1. 03 11月, 2019 2 次提交
    • R
      make time-related socket options overridable by arch bits files · 0bbc04c9
      Rich Felker 提交于
      SO_RCVTIMEO and SO_SNDTIMEO already were, but only in aggregate with
      SO_DEBUG and all of the other low/traditional options that varied per
      arch. SO_TIMESTAMP* are newly overridable. the two groups have to be
      done separately since mips64 and powerpc64 will override the former
      but not the latter.
      
      at some point this should be cleaned up to use bits headers more
      idiomatically.
      0bbc04c9
    • R
      add time64 redirect for, and redirecting implementation of, dlsym · 22daaea3
      Rich Felker 提交于
      if symbols are being redirected to provide the new time64 ABI, dlsym
      must perform matching redirections; otherwise, it would poke a hole in
      the magic and return pointers to functions that are not safe to call
      from a caller using time64 types.
      
      rather than duplicating a table of redirections, use the time64
      symbols present in libc's symbol table to derive the decision for
      whether a particular symbol needs to be redirected.
      22daaea3
  2. 29 10月, 2019 2 次提交
    • R
      prepare struct sched_param for change in time_t definition · 2d69fcf5
      Rich Felker 提交于
      the time_t members in struct sched_param are just reserved space to
      preserve size and alignment. when time_t changes to 64-bit on 32-bit
      archs, this structure should not change.
      
      make definition conditional on _REDIR_TIME64 to match the size of the
      old time_t, which can be assumed to be long if _REDIR_TIME64 is
      defined.
      2d69fcf5
    • R
      add time64 symbol name redirects to public headers, under arch control · 1febd21d
      Rich Felker 提交于
      a _REDIR_TIME64 macro is introduced, which the arch's alltypes.h is
      expected to define, to control redirection of symbol names for
      interfaces that involve time_t and derived types. this ensures that
      object files will only be linked to libc interfaces matching the ABI
      whose headers they were compiled against.
      
      along with time32 compat shims, which will be introduced separately,
      the redirection also makes it possible for a single libc (static or
      shared) to be used with object files produced with either the old
      (32-bit time_t) headers or the new ones after 64-bit time_t switchover
      takes place. mixing of such object files (or shared libraries) in the
      same program will also be possible, but must be done with care; ABI
      between libc and a consumer of the libc interfaces is guaranteed to
      match by the the symbol name redirection, but pairwise ABI between
      consumers of libc that define interfaces between each other in terms
      of time_t is not guaranteed to match.
      
      this change adds a dependency on an additional "GNU C" feature to the
      public headers for existing 32-bit archs, which is generally
      undesirable; however, the feature is one which glibc has depended on
      for a long time, and thus which any viable alternative compiler is
      going to need to provide. 64-bit archs are not affected, nor will
      future 32-bit archs be, regardless of whether they are "new" on the
      kernel side (e.g. riscv32) or just newly-added (e.g. a new sparc or
      xtensa port). the same applies to newly-added ABIs for existing
      machine-level archs.
      1febd21d
  3. 20 10月, 2019 1 次提交
    • R
      adjust struct timespec definition to be time64-ready · 9b2921be
      Rich Felker 提交于
      for time64 support on 32-bit archs, the kernel interfaces use a
      timespec layout padded to match the representation of a pair of 64-bit
      values, which requires endian-specific padding.
      
      use of an ordinary, non-bitfield, named member for the padding is
      undesirable because, on big endian archs, it would alter the
      interpretation of traditional (non-designated) initializers of the
      form {s,ns}, initializing the padding instead of the tv_nsec member.
      unnamed bitfield members solve this problem by not taking part in
      initialization, and were the expected solution when the kernel
      interfaces were designed. however, they also have further advantages
      which we take advantage of here:
      
      positioning of the padding could be controlled by having a
      preprocessor conditional with separate definitions of struct timespec
      for little and big endian, but whether padding should appear at all is
      a function of whether time_t is larger than long. this condition is
      not something the preprocessor can determine unless we were to define
      a new macro specifically for that purpose.
      
      by using unnamed bitfield members instead of ordinary named members,
      we can arrange for the size of the padding to collapse to zero when it
      should not be present, just by using sizeof(time_t) and sizeof(long)
      in the bitfield width expression, which can be any integer constant
      expression.
      9b2921be
  4. 18 10月, 2019 6 次提交
    • R
      move pthread types out of per-arch alltypes.h · 2d3083e7
      Rich Felker 提交于
      policy has long been that these definitions are purely a function of
      whether long/pointer is 32- or 64-bit, and that they are not allowed
      to vary per-arch. move the definition to the shared alltypes.h.in
      fragment, using integer constant expressions in terms of sizeof to
      vary the array dimensions appropriately. I'm not sure whether this is
      more or less ugly than using preprocessor conditionals and two sets of
      definitions here, but either way is a lot less ugly than repeating the
      same thing for every arch.
      2d3083e7
    • R
      define LONG_MAX via arch alltypes.h, strip down bits/limits.h · 7cc79d10
      Rich Felker 提交于
      LLONG_MAX is uniform for all archs we support and plenty of header and
      code level logic assumes it is, so it does not make sense for limits.h
      bits mechanism to pretend it's variable.
      
      LONG_BIT can be defined in terms of LONG_MAX; there's no reason to put
      it in bits.
      
      by moving LONG_MAX definition to __LONG_MAX in alltypes.h and moving
      LLONG_MAX out of bits, there are now no plain-C limits that are
      defined in the bits header, so the bits header only needs to be
      included in the POSIX or extended profiles. this allows the feature
      test macro logic to be removed from the bits header, facilitating a
      long-term goal of getting such logic out of bits.
      
      having __LONG_MAX in alltypes.h will allow further generalization of
      headers.
      
      archs without a constant PAGESIZE no longer need bits/limits.h at all.
      7cc79d10
    • R
      make endian.h expose unprefixed macros, functions in standard profile · 316730cd
      Rich Felker 提交于
      the resolution of Austin Group issue #162 adds endian.h as a standard
      header for future versions of the standard, making it no longer
      acceptable for some of the functionality to be hidden behind
      _BSD_SOURCE or _GNU_SOURCE. the definitions of the [lb]etoh{16,32,64}
      function-like macros are kept conditional since they are alternate
      names which the standard did not adopt.
      316730cd
    • R
      remove indirect use of endian.h from public headers · 71d23fbe
      Rich Felker 提交于
      building on commit 97d35a55,
      __BYTE_ORDER is now available wherever alltypes.h is included.
      endian.h should not be used since, in the future, it will expose
      identifiers that are not in the reserved namespace for the headers
      which were previously using it.
      71d23fbe
    • R
      move __BYTE_ORDER definition to alltypes.h · 97d35a55
      Rich Felker 提交于
      this change is motivated by the intersection of several factors.
      presently, despite being a nonstandard header, endian.h is exposing
      the unprefixed byte order macros and functions only if _BSD_SOURCE or
      _GNU_SOURCE is defined. this is to accommodate use of endian.h from
      other headers, including bits headers, which need to define structure
      layout in terms of endianness. with time64 switch-over, even more
      headers will need to do this.
      
      at the same time, the resolution of Austin Group issue 162 makes
      endian.h a standard header for POSIX-future, requiring that it expose
      the unprefixed macros and the functions even in standards-conforming
      profiles. changes to meet this new requirement would break existing
      internal usage of endian.h by causing it to violate namespace where
      it's used.
      
      instead, have the arch's alltypes.h define __BYTE_ORDER, either as a
      fixed constant or depending on the right arch-specific predefined
      macros for determining endianness. explicit literals 1234 and 4321 are
      used instead of __LITTLE_ENDIAN and __BIG_ENDIAN so that there's no
      danger of getting the wrong result if a macro is undefined and
      implicitly evaluates to 0 at the preprocessor level.
      
      the powerpc (32-bit) bits/endian.h being removed had logic for varying
      endianness, but our powerpc arch has never supported that and has
      always been big-endian-only. this logic is not carried over to the new
      __BYTE_ORDER definition in alltypes.h.
      97d35a55
    • R
      remove per-arch definitions for va_list · 00ec11d1
      Rich Felker 提交于
      now that commit f7f10797 removed the
      legacy i386 conditional definition, va_list is in no way
      arch-specific, and has no reason to be in the future. move it to the
      shared part of alltypes.h.in
      00ec11d1
  5. 11 9月, 2019 4 次提交
  6. 31 8月, 2019 2 次提交
    • R
      add public declaration for optreset under appropriate feature profiles · a882841b
      Rich Felker 提交于
      commit 030e5263 added optreset, a BSD
      extension to getopt duplicating the functionality (also an extension)
      of setting optind to 0, but failed to provide a public declaration for
      it. according to the BSD documentation and headers, the application is
      not supposed to need to provide its own declaration.
      a882841b
    • R
      add posix_spawn [f]chdir file actions · 74244e5b
      Rich Felker 提交于
      these are presently extensions, thus named with _np to match glibc and
      other implementations that provide them; however they are likely to be
      standardized in the future without the _np suffix as a result of
      Austin Group issue 1208. if so, both names will be kept as aliases.
      74244e5b
  7. 24 8月, 2019 1 次提交
  8. 15 8月, 2019 1 次提交
    • R
      remove sporadic server members from struct sched_param · 827aa8fb
      Rich Felker 提交于
      these members are associated with an unsupported option group. with
      time_t changing size on 32-bit archs, all interfaces taking struct
      sched_param arguments would need redirection and compat shims in order
      to be able to continue offering these members, for no benefit. just
      convert them to reserved space instead.
      827aa8fb
  9. 08 8月, 2019 1 次提交
  10. 07 8月, 2019 1 次提交
  11. 02 8月, 2019 2 次提交
    • R
      move IPC_STAT definition to a new bits/ipcstat.h file · 006a75a9
      Rich Felker 提交于
      otherwise, 32-bit archs that could otherwise share the generic
      bits/ipc.h would need to duplicate the struct ipc_perm definition,
      obscuring the fact that it's the same. sysvipc is not widely used and
      these headers are not commonly included, so there is no performance
      gain to be had by limiting the number of indirectly included files
      here.
      
      files with the existing time32 definition of IPC_STAT are added to all
      current 32-bit archs now, so that when it's changed the change will
      show up as a change rather than addition of a new file where it's less
      obvious that the value is changing vs the generic one that was used
      before.
      006a75a9
    • R
      allow archs to define IPC_STAT, propagate time64 bit to other macros · 3c02bacf
      Rich Felker 提交于
      to make use of {sem,shm,msg}ctl IPC_STAT functionality to provide
      64-bit time_t on 32-bit archs, IPC_STAT and related macros must be
      defined with bit 8 (0x100) set. allow archs to define IPC_STAT in
      bits/ipc.h, and define the other macros in terms of it so that they
      all get the same value of the time64 bit.
      3c02bacf
  12. 02 7月, 2019 7 次提交
    • S
      elf.h: add NT_ARM_PAC{A,G}_KEYS from linux v5.1 · 47bc7f0a
      Szabolcs Nagy 提交于
      to request or change pointer auth keys for criu via ptrace, new in
      
        linux commit d0a060be573bfbf8753a15dca35497db5e968bb0
        arm64: add ptrace regsets for ptrauth key management
      47bc7f0a
    • S
      netinet/in.h: add INADDR_ALLSNOOPERS_GROUP from linux v5.1 · eea841e6
      Szabolcs Nagy 提交于
      RFC 4286: "The IPv4 multicast address for All-Snoopers is 224.0.0.106."
      from
      
        linux commit 4effd28c1245303dce7fd290c501ac2c11052114
        bridge: join all-snoopers multicast address
      eea841e6
    • S
      sys/socket.h: add SO_BINDTOIFINDEX from linux v5.1 · 5b2b682d
      Szabolcs Nagy 提交于
      SO_BINDTOIFINDEX behaves similar to SO_BINDTODEVICE, but takes a
      network interface index as argument, rather than the network
      interface name. see
      
        linux commit f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c
        net: introduce SO_BINDTOIFINDEX sockopt
      5b2b682d
    • S
      netinet/in.h: add IPV6_ROUTER_ALERT_ISOLATE from linux v5.1 · 93b5f6c8
      Szabolcs Nagy 提交于
      restricts router alert packets received by the socket to the
      socket's namespace only. see
      
        linux commit 9036b2fe092a107856edd1a3bad48b83f2b45000
        net: ipv6: add socket option IPV6_ROUTER_ALERT_ISOLATE
      93b5f6c8
    • S
      sys/prctl.h: add PR_SPEC_DISABLE_NOEXEC from linux v5.1 · c7081edc
      Szabolcs Nagy 提交于
      allows specifying that the speculative store bypass disable bit should
      be cleared on exec. see
      
        linux commit 71368af9027f18fe5d1c6f372cfdff7e4bde8b48
        x86/speculation: Add PR_SPEC_DISABLE_NOEXEC
      c7081edc
    • S
      fcntl.h: add F_SEAL_FUTURE_WRITE from linux v5.1 · 9e8dd1c7
      Szabolcs Nagy 提交于
      needed for android so it can migrate from its ashmem to memfd.
      allows making the memfd readonly for future users while keeping
      a writable mmap of it. see
      
        linux commit ab3948f58ff841e51feb845720624665ef5b7ef3
        mm/memfd: add an F_SEAL_FUTURE_WRITE seal to memfd
      9e8dd1c7
    • S
      sys/fanotify.h: update for linux v5.1 · f67b3c17
      Szabolcs Nagy 提交于
      includes changes from linux v5.1
      
        linux commit 235328d1fa4251c6dcb32351219bb553a58838d2
        fanotify: add support for create/attrib/move/delete events
      
        linux commit 5e469c830fdb5a1ebaa69b375b87f583326fd296
        fanotify: copy event fid info to user
      
        linux commit e9e0c8903009477b630e37a8b6364b26a00720da
        fanotify: encode file identifier for FAN_REPORT_FID
      
      as well as earlier changes that were missed.
      
      sys/statfs.h is included for fsid_t.
      f67b3c17
  13. 22 6月, 2019 1 次提交
    • R
      remove implicit include of sys/sysmacros.h from sys/types.h · a31a30a0
      Rich Felker 提交于
      this reverts commit f552c792, which
      exposed the sysmacros.h macros (device major/minor calculations) for
      BSD and GNU profiles to mimic an unintentional glibc behavior some
      code depended on. glibc has deprecated and since removed them as the
      resolution to bug #19239, so it makes no sense for us to keep this
      behavior. affected code should all have been fixed by now, and if it's
      not yet fixed it needs to be for use with modern glibc anyway.
      a31a30a0
  14. 15 6月, 2019 1 次提交
    • R
      add riscv64 architecture support · 0a48860c
      Rich Felker 提交于
      Author: Alex Suykov <alex.suykov@gmail.com>
      Author: Aric Belsito <lluixhi@gmail.com>
      Author: Drew DeVault <sir@cmpwn.com>
      Author: Michael Clark <mjc@sifive.com>
      Author: Michael Forney <mforney@mforney.org>
      Author: Stefan O'Rear <sorear2@gmail.com>
      
      This port has involved the work of many people over several years. I
      have tried to ensure that everyone with substantial contributions has
      been credited above; if any omissions are found they will be noted
      later in an update to the authors/contributors list in the COPYRIGHT
      file.
      
      The version committed here comes from the riscv/riscv-musl repo's
      commit 3fe7e2c75df78eef42dcdc352a55757729f451e2, with minor changes by
      me for issues found during final review:
      
      - a_ll/a_sc atomics are removed (according to the ISA spec, lr/sc
        are not safe to use in separate inline asm fragments)
      
      - a_cas[_p] is fixed to be a memory barrier
      
      - the call from the _start assembly into the C part of crt1/ldso is
        changed to allow for the possibility that the linker does not place
        them nearby each other.
      
      - DTP_OFFSET is defined correctly so that local-dynamic TLS works
      
      - reloc.h LDSO_ARCH logic is simplified and made explicit.
      
      - unused, non-functional crti/n asm files are removed.
      
      - an empty .sdata section is added to crt1 so that the
        __global_pointer reference is resolvable.
      
      - indentation style errors in some asm files are fixed.
      0a48860c
  15. 18 4月, 2019 1 次提交
    • S
      define FP_FAST_FMA* when fma* can be inlined · e980ca7a
      Szabolcs Nagy 提交于
      FP_FAST_FMA can be defined if "the fma function generally executes about
      as fast as, or faster than, a multiply and an add of double operands",
      which can only be true if the fma call is inlined as an instruction.
      
      gcc sets __FP_FAST_FMA if __builtin_fma is inlined as an instruction,
      but that does not mean an fma call will be inlined (e.g. it is defined
      with -fno-builtin-fma), other compilers (clang) don't even have such
      macro, but this is the closest we can get.
      
      (even if the libc fma implementation is a single instruction, the extern
      call overhead is already too big when the macro is used to decide between
      x*y+z and fma(x,y,z) so it cannot be based on libc only, defining the
      macro unconditionally on targets which have fma in the base isa is also
      incorrect: the compiler might not inline fma anyway.)
      
      this solution works with gcc unless fma inlining is explicitly turned off.
      e980ca7a
  16. 11 4月, 2019 1 次提交
    • A
      fcntl.h: define O_TTY_INIT to 0 · 65c8be38
      A. Wilcox 提交于
      POSIX: "[If] either O_TTY_INIT is set in oflag or O_TTY_INIT has the
      value zero, open() shall set any non-standard termios structure
      terminal parameters to a state that provides conforming behavior."
      
      The Linux kernel tty drivers always perform initialisation on their
      devices to set known good termios values during the open(2) call.  This
      means that setting O_TTY_INIT to zero is conforming.
      65c8be38
  17. 06 4月, 2019 1 次提交
    • B
      fix signature of function accepted by makecontext · e8e780af
      Bobby Bingham 提交于
      This parameter was incorrectly declared to be a pointer to a function
      accepting zero parameters.  The intent of makecontext is that it is
      possible to pass integer parameters to the function, so this should
      have been a pointer to a function accepting an unspecified set of
      parameters.
      e8e780af
  18. 14 3月, 2019 5 次提交