From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- include/libc-internal.h | 612 ++++++++++++++---------- libc/inet/addr.c | 45 +- libc/inet/ether_addr.c | 19 +- libc/inet/getaddrinfo.c | 114 +++-- libc/inet/getnetbyad.c | 8 +- libc/inet/getnetbynm.c | 13 +- libc/inet/getnetent.c | 25 +- libc/inet/getproto.c | 60 ++- libc/inet/getservice.c | 69 +-- libc/inet/herror.c | 7 +- libc/inet/hostid.c | 32 +- libc/inet/if_index.c | 57 ++- libc/inet/ifaddrs.c | 31 +- libc/inet/in6_addr.c | 6 +- libc/inet/inet_net.c | 7 +- libc/inet/ntop.c | 37 +- libc/inet/opensock.c | 6 +- libc/inet/resolv.c | 315 ++++++------ libc/inet/rpc/auth_none.c | 13 +- libc/inet/rpc/auth_unix.c | 50 +- libc/inet/rpc/authunix_prot.c | 18 +- libc/inet/rpc/bindresvport.c | 17 +- libc/inet/rpc/clnt_generic.c | 30 +- libc/inet/rpc/clnt_perror.c | 101 ++-- libc/inet/rpc/clnt_raw.c | 19 +- libc/inet/rpc/clnt_simple.c | 18 +- libc/inet/rpc/clnt_tcp.c | 64 +-- libc/inet/rpc/clnt_udp.c | 79 +-- libc/inet/rpc/clnt_unix.c | 71 +-- libc/inet/rpc/create_xid.c | 8 +- libc/inet/rpc/get_myaddress.c | 28 +- libc/inet/rpc/getrpcent.c | 96 ++-- libc/inet/rpc/getrpcport.c | 9 +- libc/inet/rpc/pmap_clnt.c | 53 +- libc/inet/rpc/pmap_getmaps.c | 6 +- libc/inet/rpc/pmap_getport.c | 15 +- libc/inet/rpc/pmap_prot.c | 3 +- libc/inet/rpc/pmap_prot2.c | 5 +- libc/inet/rpc/pmap_rmt.c | 74 +-- libc/inet/rpc/rcmd.c | 159 +++--- libc/inet/rpc/rexec.c | 95 ++-- libc/inet/rpc/rpc_callmsg.c | 28 +- libc/inet/rpc/rpc_dtablesize.c | 11 +- libc/inet/rpc/rpc_private.h | 5 +- libc/inet/rpc/rpc_prot.c | 52 +- libc/inet/rpc/rpc_thread.c | 48 +- libc/inet/rpc/rtime.c | 19 +- libc/inet/rpc/ruserpass.c | 123 ++--- libc/inet/rpc/svc.c | 131 ++--- libc/inet/rpc/svc_auth.c | 7 +- libc/inet/rpc/svc_auth_unix.c | 12 +- libc/inet/rpc/svc_raw.c | 8 +- libc/inet/rpc/svc_run.c | 16 +- libc/inet/rpc/svc_simple.c | 34 +- libc/inet/rpc/svc_tcp.c | 59 ++- libc/inet/rpc/svc_udp.c | 78 +-- libc/inet/rpc/svc_unix.c | 72 +-- libc/inet/rpc/xdr.c | 137 +++--- libc/inet/rpc/xdr_array.c | 19 +- libc/inet/rpc/xdr_mem.c | 13 +- libc/inet/rpc/xdr_rec.c | 43 +- libc/inet/rpc/xdr_reference.c | 21 +- libc/inet/rpc/xdr_stdio.c | 12 +- libc/inet/socketcalls.c | 98 ++-- libc/misc/assert/__assert.c | 3 + libc/misc/ctype/ctype.c | 34 +- libc/misc/dirent/alphasort.c | 4 +- libc/misc/dirent/alphasort64.c | 3 +- libc/misc/dirent/closedir.c | 9 +- libc/misc/dirent/dirfd.c | 11 +- libc/misc/dirent/dirstream.h | 4 +- libc/misc/dirent/opendir.c | 19 +- libc/misc/dirent/readdir.c | 6 +- libc/misc/dirent/readdir64.c | 6 +- libc/misc/dirent/readdir64_r.c | 4 +- libc/misc/dirent/readdir_r.c | 4 +- libc/misc/dirent/rewinddir.c | 3 +- libc/misc/dirent/scandir.c | 40 +- libc/misc/dirent/scandir64.c | 13 +- libc/misc/dirent/seekdir.c | 4 +- libc/misc/error/err.c | 48 +- libc/misc/error/error.c | 24 +- libc/misc/file/lockf.c | 20 +- libc/misc/file/lockf64.c | 21 +- libc/misc/fnmatch/fnmatch.c | 118 ++--- libc/misc/fnmatch/fnmatch_loop.c | 6 +- libc/misc/fnmatch/fnmatch_old.c | 11 +- libc/misc/ftw/ftw.c | 65 +-- libc/misc/ftw/ftw64.c | 4 +- libc/misc/glob/glob.c | 57 ++- libc/misc/glob/glob64.c | 6 +- libc/misc/gnu/obstack.c | 23 +- libc/misc/internals/__uClibc_main.c | 45 +- libc/misc/internals/tempname.c | 43 +- libc/misc/locale/locale.c | 119 ++--- libc/misc/mntent/mntent.c | 37 +- libc/misc/regex/regcomp.c | 5 +- libc/misc/regex/regex.c | 69 +-- libc/misc/regex/regex_old.c | 49 +- libc/misc/search/hsearch.c | 8 +- libc/misc/search/hsearch_r.c | 25 +- libc/misc/search/lsearch.c | 13 +- libc/misc/search/tsearch.c | 16 +- libc/misc/statfs/fstatfs64.c | 19 +- libc/misc/statfs/fstatvfs.c | 8 +- libc/misc/statfs/fstatvfs64.c | 9 +- libc/misc/statfs/internal_statvfs.c | 48 +- libc/misc/statfs/statfs64.c | 18 +- libc/misc/statfs/statvfs.c | 7 +- libc/misc/statfs/statvfs64.c | 6 +- libc/misc/syslog/syslog.c | 108 +++-- libc/misc/sysvipc/ftok.c | 4 +- libc/misc/sysvipc/shm.c | 4 +- libc/misc/time/adjtime.c | 8 +- libc/misc/time/ftime.c | 4 +- libc/misc/time/time.c | 235 ++++----- libc/misc/ttyent/getttyent.c | 30 +- libc/misc/utmp/utent.c | 51 +- libc/misc/utmp/wtent.c | 54 +-- libc/misc/wchar/Makefile.in | 2 +- libc/misc/wchar/wchar.c | 115 +++-- libc/misc/wchar/wstdio.c | 27 +- libc/misc/wctype/wctype.c | 175 +++---- libc/misc/wordexp/wordexp.c | 136 +++--- libc/pwd_grp/lckpwdf.c | 45 +- libc/pwd_grp/pwd_grp.c | 179 ++++--- libc/pwd_grp/pwd_grp_internal.c | 5 +- libc/signal/killpg.c | 3 +- libc/signal/raise.c | 16 +- libc/signal/sigaction.c | 14 +- libc/signal/sigaddset.c | 2 + libc/signal/sigblock.c | 10 +- libc/signal/sigdelset.c | 6 +- libc/signal/sigempty.c | 6 +- libc/signal/sigfillset.c | 12 +- libc/signal/siggetmask.c | 5 +- libc/signal/sighold.c | 7 +- libc/signal/sigignore.c | 3 +- libc/signal/sigintr.c | 4 +- libc/signal/sigjmp.c | 4 +- libc/signal/signal.c | 10 +- libc/signal/sigpause.c | 18 +- libc/signal/sigrelse.c | 9 +- libc/signal/sigset.c | 8 +- libc/signal/sigsetmask.c | 11 +- libc/signal/sigwait.c | 12 +- libc/signal/sysv_signal.c | 3 +- libc/stdio/_READ.c | 5 +- libc/stdio/__fsetlocking.c | 5 +- libc/stdio/_cs_funcs.c | 23 +- libc/stdio/_flushlbf.c | 2 + libc/stdio/_fopen.c | 10 +- libc/stdio/_fpmaxtostr.c | 4 +- libc/stdio/_fwrite.c | 11 +- libc/stdio/_stdio.c | 7 +- libc/stdio/_stdio.h | 70 +-- libc/stdio/_trans2w.c | 4 +- libc/stdio/_uintmaxtostr.c | 10 +- libc/stdio/_wfwrite.c | 10 +- libc/stdio/asprintf.c | 9 +- libc/stdio/clearerr.c | 7 +- libc/stdio/ctermid.c | 4 +- libc/stdio/dprintf.c | 4 +- libc/stdio/fclose.c | 11 +- libc/stdio/fcloseall.c | 2 + libc/stdio/fdopen.c | 9 +- libc/stdio/feof.c | 7 +- libc/stdio/ferror.c | 7 +- libc/stdio/fflush.c | 20 +- libc/stdio/fgetc.c | 41 +- libc/stdio/fgetpos.c | 4 +- libc/stdio/fgetpos64.c | 2 +- libc/stdio/fgets.c | 23 +- libc/stdio/fgetwc.c | 28 +- libc/stdio/fgetws.c | 15 +- libc/stdio/fileno.c | 19 +- libc/stdio/fmemopen.c | 9 +- libc/stdio/fopen.c | 7 +- libc/stdio/fopen64.c | 1 - libc/stdio/fopencookie.c | 5 +- libc/stdio/fprintf.c | 10 +- libc/stdio/fputc.c | 34 +- libc/stdio/fputs.c | 25 +- libc/stdio/fputwc.c | 16 +- libc/stdio/fputws.c | 25 +- libc/stdio/fread.c | 23 +- libc/stdio/freopen.c | 2 + libc/stdio/fseeko.c | 18 +- libc/stdio/fseeko64.c | 2 +- libc/stdio/fsetpos.c | 4 +- libc/stdio/fsetpos64.c | 2 +- libc/stdio/ftello.c | 18 +- libc/stdio/ftello64.c | 2 +- libc/stdio/fwprintf.c | 4 +- libc/stdio/fwrite.c | 18 +- libc/stdio/getchar.c | 10 +- libc/stdio/getdelim.c | 8 +- libc/stdio/getline.c | 9 +- libc/stdio/gets.c | 5 +- libc/stdio/getw.c | 4 +- libc/stdio/getwchar.c | 13 +- libc/stdio/old_vfprintf.c | 23 +- libc/stdio/open_memstream.c | 17 +- libc/stdio/perror.c | 10 +- libc/stdio/popen.c | 36 +- libc/stdio/printf.c | 9 +- libc/stdio/putchar.c | 10 +- libc/stdio/puts.c | 7 +- libc/stdio/putw.c | 6 +- libc/stdio/putwchar.c | 14 +- libc/stdio/remove.c | 11 +- libc/stdio/rewind.c | 9 +- libc/stdio/scanf.c | 114 +++-- libc/stdio/setbuf.c | 4 +- libc/stdio/setbuffer.c | 4 +- libc/stdio/setlinebuf.c | 4 +- libc/stdio/setvbuf.c | 5 +- libc/stdio/snprintf.c | 9 +- libc/stdio/sprintf.c | 9 +- libc/stdio/swprintf.c | 4 +- libc/stdio/tempnam.c | 4 +- libc/stdio/tmpfile.c | 11 +- libc/stdio/tmpnam.c | 4 +- libc/stdio/ungetc.c | 5 +- libc/stdio/ungetwc.c | 5 +- libc/stdio/vasprintf.c | 22 +- libc/stdio/vdprintf.c | 12 +- libc/stdio/vfprintf.c | 51 +- libc/stdio/vprintf.c | 4 +- libc/stdio/vsnprintf.c | 23 +- libc/stdio/vsprintf.c | 4 +- libc/stdio/vswprintf.c | 9 +- libc/stdio/vwprintf.c | 4 +- libc/stdio/wprintf.c | 4 +- libc/stdlib/abort.c | 25 +- libc/stdlib/atexit.c | 11 +- libc/stdlib/drand48.c | 4 +- libc/stdlib/drand48_r.c | 4 +- libc/stdlib/erand48.c | 3 +- libc/stdlib/erand48_r.c | 5 +- libc/stdlib/gcvt.c | 4 +- libc/stdlib/getenv.c | 35 +- libc/stdlib/getpt.c | 7 +- libc/stdlib/jrand48.c | 4 +- libc/stdlib/jrand48_r.c | 5 +- libc/stdlib/ldiv.c | 2 +- libc/stdlib/lldiv.c | 2 +- libc/stdlib/lrand48.c | 4 +- libc/stdlib/lrand48_r.c | 9 +- libc/stdlib/malloc-simple/alloc.c | 11 +- libc/stdlib/malloc-standard/calloc.c | 5 +- libc/stdlib/malloc-standard/free.c | 3 +- libc/stdlib/malloc-standard/mallinfo.c | 8 +- libc/stdlib/malloc-standard/malloc.h | 9 +- libc/stdlib/malloc-standard/realloc.c | 9 +- libc/stdlib/malloc/calloc.c | 4 +- libc/stdlib/malloc/free.c | 7 +- libc/stdlib/malloc/heap_debug.c | 5 +- libc/stdlib/malloc/malloc.c | 6 +- libc/stdlib/malloc/malloc.h | 1 + libc/stdlib/malloc/malloc_debug.c | 14 +- libc/stdlib/malloc/realloc.c | 4 +- libc/stdlib/mrand48.c | 4 +- libc/stdlib/mrand48_r.c | 4 +- libc/stdlib/nrand48.c | 4 +- libc/stdlib/nrand48_r.c | 5 +- libc/stdlib/ptsname.c | 34 +- libc/stdlib/rand.c | 4 +- libc/stdlib/random.c | 17 +- libc/stdlib/random_r.c | 24 +- libc/stdlib/realpath.c | 36 +- libc/stdlib/seed48.c | 4 +- libc/stdlib/seed48_r.c | 9 +- libc/stdlib/setenv.c | 46 +- libc/stdlib/srand48.c | 4 +- libc/stdlib/srand48_r.c | 5 +- libc/stdlib/stdlib.c | 162 ++++--- libc/stdlib/strtod.c | 33 +- libc/stdlib/strtof.c | 4 +- libc/stdlib/strtold.c | 4 +- libc/stdlib/system.c | 21 +- libc/stdlib/unix_grantpt.c | 34 +- libc/stdlib/unlockpt.c | 3 +- libc/stdlib/valloc.c | 4 +- libc/string/__glibc_strerror_r.c | 11 +- libc/string/__xpg_strerror_r.c | 23 +- libc/string/_collate.c | 73 +-- libc/string/arm/bcopy.S | 13 +- libc/string/arm/bzero.S | 13 +- libc/string/arm/memcmp.S | 13 +- libc/string/arm/memcpy.S | 11 +- libc/string/arm/memmove.S | 11 +- libc/string/arm/memset.S | 11 +- libc/string/arm/strcmp.S | 15 +- libc/string/arm/strlen.S | 11 +- libc/string/arm/strncmp.S | 11 +- libc/string/basename.c | 7 +- libc/string/bcopy.c | 10 +- libc/string/bzero.c | 8 +- libc/string/ffs.c | 7 +- libc/string/frv/memcpy.S | 11 +- libc/string/frv/memset.S | 11 +- libc/string/generic/memchr.c | 8 +- libc/string/generic/memcmp.c | 9 +- libc/string/generic/memcpy.c | 6 +- libc/string/generic/memmem.c | 10 +- libc/string/generic/memmove.c | 10 +- libc/string/generic/mempcpy.c | 10 +- libc/string/generic/memrchr.c | 8 +- libc/string/generic/memset.c | 6 +- libc/string/generic/rawmemchr.c | 8 +- libc/string/generic/strcat.c | 6 +- libc/string/generic/strchr.c | 11 +- libc/string/generic/strchrnul.c | 8 +- libc/string/generic/strcmp.c | 11 +- libc/string/generic/strcpy.c | 6 +- libc/string/generic/strcspn.c | 10 +- libc/string/generic/strlen.c | 8 +- libc/string/generic/strncat.c | 6 +- libc/string/generic/strncmp.c | 6 +- libc/string/generic/strncpy.c | 6 +- libc/string/generic/strnlen.c | 8 +- libc/string/generic/strrchr.c | 15 +- libc/string/generic/strsep.c | 13 +- libc/string/generic/strspn.c | 6 +- libc/string/generic/strstr.c | 6 +- libc/string/generic/strtok_r.c | 16 +- libc/string/i386/memchr.c | 6 +- libc/string/i386/memcpy.c | 6 +- libc/string/i386/memmove.c | 6 +- libc/string/i386/memset.c | 6 +- libc/string/i386/strcat.c | 6 +- libc/string/i386/strchr.c | 9 +- libc/string/i386/strcmp.c | 11 +- libc/string/i386/strcpy.c | 6 +- libc/string/i386/strlen.c | 6 +- libc/string/i386/strncat.c | 6 +- libc/string/i386/strncmp.c | 6 +- libc/string/i386/strncpy.c | 6 +- libc/string/i386/strnlen.c | 6 +- libc/string/i386/strrchr.c | 9 +- libc/string/memccpy.c | 4 +- libc/string/memchr.c | 8 +- libc/string/memcmp.c | 9 +- libc/string/memcpy.c | 9 +- libc/string/memmem.c | 4 +- libc/string/memmove.c | 9 +- libc/string/mempcpy.c | 8 +- libc/string/memrchr.c | 6 +- libc/string/memset.c | 9 +- libc/string/mips/memcpy.S | 6 +- libc/string/mips/memset.S | 6 +- libc/string/mips/sysdep.h | 1 - libc/string/powerpc/memcpy.c | 6 +- libc/string/powerpc/memmove.c | 6 +- libc/string/powerpc/memset.c | 6 +- libc/string/psignal.c | 6 +- libc/string/rawmemchr.c | 7 +- libc/string/sh64/memcpy.S | 11 +- libc/string/sh64/memset.S | 11 +- libc/string/sh64/strcpy.S | 11 +- libc/string/sh64/strlen.S | 11 +- libc/string/sparc/_glibc_inc.h | 1 - libc/string/sparc/sparc32/memchr.S | 8 +- libc/string/sparc/sparc32/memcpy.S | 18 +- libc/string/sparc/sparc32/memset.S | 12 +- libc/string/sparc/sparc32/stpcpy.S | 6 +- libc/string/sparc/sparc32/strcat.S | 6 +- libc/string/sparc/sparc32/strchr.S | 16 +- libc/string/sparc/sparc32/strcmp.S | 7 +- libc/string/sparc/sparc32/strcpy.S | 7 +- libc/string/sparc/sparc32/strlen.S | 7 +- libc/string/sparc/sparc64/memchr.S | 8 +- libc/string/sparc/sparc64/memcpy.S | 22 +- libc/string/sparc/sparc64/memset.S | 12 +- libc/string/sparc/sparc64/sparcv9b/memcpy.S | 18 +- libc/string/sparc/sparc64/stpcpy.S | 7 +- libc/string/sparc/sparc64/strcat.S | 7 +- libc/string/sparc/sparc64/strchr.S | 16 +- libc/string/sparc/sparc64/strcmp.S | 7 +- libc/string/sparc/sparc64/strcpy.S | 6 +- libc/string/sparc/sparc64/strlen.S | 7 +- libc/string/stpcpy.c | 9 +- libc/string/stpncpy.c | 9 +- libc/string/strcasecmp.c | 37 +- libc/string/strcasestr.c | 10 +- libc/string/strcat.c | 9 +- libc/string/strchr.c | 11 +- libc/string/strchrnul.c | 9 +- libc/string/strcmp.c | 21 +- libc/string/strcpy.c | 9 +- libc/string/strcspn.c | 9 +- libc/string/strdup.c | 21 +- libc/string/strerror.c | 10 +- libc/string/strlcpy.c | 31 +- libc/string/strlen.c | 9 +- libc/string/strncasecmp.c | 37 +- libc/string/strncat.c | 9 +- libc/string/strncmp.c | 8 +- libc/string/strncpy.c | 8 +- libc/string/strndup.c | 13 +- libc/string/strnlen.c | 8 +- libc/string/strpbrk.c | 9 +- libc/string/strrchr.c | 10 +- libc/string/strsep.c | 13 +- libc/string/strsignal.c | 13 +- libc/string/strspn.c | 9 +- libc/string/strstr.c | 13 +- libc/string/strtok.c | 6 +- libc/string/strtok_r.c | 21 +- libc/string/x86_64/_glibc_inc.h | 1 - libc/string/x86_64/bzero.S | 4 +- libc/string/x86_64/memcpy.S | 8 +- libc/string/x86_64/mempcpy.S | 4 +- libc/string/x86_64/memset.S | 8 +- libc/string/x86_64/stpcpy.S | 4 +- libc/string/x86_64/strcat.S | 6 +- libc/string/x86_64/strchr.S | 8 +- libc/string/x86_64/strcmp.S | 10 +- libc/string/x86_64/strcpy.S | 4 +- libc/string/x86_64/strcspn.S | 8 +- libc/string/x86_64/strlen.S | 6 +- libc/string/x86_64/strpbrk.S | 4 +- libc/string/x86_64/strspn.S | 6 +- libc/sysdeps/linux/alpha/__longjmp.S | 1 + libc/sysdeps/linux/alpha/brk.S | 12 +- libc/sysdeps/linux/alpha/clone.S | 14 +- libc/sysdeps/linux/arm/__longjmp.S | 1 + libc/sysdeps/linux/arm/brk.c | 4 +- libc/sysdeps/linux/arm/clone.S | 13 +- libc/sysdeps/linux/arm/ioperm.c | 26 +- libc/sysdeps/linux/arm/iopl.c | 2 + libc/sysdeps/linux/arm/mmap64.S | 2 +- libc/sysdeps/linux/arm/sigaction.c | 14 +- libc/sysdeps/linux/arm/vfork.S | 11 +- libc/sysdeps/linux/bfin/brk.c | 10 +- libc/sysdeps/linux/bfin/vfork.S | 3 +- libc/sysdeps/linux/common/__rt_sigtimedwait.c | 15 +- libc/sysdeps/linux/common/__syscall_fcntl.c | 25 +- libc/sysdeps/linux/common/__syscall_fcntl64.c | 11 +- libc/sysdeps/linux/common/_exit.c | 7 +- libc/sysdeps/linux/common/adjtimex.c | 9 +- libc/sysdeps/linux/common/alarm.c | 12 +- libc/sysdeps/linux/common/chdir.c | 5 +- libc/sysdeps/linux/common/chmod.c | 5 +- libc/sysdeps/linux/common/clock_getres.c | 4 +- libc/sysdeps/linux/common/clock_gettime.c | 4 +- libc/sysdeps/linux/common/clock_settime.c | 4 +- libc/sysdeps/linux/common/close.c | 9 +- libc/sysdeps/linux/common/cmsg_nxthdr.c | 7 +- libc/sysdeps/linux/common/creat64.c | 4 +- libc/sysdeps/linux/common/dl-osinfo.h | 13 +- libc/sysdeps/linux/common/dup2.c | 6 +- libc/sysdeps/linux/common/execve.c | 5 +- libc/sysdeps/linux/common/fchdir.c | 6 +- libc/sysdeps/linux/common/fork.c | 9 +- libc/sysdeps/linux/common/fstat.c | 13 +- libc/sysdeps/linux/common/fstat64.c | 6 +- libc/sysdeps/linux/common/fstatfs.c | 6 +- libc/sysdeps/linux/common/fsync.c | 2 +- libc/sysdeps/linux/common/ftruncate.c | 3 +- libc/sysdeps/linux/common/ftruncate64.c | 4 +- libc/sysdeps/linux/common/getcwd.c | 50 +- libc/sysdeps/linux/common/getdents.c | 7 +- libc/sysdeps/linux/common/getdents64.c | 7 +- libc/sysdeps/linux/common/getdirname.c | 20 +- libc/sysdeps/linux/common/getdnnm.c | 20 +- libc/sysdeps/linux/common/getdtablesize.c | 9 +- libc/sysdeps/linux/common/getegid.c | 11 +- libc/sysdeps/linux/common/geteuid.c | 11 +- libc/sysdeps/linux/common/getgid.c | 5 +- libc/sysdeps/linux/common/getgroups.c | 9 +- libc/sysdeps/linux/common/gethstnm.c | 21 +- libc/sysdeps/linux/common/getpagesize.c | 16 +- libc/sysdeps/linux/common/getpgid.c | 3 +- libc/sysdeps/linux/common/getpid.c | 12 +- libc/sysdeps/linux/common/getpriority.c | 5 +- libc/sysdeps/linux/common/getrlimit.c | 7 +- libc/sysdeps/linux/common/getrlimit64.c | 4 +- libc/sysdeps/linux/common/getsid.c | 5 +- libc/sysdeps/linux/common/gettimeofday.c | 6 +- libc/sysdeps/linux/common/getuid.c | 5 +- libc/sysdeps/linux/common/ioctl.c | 6 +- libc/sysdeps/linux/common/kill.c | 5 +- libc/sysdeps/linux/common/llseek.c | 18 +- libc/sysdeps/linux/common/longjmp.c | 13 +- libc/sysdeps/linux/common/lseek.c | 14 +- libc/sysdeps/linux/common/lstat.c | 13 +- libc/sysdeps/linux/common/lstat64.c | 6 +- libc/sysdeps/linux/common/mkdir.c | 5 +- libc/sysdeps/linux/common/mkfifo.c | 4 +- libc/sysdeps/linux/common/mknod.c | 5 +- libc/sysdeps/linux/common/mmap.c | 5 +- libc/sysdeps/linux/common/mmap64.c | 5 +- libc/sysdeps/linux/common/modify_ldt.c | 2 +- libc/sysdeps/linux/common/mremap.c | 6 +- libc/sysdeps/linux/common/msync.c | 2 +- libc/sysdeps/linux/common/munmap.c | 6 +- libc/sysdeps/linux/common/nanosleep.c | 5 +- libc/sysdeps/linux/common/nice.c | 7 +- libc/sysdeps/linux/common/ntp_gettime.c | 6 +- libc/sysdeps/linux/common/open.c | 14 +- libc/sysdeps/linux/common/open64.c | 14 +- libc/sysdeps/linux/common/pause.c | 8 +- libc/sysdeps/linux/common/pipe.c | 6 +- libc/sysdeps/linux/common/poll.c | 46 +- libc/sysdeps/linux/common/posix_fadvise.c | 6 +- libc/sysdeps/linux/common/posix_fadvise64.c | 2 +- libc/sysdeps/linux/common/pread_write.c | 35 +- libc/sysdeps/linux/common/read.c | 9 +- libc/sysdeps/linux/common/readlink.c | 6 +- libc/sysdeps/linux/common/rmdir.c | 6 +- libc/sysdeps/linux/common/sbrk.c | 12 +- libc/sysdeps/linux/common/select.c | 10 +- libc/sysdeps/linux/common/setegid.c | 10 +- libc/sysdeps/linux/common/seteuid.c | 14 +- libc/sysdeps/linux/common/setgroups.c | 9 +- libc/sysdeps/linux/common/setitimer.c | 6 +- libc/sysdeps/linux/common/setpgid.c | 5 +- libc/sysdeps/linux/common/setpgrp.c | 8 +- libc/sysdeps/linux/common/setpriority.c | 6 +- libc/sysdeps/linux/common/setregid.c | 4 +- libc/sysdeps/linux/common/setresgid.c | 5 +- libc/sysdeps/linux/common/setresuid.c | 5 +- libc/sysdeps/linux/common/setreuid.c | 5 +- libc/sysdeps/linux/common/setrlimit.c | 8 +- libc/sysdeps/linux/common/setrlimit64.c | 4 +- libc/sysdeps/linux/common/setsid.c | 6 +- libc/sysdeps/linux/common/settimeofday.c | 6 +- libc/sysdeps/linux/common/sigprocmask.c | 7 +- libc/sysdeps/linux/common/sigsuspend.c | 7 +- libc/sysdeps/linux/common/ssp.c | 38 +- libc/sysdeps/linux/common/stat.c | 13 +- libc/sysdeps/linux/common/stat64.c | 6 +- libc/sysdeps/linux/common/statfs.c | 5 +- libc/sysdeps/linux/common/time.c | 12 +- libc/sysdeps/linux/common/times.c | 6 +- libc/sysdeps/linux/common/truncate.c | 3 +- libc/sysdeps/linux/common/truncate64.c | 5 +- libc/sysdeps/linux/common/ulimit.c | 8 +- libc/sysdeps/linux/common/uname.c | 6 +- libc/sysdeps/linux/common/unlink.c | 6 +- libc/sysdeps/linux/common/utime.c | 15 +- libc/sysdeps/linux/common/utimes.c | 13 +- libc/sysdeps/linux/common/vfork.c | 9 +- libc/sysdeps/linux/common/wait.c | 14 +- libc/sysdeps/linux/common/wait3.c | 7 +- libc/sysdeps/linux/common/wait4.c | 5 +- libc/sysdeps/linux/common/waitpid.c | 17 +- libc/sysdeps/linux/common/write.c | 11 +- libc/sysdeps/linux/cris/brk.c | 5 +- libc/sysdeps/linux/cris/clone.S | 9 +- libc/sysdeps/linux/cris/fork.c | 4 +- libc/sysdeps/linux/cris/sbrk.c | 7 +- libc/sysdeps/linux/cris/setjmp.S | 9 - libc/sysdeps/linux/e1/longjmp.c | 4 +- libc/sysdeps/linux/frv/brk.c | 5 +- libc/sysdeps/linux/frv/clone.S | 13 +- libc/sysdeps/linux/frv/fstat.c | 6 +- libc/sysdeps/linux/frv/fstat64.c | 6 +- libc/sysdeps/linux/frv/lstat.c | 6 +- libc/sysdeps/linux/frv/lstat64.c | 6 +- libc/sysdeps/linux/frv/mmap.c | 5 +- libc/sysdeps/linux/frv/sbrk.c | 7 +- libc/sysdeps/linux/frv/stat.c | 6 +- libc/sysdeps/linux/frv/stat64.c | 6 +- libc/sysdeps/linux/frv/vfork.S | 11 +- libc/sysdeps/linux/h8300/brk.c | 5 +- libc/sysdeps/linux/h8300/clone.S | 10 - libc/sysdeps/linux/h8300/vfork.S | 1 + libc/sysdeps/linux/hppa/__longjmp.S | 3 + libc/sysdeps/linux/hppa/brk.c | 7 +- libc/sysdeps/linux/hppa/clone.S | 13 +- libc/sysdeps/linux/hppa/mmap.c | 6 +- libc/sysdeps/linux/i386/__longjmp.S | 3 + libc/sysdeps/linux/i386/brk.c | 5 +- libc/sysdeps/linux/i386/clone.S | 11 +- libc/sysdeps/linux/i386/mmap.S | 13 +- libc/sysdeps/linux/i386/sigaction.c | 11 +- libc/sysdeps/linux/i386/vfork.S | 15 +- libc/sysdeps/linux/m68k/__longjmp.S | 1 + libc/sysdeps/linux/m68k/brk.c | 5 +- libc/sysdeps/linux/m68k/clone.S | 13 +- libc/sysdeps/linux/m68k/vfork.S | 11 +- libc/sysdeps/linux/microblaze/__longjmp.S | 2 + libc/sysdeps/linux/microblaze/longjmp.S | 2 + libc/sysdeps/linux/microblaze/mmap.c | 2 + libc/sysdeps/linux/microblaze/vfork.S | 7 +- libc/sysdeps/linux/mips/__longjmp.c | 2 + libc/sysdeps/linux/mips/brk.c | 5 +- libc/sysdeps/linux/mips/clone.S | 13 +- libc/sysdeps/linux/mips/mmap.c | 6 +- libc/sysdeps/linux/mips/pipe.S | 11 +- libc/sysdeps/linux/mips/pipe.c | 3 +- libc/sysdeps/linux/mips/pread_write.c | 8 +- libc/sysdeps/linux/mips/sigaction.c | 11 +- libc/sysdeps/linux/nios/__longjmp.S | 8 +- libc/sysdeps/linux/nios/brk.c | 5 +- libc/sysdeps/linux/nios/clone.S | 11 +- libc/sysdeps/linux/nios/vfork.S | 10 +- libc/sysdeps/linux/nios2/__longjmp.S | 1 + libc/sysdeps/linux/nios2/brk.c | 5 +- libc/sysdeps/linux/nios2/clone.S | 11 +- libc/sysdeps/linux/nios2/vfork.S | 11 +- libc/sysdeps/linux/powerpc/__longjmp.S | 2 + libc/sysdeps/linux/powerpc/brk.S | 13 +- libc/sysdeps/linux/powerpc/clone.S | 12 +- libc/sysdeps/linux/powerpc/ioctl.c | 11 +- libc/sysdeps/linux/powerpc/mmap.c | 5 +- libc/sysdeps/linux/powerpc/pread_write.c | 35 +- libc/sysdeps/linux/powerpc/vfork.S | 15 +- libc/sysdeps/linux/powerpc/vfork.c | 5 +- libc/sysdeps/linux/sh/__longjmp.S | 3 +- libc/sysdeps/linux/sh/brk.c | 5 +- libc/sysdeps/linux/sh/clone.S | 13 +- libc/sysdeps/linux/sh/longjmp.c | 1 + libc/sysdeps/linux/sh/mmap.c | 6 +- libc/sysdeps/linux/sh/pipe.c | 3 +- libc/sysdeps/linux/sh/pread_write.c | 8 +- libc/sysdeps/linux/sh/sbrk.c | 7 +- libc/sysdeps/linux/sh/vfork.S | 12 +- libc/sysdeps/linux/sh64/brk.c | 5 +- libc/sysdeps/linux/sparc/__longjmp.S | 3 + libc/sysdeps/linux/sparc/brk.c | 5 +- libc/sysdeps/linux/sparc/clone.S | 14 +- libc/sysdeps/linux/sparc/fork.S | 13 +- libc/sysdeps/linux/sparc/vfork.S | 15 +- libc/sysdeps/linux/v850/__longjmp.S | 2 + libc/sysdeps/linux/v850/mmap.c | 2 + libc/sysdeps/linux/v850/vfork.S | 8 +- libc/sysdeps/linux/x86_64/__longjmp.S | 2 + libc/sysdeps/linux/x86_64/brk.c | 5 +- libc/sysdeps/linux/x86_64/clone.S | 13 +- libc/sysdeps/linux/x86_64/mmap.c | 6 +- libc/sysdeps/linux/x86_64/sigaction.c | 14 +- libc/sysdeps/linux/x86_64/vfork.S | 15 +- libc/termios/Makefile.in | 30 +- libc/termios/cfmakeraw.c | 31 ++ libc/termios/cfsetspeed.c | 164 +++++++ libc/termios/isatty.c | 32 ++ libc/termios/speed.c | 97 ++++ libc/termios/tcdrain.c | 30 ++ libc/termios/tcflow.c | 30 ++ libc/termios/tcflush.c | 31 ++ libc/termios/tcgetattr.c | 20 +- libc/termios/tcgetpgrp.c | 36 ++ libc/termios/tcgetsid.c | 24 +- libc/termios/tcsendbrk.c | 48 ++ libc/termios/tcsetattr.c | 14 +- libc/termios/tcsetpgrp.c | 30 ++ libc/termios/termios.c | 327 ------------- libc/termios/ttyname.c | 58 ++- libc/unistd/confstr.c | 6 +- libc/unistd/daemon.c | 100 ++-- libc/unistd/exec.c | 50 +- libc/unistd/fpathconf.c | 8 +- libc/unistd/getlogin.c | 19 +- libc/unistd/getopt-susv3.c | 2 + libc/unistd/getopt.c | 37 +- libc/unistd/getpass.c | 26 +- libc/unistd/getsubopt.c | 11 +- libc/unistd/pathconf.c | 8 +- libc/unistd/sleep.c | 26 +- libc/unistd/sysconf.c | 11 +- libc/unistd/ualarm.c | 8 +- libc/unistd/usershell.c | 13 +- libc/unistd/usleep.c | 8 +- libpthread/linuxthreads.old/attr.c | 3 +- libpthread/linuxthreads.old/forward.c | 3 +- libpthread/linuxthreads.old/libc_pthread_init.c | 8 +- libpthread/linuxthreads.old/manager.c | 2 +- 671 files changed, 6798 insertions(+), 5558 deletions(-) create mode 100644 libc/termios/cfmakeraw.c create mode 100644 libc/termios/cfsetspeed.c create mode 100644 libc/termios/isatty.c create mode 100644 libc/termios/speed.c create mode 100644 libc/termios/tcdrain.c create mode 100644 libc/termios/tcflow.c create mode 100644 libc/termios/tcflush.c create mode 100644 libc/termios/tcgetpgrp.c create mode 100644 libc/termios/tcsendbrk.c create mode 100644 libc/termios/tcsetpgrp.c delete mode 100644 libc/termios/termios.c diff --git a/include/libc-internal.h b/include/libc-internal.h index 9ade7e2ab..feb329323 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -119,6 +119,11 @@ # define IS_IN_libc 1 #endif +/* need this to unset defaults in libpthread for files that get added to libc */ +#ifdef IS_IN_libc +# undef NOT_IN_libc +#endif + /* Prepare for the case that `__builtin_expect' is not available. */ #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 # define __builtin_expect(x, expected_value) (x) @@ -138,306 +143,401 @@ #define attribute_unused __attribute__ ((unused)) -/* Arrange to hide uClibc internals */ -#if __GNUC_PREREQ (3, 3) -# define attribute_hidden __attribute__ ((visibility ("hidden"))) -#else -# define attribute_hidden -#endif +/* The following macros are used for PLT bypassing within libc.so + (and if needed other libraries similarly). + First of all, you need to have the function prototyped somewhere, + say in foo/foo.h: -#ifndef __ASSEMBLER__ -# 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_hidden; + int foo (int __bar); -# 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_hidden; -#else /* __ASSEMBLER__ */ -# define hidden_strong_alias(name, aliasname) \ - .global C_SYMBOL_NAME (aliasname) ; \ - .hidden C_SYMBOL_NAME (aliasname) ; \ - .set C_SYMBOL_NAME(aliasname),C_SYMBOL_NAME(name) + If calls to foo within libc.so should always go to foo defined in libc.so, + then in include/foo.h you add: -# define hidden_weak_alias(name, aliasname) \ - .weak C_SYMBOL_NAME(aliasname) ; \ - .hidden C_SYMBOL_NAME(aliasname) ; \ - C_SYMBOL_NAME(aliasname) = C_SYMBOL_NAME(name) -#endif /* __ASSEMBLER__ */ + libc_hidden_proto (foo) -#ifdef __UCLIBC_BUILD_RELRO__ -# define attribute_relro __attribute__ ((section (".data.rel.ro"))) -#else -# define attribute_relro -#endif + line and after the foo function definition: -#ifdef __GNUC__ -# define attribute_noreturn __attribute__ ((__noreturn__)) -#else -# define attribute_noreturn -#endif + int foo (int __bar) + { + return __bar; + } + libc_hidden_def (foo) -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -# define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec"))) -#endif + or -/* Pull in things like __attribute_used__ */ -#include + int foo (int __bar) + { + return __bar; + } + libc_hidden_weak (foo) -/* --- this is added to integrate linuxthreads */ -#define __USE_UNIX98 1 + Simularly for global data. If references to foo within libc.so should + always go to foo defined in libc.so, then in include/foo.h you add: -#ifndef __ASSEMBLER__ -# ifdef IS_IN_libc + libc_hidden_proto (foo) -# define __UC(N) __ ## N -# define __UC_ALIAS(N) strong_alias( __ ## N , N ) -# if defined __UCLIBC_HAS_XLOCALE__ && defined __UCLIBC_DO_XLOCALE -# define __UCXL(N) __ ## N ## _l -# define __UCXL_ALIAS(N) strong_alias ( __ ## N ## _l , N ## _l ) -# else -# define __UCXL(N) __UC(N) -# define __UCXL_ALIAS(N) __UC_ALIAS(N) -# endif + line and after foo's definition: -# define __need_size_t -# ifdef __UCLIBC_HAS_WCHAR__ -# define __need_wchar_t -# define __need_wint_t -# endif -# include + int foo = INITIAL_FOO_VALUE; + libc_hidden_data_def (foo) -# include + or -# ifndef __ssize_t_defined -typedef __ssize_t ssize_t; -# define __ssize_t_defined -# endif + int foo = INITIAL_FOO_VALUE; + libc_hidden_data_weak (foo) -# include + If foo is normally just an alias (strong or weak) of some other function, + you should use the normal strong_alias first, then add libc_hidden_def + or libc_hidden_weak: -/* prototypes for internal use, please keep these in sync w/ updated headers */ -/* #include */ -#ifndef __USE_FILE_OFFSET64 -extern int __open (__const char *__file, int __oflag, ...) __nonnull ((1)) attribute_hidden; -extern int __fcntl (int __fd, int __cmd, ...) attribute_hidden; -#else -# ifdef __REDIRECT -extern int __REDIRECT (__open, (__const char *__file, int __oflag, ...), __open64) - __nonnull ((1)) attribute_hidden; -extern int __REDIRECT (__fcntl, (int __fd, int __cmd, ...), __fcntl64) attribute_hidden; -# else -# define __open __open64 -# define __fcntl __fcntl64 -# endif -#endif -#ifdef __USE_LARGEFILE64 -extern int __open64 (__const char *__file, int __oflag, ...) __nonnull ((1)) attribute_hidden; -extern int __fcntl64 (int __fd, int __cmd, ...) attribute_hidden; -#endif + int baz (int __bar) + { + return __bar; + } + strong_alias (baz, foo) + libc_hidden_weak (foo) -/* #include */ -extern int __memcmp (__const void *__s1, __const void *__s2, size_t __n) attribute_hidden; -extern void *__memcpy (void *__restrict __dest, - __const void *__restrict __src, size_t __n) attribute_hidden; -extern void *__memmove (void *__dest, __const void *__src, size_t __n) attribute_hidden; -extern void *__memset (void *__s, int __c, size_t __n) attribute_hidden; -extern char *__strcpy (char *__restrict __dest, __const char *__restrict __src) attribute_hidden; -extern size_t __strlen (__const char *__s) attribute_hidden; -extern int __strcmp (__const char *__s1, __const char *__s2) attribute_hidden; -extern char *__strcat (char *__restrict __dest, __const char *__restrict __src) attribute_hidden; -extern char *__strncpy (char *__restrict __dest, - __const char *__restrict __src, size_t __n) attribute_hidden; -extern char *__strchr (__const char *__s, int __c) attribute_hidden; -extern char *__strrchr (__const char *__s, int __c) attribute_hidden; -extern int __strncmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden; -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; -extern void *__rawmemchr (__const void *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden; -extern size_t __strspn (__const char *__s, __const char *__accept) - __THROW __attribute_pure__ __nonnull ((1, 2)) attribute_hidden; -extern char *__strpbrk (__const char *__s, __const char *__accept) - __THROW __attribute_pure__ __nonnull ((1, 2)) attribute_hidden; -extern size_t __strnlen (__const char *__string, size_t __maxlen) - __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden; -extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, - char **__restrict __save_ptr) __THROW __nonnull ((2, 3)) attribute_hidden; + If the function should be internal to multiple objects, say ld.so and + libc.so, the best way is to use: -/* 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; - -/* ctype.h */ -extern int __tolower (int __c) __THROW attribute_hidden; -extern int __toupper (int __c) __THROW attribute_hidden; - -#ifdef __UCLIBC_HAS_WCHAR__ -/* wchar.h */ -extern size_t __wcslen (__const wchar_t *__s) __THROW __attribute_pure__ attribute_hidden; -extern wchar_t *__wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __THROW attribute_hidden; -extern size_t __wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) - __THROW __attribute_pure__ attribute_hidden; -extern wchar_t *__wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) - __THROW __attribute_pure__ attribute_hidden; -/* wctype.h */ -extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden; -#endif + #if !defined NOT_IN_libc || defined IS_IN_rtld + hidden_proto (foo) + #endif + + in include/foo.h and the normal macros at all function definitions + depending on what DSO they belong to. + + If versioned_symbol macro is used to define foo, + libc_hidden_ver macro should be used, as in: -/* #include */ -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; -extern void _exit_internal (int __status) __attribute__ ((__noreturn__)) attribute_hidden; -#ifndef __USE_FILE_OFFSET64 -extern int __lockf (int __fd, int __cmd, __off_t __len) attribute_hidden; -extern __off_t __lseek (int __fd, __off_t __offset, int __whence) __THROW attribute_hidden; + int __real_foo (int __bar) + { + return __bar; + } + versioned_symbol (libc, __real_foo, foo, GLIBC_2_1); + libc_hidden_ver (__real_foo, foo) */ + +/* uClibc specific (the above comment was copied from glibc): + * a. when ppc64 will be supported, we need changes to support: + * strong_data_alias (used by asm hidden_data_def) / HAVE_ASM_GLOBAL_DOT_NAME + * b. libc_hidden_proto(foo) should be added after the header having foo's prototype + * or after extern foo... to all source files that should use the internal version + * of foo within libc, even to the file defining foo itself, libc_hidden_def does + * not hide __GI_foo itself, although the name suggests it (hiding is done exclusively + * by libc_hidden_proto). The reasoning to have it after the header w/ foo's prototype is + * to get first the __REDIRECT from original header and then create the __GI_foo alias + * c. no versioning support, hidden[_data]_ver are noop */ + +/* Arrange to hide uClibc internals */ +#if __GNUC_PREREQ (3, 3) +# define attribute_hidden __attribute__ ((visibility ("hidden"))) +# define __hidden_proto_hiddenattr(attrs...) __attribute__ ((visibility ("hidden"), ##attrs)) #else -# ifdef __REDIRECT -extern int __REDIRECT (__lockf, (int __fd, int __cmd, __off64_t __len), - __lockf64) attribute_hidden; -extern __off64_t __REDIRECT (__lseek, - (int __fd, __off64_t __offset, int __whence), - __lseek64) attribute_hidden; +# define attribute_hidden +# define __hidden_proto_hiddenattr(attrs...) +#endif + +/* if ppc64 will be supported, this section needs adapting due to HAVE_ASM_GLOBAL_DOT_NAME */ +#if 1 /* SHARED */ +# ifndef __ASSEMBLER__ +# 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_hidden; + +# 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_hidden; + +# define hidden_proto(name, attrs...) __hidden_proto (name, __GI_##name, ##attrs) +# define __hidden_proto(name, internal, attrs...) \ + extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ + __hidden_proto_hiddenattr (attrs); +# define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name) +# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name) +# define __hidden_asmname2(prefix, name) #prefix name +# define __hidden_ver1(local, internal, name) \ + extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \ + extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname (#local)))) +# define hidden_def(name) __hidden_ver1(__GI_##name, name, name); +# define hidden_data_def(name) hidden_def(name) +# define hidden_weak(name) __hidden_ver1(__GI_##name, name, name) __attribute__((weak)); +# define hidden_data_weak(name) hidden_weak(name) + +# else /* __ASSEMBLER__ */ +# define hidden_strong_alias(name, aliasname) \ + .global C_SYMBOL_NAME (aliasname) ; \ + .hidden C_SYMBOL_NAME (aliasname) ; \ + .set C_SYMBOL_NAME(aliasname),C_SYMBOL_NAME(name) + +# define hidden_weak_alias(name, aliasname) \ + .weak C_SYMBOL_NAME(aliasname) ; \ + .hidden C_SYMBOL_NAME(aliasname) ; \ + C_SYMBOL_NAME(aliasname) = C_SYMBOL_NAME(name) + +/* For assembly, we need to do the opposite of what we do in C: + in assembly gcc __REDIRECT stuff is not in place, so functions + are defined by its normal name and we need to create the + __GI_* alias to it, in C __REDIRECT causes the function definition + to use __GI_* name and we need to add alias to the real name. + There is no reason to use hidden_weak over hidden_def in assembly, + but we provide it for consistency with the C usage. + hidden_proto doesn't make sense for assembly but the equivalent + is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */ +# define hidden_def(name) hidden_strong_alias (name, __GI_##name) +# define hidden_data_def(name) hidden_strong_alias (name, __GI_##name) +# define hidden_weak(name) hidden_def (name) +# define hidden_data_weak(name) hidden_data_def (name) +# define HIDDEN_JUMPTARGET(name) __GI_##name +# endif /* __ASSEMBLER__ */ +#else /* SHARED */ +# define hidden_strong_alias(name, aliasname) +# define hidden_weak_alias(name, aliasname) + +# ifndef __ASSEMBLER__ +# define hidden_proto(name, attrs...) # else -# define __lockf __lockf64 -# define __lseek __lseek64 +# define HIDDEN_JUMPTARGET(name) name # endif +# define hidden_def(name) +# define hidden_data_def(name) +# define hidden_weak(name) +# define hidden_data_weak(name) +#endif /* SHARED */ + +/* uClibc does not support versioning yet. */ +#define versioned_symbol(lib, local, symbol, version) /* weak_alias(local, symbol) */ +#define hidden_ver(local, name) /* strong_alias(local, __GI_##name) */ +#define hidden_data_ver(local, name) /* strong_alias(local,__GI_##name) */ + +#if !defined NOT_IN_libc +# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libc_hidden_def(name) hidden_def (name) +# define libc_hidden_weak(name) hidden_weak (name) +# define libc_hidden_ver(local, name) hidden_ver (local, name) +# define libc_hidden_data_def(name) hidden_data_def (name) +# define libc_hidden_data_weak(name) hidden_data_weak (name) +# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define libc_hidden_proto(name, attrs...) +# define libc_hidden_def(name) +# define libc_hidden_weak(name) +# define libc_hidden_ver(local, name) +# define libc_hidden_data_def(name) +# define libc_hidden_data_weak(name) +# define libc_hidden_data_ver(local, name) #endif -#ifdef __USE_LARGEFILE64 -extern int __lockf64 (int __fd, int __cmd, __off64_t __len) attribute_hidden; -extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence) __THROW attribute_hidden; + +#if defined NOT_IN_libc && defined IS_IN_rtld +# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define rtld_hidden_def(name) hidden_def (name) +# define rtld_hidden_weak(name) hidden_weak (name) +# define rtld_hidden_ver(local, name) hidden_ver (local, name) +# define rtld_hidden_data_def(name) hidden_data_def (name) +# define rtld_hidden_data_weak(name) hidden_data_weak (name) +# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define rtld_hidden_proto(name, attrs...) +# define rtld_hidden_def(name) +# define rtld_hidden_weak(name) +# define rtld_hidden_ver(local, name) +# define rtld_hidden_data_def(name) +# define rtld_hidden_data_weak(name) +# define rtld_hidden_data_ver(local, name) #endif -/* #include */ -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 abort __abort -#define fprintf __fprintf -#define fclose __fclose -#ifndef __USE_FILE_OFFSET64 -#define fopen __fopen +#if defined NOT_IN_libc && defined IS_IN_libm +# define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libm_hidden_def(name) hidden_def (name) +# define libm_hidden_weak(name) hidden_weak (name) +# define libm_hidden_ver(local, name) hidden_ver (local, name) +# define libm_hidden_data_def(name) hidden_data_def (name) +# define libm_hidden_data_weak(name) hidden_data_weak (name) +# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name) #else -#define fopen __fopen64 +# define libm_hidden_proto(name, attrs...) +# define libm_hidden_def(name) +# define libm_hidden_weak(name) +# define libm_hidden_ver(local, name) +# define libm_hidden_data_def(name) +# define libm_hidden_data_weak(name) +# define libm_hidden_data_ver(local, name) #endif -#ifdef __USE_LARGEFILE64 -#define fopen64 __fopen64 + +#if defined NOT_IN_libc && defined IS_IN_libresolv +# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libresolv_hidden_def(name) hidden_def (name) +# define libresolv_hidden_weak(name) hidden_weak (name) +# define libresolv_hidden_ver(local, name) hidden_ver (local, name) +# define libresolv_hidden_data_def(name) hidden_data_def (name) +# define libresolv_hidden_data_weak(name) hidden_data_weak (name) +# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define libresolv_hidden_proto(name, attrs...) +# define libresolv_hidden_def(name) +# define libresolv_hidden_weak(name) +# define libresolv_hidden_ver(local, name) +# define libresolv_hidden_data_def(name) +# define libresolv_hidden_data_weak(name) +# define libresolv_hidden_data_ver(local, name) #endif -/* #include */ -extern char *__getenv (__const char *__name) attribute_hidden; -extern void __exit (int __status) __THROW __attribute__ ((__noreturn__)) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_librt +# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define librt_hidden_def(name) hidden_def (name) +# define librt_hidden_weak(name) hidden_weak (name) +# define librt_hidden_ver(local, name) hidden_ver (local, name) +# define librt_hidden_data_def(name) hidden_data_def (name) +# define librt_hidden_data_weak(name) hidden_data_weak (name) +# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define librt_hidden_proto(name, attrs...) +# define librt_hidden_def(name) +# define librt_hidden_weak(name) +# define librt_hidden_ver(local, name) +# define librt_hidden_data_def(name) +# define librt_hidden_data_weak(name) +# define librt_hidden_data_ver(local, name) +#endif -/* #include */ -extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set, - __sigset_t *__restrict __oset) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_libdl +# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libdl_hidden_def(name) hidden_def (name) +# define libdl_hidden_weak(name) hidden_weak (name) +# define libdl_hidden_ver(local, name) hidden_ver (local, name) +# define libdl_hidden_data_def(name) hidden_data_def (name) +# define libdl_hidden_data_weak(name) hidden_data_weak (name) +# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define libdl_hidden_proto(name, attrs...) +# define libdl_hidden_def(name) +# define libdl_hidden_weak(name) +# define libdl_hidden_ver(local, name) +# define libdl_hidden_data_def(name) +# define libdl_hidden_data_weak(name) +# define libdl_hidden_data_ver(local, name) +#endif -/* #include */ -extern int __ioctl (int __fd, unsigned long int __request, ...) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_libintl +# define libintl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libintl_hidden_def(name) hidden_def (name) +# define libintl_hidden_weak(name) hidden_weak (name) +# define libintl_hidden_ver(local, name) hidden_ver (local, name) +# define libintl_hidden_data_def(name) hidden_data_def (name) +# define libintl_hidden_data_weak(name) hidden_data_weak (name) +# define libintl_hidden_data_ver(local, name) hidden_data_ver(local, name) +#else +# define libintl_hidden_proto(name, attrs...) +# define libintl_hidden_def(name) +# define libintl_hidden_weak(name) +# define libintl_hidden_ver(local, name) +# define libintl_hidden_data_def(name) +# define libintl_hidden_data_weak(name) +# define libintl_hidden_data_ver(local, name) +#endif -/* #include */ -extern int __socket (int __domain, int __type, int __protocol) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_libnsl +# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libnsl_hidden_def(name) hidden_def (name) +# define libnsl_hidden_weak(name) hidden_weak (name) +# define libnsl_hidden_ver(local, name) hidden_ver (local, name) +# define libnsl_hidden_data_def(name) hidden_data_def (name) +# define libnsl_hidden_data_weak(name) hidden_data_weak (name) +# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define libnsl_hidden_proto(name, attrs...) +# define libnsl_hidden_def(name) +# define libnsl_hidden_weak(name) +# define libnsl_hidden_ver(local, name) +# define libnsl_hidden_data_def(name) +# define libnsl_hidden_data_weak(name) +# define libnsl_hidden_data_ver(local, name) +#endif -/* #include */ -#ifndef __USE_FILE_OFFSET64 -struct stat; -extern int __stat (__const char *__restrict __file, - struct stat *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden; -extern int __fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)) attribute_hidden; -extern int __lstat (__const char *__restrict __file, - struct stat *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_libutil +# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libutil_hidden_def(name) hidden_def (name) +# define libutil_hidden_weak(name) hidden_weak (name) +# define libutil_hidden_ver(local, name) hidden_ver (local, name) +# define libutil_hidden_data_def(name) hidden_data_def (name) +# define libutil_hidden_data_weak(name) hidden_data_weak (name) +# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name) #else -# ifdef __REDIRECT_NTH -extern int __REDIRECT_NTH (__stat, (__const char *__restrict __file, - struct stat *__restrict __buf), __stat64) - __nonnull ((1, 2)) attribute_hidden; -extern int __REDIRECT_NTH (__fstat, (int __fd, struct stat *__buf), __fstat64) - __nonnull ((2)) attribute_hidden; -extern int __REDIRECT_NTH (__lstat, - (__const char *__restrict __file, - struct stat *__restrict __buf), __lstat64) - __nonnull ((1, 2)) attribute_hidden; -# else -# define __stat __stat64 -# define __fstat __fstat64 -# define __lstat __lstat64 -# endif +# define libutil_hidden_proto(name, attrs...) +# define libutil_hidden_def(name) +# define libutil_hidden_weak(name) +# define libutil_hidden_ver(local, name) +# define libutil_hidden_data_def(name) +# define libutil_hidden_data_weak(name) +# define libutil_hidden_data_ver(local, name) #endif -#ifdef __USE_LARGEFILE64 -struct stat64; -extern int __stat64 (__const char *__restrict __file, - struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)) attribute_hidden; -extern int __fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)) attribute_hidden; -extern int __lstat64 (__const char *__restrict __file, - struct stat64 *__restrict __buf) - __THROW __nonnull ((1, 2)) attribute_hidden; + +#if defined NOT_IN_libc && defined IS_IN_libcrypt +# define libcrypt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libcrypt_hidden_def(name) hidden_def (name) +# define libcrypt_hidden_weak(name) hidden_weak (name) +# define libcrypt_hidden_ver(local, name) hidden_ver (local, name) +# define libcrypt_hidden_data_def(name) hidden_data_def (name) +# define libcrypt_hidden_data_weak(name) hidden_data_weak (name) +# define libcrypt_hidden_data_ver(local, name) hidden_data_ver (local, name) +#else +# define libcrypt_hidden_proto(name, attrs...) +# define libcrypt_hidden_def(name) +# define libcrypt_hidden_weak(name) +# define libcrypt_hidden_ver(local, name) +# define libcrypt_hidden_data_def(name) +# define libcrypt_hidden_data_weak(name) +# define libcrypt_hidden_data_ver(local, name) #endif -/* #include */ -#ifndef __USE_FILE_OFFSET64 -struct statfs; -extern int __statfs (__const char *__file, struct statfs *__buf) - __THROW __nonnull ((1, 2)) attribute_hidden; -extern int __fstatfs (int __fildes, struct statfs *__buf) - __THROW __nonnull ((2)) attribute_hidden; +#if defined NOT_IN_libc && defined IS_IN_libpthread +# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libpthread_hidden_def(name) hidden_def (name) +# define libpthread_hidden_weak(name) hidden_weak (name) +# define libpthread_hidden_ver(local, name) hidden_ver (local, name) +# def