about summary refs log tree commit diff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix __get_nprocs fgets_unlocked namespace (bug 17582).Joseph Myers2014-11-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __get_nprocs is called from malloc code, but calls fgets_unlocked, which is not an ISO C or POSIX function. This patch fixes it to call a new __fgets_unlocked name instead. Note: there are various other uses of fgets_unlocked in glibc's libraries, and I haven't yet investigated which others might also be problematic (called directly or indirectly from standard functions) and so need to change to use __fgets_unlocked. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17582] * libio/iofgets.c [weak_alias && !_IO_MTSAFE_IO] (__fgets_unlocked): Add alias of _IO_fgets. Use libc_hidden_def. * libio/iofgets_u.c (fgets_unlocked): Rename to __fgets_unlocked and define as weak alias of __fgets_unlocked. Use libc_hidden_weak. (__fgets_unlocked): Use libc_hidden_def. * include/stdio.h (__fgets_unlocked): Declare. Use libc_hidden_proto. * sysdeps/unix/sysv/linux/getsysstats.c (phys_pages_info): Use __fgets_unlocked instead of fgets_unlocked. * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_CONF_PARSER): Likewise. * sysdeps/unix/sysv/linux/sparc/getsysstats.c (GET_NPROCS_CONF_PARSER): Likewise.
* Fix __printf_fp wmemset namespace (bug 17574).Joseph Myers2014-11-121-0/+2
| | | | | | | | | | | | | | | | | __printf_fp calls wmemset, but that is not an ISO C90 function. This patch fixes it to call a new __wmemset name instead (with wmemset being a weak alias). Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17574] * wcsmbs/wmemset.c (wmemset): Rename to __wmemset and define as weak alias of __wmemset. Use libc_hidden_weak. (__wmemset): Use libc_hidden_def. * include/wchar.h (__wmemset): Declare. Use libc_hidden_proto. * stdio-common/printf_fp.c (___printf_fp): Call __wmemset instead of wmemset.
* Fix stpcpy / mempcpy namespace (bug 17573).Joseph Myers2014-11-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various glibc functions call __stpcpy and __mempcpy for namespace reasons instead of plain stpcpy and mempcpy. But __stpcpy and __mempcpy are macros that call __builtin_stpcpy and __builtin_mempcpy, and unless GCC optimizes the calls, they end up calling the C functions stpcpy and mempcpy. For calls from within shared libc, libc_hidden_builtin_proto ensures that calls to those C functions are in turn mapped to call __GI_stpcpy and __GI_mempcpy. However, for static libc, and for calls from shared libraries other than libc, the ELF symbols stpcpy and mempcpy end up getting called, breaking the ISO C namespace (in the case of stpcpy) or glibc conventions about not relying on the "future library directions" reservations (in the case of mempcpy). This patch fixes this by adding declarations of these functions to include/string.h, under an appropriate condition, with __asm__ used to change the assembler name used for calls (the mempcpy case was previously discussed, and the approach for the fix is as I suggested in <https://sourceware.org/ml/libc-alpha/2013-02/msg00063.html>). Tested for x86_64 with the testsuite; also checked that dcigettext.o (an example previously noted of undesired calls to stpcpy and mempcpy) now calls __stpcpy and __mempcpy instead, as do non-libc shared libraries (__stpcpy and __mempcpy were already exported from shared libc). Disassembly of installed shared libraries isn't easy to compare because of reordered PLT entries resulting from the change in functions called (libnsl, libnss_compat, libnss_dns, libnss_files, libnss_hesiod, libnss_nis, libnss_nisplus, libpthread, librt all have such changes). [BZ #17573] * include/string.h [NOT_IN_libc || !SHARED] (mempcpy): Declare with asm name __mempcpy. [NOT_IN_libc || !SHARED] (stpcpy): Declare with asm name __stpcpy.
* Fix qsort_r namespace (bug 17571).Joseph Myers2014-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | qsort_r is defined in the same file as qsort, but is not an ISO C function, so should be a weak alias for __qsort_r. The uses in getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX function and qsort_r isn't. This patch implements this. Because nscd uses the getaddrinfo sources outside libc, as do the tst-rfc3484 tests, a #define of __qsort_r to qsort_r is added there alongside the similar defines for other libc-internal symbols used in getaddrinfo. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17571] * stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak alias of __qsort_r. (qsort): Call __qsort_r instead of qsort_r. * include/stdlib.h (qsort_r): Do not call libc_hidden_proto. (__qsort_r): Declare. Call libc_hidden_proto. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r instead of qsort_r. * nscd/gai.c (__qsort_r): Define to qsort_r. * posix/tst-rfc3484.c (__qsort_r): Likewise. * posix/tst-rfc3484-2.c (__qsort_r): Likewise. * posix/tst-rfc3484-3.c (__qsort_r): Likewise.
* Fix __getcwd rewinddir namespace (bug 17584).Joseph Myers2014-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __getcwd is called from dcigettext.o (brought in by various ISO C functionality), but calls rewinddir, which is not an ISO C function. This patch makes __getcwd call __rewinddir instead and makes rewinddir a weak alias for __rewinddir. Since getcwd.c is shared with gnulib (albeit not merged in either direction for a long time, and omitted from gnulib's config/srclist.txt list of shared files) I put in a #ifndef _LIBC define of __rewinddir to rewinddir, although a future merged version of getcwd could end up looking significantly different. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). [BZ #17584] * dirent/rewinddir.c (rewinddir): Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * sysdeps/mach/hurd/rewinddir.c: Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * sysdeps/posix/rewinddir.c: Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * include/dirent.h (rewinddir): Don't use libc_hidden_proto. (__rewinddir): Use libc_hidden_proto. * sysdeps/posix/getcwd.c [!_LIBC] (__rewinddir): Define to rewinddir. (__getcwd): Use __rewinddir instead of rewinddir.
* Fix tzfile.c namespace (bug 17583).Joseph Myers2014-11-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tzfile.c is brought in by various ISO C functions, but calls fileno, fread_unlocked and ftello, which are not ISO C functions. This patch adds names __fileno, __fread_unlocked and __ftello for those functions, making tzfile.c use those new names. Note: there are various uses of fileno elsewhere in glibc that I didn't change, although it may turn out that some of those also need to use __fileno. Tested for x86_64 with the glibc testsuite. Changed line numbers in tzfile.c cause changes in assertions, and for some reason this ends up with different instruction choice and register allocation, affecting the size of __tzfile_read and so making comparison of disassembly for libc.so problematic. [BZ #17583] * libio/fileno.c (fileno): Rename to __fileno and define as weak alias of __fileno. Use libc_hidden_weak. (__fileno): Use libc_hidden_def. [weak_alias] (fileno_unlocked): Define as weak alias of __fileno. * libio/ftello.c (ftello): Rename to __ftello and define as weak alias of __ftello. [__OFF_T_MATCHES_OFF64_T] (ftello64): Define as weak alias of __ftello. * libio/iofread.c [weak_alias && !_IO_MTSAFE_IO] (__fread_unlocked): Define as strong alias of _IO_fread. Use libc_hidden_def. (fread_unlocked): Don't use libc_hidden_ver. * libio/iofread_u.c (fread_unlocked): Rename to __fread_unlocked and define as weak alias of __fread_unlocked. Don't use libc_hidden_def. (__fread_unlocked): Use libc_hidden_def. * include/stdio.h (__fileno): Declare. Use libc_hidden_proto. (ftello): Don't use libc_hidden_proto. (__ftello): Declare. Use libc_hidden_proto. (fread_unlocked): Don't use libc_hidden_proto. (__fread_unlocked): Declare. Use libc_hidden_proto. * time/tzfile.c (__tzfile_read): Use __fileno, __fread_unlocked and __ftello instead of fileno, fread_unlocked and ftello.
* Remove __libc_waitpid function name.Joseph Myers2014-11-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the removal of unused __libc_* function names, this patch removes the __libc_waitpid name. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch; __waitpid, which is exported from shared libc, changes from weak to strong on some configurations, which is of no significance). * include/sys/wait.h (__libc_waitpid): Remove declaration. * posix/waitpid.c (__libc_waitpid): Rename to __waitpid. (__waitpid): Don't define as alias. Use libc_hidden_def not libc_hidden_weak. (waitpid): Define as alias of __waitpid. * sysdeps/unix/bsd/waitpid.c (__libc_waitpid): Rename to __waitpid. (__waitpid): Don't define as alias. Use libc_hidden_def not libc_hidden_weak. (waitpid): Define as alias of __waitpid. * sysdeps/unix/sysv/linux/i386/syscalls.list (waitpid): Remove __libc_waitpid alias. * sysdeps/unix/sysv/linux/m68k/syscalls.list (waitpid): Likewise. * sysdeps/unix/sysv/linux/powerpc/syscalls.list (waitpid): Likewise. * sysdeps/unix/sysv/linux/sh/syscalls.list (waitpid): Likewise. * sysdeps/unix/sysv/linux/sparc/syscalls.list (waitpid): Likewise. * sysdeps/unix/sysv/linux/tile/waitpid.S (__libc_waitpid): Remove alias. * sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Rename to __waitpid. (__waitpid): Don't define as alias. Use libc_hidden_def not libc_hidden_weak. (waitpid): Define as alias of __waitpid.
* Remove INTDEF / INTUSE / INTVARDEF (bug 14132).Joseph Myers2014-11-051-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Completing the removal of the obsolete INTDEF / INTUSE mechanism, this patch removes the final use - that for _dl_starting_up - replacing it by rtld_hidden_def / rtld_hidden_proto. Having removed the last use, the mechanism itself is also removed. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. (This is not much of a test since this variable is only defined and used in the !HAVE_INLINED_SYSCALLS case.) [BZ #14132] * include/libc-symbols.h (INTUSE): Remove macro. (INTDEF): Likewise. (INTVARDEF): Likewise. (_INTVARDEF): Likewise. (INTDEF2): Likewise. (INTVARDEF2): Likewise. * elf/rtld.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Use rtld_hidden_def instead of INTVARDEF. * sysdeps/generic/ldsodefs.h [IS_IN_rtld] (_dl_starting_up_internal): Remove declaration. (_dl_starting_up): Use rtld_hidden_proto. * elf/dl-init.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Remove declaration. [!HAVE_INLINED_SYSCALLS] (_dl_starting_up_internal): Likewise. (_dl_init) [!HAVE_INLINED_SYSCALLS]: Don't use INTUSE with _dl_starting_up. * elf/dl-writev.h (_dl_writev): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h [!HAVE_INLINED_SYSCALLS] (DL_STARTING_UP_DEF): Use __GI__dl_starting_up instead of _dl_starting_up_internal.
* Clean up internal ctype.h header.Roland McGrath2014-10-301-16/+16
|
* Remove __libc_readv and __libc_writev function names.Joseph Myers2014-10-301-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the removal of __libc_* function names that are no longer used anywhere, this patch removes the __libc_readv and __libc_writev names. Tested for x86_64 that stripped installed shared libraries are unchanged by the patch. * include/sys/uio.h (__libc_readv): Remove declaration. (__libc_writev): Likewise. * misc/readv.c (__libc_readv): Rename to __readv. (__readv): Do not define as alias. (readv): Define as alias of __readv. * misc/writev.c (__libc_writev): Rename to __writev. (__writev): Do not define as alias. (writev): Define as alias of __writev. * sysdeps/posix/readv.c (__libc_readv): Rename to __readv. (__readv): Do not define as alias. (readv): Define unconditionally as alias of __readv. * sysdeps/posix/writev.c (__libc_writev): Rename to __writev. (__writev): Do not define as alias. (writev): Define unconditionally as alias of __writev. * sysdeps/unix/syscalls.list (readv): Do not define __libc_readv name. (writev): Do not define __libc_writev name.
* Remove __libc_creat function name.Joseph Myers2014-10-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glibc has lots of __libc_* function names that no longer serve any purpose (are not used for any calls or exported at a public symbol version). This patch removes __libc_creat. It has the effect of creat becoming a strong symbol instead of a weak symbol in various cases, but that's fine; in shared libraries it doesn't matter at all, while for static linking the only other symbol sometimes defined in the same object is creat64, and whenever creat64 is a reserved name so is creat. Other such cases of unnecessary __libc_* symbols are expected to be dealt with in separate patches over time. Tested for x86_64 (testsuite, and that the disassembly of installed shared libraries is unchanged by the patch). * include/fcntl.h (__libc_creat): Remove declaration. * io/creat.c (__libc_creat): Rename to creat. (creat): Do not define as alias. * sysdeps/unix/sysv/linux/alpha/creat.c (creat64): Define as alias of creat instead of __libc_creat. * sysdeps/unix/sysv/linux/generic/creat.c (__libc_creat): Rename to creat. (creat): Do not define as alias. [__WORDSIZE == 64] (creat64): Define as alias of creat instead of __libc_creat. * sysdeps/unix/sysv/linux/syscalls.list (creat): Do not define __libc_creat name. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (creat): Likewise.
* Don't use INTVARDEF/INTUSE with __libc_enable_secure (bug 14132).Joseph Myers2014-10-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the removal of the obsolete INTDEF / INTVARDEF / INTUSE mechanism, this patch replaces its use for __libc_enable_secure with the use of rtld_hidden_data_def and rtld_hidden_proto. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. [BZ #14132] * elf/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def instead of INTVARDEF. (_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure. * sysdeps/mach/hurd/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def instead of INTVARDEF. (_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure. * elf/dl-deps.c (expand_dst): Likewise. * elf/dl-load.c (_dl_dst_count): Likewise. (_dl_dst_substitute): Likewise. (decompose_rpath): Likewise. (_dl_init_paths): Likewise. (open_path): Likewise. (_dl_map_object): Likewise. * elf/rtld.c (dl_main): Likewise. (process_dl_audit): Likewise. (process_envvars): Likewise. * include/unistd.h [IS_IN_rtld] (__libc_enable_secure_internal): Remove declaration. (__libc_enable_secure): Use rtld_hidden_proto.
* Don't use INTDEF/INTUSE with __cxa_atexit (bug 14132).Joseph Myers2014-10-091-4/+1
| | | | | | | | | | | | | | | This patch removes use of the obsolete INTDEF/INTUSE mechanism for __cxa_atexit, replacing it with libc_hidden_def/libc_hidden_proto. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. [BZ #14132] * stdlib/cxa_atexit.c (__cxa_atexit): Use libc_hidden_def instead of INTDEF. * include/stdlib.h (__cxa_atexit_internal): Remove declaration. (__cxa_atexit): Use libc_hidden_proto. [!NOT_IN_libc] (__cxa_atexit): Remove macro definition.
* Remove stray *_internal aliases (bug 14132).Joseph Myers2014-10-091-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes some stray (unused) *_internal aliases, and function prototypes with no corresponding definitions at all, at least some of which were missed in previous INTDEF / INTUSE removal. Not removed in this patch: __canonicalize_directory_name_internal, noticed in the course of preparing this patch, isn't an alias, but an actual function in sysdeps/mach/hurd/getcwd.c - apparently unused, however. Tested for x86_64 that installed stripped shared libraries are unchanged by this patch. [BZ #14132] * include/wctype.h [!_ISOMAC] (__iswalpha_l_internal): Remove declaration. [!_ISOMAC] (__iswdigit_l_internal): Likewise. [!_ISOMAC] (__iswspace_l_internal): Likewise. [!_ISOMAC] (__iswxdigit_l_internal): Likewise. [!_ISOMAC] (__iswctype_internal): Likewise. * stdio-common/siglist.c (_sys_siglist_internal): Remove alias. * sysdeps/unix/syscalls.list (chown): Remove __chown_internal alias. (fcntl): Remove __fcntl_internal alias. * sysdeps/unix/sysv/linux/hppa/syscalls.list (connect): Remove __connect_internal alias. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (connect): Likewise.
* Update version.h and include/features.h for 2.20 release glibc-2.20Allan McRae2014-09-071-1/+1
|
* Remove unnecessary uses of NOT_IN_libcSiddhesh Poyarekar2014-08-211-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a IS_IN_* macro is defined, then NOT_IN_libc is always defined, except obviously for IS_IN_libc. There's no need to check for both. Verified on x86_64 and i686 that the source is unchanged. * include/libc-symbols.h: Remove unnecessary check for NOT_IN_libc. * nptl/pthreadP.h: Likewise. * sysdeps/aarch64/setjmp.S: Likewise. * sysdeps/alpha/setjmp.S: Likewise. * sysdeps/arm/sysdep.h: Likewise. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/m68k/setjmp.c: Likewise. * sysdeps/posix/getcwd.c: Likewise. * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise. * sysdeps/s390/s390-32/setjmp.S: Likewise. * sysdeps/s390/s390-64/setjmp.S: Likewise. * sysdeps/sh/sh3/setjmp.S: Likewise. * sysdeps/sh/sh4/setjmp.S: Likewise. * sysdeps/unix/alpha/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/x86_64/setjmp.S: Likewise.
* Fix -Wundef warnings in regex_internal.hSiddhesh Poyarekar2014-08-011-0/+4
|
* Fix -Wundef warnings in fnmatch.cSiddhesh Poyarekar2014-08-011-2/+4
| | | | | | Fixes -Wundef warnings for MBSTATE_T and HAVE_STRING_H. The HAVE_STRING_H bit is a merge from the gnulib fnmatch.c and the MBSTATE_T fix has been posted to gnulib for inclusion.
* Clean up HAVE_CONFIG_H and STDC_HEADERS.Roland McGrath2014-06-201-0/+13
|
* Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.Joseph Myers2014-06-201-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up for __ASSUME_ATFCTS now always being true for the supported Linux kernel versions by removing conditional code in sysdeps/unix/sysv/linux. Several fchownat.c files that were only present because of differences in the fallback syscalls used (depending on the architecture-specific names of chown-related syscalls for 32-bit uids) are removed. Files that looks like they could be replaced by syscalls.list entries have the standard "Consider moving to syscalls.list." comment (see bug 14138) added. Conditionals on the relevant __NR_* syscall numbers being defined are also removed, since my analysis indicated that the relevant syscalls are always defined for all relevant kernel versions using any affected file. Much of the removed fallback code had unbounded stack allocations, so this reduces the number of cases to consider for anyone reviewing uses of alloca and VLAs in glibc. There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS remains in kernel-features.h. The logical condition relevant there is whether openat64_not_cancel_3 is known to work. Hurd doesn't use this version of getcwd at all, so the conditionals in getcwd.c are always true in glibc. However, this code is also used in gnulib. So the best way to deal with the conditionals there may be for gnulib people to deal with merging all relevant changes in both directions between the glibc and gnulib versions of this file, at the end of which the openat conditionals should be in whatever form is best for gnulib, and hardcoded in the _LIBC case to having openat supported. Tested by comparing before-and-after disassembly of installed (stripped) shared libraries, on x86_64 and x86. On x86 the patch made no change to the disassembly; on x86_64, the only changes were in readlinkat, where formerly the return value from the readlinkat syscall was stored in an int variable before being converted to ssize_t for the return, and now the return value is returned directly without truncation to int. I think it's clearly correct not to truncate the return value (although I also think the truncation would not have been a user-visible bug because the kernel would never have returned a value it could have affected). * include/fcntl.h (__atfct_seterrno): Remove prototype. (__atfct_seterrno_2): Likewise. * sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include <kernel-features.h>. (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS] (__have_atfcts): Remove conditional definition. (__fxstatat([__NR_fstatat64]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code unreachable if [__ASSUME_ATFCTS]. * sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/faccessat.c: Do not include <kernel-features.h>. (faccessat) [__NR_faccessat]: Make code unconditional. (faccessat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fchmodat.c: Do not include <kernel-features.h>. (fchmodat) [__NR_fchmodat]: Make code unconditional. (fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fchownat.c: Do not include <kernel-features.h>. (fchownat) [__NR_fchownat]: Make code unconditional. (fchownat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/futimesat.c: Do not include <kernel-features.h>. (futimesat) [__NR_futimesat]: Make code unconditional. (futimesat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_newfstatat]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fxstatat64.c: Do not include <kernel-features.h>. (__fxstatat64) [__NR_fstatat64]: Make code unconditional. (__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_fstatat64]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/linkat.c: Do not include <kernel-features.h>. (linkat) [__NR_linkat]: Make code unconditional. (linkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include <kernel-features.h>. (__fxstatat64) [__NR_newfstatat]: Make code unconditional. (__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/mkdirat.c: Do not include <kernel-features.h>. (mkdirat) [__NR_mkdirat]: Make code unconditional. (mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/openat.c: Do not include <kernel-features.h>. [!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function. [!__ASSUME_ATFCTS] (__have_atfcts): Remove variable. (OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional. (OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/readlinkat.c: Do not include <kernel-features.h>. (readlinkat) [__NR_readlinkat]: Make code unconditional. (readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. Return result of INLINE_SYSCALL directly, not via int variable. * sysdeps/unix/sysv/linux/renameat.c: Do not include <kernel-features.h>. [!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function. (renameat) [__NR_renameat]: Make code unconditional. (renameat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/symlinkat.c: Do not include <kernel-features.h>. (symlinkat) [__NR_symlinkat]: Make code unconditional. (symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/unlinkat.c: Do not include <kernel-features.h>. (unlinkat) [__NR_unlinkat]: Make code unconditional. (unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_newfstatat]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/xmknodat.c: Do not include <kernel-features.h>. (__xmknodat) [__NR_mknodat]: Make code unconditional. (__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
* Get rid of nptl/sysdeps/pthread/ subdirectoryRoland McGrath2014-06-121-0/+117
|
* Clean up __exit_thread.Roland McGrath2014-05-131-3/+0
|
* Compile with -Wundef.Roland McGrath2014-03-142-0/+47
|
* BZ #16632: Change [_BSD/_SVID]_SOURCE warning.Carlos O'Donell2014-02-251-2/+5
| | | | | | | | | | | | | | | | | | Source packages that need to support both 2.19 and 2.20 will need to decide to use _BSD_SOURCE and _SVID_SOURCE vs. _DEFAULT_SOURCE. The difficulty in making that decision is that __GLIBC_MINOR__ is itself defined in features.h, but you want to set the feature test macros before including features.h. Therefore to ease the transition we should disable the warning if _DEFAULT_SOURCE is also defined. https://sourceware.org/ml/libc-alpha/2014-02/msg00666.html https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes
* Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answerAndreas Schwab2014-02-191-3/+3
| | | | | Instead of trying to guess whether the second buffer needs to be freed set a flag at the place it is allocated
* Combine __USE_BSD and __USE_SVID into __USE_MISC.Joseph Myers2014-02-121-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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].
* Remove _BSD_SOURCE and _SVID_SOURCE.Joseph Myers2014-02-111-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a minimal patch to remove _BSD_SOURCE and _SVID_SOURCE from the documented user API, making them into aliases for _DEFAULT_SOURCE with a #warning given, but keeping most of the features.h logic using those macros and all the exising __USE_* conditionals, on the basis that all the consequent cleanups will go in followup patches. Tested x86_64. * include/features.h: Update comment documenting feature test macros. [_BSD_SOURCE || _SVID_SOURCE]: Give #warning. Define _DEFAULT_SOURCE. * manual/creature.texi (_BSD_SOURCE): Remove documentation. (_SVID_SOURCE): Likewise. (_DEFAULT_SOURCE): Update description of default features. (Feature Test Macros): Don't mention _SVID_SOURCE in conjunction with _GNU_SOURCE. * manual/filesys.texi (__ftw_func_t): Do not refer to _BSD_SOURCE. (S_ISVTX): Likewise. * manual/math.texi (Mathematical Constants): Likewise. * manual/signal.texi (Interrupted Primitives): Likewise. * manual/startup.texi (putenv): Do not refer to _SVID_SOURCE. * math/test-matherr.c (_SVID_SOURCE): Do not define. * sysvipc/sys/ipc.h [__USE_SVID && !__USE_XOPEN && __GNUC__ >= 2]: Don't refer to _SVID_SOURCE in warning text.
* include/stap-probe.h: Add comment about SystemTap argument formatWill Newton2014-02-111-1/+9
| | | | | | | | | | | | | | Add a comment pointing to the SystemTap wiki page that documents the format of the arguments. Also add a pointer to the SystemTap and gdb sources which seem to be the best place to get the architecture specific details. ChangeLog: 2014-02-11 Will Newton <will.newton@linaro.org> * include/stap-probe.h: Add comment about probe argument format.
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-1/+1
|
* Avoid comma operator warnings.Roland McGrath2014-02-071-1/+2
|
* Update version.h and include/features.h for 2.19 release glibc-2.19Allan McRae2014-02-071-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-0119-19/+19
|
* Add _DEFAULT_SOURCE feature test macro.Joseph Myers2013-12-191-13/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a feature test macro _DEFAULT_SOURCE to enable the default set of header declarations. The intention is: if _DEFAULT_SOURCE is not used there is no change to the set of __USE_* macros glibc defines; if it's used on its own, and without compiler options such as -std=c99 that define __STRICT_ANSI__, again, there is no change; if it's used together with the macros it approximately (i.e., apart from __USE_POSIX_IMPLICITLY) implies (-D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L), again, there is no change. Otherwise, it causes the relevant features to be enabled, even if __STRICT_ANSI__, or another feature test macro, would cause them to be disabled. This macro deliberately bundles the POSIX.1-2008 (non-X/Open) functionality with the BSD/SVID/"misc" functionality, rather than defining a macro that gives just the latter, as many of the header cleanups resulting from removing _BSD_SOURCE and _SVID_SOURCE support are only possible when BSD/SVID/"misc" is always bundled with POSIX.1-2008. Tested x86_64. * include/features.h: Update comment documenting feature test macros. Mention _DEFAULT_SOURCE in comment. [_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine. [_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE, _BSD_SOURCE and _SVID_SOURCE. [!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE && !_SVID_SOURCE]: Likewise. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (__USE_POSIX_IMPLICITLY): Define. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (_POSIX_SOURCE): Undefine and redefine. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (_POSIX_C_SOURCE): Likewise. * manual/creature.texi (_DEFAULT_SOURCE): Document. (Feature Test Macros): Update documentation of default features.
* Remove __FAVOR_BSD.Joseph Myers2013-12-171-9/+0
|
* [BZ #16195] Fix build warnings from systemtap probes in non-systemtap ↵Siddhesh Poyarekar2013-12-031-7/+8
| | | | | | | | | | | | | | | | | | | | | | configurations Joseph pointed out in the bug report (and in an earlier thread) that systemtap probes cause build time warnings like the following: ../sysdeps/ieee754/dbl-64/e_atan2.c:602:4: warning: the address of 'p' will always evaluate as 'true' [-Waddress] due to the fact that we're now passing non-weak variables to LIBC_PROBE in the libm probes. This happens only on configurations that do not enable systemtap. The macro definition of LIBC_PROBE in this case only acts as a sanity checker to ensure that the number parameters passed to LIBC_PROBE is equal to the argument count parameter passed before it. This can be done in a much simpler manner by just adding a macro definition for each number of arguments. I am assuming here that we don't really want to bother with supporting LIBC_PROBE with an indeterminate number of arguments and if there is a need for a probe to have more data than what is currently supported (4 arguments), one could simply add an additional macro here.
* Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271).Joseph Myers2013-11-281-0/+1
|
* Define TLS version of libc_hidden_proto.Joseph Myers2013-11-181-3/+33
|
* Define __STDC_IEC_559* based on __GCC_IEC_559*.Joseph Myers2013-11-041-3/+22
|
* Make __ffs hiddenAndreas Schwab2013-09-201-0/+1
|
* conformtest: Fix namespace testing.Joseph Myers2013-09-042-2/+4
|
* Remove --disable-versioning.Joseph Myers2013-09-042-8/+4
|
* Clean up h_errno declaration to use __thread unconditionally.Roland McGrath2013-08-271-10/+5
|
* Clean up _res declaration to use __thread unconditionally.Roland McGrath2013-08-271-13/+5
|
* Update version.h and include/features.h for 2.18 release. glibc-2.18David S. Miller2013-08-101-1/+1
|
* libc-internal.h: add ALIGN helper macrosMike Frysinger2013-06-241-0/+20
| | | | | | | Rather than open coding the masks, add helper macros to do the magic. This makes code easier to read. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Fix loop construction to functions callsAdhemerval Zanella2013-06-201-0/+10
| | | | | | Check wheter the compiler has the option -fno-tree-loop-distribute-patterns to inhibit loop transformation to library calls and uses it on memset and memmove default implementation to avoid recursive calls.
* Set/restore rounding mode only when neededSiddhesh Poyarekar2013-06-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most common use case of math functions is with default rounding mode, i.e. rounding to nearest. Setting and restoring rounding mode is an unnecessary overhead for this, so I've added support for a context, which does the set/restore only if the FP status needs a change. The code is written such that only x86 uses these. Other architectures should be unaffected by it, but would definitely benefit if the set/restore has as much overhead relative to the rest of the code, as the x86 bits do. Here's a summary of the performance improvement due to these improvements; I've only mentioned functions that use the set/restore and have benchmark inputs for x86_64: Before: cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy After: cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy So the improvements are: cos: 27.9089% exp: 22.6919% pow: 4.01564% sin: 19.1585% tan: 1.96086% The downside of the change is that it will have an adverse performance impact on non-default rounding modes, but I think the tradeoff is justified.
* Fix indentation and add copyright header to time.hSiddhesh Poyarekar2013-06-111-4/+21
|
* Fix symbol definitions for __clock_* functionsSiddhesh Poyarekar2013-06-111-0/+1
| | | | | | __clock_gettime and other __clock_* functions could result in an extra PLT reference within libc.so if it actually gets used. None of the code currently uses them, which is why this probably went unnoticed.
* Avoid use of "register" as optimization hint.Joseph Myers2013-06-071-4/+4
|