1. 15 9月, 2018 4 次提交
    • B
      improve error handling of ttyname_r and isatty · c8497199
      Benjamin Peterson 提交于
      POSIX allows ttyname(_r) and isatty to return EBADF if passed file
      descriptor is invalid.
      
      maintainer's note: these are optional ("may fail") errors, but it's
      non-conforming for ttyname_r to return ENOTTY when it failed for a
      different reason.
      c8497199
    • R
      add hidden version of &errno accessor function · e13063aa
      Rich Felker 提交于
      this significantly improves codegen in functions that need to access
      errno but otherwise have no need for a GOT pointer.
      
      we could probably improve it much more by including an inline version
      of the &errno accessor function, but that depends on having the
      definitions of struct __pthread and __pthread_self(), which at present
      would expose a lot more than is appropriate. moving them to a small
      tls.h later might make this more reasonable.
      e13063aa
    • R
      fix build regression in sysconf for archs with variable page size · da55d488
      Rich Felker 提交于
      commit 5ce37379 removed the inclusion
      of libc.h from this file as spurious, but it's needed to get PAGE_SIZE
      on archs where PAGE_SIZE is not a constant defined by limits.h.
      da55d488
    • R
      drop lazy plural forms init in dcngettext · 017e67dd
      Rich Felker 提交于
      there is no good reason to wait to find and process the plural rules
      for a translated message file until a gettext form requesting plural
      rule processing is used. it just imposes additional synchronization,
      here in the form of clunky use of atomics.
      
      it looks like there may also have been a race condition where nplurals
      could be seen without plural_rule being seen, possibly leading to null
      pointer dereference. if so, this commit fixes it.
      017e67dd
  2. 14 9月, 2018 1 次提交
    • R
      fix broken atomic store on powerpc[64] · 12817793
      Rich Felker 提交于
      in our memory model, all atomics are supposed to be full barriers;
      stores are not release-only. this is important because store is used
      as an unlock operation in places where it needs to acquire the waiter
      count to determine if a futex wake is needed. at least in the
      malloc-internal locks, but possibly elsewhere, soft deadlocks from
      missing futex wake (breakable by poking the threads to restart the
      syscall, e.g. by attaching a tracer) were reported to occur.
      
      once the malloc lock is replaced with Jens Gustedt's new lock
      implementation (see commit 47d0bcd4),
      malloc will not be affected by the issue, but it's not clear that
      other uses won't be. reducing the strength of the ordering properties
      required from a_store would require a thorough analysis of how it's
      used.
      
      to fix the problem, I'm removing the powerpc[64]-specific a_store
      definition; now, the top-level atomic.h will implement a_store using
      a_barrier on both sides of the store.
      
      it's not clear to me yet whether there might be issues with the other
      atomics. it's possible that a_post_llsc needs to be replaced with a
      full barrier to guarantee the formal semanics we want, but either way
      I think the difference is unlikely to impact the way we use them.
      12817793
  3. 13 9月, 2018 35 次提交