mirror of git://sourceware.org/git/glibc.git
Some older standards (XPG4.2 through POSIX.1:2001, XSI only) require sys/wait.h to include the definition of struct rusage. This is missing in glibc. This patch adds the required definition. struct rusage is moved to a new header bits/types/struct_rusage.h to avoid bringing in the whole of sys/resource.h (although the standards in question do allow the whole of sys/resource.h to be brought in). In the five bits/resource.h headers, the only variation between the definitions of struct rusage is that the sysdeps/unix/sysv/linux version is prepared for x32 (by having anonymous unions with __syscall_slong_t fields) and the others are not. Thus, this version is suitable for use generically (everything other than x32 simply has __syscall_slong_t the same as long int, so there are no API or ABI changes involved, and anonymous unions are already a required language feature for glibc headers elsewhere), and this patch uses it as a base for the single implementation of bits/types/struct_rusage.h. Tested for x86_64, and with build-many-glibcs.py. [BZ #21575] * resource/bits/types/struct_rusage.h: New file. * include/bits/types/struct_rusage.h: Likewise. * bits/resource.h (struct rusage): Include <bits/types/struct_rusage.h> instead of defining here. * sysdeps/unix/sysv/linux/bits/resource.h (struct rusage): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/resource.h (struct rusage): Likewise. * sysdeps/unix/sysv/linux/mips/bits/resource.h (struct rusage): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/resource.h (struct rusage): Likewise. * resource/Makefile (headers): Add bits/types/struct_rusage.h. * posix/sys/wait.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K8]: Include <bits/types/struct_rusage.h> |
||
|---|---|---|
| .. | ||
| bits | ||
| mips32 | ||
| mips64 | ||
| sys | ||
| Implies | ||
| Makefile | ||
| Versions | ||
| ____longjmp_chk.c | ||
| _test_and_set.c | ||
| arch-fork.h | ||
| brk.c | ||
| clone.S | ||
| configure | ||
| configure.ac | ||
| dl-cache.h | ||
| dl-static.c | ||
| getcontext.S | ||
| getmsg.c | ||
| getrlimit64.c | ||
| getsysstats.c | ||
| init-first.c | ||
| kernel-features.h | ||
| kernel_rt_sigframe.h | ||
| kernel_sigaction.h | ||
| kernel_stat.h | ||
| kernel_termios.h | ||
| ldsodefs.h | ||
| libc-abis | ||
| libc-vdso.h | ||
| makecontext.S | ||
| pipe.S | ||
| profil-counter.h | ||
| pt-vfork.S | ||
| putmsg.c | ||
| readelflib.c | ||
| register-dump.h | ||
| setcontext.S | ||
| setrlimit64.c | ||
| shlib-versions | ||
| sigaction.c | ||
| sigcontextinfo.h | ||
| swapcontext.S | ||
| syscalls.list | ||
| sysdep-cancel.h | ||
| ucontext_i.sym | ||
| ustat.c | ||
| vfork.S | ||
| xstatconv.c | ||