diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-07 16:09:49 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-07 16:09:49 +0000 |
commit | 53b5f21c9c453ff74c9aabdecd166a5e6ddb202b (patch) | |
tree | 7e94f2193471512a521b3675b28a27b829a43707 /libc/misc | |
parent | 746d0019f275acc0d3752b54e8ae1930a2f5fa3c (diff) |
Hide more
Diffstat (limited to 'libc/misc')
-rw-r--r-- | libc/misc/ftw/ftw.c | 1 | ||||
-rw-r--r-- | libc/misc/mntent/mntent.c | 11 | ||||
-rw-r--r-- | libc/misc/regex/regex.c | 1 | ||||
-rw-r--r-- | libc/misc/regex/regex_old.c | 1 | ||||
-rw-r--r-- | libc/misc/statfs/internal_statvfs.c | 15 | ||||
-rw-r--r-- | libc/misc/time/time.c | 12 | ||||
-rw-r--r-- | libc/misc/utmp/utent.c | 47 | ||||
-rw-r--r-- | libc/misc/wchar/wstdio.c | 1 | ||||
-rw-r--r-- | libc/misc/wordexp/wordexp.c | 2 |
9 files changed, 52 insertions, 39 deletions
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index 6bd36d749..09a87e4be 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -26,6 +26,7 @@ #define tsearch __tsearch #define tdestroy __tdestroy #define fchdir __fchdir +#define getcwd __getcwd #define _GNU_SOURCE #include <features.h> diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index 35767280e..81575a679 100644 --- a/libc/misc/mntent/mntent.c +++ b/libc/misc/mntent/mntent.c @@ -14,7 +14,7 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; #define UNLOCK __pthread_mutex_unlock(&mylock) /* Reentrant version of getmntent. */ -struct mntent *getmntent_r (FILE *filep, +struct mntent attribute_hidden *__getmntent_r (FILE *filep, struct mntent *mnt, char *buff, int bufsize) { char *cp, *ptrptr; @@ -61,6 +61,7 @@ struct mntent *getmntent_r (FILE *filep, return mnt; } +strong_alias(__getmntent_r,getmntent_r) struct mntent *getmntent(FILE * filep) { @@ -75,7 +76,7 @@ struct mntent *getmntent(FILE * filep) abort(); } - tmp = getmntent_r(filep, &mnt, buff, BUFSIZ); + tmp = __getmntent_r(filep, &mnt, buff, BUFSIZ); UNLOCK; return(tmp); } @@ -97,14 +98,16 @@ char *hasmntopt(const struct mntent *mnt, const char *opt) return strstr(mnt->mnt_opts, opt); } -FILE *setmntent(const char *name, const char *mode) +FILE attribute_hidden *__setmntent(const char *name, const char *mode) { return fopen(name, mode); } +strong_alias(__setmntent,setmntent) -int endmntent(FILE * filep) +int attribute_hidden __endmntent(FILE * filep) { if (filep != NULL) fclose(filep); return 1; } +strong_alias(__endmntent,endmntent) diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c index 0eefa85c9..5220ba57c 100644 --- a/libc/misc/regex/regex.c +++ b/libc/misc/regex/regex.c @@ -33,6 +33,7 @@ #ifdef __UCLIBC_HAS_WCHAR__ #define RE_ENABLE_I18N #define wcscoll __wcscoll +#define wcrtomb __wcrtomb #define mbrtowc __mbrtowc #define iswctype __iswctype #define iswlower __iswlower diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index ab471ee1e..1f9d37780 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -29,6 +29,7 @@ /* for some reason this does not work */ #define memcpy __memcpy #define mbrtowc __mbrtowc +#define wcrtomb __wcrtomb #define wcscoll __wcscoll #define iswctype __iswctype #define iswalnum __iswalnum diff --git a/libc/misc/statfs/internal_statvfs.c b/libc/misc/statfs/internal_statvfs.c index 8f7e386c4..4e25edc3f 100644 --- a/libc/misc/statfs/internal_statvfs.c +++ b/libc/misc/statfs/internal_statvfs.c @@ -17,6 +17,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +extern FILE *__setmntent (__const char *__file, __const char *__mode) __THROW attribute_hidden; +extern struct mntent *__getmntent_r (FILE *__restrict __stream, + struct mntent *__restrict __result, + char *__restrict __buffer, + int __bufsize) __THROW attribute_hidden; +extern int __endmntent (FILE *__stream) __THROW attribute_hidden; + /* Now fill in the fields we have information for. */ buf->f_bsize = fsbuf.f_bsize; /* Linux does not support f_frsize, so set it to the full block size. */ @@ -57,15 +64,15 @@ struct mntent mntbuf; FILE *mtab; - mtab = setmntent ("/proc/mounts", "r"); + mtab = __setmntent ("/proc/mounts", "r"); if (mtab == NULL) - mtab = setmntent (_PATH_MOUNTED, "r"); + mtab = __setmntent (_PATH_MOUNTED, "r"); if (mtab != NULL) { char tmpbuf[1024]; - while (getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) + while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) { struct stat fsst; @@ -102,7 +109,7 @@ } /* Close the file. */ - endmntent (mtab); + __endmntent (mtab); } __set_errno (save_errno); diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 4d47cd745..59b3ef641 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -145,6 +145,8 @@ #include <locale.h> #include <bits/uClibc_uintmaxtostr.h> +extern void __tzset (void) __THROW attribute_hidden; + #ifdef __UCLIBC_HAS_XLOCALE__ #include <xlocale.h> extern int __strncasecmp_l (__const char *__s1, __const char *__s2, @@ -563,7 +565,7 @@ struct tm attribute_hidden *__localtime_r(register const time_t *__restrict time { TZLOCK; - tzset(); + __tzset(); __time_localtime_tzi(timer, result, _time_tzinfo); @@ -989,7 +991,7 @@ size_t attribute_hidden __UCXL(strftime)(char *__restrict s, size_t maxsize, unsigned char mod; unsigned char code; - tzset(); /* We'll, let's get this out of the way. */ + __tzset(); /* We'll, let's get this out of the way. */ lvl = 0; p = format; @@ -1800,7 +1802,7 @@ static char *read_TZ_file(char *buf) #endif /* __UCLIBC_HAS_TZ_FILE__ */ -void tzset(void) +void attribute_hidden __tzset(void) { register const char *e; register char *s; @@ -1987,7 +1989,7 @@ void tzset(void) #endif TZUNLOCK; } - +strong_alias(__tzset,tzset) #endif /**********************************************************************/ /* #ifdef L_utime */ @@ -2189,7 +2191,7 @@ time_t attribute_hidden _time_mktime(struct tm *timeptr, int store_on_success) TZLOCK; - tzset(); + __tzset(); t = _time_mktime_tzi(timeptr, store_on_success, _time_tzinfo); diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index e03d4528f..374b53b93 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -37,29 +37,7 @@ static struct utmp static_utmp; static const char default_file_name[] = _PATH_UTMP; static const char *static_ut_name = (const char *) default_file_name; - - -static struct utmp *__getutent(int utmp_fd) - -{ - if (utmp_fd == -1) { - setutent(); - } - if (utmp_fd == -1) { - return NULL; - } - - LOCK; - if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp)) - { - return NULL; - } - - UNLOCK; - return &static_utmp; -} - -void setutent(void) +void attribute_hidden __setutent(void) { int ret; @@ -87,6 +65,26 @@ bummer: UNLOCK; return; } +strong_alias(__setutent,setutent) + +static struct utmp *__getutent(int utmp_fd) +{ + if (utmp_fd == -1) { + __setutent(); + } + if (utmp_fd == -1) { + return NULL; + } + + LOCK; + if (__read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp)) + { + return NULL; + } + + UNLOCK; + return &static_utmp; +} void endutent(void) { @@ -148,8 +146,6 @@ struct utmp *getutline(const struct utmp *utmp_entry) return NULL; } -extern struct utmp *__getutid (__const struct utmp *__id) attribute_hidden; - struct utmp *pututline (const struct utmp *utmp_entry) { LOCK; @@ -190,4 +186,3 @@ int utmpname (const char *new_ut_name) UNLOCK; return 0; } - diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c index 6d4c2732f..b0f259001 100644 --- a/libc/misc/wchar/wstdio.c +++ b/libc/misc/wchar/wstdio.c @@ -52,6 +52,7 @@ #define wcslen __wcslen #define wcsrtombs __wcsrtombs #define mbrtowc __mbrtowc +#define wcrtomb __wcrtomb #define _GNU_SOURCE #include <stdio.h> diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c index 7cac06f69..d8bf785d3 100644 --- a/libc/misc/wordexp/wordexp.c +++ b/libc/misc/wordexp/wordexp.c @@ -27,6 +27,8 @@ #define waitpid __waitpid #define kill __kill #define getuid __getuid +#define getpwnam_r __getpwnam_r +#define getpwuid_r __getpwuid_r #define execve __execve #define dup2 __dup2 |