diff options
Diffstat (limited to 'include/libc-internal.h')
-rw-r--r-- | include/libc-internal.h | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/include/libc-internal.h b/include/libc-internal.h index feb27b812..03f17dd43 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -19,6 +19,8 @@ #ifndef _LIBC_INTERNAL_H #define _LIBC_INTERNAL_H 1 +#include <features.h> + /* Some nice features only work properly with ELF */ #if defined __HAVE_ELF__ /* Define ALIASNAME as a weak alias for NAME. */ @@ -66,6 +68,9 @@ /* On some platforms we can make internal function calls (i.e., calls of functions not exported) a bit faster by using a different calling convention. */ +#if 0 /*def __i386__*/ +# define internal_function __attribute__ ((regparm (3), stdcall)) +#endif #ifndef internal_function # define internal_function /* empty */ #endif @@ -91,6 +96,8 @@ # define __cast__(_to) #endif +#define attribute_unused __attribute__ ((unused)) + /* Arrange to hide uClibc internals */ #if __GNUC_PREREQ (3, 3) # define attribute_hidden __attribute__ ((visibility ("hidden"))) @@ -98,6 +105,14 @@ # define attribute_hidden #endif #define hidden_def(name) extern __typeof (name) name attribute_hidden; +/* Define ALIASNAME as a hidden weak alias for NAME. */ +# define hidden_weak_alias(name, aliasname) _hidden_weak_alias (name, aliasname) +# define _hidden_weak_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) __attribute__ ((visibility ("hidden"))); +/* Define ALIASNAME as a hidden strong alias for NAME. */ +# define hidden_strong_alias(name, aliasname) _hidden_strong_alias(name, aliasname) +# define _hidden_strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))) __attribute__ ((visibility ("hidden"))); #ifdef __UCLIBC_BUILD_RELRO__ # define attribute_relro __attribute__ ((section (".data.rel.ro"))) @@ -142,9 +157,6 @@ typedef __ssize_t ssize_t; # include <bits/sigset.h> -/* sources are built w/ _GNU_SOURCE, this gets undefined */ -extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen); - /* prototypes for internal use, please keep these in sync w/ updated headers */ /* #include <fcntl.h> */ extern int __open(__const char *__file, int __oflag, ...) attribute_hidden; @@ -167,6 +179,10 @@ extern char *__strdup (__const char *__s) attribute_hidden; extern int __strcasecmp (__const char *__s1, __const char *__s2) attribute_hidden; extern int __strncasecmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden; +/* sources are built w/ _GNU_SOURCE, this gets undefined */ +extern int __xpg_strerror_r_internal (int __errnum, char *__buf, size_t __buflen) attribute_hidden; +extern char *__glibc_strerror_r_internal (int __errnum, char *__buf, size_t __buflen) attribute_hidden; + /* #include <unistd.h> */ 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; @@ -175,6 +191,12 @@ extern __pid_t __getpid (void) attribute_hidden; /* #include <stdio.h> */ extern void __perror (__const char *__s) attribute_hidden; +extern int __printf (__const char *__restrict __format, ...) attribute_hidden; +extern int __sprintf (char *__restrict __s, + __const char *__restrict __format, ...) attribute_hidden; +/* hack */ +#define fprintf __fprintf +#define fclose __fclose /* #include <stdlib.h> */ extern char *__getenv (__const char *__name) attribute_hidden; @@ -183,13 +205,29 @@ extern char *__getenv (__const char *__name) attribute_hidden; extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set, __sigset_t *__restrict __oset) attribute_hidden; -/* #include <sys/time.h> */ +/* #include <sys/ioctl.h> */ +extern int __ioctl (int __fd, unsigned long int __request, ...) attribute_hidden; + +/* #include <sys/socket.h> */ +extern int __socket (int __domain, int __type, int __protocol) attribute_hidden; + # if 0 /* undoable here */ +/* #include <dirent.h> */ +typedef struct __dirstream DIR; +extern DIR *__opendir (__const char *__name) attribute_hidden; +extern int __closedir (DIR *__dirp) attribute_hidden; + +/* #include <stdio.h> */ +extern int __vfprintf (FILE *__restrict __s, __const char *__restrict __format, + __gnuc_va_list __arg) attribute_hidden; +extern int __fprintf (FILE *__restrict __stream, + __const char *__restrict __format, ...) attribute_hidden; +extern int __fclose (FILE *__stream) attribute_hidden; + +/* #include <sys/time.h> */ # define __need_timeval # include <bits/time.h> extern int __gettimeofday(struct timeval *__restrict __tv, *__restrict __timezone__ptr_t __tz) attribute_hidden; -# else -# define gettimeofday __gettimeofday # endif /* #include <pthread.h> */ |