summaryrefslogtreecommitdiff
path: root/sysdeps/mach
Commit message (Collapse)AuthorAgeFilesLines
* Create bits/types headers for most remaining __T_defined macros.Zack Weinberg2019-03-091-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't exactly fit the theme but as long as I'm tinkering with sys/types.h it makes sense to go through and create single-declaration bits/types/ headers for all of the remaining cases where we have two or more headers declaring a public type. The remaining uses of the original __T_defined idiom are: __error_t_defined in files shared with gnulib, which probably has to remain as is; ____gwchar_t_defined in inttypes.h, which may not be necessary anymore and should be addressed separately, and __ldiv_t_defined and __lldiv_t_defined in stdlib.h, ditto. Our handling of LFS types is a little inconsistent: some headers declare both off_t and off64_t (for instance) when _LARGEFILE64_SOURCE, others will only declare off_t regardless of _LARGEFILE64_SOURCE. I don't know if this was intentional or not. I am tempted to centralize responsibility for _LARGEFILE64_SOURCE as well as _FILE_OFFSET_BITS=64 in bits/types/off_t.h (etc) so that any header that declares off_t will automatically also declare off64_t when _LARGEFILE64_SOURCE. sunrpc/rpc/types.h is special, because it is included in files compiled by the *build* compiler (cross-rpcgen-objs), and therefore it cannot unconditionally assume bits/types headers are available. What I did was have it include the appropriate bits/types headers only if including sys/types.h did not cause __BIT_TYPES_DEFINED__ to be defined. This will do the right thing when an installed rpc/types.h is included by application code compiled without __USE_MISC in effect. During the build, we rely on the fact that we compile all of our own code with __USE_MISC in effect. This is fragile, but should be acceptable for code that's no longer built by default anyway. scripts/check-obsolete-constructs.py ensures that only sys/types.h and rpc/types.h include the bits/types/ headers that define obsolete types. * posix/bits/types/blkcnt64_t.h * posix/bits/types/blkcnt_t.h * posix/bits/types/blksize_t.h * posix/bits/types/dev_t.h * posix/bits/types/fsblkcnt64_t.h * posix/bits/types/fsblkcnt_t.h * posix/bits/types/fsfilcnt64_t.h * posix/bits/types/fsfilcnt_t.h * posix/bits/types/fsid_t.h * posix/bits/types/gid_t.h * posix/bits/types/id_t.h * posix/bits/types/ino64_t.h * posix/bits/types/ino_t.h * posix/bits/types/intptr_t.h * posix/bits/types/key_t.h * posix/bits/types/loff_t.h * posix/bits/types/mode_t.h * posix/bits/types/nlink_t.h * posix/bits/types/off64_t.h * posix/bits/types/off_t.h * posix/bits/types/pid_t.h * posix/bits/types/socklen_t.h * posix/bits/types/ssize_t.h * posix/bits/types/suseconds_t.h * posix/bits/types/uid_t.h * posix/bits/types/useconds_t.h: New single-declaration headers for standard types canonically defined by sys/types.h, sys/socket.h, or inttypes.h but also exposed by other headers under some circumstances. Code moved from posix/sys/types.h, socket/sys/socket.h, stdlib/inttypes.h as appropriate. * posix/bits/types/uint.h * posix/bits/types/u_int.h * posix/bits/types/u_intN_t.h * posix/bits/types/caddr_t.h * posix/bits/types/daddr_t.h * posix/bits/types/loff_t.h * posix/bits/types/register_t.h: Similarly, but for obsolete BSD-derived types whose canonical home is sys/types.h. Some of these headers define more than one type. * posix/Makefile (headers): Install the above new headers. Rewrap the list. * posix/sys/types.h: All definitions of public types now accomplished using the above new headers. Consolidate groups of definitions controlled by the same feature selection macros. * inet/arpa/inet.h, bits/socket.h * sysdeps/mach/hurd/bits/socket.h * sysdeps/unix/sysv/linux/bits/socket.h: Use bits/types/socklen_t.h. * dirent/dirent.h: Use bits/types/ino_t.h and bits/types/ino64_t.h. * grp/grp.h: Use bits/types/gid_t.h. * io/fcntl.h: Use bits/types/mode_t.h, bits/types/off_t.h, bits/types/pid_t.h, and bits/types/off64_t.h. * io/sys/stat.h: Use bits/types/dev_t.h, bits/types/gid_t.h, bits/types/ino_t.h, bits/types/mode_t.h, bits/types/nlink_t.h, bits/types/off_t.h, bits/types/uid_t.h, and bits/types/blkcnt_t.h. * libio/stdio.h: Use bits/types/off_t.h, bits/types/off64_t.h, and bits/types/ssize_t.h. * misc/sys/mman.h: Use bits/types/off_t.h and bits/types/mode_t.h. * misc/sys/select.h: Use bits/types/suseconds_t.h. * posix/sched.h: Use bits/types/pid_t.h. * posix/sys/wait.h: Use bits/types/pid_t.h and bits/types/id_t.h. * posix/unistd.h: Use bits/types/gid_t.h, bits/types/uid_t.h, bits/types/off_t.h, bits/types/off64_t.h, bits/types/useconds_t.h, bits/types/intptr_t.h, and bits/types/socklen_t.h. * pwd/pwd.h: Use bits/types/gid_t.h and bits/types/uid_t.h. * resource/sys/resource.h: Use bits/types/id_t.h. * signal/signal.h: Use bits/types/pid_t.h and bits/types/uid_t.h. * stdlib/monetary.h: Use bits/types/ssize_t.h. * streams/stropts.h: Use bits/types/gid_t.h and bits/types/uid_t.h. * sysdeps/gnu/utmpx.h: Use bits/types/pid_t.h. * sysvipc/sys/ipc.h: Use bits/types/uid_t.h, bits/types/gid_t.h, bits/types/mode_t.h, and bits/types/key_t.h. * sysvipc/sys/msg.h: Use bits/types/pid_t.h and bits/types/ssize_t.h. * sysvipc/sys/shm.h: Use bits/types/pid_t.h. * termios/termios.h: Use bits/types/pid_t.h. * time/sys/time.h: Use bits/types/suseconds_t.h. * time/time.h: Use bits/types/pid_t.h. * sunrpc/rpc/types.h: Consolidate all #includes at the top of the file. If __BIT_TYPES_DEFINED__ is not defined after including sys/types.h, also include bits/types/caddr_t.h, bits/types/daddr_t.h, bits/types/fsid_t.h, and bits/types/u_int.h. * scripts/check-obsolete-constructs.py (OBSOLETE_TYPE_HDR_RE_): New. (ObsoleteIndirectDefinitionsAllowed): New; allows inclusion of bits/types/ headers that define obsolete typedefs, but not direct definitions of those types. (ObsoleteNotAllowed, ObsoletePrivateDefinitionsAllowed) (ObsoletePublicDefinitionsAllowed): Do not allow inclusion of bits/types/ headers that define obsolete typedefs. * include/bits/types/blkcnt64_t.h * include/bits/types/blkcnt_t.h * include/bits/types/blksize_t.h * include/bits/types/caddr_t.h * include/bits/types/daddr_t.h * include/bits/types/dev_t.h * include/bits/types/fsblkcnt64_t.h * include/bits/types/fsblkcnt_t.h * include/bits/types/fsfilcnt64_t.h * include/bits/types/fsfilcnt_t.h * include/bits/types/fsid_t.h * include/bits/types/gid_t.h * include/bits/types/id_t.h * include/bits/types/ino64_t.h * include/bits/types/ino_t.h * include/bits/types/intptr_t.h * include/bits/types/key_t.h * include/bits/types/loff_t.h * include/bits/types/mode_t.h * include/bits/types/nlink_t.h * include/bits/types/off64_t.h * include/bits/types/off_t.h * include/bits/types/pid_t.h * include/bits/types/register_t.h * include/bits/types/socklen_t.h * include/bits/types/ssize_t.h * include/bits/types/suseconds_t.h * include/bits/types/u_char.h * include/bits/types/u_intN_t.h * include/bits/types/uchar.h * include/bits/types/uid_t.h * include/bits/types/useconds_t.h: New wrappers.
* Clean up bits/types.h.Zack Weinberg2019-03-091-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes four linked changes to bits/types.h. First, we use __(u)?int(16|32|64)_t to define __[SU](16|32|64)_TYPE. In addition to reducing the amount of ifdeffage, this means __STD_TYPE is no longer necessary, since gcc -std=c89 will complain about ‘typedef long long foo_t’ but not ‘typedef __int64_t foo_t’, even if the underlying type of __int64_t is long long. Second, we eliminate __UQUAD_TYPE and __SQUAD_TYPE from the set of macros bits/typesizes.h should use to define __FOO_T_TYPE macros, since they are always the same as __U64_TYPE and __S64_TYPE respectively. Third, we remove __u_char, __u_short, __u_int, __u_long, __u_quad_t, and __quad_t, we add __uintptr_t, and we define __intmax_t and __uintmax_t as __int64_t and __uint64_t. Fourth, we reorganize the list of typedefs into groups by the standard (if any) that defines them, and sort them alphabetically within each group. * posix/bits/types.h: Move #error for __WORDSIZE neither 32 nor 64 to first group of conditionals on __WORDSIZE, and make it more explicit. Update commentary. Define all __foo_t types with regular ‘typedef’. Reorganize all __foo_t types into the same groups that sys/types.h uses. (__u_char, __u_short, __u_int, __u_long, __quad_t, __u_quad_t) (__UQUAD_TYPE, __SQUAD_TYPE, __STD_TYPE): Don’t define. (__S16_TYPE): Define unconditionally as __int16_t. (__U16_TYPE): Define unconditionally as __uint16_t. (__S32_TYPE): Define unconditionally as __int32_t. (__U32_TYPE): Define unconditionally as __uint32_t. (__S64_TYPE): Define unconditionally as __int64_t. (__U64_TYPE): Define unconditionally as __uint64_t. (__intmax_t): Define unconditionally as __int64_t. (__uintmax_t): Define unconditionally as __uint64_t. (__uintptr_t): New typedef. * bits/time64.h * bits/typesizes.h * sysdeps/mach/hurd/bits/typesizes.h * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h * sysdeps/unix/sysv/linux/generic/bits/typesizes.h * sysdeps/unix/sysv/linux/mips/bits/typesizes.h * sysdeps/unix/sysv/linux/s390/bits/typesizes.h * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h * sysdeps/unix/sysv/linux/x86/bits/typesizes.h: Replace all uses of __UQUAD_TYPE with __U64_TYPE, and all uses of __SQUAD_TYPE with __S64_TYPE. * posix/sys/types.h, rpc/sys/types.h (u_char): Define as unsigned char. (u_short): Define as unsigned short. (u_int): Define as unsigned int. (u_long): Define as unsigned long. (quad_t): Define as __int64_t. (u_quad_t): Define as __uint64_t. * stdlib/stdint.h (intptr_t): Define as __intptr_t. (uintptr_t): Define as __uintptr_t. * scripts/check-obsolete-constructs.py: Update allowed definitions for the obsolete types. No longer allow __STD_TYPE as an alias for typedef.
* Add caddr_t, daddr_t, and loff_t to the set of obsolete typedefs.Zack Weinberg2019-03-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | caddr_t is a BSD-derived alias for ‘char *’, obsoleted by the introduction of ‘void *’ in C89 (!) daddr_t is a “disk address,” but it’s always defined as ‘int’, making it too small for modern disks and tapes. loff_t is another name for off64_t, from early drafts of LFS. All three are already only exposed by sys/types.h under __USE_MISC. This patch adds them to the set of types that shall not be used in installed headers (enforced by check-obsolete-constructs.py) and expunges all remaining uses, internally as well as in installed headers. Since __DADDR_T_TYPE is always defined as __S32_TYPE, and daddr_t is obsolete so there’s no need to worry about future variation, the patch also removes __DADDR_T_TYPE from the set of macros that bits/typesizes.h is required to define. Instead bits/types.h always defines __daddr_t as __S32_TYPE, and the definition is moved to a more logical location within the file, next to __caddr_t. It’s always safe to change (__)loff_t to the matching (__)off64_t; in a few internal files, I removed an unnecessary __ prefix. daddr_t is only used for struct ustat, which is obsoleted by struct statvfs and we already don’t declare it in public headers, and for an ioctl parameter block in sys/mtio.h (which may or may not be obsolete, I can’t tell). In sys/mtio.h I replaced both uses with ‘int’ to match the use of bare ‘long int’ for most of the other fields of that structure. In misc/ustat.c, the definition of struct ustat is not actually necessary so I removed it entirely. In sysdeps/unix/sysv/linux/ustat.c a definition is necessary but only because INLINE_SYSCALL_CALL doesn’t work (on at least x86) when an argument is a pointer to an incomplete type, so I substituted a dummy definition. Most of the internal uses of caddr_t are in the sunrpc and nis directories, and since most of that code is obsolete, I mechanically replaced them with char * rather than consider whether void * might make more sense. Because “const caddr_t foo” is semantically different from “const char *foo” (in the first case ‘foo’ itself is const but the memory pointed to isn’t, in the second case the memory pointed to is const but ‘foo’ isn’t) this change exposed some const-correctness errors in sunrpc, which I fixed minimally. Outside of sunrpc and nis, I put a little more thought into whether uses of caddr_t should be void * instead. * scripts/check-obsolete-constructs.py: Add caddr_t, daddr_t, and loff_t to the set of obsolete types forbidden in public headers. * posix/bits/types.h: Unconditionally define __daddr_t as __S32_TYPE. Move definition of __daddr_t next to definition of __caddr_t. * bits/typesizes.h * sysdeps/mach/hurd/bits/typesizes.h * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h * sysdeps/unix/sysv/linux/generic/bits/typesizes.h * sysdeps/unix/sysv/linux/mips/bits/typesizes.h * sysdeps/unix/sysv/linux/s390/bits/typesizes.h * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h * sysdeps/unix/sysv/linux/x86/bits/typesizes.h: Don’t define __DADDR_T_TYPE. * sysdeps/gnu/sys/mtio.h (struct mtget): Change all uses of __daddr_t to int. * misc/ustat.c: Remove definition of struct ustat; only forward-declare it. * sysdeps/unix/sysv/linux/ustat.c: Replace fields of struct ustat with a size-preserving dummy field. * hurd/Makefile (migheaderpipe): Rewrite loff_t as __off64_t. * hurd/fd-read.c (_hurd_fd_read): Use off64_t instead of loff_t. * hurd/fd-write.c (hurd_fd_write): Use off64_t instead of loff_t. * hurd/hurd/fd.h (_hurd_fd_read, _hurd_fd_write): Declare using __off64_t instead of __loff_t. * support/xunistd.h (xcopy_file_range): Declare using off64_t instead of loff_t. * sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h * sysdeps/unix/sysv/linux/lseek.c * sysdeps/unix/sysv/linux/lseek64.c * sysdeps/unix/sysv/linux/splice.c Throughout, use off64_t instead of loff_t. * sysdeps/unix/sysv/linux/sys/quota.h (dqoff): Use __off64_t instead of __loff_t. (quotactl): Declare using char * instead of caddr_t. * sysdeps/unix/sysv/linux/test-errno-linux.c (do_test): Cast to char * instead of caddr_t when calling quotactl. * elf/dl-map-segments.h (_dl_map_segments): Cast to void * instead of caddr_t when calling __mprotect and __mmap. * elf/dl-minimal.c (malloc): Declare page as char *, not caddr_t. * elf/dl-reloc.c (_dl_relocate_object): Declare textrels.start as char *, not caddr_t. Cast to char *, not caddr_t, in pointer arithmetic. * intl/loadmsgcat.c: Remove two unnecessary casts to caddr_t when calling munmap. Change a third cast to target void * instead and add a comment explaining why this one is necessary. * locale/loadlocale.c (_nl_load_locale): Use NULL instead of `(caddr_t)0`, and remove an unnecessary cast to caddr_t when calling munmap. (_nl_unload_locale): Change casts when calling free and munmap to target char *, and add a comment explaining why they are necessary. * sysdeps/gnu/net/if.h (struct ifreq): Declare ifru_data as char *, not __caddr_t. (struct ifconf): Declare ifcu_buf as char *, not __caddr_t. * nis/nis_add.c * nis/nis_call.c * nis/nis_callback.c * nis/nis_checkpoint.c * nis/nis_findserv.c * nis/nis_intern.h * nis/nis_lookup.c * nis/nis_mkdir.c * nis/nis_modify.c * nis/nis_ping.c * nis/nis_remove.c * nis/nis_rmdir.c * nis/nis_server.c * nis/nis_table.c * nis/nis_util.c * nis/nss_nisplus/nisplus-grp.c * nis/nss_nisplus/nisplus-pwd.c * nis/rpcsvc/nis_callback.h * nis/rpcsvc/yp.h * nis/ypclnt.c * sunrpc/auth_des.c * sunrpc/auth_unix.c * sunrpc/authdes_prot.c * sunrpc/authuxprot.c * sunrpc/clnt_raw.c * sunrpc/clnt_tcp.c * sunrpc/clnt_udp.c * sunrpc/clnt_unix.c * sunrpc/key_call.c * sunrpc/pm_getmaps.c * sunrpc/pm_getport.c * sunrpc/pmap_clnt.c * sunrpc/pmap_prot2.c * sunrpc/pmap_rmt.c * sunrpc/proto.h * sunrpc/rpc/auth.h * sunrpc/rpc/clnt.h * sunrpc/rpc/pmap_clnt.h * sunrpc/rpc/pmap_rmt.h * sunrpc/rpc/rpc_msg.h * sunrpc/rpc/svc.h * sunrpc/rpc/xdr.h * sunrpc/rpc_clntout.c * sunrpc/rpc_cmsg.c * sunrpc/rpc_hout.c * sunrpc/rpc_prot.c * sunrpc/rpc_sample.c * sunrpc/rpc_svcout.c * sunrpc/svc.c * sunrpc/svc_authux.c * sunrpc/svc_raw.c * sunrpc/svc_tcp.c * sunrpc/svc_udp.c * sunrpc/svc_unix.c * sunrpc/xdr.c * sunrpc/xdr_array.c * sunrpc/xdr_mem.c * sunrpc/xdr_rec.c * sunrpc/xdr_ref.c * sunrpc/xdr_sizeof.c * sunrpc/xdr_stdio.c: Mechanically replace all uses of caddr_t with char *. * sunrpc/xdr_mem.c (xdrmem_create): Cast away const when setting xdrs->x_private and xdrs->x_base. * sunrpc/xdr_stdio.c (xdrstdio_getbytes): Correct argument types in definition to match prototype.
* Define register_t using bits/typesizes.h macros.Zack Weinberg2019-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently register_t is, unlike all other types in sys/types.h, defined using a GCC extension (__attribute__((mode(word)))), falling back to ‘int’ if the extension is unavailable. This is a potential ABI compatibility hazard for people using non-GNU compilers with glibc. It’s also unnecessary; the bits/typesizes.h mechanism can handle all of the existing variation in the definition. In most cases, defining __REGISTER_T_TYPE as __SWORD_TYPE is sufficient. Special handling is necessary for MIPS n32 and x86-64 x32, where __SWORD_TYPE is ‘int’ and the appropriate type for register_t is ‘long long’. Unfortunately, this means we need to create a new bits/typesizes.h variant for linux/mips. This variant is based on the top-level bits/typesizes.h, not linux/generic/bits/typesizes.h, to match the existing MIPS ABIs. Tested using build-many-glibcs. The c++-types test confirms that the physical type of register_t does not change on any supported platform. * posix/sys/types.h: Typedef register_t as __register_t. * posix/bits/types.h: Typedef __register_t using __REGISTER_T_TYPE. * bits/typesizes.h * sysdeps/mach/hurd/bits/typesizes.h * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h * sysdeps/unix/sysv/linux/generic/bits/typesizes.h * sysdeps/unix/sysv/linux/s390/bits/typesizes.h * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: Define __REGISTER_T_TYPE as __SWORD_TYPE. * sysdeps/unix/sysv/linux/mips/bits/typesizes.h: New file (copied from bits/typesizes.h). Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and n64 ABIs. Define __REGISTER_T_TYPE as __SQUAD_TYPE for n32. * sysdeps/unix/sysv/linux/x86/bits/typesizes.h: Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and 64-bit ABIs. Define __REGISTER_T_TYPE as __SQUAD_TYPE for x32.
* Move most headers installed by top-level Makefile to misc/.Zack Weinberg2019-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Makefile glue to run tests on installed headers is currently duplicated between the top-level Makefile and Rules, because the top-level Makefile doesn't read Rules but does install some headers. This patch moves most of the headers installed by the top-level Makefile to misc/ (chosen arbitrarily; I'm open to putting them somewhere else if reviewers feel it would be better) and removes the duplicated logic from the top-level Makefile. I believe this also means that none of the headers in include/ are installed headers anymore. gnu/lib-names*.h are still generated by code in Makerules and installed by the top-level Makefile. I tried to move them to misc/ as well, but that broke the generation process in a manner that didn't make any sense so I gave up. The tests performed on installed headers are not especially useful for gnu/lib-names*.h so I think we can live with this for now. * include/bits/xopen_lim.h * include/features.h * include/gnu-versions.h * include/gnu/libc-version.h * include/limits.h * include/stdc-predef.h * include/values.h: Move to misc/ and replace with a trivial wrapper. * Makefile (headers): Remove all headers moved to misc/. Don't set a vpath for %.h. (check-installed-headers-c.out, check-installed-headers-cxx.out) (check-wrapper-headers.out): Remove rules. * misc/Makefile (headers): Add all of the above headers and sort the list. * sysdeps/mach/hurd/bits/errno.h: Regenerate.
* Break lines before not after operators, batch 4.Joseph Myers2019-03-075-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes further coding style issues where code should have broken lines before operators in accordance with the GNU Coding Standards but instead was breaking lines after them. Tested for x86_64, and with build-many-glibcs.py. * stdio-common/vfscanf-internal.c (ARG): Break lines before rather than after operators. * sysdeps/mach/hurd/setitimer.c (timer_thread): Likewise. (setitimer_locked): Likewise. * sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise. * sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise. * sysdeps/mach/pagecopy.h (PAGE_COPY_FWD): Likewise. * sysdeps/mach/thread_state.h (machine_get_basic_state): Likewise. * sysdeps/powerpc/powerpc64/tst-ucontext-ppc64-vscr.c (PPC_CPU_SUPPORTED): Likewise. * sysdeps/unix/sysv/linux/alpha/a.out.h (N_TXTOFF): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h (stat_overflow): Likewise. (statfs_overflow): Likewise. * sysdeps/unix/sysv/linux/tst-personality.c (do_test): Likewise. * sysdeps/unix/sysv/linux/tst-ttyname.c (eq_ttyname): Likewise. (eq_ttyname_r): Likewise. (run_chroot_tests): Likewise.
* hurd: Add renameat2 support for RENAME_NOREPLACESamuel Thibault2019-02-272-20/+57
| | | | | | | | | * include/stdio.h (__renameat2): New hidden prototype. * stdio-common/renameat2.c (__renameat2): Add hidden definition. * sysdeps/mach/hurd/renameat.c (__renameat): Move implementation to... * sysdeps/mach/hurd/renameat2.c (__renameat2): ... new function, and add support for RENAME_NOREPLACE. * sysdeps/unix/sysv/linux/renameat2.c (__renameat2): Add hidden definition.
* Add some spaces before '('.Joseph Myers2019-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes various places where a space should have been present before '(' in accordance with the GNU Coding Standards. Most but not all of the fixes in this patch are for calls to sizeof (but it's not exhaustive regarding such calls that should be fixed). Tested for x86_64, and with build-many-glibcs.py. * benchtests/bench-strcpy.c (do_test): Use space before '('. * benchtests/bench-string.h (cmdline_process_function): Likewise. * benchtests/bench-strlen.c (do_test): Likewise. (test_main): Likewise. * catgets/gencat.c (read_old): Likewise. * elf/cache.c (load_aux_cache): Likewise. * iconvdata/bug-iconv8.c (do_test): Likewise. * math/test-tgmath-ret.c (do_test): Likewise. * nis/nis_call.c (rec_dirsearch): Likewise. * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise. * nptl/tst-audit-threads.c (do_test): Likewise. * nptl/tst-cancel4-common.h (set_socket_buffer): Likewise. * nss/nss_test1.c (init): Likewise. * nss/test-netdb.c (test_hosts): Likewise. * posix/execvpe.c (maybe_script_execute): Likewise. * stdio-common/tst-fmemopen4.c (do_test): Likewise. * stdio-common/tst-printf.c (do_test): Likewise. * stdio-common/vfscanf-internal.c (__vfscanf_internal): Likewise. * stdlib/fmtmsg.c (NKEYWORDS): Likewise. * stdlib/qsort.c (STACK_SIZE): Likewise. * stdlib/test-canon.c (do_test): Likewise. * stdlib/tst-swapcontext1.c (do_test): Likewise. * string/memcmp.c (OPSIZ): Likewise. * string/test-strcpy.c (do_test): Likewise. (do_random_tests): Likewise. * string/test-strlen.c (do_test): Likewise. (test_main): Likewise. * string/test-strrchr.c (do_test): Likewise. (do_random_tests): Likewise. * string/tester.c (test_memrchr): Likewise. (test_memchr): Likewise. * sysdeps/generic/memcopy.h (OPSIZ): Likewise. * sysdeps/generic/unwind-dw2.c (execute_stack_op): Likewise. * sysdeps/generic/unwind-pe.h (read_sleb128): Likewise. (read_encoded_value_with_base): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/hppa/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/ia64/fpu/sfp-machine.h (TI_BITS): Likewise. * sysdeps/mach/hurd/spawni.c (__spawni): Likewise. * sysdeps/posix/spawni.c (maybe_script_execute): Likewise. * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (query_auxv): Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Likewise. * sysdeps/unix/sysv/linux/csky/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/m68k/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/nios2/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute): Likewise. * sysdeps/unix/sysv/linux/x86/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h (FP_XSTATE_MAGIC2_SIZE): Likewise. * sysdeps/x86/fpu/sfp-machine.h (TI_BITS): Likewise. * time/test_time.c (main): Likewise.
* Break further lines before not after operators.Joseph Myers2019-02-2615-97/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues the process of fixing coding style to break lines before not after operators in accordance with the GNU Coding Standards, fixing such issues in a non-exhaustive selection of sysdeps files that had them. Tested for x86_64, and with build-many-glibcs.py. * sysdeps/arm/sysdep.h (#if condition): Break lines before rather than after operators. * sysdeps/mach/hurd/fork.c (__fork): Likewise. * sysdeps/mach/hurd/getcwd.c (__hurd_canonicalize_directory_name_internal): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-consistent.c (pthread_mutex_consistent): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-init.c (_pthread_mutex_init): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c (__pthread_mutex_transfer_np): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-unlock.c (__pthread_mutex_unlock): Likewise. * sysdeps/mach/hurd/htl/pt-mutex.h (ROBUST_LOCK): Likewise. (mtx_owned_p): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c (pthread_mutexattr_getrobust): Likewise. * sysdeps/mach/hurd/i386/init-first.c (init1): Likewise. * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/kill.c (__kill): Likewise. * sysdeps/mach/hurd/mig-reply.c (__mig_get_reply_port): Likewise. * sysdeps/mach/hurd/ptrace.c (ptrace): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h (#if condition): Likewise. * sysdeps/unix/sysv/linux/alpha/ioperm.c (process_cpuinfo): Likewise. * sysdeps/unix/sysv/linux/bits/timex.h (STA_RONLY): Likewise. * sysdeps/unix/sysv/linux/csky/sysdep.h (#if condition): Likewise. * sysdeps/unix/sysv/linux/generic/____longjmp_chk.c (____longjmp_chk): Likewise. * sysdeps/unix/sysv/linux/generic/futimesat.c (futimesat): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c (__get_clockfreq_via_cpuinfo): Likewise.
* Add and move fall-through comments in system-specific code.Joseph Myers2019-02-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes -Wimplicit-fallthrough warnings in system-specific code that show up building glibc with -Wextra, by adding fall-through comments, or moving existing such comments to the place required for them to work (immediately before the case label being fallen through). Tested with build-many-glibcs.py. * sysdeps/i386/dl-machine.h (elf_machine_rela): Add fall-through comments. * sysdeps/m68k/m680x0/fpu/s_cexp_template.c (s(__cexp)): Likewise. * sysdeps/m68k/memcopy.h (WORD_COPY_FWD): Likewise. (WORD_COPY_BWD): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/iso-8859-1_cp037_z900.c (TR_LOOP): Likewise. * sysdeps/mips/dl-machine.h (elf_machine_reloc): Move fall-through comment. * sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Likewise.
* Break more lines before not after operators.Joseph Myers2019-02-257-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes further coding style fixes where code was breaking lines after an operator, contrary to the GNU Coding Standards. As with the previous patch, it is limited to files following a reasonable approximation to GNU style already, and is not exhaustive; more such issues remain to be fixed. Tested for x86_64, and with build-many-glibcs.py. * dirent/dirent.h [!_DIRENT_HAVE_D_NAMLEN && _DIRENT_HAVE_D_RECLEN] (_D_ALLOC_NAMLEN): Break lines before rather than after operators. * elf/cache.c (print_cache): Likewise. * gshadow/fgetsgent_r.c (__fgetsgent_r): Likewise. * htl/pt-getattr.c (__pthread_getattr_np): Likewise. * hurd/hurdinit.c (_hurd_setproc): Likewise. * hurd/hurdkill.c (_hurd_sig_post): Likewise. * hurd/hurdlookup.c (__file_name_lookup_under): Likewise. * hurd/hurdsig.c (_hurd_internal_post_signal): Likewise. (reauth_proc): Likewise. * hurd/lookup-at.c (__file_name_lookup_at): Likewise. (__file_name_split_at): Likewise. (__directory_name_split_at): Likewise. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise. * hurd/port2fd.c (_hurd_port2fd): Likewise. * iconv/gconv_dl.c (do_print): Likewise. * inet/netinet/in.h (struct sockaddr_in): Likewise. * libio/wstrops.c (_IO_wstr_seekoff): Likewise. * locale/setlocale.c (new_composite_name): Likewise. * malloc/memusagestat.c (main): Likewise. * misc/fstab.c (fstab_convert): Likewise. * nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise. * nss/nss_compat/compat-grp.c (getgrent_next_nss): Likewise. (getgrent_next_file): Likewise. (internal_getgrnam_r): Likewise. (internal_getgrgid_r): Likewise. * nss/nss_compat/compat-initgroups.c (getgrent_next_nss): Likewise. (internal_getgrent_r): Likewise. * nss/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Likewise. (getpwent_next_nss): Likewise. (getpwent_next_file): Likewise. (internal_getpwnam_r): Likewise. (internal_getpwuid_r): Likewise. * nss/nss_compat/compat-spwd.c (getspent_next_nss_netgr): Likewise. (getspent_next_nss): Likewise. (internal_getspnam_r): Likewise. * pwd/fgetpwent_r.c (__fgetpwent_r): Likewise. * shadow/fgetspent_r.c (__fgetspent_r): Likewise. * string/strchr.c (STRCHR): Likewise. * string/strchrnul.c (STRCHRNUL): Likewise. * sysdeps/aarch64/fpu/fpu_control.h (_FPU_FPCR_IEEE): Likewise. * sysdeps/aarch64/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/csky/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/generic/memcopy.h (PAGE_COPY_FWD_MAYBE): Likewise. * sysdeps/generic/symbol-hacks.h (__stack_chk_fail_local): Likewise. * sysdeps/gnu/netinet/ip_icmp.h (ICMP_INFOTYPE): Likewise. * sysdeps/gnu/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/gnu/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/hppa/jmpbuf-unwind.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/mach/hurd/bits/stat.h (S_ISPARE): Likewise. * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Likewise. (open_file): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c (pthread_mutexattr_setprotocol): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/mach/hurd/mmap.c (__mmap): Likewise. * sysdeps/mach/hurd/ptrace.c (ptrace): Likewise. * sysdeps/mach/hurd/spawni.c (__spawni): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_type_class): Likewise. (elf_machine_rela): Likewise. * sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/mips/sys/asm.h (multiple #if conditionals): Likewise. * sysdeps/posix/rename.c (rename): Likewise. * sysdeps/powerpc/novmx-sigjmp.c (__novmx__sigjmp_save): Likewise. * sysdeps/powerpc/sigjmp.c (__vmx__sigjmp_save): Likewise. * sysdeps/s390/fpu/fenv_libc.h (FPC_VALID_MASK): Likewise. * sysdeps/s390/utf8-utf16-z9.c (gconv_end): Likewise. * sysdeps/unix/grantpt.c (grantpt): Likewise. * sysdeps/unix/sysv/linux/a.out.h (N_TXTOFF): Likewise. * sysdeps/unix/sysv/linux/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/unix/sysv/linux/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/x86/cpu-features.c (get_common_indices): Likewise. * time/tzfile.c (__tzfile_compute): Likewise.
* hurd: Check at_flags passed to faccessatSamuel Thibault2019-01-221-1/+3
| | | | | * sysdeps/mach/hurd/faccessat.c (__faccessat_common): Check for errors returned by __hurd_at_flags.
* nptl: Remove tst-cancel-wrappers test and related macrosAdhemerval Zanella2019-01-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With upcoming BZ#12683 fix, syscall cancellation is not more handled by {libc,pthread,librt}_{enable,disable}_asynccancel symbols. This renders both LIBC_CANCEL_HANDLED and empty declaration and tst-cancel-wrappers.sh unrequired. This patch removes both the macro and the nptl test. Checked on x86_64-linux-gnu. * io/creat.c (LIBC_CANCEL_HANDLED): Remove macro. * io/ppoll.c (LIBC_CANCEL_HANDLED): Likewise. * misc/pselect.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/pthreadP.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/generic/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/mach/hurd/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/pause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/sigpause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat64.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwait.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/Makefile [$(run-built-tests) = yes] (tests-special): Remove tst-cancel-wrappers.sh. (generated): Remove tst-cancel-wrappers.out. (tst-cancel-wrappers.out): Remove rule. * nptl/tst-cancel-wrappers.sh: Remove file.
* hurd: advertise *_setpshared as not supportedSamuel Thibault2019-01-021-0/+1
| | | | | | | | | | | | | | | | The functions themselves return 0, but initializing a mutex/etc with . pshared set to 1 will fail anyway . * sysdeps/htl/pt-barrierattr-setpshared.c (pthread_barrierattr_setpshared): Add stub warning. * sysdeps/htl/pt-condattr-setpshared.c (pthread_condattr_setpshared): Likewise. * sysdeps/htl/pt-mutexattr-setpshared.c (pthread_mutexattr_setpshared): Likewise. * sysdeps/htl/pt-rwlockattr-setpshared.c (pthread_rwlockattr_setpshared): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c (pthread_mutexattr_setpshared): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-01347-347/+347
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* hurd: Fix 64bit fcntl lock implementationSamuel Thibault2018-12-191-3/+3
| | | | | * sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Test against 64bit `cmd' values in the 64bit value cases.
* Do not clobber sp in _hurd_stack_setup.Joseph Myers2018-12-131-1/+1
| | | | | | | | | | | | | GCC mainline now gives errors for an asm that clobbers the stack pointer. According to <https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC previously ignored such a clobber; thus, this patch removes it from _hurd_stack_setup. Tested with build-many-glibcs.py for i686-gnu. * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Do not clobber sp.
* hurd: Fix linknamespace of spawniSamuel Thibault2018-12-071-2/+2
| | | | | | | | | * include/unistd.h (__confstr): Add prototype and hidden prototype. * posix/confstr.c (confstr): Rename to __confstr. (__confstr): Add hidden def. (confstr): Add weak alias for __confstr. * sysdeps/mach/hurd/spawni.c (__spawni): Call __confstr instead of confstr.
* hurd: Implement support for posix_spawn_file_actions_addfchdir_npSamuel Thibault2018-12-071-0/+44
|
* posix: New function posix_spawn_file_actions_addfchdir_np [BZ #17405]Florian Weimer2018-12-071-0/+1
| | | | | | Along with posix_spawn_file_actions_addchdir, posix_spawn_file_actions_addfchdir is the subject of a change proposal for POSIX: <http://austingroupbugs.net/view.php?id=1208>
* scripts/abilist.awk: Handle special _end symbol for HurdFlorian Weimer2018-11-301-1/+1
| | | | | | | | Hurd has this in libc.so: 0024db9c g D .bss 00000000 GLIBC_2.2.6 _end This g/D combination was not recognized before.
* hurd: Fix returning value for fcntl(F_*LK*)Samuel Thibault2018-11-301-6/+4
| | | | | | | to avoid calling va_end again, etc. * sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Directly return value returned by __f_setlk.
* Fix Hurd build with read-only source directory.Joseph Myers2018-11-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for generating sysdeps/mach/hurd/bits/errno.h involves a stamp file and $(move-if-change). The temporary file (generated unconditionally) is generated in the source directory. This means that even if sysdeps/mach/hurd/bits/errno.h is up to date, and has an up to date timestamp, the build will fail if the source directory is read-only. Even with a writable source directory, multiple concurrent builds for i686-gnu with the same source directory could race to access the temporary file (which always has the same name). This patch uses the build directory for the temporary file instead to avoid those problems. (In the case where the file is out of date and the temporary file does need to be moved to the source directory, if there are multiple concurrent builds for i686-gnu with the same source directory, and the source and build directories are on different filesystems, it's possible there might still be races replacing the file in the source directory, depending on exactly how mv handles such cross-filesystem moves. This is certainly no worse than the present situation, where such a case would have races regardless of whether the file is out of date or whether different filesystems are in use.) Tested with a build-many-glibcs.py build for i686-gnu. * sysdeps/mach/hurd/Makefile ($(common-objpfx)stamp-errnos): Use $(hurd-objpfx)bits/errno.h-tmp, not $(hurd)/bits/errno.h-tmp.
* Remove the error handling wrapper from powSzabolcs Nagy2018-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new pow symbol version that doesn't do SVID compatible error handling. The standard errno and fp exception based error handling is inline in the new code and does not have significant overhead. The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty w_pow.c and enabled for targets with their own pow implementation or ifunc dispatch on __ieee754_pow by including math/w_pow.c. The compatibility symbol version still uses the wrapper with SVID error handling around the new code. There is no new symbol version nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv). On targets where previously powl was an alias of pow, now it points to the compatibility symbol with the wrapper, because it still need the SVID compatible error handling. This affects NO_LONG_DOUBLE (e.g. arm) and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well. The __pow_finite symbol is now an alias of pow. Both __pow_finite and pow set errno and thus not const functions. The ia64 asm is changed so the compat and new symbol versions map to the same address. On x86_64 #include <math.h> was added before macro definitions that may affect that header. Tested with build-many-glibcs.py. * math/Versions (GLIBC_2.29): Add pow. * math/w_pow_compat.c (__pow_compat): Change to versioned compat symbol. * math/w_pow.c: New file. * sysdeps/i386/fpu/w_pow.c: New file. * sysdeps/ia64/fpu/e_pow.S: Add versioned symbols. * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Rename to __pow and add necessary aliases. * sysdeps/ieee754/dbl-64/w_pow.c: New file. * sysdeps/m68k/m680x0/fpu/w_pow.c: New file. * sysdeps/mach/hurd/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Update. * sysdeps/unix/sysv/linux/arm/libm.abilist: Update. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Update. * sysdeps/unix/sysv/linux/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update. * sysdeps/unix/sysv/linux/sh/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update. * sysdeps/x86_64/fpu/multiarch/e_pow-fma.c (__ieee754_pow): Rename to __pow. * sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c (__ieee754_pow): Likewise. * sysdeps/x86_64/fpu/multiarch/e_pow.c (__ieee754_pow): Likewise. * sysdeps/x86_64/fpu/multiarch/w_pow.c: New file.
* Remove the error handling wrapper from log2Szabolcs Nagy2018-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new log2 symbol version that doesn't do SVID compatible error handling. The standard errno and fp exception based error handling is inline in the new code and does not have significant overhead. The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty w_log2.c and enabled for targets with their own log2 implementation by including math/w_log2.c. The compatibility symbol version still uses the wrapper with SVID error handling around the new code. There is no new symbol version nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv). On targets where previously log2l was an alias of log2, now it points to the compatibility symbol with the wrapper, because it still need the SVID compatible error handling. This affects NO_LONG_DOUBLE (e.g. arm) and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well. The __log2_finite symbol is now an alias of log2. Both __log2_finite and log2 set errno and thus not const functions. The ia64 asm is changed so the compat and new symbol versions map to the same address. Tested with build-many-glibcs.py. * math/Versions (GLIBC_2.29): Add log2. * math/w_log2_compat.c (__log2_compat): Change to versioned compat symbol. * math/w_log2.c: New file. * sysdeps/i386/fpu/w_log2.c: New file. * sysdeps/ia64/fpu/e_log2.S: Add versioned symbols. * sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Rename to __log2 and add necessary aliases. * sysdeps/ieee754/dbl-64/w_log2.c: New file. * sysdeps/m68k/m680x0/fpu/w_log2.c: New file. * sysdeps/mach/hurd/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Update. * sysdeps/unix/sysv/linux/arm/libm.abilist: Update. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Update. * sysdeps/unix/sysv/linux/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update. * sysdeps/unix/sysv/linux/sh/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
* Remove the error handling wrapper from logSzabolcs Nagy2018-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new log symbol version that doesn't do SVID compatible error handling. The standard errno and fp exception based error handling is inline in the new code and does not have significant overhead. The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty w_log.c and enabled for targets with their own log implementation by including math/w_log.c. The compatibility symbol version still uses the wrapper with SVID error handling around the new code. There is no new symbol version nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv). On targets where previously logl was an alias of log, now it points to the compatibility symbol with the wrapper, because it still need the SVID compatible error handling. This affects NO_LONG_DOUBLE (e.g. arm) and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well. The __log_finite symbol is now an alias of log. Both __log_finite and log set errno and thus not const functions. The ia64 asm is changed so the compat and new symbol versions map to the same address. On x86_64 #include <math.h> was added before macro definitions that may affect that header. Tested with build-many-glibcs.py. * math/Versions (GLIBC_2.29): Add log. * math/w_log_compat.c (__log_compat): Change to versioned compat symbol. * math/w_log.c: New file. * sysdeps/i386/fpu/w_log.c: New file. * sysdeps/ia64/fpu/e_log.S: Update. * sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Rename to __log and add necessary aliases. * sysdeps/ieee754/dbl-64/w_log.c: New file. * sysdeps/m68k/m680x0/fpu/w_log.c: New file. * sysdeps/mach/hurd/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Update. * sysdeps/unix/sysv/linux/arm/libm.abilist: Update. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Update. * sysdeps/unix/sysv/linux/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update. * sysdeps/unix/sysv/linux/sh/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update. * sysdeps/x86_64/fpu/multiarch/e_log-avx.c (__ieee754_log): Rename to __log. * sysdeps/x86_64/fpu/multiarch/e_log-fma.c (__ieee754_log): Likewise. * sysdeps/x86_64/fpu/multiarch/e_log-fma4.c (__ieee754_log): Likewise. * sysdeps/x86_64/fpu/multiarch/e_log.c (__ieee754_log): Likewise. * sysdeps/x86_64/fpu/multiarch/w_log.c: New file.
* Remove the error handling wrapper from exp and exp2Szabolcs Nagy2018-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new exp and exp2 symbol version that don't do SVID compatible error handling. The standard errno and fp exception based error handling is inline in the new code and does not have significant overhead. The double precision wrappers are disabled for sysdeps/ieee754/dbl-64 by using empty w_exp.c and w_exp2.c files, the math/w_exp.c and math/w_exp2.c files use the wrapper template and can be included by targets that have their own exp and exp2 implementations or use ifunc on the glibc internal __ieee754_exp symbol. The compatibility symbol versions still use the wrapper with SVID error handling around the new code. There is no new symbol version nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv). On targets where previously expl and exp2l were aliases of exp and exp2, now they point to the compatibility symbols with the wrapper, because they still need the SVID compatible error handling. This affects NO_LONG_DOUBLE (e.g arm) and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well. The _finite symbols are now aliases of the standard symbols (they have no performance advantage anymore). Both the standard symbols and _finite symbols set errno and thus not const functions. The ia64 asm is changed so the compat and new symbol versions map to the same address. On x86_64 #include <math.h> was added before macro definitions that may affect that header (the new macro name is __exp instead of __ieee754_exp which breaks some math.h macros). Tested with build-many-glibcs.py. * math/Versions (GLIBC_2.29): Add exp and exp2. * math/w_exp2_compat.c (__exp2_compat): Change to versioned compat symbol, handle NO_LONG_DOUBLE and LONG_DOUBLE_COMPAT explicitly. * math/w_exp_compat.c (__exp_compat): Likewise. * math/w_exp.c: New file. * math/w_exp2.c: New file. * sysdeps/i386/fpu/w_exp.c: New file. * sysdeps/i386/fpu/w_exp2.c: New file. * sysdeps/ia64/fpu/e_exp.S: Add versioned symbols. * sysdeps/ia64/fpu/e_exp2.S: Likewise. * sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Rename to __exp and add necessary aliases. * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Rename to __exp2 and add necessary aliases. * sysdeps/ieee754/dbl-64/w_exp.c: New file. * sysdeps/ieee754/dbl-64/w_exp2.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2.c: New file. * sysdeps/mach/hurd/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Update. * sysdeps/unix/sysv/linux/arm/libm.abilist: Update. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Update. * sysdeps/unix/sysv/linux/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update. * sysdeps/unix/sysv/linux/sh/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update. * sysdeps/x86_64/fpu/multiarch/e_exp-avx.c (__exp1): Remove. (__ieee754_exp): Rename to __exp. * sysdeps/x86_64/fpu/multiarch/e_exp-fma.c (__exp1): Remove. (__ieee754_exp): Rename to __exp. * sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c (__exp1): Remove. (__ieee754_exp): Rename to __exp. * sysdeps/x86_64/fpu/multiarch/e_exp.c (__ieee754_exp): Rename to __exp. * sysdeps/x86_64/fpu/multiarch/w_exp.c: New file.
* hurd: Support lockf at offset 0 with size 0 or 1.Samuel Thibault2018-11-191-0/+13
| | | | | | * sysdeps/mach/hurd/f_setlk.c: Include <unistd.h>. (__f_setlk): When whence is SEEK_CUR, use __lseek64 to convert it to SEEK_SET.
* hurd: Fix F_*LK* fcntl with __USE_FILE_OFFSET64Samuel Thibault2018-11-166-34/+136
| | | | | | | | | | | | | | | | | | struct flock64 uses 64bit values. This introduces other values for F_GETLK, F_SETLK, F_SETLKW to distinguish between both. * sysdeps/mach/hurd/bits/fcntl.h (F_GETLK64, F_SETLK64, F_SETLKW64): New macros [__USE_FILE_OFFSET64] (F_GETLK, F_SETLK, F_SETLKW): Define to F_GETLK64, F_SETLK64, F_SETLKW64, respectively. * sysdeps/mach/hurd/f_setlk.c: New file. * sysdeps/mach/hurd/f_setlk.h: New file. * sysdeps/mach/hurd/Makefile [$(subdir) = io] (sysdeps_routines): Add f_setlk. * sysdeps/mach/hurd/fcntl.c: Include "f_setlk.h".h". (__libc_fcntl): Move non-flock operations to... * sysdeps/mach/hurd/vfcntl.c (__libc_vfcntl): ... New file. * sysdeps/mach/hurd/fcntl.c (fcntl64): Add missing alias.
* hurd: Fix build with GCC 9Samuel Thibault2018-11-141-2/+3
| | | | | | | * sysdeps/mach/hurd/dl-sysdep.c (check_no_hidden): Use __attribute_copy__ to copy attributes from name. Drop static qualifier to avoid warnings about leaf attribute not having effect on static functions.
* hurd: Document dtable_cloexec size convention.Samuel Thibault2018-11-111-1/+1
| | | | | * sysdeps/mach/hurd/spawni.c (__spawni): Use orig_dtablesize instead of dtablesize for allocating dtable_cloexec.
* Hurd: export _hurd_port_moveSamuel Thibault2018-11-101-0/+1
| | | | | | * hurd/Versions (_hurd_port_move): Export function. * sysdeps/mach/hurd/i386/libc.abilist (_hurd_port_move): Expect symbol.
* Hurd: Fix ulinks in fd table reallocationSamuel Thibault2018-11-101-1/+11
| | | | | | | * hurd/hurd/userlink.h (_hurd_userlink_move): New function. * hurd/hurd/port.h (_hurd_port_move): New function. * sysdeps/mach/hurd/spawni.c (NEW_ULINK_TABLE): New macro. (EXPAND_DTABLE): Use NEW_ULINK_TABLE macro for ulink_dtable.
* Hurd: Implement chdir support in posix_spawnSamuel Thibault2018-11-101-10/+77
| | | | | | | | | | | | This fixes build-many-glibcs.py on i686-gnu. Thanks Florian Weimer for the initial version. * sysdeps/mach/hurd/spawni.c (__spawni): Add ccwdir port. Test and use it, free it if needed. (reauthenticate): Test and use ccwdir. (child_init_port): In non-resetids case, test and use ccwdir. (child_chdir): New nested function to set ccwdir.
* posix: New function posix_spawn_file_actions_addchdir_np [BZ #17405]Florian Weimer2018-11-061-0/+1
|
* hurd: Fix last-minute refactoringSamuel Thibault2018-11-041-1/+1
| | | | * sysdeps/mach/hurd/msync.c (msync): Fix syntax.
* hurd: Support msyncSamuel Thibault2018-11-031-0/+93
| | | | * sysdeps/mach/hurd/msync.c: New file.
* hurd: Fix errno* generationSamuel Thibault2018-10-312-1/+10
| | | | | | | | * sysdeps/mach/hurd/errnos.awk: Avoid printing errnos.d. * sysdeps/gnu/errlist.c (EIEIO): Move text to... * manual/errno.texi (EIEIO): ... here. * sysdeps/gnu/errlist.c (EIEIO): Regenerate. * sysdeps/mach/hurd/bits/errno.h: Regenerate.
* hurd: Fix race between calling RPC and handling a signalSamuel Thibault2018-10-281-7/+16
| | | | | | | | | | * sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Make _hurd_intr_rpc_msg_about_to global point to start of controlled assembly snippet. Make it check canceled flag. * hurd/hurdsig.c (_hurdsig_abort_rpcs): Only mutate thread if it passed the _hurd_intr_rpc_msg_about_to point. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Remove comment on mutation issue, remove cancel flag check.
* hurd: XFAIL absence of C11 threads implementationSamuel Thibault2018-10-251-0/+4
| | | | | | * sysdeps/mach/hurd/i386/Makefile [$(subdir) = conform] (test-xfail-ISO11/threads.h/linknamespace, test-xfail-ISO11/threads.h/conform): Add.
* hurd: Fix exec usage of mach_setup_threadSamuel Thibault2018-08-013-1/+5
| | | | | | | | | | | | | | | | Exec needs that mach_setup_thread does *not* set up TLS since it works on another task, so we have to split this into mach_setup_tls. * mach/mach.h (__mach_setup_tls, mach_setup_tls): Add prototypes. * mach/setup-thread.c (__mach_setup_thread): Move TLS setup to... (__mach_setup_tls): ... new function. (mach_setup_tls): New alias. * hurd/hurdsig.c (_hurdsig_init): Call __mach_setup_tls after __mach_setup_thread. * sysdeps/mach/hurd/profil.c (update_waiter): Likewise. * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Likewise. * mach/Versions [libc] (mach_setup_tls): Add symbol. * sysdeps/mach/hurd/i386/libc.abilist (mach_setup_tls): Likewise.
* hurd: Fix startup of static binaries linked against libpthreadSamuel Thibault2018-07-311-33/+35
| | | | | | * sysdeps/mach/hurd/i386/init-first.c (init1): Move ELF hdr and TLS initialization... (init): ... before initializing libpthread.
* hurd: Fix some ld.so symbol override from libcSamuel Thibault2018-07-282-1/+22
| | | | | | | | ld.so symbols to be overriden by libc need to be extern to really get overriden. * sysdeps/mach/hurd/not-errno.h: New file. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
* hurd: Fix some ld.so symbol override from libcSamuel Thibault2018-07-283-12/+8
| | | | | | | | | | ld.so symbols to be overriden by libc need to be extern to really get overriden. * sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read, __sbrk): Do not set attribute_hidden. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
* hurd: Fix some ld.so symbol override from libcSamuel Thibault2018-07-275-8/+25
| | | | | | | | | | | | | | ld.so symbols to be overriden by libc need to be extern to really get overriden. More fixes are needed to avoid the hidden attribute. * sysdeps/mach/hurd/Versions (libc): Make __access and __access_noerrno external so they can override the ld symbols. (ld): Make __access, __read, __sbrk, __strtoul_internal, __write, __writev, __open64, __access_noerrno extern so they can be overrided. * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
* check-execstack: Permit sysdeps to xfail some libsSamuel Thibault2018-07-201-0/+6
| | | | | | | | | | | * scripts/check-execstack.awk: Consider `xfail' variable containing a list of libraries whose stack executability is expected. * elf/Makefile ($(objpfx)check-execstack.out): Pass $(check-execstack-xfail) to check-execstack.awk through `xfail' variable. * sysdeps/mach/hurd/i386/Makefile (check-execstack-xfail): Set to ld.so libc.so libpthread.so.
* hurd: Fix installed-headers testsSamuel Thibault2018-07-202-0/+4
| | | | | | * sysdeps/mach/include/mach-shortcuts-hidden.h [!_ISOMAC]: Do not declare libc hidden prototypes. * sysdeps/mach/include/mach/mach_traps.h [!_ISOMAC]: Likewise.
* Fix new file headerSamuel Thibault2018-07-201-4/+3
|
* hurd: Implement pipe2Thomas Schwinge2018-07-202-20/+61
| | | | | | * sysdeps/mach/hurd/pipe2.c: New file, copy from pipe.c. Evolve it to implement __pipe2. * sysdeps/mach/hurd/pipe.c (__pipe): Reimplement using __pipe2.
* hurd: SOCK_CLOEXEC and SOCK_NONBLOCK for socketpairThomas Schwinge2018-07-201-3/+22
| | | | | * sysdeps/mach/hurd/socketpair.c (__socketpair): Handle SOCK_CLOEXEC and SOCK_NONBLOCK.