1. 28 7月, 2013 2 次提交
    • R
      fix semantically incorrect use of LC_GLOBAL_LOCALE · 1ae4bc42
      Rich Felker 提交于
      LC_GLOBAL_LOCALE refers to the global locale, controlled by setlocale,
      not the thread-local locale in effect which these functions should be
      using. neither LC_GLOBAL_LOCALE nor 0 has an argument to the *_l
      functions has behavior defined by the standard, but 0 is a more
      logical choice for requesting the callee to lookup the current locale.
      in the future I may move the current locale lookup the the caller (the
      non-_l-suffixed wrapper).
      
      at this point, all of the locale logic is dummied out, so no harm was
      done, but it should at least avoid misleading usage.
      1ae4bc42
    • R
      reorder strftime to eliminate the incorrect indention level · d53b1f82
      Rich Felker 提交于
      this change is in preparation for possibly adding support for the
      field width and padding specifiers added in POSIX 2008.
      d53b1f82
  2. 25 7月, 2013 3 次提交
  3. 17 7月, 2013 3 次提交
  4. 29 6月, 2013 3 次提交
  5. 08 6月, 2013 1 次提交
    • R
      support cputime clocks for processes/threads other than self · ea200e38
      Rich Felker 提交于
      apparently these features have been in Linux for a while now, so it
      makes sense to support them. the bit twiddling seems utterly illogical
      and wasteful, especially the negation, but that's how the kernel folks
      chose to encode pids/tids into the clock id.
      ea200e38
  6. 24 5月, 2013 1 次提交
    • R
      fix overflow behavior of clock() function · 05453b37
      Rich Felker 提交于
      per Austin Group interpretation for issue #686, which cites the
      requirements of ISO C, clock() cannot wrap. if the result is not
      representable, it must return (clock_t)-1. in addition, the old code
      was performing wrapping via signed overflow and thus invoking
      undefined behavior.
      
      since it seems impossible to accurately check for overflow with the
      old times()-based fallback code, I have simply dropped the fallback
      code for now, thus always returning -1 on ancient systems. if there's
      a demand for making it work and somebody comes up with a way, it could
      be reinstated, but the clock() function is essentially useless on
      32-bit system anyway (it overflows in less than an hour).
      
      it should be noted that I used LONG_MAX rather than ULONG_MAX, despite
      32-bit archs using an unsigned type for clock_t. this discrepency with
      the glibc/LSB type definitions will be fixed now; since wrapping of
      clock_t is no longer supported, there's no use in it being unsigned.
      05453b37
  7. 06 5月, 2013 2 次提交
    • R
      fix incorrect clock tick scaling in fallback case of clock() · da49b872
      Rich Felker 提交于
      since CLOCKS_PER_SEC is 1000000 (required by XSI) and the times
      syscall reports values in 1/100 second units (Linux), the correct
      scaling factor is 10000, not 100. note that only ancient kernels which
      lack clock_gettime are affected.
      da49b872
    • R
      do not interpret errors in return value of times() syscall · 9293b765
      Rich Felker 提交于
      all return values are valid, and on 32-bit systems, values that look
      like errors can and will occur. since the only actual error this
      function could return is EFAULT, and it is only returnable when the
      application has invoked undefined behavior, simply ignore the
      possibility that the return value is actually an error code.
      9293b765
  8. 07 4月, 2013 1 次提交
  9. 02 4月, 2013 1 次提交
  10. 27 3月, 2013 1 次提交
    • R
      remove __SYSCALL_SSLEN arch macro in favor of using public _NSIG · ccc7b4c3
      Rich Felker 提交于
      the issue at hand is that many syscalls require as an argument the
      kernel-ABI size of sigset_t, intended to allow the kernel to switch to
      a larger sigset_t in the future. previously, each arch was defining
      this size in syscall_arch.h, which was redundant with the definition
      of _NSIG in bits/signal.h. as it's used in some not-quite-portable
      application code as well, _NSIG is much more likely to be recognized
      and understood immediately by someone reading the code, and it's also
      shorter and less cluttered.
      
      note that _NSIG is actually 65/129, not 64/128, but the division takes
      care of throwing away the off-by-one part.
      ccc7b4c3
  11. 02 2月, 2013 1 次提交
  12. 27 1月, 2013 1 次提交
  13. 09 11月, 2012 1 次提交
    • R
      clean up sloppy nested inclusion from pthread_impl.h · efd4d87a
      Rich Felker 提交于
      this mirrors the stdio_impl.h cleanup. one header which is not
      strictly needed, errno.h, is left in pthread_impl.h, because since
      pthread functions return their error codes rather than using errno,
      nearly every single pthread function needs the errno constants.
      
      in a few places, rather than bringing in string.h to use memset, the
      memset was replaced by direct assignment. this seems to generate much
      better code anyway, and makes many functions which were previously
      non-leaf functions into leaf functions (possibly eliminating a great
      deal of bloat on some platforms where non-leaf functions require ugly
      prologue and/or epilogue).
      efd4d87a
  14. 30 9月, 2012 1 次提交
  15. 07 9月, 2012 1 次提交
    • R
      use restrict everywhere it's required by c99 and/or posix 2008 · 400c5e5c
      Rich Felker 提交于
      to deal with the fact that the public headers may be used with pre-c99
      compilers, __restrict is used in place of restrict, and defined
      appropriately for any supported compiler. we also avoid the form
      [restrict] since older versions of gcc rejected it due to a bug in the
      original c99 standard, and instead use the form *restrict.
      400c5e5c
  16. 10 8月, 2012 1 次提交
    • R
      fix (hopefully) all hard-coded 8's for kernel sigset_t size · 2f437040
      Rich Felker 提交于
      some minor changes to how hard-coded sets for thread-related purposes
      are handled were also needed, since the old object sizes were not
      necessarily sufficient. things have gotten a bit ugly in this area,
      and i think a cleanup is in order at some point, but for now the goal
      is just to get the code working on all supported archs including mips,
      which was badly broken by linux rejecting syscalls with the wrong
      sigset_t size.
      2f437040
  17. 14 6月, 2012 1 次提交
  18. 24 5月, 2012 1 次提交
    • R
      linux deprecated SYS_utime on some archs, so use SYS_utimes instead · c37afdfd
      Rich Felker 提交于
      the old code could be kept for cases where SYS_utime is available, but
      it's not really worth the ifdef ugliness. and better to avoid
      deprecated stuff just in case the kernel devs ever get crazy enough to
      start removing it from archs where it was part of the ABI and breaking
      static bins...
      c37afdfd
  19. 25 4月, 2012 1 次提交
    • R
      ditch the priority inheritance locks; use malloc's version of lock · 4750cf42
      Rich Felker 提交于
      i did some testing trying to switch malloc to use the new internal
      lock with priority inheritance, and my malloc contention test got
      20-100 times slower. if priority inheritance futexes are this slow,
      it's simply too high a price to pay for avoiding priority inversion.
      maybe we can consider them somewhere down the road once the kernel
      folks get their act together on this (and perferably don't link it to
      glibc's inefficient lock API)...
      
      as such, i've switch __lock to use malloc's implementation of
      lightweight locks, and updated all the users of the code to use an
      array with a waiter count for their locks. this should give optimal
      performance in the vast majority of cases, and it's simple.
      
      malloc is still using its own internal copy of the lock code because
      it seems to yield measurably better performance with -O3 when it's
      inlined (20% or more difference in the contention stress test).
      4750cf42
  20. 02 3月, 2012 3 次提交
  21. 29 2月, 2012 1 次提交
  22. 26 9月, 2011 1 次提交
    • R
      cleanup various minor issues reported by nsz · fd142e5e
      Rich Felker 提交于
      the changes to syscall_ret are mostly no-ops in the generated code,
      just cleanup of type issues and removal of some implementation-defined
      behavior. the one exception is the change in the comparison value,
      which is fixed so that 0xf...f000 (which in principle could be a valid
      return value for mmap, although probably never in reality) is not
      treated as an error return.
      fd142e5e
  23. 17 9月, 2011 1 次提交
  24. 14 9月, 2011 1 次提交
  25. 06 9月, 2011 1 次提交
  26. 16 8月, 2011 1 次提交
    • R
      partially working strptime · 47a8816d
      Rich Felker 提交于
      it's missing at least:
      - derived fields
      - week numbers
      - short year (without century) support
      - locale modifiers
      47a8816d
  27. 13 8月, 2011 2 次提交
    • R
      fix missing include in last commit · ef9dd035
      Rich Felker 提交于
      ef9dd035
    • R
      fix clock() function · ad575982
      Rich Felker 提交于
      it previously was returning the pseudo-monotonic-realtime clock
      returned by times() rather than process cputime. it also violated C
      namespace by pulling in times().
      
      we now use clock_gettime() if available because times() has
      ridiculously bad resolution. still provide a fallback for ancient
      kernels without clock_gettime.
      ad575982
  28. 12 8月, 2011 2 次提交