From 3134156779108fe8b46e0f4cd60d837572faaa93 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 25 Feb 2012 23:18:39 -0500 Subject: First steps to get conformtest fully working --- include/aio.h | 2 ++ include/assert.h | 4 +++- include/ctype.h | 6 +++++- include/dirent.h | 4 +++- include/dlfcn.h | 2 ++ include/fcntl.h | 2 ++ include/fnmatch.h | 2 ++ include/glob.h | 2 ++ include/grp.h | 2 ++ include/libio.h | 2 ++ include/locale.h | 2 ++ include/math.h | 2 ++ include/net/if.h | 2 ++ include/netdb.h | 2 ++ include/netinet/in.h | 2 ++ include/pthread.h | 2 ++ include/pwd.h | 2 ++ include/regex.h | 2 ++ include/sched.h | 2 ++ include/search.h | 2 ++ include/setjmp.h | 4 +++- include/signal.h | 2 ++ include/stdio.h | 8 ++++---- include/stdlib.h | 10 +++++----- include/string.h | 4 ++++ include/stropts.h | 1 + include/sys/cdefs.h | 14 ++++++++------ include/sys/mman.h | 2 ++ include/sys/msg.h | 2 ++ include/sys/resource.h | 2 ++ include/sys/select.h | 2 ++ include/sys/socket.h | 2 ++ include/sys/stat.h | 2 ++ include/sys/statvfs.h | 2 ++ include/sys/time.h | 2 ++ include/sys/times.h | 2 ++ include/sys/uio.h | 2 ++ include/sys/utsname.h | 2 ++ include/sys/wait.h | 2 ++ include/termios.h | 2 ++ include/time.h | 6 ++---- include/uchar.h | 1 + include/ulimit.h | 2 ++ include/unistd.h | 2 ++ include/utime.h | 2 ++ include/wchar.h | 2 ++ include/wctype.h | 4 ++++ include/wordexp.h | 2 ++ 48 files changed, 115 insertions(+), 23 deletions(-) create mode 100644 include/stropts.h create mode 100644 include/uchar.h (limited to 'include') diff --git a/include/aio.h b/include/aio.h index c81dae9..90c74f9 100644 --- a/include/aio.h +++ b/include/aio.h @@ -1,6 +1,7 @@ #ifndef _AIO_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern void __aio_init (const struct aioinit *__init); @@ -8,5 +9,6 @@ extern void __aio_init (const struct aioinit *__init); lio_listio and we do not issue events for each individual list element. */ #define LIO_NO_INDIVIDUAL_EVENT 128 +#endif #endif diff --git a/include/assert.h b/include/assert.h index 573eb40..d0d9259 100644 --- a/include/assert.h +++ b/include/assert.h @@ -1,5 +1,6 @@ #include +#ifndef _ISOMAC /* This prints an "Assertion failed" message and aborts. In installed assert.h this is only conditionally declared, so it has to be repeated here. */ @@ -19,7 +20,8 @@ extern void __assert_fail_base (const char *fmt, const char *assertion, const char *function) __THROW __attribute__ ((__noreturn__)); -#if !defined NOT_IN_libc || defined IS_IN_rtld +# if !defined NOT_IN_libc || defined IS_IN_rtld hidden_proto (__assert_fail) hidden_proto (__assert_perror_fail) +# endif #endif diff --git a/include/ctype.h b/include/ctype.h index 4b5abda..6a18039 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,5 +1,6 @@ #ifndef _CTYPE_H +#ifndef _ISOMAC /* Initialize ctype locale data. */ extern void __ctype_init (void); libc_hidden_proto (__ctype_init) @@ -46,9 +47,11 @@ __ctype_tolower_loc (void) } # endif /* Not NOT_IN_libc. */ +#endif -# include +#include +#ifndef _ISOMAC # if !defined __NO_CTYPE && !defined NOT_IN_libc /* The spec says that isdigit must only match the decimal digits. We can check this without a memory access. */ @@ -59,5 +62,6 @@ __ctype_tolower_loc (void) # undef __isdigit_l # define __isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; }) # endif +#endif #endif /* ctype.h */ diff --git a/include/dirent.h b/include/dirent.h index 28bf432..2e88005 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,6 +1,7 @@ #ifndef _DIRENT_H -# include # include +# ifndef _ISOMAC +# include # include # include @@ -44,5 +45,6 @@ extern void __scandir_cancel_handler (void *arg); libc_hidden_proto (rewinddir) libc_hidden_proto (scandirat) libc_hidden_proto (scandirat64) +# endif #endif diff --git a/include/dlfcn.h b/include/dlfcn.h index ae9c886..a67b2e3 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -1,5 +1,6 @@ #ifndef _DLFCN_H #include +#ifndef _ISOMAC #include /* For ElfW. */ #include @@ -146,5 +147,6 @@ extern void __libc_register_dl_open_hook (struct link_map *map) extern void __libc_register_dlfcn_hook (struct link_map *map) attribute_hidden; #endif +#endif #endif diff --git a/include/fcntl.h b/include/fcntl.h index 7afbd1c..b645ffc 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -1,6 +1,7 @@ #ifndef _FCNTL_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __open64 (const char *__file, int __oflag, ...); libc_hidden_proto (__open64) @@ -44,5 +45,6 @@ extern int __have_atfcts attribute_hidden; #ifdef O_CLOEXEC extern int __have_o_cloexec attribute_hidden; #endif +#endif #endif diff --git a/include/fnmatch.h b/include/fnmatch.h index 2cdad0a..9ef8150 100644 --- a/include/fnmatch.h +++ b/include/fnmatch.h @@ -2,6 +2,8 @@ #include +#ifndef _ISOMAC libc_hidden_proto (fnmatch) +#endif #endif diff --git a/include/glob.h b/include/glob.h index a0c0597..228fe30 100644 --- a/include/glob.h +++ b/include/glob.h @@ -1,6 +1,7 @@ #ifndef _GLOB_H #include +#ifndef _ISOMAC libc_hidden_proto (glob) libc_hidden_proto (glob64) libc_hidden_proto (globfree) @@ -11,5 +12,6 @@ extern int __glob_pattern_p (const char *__pattern, int __quote); extern int __glob64 (const char *__pattern, int __flags, int (*__errfunc) (const char *, int), glob64_t *__pglob); +#endif #endif diff --git a/include/grp.h b/include/grp.h index 9fa71ea..0fb5c9a 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,6 +1,7 @@ #ifndef _GRP_H #include +#ifndef _ISOMAC libc_hidden_proto (setgroups) /* Now define the internal interfaces. */ @@ -60,3 +61,4 @@ DECLARE_NSS_PROTOTYPES (nisplus) #undef DECLARE_NSS_PROTOTYPES #endif +#endif diff --git a/include/libio.h b/include/libio.h index 633ee51..aca7000 100644 --- a/include/libio.h +++ b/include/libio.h @@ -1,5 +1,6 @@ #include +#ifndef _ISOMAC #ifndef _LIBC_LIBIO_H #define _LIBC_LIBIO_H @@ -22,3 +23,4 @@ libc_hidden_proto (__wuflow) #endif #endif +#endif diff --git a/include/locale.h b/include/locale.h index a296a5f..8091e1d 100644 --- a/include/locale.h +++ b/include/locale.h @@ -1,6 +1,7 @@ #ifndef _LOCALE_H #include +#ifndef _ISOMAC extern __typeof (uselocale) __uselocale; libc_hidden_proto (setlocale) @@ -22,3 +23,4 @@ extern struct lconv *__localeconv (void); extern const char *__current_locale_name (int category) attribute_hidden; #endif +#endif diff --git a/include/math.h b/include/math.h index 3934880..2b040c6 100644 --- a/include/math.h +++ b/include/math.h @@ -2,6 +2,7 @@ #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __matherr (struct exception *__exc); @@ -36,3 +37,4 @@ extern int __isinf_nsf (float); extern int __isinf_nsl (long double); #endif +#endif diff --git a/include/net/if.h b/include/net/if.h index 872ab6d..1d86226 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -2,9 +2,11 @@ # include_next +#ifndef _ISOMAC libc_hidden_proto (if_nametoindex) libc_hidden_proto (if_indextoname) libc_hidden_proto (if_nameindex) libc_hidden_proto (if_freenameindex) +#endif #endif diff --git a/include/netdb.h b/include/netdb.h index 0db3579..3f2ae06 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -1,6 +1,7 @@ #ifndef _NETDB_H #include +#ifndef _ISOMAC /* Macros for accessing h_errno from inside libc. */ # undef h_errno # ifdef _LIBC_REENTRANT @@ -280,5 +281,6 @@ DECLARE_NSS_PROTOTYPES (nis) DECLARE_NSS_PROTOTYPES (nisplus) #undef DECLARE_NSS_PROTOTYPES +#endif #endif /* !_NETDB_H */ diff --git a/include/netinet/in.h b/include/netinet/in.h index 876f1a4..6fb5c86 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -2,8 +2,10 @@ #include +#ifndef _ISOMAC libc_hidden_proto (bindresvport) libc_hidden_proto (in6addr_loopback) libc_hidden_proto (in6addr_any) +#endif #endif diff --git a/include/pthread.h b/include/pthread.h index f8860bd..51854f6 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -1,4 +1,6 @@ #include_next +#ifndef _ISOMAC /* This function is called to initialize the pthread library. */ extern void __pthread_initialize (void) __attribute__ ((weak)); +#endif diff --git a/include/pwd.h b/include/pwd.h index 465c17c..bd7fecc 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,6 +1,7 @@ #ifndef _PWD_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __getpwent_r (struct passwd *__resultbuf, char *__buffer, size_t __buflen, struct passwd **__result) @@ -51,5 +52,6 @@ DECLARE_NSS_PROTOTYPES (nis) DECLARE_NSS_PROTOTYPES (nisplus) #undef DECLARE_NSS_PROTOTYPES +#endif #endif diff --git a/include/regex.h b/include/regex.h index a7606c5..fd4beef 100644 --- a/include/regex.h +++ b/include/regex.h @@ -1,6 +1,7 @@ #ifndef _REGEX_H #include +#ifndef _ISOMAC /* Document internal interfaces. */ extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax); @@ -41,3 +42,4 @@ extern size_t __regerror (int __errcode, const regex_t *__preg, extern void __regfree (regex_t *__preg); #endif +#endif diff --git a/include/sched.h b/include/sched.h index 1eae9f7..4f59397 100644 --- a/include/sched.h +++ b/include/sched.h @@ -1,6 +1,7 @@ #ifndef _SCHED_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __sched_setparam (__pid_t __pid, const struct sched_param *__param); @@ -21,3 +22,4 @@ extern int __clone (int (*__fn) (void *__arg), void *__child_stack, extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, size_t __child_stack_size, int __flags, void *__arg, ...); #endif +#endif diff --git a/include/search.h b/include/search.h index d1f3a92..cf9c343 100644 --- a/include/search.h +++ b/include/search.h @@ -1,6 +1,7 @@ #ifndef _SEARCH_H #include +#ifndef _ISOMAC libc_hidden_proto (hcreate_r) libc_hidden_proto (hdestroy_r) libc_hidden_proto (hsearch_r) @@ -17,3 +18,4 @@ extern void *__tdelete (const void *__key, void **__rootp, extern void __twalk (const void *__root, __action_fn_t action); extern void __tdestroy (void *__root, __free_fn_t freefct); #endif +#endif diff --git a/include/setjmp.h b/include/setjmp.h index 6863f51..622bb31 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -1,6 +1,7 @@ #ifndef _SETJMP_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ /* Internal machine-dependent function to restore context sans signal mask. */ @@ -16,12 +17,13 @@ extern int __sigjmp_save (jmp_buf __env, int __savemask); extern void _longjmp_unwind (jmp_buf env, int val); extern void __libc_siglongjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); + __attribute__ ((noreturn)); extern void __libc_longjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); libc_hidden_proto (__libc_longjmp) libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) +#endif #endif diff --git a/include/signal.h b/include/signal.h index 6250d30..c43f2ab 100644 --- a/include/signal.h +++ b/include/signal.h @@ -4,6 +4,7 @@ #else # include +# ifndef _ISOMAC libc_hidden_proto (sigemptyset) libc_hidden_proto (sigfillset) libc_hidden_proto (sigaddset) @@ -58,5 +59,6 @@ extern int __xpg_sigpause (int sig); /* Allocate real-time signal with highest/lowest available priority. */ extern int __libc_allocate_rtsig (int __high); +# endif #endif #endif diff --git a/include/stdio.h b/include/stdio.h index 48aa765..bd0209a 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,5 +1,5 @@ #ifndef _STDIO_H -# if defined __need_FILE || defined __need___FILE +# if defined __need_FILE || defined __need___FILE || defined _ISOMAC # include # else # include @@ -29,7 +29,7 @@ extern int __vsscanf (const char *__restrict __s, _G_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))); -#ifndef __cplusplus +# ifndef __cplusplus extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW; extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...) __THROW; @@ -51,7 +51,7 @@ extern int __obstack_printf_chk (struct obstack *, int, const char *, ...) __THROW; extern int __obstack_vprintf_chk (struct obstack *, int, const char *, _G_va_list) __THROW; -#endif +# endif extern int __isoc99_fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __wur; @@ -119,7 +119,7 @@ extern int _sys_nerr_internal attribute_hidden; extern int __asprintf_internal (char **__restrict __ptr, const char *__restrict __fmt, ...) attribute_hidden __attribute__ ((__format__ (__printf__, 2, 3))); -# if !defined NOT_IN_libc && !defined _ISOMAC +# if !defined NOT_IN_libc # define __asprintf(ptr, fmt, args...) \ INTUSE(__asprintf) (ptr, fmt, ##args) diff --git a/include/stdlib.h b/include/stdlib.h index fc9ef7f..de0b414 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -4,14 +4,14 @@ #define __Need_M_And_C #endif -#include +#ifndef _ISOMAC +# include +#endif #include /* Now define the internal interfaces. */ -#ifndef __Need_M_And_C -# ifndef _ISOMAC -# include -# endif +#if !defined __Need_M_And_C && !defined _ISOMAC +# include __BEGIN_DECLS diff --git a/include/string.h b/include/string.h index 0b49b8f..f1077f6 100644 --- a/include/string.h +++ b/include/string.h @@ -1,5 +1,6 @@ #ifndef _STRING_H +#ifndef _ISOMAC #include extern void *__memccpy (void *__dest, const void *__src, @@ -43,11 +44,13 @@ extern void *__memchr (const void *__s, int __c, size_t __n) extern int __ffs (int __i) __attribute__ ((const)); extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen); +#endif /* Now the real definitions. We do this here since some of the functions above are defined as macros in the headers. */ #include +#ifndef _ISOMAC extern __typeof (strcoll_l) __strcoll_l; extern __typeof (strxfrm_l) __strxfrm_l; extern __typeof (strcasecmp_l) __strcasecmp_l; @@ -142,5 +145,6 @@ extern char *__strcat_chk (char *__restrict __dest, extern char *__strncat_chk (char *__restrict __dest, const char *__restrict __src, size_t __len, size_t __destlen) __THROW; +#endif #endif diff --git a/include/stropts.h b/include/stropts.h new file mode 100644 index 0000000..27ab60a --- /dev/null +++ b/include/stropts.h @@ -0,0 +1 @@ +#include diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index a2bdf20..fa93982 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -2,21 +2,23 @@ #include +#ifndef _ISOMAC /* The compiler will optimize based on the knowledge the parameter is not NULL. This will omit tests. A robust implementation cannot allow this so when compiling glibc itself we ignore this attribute. */ -#undef __nonnull -#define __nonnull(params) +# undef __nonnull +# define __nonnull(params) extern void __chk_fail (void) __attribute__ ((__noreturn__)); libc_hidden_proto (__chk_fail) rtld_hidden_proto (__chk_fail) -#if __GNUC_PREREQ (4,3) -# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__))) -#else -# define __attribute_alloc_size(...) +# if __GNUC_PREREQ (4,3) +# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__))) +# else +# define __attribute_alloc_size(...) +# endif #endif #endif diff --git a/include/sys/mman.h b/include/sys/mman.h index a4687b3..0a0e4a6 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -1,6 +1,7 @@ #ifndef _SYS_MMAN_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern void *__mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset); @@ -14,5 +15,6 @@ extern void *__mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...); libc_hidden_proto (madvise); +#endif #endif diff --git a/include/sys/msg.h b/include/sys/msg.h index 03e17f9..43ec5b9 100644 --- a/include/sys/msg.h +++ b/include/sys/msg.h @@ -1,9 +1,11 @@ #ifndef _SYS_MSG_H #include +#ifndef _ISOMAC extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg); extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg); +#endif #endif diff --git a/include/sys/resource.h b/include/sys/resource.h index b4ea1ae..c35df43 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -1,6 +1,7 @@ #ifndef _SYS_RESOURCE_H #include +#ifndef _ISOMAC libc_hidden_proto (getpriority) libc_hidden_proto (setpriority) libc_hidden_proto (getrlimit64) @@ -14,3 +15,4 @@ extern int __getrusage (enum __rusage_who __who, struct rusage *__usage) extern int __setrlimit (enum __rlimit_resource __resource, const struct rlimit *__rlimits); #endif +#endif diff --git a/include/sys/select.h b/include/sys/select.h index 2e5901c..07bb49b 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -1,6 +1,7 @@ #ifndef _SYS_SELECT_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __pselect (int __nfds, fd_set *__readfds, fd_set *__writefds, fd_set *__exceptfds, @@ -14,3 +15,4 @@ extern int __select (int __nfds, fd_set *__restrict __readfds, libc_hidden_proto (__select) #endif +#endif diff --git a/include/sys/socket.h b/include/sys/socket.h index d45c99d..2ae3428 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -1,6 +1,7 @@ #ifndef _SYS_SOCKET_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ /* Create a new socket of type TYPE in domain DOMAIN, using @@ -162,3 +163,4 @@ extern int __have_sock_cloexec; #endif #endif +#endif diff --git a/include/sys/stat.h b/include/sys/stat.h index a6cf60f..7a65d60 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -1,6 +1,7 @@ #ifndef _SYS_STAT_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __stat (const char *__file, struct stat *__buf); extern int __fstat (int __fd, struct stat *__buf); @@ -55,3 +56,4 @@ libc_hidden_proto (__fxstatat64) #define __fstatat64(dfd, fname, buf, flag) \ __fxstatat64 (_STAT_VER, dfd, fname, buf, flag) #endif +#endif diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h index 74ef2db..fa30453 100644 --- a/include/sys/statvfs.h +++ b/include/sys/statvfs.h @@ -1,6 +1,7 @@ #ifndef _SYS_STATVFS_H #include +#ifndef _ISOMAC /* Now define the internal interfaces. */ extern int __statvfs64 (const char *__file, struct statvfs64 *__buf); extern int __fstatvfs64 (int __fildes, struct statvfs64 *__buf); @@ -8,3 +9,4 @@ extern int __fstatvfs64 (int __fildes, struct statvfs64 *__buf); libc_hidden_proto (statvfs) libc_hidden_proto (fstatvfs) #endif +#endif diff --git a/include/sys/time.h b/include/sys/time.h index a5ec500..d5de942 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -1,6 +1,7 @@ #ifndef _SYS_TIME_H #include