diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-06 04:49:25 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-06 04:49:25 +0000 |
commit | dc92cc5ad2d89036502585cf05426012b1f8647e (patch) | |
tree | 6d26af5068750baaefca2cad7e5de482e3144a15 | |
parent | 10fd55482a520d4d8ff42466eb6d257332c428dd (diff) | |
download | uClibc-alpine-dc92cc5ad2d89036502585cf05426012b1f8647e.tar.bz2 uClibc-alpine-dc92cc5ad2d89036502585cf05426012b1f8647e.tar.xz |
Missed a couple of files from the merge. Well, a nice wasted evening where no development got done because I keep having to sync up. Tomorrow, I am going to start checking NPTL into mainline. I have had enough.
-rw-r--r-- | include/libc-internal.h | 47 | ||||
-rw-r--r-- | include/string.h | 52 |
2 files changed, 49 insertions, 50 deletions
diff --git a/include/libc-internal.h b/include/libc-internal.h index 11e020ee1..469f5eba5 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -22,9 +22,9 @@ /* Some nice features only work properly with ELF */ #if defined __HAVE_ELF__ /* Define ALIASNAME as a weak alias for NAME. */ -# define weak_alias(name, aliasname) _weak_alias (name, aliasname) -# define _weak_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); +# define weak_alias(name, aliasname) _weak_alias (name, aliasname) +# define _weak_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); /* Define ALIASNAME as a strong alias for NAME. */ # define strong_alias(name, aliasname) _strong_alias(name, aliasname) # define _strong_alias(name, aliasname) \ @@ -35,21 +35,21 @@ # define weak_const_function __attribute__ ((weak, __const__)) /* Tacking on "\n\t#" to the section name makes gcc put it's bogus * section attributes on what looks like a comment to the assembler. */ -# if defined(__cris__) -# define link_warning(symbol, msg) -# else -# define link_warning(symbol, msg) \ +# if defined(__cris__) +# define link_warning(symbol, msg) +# else +# define link_warning(symbol, msg) \ asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \ static const char __evoke_link_warning_##symbol[] \ __attribute__ ((unused, section (".gnu.warning." #symbol "\n\t#"))) = msg; -#endif +# endif #else /* !defined __HAVE_ELF__ */ -# define strong_alias(name, aliasname) _strong_alias (name, aliasname) -# define weak_alias(name, aliasname) _strong_alias (name, aliasname) -# define _strong_alias(name, aliasname) \ +# define strong_alias(name, aliasname) _strong_alias (name, aliasname) +# define weak_alias(name, aliasname) _strong_alias (name, aliasname) +# define _strong_alias(name, aliasname) \ __asm__(".global " __C_SYMBOL_PREFIX__ #aliasname "\n" \ ".set " __C_SYMBOL_PREFIX__ #aliasname "," __C_SYMBOL_PREFIX__ #name); -# define link_warning(symbol, msg) \ +# define link_warning(symbol, msg) \ asm (".stabs \"" msg "\",30,0,0,0\n\t" \ ".stabs \"" #symbol "\",1,0,0,0\n"); #endif @@ -97,6 +97,7 @@ #else # define attribute_hidden #endif +#define hidden_def(name) extern __typeof (name) name attribute_hidden; #ifdef __UCLIBC_BUILD_RELRO__ # define attribute_relro __attribute__ ((section (".data.rel.ro"))) @@ -155,6 +156,10 @@ extern char *__strdup (__const char *__s) attribute_hidden; extern ssize_t __read(int __fd, void *__buf, size_t __nbytes) attribute_hidden; extern ssize_t __write(int __fd, __const void *__buf, size_t __n) attribute_hidden; extern int __close(int __fd) attribute_hidden; +extern __pid_t __getpid (void) attribute_hidden; + +/* #include <stdlib.h> */ +extern char *__getenv (__const char *__name) attribute_hidden; /* #include <signal.h> */ extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set, @@ -169,15 +174,15 @@ extern int __gettimeofday(struct timeval *__restrict __tv, *__restrict __timezon # define gettimeofday __gettimeofday # endif -# elif IS_IN_libpthread - -# define gettimeofday __libc_gettimeofday - -# else - -# define open __libc_open +/* #include <pthread.h> */ +# ifndef __UCLIBC_HAS_THREADS__ +# define __pthread_mutex_init(mutex, mutexattr) ((void)0) +# define __pthread_mutex_lock(mutex) ((void)0) +# define __pthread_mutex_trylock(mutex) ((void)0) +# define __pthread_mutex_unlock(mutex) ((void)0) +# endif -# endif -#endif +# endif /* IS_IN_libc */ +#endif /* __ASSEMBLER__ */ #endif /* _LIBC_INTERNAL_H */ diff --git a/include/string.h b/include/string.h index ea59d94ed..a98248c96 100644 --- a/include/string.h +++ b/include/string.h @@ -111,8 +111,7 @@ extern size_t strxfrm (char *__restrict __dest, __THROW __nonnull ((2)); __END_NAMESPACE_STD -#ifdef __UCLIBC_HAS_XLOCALE__ -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__ /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ @@ -121,17 +120,10 @@ __END_NAMESPACE_STD /* Compare the collated forms of S1 and S2 using rules from L. */ extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); -extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) - __THROW __attribute_pure__ __nonnull ((1, 2, 3)); - /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) __THROW __nonnull ((2, 4)); -extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n, - __locale_t __l) __THROW __nonnull ((2, 4)); - #endif -#endif /* __UCLIBC_HAS_XLOCALE__ */ #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Duplicate S, returning an identical malloc'd string. */ @@ -210,10 +202,12 @@ __END_NAMESPACE_STD /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ +#if 0 /* uClibc: disabled */ extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); +#endif #if defined __USE_POSIX || defined __USE_MISC extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) @@ -236,9 +230,11 @@ extern void *memmem (__const void *__haystack, size_t __haystacklen, /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ +#if 0 /* uClibc: disabled */ extern void *__mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); +#endif extern void *mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); @@ -263,12 +259,6 @@ __BEGIN_NAMESPACE_STD /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror (int __errnum) __THROW; __END_NAMESPACE_STD - -extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); -extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) - __THROW __nonnull ((2)); - #if defined __USE_XOPEN2K || defined __USE_MISC /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string @@ -280,8 +270,10 @@ extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) # if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ -# ifdef __REDIRECT -extern int __REDIRECT (strerror_r, +extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) + __THROW __nonnull ((2)); +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull ((2)); # else @@ -290,8 +282,10 @@ extern int __REDIRECT (strerror_r, # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ -# ifdef __REDIRECT -extern char * __REDIRECT (strerror_r, +extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) + __THROW __nonnull ((2)); +# ifdef __REDIRECT_NTH +extern char * __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), __glibc_strerror_r) __nonnull ((2)); # else @@ -302,7 +296,9 @@ extern char * __REDIRECT (strerror_r, /* We define this function always since `bzero' is sometimes needed when the namespace rules does not allow this. */ +#if 0 /* uClibc: disabled */ extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1)); +#endif #ifdef __USE_BSD /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ @@ -330,7 +326,7 @@ extern int ffs (int __i) __THROW __attribute__ ((__const__)); /* The following two functions are non-standard but necessary for non-32 bit platforms. */ -# ifdef __USE_GNU +#if 0 /*def __USE_GNU*/ extern int ffsl (long int __l) __THROW __attribute__ ((__const__)); # ifdef __GNUC__ __extension__ extern int ffsll (long long int __ll) @@ -347,25 +343,17 @@ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif /* Use BSD. */ -#ifdef __UCLIBC_HAS_XLOCALE__ -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__ /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); -extern int __strcasecmp_l (__const char *__s1, __const char *__s2, - __locale_t __loc) - __THROW __attribute_pure__ __nonnull ((1, 2, 3)); extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 4)); -extern int __strncasecmp_l (__const char *__s1, __const char *__s2, - size_t __n, __locale_t __loc) - __THROW __attribute_pure__ __nonnull ((1, 2, 4)); #endif -#endif /* __UCLIBC_HAS_XLOCALE__ */ #ifdef __USE_BSD /* Return the next DELIM-delimited token from *STRINGP, @@ -377,23 +365,29 @@ extern char *strsep (char **__restrict __stringp, #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ +#if 0 extern int strverscmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); +#endif /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +#if 0 /* uClibc: disabled */ extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) __THROW __nonnull ((1, 2)); +#endif extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ +#if 0 /* uClibc: disabled */ extern char *__stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); +#endif extern char *stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); |