1. 31 8月, 2020 1 次提交
  2. 19 8月, 2020 1 次提交
  3. 18 8月, 2020 1 次提交
  4. 17 8月, 2020 1 次提交
  5. 13 2月, 2020 1 次提交
    • R
      fix remaining direct use of stat syscalls outside fstatat.c · c9ebff47
      Rich Felker 提交于
      because struct stat is no longer assumed to correspond to the
      structure used by the stat-family syscalls, it's not valid to make any
      of these syscalls directly using a buffer of type struct stat.
      
      commit 94938920 moved all logic around
      this change for stat-family functions into fstatat.c, making the
      others wrappers for it. but a few other direct uses of the syscall
      were overlooked. the ones in tmpnam/tempnam are harmless since the
      syscalls are just used to test for file existence. however, the uses
      in fchmodat and __map_file depend on getting accurate file properties,
      and these functions may actually have been broken one or more mips
      variants due to removal of conversion hacks from syscall_arch.h.
      
      as a low-risk fix, simply use struct kstat in place of struct stat in
      the affected places.
      c9ebff47
  6. 07 2月, 2020 5 次提交
  7. 05 2月, 2020 3 次提交
  8. 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
  9. 28 1月, 2020 1 次提交
  10. 17 1月, 2020 1 次提交
    • A
      add thumb2 support to arm assembler memcpy · 91e662d1
      Andre McCurdy 提交于
      For Thumb2 compatibility, replace two instances of a single
      instruction "orr with a variable shift" with the two instruction
      equivalent. Neither of the replacements are in a performance critical
      loop.
      91e662d1
  11. 02 1月, 2020 1 次提交
  12. 01 1月, 2020 1 次提交
  13. 23 12月, 2019 2 次提交
  14. 22 12月, 2019 1 次提交
  15. 21 12月, 2019 1 次提交
  16. 20 12月, 2019 1 次提交
    • R
      add further ioctl time64 fallback conversions · 2412638b
      Rich Felker 提交于
      this commit covers all remaining ioctls I'm aware of that use
      time_t-derived types in their interfaces. it may still be incomplete,
      and has undergone only minimal testing for a few commands used in
      audio playback.
      
      the SNDRV_PCM_IOCTL_SYNC_PTR command is special-cased because, rather
      than the whole structure expanding, it has two substructures each
      padded to 64 bytes that expand within their own 64-byte reserved zone.
      as long as it's the only one of its type, it doesn't really make sense
      to make a general framework for it, but the existing table framework
      is still used for the substructures in the special-case. one of the
      substructures, snd_pcm_mmap_status, has a snd_pcm_uframes_t member
      which is not a timestamp but is expanded just like one, to match the
      64-bit-arch version of the structure. this is handled just like a
      timestamp at offset 8, and is the motivation for the conversions table
      holding offsets of individual values to be expanded rather than
      timespec/timeval type pairs.
      
      for some of the types, the size to which they expand is dependent on
      whether the arch's ABI aligns 8-byte types on 8-byte boundaries.
      new_req entries in the table need to reflect this size to get the
      right ioctl request number that will match what callers pass, but we
      don't have access to the actual structure type definitions here and
      duplicating them would be cumbersome. instead, the new_misaligned
      macro introduced here constructs an artificial object whose size is
      the result of expanding a misaligned timespec/timeval to 64-bit and
      imposing the arch's alignment on the result, which can be passed to
      the _IO{R,W,WR} macros.
      2412638b
  17. 19 12月, 2019 2 次提交
    • R
      improve ioctl time64 conversion fallback framework · 64d0e865
      Rich Felker 提交于
      record offsets of individual slots that expand from 32- to 64-bit,
      rather than timespec/timeval pairs. this flexibility will be needed
      for some ioctls. reduce size of types in table. adjust representation
      of offsets to include a count rather than needing -1 padding so that
      the table is less ugly and doesn't need large diffs if we increase max
      number of slots.
      64d0e865
    • R
      convert ioctl time64 fallbacks to table-driven framework · 221b1a1d
      Rich Felker 提交于
      with the current set of supported ioctls, this conversion is hardly an
      improvement, but it sets the stage for being able to do alsa, v4l2,
      ppp, and other ioctls with timespec/timeval-derived types. without
      this capability, a lot of functionality users depend on would stop
      working with the time64 switchover.
      221b1a1d
  18. 18 12月, 2019 2 次提交
    • R
      hook recvmmsg up to SO_TIMESTAMP[NS] fallback for pre-time64 kernels · 114178dc
      Rich Felker 提交于
      always try the time64 syscall first since we can use its success to
      conclude that no conversion is needed (any setsockopt for the
      timestamp options would have succeeded without need for fallbacks).
      otherwise, we have to remember the original controllen for each
      msghdr, requiring O(vlen) space, so vlen must be bounded. linux clamps
      it to IOV_MAX for sendmmsg only (not recvmmsg), but doing the same for
      recvmmsg is not unreasonable, especially since the limitation will
      only apply to old kernels.
      
      we could optimize to avoid trying SYS_recvmmsg_time64 first if all
      msghdrs have controllen zero, or support unlimited vlen by looping and
      emulating the timeout logic, but I'm not inclined to do complex and
      error-prone optimizations on a function that has so many underlying
      problems it should really never be used.
      114178dc
    • R
      implement SO_TIMESTAMP[NS] fallback for kernels without time64 versions · ae388bec
      Rich Felker 提交于
      the definitions of SO_TIMESTAMP* changed on 32-bit archs in commit
      38143339 to the new versions that
      provide 64-bit versions of timeval/timespec structure in control
      message payload. socket options, being state attached to the socket
      rather than function calls, are not trivial to implement as fallbacks
      on ENOSYS, and support for them was initially omitted on the
      assumption that the ioctl-based polling alternatives (SIOCGSTAMP*)
      could be used instead by applications if setsockopt fails.
      
      unfortunately, it turns out that SO_TIMESTAMP is sufficiently old and
      widely supported that a number of applications assume it's available
      and treat errors as fatal.
      
      this patch introduces emulation of SO_TIMESTAMP[NS] on pre-time64
      kernels by falling back to setting the "_OLD" (time32) versions of the
      options if the time64 ones are not recognized, and performing
      translation of the SCM_TIMESTAMP[NS] control messages in recvmsg.
      since recvmsg does not know whether its caller is legacy time32 code
      or time64, it performs translation for any SCM_TIMESTAMP[NS]_OLD
      control messages it sees, leaving the original time32 timestamp as-is
      (it can't be rewritten in-place anyway, and memmove would be mildly
      expensive) and appending the converted time64 control message at the
      end of the buffer. legacy time32 callers will see the converted one as
      a spurious control message of unknown type; time64 callers running on
      pre-time64 kernels will see the original one as a spurious control
      message of unknown type. a time64 caller running on a kernel with
      native time64 support will only see the time64 version of the control
      message.
      
      emulation of SO_TIMESTAMPING is not included at this time since (1)
      applications which use it seem to be prepared for the possibility that
      it's not present or working, and (2) it can also be used in sendmsg
      control messages, in a manner that looks complex to emulate
      completely, and costly even when running on a time64-supporting
      kernel.
      
      corresponding changes in recvmmsg are not made at this time; they will
      be done separately.
      ae388bec
  19. 08 12月, 2019 2 次提交
  20. 06 11月, 2019 1 次提交
  21. 03 11月, 2019 2 次提交
  22. 29 10月, 2019 2 次提交
    • R
      make fstatat fill in old time32 stat fields too · 0961bb94
      Rich Felker 提交于
      here _REDIR_TIME64 is used as an indication that there's an old ABI,
      and thereby the old time32 timespec fields of struct stat.
      
      keeping struct stat compatible and providing both versions of the
      timespec fields is done so that ftw/nftw does not need painful compat
      shims, and (more importantly) so that similar interfaces between pairs
      of libc consumers (applications/libraries) will be less likely to
      break when one has been rebuilt for time64 but the other has not.
      0961bb94
    • R
      disable lfs64 aliases for remapped time64 functions · 50018f92
      Rich Felker 提交于
      these functions cannot provide the glibc lfs64-ABI-compatible symbols
      when time_t differs from what it was in that ABI. instead, the aliases
      need to be provided by the time32 compat shims or through some other
      mechanism.
      50018f92
  23. 26 10月, 2019 4 次提交
    • R
      update case mappings to unicode 12.1.0 · 06d4075a
      Rich Felker 提交于
      06d4075a
    • U
      update ctype data to unicode 12.1.0 · e95538fa
      u_quark 提交于
      e95538fa
    • R
      overhaul wide character case mapping implementation · a11a6246
      Rich Felker 提交于
      the existing implementation of case mappings was very small (typically
      around 1.5k), but unmaintainable, requiring manual addition of new
      case mappings with each new edition of Unicode. often, it turned out
      that newly-added case mappings were not easily representable in the
      existing tightly-constrained table structures, requiring new hacks to
      be invented and delaying support for new characters.
      
      the new implementation added here follows the pattern used for
      character class membership, with a two-level table allowing Unicode
      blocks for which no data is needed to be elided. however, rather than
      single-bit data, each character maps to a one of up to 6 case-mapping
      rules available to its block, where 6 is floor(cbrt(256)) and allow 3
      characters to be represented per byte (vs 8 with bit tables). blocks
      that would need more than 6 rules designate one as an exception and
      let lookup pass into a binary search of exceptional cases for the
      block.
      
      the number 6 was chosen empirically; many blocks would be ok with 4
      rules (uncased, lower, upper, possible exceptions), some even just
      with 2, but the latter are rare and fitting 4 characters per byte
      rather than 3 does not save significant space. moreover, somewhat
      surprisingly, there are sufficiently many blocks where even 4 rules
      don't suffice without a lot of exceptions (blocks where some case
      pairs are laced, others offset) that originally I was looking at
      supporting variable-width tables, with 1-, 2-, or 3-bit entries,
      thereby allowing blocks with 8 rules. as implemented in my
      experiments, that version was significantly larger and involved more
      memory accesses/cache lines.
      
      improvements in size at the expense of some performance might be
      possible by utilizing iswalpha data or merging the table of case
      mapping identity with alphabetic identity. these were explored
      somewhat when the code was first written, and might be worth
      revisiting in the future.
      a11a6246
    • R
      add missing case mapping between U+03F3 and U+037F · e8aba58a
      Rich Felker 提交于
      somehow this seems to have been overlooked. add it now so that
      subsequent overhaul of case mapping implementation will not introduce
      a functional change at the same time.
      e8aba58a
  24. 24 10月, 2019 1 次提交
  25. 20 10月, 2019 1 次提交
    • R
      clock_adjtime: generalize time64 not to assume old struct layout match · 928674dc
      Rich Felker 提交于
      commit 2b4fd6f7 added time64 for this
      function, but did so with a hidden assumption that the new time64
      version of struct timex will be layout-compatible with the old one.
      however, there is little benefit to doing it that way, and the cost is
      permanent special-casing of 32-bit archs with 64-bit time_t in the
      public interface definitions.
      
      instead, do a full translation of the structure going in and out. this
      commit is actually a revision to an earlier uncommited version of the
      code.
      928674dc