about summary refs log tree commit diff
path: root/misc/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* Installed-header hygiene (BZ#20366): time.h types.Zack Weinberg2016-09-231-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many headers are expected to expose a subset of the type definitions in time.h. time.h has a whole bunch of messy logic for conditionally defining some its types and structs, but, as best I can tell, this has never worked 100%. In particular, __need_timespec is ineffective if _TIME_H has already been defined, which means that if you compile #include <time.h> #include <sched.h> with e.g. -fsyntax-only -std=c89 -Wall -Wsystem-headers, you will get In file included from test.c:2:0: /usr/include/sched.h:74:57: warning: "struct timespec" declared inside parameter list will not be visible outside of this definition or declaration extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; ^~~~~~~~ And if you want to _use_ sched_rr_get_interval in a TU compiled that way, you're hosed. This patch replaces all of that with small bits/types/TYPE.h headers as introduced earlier. time.h and bits/time.h are now *much* simpler, and a lot of other headers are slightly simpler. * time/time.h, bits/time.h, sysdeps/unix/sysv/linux/bits/time.h: Remove all logic conditional on __need macros. Move all the conditionally defined types to their own headers... * time/bits/types/clock_t.h: Define clock_t here. * time/bits/types/clockid_t.h: Define clockid_t here. * time/bits/types/struct_itimerspec.h: Define struct itimerspec here. * time/bits/types/struct_timespec.h: Define struct timespec here. * time/bits/types/struct_timeval.h: Define struct timeval here. * time/bits/types/struct_tm.h: Define struct tm here. * time/bits/types/time_t.h: Define time_t here. * time/bits/types/timer_t.h: Define timer_t here. * time/Makefile: Install the new headers. * bits/resource.h, io/fcntl.h, io/sys/poll.h, io/sys/stat.h * io/utime.h, misc/sys/select.h, posix/sched.h, posix/sys/times.h * posix/sys/types.h, resolv/netdb.h, rt/aio.h, rt/mqueue.h * signal/signal.h, pthread/semaphore.h, sysdeps/nptl/pthread.h * sysdeps/unix/sysv/linux/alpha/bits/resource.h * sysdeps/unix/sysv/linux/alpha/sys/acct.h * sysdeps/unix/sysv/linux/bits/resource.h * sysdeps/unix/sysv/linux/bits/timex.h * sysdeps/unix/sysv/linux/mips/bits/resource.h * sysdeps/unix/sysv/linux/net/ppp_defs.h * sysdeps/unix/sysv/linux/sparc/bits/resource.h * sysdeps/unix/sysv/linux/sys/acct.h * sysdeps/unix/sysv/linux/sys/timerfd.h * sysvipc/sys/msg.h, sysvipc/sys/sem.h, sysvipc/sys/shm.h * time/sys/time.h, time/sys/timeb.h Use the new bits/types headers. * include/time.h: Remove __need logic. * include/bits/time.h * include/bits/types/clock_t.h, include/bits/types/clockid_t.h * include/bits/types/time_t.h, include/bits/types/timer_t.h * include/bits/types/struct_itimerspec.h * include/bits/types/struct_timespec.h * include/bits/types/struct_timeval.h * include/bits/types/struct_tm.h: New wrapper headers.
* Installed-header hygiene (BZ#20366): Simple self-contained fixes.Zack Weinberg2016-09-231-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some headers did not include all of their prerequisite headers. * rpcsvc/nislib.h: Include rpcsvc/nis.h. * sysdeps/unix/sysv/linux/netrose/rose.h: Include sys/socket.h and netax25/ax25.h. <endian.h> only defines BYTE_ORDER, BIG_ENDIAN, LITTLE_ENDIAN, etc. under __USE_MISC; glibc's headers should use __BYTE_ORDER, __BIG_ENDIAN, __LITTLE_ENDIAN, etc. instead. * inet/netinet/icmp6.h, inet/netinet/ip6.h * resolv/arpa/nameser_compat.h: Use __BYTE_ORDER etc. instead of BYTE_ORDER etc. sys/types.h only conditionally defines caddr_t and clockid_t. * sysdeps/unix/sysv/linux/sys/quota.h: Use __caddr_t instead of caddr_t. * sysdeps/unix/sysv/linux/sys/timerfd.h: Use __clockid_t instead of clockid_t. Remove a #warning that was the sole actual problem with using sys/ipc.h without _GNU_SOURCE/_XOPEN_SOURCE. * sysvipc/sys/ipc.h: Remove unnecessary #warning. _LIBC, __USE_XOPEN2K8, and __STDC_VERSION__ are not always defined. It seems to me that _LIBC should not appear in installed headers, but avoiding that for argp specifically would require more surgery than feels appropriate for this patch set. It's possible that "#ifdef _LIBC" would be sufficient, but I wanted to be conservative. All three versions of bits/socket.h want to know whether __flexarr will produce a real flexible array member -- specifically, one that doesn't alter sizeof(the structure containing it). They were testing for this with a complicated #if condition that did not agree with sys/cdefs.h and that tripped -Wundef warnings under -std=c90. I added a new macro to sys/cdefs.h, __glibc_c99_flexarr_available, which reveals exactly what these headers want to know. I also took the opportunity to flatten the rather messy conditional nest defining __flexarr. * argp/argp.h: Check whether _LIBC is defined before expanding it. * posix/glob.h: Check whether __USE_XOPEN2K8 is defined instead of expanding it. * misc/sys/cdefs.h: Tidy up conditional nest defining __flexarr. Define __glibc_c99_flexarr_available to 1 when the compiler supports C99-compatible flexible array members, 0 otherwise. * sysdeps/unix/sysv/linux/bits/socket.h * sysdeps/mach/hurd/bits/socket.h * bits/socket.h: Use __glibc_c99_flexarr_available in definitions of struct cmsghdr and CMSG_DATA.
* Deprecate inclusion of <sys/sysmacros.h> by <sys/types.h>Zack Weinberg2016-08-031-3/+59
| | | | | | | | | | | | | | | | | The macros defined by <sys/sysmacros.h> are not part of POSIX nor XSI, and their names frequently collide with user code; see for instance glibc bug 19239 and Red Hat bug 130601. <stdlib.h> includes <sys/types.h> under _GNU_SOURCE, and C++ code presently cannot avoid being compiled under _GNU_SOURCE, exacerbating the problem. * NEWS: Inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. * misc/sys/sysmacros.h: If __SYSMACROS_DEPRECATED_INCLUSION is defined, define major, minor, and makedev to issue deprecation warnings on use. If __SYSMACROS_DEPRECATED_INCLUSION is *not* defined, suppress previously-activated deprecation warnings for these macros and prevent subsequent inclusions of this header from having any effect. * posix/sys/types.h: Define __SYSMACROS_DEPRECATED_INCLUSION before including <sys/sysmacros.h>, and undefine it again afterward.
* Minimize sysdeps code involved in defining major/minor/makedev.Zack Weinberg2016-08-031-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently sys/sysmacros.h is entirely defined in sysdeps. This would mean that the deprecation logic coming up in the next patch would have to be written twice (in generic/ and unix/sysv/linux/). To avoid that, hoist all but the unavoidably system-dependent logic to misc/, leaving a bits/ header behind. This also promotes the Linux-specific encoding of dev_t, which accommodates 32-bit major and minor numbers in a 64-bit dev_t, to generic, as glibc's dev_t is always 64 bits wide. The former Linux implementation used inline functions to avoid evaluating arguments more than once. After this change, all platforms use inline functions, which means that three new symbols are added to the generic ABI. (These symbols are in the user namespace, which is how they have always been on Linux. They begin with "gnu_dev_", so collisions with user code are pretty unlikely.) New ports henceforth need only provide a bits/sysmacros.h defining internal macros __SYSMACROS_{DECLARE,DEFINE}_{MAJOR,MINOR,MAKEDEV}. This is only necessary if the kernel encoding is incompatible with the now-generic encoding (for instance, it would be necessary for FreeBSD). While I was at it, I added a basic round-trip test for these functions. * sysdeps/generic/sys/sysmacros.h: Delete file. * sysdeps/unix/sysv/linux/makedev.c: Delete file. * sysdeps/unix/sysv/linux/sys/sysmacros.h: Move file ... * bits/sysmacros.h: ... here; this encoding is now the generic encoding. Now defines only the following macros: __SYSMACROS_DECLARE_MAJOR, __SYSMACROS_DEFINE_MAJOR, __SYSMACROS_DECLARE_MINOR, __SYSMACROS_DEFINE_MINOR, __SYSMACROS_DECLARE_MAKEDEV, __SYSMACROS_DEFINE_MAKEDEV. * misc/sys/sysmacros.h, misc/makedev.c: New files that use bits/sysmacros.h and the above new macros to generate the public implementations of major, minor, and makedev. * misc/tst-makedev.c: New test. * include/sys/sysmacros.h: New wrapper. * misc/Makefile (headers): Add sys/sysmacros.h, bits/sysmacros.h. (routines): Add makedev. (tests): Add tst-makedev. * misc/Versions [GLIBC_2.25]: Add gnu_dev_major, gnu_dev_minor, gnu_dev_makedev. * posix/Makefile (headers): Remove sys/sysmacros.h. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove makedev. * sysdeps/arm/nacl/libc.abilist: Add GLIBC_2.25, gnu_dev_major, gnu_dev_makedev, gnu_dev_minor. * sysdeps/unix/sysv/linux/aarch64/libc.abilist * sysdeps/unix/sysv/linux/alpha/libc.abilist * sysdeps/unix/sysv/linux/arm/libc.abilist * sysdeps/unix/sysv/linux/hppa/libc.abilist * sysdeps/unix/sysv/linux/i386/libc.abilist * sysdeps/unix/sysv/linux/ia64/libc.abilist * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist * sysdeps/unix/sysv/linux/microblaze/libc.abilist * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist * sysdeps/unix/sysv/linux/nios2/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist * sysdeps/unix/sysv/linux/sh/libc.abilist * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Add GLIBC_2.25.
* Add utility macros for clang detection, and deprecation with messages.Zack Weinberg2016-08-031-1/+21
| | | | | | | | | | | | | | | | | | | | | There are three new macros added to features.h and sys/cdefs.h: * __glibc_clang_prereq: just like __GNUC_PREREQ, but for clang. * __glibc_clang_has_extension: wraps clang's intrinsic __has_extension. Writing "#if defined __clang__ && __has_extension (...)" doesn't work, because compilers other than clang will object to the unknown macro __has_extension even though they don't need to evaluate it. Instead, write "#if __glibc_clang_has_extension (...)". * __attribute_deprecated_msg__(msg): like __attribute_deprecated__, but if possible, prints a message. The first two are used to define the third. The third will be used in subsequent patches. * include/features.h (__glibc_clang_prereq): New macro. * misc/sys/cdefs.h (__glibc_clang_has_extension) (__attribute_deprecated_msg__): New macros.
* Bug 20215: Always undefine __always_inline before defining it.Carlos O'Donell2016-06-101-0/+5
| | | | | | The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with the definition in misc/sys/cdefs.h. To fix this we undefine it first and always use the glibc definition.
* Fix sys/time.h timespec namespace (bug 20041).Joseph Myers2016-05-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For UNIX98 and older standards, sys/time.h should not define struct timespec, but does so via the inclusion of sys/select.h (which is a new header in the 2001 edition of POSIX, and defines struct timespec because of the declaration of pselect, a new function in the 2001 edition of POSIX). In turn, this affects some other headers that themselves include sys/time.h. This patch fixes this by conditioning the __need_timespec definition in sys/select.h on __USE_XOPEN2K, the same condition used there for the declaration of pselect (this has no effect on direct uses of sys/select.h with feature test macros for any standard that includes that header, since such standards result in __USE_XOPEN2K being defined). Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #20041] * misc/sys/select.h (__need_timespec): Only define if [__USE_XOPEN2K]. * conform/Makefile (test-xfail-XPG4/sys/time.h/conform): Remove variable. (test-xfail-XPG4/utmpx.h/conform): Likewise. (test-xfail-UNIX98/sys/time.h/conform): Likewise. (test-xfail-UNIX98/utmpx.h/conform): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-0411-11/+11
|
* Use HOST_NAME_MAX for MAXHOSTNAMELEN in <sys/param.h>.Roland McGrath2015-09-151-0/+3
|
* Add ersatz _Static_assert on older C hostsPaul Eggert2015-02-071-0/+8
| | | | | * misc/sys/cdefs.h (_Static_assert): Define a substitute, if on a pre-C11 C platform that is not known to support _Static_assert.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-0211-11/+11
|
* Make __extern_always_inline usable on clang++ againSiddhesh Poyarekar2014-09-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for BZ #17266 (884ddc5081278f488ef8cd49951f41cfdbb480ce) removed changes that had gone into cdefs.h to make __extern_always_inline usable with clang++. This patch adds back support for clang to detect if GNU inlining semantics are available, this time without breaking the gcc use case. The check put here is based on the earlier patch and assertion[1] that checking if __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ is defined is sufficient to determine that clang++ suports GNU inlining semantics. Tested with a simple program that builds with __extern_always_inline with the patch and fails compilation without it. #include <stdio.h> #include <sys/cdefs.h> extern void foo_alias (void) __asm ("foo"); __extern_always_inline void foo (void) { puts ("hi oh world!"); return foo_alias (); } void foo_alias (void) { puts ("hell oh world"); } int main () { foo (); } [1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html [BZ #17266] * misc/sys/cdefs.h: Define __extern_always_inline for clang 4.2 and newer.
* Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266)Siddhesh Poyarekar2014-09-161-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may not be sufficient since those flags were added during initial support for C99 inlining semantics. There is also a problem with always defining __extern_inline and __extern_always_inline, since it enables inline wrapper functions even when GNU inlining semantics are not guaranteed. This, along with the possibility of such wrappers using redirection (btowc for example) could result in compiler generating an infinitely recusrive call to the function. In fact it was such a recursion that led to this code being written the way it was; see: https://bugzilla.redhat.com/show_bug.cgi?id=186410 The initial change was to fix bugs 14530 and 13741, but they can be resolved by checking if __fortify_function and/or __extern_always_inline are defined, as it has been done in this patch. In addition, I have audited uses of __extern_always_inline to make sure that none of the uses result in compilation errors. There is however a regression in this patch for llvm, since it reverts the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ definition imply proper extern inline semantics. 2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com> Jakub Jelinek <jakub@redhat.com> [BZ #17266] * libio/stdio.h: Check definition of __fortify_function instead of __extern_always_inline to include bits/stdio2.h. * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also check if __extern_always_inline is defined. [__USE_MISC || __USE_XOPEN]: Likewise. [__USE_ISOC99] Likewise. * misc/sys/cdefs.h (__fortify_function): Define only if __extern_always_inline is defined. [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining __extern_always_inline and __extern_inline only for g++-4.3 and newer or a compatible gcc.
* Fix Wundef warning for __STDC_VERSION__Siddhesh Poyarekar2014-07-031-1/+3
| | | | | | | | c4c4124473c187b5c4642611390897666c3d3970 added the _Noreturn macro for pre-C11 compilers, but it now throws a new Wundef warning during `make check` for __STDC_VERSION__ which gcc does not define by default. The following patch fixes this in line with other uses of __STDC_VERSION__ in the file.
* misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilersPaul Eggert2014-07-021-0/+8
| | | | | | | 2014-07-02 Will Newton <will.newton@linaro.org> Paul Eggert <eggert@cs.ucla.edu> * misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers.
* misc/sys/xattr.h: guard against linux uapi header inclusionSerge Hallyn2014-03-181-0/+2
| | | | | | | | | | | | | | | | If the glibc xattr.h header is included after the uapi header, compilation fails due to an enum re-using a #define from the uapi header. Protect against this by guarding the define and enum inclusions against each other. (A corresponding kernel patch has been sent here: http://lkml.org/lkml/2014/3/7/331 ) (See https://lists.debian.org/debian-glibc/2014/03/msg00029.html and https://sourceware.org/glibc/wiki/Synchronizing_Headers for more information.) Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
* misc/sys/select.h (__FD_MASK): Avoid signed integer overflow.Florian Weimer2014-02-251-1/+1
| | | | | | | Shifting into the sign position is currently supported as a GCC extension, but explicitly subjected to future changes. Computation in the unsigned type followed by a cast to the signed type is a GCC extension that will be available forever.
* Complete _BSD_SOURCE / _SVID_source followup cleanup.Joseph Myers2014-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completes the headers cleanup consequent on removal of _BSD_SOURCE and _SVID_SOURCE (apart from any subsequent deprecations): * #endif conditionals that referred to BSD or SVID are updated. * Redundant __USE_* tests in cases involving __USE_MISC are removed. This includes cases such as __USE_MISC || __USE_ISOC99, where __USE_MISC is redundant (because __USE_MISC is only ever defined in the default / _DEFAULT_SOURCE / _GNU_SOURCE case, when __USE_ISOC99 is also defined; the same applies to the non-XSI-extended POSIX versions), and cases involving __USE_GNU, where __USE_GNU is redundant (because if __USE_GNU is defined, so are the other __USE_* macros). There may well be other cases of __USE_FOO || __USE_BAR tests that could be simplified because one macro implies the other; this patch only addresses cases involving __USE_MISC. Tested x86_64. * bits/fcntl.h [__USE_MISC]: Remove redundant conditionals. * bits/sigaction.h [__USE_MISC]: Likewise. * bits/waitstatus.h: Update #endif comments. * ctype/ctype.h: Likewise. * dirent/dirent.h: Likewise. [__USE_MISC]: Remove redundant conditionals. * grp/grp.h: Update #endif comments. [__USE_GNU]: Remove redundant conditionals. [__USE_MISC]: Likewise. * inet/netinet/in.h [__USE_GNU]: Likewise. * io/sys/stat.h [__USE_MISC]: Likewise. * libio/bits/stdio-ldbl.h [__USE_MISC]: Likewise. * libio/bits/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * libio/bits/stdio2.h [__USE_MISC]: Likewise. * libio/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * math/bits/math-finite.h [__USE_MISC]: Likewise. * math/bits/mathcalls.h [__USE_MISC]: Likewise. * math/math.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. * misc/sys/uio.h: Update #endif comments. * posix/bits/unistd.h [__USE_MISC]: Remove redundant conditionals. * posix/glob.h [__USE_MISC]: Likewise. * posix/sys/types.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/sys/wait.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/unistd.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * pwd/pwd.h [__USE_GNU]: Likewise. [__USE_MISC]: Likewise. * resolv/netdb.h [__USE_GNU]: Likewise. * signal/signal.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * stdlib/stdlib.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. [__USE_GNU]: Likewise. * string/bits/string2.h [__USE_MISC]: Likewise. * string/string.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/unix/sysv/linux/bits/in.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/x86/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/x86/bits/string.h: Update #endif comments. * sysdeps/x86/fpu/bits/mathinline.h [__USE_MISC]: Remove redundant conditionals. * time/sys/time.h: Update #endif comments. * time/time.h: Likewise. [__USE_MISC]: Remove redundant conditionals.
* Combine __USE_BSD and __USE_SVID into __USE_MISC.Joseph Myers2014-02-123-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up following the obsoletion of _BSD_SOURCE and _SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC. The only non-mechanical part of this patch is the changes to features.h; everything else is simple substitution of __USE_MISC for the old macros. Thus, this patch leaves obviously redundant conditionals such as "defined __USE_MISC || defined __USE_MISC", and does not update #endif comments where they referred to BSD or SVID in words instead of the literal macro name. This is intended to facilitate patch review by separating the less mechanical changes from these purely mechanical changes into a separate patch. (I do intend to integrate all the changes from <https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I believe includes all the trailing comment updates, in subsequent patches.) Tested x86_64. * include/features.h (__USE_BSD): Remove macro definitions. (__USE_SVID): Likewise. (_BSD_SOURCE): Likewise. (_SVID_SOURCE): Likewise. [!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition from definition of _DEFAULT_SOURCE. [_BSD_SOURCE || _SVID_SOURCE]: Change condition to [_DEFAULT_SOURCE]. * bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC]. * bits/mman.h [__USE_BSD]: Likewise. * bits/termios.h [__USE_BSD]: Likewise. * bits/waitstatus.h [__USE_BSD]: Likewise. * ctype/ctype.h [__USE_SVID]: Likewise. * dirent/dirent.h [__USE_BSD]: Likewise. * grp/grp.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * inet/netinet/igmp.h [__USE_BSD]: Likewise. * io/fcntl.h [__USE_BSD]: Likewise. * io/ftw.h [__USE_BSD]: Likewise. * io/sys/stat.h [__USE_BSD]: Likewise. * libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise. * libio/bits/stdio2.h [__USE_BSD]: Likewise. * libio/stdio.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * math/math.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise. * misc/bits/syslog.h [__USE_BSD]: Likewise. * misc/search.h [__USE_SVID]: Likewise. * misc/sys/mman.h [__USE_BSD]: Likewise. * misc/sys/syslog.h [__USE_BSD]: Likewise. * misc/sys/uio.h [__USE_BSD]: Likewise. * posix/bits/unistd.h [__USE_BSD]: Likewise. * posix/glob.h [__USE_BSD]: Likewise. * posix/regex.h [__USE_BSD]: Likewise. * posix/sys/types.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * posix/sys/utsname.h [__USE_SVID]: Likewise. * posix/sys/wait.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * posix/unistd.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * pwd/pwd.h [__USE_SVID]: Likewise. * resolv/netdb.h [__USE_BSD]: Likewise. * setjmp/setjmp.h [__USE_BSD]: Likewise. * signal/signal.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * socket/sys/socket.h [__USE_BSD]: Likewise. * stdlib/fmtmsg.h [__USE_SVID]: Likewise. * stdlib/stdlib.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * string/bits/string2.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * string/bits/string3.h [__USE_BSD]: Likewise. * string/endian.h [__USE_BSD]: Likewise. * string/string.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * string/strings.h [__USE_BSD]: Likewise. * sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise. * sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/x86/bits/string.h [__USE_BSD]: Likewise. * sysvipc/sys/ipc.h [__USE_SVID]: Likewise. * termios/termios.h [__USE_BSD]: Likewise. * time/sys/time.h [__USE_BSD]: Likewise. * time/time.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change condition to [__USE_MISC].
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-0111-11/+11
|
* Add error reporting (via errno) to getauxval().Brooks Moses2013-12-181-2/+2
| | | | | | | | | | | | [BZ 15846] As discussed in the recent thread on my $EXEC_ORIGIN patch and in BZ 15846, getauxval() presently has no unambiguous way of reporting an error condition. It currently returns zero on error, but this may also be a valid result for some auxv entries. As there is no clear invalid result for all current and future auxv entries, this patch sets errno (following a suggestion in the BZ entry). This version of the patch also adds documentation and tests for the value-not-found conditions in getauxval().
* Only defined DEV_BSIZE if not already defined.Aurelien Jarno2013-05-081-1/+3
|
* Use __gnu_inline__ for __extern_always_inline in g++-4.2Richard Smith2013-05-011-8/+6
| | | | | | | | | | | | | Use the __gnu_inline__ attribute in _FORTIFY_SOURCE's __extern_always_inline macro whenever the compiler supports it. Previously this macro only included the __gnu_inline__ attribute in C++ mode for gcc >= 4.3. However, __gnu_inline__ semantics are always desired for the __extern_always_inline functions, and are available in g++ 4.2 (and some releases of g++ 4.1, and also in Clang, which claims to be g++ 4.2). This change stops g++-4.2 from emitting weak definitions for the fortify wrapper functions if they can't be inlined, and also improves Clang compatibility.
* sys/cdefs.h: export __attribute_alloc_size__Mike Frysinger2013-02-181-0/+9
| | | | | | | | Since we want to use this in installed headers, move it to the installed sys/cdefs.h. This requires a slight tweaking of the name (add trailing underscores). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Remove __ptrvalue, __bounded and __unbounded.Joseph Myers2013-02-131-8/+0
|
* Fix a typo in the mremap comment.Roland McGrath2013-02-111-1/+1
|
* Whitespace fix for __glibc_likely/__glibc_unlikely defns.Roland McGrath2013-01-231-4/+4
|
* Fix copyright notice corruption from update-copyright bug.Joseph Myers2013-01-022-2/+2
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-0211-13/+11
|
* Add __glibc_likely as an alias for __builtin_expect when availableSiddhesh Poyarekar2012-12-281-0/+2
|
* Fix up definitions for older compilers.Marek Polacek2012-09-261-1/+8
|
* Split sys/param.h out into common file and sysdeps bits/param.h file.Roland McGrath2012-08-171-0/+101
|
* Fix LOG_MAKEPRI to agree with BSDAndreas Schwab2012-07-101-2/+2
|
* Wrap __builtin_expect in pthread.hSiddhesh Poyarekar2012-06-041-0/+6
| | | | | | [BZ #14188] This fixes compilation of programs using pthread_cleanup_push built with non-gcc compilers and older gcc compilers.
* * misc/getauxval.c (__getauxval): Use unsigned long int.Richard Henderson2012-05-211-2/+3
| | | | | * misc/sys/auxv.h: Include <sys/cdefs.h>. (getauxval): Use unsigned long int.
* Add <sys/auxv.h> and getauxval.Richard Henderson2012-05-201-0/+35
|
* Fix attributes for fortify functions.Marek Polacek2012-04-292-13/+12
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-099-27/+18
|
* Remove pre-ISO C supportUlrich Drepper2012-01-075-36/+33
| | | | No more __const.
* Mark setjmp and ucontext functions as non-leafAndreas Schwab2011-11-111-0/+4
|
* Don't mark memory synchronisation functions as leafAndreas Schwab2011-10-271-1/+6
|
* Fix syntax error in __THROW macroAndreas Schwab2011-10-171-2/+2
|
* Use leaf function attribute in __THROWUlrich Drepper2011-10-161-3/+12
|
* Avoid macro clash between <sys/select.h> and <linux/posix_types.h>Andreas Schwab2011-09-131-5/+3
|
* Add range checking for FD_SET, FD_CLR, and FD_ISSETUlrich Drepper2011-09-081-1/+7
|
* Add const attr to gnu_dev_{major,minor,makedev}Marek Polacek2011-07-201-1/+8
|
* Fix preadv, pwritev and fallocate for -D_FILE_OFFSET_BITS=64.Jakub Jelinek2009-11-061-2/+2
| | | | | | | | As reported in http://bugzilla.redhat.com/533063 , preadv/pwritev prototypes are wrong on 32-bit arches with -D_FILE_OFFSET_BITS=64 and as I've just found, fallocate is wrong too. The problem is that only off_t is remapped to the 64-bit type transparently, __off_t is not.
* Fix warnings when using <sys/select.h>.Ulrich Drepper2009-06-141-2/+2
| | | | | gcc 4.4 is more picky. And the x86-64 version of <bits/select.h> contained a now unnecessary asm optimization. Remove it.
* * sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.Ulrich Drepper2009-04-231-4/+4
| | | | | | | | | | | | | | | | | | * sysdeps/unix/sysv/linux/pwritev.c: Likewise. 2009-04-23 Jakub Jelinek <jakub@redhat.com> * sysdeps/posix/pwritev.c (PWRITEV): Fix up comment. Copy data from vector to temporary buffer and call PWRITEV after it instead of vice versa. * sysdeps/posix/preadv.c: Fix up comment. * misc/preadv.c: Likewise. * misc/preadv64.c: Likewise. * misc/pwritev.c: Likewise. * misc/pwritev64.c: Likewise. * misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise. 2009-04-23 Ulrich Drepper <drepper@redhat.com>
* * misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.Ulrich Drepper2009-04-031-7/+76
| | | | | | | | | | | | | | | | | | | | | | * misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for GLIBC_2.10. * misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64. * sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv and pwritev. * misc/preadv.c: New file. * misc/preadv64.c: New file. * misc/pwritev.c: New file. * misc/pwritev64.c: New file. * sysdeps/posx/preadv.c: New file. * sysdeps/posx/preadv64.c: New file. * sysdeps/posx/pwritev.c: New file. * sysdeps/posx/pwritev64.c: New file. * sysdeps/unix/sysv/linux/preadv.c: New file. * sysdeps/unix/sysv/linux/preadv64.c: New file. * sysdeps/unix/sysv/linux/pwritev.c: New file. * sysdeps/unix/sysv/linux/pwritev64.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.