Commit Graph
7 Commits
Author SHA1 Message Date
Alexey Izbyshev c1b42c4a3a wait4: fix missing rusage on x32 due to wrong success condition
Resource usage data is filled by the kernel only when wait4 returns
a pid, i.e. a positive value.

Commit 5850546e96 introduced this bug,
possibly because of copy-pasting from getrusage.
2023-04-11 09:23:44 -04:00
Rich Felker 5850546e96 wait4, getrusage: add time64/x32 variant
presently the kernel does not actually define time64 versions of these
syscalls, and they're not really needed except to represent extreme
cpu time usage. however, x32's versions of the syscalls already behave
as time64 ones, meaning the functions were broken on x32 if the caller
used any part of the rusage result other than ru_utime and ru_stime.
commit 7e81711431 made it possible to
fix this by treating x32's syscalls as time64 versions.

in the non-time64-syscall case, make the syscall with the rusage
destination pointer adjusted so that all members but the timevals line
up between the libc and kernel structures. on 64-bit archs, or present
32-bit archs with 32-bit time_t, the timevals will line up too and no
further work is needed. for future 32-bit archs with 64-bit time_t,
the timevals are copied into place, contingent on time_t being larger
than long.
2019-10-19 21:29:55 -04:00
Szabolcs Nagy 571744447c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
Rich Felker aa398f56fa global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
Rich Felker cc2a8228fa cleanup cruft left from when kernel and user time_t disagreed 2011-02-19 02:28:42 -05:00
Rich Felker 9b235e8374 remove standalone syscall cruft
this was originally written for an early draft of the library where
non-standard functions would reside in a static library separate from
the shared libc.so, which would implement a pure standard. the idea
was not to depend on an implementation-dependent __syscall_ret
function in the main libc. but it turned out to be better to put
everything in a single library for both static and dynamic linking
uses, and thus the (incomplete) remnants of this feature were just
enlarging the source and binary.
2011-02-15 14:39:02 -05:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00