1. 09 9月, 2020 1 次提交
  2. 05 9月, 2020 1 次提交
  3. 17 8月, 2020 1 次提交
  4. 29 1月, 2020 2 次提交
  5. 26 1月, 2020 1 次提交
  6. 12 1月, 2020 1 次提交
  7. 02 1月, 2020 2 次提交
    • M
      unconditonally define alloca as __builtin_alloca · a56ec7e8
      Michael Forney 提交于
      This enables alternative compilers, which may not define __GNUC__,
      to implement alloca, which is still fairly widely used.
      
      This is similar to how stdarg.h already works in musl; compilers must
      implement __builtin_va_arg, there is no fallback definition.
      a56ec7e8
    • R
      remove gratuitous aligned attribute from __ptrace_syscall_info · ac89e2cc
      Rich Felker 提交于
      this change was discussed on the mailing list thread for the linux
      uapi v5.3 patches, and submitted as a v2 patch, but overlooked when I
      applied the patches much later.
      
      revert commit f291c09e and apply the
      v2 as submitted; the net change is just padding.
      
      notes by Szabolcs Nagy follow:
      
      compared to the linux uapi (and glibc) a padding is used instead of
      aligned attribute for keeping the layout the same across targets, this
      means the alignment of the struct may be different on some targets
      (e.g. m68k where uint64_t is 2 byte aligned) but that should not affect
      syscalls and this way the abi does not depend on nonstandard extensions.
      ac89e2cc
  8. 31 12月, 2019 8 次提交
    • S
      sys/wait.h: add P_PIDFD from linux v5.4 · f296be74
      Szabolcs Nagy 提交于
      allows waiting on a pidfd, in the future it might allow retrieving the
      exit status by a non-parent process, see
      
        linux commit 3695eae5fee0605f316fbaad0b9e3de791d7dfaf
        pidfd: add P_PIDFD to waitid()
      f296be74
    • S
      netinet/tcp.h: add new tcp_info fields from linux v5.4 · 5e0c9f24
      Szabolcs Nagy 提交于
      tcpi_rcv_ooopack for tracking connection quality:
      
        linux commit f9af2dbbfe01def62765a58af7fbc488351893c3
        tcp: Add TCP_INFO counter for packets received out-of-order
      
      tcpi_snd_wnd peer window size for diagnosing tcp performance problems:
      
        linux commit 8f7baad7f03543451af27f5380fc816b008aa1f2
        tcp: Add snd_wnd to TCP_INFO
      5e0c9f24
    • S
      sys/prctl.h: add PR_*_TAGGED_ADDR_* from linux v5.4 · 5675aaa5
      Szabolcs Nagy 提交于
      per thread prctl commands to relax the syscall abi such that top bits
      of user pointers are ignored in the kernel. this allows the use of
      those bits by hwasan or by mte to color pointers and memory on aarch64:
      
        linux commit 63f0c60379650d82250f22e4cf4137ef3dc4f43d
        arm64: Introduce prctl() options to control the tagged user addresses ABI
      5675aaa5
    • S
      sys/mman.h: add MADV_COLD and MADV_PAGEOUT from linux v5.4 · d95ead26
      Szabolcs Nagy 提交于
      These were mainly introduced so android can optimize the memory usage
      of unused apps.
      
      MADV_COLD hints that the memory range is currently not needed (unlike
      with MADV_FREE the content is not garbage, it needs to be swapped):
      
        linux commit 9c276cc65a58faf98be8e56962745ec99ab87636
        mm: introduce MADV_COLD
      
      MADV_PAGEOUT hints that the memory range is not needed for a long time
      so it can be reclaimed immediately independently of memory pressure
      (unlike with MADV_DONTNEED the content is not garbage):
      
        linux commit 1a4e58cce84ee88129d5d49c064bd2852b481357
        mm: introduce MADV_PAGEOUT
      d95ead26
    • S
      sys/ptrace.h: add PTRACE_GET_SYSCALL_INFO from linux v5.3 · f291c09e
      Szabolcs Nagy 提交于
      ptrace API to get details of the syscall the tracee is blocked in, see
      
        linux commit 201766a20e30f982ccfe36bebfad9602c3ff574a
        ptrace: add PTRACE_GET_SYSCALL_INFO request
      
      the align attribute was used to keep the layout the same across targets
      e.g. on m68k uint32_t is 2 byte aligned, this helps with compat ptrace.
      f291c09e
    • S
      sys/socket.h: add SO_DETACH_REUSEPORT_BPF from linux v5.3 · 06636c55
      Szabolcs Nagy 提交于
      see
      
        linux commit 99f3a064bc2e4bd5fe50218646c5be342f2ad18c
        bpf: net: Add SO_DETACH_REUSEPORT_BPF
      06636c55
    • S
      netinet/if_ether.h: add ETH_P_LLDP from linux v5.3 · 167cbf13
      Szabolcs Nagy 提交于
      see
      
        linux commit c54c2c72b2b90a3ba61b8cad032a578ce2bf5b35
        net: Add a define for LLDP ethertype
      167cbf13
    • S
      netinet/tcp.h: add TCP_TX_DELAY from linux v5.3 · af2576e6
      Szabolcs Nagy 提交于
      see
      
        linux commit a842fe1425cb20f457abd3f8ef98b468f83ca98b
        tcp: add optional per socket transmit delay
      af2576e6
  9. 23 12月, 2019 3 次提交
    • A
      add uapi guards for new netinet/ip.h conflict with struct iphdr · 0738e6c1
      A. Wilcox 提交于
      This ensures that the musl definition of 'struct iphdr' does not conflict
      with the Linux kernel UAPI definition of it.
      
      Some software, i.e. net-tools, will not compile against 5.4 kernel headers
      without this patch and the corresponding Linux kernel patch.
      0738e6c1
    • R
      adjust utmpx struct layout for time64, 32-/64-bit arch compat · 1e7f0fcd
      Rich Felker 提交于
      since time64 switchover has changed the size and layout of the struct
      anyway, take the opportunity to fix it up so that it can be shared
      between 32- and 64-bit ABIs on the same system as long as byte order
      matches.
      
      the ut_type member is explicitly padded to make up for m68k having
      only 2-byte alignment; explicit padding has no effect on other archs.
      
      ut_session is changed from long to int, with endian-matched padding.
      this affects 64-bit archs as well, but brings the type into alignment
      with glibc's x86_64 struct, so it should not break software, and does
      not break on-disk format. the semantic type is int (pid-like) anyway.
      the padding produces correct alignment for the ut_tv member on 32-bit
      archs that don't naturally align it, so that ABI matches 64-bit.
      
      this type is presently not used anywhere in the ABI between libc and
      libc consumers; it's only used between pairs of consumers if a
      third-party utmp library using the system utmpx.h is in use.
      1e7f0fcd
    • R
      fix elf_prstatus regression on time64, existing wrong definition on x32 · 3f959f6f
      Rich Felker 提交于
      the elf_prstatus structure is used in core dumps, and the timeval
      structures in it are longs matching the elf class, *not* the kernel
      "old timeval" for the arch. this means using timeval here for x32 was
      always wrong, despite kernel uapi headers and glibc also exposing it
      this way, and of course it's wrong for any arch with 64-bit time_t.
      
      rather than just changing the type on affected archs, use a tagless
      struct containing long tv_sec and tv_usec members in place of the
      timevals. this intentionally breaks use of them as timevals (e.g.
      assignment, passing address, etc.) on 64-bit archs as well so that any
      usage unsafe for 32-bit archs is caught even in software that only
      gets tested on 64-bit archs. from what I could gather, there is not
      any software using these members anyway. the only reason they need to
      be fixed to begin with is that the only members which are commonly
      used, the saved registers, follow the time members and have the wrong
      offset if the time members are sized incorrectly.
      3f959f6f
  10. 19 12月, 2019 1 次提交
  11. 18 12月, 2019 1 次提交
    • R
      signal to kernel headers that time_t is 64-bit · f12bd8e0
      Rich Felker 提交于
      linux/input.h and perhaps others use this macro to determine whether
      the userspace time_t is 64-bit when potentially defining types in
      terms of time_t and derived structures. the name __USE_TIME_BITS64 is
      unfortunate; it really should have been in the __UAPI namespace. but
      this is what was chosen back in v4.16 when first preparing input.h for
      time64 userspace, presumably based on expectations about what the
      glibc-internal features.h macro for time64 would be, and changing it
      now would just put a new minimum version requirement on kernel
      headers.
      
      the __USE_TIME_BITS64 macro is not intended as a public interface. it
      is purely an internal contract between libc and Linux uapi headers.
      f12bd8e0
  12. 03 11月, 2019 5 次提交
    • R
      move time_t and suseconds_t definitions to common alltypes.h.in · d6dcfe4d
      Rich Felker 提交于
      now that all 32-bit archs have 64-bit time_t (and suseconds_t), the
      arch-provided _Int64 macro (long or long long, as appropriate) can be
      used to define them, and arch-specific definitions are no longer
      needed.
      d6dcfe4d
    • R
      move time64 socket options from arch bits to top-level sys/socket.h · c71dbb24
      Rich Felker 提交于
      now that all 32-bit archs have 64-bit time types, the values for the
      time-related socket option macros can be treated as universal for
      32-bit archs. the sys/socket.h mechanism for this predates
      arch/generic and is instead in the top-level header.
      
      x32, which does not use the new time64 values of the macros, already
      has its own overrides, so this commit does not affect it.
      c71dbb24
    • R
      move msghdr and cmsghdr out of bits/socket.h · a0252bc7
      Rich Felker 提交于
      these structures can now be defined generically in terms of endianness
      and long size. previously, the 32-bit archs all shared a common
      definition from the generic bits header, and each 64-bit arch had to
      repeat the 64-bit version, with endian conditionals if the arch had
      variants of each endianness.
      
      I would prefer getting rid of the preprocessor conditionals for
      padding and instead using unnamed bitfield members, like commit
      9b2921be did for struct timespec.
      however, at present sendmsg, recvmsg, and recvmmsg need access to the
      padding members by name to zero them. this could perhaps be cleaned up
      in the future.
      a0252bc7
    • 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
  13. 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
  14. 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
  15. 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
  16. 11 9月, 2019 4 次提交