1. 05 2月, 2020 2 次提交
  2. 31 1月, 2020 1 次提交
    • R
      remove legacy clock_gettime and gettimeofday from public syscall.h · 5a105f19
      Rich Felker 提交于
      some nontrivial number of applications have historically performed
      direct syscalls for these operations rather than using the public
      functions. such usage is invalid now that time_t is 64-bit and these
      syscalls no longer match the types they are used with, and it was
      already harmful before (by suppressing use of vdso).
      
      since syscall() has no type safety, incorrect usage of these syscalls
      can't be caught at compile-time. so, without manually inspecting or
      running additional tools to check sources, the risk of such errors
      slipping through is high.
      
      this patch renames the syscalls on 32-bit archs to clock_gettime32 and
      gettimeofday_time32, so that applications using the original names
      will fail to build without being fixed.
      
      note that there are a number of other syscalls that may also be unsafe
      to use directly after the time64 switchover, but (1) these are the
      main two that seem to be in widespread use, and (2) most of the others
      continue to have valid usage with a null timeval/timespec argument, as
      the argument is an optional timeout or similar.
      5a105f19
  3. 31 12月, 2019 2 次提交
  4. 03 11月, 2019 4 次提交
    • 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
      switch all existing 32-bit archs to 64-bit time_t · 38143339
      Rich Felker 提交于
      this commit preserves ABI fully for existing interface boundaries
      between libc and libc consumers (applications or libraries), by
      retaining existing symbol names for the legacy 32-bit interfaces and
      redirecting sources compiled against the new headers to alternate
      symbol names. this does not necessarily, however, preserve the
      pairwise ABI of libc consumers with one another; where they use
      time_t-derived types in their interfaces with one another, it may be
      necessary to synchronize updates with each other.
      
      the intent is that ABI resulting from this commit already be stable
      and permanent, but it will not be officially so until a release is
      made. changes to some header-defined types that do not play any role
      in the ABI between libc and its consumers may still be subject to
      change.
      
      mechanically, the changes made by this commit for each 32-bit arch are
      as follows:
      
      - _REDIR_TIME64 is defined to activate the symbol redirections in
        public headers
      
      - COMPAT_SRC_DIRS is defined in arch.mak to activate build of ABI
        compat shims to serve as definitions for the original symbol names
      
      - time_t and suseconds_t definitions are changed to long long (64-bit)
      
      - IPC_STAT definition is changed to add the IPC_TIME64 bit (0x100),
        triggering conversion of semid_ds, shmid_ds, and msqid_ds split
        low/high time bits into new time_t members
      
      - structs semid_ds, shmid_ds, msqid_ds, and stat are modified to add
        new 64-bit time_t/timespec members at the end, maintaining existing
        layout of other members.
      
      - socket options (SO_*) and ioctl (sockios) command macros are
        redefined to use the kernel's "_NEW" values.
      
      in addition, on archs where vdso clock_gettime is used, the
      VDSO_CGT_SYM macro definition in syscall_arch.h is changed to use a
      new time64 vdso function if available, and a new VDSO_CGT32_SYM macro
      is added for use as fallback on kernels lacking time64.
      38143339
    • 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
  5. 18 10月, 2019 4 次提交
    • 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
      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
  6. 11 9月, 2019 1 次提交
    • S
      add new syscall numbers from linux v5.2 · b6076309
      Szabolcs Nagy 提交于
      new mount api syscalls were added, same numers on all targets, see
      
        linux commit a07b20004793d8926f78d63eb5980559f7813404
        vfs: syscall: Add open_tree(2) to reference or clone a mount
      
        linux commit 2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae
        vfs: syscall: Add move_mount(2) to move mounts around
      
        linux commit 24dcb3d90a1f67fe08c68a004af37df059d74005
        vfs: syscall: Add fsopen() to prepare for superblock creation
      
        linux commit ecdab150fddb42fe6a739335257949220033b782
        vfs: syscall: Add fsconfig() for configuring and managing a context
      
        linux commit 93766fbd2696c2c4453dd8e1070977e9cd4e6b6d
        vfs: syscall: Add fsmount() to create a mount for a superblock
      
        linux commit cf3cba4a429be43e5527a3f78859b1bfd9ebc5fb
        vfs: syscall: Add fspick() to select a superblock for reconfiguration
      
        linux commit 9c8ad7a2ff0bfe58f019ec0abc1fb965114dde7d
        uapi, x86: Fix the syscall numbering of the mount API syscalls [ver #2]
      
        linux commit d8076bdb56af5e5918376cd1573a6b0007fc1a89
        uapi: Wire up the mount API syscalls on non-x86 arches [ver #2]
      b6076309
  7. 02 8月, 2019 1 次提交
    • 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
  8. 30 7月, 2019 1 次提交
    • R
      extricate bits/sem.h from x32 time_t hack · 1afe5f3e
      Rich Felker 提交于
      various padding fields in the generic bits/sem.h were defined in terms
      of time_t as a cheap hack standing in for "kernel long", to allow x32
      to use the generic version of the file. this was a really bad idea, as
      it ended up getting copied into lots of arch-specific versions of the
      bits file, and is a blocker to changing time_t to 64-bit on 32-bit
      archs.
      
      this commit adds an x32-specific version of the header, and changes
      padding type back from time_t to long (currently the same type on all
      archs but x32) in the generic header and all the others the hack got
      copied into.
      1afe5f3e
  9. 19 7月, 2019 1 次提交
    • R
      remove utterly wrong includes from mips64/n32 bits/stat.h · 62a73d96
      Rich Felker 提交于
      these were overlooked during review. bits headers are not allowed to
      pull in additional headers (note: that rule is currently broken in
      other places but just for endian.h). string.h has no place here
      anyway, and including bits/alltypes.h without defining macros to
      request types from it is a nop.
      62a73d96
  10. 11 7月, 2019 1 次提交
  11. 02 7月, 2019 1 次提交
    • S
      add new syscall numbers from linux v5.1 · f3f96f2d
      Szabolcs Nagy 提交于
      syscall numbers are now synced up across targets (starting from 403 the
      numbers are the same on all targets other than an arch specific offset)
      
      IPC syscalls sem*, shm*, msg* got added where they were missing (except
      for semop: only semtimedop got added), the new semctl, shmctl, msgctl
      imply IPC_64, see
      
        linux commit 0d6040d4681735dfc47565de288525de405a5c99
        arch: add split IPC system calls where needed
      
      new 64bit time_t syscall variants got added on 32bit targets, see
      
        linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
        y2038: add 64-bit time_t syscalls to all 32-bit architectures
      
      new async io syscalls got added, see
      
        linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
        Add io_uring IO interface
      
        linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
        io_uring: add support for pre-mapped user IO buffers
      
      a new syscall got added that uses the fd of /proc/<pid> as a stable
      handle for processes: allows sending signals without pid reuse issues,
      intended to eventually replace rt_sigqueueinfo, kill, tgkill and
      rt_tgsigqueueinfo, see
      
        linux commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
        signal: add pidfd_send_signal() syscall
      
      on some targets (arm, m68k, s390x, sh) some previously missing syscall
      numbers got added as well.
      f3f96f2d
  12. 08 2月, 2019 1 次提交
  13. 10 12月, 2018 1 次提交
  14. 18 7月, 2018 1 次提交
    • 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
  15. 27 6月, 2018 1 次提交
  16. 20 6月, 2018 1 次提交
  17. 11 3月, 2018 1 次提交
    • R
      fix minor namespace issues in termios.h · eb5ae940
      Rich Felker 提交于
      the output delay features (NL*, CR*, TAB*, BS*, and VT*) are
      XSI-shaded. VT* is in the V* namespace reservation but the rest need
      to be suppressed in base POSIX namespace.
      
      unfortunately this change introduces feature test macro checks into
      another bits header. at some point these checks should be simplified
      by having features.h handle the "FTM X implies Y" relationships.
      eb5ae940
  18. 23 2月, 2018 2 次提交
    • 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
      mips,powerpc: fix TIOCSER_TEMT in termios.h · 9eda4dc6
      Szabolcs Nagy 提交于
      use the same token to define TIOCSER_TEMT as is used in ioctl.h
      so when both headers are included there are no redefinition warnings
      during musl build.
      9eda4dc6
  19. 06 11月, 2017 2 次提交
  20. 07 9月, 2017 1 次提交
    • S
      make syscall.h consistent with linux · 822dddfb
      Szabolcs Nagy 提交于
      most of the found naming differences don't matter to musl, because
      internally it unifies the syscall names that vary across targets,
      but for external code the names should match the kernel uapi.
      
      aarch64:
      	__NR_fstatat is called __NR_newfstatat in linux.
      	__NR_or1k_atomic got mistakenly copied from or1k.
      arm:
      	__NR_arm_sync_file_range is an alias for __NR_sync_file_range2
      	__NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux,
      	the old non-arm name is kept too, it should not cause issues.
      	(powerpc has similar nonstandard fadvise and it uses the
      	normal name.)
      i386:
      	__NR_madvise1 was removed from linux in commit
      	303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11
      microblaze:
      	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite
      	had different name in linux.
      mips:
      	__NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select
      	had different name in linux.
      mipsn32:
      	__NR_fstatat is called __NR_newfstatat in linux.
      or1k:
      	__NR__llseek is called __NR_llseek in linux.
      	the old name is kept too because that's the name musl uses
      	internally.
      powerpc:
      	__NR_{get,set}res{gid,uid}32 was never present in powerpc linux.
      	__NR_timerfd was briefly defined in linux but then got renamed.
      822dddfb
  21. 30 8月, 2017 2 次提交
  22. 30 12月, 2016 1 次提交
  23. 20 10月, 2016 1 次提交
    • S
      add bits/hwcap.h and include it in sys/auxv.h · fe39aaae
      Szabolcs Nagy 提交于
      aarch64, arm, mips, mips64, mipsn32, powerpc, powerpc64 and sh have
      cpu feature bits defined in linux for AT_HWCAP auxv entry, so expose
      those in sys/auxv.h
      
      it seems the mips hwcaps were never exposed to userspace neither
      by linux nor by glibc, but that's most likely an oversight.
      fe39aaae
  24. 14 7月, 2016 1 次提交
  25. 04 7月, 2016 5 次提交