reduce spurious inclusion of libc.h
authorRich Felker <dalias@aerifal.cx>
Wed, 12 Sep 2018 04:08:09 +0000 (00:08 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 12 Sep 2018 18:34:37 +0000 (14:34 -0400)
commit5ce3737931bb411a8d167356d4d0287b53b0cbdc
tree726fc5dde9cc462316faa715158c38f0da72292d
parent0676c3a34c7bf12b33f8f5efb92476f4ffc7f20e
reduce spurious inclusion of libc.h

libc.h was intended to be a header for access to global libc state and
related interfaces, but ended up included all over the place because
it was the way to get the weak_alias macro. most of the inclusions
removed here are places where weak_alias was needed. a few were
recently introduced for hidden. some go all the way back to when
libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented)
cancellation points had to include it.

remaining spurious users are mostly callers of the LOCK/UNLOCK macros
and files that use the LFS64 macro to define the awful *64 aliases.

in a few places, new inclusion of libc.h is added because several
internal headers no longer implicitly include libc.h.

declarations for __lockfile and __unlockfile are moved from libc.h to
stdio_impl.h so that the latter does not need libc.h. putting them in
libc.h made no sense at all, since the macros in stdio_impl.h are
needed to use them correctly anyway.
193 files changed:
src/aio/aio.c
src/aio/aio_suspend.c
src/aio/lio_listio.c
src/conf/sysconf.c
src/crypt/crypt_r.c
src/ctype/isalnum.c
src/ctype/isalpha.c
src/ctype/isblank.c
src/ctype/iscntrl.c
src/ctype/isdigit.c
src/ctype/isgraph.c
src/ctype/islower.c
src/ctype/isprint.c
src/ctype/ispunct.c
src/ctype/isspace.c
src/ctype/isupper.c
src/ctype/iswalnum.c
src/ctype/iswalpha.c
src/ctype/iswblank.c
src/ctype/iswcntrl.c
src/ctype/iswctype.c
src/ctype/iswdigit.c
src/ctype/iswgraph.c
src/ctype/iswlower.c
src/ctype/iswprint.c
src/ctype/iswpunct.c
src/ctype/iswspace.c
src/ctype/iswupper.c
src/ctype/iswxdigit.c
src/ctype/isxdigit.c
src/ctype/tolower.c
src/ctype/toupper.c
src/ctype/towctrans.c
src/ctype/wctrans.c
src/dirent/closedir.c
src/env/__environ.c
src/env/clearenv.c
src/env/getenv.c
src/env/putenv.c
src/env/unsetenv.c
src/errno/strerror.c
src/fcntl/fcntl.c
src/fenv/fesetround.c
src/fenv/m68k/fenv.c
src/fenv/powerpc64/fenv.c
src/fenv/s390x/fenv.c
src/internal/dynlink.h
src/internal/fdpic_crt.h
src/internal/libc.h
src/internal/malloc_impl.h
src/internal/sh/__shcall.c
src/internal/stdio_impl.h
src/internal/syscall.h
src/ipc/msgrcv.c
src/ipc/msgsnd.c
src/ldso/__dlsym.c
src/ldso/dladdr.c
src/ldso/dlclose.c
src/ldso/dlerror.c
src/ldso/dlinfo.c
src/ldso/dlopen.c
src/ldso/tlsdesc.c
src/legacy/euidaccess.c
src/legacy/utmpx.c
src/linux/cache.c
src/linux/getdents.c
src/linux/setfsgid.c
src/linux/setfsuid.c
src/linux/sysinfo.c
src/linux/x32/sysinfo.c
src/locale/__lctrans.c
src/locale/dcngettext.c
src/locale/freelocale.c
src/locale/langinfo.c
src/locale/newlocale.c
src/locale/strcoll.c
src/locale/strxfrm.c
src/locale/textdomain.c
src/locale/wcscoll.c
src/locale/wcsxfrm.c
src/malloc/memalign.c
src/math/exp10.c
src/math/exp10f.c
src/math/exp10l.c
src/math/lgamma_r.c
src/math/lgammaf_r.c
src/math/lgammal.c
src/math/remainder.c
src/math/remainderf.c
src/math/signgam.c
src/misc/basename.c
src/misc/getopt.c
src/misc/pty.c
src/mman/madvise.c
src/mman/mremap.c
src/mman/munmap.c
src/multibyte/internal.h
src/network/accept.c
src/network/accept4.c
src/network/connect.c
src/network/dn_expand.c
src/network/ent.c
src/network/getnameinfo.c
src/network/inet_aton.c
src/network/lookup_serv.c
src/network/recvfrom.c
src/network/recvmsg.c
src/network/res_mkquery.c
src/network/res_query.c
src/network/res_send.c
src/network/resolvconf.c
src/network/sendmsg.c
src/network/sendto.c
src/passwd/pwf.h
src/process/execvp.c
src/process/posix_spawn.c
src/process/system.c
src/process/waitid.c
src/process/waitpid.c
src/search/hsearch.c
src/select/poll.c
src/select/pselect.c
src/select/select.c
src/signal/signal.c
src/signal/sigsetjmp_tail.c
src/signal/sigsuspend.c
src/signal/sigtimedwait.c
src/stat/futimesat.c
src/stdio/__fdopen.c
src/stdio/fclose.c
src/stdio/fgetpos.c
src/stdio/fmemopen.c
src/stdio/fopen.c
src/stdio/freopen.c
src/stdio/fscanf.c
src/stdio/fseek.c
src/stdio/fsetpos.c
src/stdio/ftell.c
src/stdio/fwscanf.c
src/stdio/getdelim.c
src/stdio/open_memstream.c
src/stdio/open_wmemstream.c
src/stdio/scanf.c
src/stdio/sscanf.c
src/stdio/swscanf.c
src/stdio/tmpfile.c
src/stdio/vfprintf.c
src/stdio/vfwprintf.c
src/stdio/vfwscanf.c
src/stdio/vscanf.c
src/stdio/vsscanf.c
src/stdio/vswprintf.c
src/stdio/vswscanf.c
src/stdio/vwscanf.c
src/stdio/wscanf.c
src/stdlib/strtod.c
src/stdlib/strtol.c
src/string/memrchr.c
src/string/stpcpy.c
src/string/stpncpy.c
src/string/strcasecmp.c
src/string/strchrnul.c
src/string/strerror_r.c
src/string/strlcpy.c
src/string/strncasecmp.c
src/string/wcsdup.c
src/temp/mkostemps.c
src/termios/cfsetospeed.c
src/termios/tcdrain.c
src/thread/__syscall_cp.c
src/thread/__tls_get_addr.c
src/thread/pthread_attr_setinheritsched.c
src/thread/pthread_cancel.c
src/thread/pthread_equal.c
src/thread/pthread_self.c
src/thread/pthread_testcancel.c
src/thread/x32/syscall_cp_fixup.c
src/time/asctime_r.c
src/time/clock_gettime.c
src/time/clock_nanosleep.c
src/time/gmtime_r.c
src/time/localtime_r.c
src/time/nanosleep.c
src/time/strftime.c
src/time/wcsftime.c
src/unistd/acct.c
src/unistd/close.c
src/unistd/dup3.c
src/unistd/pause.c
src/unistd/read.c
src/unistd/readv.c
src/unistd/write.c
src/unistd/writev.c