about summary refs log tree commit diff
path: root/sysdeps/posix
Commit message (Collapse)AuthorAgeFilesLines
* getaddrinfo: Eliminate another strdup callFlorian Weimer2017-06-031-1/+1
|
* getaddrinfo: Fix localplt failure involving strdupFlorian Weimer2017-06-021-4/+11
|
* getaddrinfo: Always allocate canonical name on the heapFlorian Weimer2017-06-021-67/+42
| | | | | | | A further simplification could eliminate the canon variable in gaih_inet and replace it with canonbuf. However, canonbuf is used as a flag in the nscd code, which makes this somewhat non-straightforward.
* posix: Implement preadv2 and pwritev2Adhemerval Zanella2017-05-314-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support of preadv2 and pwritev2 which are similar to preadv/pwritev but with an extra flag argument. As for preadv/pwritev both interfaces are added a non-standard GNU API. For default 'posix' implementation trying to emulate the Linux supported flags is troublesome: * We can not temporary change the file state of the O_DSYNC and O_SYNC flags to emulate RWF_{D}SYNC (attempts to change the state of using fcntl are silently ignored). * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal semantic not provided by any other flag (O_NONBLOCK for instance). So default sysdeps/posix implementations fails with EOPNOTSUPP for any non supported flag (which are none currently) calls generic preadv/pwritev. Basically this implementation supports only preadv2 called as preadv (with flags sets to 0). The Linux one uses the preadv2/pwritev2 syscall if defined, otherwise it call preadv/writev. Instead of using the previous __ASSUME_* to unconditionally issue the syscall (and avoid building the fallback routine), it call pread/write if the preadv2/pwritev2 syscalls fails. The idea is just avoid adding another __ASSUME_* and checking each architecture on every kernel bump and simplify code conditionals. Checked on x86_64-linux-gnu and on i686-linux-gnu and a check with run-built-tests=no on aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips{64,64n32}-linux-gnu, nios2-linux-gnu, powerpc{64,64le}-linux-gnu, s390{x}-linux-gnu, sparc{64,v9}-linux-gnu, tile{gx,pro}-linux-gnu, and sh4-linux-gnu (all using gcc 6.3). * NEWS: Add note about pwritev2 and preadv2 inclusion. * misc/Makefile (routines): Add preadv2, preadv64v2, pwritev2, and pwritev64v2. (tests): Add tst-preadvwritev2 and tst-preadvwritev64v2. * misc/Versions (GLIBC_2.26): Add preadv2, preadv64v2, pwritev2, and pwritev64v2. * misc/preadv2.c: New file. * misc/preadv64v2.c: Likewise. * misc/pwritev2.c: Likewise. * misc/pwritev64v2.c: Likewise. * misc/tst-preadvwritev2.c: Likewise. * misc/tst-preadvwritev64v2.c: Likewise. * manual/llio.texi: Add preadv2 and pwritev2 documentation. * misc/sys/uio.h [__USE_GNU && !__USE_FILE_OFFSET64] (preadv2): New prototype. [__USE_GNU && !__USE_FILE_OFFSET64] (pwritev2): Likewise. [__USE_GNU && __USE_FILE_OFFSET64] (preadv64v2): Likewise. [__USE_GNU && __USE_FILE_OFFSET64] (pwritev64v2): Likewise. * misc/tst-preadvwritev-common.c (PREADV): Define if not defined. (PWRITEV): Likewise. (do_test_with_offset): Use PREADV and PWRITEV macros and check for ENOSYS. * nptl/tst-cancel4.c (tf_pwritev2): New test. (tf_preadv2): Likewise. (tf_fsync): Add tf_pwritev2 and tf_preadv2. * sysdeps/posix/preadv2.c: Likewise. * sysdeps/posix/preadv64v2.c: Likewise. * sysdeps/posix/pwritev2.c: Likewise. * sysdeps/posix/pwritev64v2.c: Likewise. * sysdeps/unix/sysv/linux/kernel-features.h: Add comment for syscall support in kernel. * sysdeps/unix/sysv/linux/preadv2.c: Likewise. * sysdeps/unix/sysv/linux/preadv64v2.c: Likewise. * sysdeps/unix/sysv/linux/pwritev2.c: Likewise. * sysdeps/unix/sysv/linux/pwritev64v2.c: Likewise. * sysdeps/unix/sysv/linux/preadv.c (preadv): Add libc_hidden_def. * sysdeps/unix/sysv/linux/preadv64.c (preadv64): Likewise. * sysdeps/unix/sysv/linux/pwritev.c (pwritev): Likewise. * sysdeps/unix/sysv/linux/pwritev64.c (pwritev64): Likewise. * sysdeps/unix/sysv/linux/bits/uio.h: Add supported preadv2/pwritev2 support flags on Linux. * sysdeps/unix/sysv/linux/aarch64/libc.abilist (GLIBC_2.26): Add preadv2, preadv64v2, pwritev2, pwritev64v2. * sysdeps/unix/sysv/linux/alpha/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/sysv/linux/tile/tilegx/tilegx32/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/sysv/linux/tile/tilegx/tilegx64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist (GLIBC_2.26): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist (GLIBC_2.26): Likewise.
* Remove __need macros from signal.h.Zack Weinberg2017-05-207-49/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The types affected are __sig_atomic_t, sig_atomic_t, __sigset_t, sigset_t, sigval_t, sigevent_t, and siginfo_t. __sig_atomic_t is a scalar, so it's now directly available from bits/types.h. The others get bits/types/ headers. Side effects include: There have been small changes to which non-signal headers expose which subset of the signal-related types. A couple of architectures' nested siginfo_t fields had to be renamed to prevent undesired macro expansion. Internal code that wants to manipulate signal masks must now include <sigsetops.h> (which is not installed) and should be aware that __sigaddset, __sigandset, __sigdelset, __sigemptyset, and __sigorset no longer return a value (unlike the public API). Relatedly, the public signal.h no longer declares any of those functions. The obsolete sigmask() macro no longer has a system-specific definition -- in the cases where it matters, it didn't work anyway. New Linux architectures should create bits/siginfo-arch.h and/or bits/siginfo-consts-arch.h to customize their siginfo_t, rather than duplicating everything in bits/siginfo.h (which no longer exists). Add new __SI_* macros if necessary. Ports to other operating systems are strongly encouraged to generalize this scheme further. * bits/sigevent-consts.h * bits/siginfo-consts.h * bits/types/__sigset_t.h * bits/types/sigevent_t.h * bits/types/siginfo_t.h * sysdeps/unix/sysv/linux/bits/sigevent-consts.h * sysdeps/unix/sysv/linux/bits/siginfo-consts.h * sysdeps/unix/sysv/linux/bits/types/__sigset_t.h * sysdeps/unix/sysv/linux/bits/types/sigevent_t.h * sysdeps/unix/sysv/linux/bits/types/siginfo_t.h: New system-dependent bits headers. * sysdeps/unix/sysv/linux/bits/siginfo-arch.h * sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h * sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h * sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h * sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h * sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h * sysdeps/unix/sysv/linux/tile/bits/siginfo-arch.h * sysdeps/unix/sysv/linux/tile/bits/siginfo-consts-arch.h * sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h: New Linux-only system-dependent bits headers. * signal/bits/types/sig_atomic_t.h * signal/bits/types/sigset_t.h * signal/bits/types/sigval_t.h: New non-system-dependent bits headers. * sysdeps/generic/sigsetops.h * sysdeps/unix/sysv/linux/sigsetops.h: New internal headers. * include/bits/types/sig_atomic_t.h * include/bits/types/sigset_t.h * include/bits/types/sigval_t.h: New wrappers. * signal/sigsetops.h * bits/siginfo.h * bits/sigset.h * sysdeps/unix/sysv/linux/bits/siginfo.h * sysdeps/unix/sysv/linux/bits/sigset.h * sysdeps/unix/sysv/linux/ia64/bits/siginfo.h * sysdeps/unix/sysv/linux/mips/bits/siginfo.h * sysdeps/unix/sysv/linux/s390/bits/siginfo.h * sysdeps/unix/sysv/linux/sparc/bits/siginfo.h * sysdeps/unix/sysv/linux/tile/bits/siginfo.h * sysdeps/unix/sysv/linux/x86/bits/siginfo.h: Deleted. * signal/Makefile, sysdeps/unix/sysv/linux/Makefile: Update lists of installed headers. * posix/bits/types.h: Define __sig_atomic_t here. * signal/signal.h: Use the new bits headers; no need to handle __need_sig_atomic_t nor __need_sigset_t. Don't use __sigmask to define sigmask. * include/signal.h: No need to handle __need_sig_atomic_t nor __need_sigset_t. Don't define __sigemptyset. * io/sys/poll.h, setjmp/setjmp.h * sysdeps/arm/sys/ucontext.h, sysdeps/generic/sys/ucontext.h * sysdeps/i386/sys/ucontext.h, sysdeps/m68k/sys/ucontext.h * sysdeps/mach/hurd/i386/bits/sigcontext.h * sysdeps/mips/sys/ucontext.h, sysdeps/powerpc/novmxsetjmp.h * sysdeps/pthread/bits/sigthread.h * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h * sysdeps/unix/sysv/linux/mips/sys/ucontext.h * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h * sysdeps/unix/sysv/linux/s390/sys/ucontext.h * sysdeps/unix/sysv/linux/sh/sys/ucontext.h * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h * sysdeps/unix/sysv/linux/tile/sys/ucontext.h * sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Use bits/types/__sigset_t.h. * misc/sys/select.h, posix/spawn.h * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h * sysdeps/unix/sysv/linux/sys/epoll.h * sysdeps/unix/sysv/linux/sys/signalfd.h: Use bits/types/sigset_t.h. * resolv/netdb.h, rt/mqueue.h: Use bits/types/sigevent_t.h. * rt/aio.h: Use bits/types/sigevent_t.h and bits/sigevent-consts.h. * socket/sys/socket.h: Don't include bits/sigset.h. * login/utmp_file.c, shadow/lckpwdf.c, signal/sigandset.c * signal/sigisempty.c, stdlib/abort.c, sysdeps/posix/profil.c * sysdeps/posix/sigignore.c, sysdeps/posix/sigintr.c * sysdeps/posix/signal.c, sysdeps/posix/sigset.c * sysdeps/posix/sprofil.c, sysdeps/posix/sysv_signal.c * sysdeps/unix/sysv/linux/nptl-signals.h: Include sigsetops.h. * signal/sigaddset.c, signal/sigandset.c, signal/sigdelset.c * signal/sigorset.c, stdlib/abort.c, sysdeps/posix/sigignore.c * sysdeps/posix/signal.c, sysdeps/posix/sigset.c: __sigaddset, __sigandset, __sigdelset, __sigemptyset, __sigorset now return no value. * signal/sigaddset.c, signal/sigdelset.c, signal/sigismem.c Include <errno.h>, <signal.h>, and <sigsetops.h> instead of "sigsetops.h". * signal/sigsetops.c: Explicitly define __sigismember, __sigaddset, and __sigdelset as compatibility symbols. * signal/Versions: Correct commentary on __sigpause, __sigaddset, __sigdelset, __sigismember. * inet/rcmd.c: Include sigsetops.h. Convert old code using __sigblock/__sigsetmask to use __sigprocmask and friends.
* posix: Fix and simplify default p{read,write}v implementationAdhemerval Zanella2017-05-156-168/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all architectures but microblaze use wire-up syscall for p{readv,write}v. Microblaze still uses the syscall emulation using sysdep/posix/p{readv,writev}.c and it was reported in some ocasions [1] [2] that it might have some issues with some linux specific usage (mainly with O_DIRECT and the alignment requirement). Although it is not an issue for virtually all the system, this patch refactors the sysdeps/posix p{read,write}v syscall to avoid such issue (by using posix_memalign on the buffer used on p{read,write} call) and by refactoring it common files to avoid the need check on defines to correct set the alias and internal symbols. Checked on microblaze-linux-gnu check with run-built-tests=no and by using the sysdeps/posix implementation on x86_64-linux-gnu (just for sanity test where it shown no regression). * sysdeps/posix/preadv.c: Use sysdeps/posix/preadv_common.c. * sysdeps/posix/preadv64.c: Likewise. * sysdeps/unix/sysv/linux/preadv.c: Likewise. * sysdeps/unix/sysv/linux/preadv64.c: Likewise. * sysdeps/posix/pwritev.c: Use sysdeps/posix/pwritev_common.c. * sysdeps/posix/pwritev64.c: Likewise. * sysdeps/unix/sysv/linux/pwritev.c: Likewise. * sysdeps/unix/sysv/linux/pwritev64.c: Likewise. * sysdeps/posix/preadv_common.c: New file. * sysdeps/posix/pwritev_common.c: Likewise. [1] http://www.mail-archive.com/qemu-devel@nongnu.org/msg25282.html [2] https://bugzilla.redhat.com/show_bug.cgi?id=563103#c8
* getaddrinfo: Unconditionally use malloc for address listFlorian Weimer2017-05-111-24/+5
| | | | | getaddrinfo has to call malloc eventually anyway, so the complexity of avoiding malloc calls is not worth potential savings.
* [BZ 21340] add support for POSIX_SPAWN_SETSIDAdhemerval Zanella2017-04-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the POSIX_SPAWN_SETSID flag. It was recently accepted by the Austin Group: http://austingroupbugs.net/view.php?id=1044 Checked on x86_64 Daurnimator <quae@daurnimator.com> Adhemerval Zanella <adhemerval.zanella@linaro.org> [BZ #21340] * posix/Makefile (tests): Add tst-posix_spawn-setsid to list of tests. * posix/spawn.h: define POSIX_SPAWN_SETSID flag. * posix/spawnattr_setflags.c (ALL_FLAGS): Add POSIX_SPAWN_SETSID to valid flags. * posix/tst-posix_spawn-setsid.c: Add test for POSIX_SPAWN_SETSID. * sysdeps/mach/hurd/spawni.c (__spawni): Implementation of POSIX_SPAWN_SETSID. * sysdeps/posix/spawni.c (__spawni): Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise. * NEWS: Add note about POSIX_SPAWN_SETSID support.
* Create more sockets with SOCK_CLOEXEC [BZ #15722]Florian Weimer2017-04-191-1/+1
|
* Assume that O_CLOEXEC is always defined and worksFlorian Weimer2017-04-183-72/+11
|
* Assume that O_NOFOLLOW is always definedFlorian Weimer2017-04-131-2/+0
|
* Remove the str(n)dup inlines from string/bits/string2.h. Although inliningWilco Dijkstra2017-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calls with constant strings shows a small (~10%) performance gain, strdup is typically used in error reporting code, so not performance critical. Remove the now unused __need_malloc_and_calloc related defines from stdlib.h. Rename existing uses of str(n)dup to __str(n)dup so it no longer needs to be redirected to a builtin. Also building GLIBC with -Os now no longer shows localplt or linkname space failures (partial fix for BZ #15105 and BZ #19463). [BZ #15105] [BZ #19463] * elf/dl-cache.c (_dl_load_cache_lookup): Use __strdup. * inet/rcmd.c (rcmd_af): Likewise. * inet/rexec.c (rexec_af): Likewise. * intl/dcigettext.c (_LIBC): Likewise. * intl/finddomain.c (_nl_find_domain): Use strdup expansion. * locale/loadarchive.c (_nl_load_locale_from_archive): Use __strdup. * locale/setlocale.c (setlocale): Likewise. * posix/spawn_faction_addopen.c (posix_spawn_file_actions_addopen): Likewise. * stdlib/putenv.c (putenv): Use __strndup. * sunrpc/svc_simple.c (__registerrpc): Use __strdup. * sysdeps/posix/getaddrinfo.c (gaih_inet): Use __strdup/__strndup. * include/stdlib.h (__need_malloc_and_calloc): Remove uses. (__Need_M_And_C) Remove define/undef. * stdlib/stdlib.h (__need_malloc_and_calloc): Remove uses. (__malloc_and_calloc_defined): Remove define. * string/bits/string2.h (__strdup): Remove define. (strdup): Likewise. (__strndup): Likewise. (strndup): Likewise.
* timezone: Remove TZNAME_MAX limit from sysconf [BZ #15576]Florian Weimer2017-03-071-1/+1
| | | | | glibc does not impose a limit, and POSIX does not allow a sysconf limit which changes during the lifetime of a process.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-0184-84/+84
|
* resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582]Florian Weimer2016-12-311-7/+9
|
* hurd: fix fcntl visibilitySamuel Thibault2016-09-181-1/+1
| | | | * sysdeps/posix/dup.c (__dup): Call __fcntl instead of fcntl.
* rt: Set shm_open as a non cancellation point (BZ #18243)Adhemerval Zanella2016-09-151-0/+7
| | | | | | | | | | | | | This patch changes shm_open to not act as a cancellation point. Cancellation is disable at start and reenable in function exit. It fixes BZ #18243. Tested on x86_64 and i686. [BZ #18243] * rt/Makefile (test): Add tst-shm-cancel. * rt/tst-shm-cancel.c: New file. * sysdeps/posix/shm_open.c: Disable asynchronous cancellation.
* inet: Add __inet6_scopeid_pton function [BZ #20611]Florian Weimer2016-09-151-24/+7
| | | | | __inet6_scopeid_pton implements strict validation of numeric scope IDs. Use it in getaddrinfo and __res_vinit.
* Fix generic wait3 after union wait_status removal.Roland McGrath2016-09-021-1/+1
| | | | | * sysdeps/posix/wait3.c: Don't treat STAT_LOC as a union, since it's not any more.
* Fix incorrect double-checked locking related to _res_hconf.initialized.Torvald Riegel2016-08-181-2/+1
| | | | | | | | | | | | | | | | | | _res_hconf.initialized was not suitable for use in a multi-threaded environment due to the lack of atomics and memory barriers. Use of it was also unnecessary because _res_hconf_init did the right thing by using __libc_once. This patch fixes the glibc-internal uses by just calling _res_hconf_init unconditionally, and switches to a release MO atomic store for _res_hconf.initialized to fix the glibc side of the synchronization problem (which will maintain backward compatibility, but cannot fix the lack of acquire MO on any glibc-external loads). [BZ #20477] * resolv/res_hconf.c (do_init): Use atomic access. * resolv/res_hconf.h: Add comments. * nscd/aicache.c (addhstaiX): Call _res_hconf_init unconditionally. * nss/getXXbyYY_r.c (REENTRANT_NAME): Likewise. * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
* getaddrinfo: Convert from extend_alloca to struct scratch_bufferFlorian Weimer2016-05-121-92/+59
|
* getaddrinfo: Restore RES_USE_INET6 flag on error path [BZ #19994]Florian Weimer2016-05-101-0/+1
|
* CVE-2016-3706: getaddrinfo: stack overflow in hostent conversion [BZ #20010]Florian Weimer2016-04-291-61/+69
| | | | | | | | | | When converting a struct hostent response to struct gaih_addrtuple, the gethosts macro (which is called from gaih_inet) used alloca, without malloc fallback for large responses. This commit changes this code to use calloc unconditionally. This commit also consolidated a second hostent-to-gaih_addrtuple conversion loop (in gaih_inet) to use the new conversion function.
* Remove union wait [BZ #19613]Florian Weimer2016-04-142-2/+2
| | | | | | | The overloading approach in the W* macros was incompatible with integer expressions of a type different from int. Applications using union wait and these macros will have to migrate to the POSIX-specified int status type.
* Fix flag test in waitid compatibility layerSamuel Thibault2016-03-131-1/+1
| | | | | * sysdeps/posix/waitid.c (OUR_WAITID): Test against WSTOPPED instead of WUNTRACED.
* posix: New Linux posix_spawn{p} implementationAdhemerval Zanella2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a new posix_spawn{p} implementation for Linux. The main difference is it uses the clone syscall directly with CLONE_VM and CLONE_VFORK flags and a direct allocated stack. The new stack and start function solves most the vfork limitation (possible parent clobber due stack spilling). The remaning issue are related to signal handling: 1. That no signal handlers must run in child context, to avoid corrupt parent's state. 2. Child must synchronize with parent to enforce stack deallocation and to possible return execv issues. The first one is solved by blocking all signals in child, even NPTL-internal ones (SIGCANCEL and SIGSETXID). The second issue is done by a stack allocation in parent and a synchronization with using a pipe or waitpid (in case or error). The pipe has the advantage of allowing the child signal an exec error (checked with new tst-spawn2 test). There is an inherent race condition in pipe2 usage for architectures that do not support the syscall directly. In such cases the a pipe plus fctnl is used instead and it may lead to file descriptor leak in parent (as decribed by fcntl documentation). The child process stack is allocate with a mmap with MAP_STACK flag using default architecture stack size. Although it is slower than use a stack buffer from parent, it allows some slack for the compatibility code to run scripts with no shebang (which may use a buffer with size depending of argument list count). Performance should be similar to the vfork default posix implementation and way faster than fork path (vfork on mostly linux ports are basically clone with CLONE_VM plus CLONE_VFORK). The only difference is the syscalls required for the stack allocation/deallocation. It fixes BZ#10354, BZ#14750, and BZ#18433. Tested on i386, x86_64, powerpc64le, and aarch64. [BZ #14750] [BZ #10354] [BZ #18433] * include/sched.h (__clone): Add hidden prototype. (__clone2): Likewise. * include/unistd.h (__dup): Likewise. * posix/Makefile (tests): Add tst-spawn2. * posix/tst-spawn2.c: New file. * sysdeps/posix/dup.c (__dup): Add hidden definition. * sysdeps/unix/sysv/linux/aarch64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/alpha/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/arm/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/hppa/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/i386/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/ia64/clone2.S (__clone): Likewise. * sysdeps/unix/sysv/linux/m68k/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/microblaze/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/mips/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/nios2/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/sh/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/tile/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/x86_64/clone.S (__clone): Likewise. * sysdeps/unix/sysv/linux/nptl-signals.h (____nptl_is_internal_signal): New function. * sysdeps/unix/sysv/linux/spawni.c: New file.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-0483-83/+83
|
* Remove signal handling for nanosleep (bug 16364)Adhemerval Zanella2015-11-201-9/+0
| | | | | | | | | | | | | | | | | | | | | | Linux 2.6.32 and forward do not show the issue regarding SysV SIGCHLD vs. SIG_IGN for nanosleep which make it feasible to use it for sleep implementation without requiring any hacking to handle the spurious wake up. The issue is likely being fixed before 2.6 and git history [1] [2]. This patch simplifies the sleep code to call nanosleep directly by using the posix default version. It also removes the early cancellation tests for zero argument, since nanosleep will handle cancellation in this case. [1] https://lkml.org/lkml/2004/11/25/5 [2] https://lkml.org/lkml/2003/11/8/50 Checked on x86_64, ppc64le, and aarch64. [BZ #16364] * sysdeps/unix/sysv/linux/sleep.c: Remove file * sysdeps/posix/sleep.c (__sleep): Simplify cancellation handling.
* Convert 69 more function definitions to prototype style (line wrap cases).Joseph Myers2015-10-191-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This automatically-generated patch converts 69 function definitions in glibc from old-style K&R to prototype-style. This patch, covering both sysdeps and non-sysdeps files, deals with cases where the prototype needed to be wrapped over more than one line. Otherwise, exclusions and caveats are as for <https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> and <https://sourceware.org/ml/libc-alpha/2015-10/msg00599.html>. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * crypt/crypt-entry.c (__crypt_r): Convert to prototype-style function definition. * crypt/crypt_util.c (__encrypt_r): Likewise. * libio/genops.c (_IO_no_init): Likewise. * libio/iofopncook.c (_IO_fopencookie): Likewise. (_IO_old_fopencookie): Likewise. * libio/iofwrite_u.c (fwrite_unlocked): Likewise. * libio/iogetline.c (_IO_getline): Likewise. (_IO_getline_info): Likewise. * libio/iogetwline.c (_IO_getwline): Likewise. (_IO_getwline_info): Likewise. * libio/vsnprintf.c (_IO_vsnprintf): Likewise. * libio/vswprintf.c (_IO_vswprintf): Likewise. * locale/programs/simple-hash.c (insert_entry_2): Likewise. (find_entry): Likewise. (iterate_table): Likewise. (lookup): Likewise. * login/forkpty.c (forkpty): Likewise. * misc/hsearch_r.c (__hsearch_r): Likewise. * misc/select.c (__select): Likewise. * nptl/cleanup_defer_compat.c (_pthread_cleanup_pop_restore): Likewise. * nptl/old_pthread_cond_init.c (__pthread_cond_init_2_0): Likewise. * nptl/old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0): Likewise. * nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * nptl/pthread_barrierattr_getpshared.c (pthread_barrierattr_getpshared): Likewise. * nptl/pthread_getschedparam.c (__pthread_getschedparam): Likewise. * nptl/pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Likewise. * nptl/pthread_mutexattr_getprioceiling.c (pthread_mutexattr_getprioceiling): Likewise. * nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise. * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise. * nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise. * nptl/pthread_setschedparam.c (__pthread_setschedparam): Likewise. * socket/recvfrom.c (__recvfrom): Likewise. * socket/sendto.c (__sendto): Likewise. * socket/setsockopt.c (__setsockopt): Likewise. * stdio-common/_itoa.c (_itoa): Likewise. * stdio-common/_itowa.c (_itowa): Likewise. * stdio-common/reg-printf.c (__register_printf_specifier): Likewise. (__register_printf_function): Likewise. * stdio-common/tempname.c (__path_search): Likewise. * stdlib/addmul_1.c (mpn_addmul_1): Likewise. * stdlib/mul_1.c (mpn_mul_1): Likewise. * stdlib/random_r.c (__initstate_r): Likewise. * stdlib/setenv.c (__add_to_environ): Likewise. * stdlib/submul_1.c (mpn_submul_1): Likewise. * streams/getpmsg.c (getpmsg): Likewise. * streams/putmsg.c (putmsg): Likewise. * streams/putpmsg.c (putpmsg): Likewise. * sunrpc/clnt_raw.c (clntraw_call): Likewise. * sunrpc/clnt_tcp.c (clnttcp_call): Likewise. * sunrpc/clnt_udp.c (clntudp_create): Likewise. * sunrpc/clnt_unix.c (clntunix_call): Likewise. * sunrpc/pm_getport.c (pmap_getport): Likewise. * sunrpc/svc_udp.c (cache_get): Likewise. * sunrpc/xdr_array.c (xdr_vector): Likewise. * sysdeps/mach/hurd/getcwd.c (__canonicalize_directory_name_internal): Likewise. * sysdeps/mach/hurd/pselect.c (__pselect): Likewise. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. * sysdeps/mach/hurd/select.c (__select): Likewise. * sysdeps/posix/ttyname_r.c (getttyname_r): Likewise. * sysdeps/pthread/timer_settime.c (timer_settime): Likewise. * sysdeps/sparc/nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise. * sysdeps/unix/sysv/linux/i386/putmsg.c (putmsg): Likewise. * sysdeps/unix/sysv/linux/s390/semtimedop.c (semtimedop): Likewise. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise. * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Likewise. * sysvipc/semtimedop.c (semtimedop): Likewise. * time/setitimer.c (__setitimer): Likewise. * time/strftime_l.c (emacs_strftime): Likewise.
* Convert 231 sysdeps function definitions to prototype style.Joseph Myers2015-10-1932-92/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly automatically-generated patch converts 231 sysdeps function definitions in glibc from old-style K&R to prototype-style. For __aio_sigqueue and __gai_sigqueue I had to add internal_function to the definitions as noted by Florian in <https://sourceware.org/ml/libc-alpha/2015-10/msg00595.html> to keep the functions compiling on x86 after conversion to prototype definitions. Otherwise, the patch is automatically generated with all the same exclusions and caveats as in <https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> except that it's a patch for sysdeps files. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). Also tested for arm, mips64 and powerpc32 that installed stripped shared libraries are unchanged by the patch. * sysdeps/arm/backtrace.c (__backtrace): Convert to prototype-style function definition. * sysdeps/i386/backtrace.c (__backtrace): Likewise. * sysdeps/i386/ffs.c (__ffs): Likewise. * sysdeps/i386/i686/ffs.c (__ffs): Likewise. * sysdeps/ia64/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/ia64/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise. * sysdeps/m68k/ffs.c (__ffs): Likewise. * sysdeps/m68k/m680x0/fpu/e_acos.c (FUNC): Likewise. * sysdeps/m68k/m680x0/fpu/e_fmod.c (FUNC): Likewise. * sysdeps/mach/adjtime.c (__adjtime): Likewise. * sysdeps/mach/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/mach/hurd/_exit.c (_exit): Likewise. * sysdeps/mach/hurd/access.c (__access): Likewise. * sysdeps/mach/hurd/adjtime.c (__adjtime): Likewise. * sysdeps/mach/hurd/chdir.c (__chdir): Likewise. * sysdeps/mach/hurd/chmod.c (__chmod): Likewise. * sysdeps/mach/hurd/chown.c (__chown): Likewise. * sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Likewise. (cthread_getspecific): Likewise. (cthread_setspecific): Likewise. (__libc_getspecific): Likewise. * sysdeps/mach/hurd/euidaccess.c (__euidaccess): Likewise. * sysdeps/mach/hurd/faccessat.c (faccessat): Likewise. * sysdeps/mach/hurd/fchdir.c (__fchdir): Likewise. * sysdeps/mach/hurd/fchmod.c (__fchmod): Likewise. * sysdeps/mach/hurd/fchmodat.c (fchmodat): Likewise. * sysdeps/mach/hurd/fchown.c (__fchown): Likewise. * sysdeps/mach/hurd/fchownat.c (fchownat): Likewise. * sysdeps/mach/hurd/flock.c (__flock): Likewise. * sysdeps/mach/hurd/fsync.c (fsync): Likewise. * sysdeps/mach/hurd/ftruncate.c (__ftruncate): Likewise. * sysdeps/mach/hurd/getgroups.c (__getgroups): Likewise. * sysdeps/mach/hurd/gethostname.c (__gethostname): Likewise. * sysdeps/mach/hurd/getitimer.c (__getitimer): Likewise. * sysdeps/mach/hurd/getlogin_r.c (__getlogin_r): Likewise. * sysdeps/mach/hurd/getpgid.c (__getpgid): Likewise. * sysdeps/mach/hurd/getrusage.c (__getrusage): Likewise. * sysdeps/mach/hurd/getsockname.c (__getsockname): Likewise. * sysdeps/mach/hurd/group_member.c (__group_member): Likewise. * sysdeps/mach/hurd/isatty.c (__isatty): Likewise. * sysdeps/mach/hurd/lchown.c (__lchown): Likewise. * sysdeps/mach/hurd/link.c (__link): Likewise. * sysdeps/mach/hurd/linkat.c (linkat): Likewise. * sysdeps/mach/hurd/listen.c (__listen): Likewise. * sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise. * sysdeps/mach/hurd/mkdirat.c (mkdirat): Likewise. * sysdeps/mach/hurd/openat.c (__openat): Likewise. * sysdeps/mach/hurd/poll.c (__poll): Likewise. * sysdeps/mach/hurd/readlink.c (__readlink): Likewise. * sysdeps/mach/hurd/readlinkat.c (readlinkat): Likewise. * sysdeps/mach/hurd/recv.c (__recv): Likewise. * sysdeps/mach/hurd/rename.c (rename): Likewise. * sysdeps/mach/hurd/renameat.c (renameat): Likewise. * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Likewise. * sysdeps/mach/hurd/rmdir.c (__rmdir): Likewise. * sysdeps/mach/hurd/seekdir.c (seekdir): Likewise. * sysdeps/mach/hurd/send.c (__send): Likewise. * sysdeps/mach/hurd/setdomain.c (setdomainname): Likewise. * sysdeps/mach/hurd/setegid.c (setegid): Likewise. * sysdeps/mach/hurd/seteuid.c (seteuid): Likewise. * sysdeps/mach/hurd/setgid.c (__setgid): Likewise. * sysdeps/mach/hurd/setgroups.c (setgroups): Likewise. * sysdeps/mach/hurd/sethostid.c (sethostid): Likewise. * sysdeps/mach/hurd/sethostname.c (sethostname): Likewise. * sysdeps/mach/hurd/setlogin.c (setlogin): Likewise. * sysdeps/mach/hurd/setpgid.c (__setpgid): Likewise. * sysdeps/mach/hurd/setregid.c (__setregid): Likewise. * sysdeps/mach/hurd/setreuid.c (__setreuid): Likewise. * sysdeps/mach/hurd/settimeofday.c (__settimeofday): Likewise. * sysdeps/mach/hurd/setuid.c (__setuid): Likewise. * sysdeps/mach/hurd/shutdown.c (shutdown): Likewise. * sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise. * sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise. * sysdeps/mach/hurd/sigpending.c (sigpending): Likewise. * sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/mach/hurd/sigsuspend.c (__sigsuspend): Likewise. * sysdeps/mach/hurd/socket.c (__socket): Likewise. * sysdeps/mach/hurd/symlink.c (__symlink): Likewise. * sysdeps/mach/hurd/symlinkat.c (symlinkat): Likewise. * sysdeps/mach/hurd/telldir.c (telldir): Likewise. * sysdeps/mach/hurd/truncate.c (__truncate): Likewise. * sysdeps/mach/hurd/umask.c (__umask): Likewise. * sysdeps/mach/hurd/unlink.c (__unlink): Likewise. * sysdeps/mach/hurd/unlinkat.c (unlinkat): Likewise. * sysdeps/mips/mips64/__longjmp.c (__longjmp): Likewise. * sysdeps/posix/alarm.c (alarm): Likewise. * sysdeps/posix/cuserid.c (cuserid): Likewise. * sysdeps/posix/dirfd.c (dirfd): Likewise. * sysdeps/posix/dup.c (__dup): Likewise. * sysdeps/posix/dup2.c (__dup2): Likewise. * sysdeps/posix/euidaccess.c (euidaccess): Likewise. (main): Likewise. * sysdeps/posix/flock.c (__flock): Likewise. * sysdeps/posix/fpathconf.c (__fpathconf): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/gethostname.c (__gethostname): Likewise. * sysdeps/posix/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/posix/isatty.c (__isatty): Likewise. * sysdeps/posix/killpg.c (killpg): Likewise. * sysdeps/posix/libc_fatal.c (__libc_fatal): Likewise. * sysdeps/posix/mkfifoat.c (mkfifoat): Likewise. * sysdeps/posix/raise.c (raise): Likewise. * sysdeps/posix/remove.c (remove): Likewise. * sysdeps/posix/rename.c (rename): Likewise. * sysdeps/posix/rewinddir.c (__rewinddir): Likewise. * sysdeps/posix/seekdir.c (seekdir): Likewise. * sysdeps/posix/sigblock.c (__sigblock): Likewise. * sysdeps/posix/sigignore.c (sigignore): Likewise. * sysdeps/posix/sigintr.c (siginterrupt): Likewise. * sysdeps/posix/signal.c (__bsd_signal): Likewise. * sysdeps/posix/sigset.c (sigset): Likewise. * sysdeps/posix/sigsuspend.c (__sigsuspend): Likewise. * sysdeps/posix/sysconf.c (__sysconf): Likewise. * sysdeps/posix/sysv_signal.c (__sysv_signal): Likewise. * sysdeps/posix/time.c (time): Likewise. * sysdeps/posix/ttyname.c (getttyname): Likewise. (ttyname): Likewise. * sysdeps/posix/ttyname_r.c (__ttyname_r): Likewise. * sysdeps/posix/utime.c (utime): Likewise. * sysdeps/powerpc/fpu/s_isnan.c (__isnan): Likewise. * sysdeps/powerpc/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/powerpc/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/pthread/aio_error.c (aio_error): Likewise. * sysdeps/pthread/aio_read.c (aio_read): Likewise. * sysdeps/pthread/aio_read64.c (aio_read64): Likewise. * sysdeps/pthread/aio_write.c (aio_write): Likewise. * sysdeps/pthread/aio_write64.c (aio_write64): Likewise. * sysdeps/pthread/flockfile.c (__flockfile): Likewise. * sysdeps/pthread/ftrylockfile.c (__ftrylockfile): Likewise. * sysdeps/pthread/funlockfile.c (__funlockfile): Likewise. * sysdeps/pthread/timer_create.c (timer_create): Likewise. * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise. * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise. * sysdeps/s390/ffs.c (__ffs): Likewise. * sysdeps/s390/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/s390/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/sh/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/sparc/nptl/pthread_barrier_destroy.c (pthread_barrier_destroy): Likewise. * sysdeps/sparc/nptl/pthread_barrier_wait.c (__pthread_barrier_wait): Likewise. * sysdeps/sparc/sparc32/e_sqrt.c (__ieee754_sqrt): Likewise. * sysdeps/sparc/sparc32/pthread_barrier_wait.c (__pthread_barrier_wait): Likewise. * sysdeps/sparc/sparc32/sem_init.c (__old_sem_init): Likewise. * sysdeps/tile/memcmp.c (memcmp_common_alignment): Likewise. (memcmp_not_common_alignment): Likewise. (MEMCMP): Likewise. * sysdeps/tile/wordcopy.c (_wordcopy_fwd_aligned): Likewise. (_wordcopy_fwd_dest_aligned): Likewise. (_wordcopy_bwd_aligned): Likewise. (_wordcopy_bwd_dest_aligned): Likewise. * sysdeps/unix/bsd/ftime.c (ftime): Likewise. * sysdeps/unix/bsd/gtty.c (gtty): Likewise. * sysdeps/unix/bsd/stty.c (stty): Likewise. * sysdeps/unix/bsd/tcflow.c (tcflow): Likewise. * sysdeps/unix/bsd/tcflush.c (tcflush): Likewise. * sysdeps/unix/bsd/tcgetattr.c (__tcgetattr): Likewise. * sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise. * sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Likewise. * sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise. * sysdeps/unix/bsd/tcsetpgrp.c (tcsetpgrp): Likewise. * sysdeps/unix/bsd/ualarm.c (ualarm): Likewise. * sysdeps/unix/bsd/wait3.c (__wait3): Likewise. * sysdeps/unix/getlogin_r.c (__getlogin_r): Likewise. * sysdeps/unix/sockatmark.c (sockatmark): Likewise. * sysdeps/unix/stime.c (stime): Likewise. * sysdeps/unix/sysv/linux/_exit.c (_exit): Likewise. * sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue): Likewise. Use internal_function. * sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Convert to prototype-style function definition. * sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise. * sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise. * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Likewise. * sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue): Likewise. Use internal_function. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Convert to prototype-style function definition * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. (__getlogin_r): Likewise. * sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c (__pthread_cond_broadcast): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c (__pthread_cond_destroy): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c (__pthread_cond_init): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c (__pthread_cond_signal): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c (__pthread_cond_wait): Likewise. * sysdeps/unix/sysv/linux/i386/getmsg.c (getmsg): Likewise. * sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/ia64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c (__ftruncate64): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c (truncate64): Likewise. * sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c (pthread_getcpuclockid): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_sigmask.c (pthread_sigmask): Likewise. * sysdeps/unix/sysv/linux/pthread_sigqueue.c (pthread_sigqueue): Likewise. * sysdeps/unix/sysv/linux/raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/semget.c (semget): Likewise. * sysdeps/unix/sysv/linux/semop.c (semop): Likewise. * sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise. * sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise. * sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise. * sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise. * sysdeps/unix/sysv/linux/sigstack.c (sigstack): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/speed.c (cfgetospeed): Likewise. (cfgetispeed): Likewise. (cfsetospeed): Likewise. (cfsetispeed): Likewise. * sysdeps/unix/sysv/linux/tcflow.c (tcflow): Likewise. * sysdeps/unix/sysv/linux/tcflush.c (tcflush): Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise. * sysdeps/unix/sysv/linux/time.c (time): Likewise. * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise. * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Likewise. * sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun): Likewise. * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/x86_64/backtrace.c (__backtrace): Likewise.
* To fix BZ #18675, use __fstatvfs64 in __fpathconf.Paul Pluzhnikov2015-09-091-11/+3
|
* Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912).Joseph Myers2015-09-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was noted in <https://sourceware.org/ml/libc-alpha/2012-09/msg00305.html> that the bits/*.h naming scheme should only be used for installed headers. This patch renames bits/libc-lock.h to plain libc-lock.h and bits/libc-lockP.h to plain libc-lockP.h to follow that convention. Note that I don't know where libc-lockP.h comes from for Hurd (the Hurd libc-lock.h includes libc-lockP.h, but the only libc-lockP.h in the glibc source tree is for NPTL) - some unmerged patch? - but I updated the #include in the Hurd libc-lock.h anyway. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #14912] * bits/libc-lock.h: Move to ... * sysdeps/generic/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/mach/hurd/bits/libc-lock.h: Move to ... * sysdeps/mach/hurd/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. [_LIBC]: Include <libc-lockP.h> instead of <bits/libc-lockP.h>. * sysdeps/mach/bits/libc-lock.h: Move to ... * sysdeps/mach/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lock.h: Move to ... * sysdeps/nptl/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lockP.h: Move to ... * sysdeps/nptl/libc-lockP.h: ...here. (_BITS_LIBC_LOCKP_H): Rename macro to _LIBC_LOCKP_H. * crypt/crypt_util.c: Include <libc-lock.h> instead of <bits/libc-lock.h>. * dirent/scandir-tail.c: Likewise. * dlfcn/dlerror.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-iteratephdr.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-writev.h: Likewise. * elf/rtld.c: Likewise. * grp/fgetgrent.c: Likewise. * gshadow/fgetsgent.c: Likewise. * gshadow/sgetsgent.c: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/gconv_db.c: Likewise. * iconv/gconv_dl.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_trans.c: Likewise. * include/link.h: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent.c: Likewise. * inet/getnetgrent_r.c: Likewise. * intl/bindtextdom.c: Likewise. * intl/dcigettext.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettextP.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/textdomain.c: Likewise. * libidn/idn-stub.c: Likewise. * libio/libioP.h: Likewise. * locale/duplocale.c: Likewise. * locale/freelocale.c: Likewise. * locale/newlocale.c: Likewise. * locale/setlocale.c: Likewise. * login/getutent_r.c: Likewise. * login/getutid_r.c: Likewise. * login/getutline_r.c: Likewise. * login/utmp-private.h: Likewise. * login/utmpname.c: Likewise. * malloc/mtrace.c: Likewise. * misc/efgcvt.c: Likewise. * misc/error.c: Likewise. * misc/fstab.c: Likewise. * misc/getpass.c: Likewise. * misc/mntent.c: Likewise. * misc/syslog.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nss-default.c: Likewise. * nis/nss_compat/compat-grp.c: Likewise. * nis/nss_compat/compat-initgroups.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/nss_nisplus/nisplus-alias.c: Likewise. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-initgroups.c: Likewise. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. * nis/ypclnt.c: Likewise. * nptl/libc_pthread_init.c: Likewise. * nss/getXXbyYY.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_db/db-XXX.c: Likewise. * nss/nss_db/db-netgrp.c: Likewise. * nss/nss_db/nss_db.h: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-alias.c: Likewise. * nss/nsswitch.c: Likewise. * posix/regex_internal.h: Likewise. * posix/wordexp.c: Likewise. * pwd/fgetpwent.c: Likewise. * resolv/res_hconf.c: Likewise. * resolv/res_libc.c: Likewise. * shadow/fgetspent.c: Likewise. * shadow/lckpwdf.c: Likewise. * shadow/sgetspent.c: Likewise. * socket/opensock.c: Likewise. * stdio-common/reg-modifier.c: Likewise. * stdio-common/reg-printf.c: Likewise. * stdio-common/reg-type.c: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/abort.c: Likewise. * stdlib/cxa_atexit.c: Likewise. * stdlib/fmtmsg.c: Likewise. * stdlib/random.c: Likewise. * stdlib/setenv.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_none.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/create_xid.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/rpc_thread.c: Likewise. * sysdeps/arm/backtrace.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/stdio-lock.h: Likewise. * sysdeps/generic/unwind-dw2-fde.c: Likewise. * sysdeps/i386/backtrace.c: Likewise. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Likewise. * sysdeps/m68k/backtrace.c: Likewise. * sysdeps/mach/hurd/cthreads.c: Likewise. * sysdeps/mach/hurd/dirstream.h: Likewise. * sysdeps/mach/hurd/malloc-machine.h: Likewise. * sysdeps/nptl/malloc-machine.h: Likewise. * sysdeps/nptl/stdio-lock.h: Likewise. * sysdeps/posix/dirstream.h: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. * sysdeps/posix/system.c: Likewise. * sysdeps/pthread/aio_suspend.c: Likewise. * sysdeps/s390/s390-32/backtrace.c: Likewise. * sysdeps/s390/s390-64/backtrace.c: Likewise. * sysdeps/unix/sysv/linux/check_pf.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c: Likewise. * sysdeps/unix/sysv/linux/shm-directory.c: Likewise. * sysdeps/unix/sysv/linux/system.c: Likewise. * sysdeps/x86_64/backtrace.c: Likewise. * time/alt_digit.c: Likewise. * time/era.c: Likewise. * time/tzset.c: Likewise. * wcsmbs/wcsmbsload.c: Likewise. * nptl/tst-initializers1.c (do_test): Refer to <libc-lock.h> instead of <bits/libc-lock.h> in comment.
* BZ#18921: Fix opendir inverted o_directory_works test.Roland McGrath2015-09-041-1/+1
|
* Fix broken overflow check in posix_fallocate [BZ 18873]Paul Eggert2015-08-312-2/+2
| | | | | | * sysdeps/posix/posix_fallocate.c (posix_fallocate): * sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64): Fix parenthesization typo.
* Fix BZ #18086 -- nice resets errno to 0.Paul Pluzhnikov2015-08-111-3/+3
|
* Make sysdeps/posix bring in login subdir.Roland McGrath2015-07-231-0/+1
|
* Factor file identity rules out of generic rtld code.Roland McGrath2015-07-141-0/+50
|
* Fix nice getpriority, setpriority namespace (bug 18553).Joseph Myers2015-06-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nice (XPG3) calls getpriority and setpriority (in XPG4 but not XPG3, i.e. UX-shaded in XPG4). This patch fixes this by making those functions into weak aliases of __* functions and calling the __* versions as needed. Tested for x86_64 and x86 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). This completes cleaning up the unsorted linknamespace test XFAILs. [BZ #18553] * resource/getpriority.c (getpriority): Rename to __getpriority and define as weak alias of __getpriority. * resource/setpriority.c (setpriority): Rename to __setpriority and define as weak alias of __setpriority. * sysdeps/mach/hurd/getpriority.c (getpriority): Rename to __getpriority and define as weak alias of __getpriority. * sysdeps/mach/hurd/setpriority.c (setpriority): Rename to __setpriority and define as weak alias of __setpriority. * sysdeps/unix/syscalls.list (getpriority): Use __getpriority as strong name. (setpriority): Use __setpriority as strong name. * sysdeps/unix/sysv/linux/getpriority.c (getpriority): Rename to __getpriority and define as weak alias of __getpriority. * include/sys/resource.h (__getpriority): Declare. Use libc_hidden_proto. (__setpriority): Likewise. (getpriority): Don't use libc_hidden_proto. (setpriority): Likewise. * sysdeps/posix/nice.c (nice): Call __getpriority instead of getpriority. Call __setpriority instead of setpriority. * conform/Makefile (test-xfail-XPG3/unistd.h/linknamespace): Remove variable.
* posix_fallocate: Emulation fixes and documentation [BZ #15661]Florian Weimer2015-06-052-38/+96
| | | | | | | | Handle signed integer overflow correctly. Detect and reject O_APPEND. Document drawbacks of emulation. This does not completely address bug 15661, but improves the situation somewhat.
* Move usleep.c using nanosleep to sysdeps/posix.Roland McGrath2015-05-201-0/+33
|
* Refactor opendir.Roland McGrath2015-05-181-41/+81
|
* linux: open and openat ignore 'mode' with O_TMPFILE in flagsEric Rannaud2015-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both open and openat load their last argument 'mode' lazily, using va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also necessary if O_TMPFILE is in oflag. By chance on x86_64, the problem wasn't evident when using O_TMPFILE with open, as the 3rd argument of open, even when not loaded with va_arg, is left untouched in RDX, where the syscall expects it. However, openat was not so lucky, and O_TMPFILE couldn't be used: mode is the 4th argument, in RCX, but the syscall expects its 4th argument in a different register than the glibc wrapper, in R10. Introduce a macro __OPEN_NEEDS_MODE (oflag) to test if either O_CREAT or O_TMPFILE is set in oflag. Tested on Linux x86_64. [BZ #17523] * io/fcntl.h (__OPEN_NEEDS_MODE): New macro. * io/bits/fcntl2.h (open): Use it. (openat): Likewise. * io/open.c (__libc_open): Likewise. * io/open64.c (__libc_open64): Likewise. * io/open64_2.c (__open64_2): Likewise. * io/open_2.c (__open_2): Likewise. * io/openat.c (__openat): Likewise. * io/openat64.c (__openat64): Likewise. * io/openat64_2.c (__openat64_2): Likewise. * io/openat_2.c (__openat_2): Likewise. * sysdeps/mach/hurd/open.c (__libc_open): Likewise. * sysdeps/mach/hurd/openat.c (__openat): Likewise. * sysdeps/posix/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise. * sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise. (__open_nocancel): Likewise. * sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/openat.c (__OPENAT): Likewise.
* Fix posix_spawn getrlimit64 namespace (bug 17991).Joseph Myers2015-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | posix_spawn (a standard POSIX function) brings in a use of getrlimit64 (not a standard POSIX function). This patch fixes this by using __getrlimit64 and making getrlimit64 a weak alias. This is more complicated than some such changes because of files that define getrlimit64 in their own way using symbol versioning after including the main sysdeps/unix/sysv/linux/getrlimit64.c with a getrlimit macro defined. There are various existing patterns for such cases in glibc; the one I've used here is that a getrlimit64 macro disables the weak_alias / libc_hidden_weak calls, leaving it to the including file to define the getrlimit64 name in whatever way is appropriate. Tested for x86_64 and x86 that installed stripped shared libraries are unchanged by this patch. [BZ #17991] * include/sys/resource.h (__getrlimit64): Declare. Use libc_hidden_proto. * resource/getrlimit64.c (getrlimit64): Rename to __getrlimit64 and define as weak alias of __getrlimit64. Use libc_hidden_weak. * sysdeps/posix/spawni.c (__spawni): Call __getrlimit64 instead of getrlimit64. * sysdeps/unix/sysv/linux/getrlimit64.c (getrlimit64): Rename to __getrlimit64. [!getrlimit64] (getrlimit64): Define as weak alias of __getrlimit64. Use libc_hidden_weak. * sysdeps/unix/sysv/linux/i386/getrlimit64.c (getrlimit64): Define using __getrlimit64 not __new_getrlimit64. (__GI_getrlimit64): Likewise. * sysdeps/unix/sysv/linux/mips/getrlimit64.c (getrlimit64): Likewise. (__GI_getrlimit64): Likewise. (__old_getrlimit64): Use __getrlimit64 not __new_getrlimit64. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list (getrlimit): Add __getrlimit64 alias. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (getrlimit): Likewise. * conform/Makefile (test-xfail-XOPEN2K/spawn.h/linknamespace): Remove variable. (test-xfail-POSIX2008/spawn.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
* Fix shm-directory.h #include.Roland McGrath2015-01-091-1/+1
|
* Function declaration cleanupAdhemerval Zanella2015-01-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the some function declaration from K&R style to default ANSI C. * nptl/pthread_cancel.c (pthread_cancel): Use ANSI prototype. * nptl/pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise. * nptl/pthread_cond_wait.c (__pthread_cond_wait): Likewise. * nptl/pthread_exit.c (__pthread_exit): Likewise. * nptl/pthread_join.c (pthread_join): Likewise. * nptl/pthread_timedjoin.c (pthread_timedjoin_np): Likewise. * sysdeps/posix/waitid.c (__waitid): Likewise. * sysdeps/unix/sysv/linux/arm/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/arm/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/arm/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/arm/pwrite64.c (__libc_pwrite64): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c (__libc_pwrite64): Likewsie. * sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise. * sysdeps/unix/sysv/linux/msgrcv.c (__libc_msgrcv): Likewise. * sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Likewise. * sysdeps/unix/sysv/linux/openat.c (OPENAT_NOT_CANCEL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c (__libc_pwrite64): Likewise. * sysdeps/unix/sysv/linux/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/preadv.c (PREADV): Likewise. * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Likewise. * sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise. * sysdeps/unix/sysv/linux/pwritev.c (__libc_pwritev): Likewise. * sysdeps/unix/sysv/linux/sh/pread.c (__libc_pread): Likewise. * sysdeps/unix/sysv/linux/sh/pread64.c (__libc_pread64): Likewise. * sysdeps/unix/sysv/linux/sh/pwrite.c (__libc_pwrite): Likewise. * sysdeps/unix/sysv/linux/sh/pwrite64.c (__libc_write64): Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Likewise. * sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Likewise. * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c (__libc_msgrcv): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-0281-81/+81
|
* Use posix-conf-vars.list to generate spec arraySiddhesh Poyarekar2014-12-291-1/+1
| | | | | | | | | | | | | | | | | | This patch adds support to generate the spec array in getconf from the conf.list. The generated code is mostly unchanged. the only changes are due to the change in layout of the spec and val arrays in the ELF. The val array can also be auto-generated from posix-conf-vars.list once the remaining macros are added to it. * posix/posix-conf-vars.list (SPEC:XBS5): Add sysconf prefix. * posix/confstr.c: Define NEED_SPEC_ARRAY to 0. * posix/posix-envs.def: Likewise. * sysdeps/posix/sysconf.c: Likewise. * posix/getconf.c: Define NEED_SPEC_ARRAY to 1. (specs): Remove array. * scripts/gen-posix-conf-vars.awk: Support generation of specs array.
* Add _POSIX namespace SYSCONF macros to posix-conf-vars.listSiddhesh Poyarekar2014-12-291-78/+80
| | | | | | | | This fixes the remaining -Wundef warnings. Tested on x86_64. * posix/posix-conf-vars.list: Add _POSIX sysconf namespace. * sysdeps/posix/sysconf.c: Include posix-conf-vars.h. (__sysconf): Use CONF_IS_* macros.
* Fix profil_counter namespace (bug 17725).Joseph Myers2014-12-172-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On ARM, where profil_counter is not static, it is brought in by references to various standard functions, as noted in <https://sourceware.org/ml/libc-alpha/2014-11/msg00890.html>, although it is not a standard function itself. I don't know if this also causes test failures on SPARC, although I see no reason for it not to do so. This patch fixes this namespace issue. profil_counter is renamed to __profil_counter and made a weak alias on ARM and SPARC. Because of the uses in profil.c / sprofil.c it seems simplest to make the rename globally, including on the other architectures for which profil_counter was static and so the change is of no substance. The variant names profil_counter_* used in sprofil.c are also renamed to start with __ so that undesired function names do not get exported in static libc. As I noted in bug 17726, profil_counter should probably be a compat symbol on ARM and SPARC, so it wouldn't exist at all in static libc even as a weak alias. Since defining a compat symbol still requires an internal name as a target of an alias, this patch still seems reasonable as an intermediate step towards that goal: it wouldn't be possible for the function simply to be static profil_counter on ARM and SPARC with profil_counter also being the exported compat symbol name, so profil.c / sprofil.c would still need to be prepared to call the function under another name (here, __profil_counter). Tested for x86_64 (testsuite, and that stripped installed shared libraries are unchanged by the patch) and ARM (ABI and linknamespace tests - this patch reduces the number of linknamespace failures I see on ARM from 227 to 5, the residue being math.h failures for fe* functions and for j0l/j1n/jnl/y0l/y1l/ynl aliases). 2014-12-17 Joseph Myers <joseph@codesourcery.com> [BZ #17725] * sysdeps/generic/profil-counter.h (profil_counter): Rename to __profil_counter. * sysdeps/unix/sysv/linux/hppa/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/ia64/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/tile/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/x86_64/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter): Likewise. [!__profil_counter] (profil_counter): Define as weak alias of __profil_counter. * sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h (profil_counter): Rename to __profil_counter. [!__profil_counter] (profil_counter): Define as weak alias of __profil_counter. * sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h (profil_counter): Rename to __profil_counter. [!__profil_counter] (profil_counter): Define as weak alias of __profil_counter. * sysdeps/posix/profil.c: Update comment referring to profil_counter. (__profil): Use __profil_counter instead of profil_counter. * sysdeps/posix/sprofil.c (profil_counter): Rename to __profil_counter. Use __profil_counter_ushort and __profil_counter_uint in definitions. (__sprofil): Use __profil_counter_uint and __profil_counter_ushort instead of profil_counter_uint and profil_counter_ushort.
* NPTL: Refactor named semaphore code to use shm-directory.hRoland McGrath2014-12-125-7/+15
|