1. 03 11月, 2019 1 次提交
    • 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
  2. 29 10月, 2019 1 次提交
    • 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. 18 10月, 2019 1 次提交
    • 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
  4. 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
  5. 02 7月, 2019 3 次提交
    • 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
      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
      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
  6. 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
  7. 14 3月, 2019 5 次提交
  8. 22 2月, 2019 1 次提交
    • R
      add membarrier syscall wrapper, refactor dynamic tls install to use it · ba18c1ec
      Rich Felker 提交于
      the motivation for this change is twofold. first, it gets the fallback
      logic out of the dynamic linker, improving code readability and
      organization. second, it provides application code that wants to use
      the membarrier syscall, which depends on preregistration of intent
      before the process becomes multithreaded unless unbounded latency is
      acceptable, with a symbol that, when linked, ensures that this
      registration happens.
      ba18c1ec
  9. 08 2月, 2019 2 次提交
  10. 10 12月, 2018 2 次提交
  11. 20 7月, 2018 2 次提交
    • M
      move inclusion of linux headers for kd.h, soundcard.h, vt.h to bits · f2c6dbe2
      midipix 提交于
      maintainer's note: while musl does not use the linux kernel headers,
      it does provide these three sys/* headers which do nothing but include
      the corresponding linux/* headers, since the sys/* versions are the
      ones documented for application use (and they arguably provide
      interfaces that are not linux-specific but common to other unices).
      these headers should probably not be provided by libc (rather by a
      separate package), but as long as they are, use the bits header
      framework as an aid to out-of-tree ports of musl for non-linux systems
      that want to implement them in some other way.
      f2c6dbe2
    • M
      remove inclusion guard hacks for sys/kd.h · 2fab90a7
      midipix 提交于
      maintainer's note: at some point, probably long before linux separated
      the uapi headers, it was the case, or at least I believed it was the
      case, that linux/types.h was unsafe to include from userspace. thus,
      the inclusion guard macro _LINUX_TYPES_H was defined in sys/kd.h to
      prevent linux/kd.h from including linux/types.h (which it spuriously
      includes but does not use). as far as I can tell, whatever problem
      this was meant to solve does not seem to have been present for a long
      time, and the hack was not done correctly anyway, so removing it is
      the right thing to do.
      2fab90a7
  12. 18 7月, 2018 2 次提交
    • S
      add support for arch-specific ptrace command macros · df6d9450
      Szabolcs Nagy 提交于
      sys/ptrace.h is target specific, use bits/ptrace.h to add target
      specific macro definitions.
      
      these macros are kept in the generic sys/ptrace.h even though some
      targets don't support them:
      
      PTRACE_GETREGS
      PTRACE_SETREGS
      PTRACE_GETFPREGS
      PTRACE_SETFPREGS
      PTRACE_GETFPXREGS
      PTRACE_SETFPXREGS
      
      so no macro definition got removed in this patch on any target. only
      s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK).
      
      the PT_ aliases follow glibc headers, otherwise the definitions come
      from linux uapi headers except ones that are skipped in glibc and
      there is no real kernel support (s390x PTRACE_*_AREA) or need special
      type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux
      2.4 compatibility (PTRACE_OLDSETOPTIONS).
      df6d9450
    • S
      sys/ptrace.h: add missing PTRACE_EVENT_STOP · 7ea32a82
      Szabolcs Nagy 提交于
      new in linux v3.1 commit 3544d72a0e10d0aa1c1bd59ed77a53a59cdc12f7
      changed in linux v3.4 commit 5cdf389aee90109e2e3d88085dea4dd5508a3be7
      
      A tracer recieves this event in the waitpid status of a PTRACED_SEIZED
      process.
      7ea32a82
  13. 13 7月, 2018 1 次提交
  14. 27 6月, 2018 1 次提交
  15. 21 6月, 2018 2 次提交
    • S
      add memfd_create syscall wrapper · 38f2fa3d
      Szabolcs Nagy 提交于
      memfd_create was added in linux v3.17 and glibc has api for it.
      38f2fa3d
    • S
      add mlock2 linux syscall wrapper · b64d66d0
      Szabolcs Nagy 提交于
      mlock2 syscall was added in linux v4.4 and glibc has api for it.
      It falls back to mlock in case of flags==0, so that case works
      even on older kernels.
      
      MLOCK_ONFAULT is moved under _GNU_SOURCE following glibc.
      b64d66d0
  16. 20 6月, 2018 5 次提交
    • S
      add speculation control prctls from linux v4.17 · da9f2b2a
      Szabolcs Nagy 提交于
      PR_{SET,GET}_SPECULATION_CTRL controls speculation related vulnerability
      mitigations, new in commits
      b617cfc858161140d69cc0b5cc211996b557a1c7
      356e4bfff2c5489e016fdb925adbf12a1e3950ee
      da9f2b2a
    • S
      add {MSG,SEM,SHM}_STAT_ANY from linux v4.17 · af55070e
      Szabolcs Nagy 提交于
      introduced to stat ipc objects without permission checks since the
      info is available in /proc/sysvipc anyway, new in linux commits
      23c8cec8cf679b10997a512abb1e86f0cedc42ba
      a280d6dc77eb6002f269d58cd47c7c7e69b617b6
      c21a6970ae727839a2f300cd8dd957de0d0238c3
      af55070e
    • S
      add MAP_FIXED_NOREPLACE from linux v4.17 · 156a3bed
      Szabolcs Nagy 提交于
      to map at a fixed address without unmapping underlying mappings
      (fails with EEXIST unlike MAP_FIXED), new in linux commits
      4ed28639519c7bad5f518e70b3284c6e0763e650 and
      a4ff8e8620d3f4f50ac4b41e8067b7d395056843.
      156a3bed
    • S
      sys/ptrace.h: add PTRACE_SECCOMP_GET_METADATA from linux v4.16 · 0f7aa600
      Szabolcs Nagy 提交于
      to get seccomp state for checkpoint restore.
      added in linux commit 26500475ac1b499d8636ff281311d633909f5d20
      
      struct tag follows the glibc api and ptrace_peeksiginfo_args
      got changed too accordingly.
      0f7aa600
    • S
      sys/epoll.h: add EPOLLNVAL from linux v4.16 · 29f3202b
      Szabolcs Nagy 提交于
      added to uapi in commit 65aaf87b3aa2d049c6b9fd85221858a895df3393
      used since commit a9a08845e9acbd224e4ee466f5c1275ed50054e8,
      which renamed POLL* to EPOLL* in the kernel.
      29f3202b
  17. 23 2月, 2018 8 次提交
    • H
      add getrandom syscall wrapper · e2065820
      Hauke Mehrtens 提交于
      This syscall is available since Linux 3.17 and was also implemented in
      glibc in version 2.25 using the same interfaces.
      e2065820
    • S
      sys/prctl.h: add new PR_SVE_* macros from linux v4.15 · 121d18d2
      Szabolcs Nagy 提交于
      PR_SVE_SET_VL and PR_SVE_GET_VL controls are new in linux commit
      2d2123bc7c7f843aa9db87720de159a049839862
      related PR_SVE_* macros were added in
      7582e22038a266444eb87bc07c372592ad647439
      121d18d2
    • S
      add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15 · 9b57db3f
      Szabolcs Nagy 提交于
      for synchronous page faults, new in linux commit
      1c9725974074a047f6080eecc62c50a8e840d050 and
      b6fb293f2497a9841d94f6b57bd2bb2cd222da43
      note that only targets that use asm-generic/mman.h have this new
      flag defined, so undef it on other targets (mips*, powerpc*).
      9b57db3f
    • S
      sys/{mman,shm}.h: add {MAP,SHM}_HUGE_ macros from linux uapi · abdaba86
      Szabolcs Nagy 提交于
      *_HUGE_SHIFT, *_HUGE_2MB, *_HUGE_1GB are documented in the man page,
      so add all of the *_HUGE_* macros from linux uapi.
      
      if MAP_HUGETLB is set, top bits of the mmap flags encode the page size.
      see the linux commit aafd4562dfee81a40ba21b5ea3cf5e06664bc7f6
      
      if SHM_HUGETLB is set, top bits of the shmget flags encode the page size.
      see the linux commit 4da243ac1cf6aeb30b7c555d56208982d66d6d33
      
      *_HUGE_16GB is defined unsigned to avoid signed left shift ub.
      abdaba86
    • S
      sys/mman.h: add MADV_WIPEONFORK from linux v4.14 · 5431c200
      Szabolcs Nagy 提交于
      allows zeroing anonymous private pages inherited by a child process.
      new in linux commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
      5431c200
    • S
      sys/socket.h: add MSG_ZEROCOPY from linux v4.14 · 986bc217
      Szabolcs Nagy 提交于
      MSG_ZEROCOPY socket send flag avoids copy in the kernel
      new in linux commit 52267790ef52d7513879238ca9fac22c1733e0e3
      SO_ZEROCOPY socket option enables MSG_ZEROCOPY if availale
      new in linux commit 76851d1212c11365362525e1e2c0a18c97478e6b
      986bc217
    • S
      sys/socket.h: add SOL_TLS from linux v4.13 · 404097a4
      Szabolcs Nagy 提交于
      socket option for kernel TLS support
      new in linux commit 3c4d7559159bfe1e3b94df3a657b2cda3a34e218
      404097a4
    • S
      sys/socket.h: add PF_SMC from linux v4.11 · 709bbf51
      Szabolcs Nagy 提交于
      add AF_SMC and PF_SMC for the IBM shared memory communication protocol.
      new in linux commit ac7138746e14137a451f8539614cdd349153e0c0
      (linux socket.h is not in uapi so this update was missed earlier)
      709bbf51