1. 02 4月, 2015 1 次提交
    • 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
  2. 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
  3. 08 3月, 2015 1 次提交
  4. 05 3月, 2015 1 次提交
    • T
      fix POLLWRNORM and POLLWRBAND on mips · f5011c62
      Trutz Behn 提交于
      these macros have the same distinct definition on blackfin, frv, m68k,
      mips, sparc and xtensa kernels. POLLMSG and POLLRDHUP additionally
      differ on sparc.
      f5011c62
  5. 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
  6. 10 2月, 2015 1 次提交
    • S
      add syscall numbers for the new execveat syscall · f54c28cb
      Szabolcs Nagy 提交于
      this syscall allows fexecve to be implemented without /proc, it is new
      in linux v3.19, added in commit 51f39a1f0cea1cacf8c787f652f26dfee9611874
      (sh and microblaze do not have allocated syscall numbers yet)
      
      added a x32 fix as well: the io_setup and io_submit syscalls are no
      longer common with x86_64, so use the x32 specific numbers.
      f54c28cb
  7. 08 2月, 2015 1 次提交
    • S
      remove cruft from x86_64 syscall.h · e63833cd
      Szabolcs Nagy 提交于
      x86_64 syscall.h defined some musl internal syscall names and made
      them public. These defines were already moved to src/internal/syscall.h
      (except for SYS_fadvise which is added now) so the cruft in x86_64
      syscall.h is not needed.
      e63833cd
  8. 02 2月, 2015 1 次提交
  9. 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
  10. 23 12月, 2014 1 次提交
    • S
      add new syscall numbers for bpf and kexec_file_load · f90fafea
      Szabolcs Nagy 提交于
      these syscalls are new in linux v3.18, bpf is present on all
      supported archs except sh, kexec_file_load is only allocted for
      x86_64 and x32 yet.
      
      bpf was added in linux commit 99c55f7d47c0dc6fc64729f37bf435abf43f4c60
      
      kexec_file_load syscall number was allocated in commit
      f0895685c7fd8c938c91a9d8a6f7c11f22df58d2
      f90fafea
  11. 21 12月, 2014 1 次提交
  12. 08 10月, 2014 1 次提交
    • S
      add new syscall numbers for seccomp, getrandom, memfd_create · 4ffc39c6
      Szabolcs Nagy 提交于
      these syscalls are new in linux v3.17 and present on all supported
      archs except sh.
      
      seccomp was added in commit 48dc92b9fc3926844257316e75ba11eb5c742b2c
      it has operation, flags and pointer arguments (if flags==0 then it is
      the same as prctl(PR_SET_SECCOMP,...)), the uapi header for flag
      definitions is linux/seccomp.h
      
      getrandom was added in commit c6e9d6f38894798696f23c8084ca7edbf16ee895
      it provides an entropy source when open("/dev/urandom",..) would fail,
      the uapi header for flags is linux/random.h
      
      memfd_create was added in commit 9183df25fe7b194563db3fec6dc3202a5855839c
      it allows anon mmap to have an fd, that can be shared, sealed and needs no
      mount point, the uapi header for flags is linux/memfd.h
      4ffc39c6
  13. 07 9月, 2014 1 次提交
    • 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
  14. 21 8月, 2014 1 次提交
    • R
      add max_align_t definition for C11 and C++11 · 321f4fa9
      Rich Felker 提交于
      unfortunately this needs to be able to vary by arch, because of a huge
      mess GCC made: the GCC definition, which became the ABI, depends on
      quirks in GCC's definition of __alignof__, which does not match the
      formal alignment of the type.
      
      GCC's __alignof__ unexpectedly exposes the an implementation detail,
      its "preferred alignment" for the type, rather than the formal/ABI
      alignment of the type, which it only actually uses in structures. on
      most archs the two values are the same, but on some (at least i386)
      the preferred alignment is greater than the ABI alignment.
      
      I considered using _Alignas(8) unconditionally, but on at least one
      arch (or1k), the alignment of max_align_t with GCC's definition is
      only 4 (even the "preferred alignment" for these types is only 4).
      321f4fa9
  15. 17 8月, 2014 1 次提交
    • R
      make pointers used in robust list volatile · de7e99c5
      Rich Felker 提交于
      when manipulating the robust list, the order of stores matters,
      because the code may be asynchronously interrupted by a fatal signal
      and the kernel will then access the robust list in what is essentially
      an async-signal context.
      
      previously, aliasing considerations made it seem unlikely that a
      compiler could reorder the stores, but proving that they could not be
      reordered incorrectly would have been extremely difficult. instead
      I've opted to make all the pointers used as part of the robust list,
      including those in the robust list head and in the individual mutexes,
      volatile.
      
      in addition, the format of the robust list has been changed to point
      back to the head at the end, rather than ending with a null pointer.
      this is to match the documented kernel robust list ABI. the null
      pointer, which was previously used, only worked because faults during
      access terminate the robust list processing.
      de7e99c5
  16. 21 7月, 2014 1 次提交
  17. 31 5月, 2014 1 次提交
    • S
      add sched_{get,set}attr syscall numbers and SCHED_DEADLINE macro · fd9571e2
      Szabolcs Nagy 提交于
      linux 3.14 introduced sched_getattr and sched_setattr syscalls in
      commit d50dde5a10f305253cbc3855307f608f8a3c5f73
      
      and the related SCHED_DEADLINE scheduling policy in
      commit aab03e05e8f7e26f51dee792beddcb5cca9215a5
      
      but struct sched_attr "extended scheduling parameters data structure"
      is not yet exported to userspace (necessary for using the syscalls)
      so related uapi definitions are not added yet.
      fd9571e2
  18. 16 4月, 2014 1 次提交
    • S
      fix RLIMIT_ constants for mips · fcea534e
      Szabolcs Nagy 提交于
      The mips arch is special in that it uses different RLIMIT_
      numbers than other archs, so allow bits/resource.h to override
      the default RLIMIT_ numbers (empty on all archs except mips).
      Reported by orc.
      fcea534e
  19. 19 3月, 2014 2 次提交
  20. 12 3月, 2014 1 次提交
    • R
      move struct semid_ds to from shared sys/sem.h to bits · f6e2f7e1
      Rich Felker 提交于
      the definition was found to be incorrect at least for powerpc, and
      fixing this cleanly requires making the definition arch-specific. this
      will allow cleaning up the definition for other archs to make it more
      specific, and reversing some of the ugliness (time_t hacks) introduced
      with the x32 port.
      
      this first commit simply copies the existing definition to each arch
      without any changes. this is intentional, to make it easier to review
      changes made on a per-arch basis.
      f6e2f7e1
  21. 23 2月, 2014 1 次提交
  22. 12 1月, 2014 1 次提交
  23. 09 1月, 2014 2 次提交
  24. 24 11月, 2013 1 次提交
  25. 24 7月, 2013 1 次提交
    • R
      change jmp_buf to share an underlying type and struct tag with sigjmp_buf · 9693501c
      Rich Felker 提交于
      this is necessary to meet the C++ ABI target. alternatives were
      considered to avoid the size increase for non-sig jmp_buf objects, but
      they seemed to have worse properties. moreover, the relative size
      increase is only extreme on x86[_64]; one way of interpreting this is
      that, if the size increase from this patch makes jmp_buf use too much
      memory, then the program was already using too much memory when built
      for non-x86 archs.
      9693501c
  26. 23 7月, 2013 3 次提交
    • R
      remove SIG_ATOMIC_MIN/MAX from stdint bits headers · 3f08154a
      Rich Felker 提交于
      i386 was done with the big commit but I missed the others
      3f08154a
    • R
      fix regression in size of nlink_t (broken stat struct) on x86_64 · 1c6cace0
      Rich Felker 提交于
      rather than moving nlink_t back to the arch-specific file, I've added
      a macro _Reg defined to the canonical type for register-size values on
      the arch. this is not the same as _Addr for (not-yet-supported)
      32-on-64 pseudo-archs like x32 and mips n32, so a new macro was
      needed.
      1c6cace0
    • R
      change wint_t to unsigned · c4dd0c98
      Rich Felker 提交于
      aside from the obvious C++ ABI purpose for this change, it also brings
      musl into alignment with the compiler's idea of the definition of
      wint_t (use in -Wformat), and makes the situation less awkward on ARM,
      where wchar_t is unsigned.
      
      internal code using wint_t and WEOF was checked against this change,
      and while a few cases of storing WEOF into wchar_t were found, they
      all seem to operate properly with the natural conversion from unsigned
      to signed.
      c4dd0c98
  27. 22 7月, 2013 1 次提交
    • R
      refactor headers, especially alltypes.h, and improve C++ ABI compat · 9448b051
      Rich Felker 提交于
      the arch-specific bits/alltypes.h.sh has been replaced with a generic
      alltypes.h.in and minimal arch-specific bits/alltypes.h.in.
      
      this commit is intended to have no functional changes except:
      - exposing additional symbols that POSIX allows but does not require
      - changing the C++ name mangling for some types
      - fixing the signedness of blksize_t on powerpc (POSIX requires signed)
      - fixing the limit macros for sig_atomic_t on x86_64
      - making dev_t an unsigned type (ABI matching goal, and more logical)
      
      in addition, some types that were wrongly defined with long on 32-bit
      archs were changed to int, and vice versa; this change is
      non-functional except for the possibility of making pointer types
      mismatch, and only affects programs that were using them incorrectly,
      and only at build-time, not runtime.
      
      the following changes were made in the interest of moving
      non-arch-specific types out of the alltypes system and into the
      headers they're associated with, and also will tend to improve
      application compatibility:
      - netdb.h now includes netinet/in.h (for socklen_t and uint32_t)
      - netinet/in.h now includes sys/socket.h and inttypes.h
      - sys/resource.h now includes sys/time.h (for struct timeval)
      - sys/wait.h now includes signal.h (for siginfo_t)
      - langinfo.h now includes nl_types.h (for nl_item)
      
      for the types in stdint.h:
      - types which are of no interest to other headers were moved out of
        the alltypes system.
      - fast types for 8- and 64-bit are hard-coded (at least for now); only
        the 16- and 32-bit ones have reason to vary by arch.
      
      and the following types have been changed for C++ ABI purposes;
      - mbstate_t now has a struct tag, __mbstate_t
      - FILE's struct tag has been changed to _IO_FILE
      - DIR's struct tag has been changed to __dirstream
      - locale_t's struct tag has been changed to __locale_struct
      - pthread_t is defined as unsigned long in C++ mode only
      - fpos_t now has a struct tag, _G_fpos64_t
      - fsid_t's struct tag has been changed to __fsid_t
      - idtype_t has been made an enum type (also required by POSIX)
      - nl_catd has been changed from long to void *
      - siginfo_t's struct tag has been removed
      - sigset_t's has been given a struct tag, __sigset_t
      - stack_t has been given a struct tag, sigaltstack
      - suseconds_t has been changed to long on 32-bit archs
      - [u]intptr_t have been changed from long to int rank on 32-bit archs
      - dev_t has been made unsigned
      
      summary of tests that have been performed against these changes:
      - nsz's libc-test (diff -u before and after)
      - C++ ABI check symbol dump (diff -u before, after, glibc)
      - grepped for __NEED, made sure types needed are still in alltypes
      - built gcc 3.4.6
      9448b051
  28. 19 7月, 2013 1 次提交
    • R
      change uid_t, gid_t, and id_t to unsigned types · 648c3b4e
      Rich Felker 提交于
      this change is both to fix one of the remaining type (and thus C++
      ABI) mismatches with glibc/LSB and to allow use of the full range of
      uid and gid values, if so desired.
      
      passwd/group access functions were not prepared to deal with unsigned
      values, so they too have been fixed with this commit.
      648c3b4e
  29. 18 7月, 2013 1 次提交
  30. 26 6月, 2013 1 次提交
    • R
      respect iso c namespace in stdio.h and wchar.h regarding va_list · a3e2f3c2
      Rich Felker 提交于
      despite declaring functions that take arguments of type va_list, these
      headers are not permitted by the c standard to expose the definition
      of va_list, so an alias for the type must be used. the name
      __isoc_va_list was chosen to convey that the purpose of this alternate
      name is for iso c conformance, and to avoid the multitude of names
      which gcc mangles with its hideous "fixincludes" monstrosity, leading
      to serious header breakage if these "fixes" are run.
      a3e2f3c2
  31. 26 5月, 2013 2 次提交
  32. 18 5月, 2013 1 次提交
    • R
      add FLT_TRUE_MIN, etc. macros from C11 · 22730d65
      Rich Felker 提交于
      there was some question as to how many decimal places to use, since
      one decimal place is always sufficient to identify the smallest
      denormal uniquely. for now, I'm following the example in the C
      standard which is consistent with the other min/max macros we already
      had in place.
      22730d65
  33. 05 4月, 2013 2 次提交
  34. 02 4月, 2013 1 次提交
    • R
      re-add useconds_t · 47cf4919
      rofl0r 提交于
      this type was removed back in 5243e5f1 ,
      because it was removed from the XSI specs.
      however some apps use it.
      since it's in the POSIX reserved namespace, we can expose it
      unconditionally.
      47cf4919