about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* Make quadrant shift a boolean in reduce_and_compute in s_sin.cSiddhesh Poyarekar2016-10-061-4/+4
| | | | | | | | Like the previous change, make the quadrant shift a boolean to make it clearer that we will do at most a single rotation of the quadrants to compute the cosine from the sine function. This does not affect codegen.
* Check n instead of k1 to decide on sign of sin/cos resultSiddhesh Poyarekar2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | For k1 in 1 and 3, n can only have values of 0 and 2, so checking k1 & 2 is equivalent to checking n & 2. We prefer the latter so that we don't use k1 for anything other than selecting the quadrant in do_sincos_1, thus dropping it completely. The previous logic was: "Compute sine for the value and based on the new rotated quadrant (k1) negate the value if we're in the fourth quadrant." With this change, the logic now is: "Compute sine for the value and negate it if we were either (1) in the fourth quadrant or (2) we actually wanted the cosine and were in the third quadrant." * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Check N instead of K1.
* Make the quadrant shift K a bool in do_sincos_* functionsSiddhesh Poyarekar2016-10-061-19/+19
| | | | | | | | | | | | | | | | The do_sincos_* functions are helpers to compute sin/cos, where they get cosine by computing sine for the next quadrant. This is decided with the value of K passed to it, which is the amount by which to shift the quadrant. Since we will only need the shift to be 0 or 1, we make K a bool to make that explicit. * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Rename K to SHIFT_QUADRANT and make it bool. (do_sincos_2): Likewise. (sloww): Likewise. (sloww1): Likewise. (__sin): Adjust calls to do_sincos_1 and do_sincos_2. (__cos): Likewise.
* powerpc: Regenerate ULPsTulio Magno Quites Machado Filho2016-10-051-55/+55
| | | | * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
* powerpc: Installed-header hygieneTulio Magno Quites Machado Filho2016-10-043-9/+11
| | | | | | | | Fix powerpc-specific headers: - Make it compatible to C89 by replace references to inline by __inline__. - Get the definition of sigset_t used by sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h. - Includes missing header file.
* S390: Regenerate ULPsStefan Liebler2016-10-041-8/+2
| | | | | | | | Regenerated ulps file after recent commit "Use __builtin_fma more in dbl-64 code.". ChangeLog: * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
* Add TCP_REPAIR_WINDOW from Linux 4.8.Joseph Myers2016-10-031-0/+11
| | | | | | | | | | | | | Linux 4.8 adds TCP_REPAIR_WINDOW to include/uapi/linux/tcp.h. This patch adds it to sysdeps/gnu/netinet/tcp.h accordingly, along with struct tcp_repair_window as requested in <https://sourceware.org/ml/libc-alpha/2016-10/msg00019.html>. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * sysdeps/gnu/netinet/tcp.h (TCP_REPAIR_WINDOW): New macro. (struct tcp_repair_window): New type.
* Use __builtin_fma more in dbl-64 code.Joseph Myers2016-09-302-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysdeps/ieee754/dbl-64/dla.h can use a macro DLA_FMS for more efficient double-width operations when fused multiply-subtract is supported. However, this macro is only defined for x86_64, conditional on architecture-specific __FMA4__. This patch makes the code use __builtin_fma conditional on __FP_FAST_FMA, as used elsewhere in glibc. Tested for x86_64, x86 and powerpc. On powerpc (where this is causing fused operations to be used where they weren't previously) I see an increase from 1ulp to 2ulp in the imaginary part of clog10: testing double (without inline functions) Failure: Test: Imaginary part of: clog10 (0x1.7a858p+0 - 0x6.d940dp-4 i) Result: is: -1.2237865208199886e-01 -0x1.f5435146bb61ap-4 should be: -1.2237865208199888e-01 -0x1.f5435146bb61cp-4 difference: 2.7755575615628914e-17 0x1.0000000000000p-55 ulp : 2.0000 max.ulp : 1.0000 Maximal error of real part of: clog10 is : 3 ulp accepted: 3 ulp Maximal error of imaginary part of: clog10 is : 2 ulp accepted: 1 ulp This is actually resulting from atan2 becoming *more* accurate (atan2 (-0x6.d940dp-4, 0x1.7a858p+0) should ideally be -0x1.208cd6e841554p-2 but was -0x1.208cd6e841555p-2 from a powerpc libm built before this change, and is -0x1.208cd6e841554p-2 from a powerpc libm built after this change). Since these functions are not expected to be correctly rounding by glibc's accuracy goals, neither result is a problem, but this does imply that some of this code, although designed to be correctly rounding, is not in fact correctly rounding (possibly because of GCC creating fused operations where the code does not expect it, something we've only disabled for specific functions where it was found to cause large errors). (Of course as previously discussed I think we should remove the slow cases where an error analysis shows this wouldn't increase the errors much above 0.5ulp; it's only functions such as cratan2 that are expected to be correctly rounding, not atan2.) * sysdeps/ieee754/dbl-64/dla.h [__FP_FAST_FMA] (DLA_FMS): Define macro to use __builtin_fma. * sysdeps/x86_64/fpu/dla.h: Remove file.
* Fix ldbl-128ibm iscanonical for -mlong-double-64.Joseph Myers2016-09-301-1/+5
| | | | | | | | | | | This patch fixes the ldbl-128ibm version of the iscanonical macro not to use __iscanonicall when long double = double (-mlong-double-64). Tested for powerpc. * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h [__NO_LONG_DOUBLE_MATH] (__iscanonicall): Do not declare. [__NO_LONG_DOUBLE_MATH] (iscanonical): Define to evaluate to 1.
* Add iscanonical.Joseph Myers2016-09-3017-1/+520
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 adds an iscanonical classification macro to <math.h>. The motivation for this is decimal floating-point, where some values have both canonical and noncanonical encodings. For IEEE binary interchange formats, all encodings are canonical. For x86/m68k ldbl-96, and for ldbl-128ibm, there are encodings that do not represent any valid value of the type; although formally iscanonical does not need to handle trap representations (and so could just always return 1), it seems useful, and in line with the description in the TS of "representations that are extraneous to the floating-point model" as being non-canonical (as well as "redundant representations of some or all of its values"), for it to detect those representations and return 0 for them. This patch adds iscanonical to glibc. It goes in a header <bits/iscanonical.h>, included under appropriate conditions in <math.h>. The default header version just evaluates the argument (converted to its semantic type, though current GCC will probably discard that conversion and any exceptions resulting from it) and returns 1. ldbl-96 and ldbl-128ibm then have versions of the header that call a function __iscanonicall for long double (the sizeof-based tests will of course need updating for float128 support, like other such type-generic macro implementations). The ldbl-96 version of __iscanonicall has appropriate conditionals to reflect the differences in the m68k version of that format (where the high mantissa bit may be either 0 or 1 when the exponent is 0 or 0x7fff). Corresponding tests for those formats are added as well. Other architectures do not have any new functions added because just returning 1 is correct for all their floating-point formats. Tested for x86_64, x86, mips64 (to test the default macro version) and powerpc. * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Include <bits/iscanonical.h>. * bits/iscanonical.h: New file. * math/s_iscanonicall.c: Likewise. * math/Versions (__iscanonicall): New libm symbol at version GLIBC_2.25. * math/libm-test.inc (iscanonical_test_data): New array. (iscanonical_test): New function. (main): Call iscanonical_test. * math/Makefile (headers): Add bits/iscanonical.h. (type-ldouble-routines): Add s_iscanonicall. * manual/arith.texi (Floating Point Classes): Document iscanonical. * manual/libm-err-tab.pl: Update comment on interfaces without ulps tabulated. * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h: New file. * sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Add test-iscanonical-ldbl-128ibm. * sysdeps/ieee754/ldbl-96/bits/iscanonical.h: New file. * sysdeps/ieee754/ldbl-96/s_iscanonicall.c: Likewise. * sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Likewise. * sysdeps/ieee754/ldbl-96/Makefile: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* Use copysign instead of ternary for some sin/cos input rangesSiddhesh Poyarekar2016-09-301-13/+13
| | | | | | | | | | | | | | | | | | | These are remaining cases where we can deduce and conclude that the sign of the result should be the same as the sign of the input being checked. For example, for sin(x), the sign of the result is the same as the result itself for x < pi. Likewise, for sine values where x after range reduction falls into this range and its sign is preserved. * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Use copysign instead of ternary condition. (do_sincos_2): Likewise. (__sin): Likewise. (__cos): Likewise. (slow): Likewise. (sloww): Likewise. (sloww1): Likewise. (bsloww): Likewise. (bsloww1): Likewise.
* Use copysign instead of ternary conditions for positive constantsSiddhesh Poyarekar2016-09-301-19/+19
| | | | | | | | | | | | | | | | | | This is the first very simple substitution of ternary conditions for correction adjustments with __copysign for positive constants. * sysdeps/ieee754/dbl-64/s_sin.c (do_cos_slow): use copysign instead of ternary condition. (do_sin_slow): Likewise. (do_sincos_1): Likewise. (do_sincos_2): Likewise. (__cos): Likewise. (sloww): Likewise. (sloww1): Likewise. (sloww2): Likewise. (bsloww): Likewise. (bsloww1): Likewise. (bsloww2): Likewise.
* consolidate sign checks for slow2Siddhesh Poyarekar2016-09-301-8/+10
| | | | | | | | | | Simplify the code a bit by consolidating sign checks in slow1 and slow2 into __sin at the higher level. * sysdeps/ieee754/dbl-64/s_sin.c (slow1): Consolidate sign check from here... (slow2): ... and here... (__sin): ... to here.
* posix: Fix open file action for posix_spawn on LinuxAdhemerval Zanella2016-09-281-0/+8
| | | | | | | | | | | | | | | | | | | | | On posix_spawn open file action (issued by posix_spawn_file_actions_addopen) POSIX states that if fildes was already an open file descriptor, it shall be closed before the new file is openedi [1]. This avoid pontential issues when posix_spawn plus addopen action is called with the process already at maximum number of file descriptor opened and also for multiple actions on single-open special paths (like /dev/watchdog). This fixes its behavior on Linux posix_spawn implementation and also adds a tests to check for its behavior. Checked on x86_64. * posix/Makefile (tests): Add tst-spawn3. * posix/tst-spawn3.c: New file. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Close file descriptor if it is already opened for open action. [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addclose.html
* linux: spawni.c: simplify error reporting to parentRasmus Villemoes2016-09-281-46/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Using CLONE_VFORK already ensures that the parent does not run until the child has either exec'ed succesfully or called _exit. Hence we don't need to read from a CLOEXEC pipe to ensure proper synchronization - we just make explicit use of the fact the the child and parent run in the same VM, so the child can write an error code to a field of the posix_spawn_args struct instead of sending it through a pipe. To ensure that this mechanism really works, the parent initializes the field to -1 and the child writes 0 before execing. This eliminates some annoying bookkeeping that is necessary to avoid the file actions from clobbering the write end of the pipe, and getting rid of the pipe creation in the first place means fewer system calls (four in the parent, usually one in the child) and fewer chanches for the spawn to fail (e.g. if we're close to EMFILE). Checked on x86_64 and i686. * sysdeps/unix/sysv/linux/spawni.c (posix_spawn_args): Remove pipe field, add err field. (__spawni_child): Report error through err member instead of pipe. (__spawnix): Likewise.
* Minor correction to the "installed header hygiene" patches.Zack Weinberg2016-09-281-2/+2
| | | | | * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Restore accidentally- deleted typedef ucontext_t.
* Add INTERNAL_SYSCALL_CALLAdhemerval Zanella2016-09-261-18/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds two new macros for internal and inline syscall to use within GLIBC: INTERNAL_SYSCALL_CALL and INLINE_SYSCALL_CALL. They are similar to the old INTERNAL_SYSCALL and INLINE_SYSCALL with the difference the new macros accept a variable argument call and do not require to pass the expected argument size. The advantage is it is possible to use variable argument macros like SYSCALL_LL{64} without the need to also handle the argument size. So for an ABI where SYSCALL_LL might split the argument in high and low parts, instead of: INTERNAL_SYSCALL_DECL (err); #if ... INTERNAL_SYSCALL (syscall, err, 2, SYSCALL_LL (len)); #else INTERNAL_SYSCALL (syscall, err, 1, SYSCALL_LL (len)); #endif It will be just: INTERNAL_SYSCALL_CALL (syscall, err, SYSCALL_LL (len)); The INLINE_SYSCALL_CALL follows the same semanthic regarding the argument and is similar to INLINE_SYSCALL regarding setting errno. Checked with a build for x86_64, i386, aach64, armhf, powerpc64le, powerpc32, and mips32. No code generation changed. * sysdeps/unix/sysdep.h (__INTERNAL_SYSCALL0): New macro. (__INTERNAL_SYSCALL1): Likewise. (__INTERNAL_SYSCALL2): Likewise. (__INTERNAL_SYSCALL3): Likewise. (__INTERNAL_SYSCALL4): Likewise. (__INTERNAL_SYSCALL5): Likewise. (__INTERNAL_SYSCALL6): Likewise. (__INTERNAL_SYSCALL7): Likewise. (__INTERNAL_SYSCALL_NARGS_X): Likewise. (__INTERNAL_SYSCALL_NARGS): Likewise. (__INTERNAL_SYSCALL_DISP): Likewise. (INTERNAL_SYSCALL_CALL): Likewise. (__SYSCALL0): Rename to __INLINE_SYSCALL0. (__SYSCALL1): Rename to __INLINE_SYSCALL1. (__SYSCALL2): Rename to __INLINE_SYSCALL2. (__SYSCALL3): Rename to __INLINE_SYSCALL3. (__SYSCALL4): Rename to __INLINE_SYSCALL4. (__SYSCALL5): Rename to __INLINE_SYSCALL5. (__SYSCALL6): Rename to __INLINE_SYSCALL6. (__SYSCALL7): Rename to __INLINE_SYSCALL7. (__SYSCALL_NARGS_X): Rename to __INLINE_SYSCALL_NARGS_X. (__SYSCALL_NARGS): Rename to __INLINE_SYSCALL_NARGS. (__SYSCALL_DISP): Rename to __INLINE_SYSCALL_DISP. (__SYSCALL_CALL): Rename to INLINE_SYSCALL_CALL. (SYSCALL_CANCEL): Replace __SYSCALL_CALL with INLINE_SYSCALL_CALL.
* Installed header hygiene (BZ#20366): Test of installed headers.Zack Weinberg2016-09-235-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a test to ensure that the problems fixed in the last several patches do not recur. Each directory checks the headers that it installs for two properties: first, each header must be compilable in isolation, as both C and C++, under a representative combination of language and library conformance levels; second, there is a blacklist of identifiers that may not appear in any installed header, currently consisting of the legacy BSD typedefs. (There is an exemption for the headers that define those typedefs, and for the RPC headers. It may be necessary to make this more sophisticated if we add more stuff to the blacklist in the future.) In order for this test to work correctly, every wrapper header that actually defines something must guard those definitions with #ifndef _ISOMAC. This is the existing mechanism used by the conform/ tests to tell wrapper headers not to define anything that the public header wouldn't, and not to use anything from libc-symbols.h. conform/ only cares for headers that we need to check for standards conformance, whereas this test applies to *every* header. (Headers in include/ that are either installed directly, or are internal-use-only and do *not* correspond to any installed header, are not affected.) * scripts/check-installed-headers.sh: New script. * Rules: In each directory that defines header files to be installed, run check-installed-headers.sh on them as a special test. * Makefile: Likewise for the headers installed at top level. * include/aliases.h, include/alloca.h, include/argz.h * include/arpa/nameser.h, include/arpa/nameser_compat.h * include/elf.h, include/envz.h, include/err.h * include/execinfo.h, include/fpu_control.h, include/getopt.h * include/gshadow.h, include/ifaddrs.h, include/libintl.h * include/link.h, include/malloc.h, include/mcheck.h * include/mntent.h, include/netinet/ether.h * include/nss.h, include/obstack.h, include/printf.h * include/pty.h, include/resolv.h, include/rpc/auth.h * include/rpc/auth_des.h, include/rpc/auth_unix.h * include/rpc/clnt.h, include/rpc/des_crypt.h * include/rpc/key_prot.h, include/rpc/netdb.h * include/rpc/pmap_clnt.h, include/rpc/pmap_prot.h * include/rpc/pmap_rmt.h, include/rpc/rpc.h * include/rpc/rpc_msg.h, include/rpc/svc.h * include/rpc/svc_auth.h, include/rpc/xdr.h * include/rpcsvc/nis_callback.h, include/rpcsvc/nislib.h * include/rpcsvc/yp.h, include/rpcsvc/ypclnt.h * include/rpcsvc/ypupd.h, include/shadow.h * include/stdio_ext.h, include/sys/epoll.h * include/sys/file.h, include/sys/gmon.h, include/sys/ioctl.h * include/sys/prctl.h, include/sys/profil.h * include/sys/statfs.h, include/sys/sysctl.h * include/sys/sysinfo.h, include/ttyent.h, include/utmp.h * sysdeps/arm/nacl/include/bits/setjmp.h * sysdeps/mips/include/sys/asm.h * sysdeps/unix/sysv/linux/include/sys/sysinfo.h * sysdeps/unix/sysv/linux/include/sys/timex.h * sysdeps/x86/fpu/include/bits/fenv.h: Add #ifndef _ISOMAC guard around internal declarations. Add multiple-inclusion guard if not already present.
* Installed-header hygiene (BZ#20366): stack_t.Zack Weinberg2016-09-2330-106/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sys/ucontext.h unconditionally uses stack_t, and it does not make sense to change that. But signal.h only declares stack_t under __USE_XOPEN_EXTENDED || __USE_XOPEN2K8. The actual definition is already in a bits header, bits/sigstack.h, but that header insists on only being included by signal.h, so we have to change that as well as all of the sys/ucontext.h variants. (Some but not all variants of bits/sigcontext.h, which sys/ucontext.h may also need, had already received this adjustment; for consistency, I made them all the same, even if that's not strictly necessary in some configurations.) bits/sigcontext.h and bits/sigstack.h also all need to receive multiple inclusion guards. * sysdeps/generic/sys/ucontext.h * sysdeps/arm/sys/ucontext.h * sysdeps/i386/sys/ucontext.h * sysdeps/m68k/sys/ucontext.h * sysdeps/mips/sys/ucontext.h * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h * sysdeps/unix/sysv/linux/arm/sys/ucontext.h * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h * sysdeps/unix/sysv/linux/ia64/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: Include both bits/sigcontext.h and bits/sigstack.h. Fix grammar error in comment, if present. * bits/sigstack.h * sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h * sysdeps/unix/sysv/linux/alpha/bits/sigstack.h * sysdeps/unix/sysv/linux/bits/sigstack.h * sysdeps/unix/sysv/linux/ia64/bits/sigstack.h * sysdeps/unix/sysv/linux/mips/bits/sigstack.h * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h * sysdeps/unix/sysv/linux/sparc/bits/sigstack.h * bits/sigcontext.h * sysdeps/mach/hurd/i386/bits/sigcontext.h * sysdeps/unix/sysv/linux/bits/sigcontext.h * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h: Add multiple inclusion guard. Permit inclusion by sys/ucontext.h as well as signal.h, if this was not already allowed. Request definition of size_t if necessary. Minimize semantically-null differences across files.
* Installed-header hygiene (BZ#20366): time.h types.Zack Weinberg2016-09-2312-61/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many headers are expected to expose a subset of the type definitions in time.h. time.h has a whole bunch of messy logic for conditionally defining some its types and structs, but, as best I can tell, this has never worked 100%. In particular, __need_timespec is ineffective if _TIME_H has already been defined, which means that if you compile #include <time.h> #include <sched.h> with e.g. -fsyntax-only -std=c89 -Wall -Wsystem-headers, you will get In file included from test.c:2:0: /usr/include/sched.h:74:57: warning: "struct timespec" declared inside parameter list will not be visible outside of this definition or declaration extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; ^~~~~~~~ And if you want to _use_ sched_rr_get_interval in a TU compiled that way, you're hosed. This patch replaces all of that with small bits/types/TYPE.h headers as introduced earlier. time.h and bits/time.h are now *much* simpler, and a lot of other headers are slightly simpler. * time/time.h, bits/time.h, sysdeps/unix/sysv/linux/bits/time.h: Remove all logic conditional on __need macros. Move all the conditionally defined types to their own headers... * time/bits/types/clock_t.h: Define clock_t here. * time/bits/types/clockid_t.h: Define clockid_t here. * time/bits/types/struct_itimerspec.h: Define struct itimerspec here. * time/bits/types/struct_timespec.h: Define struct timespec here. * time/bits/types/struct_timeval.h: Define struct timeval here. * time/bits/types/struct_tm.h: Define struct tm here. * time/bits/types/time_t.h: Define time_t here. * time/bits/types/timer_t.h: Define timer_t here. * time/Makefile: Install the new headers. * bits/resource.h, io/fcntl.h, io/sys/poll.h, io/sys/stat.h * io/utime.h, misc/sys/select.h, posix/sched.h, posix/sys/times.h * posix/sys/types.h, resolv/netdb.h, rt/aio.h, rt/mqueue.h * signal/signal.h, pthread/semaphore.h, sysdeps/nptl/pthread.h * sysdeps/unix/sysv/linux/alpha/bits/resource.h * sysdeps/unix/sysv/linux/alpha/sys/acct.h * sysdeps/unix/sysv/linux/bits/resource.h * sysdeps/unix/sysv/linux/bits/timex.h * sysdeps/unix/sysv/linux/mips/bits/resource.h * sysdeps/unix/sysv/linux/net/ppp_defs.h * sysdeps/unix/sysv/linux/sparc/bits/resource.h * sysdeps/unix/sysv/linux/sys/acct.h * sysdeps/unix/sysv/linux/sys/timerfd.h * sysvipc/sys/msg.h, sysvipc/sys/sem.h, sysvipc/sys/shm.h * time/sys/time.h, time/sys/timeb.h Use the new bits/types headers. * include/time.h: Remove __need logic. * include/bits/time.h * include/bits/types/clock_t.h, include/bits/types/clockid_t.h * include/bits/types/time_t.h, include/bits/types/timer_t.h * include/bits/types/struct_itimerspec.h * include/bits/types/struct_timespec.h * include/bits/types/struct_timeval.h * include/bits/types/struct_tm.h: New wrapper headers.
* Installed-header hygiene (BZ#20366): conditionally defined structures.Zack Weinberg2016-09-232-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several network-related structures are defined conditionally under __USE_MISC, but unconditionally used by other headers. The path of least resistance is usually to condition the uses on __USE_MISC as well. * sysdeps/mach/hurd/net/if_ppp.h * sysdeps/unix/sysv/linux/net/if_ppp.h: Only define struct ifpppstatsreq and struct ifpppcstatsreq if __USE_MISC is defined, to ensure struct ifreq is declared. * inet/netinet/ether.h: Condition all function prototypes on __USE_MISC, to ensure struct ether_addr is declared. sys/socket.h defines struct osockaddr only under __USE_MISC, whereas protocols/talkd.h requires it unconditionally. Here it doesn't make sense to condition the entire body of protocols/talkd.h on __USE_MISC. Rather than complicate sys/socket.h with a __need macro or duplicate the definition, I am introducing a new concept: tiny headers named bits/types/TYPE.h that define TYPE and nothing else. This can, I hope, ultimately replace *all* the __need macros. The guard macro for such headers will be __TYPE_defined, just in case application or third-party library code is looking at them. * socket/bits/types/struct_osockaddr.h: New header. * include/bits/types/struct_osockaddr.h: New wrapper. * socket/Makefile: Install the new header. * socket/sys/socket.h, inet/protocols/talkd.h: Refer to bits/types/struct_osockaddr.h for the definition of struct osockaddr.
* Installed-header hygiene (BZ#20366): obsolete BSD u_* types.Zack Weinberg2016-09-2323-259/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The types u_char, u_short, u_int, u_long, ushort, uint, ulong, u_int8_t, u_int16_t, u_int32_t, u_int64_t, quad_t, and u_quad_t are BSDisms that have never been standardized. While glibc should continue to *provide* these types for compatibility's sake, its public headers should not use them. The meat of this change was mechanically generated by the following shell command: perl -pi~ -e ' s/\b(__)?u_char\b/unsigned char/g; s/\b(__)?u_?short\b/unsigned short/g; s/\b(__)?u_?int\b/unsigned int/g; s/\b(__)?u_?long\b/unsigned long/g; s/\b(__)?u_int8_t\b/uint8_t/g; s/\b(__)?u_int16_t\b/uint16_t/g; s/\b(__)?u_int32_t\b/uint32_t/g; s/\b(__)?u_int64_t\b/uint64_t/g; s/\b(__)?u_quad_t\b/uint64_t/g; s/\b(__)?quad_t\b/uint64_t/g; ' $(grep -lE -e '\<((__)?(quad_t|u(short|int|long|_(char|short|int([0-9]+_t)?|long|quad_t))))\>' \ $(grep -LE '\<(_(SYS|BITS)_TYPES_H|rpc/(rpc|rpc_msg|types|xdr)\.h)\>' \ $(find . \( -false $(sed 's/^/-o -name /' all-installed-headers) \ \) -printf '%P\n' | sort -u))) where 'all-installed-headers' was a list of the basenames of all installed header files, manually extracted from the Makefiles. Non-installed wrapper headers in include/ are also adjusted, for consistency. I then manually fixed up indentation and line-wrapping. sys/types.h and bits/types.h are excluded because they must continue to define the u_* types (under __USE_MISC) for compatibility with applications. They do not use these types themselves. All headers that (transitively) include rpc/types.h are also excluded, for three reasons. First, the u_* types are defined by rpc/types.h, unconditionally (not just under __USE_MISC) so they are logically part of the SunRPC API. Second, many of those headers appear to be machine-generated. Third, it's my understanding that we are getting rid of as much of SunRPC as possible in the near future. (The one file under sunrpc/ that's touched, sunrpc/rpc/rpc_des.h, does *not* include rpc/types.h. This may itself be a bug.) After changing from u_intNN_t to uintNN_t, a number of headers now need to include stdint.h to pick up those types. It might be more hygenic, namespace-wise, to use __uintNN_t instead, but none of these headers are bound by ISO or POSIX to do so, and it's unlikely that anyone using them will be bothered. (The two files that were using __-prefixed versions of the u_types, sysdeps/mach/hurd/net/route.h and sysdeps/unix/sysv/linux/net/route.h, both already also contained uses of the unprefixed versions.) Some of these files directly included features.h and/or sys/cdefs.h, which I removed, as the style generally seems to be to let sys/types.h do that for us. (This does not change the set of definitions exposed by any header; sys/types.h unconditionally includes both features.h and sys/cdefs.h.) One file included asm/types.h unnecessarily. * bits/in.h, gmon/sys/gmon.h, inet/netinet/igmp.h * inet/protocols/routed.h, inet/protocols/talkd.h * inet/protocols/timed.h, io/fts.h, nptl_db/thread_db.h * resolv/arpa/nameser.h, resolv/resolv.h, sunrpc/rpc/rpc_des.h * sysdeps/generic/netinet/if_ether.h * sysdeps/generic/netinet/in_systm.h * sysdeps/generic/netinet/ip.h, sysdeps/generic/netinet/tcp.h * sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h * sysdeps/gnu/netinet/udp.h, sysdeps/mach/hurd/net/ethernet.h * sysdeps/mach/hurd/net/if_arp.h * sysdeps/mach/hurd/net/if_ppp.h * sysdeps/mach/hurd/net/route.h, sysdeps/mach/sys/reboot.h * sysdeps/unix/sysv/linux/bits/in.h * sysdeps/unix/sysv/linux/net/ethernet.h * sysdeps/unix/sysv/linux/net/if_arp.h * sysdeps/unix/sysv/linux/net/if_ppp.h * sysdeps/unix/sysv/linux/net/if_shaper.h * sysdeps/unix/sysv/linux/net/route.h * sysdeps/unix/sysv/linux/netinet/if_ether.h * sysdeps/unix/sysv/linux/netinet/if_fddi.h * sysdeps/unix/sysv/linux/netinet/if_tr.h * sysdeps/unix/sysv/linux/netipx/ipx.h * sysdeps/unix/sysv/linux/sys/acct.h * include/arpa/nameser.h, include/resolv.h: Change all uses of u_char to unsigned char, u_short and ushort to unsigned short, u_int and uint to unsigned int, u_long and ulong to unsigned long, u_int8_t to uint8_t, u_int16_t to uint16_t, u_int32_t to uint32_t, quad_t to int64_t, and u_int64_t and u_quad_t to uint64_t. * mach/sys/reboot.h: Remove two casts of integer literals to the types they already have. * bits/in.h: Correct error in description of IP_MULTICAST_LOOP. * sysdeps/unix/sysv/linux/bits/in.h: Likewise. * sysdeps/unix/sysv/linux/netinet/if_ether.h: Change a comment from referring to 'unsigned char' to 'uint8_t' for consistency with the macro definition below. * gmon/sys/gmon.h, inet/netinet/igmp.h, inet/protocols/talkd.h * io/fts.h, resolv/arpa/nameser.h, resolv/resolv.h * sunrpc/rpc/rpc_des.h, sysdeps/generic/netinet/ip.h * sysdeps/gnu/netinet/tcp.h, sysdeps/gnu/netinet/udp.h * sysdeps/mach/hurd/net/if_ppp.h, sysdeps/unix/sysv/linux/net/if_ppp.h * sysdeps/unix/sysv/linux/sys/acct.h * include/arpa/nameser.h, include/resolv.h: Fix indentation disrupted by mechanical edits. * inet/protocols/talkd.h, resolv/arpa/nameser.h * sysdeps/generic/netinet/in_systm.h * sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h * sysdeps/gnu/netinet/udp.h * sysdeps/unix/sysv/linux/net/ethernet.h * sysdeps/unix/sysv/linux/net/if_arp.h * sysdeps/unix/sysv/linux/net/if_ppp.h * sysdeps/unix/sysv/linux/net/if_shaper.h * sysdeps/unix/sysv/linux/netinet/if_fddi.h * sysdeps/unix/sysv/linux/netinet/if_tr.h * sysdeps/unix/sysv/linux/netipx/ipx.h * sysdeps/unix/sysv/linux/sys/acct.h Include stdint.h for uintNN_t definitions. Don't include sys/cdefs.h, features.h, or asm/types.h directly.
* Installed-header hygiene (BZ#20366): Simple self-contained fixes.Zack Weinberg2016-09-235-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some headers did not include all of their prerequisite headers. * rpcsvc/nislib.h: Include rpcsvc/nis.h. * sysdeps/unix/sysv/linux/netrose/rose.h: Include sys/socket.h and netax25/ax25.h. <endian.h> only defines BYTE_ORDER, BIG_ENDIAN, LITTLE_ENDIAN, etc. under __USE_MISC; glibc's headers should use __BYTE_ORDER, __BIG_ENDIAN, __LITTLE_ENDIAN, etc. instead. * inet/netinet/icmp6.h, inet/netinet/ip6.h * resolv/arpa/nameser_compat.h: Use __BYTE_ORDER etc. instead of BYTE_ORDER etc. sys/types.h only conditionally defines caddr_t and clockid_t. * sysdeps/unix/sysv/linux/sys/quota.h: Use __caddr_t instead of caddr_t. * sysdeps/unix/sysv/linux/sys/timerfd.h: Use __clockid_t instead of clockid_t. Remove a #warning that was the sole actual problem with using sys/ipc.h without _GNU_SOURCE/_XOPEN_SOURCE. * sysvipc/sys/ipc.h: Remove unnecessary #warning. _LIBC, __USE_XOPEN2K8, and __STDC_VERSION__ are not always defined. It seems to me that _LIBC should not appear in installed headers, but avoiding that for argp specifically would require more surgery than feels appropriate for this patch set. It's possible that "#ifdef _LIBC" would be sufficient, but I wanted to be conservative. All three versions of bits/socket.h want to know whether __flexarr will produce a real flexible array member -- specifically, one that doesn't alter sizeof(the structure containing it). They were testing for this with a complicated #if condition that did not agree with sys/cdefs.h and that tripped -Wundef warnings under -std=c90. I added a new macro to sys/cdefs.h, __glibc_c99_flexarr_available, which reveals exactly what these headers want to know. I also took the opportunity to flatten the rather messy conditional nest defining __flexarr. * argp/argp.h: Check whether _LIBC is defined before expanding it. * posix/glob.h: Check whether __USE_XOPEN2K8 is defined instead of expanding it. * misc/sys/cdefs.h: Tidy up conditional nest defining __flexarr. Define __glibc_c99_flexarr_available to 1 when the compiler supports C99-compatible flexible array members, 0 otherwise. * sysdeps/unix/sysv/linux/bits/socket.h * sysdeps/mach/hurd/bits/socket.h * bits/socket.h: Use __glibc_c99_flexarr_available in definitions of struct cmsghdr and CMSG_DATA.
* hurd: Fix stack pointer corruption in syscallSamuel Thibault2016-09-221-0/+3
| | | | | | Thanks Justus Winter for the report. * sysdeps/mach/i386/syscall.S (syscall): Push back syscall number.
* hurdmalloc: Run fork handler as late as possible [BZ #19431]Samuel Thibault2016-09-221-6/+9
| | | | | | | | | | | | | | | | | | | | | This is the hurd-specific follow-up for 29d794863cd6e03115d3670707cc873a9965ba92 : hurdmalloc also needs the same fix * hurd/hurdmalloc.c (malloc_fork_prepare): Rename to _hurd_malloc_fork_prepare. (malloc_fork_parent): Rename to _hurd_malloc_fork_parent. (malloc_fork_child): Rename to _hurd_malloc_fork_child. (_hurd_fork_prepare_hook): Drop malloc_fork_prepare. (_hurd_fork_parent_hook): Drop malloc_fork_parent. (_hurd_fork_child_hook): Drop malloc_fork_child. * hurd/hurdmalloc.h (_hurd_malloc_fork_prepare, _hurd_malloc_fork_parent, _hurd_malloc_fork_child): Add declarations. * sysdeps/mach/hurd/fork.c (__fork): Call __malloc_fork_lock_parent after locking locks (notably hurd_dtable_lock). Call _hurd_malloc_fork_prepare after that. Call _hurd_malloc_fork_parent before __malloc_fork_unlock_parent and _hurd_malloc_fork_child before __malloc_fork_unlock_child.
* Add <stdint.h> integer width macros.Joseph Myers2016-09-211-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
* malloc: Manual part of conversion to __libc_lockFlorian Weimer2016-09-212-29/+0
| | | | | This removes the old mutex_t-related definitions from malloc-machine.h, too.
* posix: Correctly block/unblock all signals on Linux posix_spawnAdhemerval Zanella2016-09-201-6/+2
| | | | | | | | | | | | | This patch correctly block and unblocks all signals when executing Linux posix_spawn by using the __libc_signal_{un}block_all functions instead of default sigprocmask. The latter might remove both SIGCANCEL and SIGSETXID from the blocked signal list. Checked on x86_64, i686, powerpc64le, and aarch64. * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Correctly block and unblock all signals when executing the clone vfork child. (SIGALL_SET): Remove macro.
* posix: Correctly enable/disable cancellation on Linux posix_spawnAdhemerval Zanella2016-09-201-2/+4
| | | | | | | | | | | | | | This patch correctly enable and disable asynchronous cancellation on Linux posix_spawn. Current code invert the logic by enabling and disabling instead. It also adds a new test to check if posix_spawn is not a cancellation entrypoint. Checked on x86_64, i686, powerpc64le, and aarch64. * nptl/Makefile (tests): Add tst-exec5. * nptl/tst-exec5.c: New file. * sysdeps/unix/sysv/linux/spawni.c (__spawni): Correctly enable and disable asynchronous cancellation.
* Build s_nan* objects from a generic templatePaul E. Murphy2016-09-207-10/+7
| | | | | | | This requires adding a macro to synthesize the call to __strto*_nan. Since this is likely to be the only usage ever for strto* functions in generated libm calls, a dedicated macro is defined for it.
* Remove __nan{f,,l} macrosPaul E. Murphy2016-09-202-8/+1
| | | | | | Use the GCC builtin instead. With the exception of the files built from a template, they are unused. This is preparation for making the s_nanF objects generated.
* Make ldexpF generic.Paul E. Murphy2016-09-204-9/+65
| | | | | | | | | | | | | | | | | This one is a little more tricky since it is built both for libm and libc, and exports multiple aliases. To simplify aliasing, a new macro is introduced which handles aliasing to two symbols. By default, it just applies declare_mgen_alias to both target symbols. Likewise, the makefile is tweaked a little to generate templates for shared files too, and a new rule is added to build m_*.c objects from the objpfx directory. Verified there are no symbol or code changes using a script to diff the *_ldexp* object files on s390x, aarch64, arm, x86_64, and ppc64.
* Remove remnants of .og patternsFlorian Weimer2016-09-203-5/+0
| | | | | | | | | | | This was used by --enable-omitfp, and the bulk of it was removed in this commit: commit bdeba1354b7364d9b7857a048286a71ddbcdff86 Author: Ulrich Drepper <drepper@gmail.com> Date: Sat Jan 7 11:29:31 2012 -0500 Remove --enable-omitfp support
* powerpc: Fix POWER9 impliesTulio Magno Quites Machado Filho2016-09-192-2/+1
| | | | | Fix multiarch build for POWER9 by correcting the order of the directories listed at sysnames configure variable.
* hurd: fix fcntl visibilitySamuel Thibault2016-09-181-1/+1
| | | | * sysdeps/posix/dup.c (__dup): Call __fcntl instead of fcntl.
* nptl: Consolidate sem_init implementationsAdhemerval Zanella2016-09-152-86/+0
| | | | | | | | | | | | | | Current sparc32 sem_init and default one only differ on sem.newsem.pad initialization. This patch removes sparc32 and sparc32v9 sem_init arch specific implementation and set sparc32 to use nptl default one. The default implementation sets the required sem.newsem.pad to 0 (which is ununsed in other architectures). I checked on i686 and a sparc32v9 build. * nptl/sem_init.c (sem_init): Init pad value to 0. * sysdeps/sparc/sparc32/sem_init.c: Remove file. * sysdeps/sparc/sparc32/sparcv9/sem_init.c: Likewise.
* 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.
* nptl: Remove sparc sem_waitAdhemerval Zanella2016-09-152-94/+0
| | | | | | | | | | | This patch removes the sparc32 sem_wait.c implementation since it is identical to default nptl one. The sparcv9 is no longer required with the removal. Checked with a sparcv9 build. * sysdeps/sparc/sparc32/sem_wait.c: Remove file. * sysdeps/sparc/sparc32/sparcv9/sem_wait.c: Likewise.
* nptl: Consolidate sem_open implementationsAdhemerval Zanella2016-09-152-301/+0
| | | | | | | | | | | | | | | | | | | | Current sparc32 sem_open and default one only differ on: 1. Default one contains a 'futex_supports_pshared' check. 2. sem.newsem.pad is initialized to zero. This patch removes sparc32 and sparc32v9 sem_open arch specific implementation and instead set sparc32 to use nptl default one. Using 1. is fine since it should always evaluate 0 for Linux (an optimized away by the compiler). Adding 2. to default implementation should be ok since 'pad' field is used mainly on sparc32 code. I checked on i686 and checked a sparc32v9 build. * nptl/sem_open.c (sem_open): Init pad value to 0. * sysdeps/sparc/sparc32/sem_open.c: Remove file. * sysdeps/sparc/sparc32/sparcv9/sem_open.c: Likewise.
* 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.
* Remove the ptw-% patternsFlorian Weimer2016-09-145-11/+8
| | | | | | | | | | Nothing depends on the PTW macro anymore, so the mechanism to define PTW for recompliations of libc routines is no longer needed. The source files are still recompiled for the nptl directory, just without the “ptw-” prefix. (Reducing the number of pattern rules in sysd-rules is critical for improving make performance.)
* ldbl-128: Use L(x) macro for long double constantsPaul E. Murphy2016-09-1350-3925/+3925
| | | | | | | | | | | | | | | | | | | | This runs the attached sed script against these files using a regex which aggressively matches long double literals when not obviously part of a comment. Likewise, 5 digit or less integral constants are replaced with integer constants, excepting the two cases of 0 used in large tables, which are also the only integral values of the form x.0*E0L encountered within these converted files. Likewise, -L(x) is transformed into L(-x). Naturally, the script has a few minor hiccups which are more clearly remedied via the attached fixup patch. Such hiccups include, context-sensitive promotion to a real type, and munging constants inside harder to detect comment blocks.
* Add e500 version of fetestexceptflag.Joseph Myers2016-09-071-0/+25
| | | | | | | | | | | | | | | When I added fetestexceptflag, I missed that e500 was another case that needed its own version because saved exceptions were not directly stored in a form that could be ANDed with exception bits (they were stored with exceptions in SPE form, but the FE_* macros always use the classic hard-float form). This patch adds an e500 version with the required call to __fexcepts_from_spe to convert from one form to the other. Tested for e500. * sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c: New file.
* Add femode_t functions: sparc.Joseph Myers2016-09-072-0/+64
| | | | | | | This patch adds SPARC versions of fegetmode and fesetmode. Untested. * sysdeps/sparc/fpu/fegetmode.c: New file. * sysdeps/sparc/fpu/fesetmode.c: Likewise.
* Add femode_t functions: sh.Joseph Myers2016-09-072-0/+65
| | | | | | | This patch adds SH versions of fegetmode and fesetmode. Untested. * sysdeps/sh/sh4/fpu/fegetmode.c: New file. * sysdeps/sh/sh4/fpu/fesetmode.c: Likewise.
* Add femode_t functions: s390.Joseph Myers2016-09-072-0/+66
| | | | | | | This patch adds S/390 versions of fegetmode and fesetmode. Untested. * sysdeps/s390/fpu/fegetmode.c: New file. * sysdeps/s390/fpu/fesetmode.c: Likewise.
* Add femode_t functions: powerpc.Joseph Myers2016-09-076-0/+222
| | | | | | | | | | | This patch adds PowerPC versions of fegetmode and fesetmode. * sysdeps/powerpc/fpu/fegetmode.c: New file. * sysdeps/powerpc/fpu/fesetmode.c: Likewise. * sysdeps/powerpc/nofpu/fegetmode.c: Likewise. * sysdeps/powerpc/nofpu/fesetmode.c: Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c: Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c: Likewise.
* Add femode_t functions: mips.Joseph Myers2016-09-072-0/+65
| | | | | | | This patch adds MIPS versions of fegetmode and fesetmode. * sysdeps/mips/fpu/fegetmode.c: New file. * sysdeps/mips/fpu/fesetmode.c: Likewise.
* Add femode_t functions: m68k.Joseph Myers2016-09-072-0/+59
| | | | | | | This patch adds M68K versions of fegetmode and fesetmode. Untested. * sysdeps/m68k/fpu/fegetmode.c: New file. * sysdeps/m69k/fpu/fesetmode.c: Likewise.
* Add femode_t functions: ia64.Joseph Myers2016-09-072-0/+68
| | | | | | | This patch adds IA64 versions of fegetmode and fesetmode. Untested. * sysdeps/ia64/fpu/fegetmode.c: New file. * sysdeps/ia64/fpu/fesetmode.c: Likewise.