musl/include/sys
Rich Felker 9448b0513e refactor headers, especially alltypes.h, and improve C++ ABI compat
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
2013-07-22 11:22:36 -04:00
..
acct.h add acct, accept4, setns, and dup3 syscalls (linux extensions) 2012-09-08 20:22:08 -04:00
cachectl.h mips cache flush/ctl syscall support and header 2012-11-04 17:06:31 -05:00
epoll.h fix epoll structure alignment on non-x86_64 archs 2013-03-06 23:57:39 -05:00
eventfd.h fix eventfd and inotify nonblock/cloexec flags to match arch values 2012-11-26 13:00:58 -05:00
file.h
fsuid.h header file fixes: multiple include guard consistency and correctness 2012-06-15 21:52:53 -04:00
inotify.h add IN_EXCL_UNLINK to sys/inotify.h 2013-01-12 19:42:39 +01:00
io.h fix breakage from introducing bits header for sys/io.h 2012-11-18 19:58:15 -05:00
ioctl.h
ipc.h fix regressions in app compatibility from previous sys/ipc.h changes 2012-12-10 21:36:12 -05:00
kd.h
klog.h
mman.h add clock_adjtime, remap_file_pages, and syncfs syscall wrappers 2012-09-16 22:26:23 -04:00
mount.h add mount flags to sys/mount.h 2013-01-12 19:42:39 +01:00
msg.h add struct msgbuf to sys/msg.h 2012-12-06 20:27:54 +01:00
mtio.h add cleaned-up sys/mtio.h 2012-11-17 19:51:49 -05:00
param.h
personality.h add personality syscall 2012-12-06 21:01:06 +01:00
poll.h
prctl.h
procfs.h make sys/procfs.h mostly work on most archs 2012-11-25 22:28:18 -05:00
ptrace.h add missing ptrace requests and options to sys/ptrace.h 2013-01-12 19:42:39 +01:00
reboot.h add RB_SW_SUSPEND and RB_KEXEC to sys/reboot.h 2013-01-12 19:42:39 +01:00
reg.h
resource.h refactor headers, especially alltypes.h, and improve C++ ABI compat 2013-07-22 11:22:36 -04:00
select.h add NFDBITS in sys/select.h with appropriate feature tests 2013-07-06 01:12:28 -04:00
sem.h work around wrong kernel type for sem_nsems member of struct semid_ds 2013-06-28 23:57:58 -04:00
sendfile.h default features: make musl usable without feature test macros 2012-09-07 23:13:55 -04:00
shm.h add missing type shmatt_t in sys/shm.h 2013-06-28 23:39:50 -04:00
signalfd.h fix another case of cloexec/nonblock flags not matching arch values 2013-01-10 17:57:30 -05:00
socket.h add new socket options to sys/socket.h following linux 2013-04-01 16:24:12 +00:00
soundcard.h
stat.h feature test macros: make _GNU_SOURCE enable everything 2012-12-03 16:57:01 -05:00
statfs.h refactor headers, especially alltypes.h, and improve C++ ABI compat 2013-07-22 11:22:36 -04:00
statvfs.h default features: make musl usable without feature test macros 2012-09-07 23:13:55 -04:00
stropts.h
swap.h add SWAP_FLAG_DISCARD to sys/swap.h 2013-01-12 19:42:39 +01:00
syscall.h syscall() declaration belongs in unistd.h, not sys/syscall.h 2012-12-10 16:40:45 -05:00
sysctl.h
sysinfo.h fix sysinfo, try 2. it seems to work this time. 2012-06-07 23:06:04 -04:00
syslog.h
sysmacros.h fix shifts possibly larger than type in major() macro 2013-06-29 13:57:13 -04:00
time.h fix the prototype of settimeofday to follow the original BSD declaration 2013-05-26 16:01:38 +00:00
timerfd.h add missing flags in sys/timerfd.h 2012-12-13 14:15:11 -05:00
times.h
timex.h add ADJ_SETOFFSET timex mode bit (new in linux v2.6.39) 2013-04-01 16:24:12 +00:00
ttydefaults.h add legacy sys/ttydefaults.h header 2013-07-03 18:07:51 +02:00
types.h refactor headers, especially alltypes.h, and improve C++ ABI compat 2013-07-22 11:22:36 -04:00
ucontext.h
uio.h add UIO_MAXIOV macro in sys/uio.h 2013-07-19 19:57:52 -04:00
un.h
user.h
utsname.h default features: make musl usable without feature test macros 2012-09-07 23:13:55 -04:00
vfs.h
vt.h
wait.h refactor headers, especially alltypes.h, and improve C++ ABI compat 2013-07-22 11:22:36 -04:00
xattr.h add missing xattr functions 2012-08-15 08:31:44 -04:00