1. 02 5月, 2015 2 次提交
  2. 18 4月, 2015 4 次提交
  3. 02 4月, 2015 2 次提交
    • R
      remove macro definition of longjmp from setjmp.h · 5e25d87b
      Rich Felker 提交于
      the C standard specifies that setjmp is a macro, but longjmp is a
      normal function. a macro version of it would be permitted (albeit
      useless) for C (not C++), but would have to be a function-like macro,
      not an object-like one.
      5e25d87b
    • R
      move O_PATH definition back to arch bits · fd427c4e
      Rich Felker 提交于
      while it's the same for all presently supported archs, it differs at
      least on sparc, and conceptually it's no less arch-specific than the
      other O_* macros. O_SEARCH and O_EXEC are still defined in terms of
      O_PATH in the main fcntl.h.
      fd427c4e
  4. 23 3月, 2015 1 次提交
    • R
      fix FLT_ROUNDS regression in C++ applications · 11d1e2e2
      Rich Felker 提交于
      commit 559de8f5 redefined FLT_ROUNDS
      to use an external function that can report the actual current
      rounding mode, rather than always reporting round-to-nearest. however,
      float.h did not include 'extern "C"' wrapping for C++, so C++ programs
      using FLT_ROUNDS ended up with an unresolved reference to a
      name-mangled C++ function __flt_rounds.
      11d1e2e2
  5. 18 3月, 2015 1 次提交
    • R
      fix MINSIGSTKSZ values for archs with large signal contexts · d5a50453
      Rich Felker 提交于
      the previous values (2k min and 8k default) were too small for some
      archs. aarch64 reserves 4k in the signal context for future extensions
      and requires about 4.5k total, and powerpc reportedly uses over 2k.
      the new minimums are chosen to fit the saved context and also allow a
      minimal signal handler to run.
      
      since the default (SIGSTKSZ) has always been 6k larger than the
      minimum, it is also increased to maintain the 6k usable by the signal
      handler. this happens to be able to store one pathname buffer and
      should be sufficient for calling any function in libc that doesn't
      involve conversion between floating point and decimal representations.
      
      x86 (both 32-bit and 64-bit variants) may also need a larger minimum
      (around 2.5k) in the future to support avx-512, but the values on
      these archs are left alone for now pending further analysis.
      
      the value for PTHREAD_STACK_MIN is not increased to match MINSIGSTKSZ
      at this time. this is so as not to preclude applications from using
      extremely small thread stacks when they know they will not be handling
      signals. unfortunately cancellation and multi-threaded set*id() use
      signals as an implementation detail and therefore require a stack
      large enough for a signal context, so applications which use extremely
      small thread stacks may still need to avoid using these features.
      d5a50453
  6. 08 3月, 2015 1 次提交
  7. 05 3月, 2015 4 次提交
  8. 04 3月, 2015 1 次提交
    • R
      make all objects used with atomic operations volatile · 56fbaa3b
      Rich Felker 提交于
      the memory model we use internally for atomics permits plain loads of
      values which may be subject to concurrent modification without
      requiring that a special load function be used. since a compiler is
      free to make transformations that alter the number of loads or the way
      in which loads are performed, the compiler is theoretically free to
      break this usage. the most obvious concern is with atomic cas
      constructs: something of the form tmp=*p;a_cas(p,tmp,f(tmp)); could be
      transformed to a_cas(p,*p,f(*p)); where the latter is intended to show
      multiple loads of *p whose resulting values might fail to be equal;
      this would break the atomicity of the whole operation. but even more
      fundamental breakage is possible.
      
      with the changes being made now, objects that may be modified by
      atomics are modeled as volatile, and the atomic operations performed
      on them by other threads are modeled as asynchronous stores by
      hardware which happens to be acting on the request of another thread.
      such modeling of course does not itself address memory synchronization
      between cores/cpus, but that aspect was already handled. this all
      seems less than ideal, but it's the best we can do without mandating a
      C11 compiler and using the C11 model for atomics.
      
      in the case of pthread_once_t, the ABI type of the underlying object
      is not volatile-qualified. so we are assuming that accessing the
      object through a volatile-qualified lvalue via casts yields volatile
      access semantics. the language of the C standard is somewhat unclear
      on this matter, but this is an assumption the linux kernel also makes,
      and seems to be the correct interpretation of the standard.
      56fbaa3b
  9. 22 2月, 2015 1 次提交
    • R
      add new masked cancellation mode · 102f6a01
      Rich Felker 提交于
      this is a new extension which is presently intended only for
      experimental and internal libc use. interface and behavior details may
      change subject to feedback and experience from using it internally.
      
      the basic concept for the new PTHREAD_CANCEL_MASKED state is that the
      first cancellation point to observe the cancellation request fails
      with an errno value of ECANCELED rather than acting on cancellation,
      allowing the caller to process the status and choose whether/how to
      act upon it.
      102f6a01
  10. 10 2月, 2015 1 次提交
    • S
      add new socket options SO_INCOMING_CPU, SO_ATTACH_BPF, SO_DETACH_BPF · 70572dce
      Szabolcs Nagy 提交于
      these socket options are new in linux v3.19, introduced in commit
      2c8c56e15df3d4c2af3d656e44feb18789f75837 and commit
      89aa075832b0da4402acebd698d0411dcc82d03e
      
      with SO_INCOMING_CPU the cpu can be queried on which a socket is
      managed inside the kernel and optimize polling of large number of
      sockets accordingly.
      
      SO_ATTACH_BPF lets eBPF programs (created by the bpf syscall) to
      be attached to sockets.
      70572dce
  11. 31 1月, 2015 1 次提交
    • T
      move MREMAP_MAYMOVE and MREMAP_FIXED out of bits · 2d67ae92
      Trutz Behn 提交于
      the definitions are generic for all kernel archs. exposure of these
      macros now only occurs on the same feature test as for the function
      accepting them, which is believed to be more correct.
      2d67ae92
  12. 23 12月, 2014 1 次提交
    • S
      add new prctl command PR_SET_MM_MAP to sys/prctl.h · 11ac2a6e
      Szabolcs Nagy 提交于
      PR_SET_MM_MAP was introduced as a subcommand for PR_SET_MM in
      linux v3.18 commit f606b77f1a9e362451aca8f81d8f36a3a112139e
      
      the associated struct type is replicated in sys/prctl.h using
      libc types.
      
      example usage:
      
       struct prctl_mm_map *p;
       ...
       prctl(PR_SET_MM, PR_SET_MM_MAP, p, sizeof *p);
      
      the kernel side supported struct size may be queried with
      the PR_SET_MM_MAP_SIZE subcommand.
      11ac2a6e
  13. 21 12月, 2014 3 次提交
  14. 18 12月, 2014 5 次提交
    • R
      fix signedness of WINT_MIN expression · aee9b152
      Rich Felker 提交于
      since wint_t is unsigned, WINT_MIN needs to expand to an unsigned zero.
      aee9b152
    • R
      make the definition of _Complex_I explicitly complex · a9c2294e
      Rich Felker 提交于
      it's unclear whether compilers which provide pure imaginary types
      might produce a pure imaginary expression for 1.0fi. using 0.0f+1.0fi
      ensures that the result is explicitly complex and makes this obvious
      to human readers too.
      a9c2294e
    • R
      make the result of the cimag macro a non-lvalue · 4075af43
      Rich Felker 提交于
      this change is not necessary but helps diagnose invalid code. based on
      patch by Jens Gustedt.
      4075af43
    • R
      fix definition of CMPLX macros in complex.h to work in constant expressions · 5ff2a118
      Rich Felker 提交于
      based on patches by Jens Gustedt. these macros need to be usable in
      static initializers, and the old definitions were not.
      
      there is no portable way to provide correct definitions for these
      macros unless the compiler supports pure imaginary types. a portable
      definition is provided for this case even though there are presently
      no compilers that can use it. gcc and compatible compilers provide a
      builtin function that can be used, but clang fails to support this and
      instead requires a construct which is a constraint violation and which
      is only a constant expression as a clang-specific extension.
      
      since these macros are a namespace violation in pre-C11 profiles, and
      since no known pre-C11 compilers provide any way to define them
      correctly anyway, the definitions have been made conditional on C11.
      5ff2a118
    • R
      add basic dns record parsing functions · aac59c11
      Rich Felker 提交于
      based on patch by Timo Teräs, with some corrections to bounds checking
      code and other minor changes.
      
      while they are borderline scope creep, the functions added are fairly
      small and are roughly the minimum code needed to use the results of
      the res_query API without re-implementing error-prone DNS packet
      parsing, and they are used in practice by some kerberos related
      software and possibly other things. at this time there is no intent to
      implement further nameser.h API functions.
      aac59c11
  15. 10 12月, 2014 1 次提交
    • B
      don't shadow functions with macros in C++ · f164875a
      Bobby Bingham 提交于
      C++ programmers typically expect something like "::function(x,y)" to work
      and may be surprised to find that "(::function)(x,y)" is actually required
      due to the headers declaring a macro version of some standard functions.
      
      We already omit function-like macros for C++ in most cases where there is
      a real function available. This commit extends this to the remaining
      function-like macros which have a real function version.
      f164875a
  16. 15 10月, 2014 1 次提交
  17. 14 10月, 2014 1 次提交
  18. 08 10月, 2014 2 次提交
    • S
      add new linux file sealing api to fcntl.h · a3763d64
      Szabolcs Nagy 提交于
      new in linux v3.17 commit 40e041a2c858b3caefc757e26cb85bfceae5062b
      sealing allows some operations to be blocked on a file which makes
      file access safer when fds are shared between processes (only
      supported for shared mem fds currently)
      
      flags:
      F_SEAL_SEAL prevents further sealing
      F_SEAL_SHRINK prevents file from shrinking
      F_SEAL_GROW prevents file from growing
      F_SEAL_WRITE prevents writes
      
      fcntl commands:
      F_GET_SEALS get the current seal flags
      F_ADD_SEALS add new seal flags
      a3763d64
    • S
      add new IPV6_AUTOFLOWLABEL socket option in netinet/in.h · a0c90b97
      Szabolcs Nagy 提交于
      added in linux v3.17 commit 753a2ad54ef45e3417a9d49537c2b42b04a2e1be
      enables automatic flow label generation on transmit
      a0c90b97
  19. 11 9月, 2014 3 次提交
    • R
      add _DEFAULT_SOURCE feature profile as an alias for _BSD_SOURCE · 5edbc6fe
      Rich Felker 提交于
      as a result of commit ab8f6a6e, this
      definition is now equivalent to the actual "default profile" which
      appears immediately below in features.h, and which defines both
      _BSD_SOURCE and _XOPEN_SOURCE.
      
      the intent of providing a _DEFAULT_SOURCE, which glibc also now
      provides, is to give applications a way to "get back" the default
      feature profile when it was lost either by compiler flags that inhibit
      it (such as -std=c99) or by library-provided predefined macros (such
      as -D_POSIX_C_SOURCE=200809L) which may inhibit exposure of features
      that were otherwise visible by default and which the application may
      need. without _DEFAULT_SOURCE, the application had encode knowledge of
      a particular libc's defaults, and such knowledge was fragile and
      subject to bitrot.
      
      eventually the names _GNU_SOURCE and _BSD_SOURCE should be phased out
      in favor of the more-descriptive and more-accurate _ALL_SOURCE and
      _DEFAULT_SOURCE, leaving the old names as aliases but using the new
      ones internally. however this is a more invasive change that would
      require extensive regression testing, so it is deferred.
      5edbc6fe
    • R
      fix _ALL_SOURCE logic to avoid possible redefinition of _GNU_SOURCE · f929493c
      Rich Felker 提交于
      this could be an error if _GNU_SOURCE was already defined differently
      by the application.
      f929493c
    • R
      fix places where _BSD_SOURCE failed to yield a superset of _XOPEN_SOURCE · ab8f6a6e
      Rich Felker 提交于
      the vast majority of these failures seem to have been oversights at
      the time _BSD_SOURCE was added, or perhaps shortly afterward. the one
      which may have had some reason behind it is omission of setpgrp from
      the _BSD_SOURCE feature profile, since the standard setpgrp interface
      conflicts with a legacy (pre-POSIX) BSD interface by the same name.
      however, such omission is not aligned with our general policy in this
      area (for example, handling of similar _GNU_SOURCE cases) and should
      not be preserved.
      ab8f6a6e
  20. 08 9月, 2014 1 次提交
    • S
      add new F_OFD_* macros to fcntl.h (open file description locks) · 976bb28f
      Szabolcs Nagy 提交于
      open file description locks are inherited across fork and only auto
      dropped after the last fd of the file description is closed, they can be
      used to synchronize between threads that open separate file descriptions
      for the same file.
      
      new in linux 3.15 commit 0d3f7a2dd2f5cf9642982515e020c1aee2cf7af6
      976bb28f
  21. 07 9月, 2014 2 次提交
    • R
      add threads.h and needed per-arch types for mtx_t and cnd_t · b7cf71a1
      Rich Felker 提交于
      based on patch by Jens Gustedt.
      
      mtx_t and cnd_t are defined in such a way that they are formally
      "compatible types" with pthread_mutex_t and pthread_cond_t,
      respectively, when accessed from a different translation unit. this
      makes it possible to implement the C11 functions using the pthread
      functions (which will dereference them with the pthread types) without
      having to use the same types, which would necessitate either namespace
      violations (exposing pthread type names in threads.h) or incompatible
      changes to the C++ name mangling ABI for the pthread types.
      
      for the rest of the types, things are much simpler; using identical
      types is possible without any namespace considerations.
      b7cf71a1
    • R
      add C11 timespec_get function, with associated time.h changes for C11 · 6eb19505
      Rich Felker 提交于
      based on patch by Jens Gustedt for inclusion with C11 threads
      implementation, but committed separately since it's independent of
      threads.
      6eb19505
  22. 06 9月, 2014 1 次提交