Add exported libsudo_util functions to util.exp and mark in headers

using __dso_public.
This commit is contained in:
Todd C. Miller
2014-06-26 15:51:15 -06:00
parent 87c2fe5a31
commit 088edcb6f5
44 changed files with 537 additions and 295 deletions

View File

@@ -247,7 +247,7 @@
* Simple isblank() macro and function for systems without it.
*/
#ifndef HAVE_ISBLANK
int isblank(int);
__dso_public int isblank(int);
# define isblank(_x) ((_x) == ' ' || (_x) == '\t')
#endif
@@ -309,7 +309,7 @@ typedef struct sigaction sigaction_t;
extern const char *__progname;
# define getprogname() (__progname)
# else
const char *getprogname(void);
__dso_public const char *getprogname(void);
# endif /* HAVE___PROGNAME */
#endif /* !HAVE_GETPROGNAME */
@@ -372,102 +372,102 @@ struct timeval;
struct timespec;
#ifndef HAVE_CLOSEFROM
void sudo_closefrom(int);
__dso_public void sudo_closefrom(int);
# undef closefrom
# define closefrom(_a) sudo_closefrom((_a))
#endif /* HAVE_CLOSEFROM */
#ifndef HAVE_GETCWD
char *sudo_getcwd(char *, size_t size);
__dso_public char *sudo_getcwd(char *, size_t size);
# undef getcwd
# define getcwd(_a, _b) sudo_getcwd((_a), (_b))
#endif /* HAVE_GETCWD */
#ifndef HAVE_GETGROUPLIST
int sudo_getgrouplist(const char *, gid_t, gid_t *, int *);
__dso_public int sudo_getgrouplist(const char *, gid_t, gid_t *, int *);
# undef getgrouplist
# define getgrouplist(_a, _b, _c, _d) sudo_getgrouplist((_a), (_b), (_c), (_d))
#endif /* GETGROUPLIST */
#ifndef HAVE_GETLINE
ssize_t sudo_getline(char **, size_t *, FILE *);
__dso_public ssize_t sudo_getline(char **, size_t *, FILE *);
# undef getline
# define getline(_a, _b, _c) sudo_getline((_a), (_b), (_c))
#endif /* HAVE_GETLINE */
#ifndef HAVE_UTIMES
int sudo_utimes(const char *, const struct timeval *);
__dso_public int sudo_utimes(const char *, const struct timeval *);
# undef utimes
# define utimes(_a, _b) sudo_utimes(((_a), (_b))
#endif /* HAVE_UTIMES */
#ifdef HAVE_FUTIME
int sudo_futimes(int, const struct timeval *);
__dso_public int sudo_futimes(int, const struct timeval *);
# undef futimes
# define futimes(_a, _b) sudo_futimes(((_a), (_b))
#endif /* HAVE_FUTIME */
#if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int sudo_snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
__dso_public int sudo_snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
# undef snprintf
# define snprintf sudo_snprintf
#endif /* HAVE_SNPRINTF */
#if !defined(HAVE_VSNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int sudo_vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
__dso_public int sudo_vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
# undef vsnprintf
# define vsnprintf sudo_vsnprintf
#endif /* HAVE_VSNPRINTF */
#if !defined(HAVE_ASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int sudo_asprintf(char **, const char *, ...) __printflike(2, 3);
__dso_public int sudo_asprintf(char **, const char *, ...) __printflike(2, 3);
# undef asprintf
# define asprintf sudo_asprintf
#endif /* HAVE_ASPRINTF */
#if !defined(HAVE_VASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
int sudo_vasprintf(char **, const char *, va_list) __printflike(2, 0);
__dso_public int sudo_vasprintf(char **, const char *, va_list) __printflike(2, 0);
# undef vasprintf
# define vasprintf sudo_vasprintf
#endif /* HAVE_VASPRINTF */
#ifndef HAVE_STRLCAT
size_t sudo_strlcat(char *, const char *, size_t);
__dso_public size_t sudo_strlcat(char *, const char *, size_t);
# undef strlcat
# define strlcat(_a, _b, _c) sudo_strlcat((_a), (_b), (_c))
#endif /* HAVE_STRLCAT */
#ifndef HAVE_STRLCPY
size_t sudo_strlcpy(char *, const char *, size_t);
__dso_public size_t sudo_strlcpy(char *, const char *, size_t);
# undef strlcpy
# define strlcpy(_a, _b, _c) sudo_strlcpy((_a), (_b), (_c))
#endif /* HAVE_STRLCPY */
#ifndef HAVE_MEMRCHR
void *sudo_memrchr(const void *, int, size_t);
__dso_public void *sudo_memrchr(const void *, int, size_t);
# undef memrchr
# define memrchr(_a, _b, _c) sudo_memrchr((_a), (_b), (_c))
#endif /* HAVE_MEMRCHR */
#ifndef HAVE_MEMSET_S
errno_t sudo_memset_s(void *, rsize_t, int, rsize_t);
__dso_public errno_t sudo_memset_s(void *, rsize_t, int, rsize_t);
# undef memset_s
# define memset_s(_a, _b, _c, _d) sudo_memset_s((_a), (_b), (_c), (_d))
#endif /* HAVE_MEMSET_S */
#ifndef HAVE_MKDTEMP
char *sudo_mkdtemp(char *);
__dso_public char *sudo_mkdtemp(char *);
# undef mkdtemp
# define mkdtemp(_a) sudo_mkdtemp((_a))
#endif /* HAVE_MKDTEMP */
#ifndef HAVE_MKSTEMPS
int mkstemps(char *, int);
__dso_public int sudo_mkstemps(char *, int);
# undef mkstemps
# define mkstemps(_a, _b) sudo_mkstemps((_a), (_b))
#endif /* HAVE_MKSTEMPS */
#ifndef HAVE_PW_DUP
struct passwd *sudo_pw_dup(const struct passwd *);
__dso_public struct passwd *sudo_pw_dup(const struct passwd *);
# undef pw_dup
# define pw_dup(_a) sudo_pw_dup((_a))
#endif /* HAVE_PW_DUP */
#ifndef HAVE_STRSIGNAL
char *sudo_strsignal(int);
__dso_public char *sudo_strsignal(int);
# undef strsignal
# define strsignal(_a) sudo_strsignal((_a))
#endif /* HAVE_STRSIGNAL */
#ifndef HAVE_SIG2STR
int sudo_sig2str(int, char *);
__dso_public int sudo_sig2str(int, char *);
# undef sig2str
# define sig2str(_a, _b) sudo_sig2str((_a), (_b))
#endif /* HAVE_SIG2STR */
#ifndef HAVE_STRTONUM
long long sudo_strtonum(const char *, long long, long long, const char **);
__dso_public long long sudo_strtonum(const char *, long long, long long, const char **);
# undef strtonum
# define strtonum(_a, _b, _c, _d) sudo_strtonum((_a), (_b), (_c), (_d))
#endif /* HAVE_STRTONUM */
@@ -476,12 +476,12 @@ long long sudo_strtonum(const char *, long long, long long, const char **);
# ifdef __MACH__
# define CLOCK_MONOTONIC 1
# endif
int sudo_clock_gettime(clockid_t clock_id, struct timespec *tp);
__dso_public int sudo_clock_gettime(clockid_t clock_id, struct timespec *tp);
# undef clock_gettime
# define clock_gettime(_a, _b) sudo_clock_gettime((_a), (_b))
#endif /* HAVE_CLOCK_GETTIME */
#ifndef HAVE_INET_PTON
int sudo_inet_pton(int af, const char *src, void *dst);
__dso_public int sudo_inet_pton(int af, const char *src, void *dst);
# undef inet_pton
# define inet_pton(_a, _b, _c) sudo_inet_pton((_a), (_b), (_c))
#endif /* HAVE_INET_PTON */