summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-08 15:04:23 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-08 15:04:23 +0000
commitafdecae49f81065952da43bb2629fcdb64aad535 (patch)
tree6812f3969a0dc88c8ef60bbbeb41e4a78c064cda /libc/misc
parentceca97e8eaee5878711eb2c2047859e4ced79be0 (diff)
Use internal versions
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/dirent/dirfd.c3
-rw-r--r--libc/misc/dirent/scandir.c2
-rw-r--r--libc/misc/dirent/scandir64.c2
-rw-r--r--libc/misc/fnmatch/fnmatch.c11
-rw-r--r--libc/misc/ftw/ftw.c5
-rw-r--r--libc/misc/glob/glob.c10
-rw-r--r--libc/misc/internals/tempname.c2
-rw-r--r--libc/misc/mntent/mntent.c1
-rw-r--r--libc/misc/regex/regex_old.c5
-rw-r--r--libc/misc/time/ftime.c2
-rw-r--r--libc/misc/time/time.c12
-rw-r--r--libc/misc/utmp/wtent.c2
-rw-r--r--libc/misc/wordexp/wordexp.c6
13 files changed, 46 insertions, 17 deletions
diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c
index b658b5a9c..48e955450 100644
--- a/libc/misc/dirent/dirfd.c
+++ b/libc/misc/dirent/dirfd.c
@@ -2,7 +2,7 @@
#include <errno.h>
#include "dirstream.h"
-int dirfd(DIR * dir)
+int attribute_hidden __dirfd(DIR * dir)
{
if (!dir || dir->dd_fd == -1) {
__set_errno(EBADF);
@@ -11,3 +11,4 @@ int dirfd(DIR * dir)
return dir->dd_fd;
}
+strong_alias(__dirfd,dirfd)
diff --git a/libc/misc/dirent/scandir.c b/libc/misc/dirent/scandir.c
index e80df58dc..cc76bed5e 100644
--- a/libc/misc/dirent/scandir.c
+++ b/libc/misc/dirent/scandir.c
@@ -21,6 +21,8 @@
*/
#define qsort __qsort
+#define opendir __opendir
+#define closedir __closedir
#include <dirent.h>
#include <stdio.h>
diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c
index 46b6d5cef..377f55fe6 100644
--- a/libc/misc/dirent/scandir64.c
+++ b/libc/misc/dirent/scandir64.c
@@ -21,6 +21,8 @@
*/
#define qsort __qsort
+#define opendir __opendir
+#define closedir __closedir
#include <features.h>
#ifdef __UCLIBC_HAS_LFS__
diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c
index 11bb3a112..44f1431c8 100644
--- a/libc/misc/fnmatch/fnmatch.c
+++ b/libc/misc/fnmatch/fnmatch.c
@@ -49,16 +49,9 @@ Cambridge, MA 02139, USA. */
# define ISUPPER(c) (ISASCII (c) && isupper (c))
-# ifndef errno
-extern int errno;
-# endif
-
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
-int fnmatch(pattern, string, flags)
-const char *pattern;
-const char *string;
-int flags;
+int attribute_hidden __fnmatch(const char *pattern, const char *string, int flags)
{
register const char *p = pattern, *n = string;
register char c;
@@ -228,5 +221,5 @@ int flags;
# undef FOLD
}
-
+strong_alias(__fnmatch,fnmatch)
#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index 09a87e4be..30009def9 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -25,8 +25,13 @@
#define stpcpy __stpcpy
#define tsearch __tsearch
#define tdestroy __tdestroy
+#define tfind __tfind
#define fchdir __fchdir
+#define chdir __chdir
+#define dirfd __dirfd
#define getcwd __getcwd
+#define opendir __opendir
+#define closedir __closedir
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c
index 3fc20dbc2..d4a0b67ca 100644
--- a/libc/misc/glob/glob.c
+++ b/libc/misc/glob/glob.c
@@ -18,6 +18,7 @@ Cambridge, MA 02139, USA. */
#define strrchr __strrchr
#define strcoll __strcoll
#define qsort __qsort
+#define fnmatch __fnmatch
#include <features.h>
#include <stdlib.h>
@@ -32,6 +33,9 @@ Cambridge, MA 02139, USA. */
#define _GNU_SOURCE
#include <glob.h>
+extern DIR *__opendir (__const char *__name) __nonnull ((1)) attribute_hidden;
+extern int __closedir (DIR *__dirp) __nonnull ((1)) attribute_hidden;
+
extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory));
extern void (*__glob_closedir_hook) __P ((__ptr_t stream));
extern const char *(*__glob_readdir_hook) __P ((__ptr_t stream));
@@ -397,7 +401,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
int meta;
stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
- : (__ptr_t) opendir (directory));
+ : (__ptr_t) __opendir (directory));
if (stream == NULL)
{
if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
@@ -497,7 +501,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
if (__glob_closedir_hook)
(*__glob_closedir_hook) (stream);
else
- (void) closedir ((DIR *) stream);
+ (void) __closedir ((DIR *) stream);
errno = save;
}
return nfound == 0 ? GLOB_NOMATCH : 0;
@@ -508,7 +512,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
if (__glob_closedir_hook)
(*__glob_closedir_hook) (stream);
else
- (void) closedir ((DIR *) stream);
+ (void) __closedir ((DIR *) stream);
errno = save;
}
while (names != NULL)
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index 99a8ac0d8..53500a7a6 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -32,6 +32,8 @@
*/
#define open64 __open64
+#define mkdir __mkdir
+#define gettimeofday __gettimeofday
#include <stddef.h>
#include <stdint.h>
diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c
index 81575a679..7e9febb1f 100644
--- a/libc/misc/mntent/mntent.c
+++ b/libc/misc/mntent/mntent.c
@@ -1,5 +1,6 @@
#define strtok_r __strtok_r
#define strstr __strstr
+#define atoi __atoi
#include <stdio.h>
#include <stdlib.h>
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 1f9d37780..c86835e17 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -31,6 +31,7 @@
#define mbrtowc __mbrtowc
#define wcrtomb __wcrtomb
#define wcscoll __wcscoll
+#define wctype __wctype
#define iswctype __iswctype
#define iswalnum __iswalnum
@@ -5166,7 +5167,7 @@ PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range,
wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL;
/* We need the size of wchar_t buffers correspond to csize1, csize2. */
int wcs_size1 = 0, wcs_size2 = 0;
- /* offset buffer for optimizatoin. See convert_mbs_to_wc. */
+ /* offset buffer for optimization. See convert_mbs_to_wc. */
int *mbs_offset1 = NULL, *mbs_offset2 = NULL;
/* They hold whether each wchar_t is binary data or not. */
char *is_binary = NULL;
@@ -5696,7 +5697,7 @@ wcs_re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos,
wchar_t *string1, *string2;
/* We need the size of wchar_t buffers correspond to csize1, csize2. */
int size1, size2;
- /* offset buffer for optimizatoin. See convert_mbs_to_wc. */
+ /* offset buffer for optimization. See convert_mbs_to_wc. */
int *mbs_offset1, *mbs_offset2;
#else /* BYTE */
static int
diff --git a/libc/misc/time/ftime.c b/libc/misc/time/ftime.c
index 24789c9eb..904763241 100644
--- a/libc/misc/time/ftime.c
+++ b/libc/misc/time/ftime.c
@@ -16,6 +16,8 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define gettimeofday __gettimeofday
+
#include <sys/timeb.h>
#include <sys/time.h>
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 59b3ef641..85a96f003 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -130,6 +130,7 @@
*/
#define strnlen __strnlen
+#define gettimeofday __gettimeofday
#define _GNU_SOURCE
#include <stdio.h>
@@ -147,8 +148,15 @@
extern void __tzset (void) __THROW attribute_hidden;
+extern long int __strtol (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __THROW __nonnull ((1)) __wur attribute_hidden;
+
#ifdef __UCLIBC_HAS_XLOCALE__
#include <xlocale.h>
+extern long int __strtol_l (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base,
+ __locale_t __loc) __THROW __nonnull ((1, 4)) __wur attribute_hidden;
extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
size_t __n, __locale_t __loc)
__THROW __attribute_pure__ __nonnull ((1, 2, 4)) attribute_hidden;
@@ -1544,9 +1552,9 @@ char attribute_hidden *__UCXL(strptime)(const char *__restrict buf, const char *
__set_errno(0);
if (!ISSPACE(*buf)) { /* Signal an error if whitespace. */
#ifdef TIME_T_IS_UNSIGNED
- t = __XL(strtoul)(buf, &o, 10 __LOCALE_ARG);
+ t = __UCXL(strtoul)(buf, &o, 10 __LOCALE_ARG);
#else
- t = __XL(strtol)(buf, &o, 10 __LOCALE_ARG);
+ t = __UCXL(strtol)(buf, &o, 10 __LOCALE_ARG);
#endif
}
if ((o == buf) || errno) { /* Not a number or overflow. */
diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c
index 0900ef379..bfedeaa70 100644
--- a/libc/misc/utmp/wtent.c
+++ b/libc/misc/utmp/wtent.c
@@ -17,6 +17,8 @@
* write to the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge, MA 02139, USA. */
+#define gettimeofday __gettimeofday
+
#include <string.h>
#include <sys/time.h>
#include <time.h>
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index d8bf785d3..8c54f8fc2 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/libc/misc/wordexp/wordexp.c
@@ -31,6 +31,12 @@
#define getpwuid_r __getpwuid_r
#define execve __execve
#define dup2 __dup2
+#define atoi __atoi
+#define fnmatch __fnmatch
+#if 0
+#define glob __glob
+#define globfree __globfree
+#endif
#define _GNU_SOURCE
#include <sys/cdefs.h>