summaryrefslogtreecommitdiff
path: root/src/linux/wait4.c
AgeCommit message (Collapse)AuthorLines
2024-02-22add framework to support archs without a native wait4 syscallRich Felker-1/+1
this commit should make no codegen change for existing archs, but is a prerequisite for new archs including riscv32. the wait4 emulation backend provides both cancellable and non-cancellable variants because waitpid is required to be a cancellation point, but all of our other uses are not, and most of them cannot be. based on patch by Stefan O'Rear.
2023-04-11wait4: fix missing rusage on x32 due to wrong success conditionAlexey Izbyshev-1/+1
Resource usage data is filled by the kernel only when wait4 returns a pid, i.e. a positive value. Commit 5850546e9669f793aab61dfc7c4f2c1ff35c4b29 introduced this bug, possibly because of copy-pasting from getrusage.
2019-10-19wait4, getrusage: add time64/x32 variantRich Felker-2/+32
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 7e8171143124f7f510db555dc6f6327a965a3e84 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.
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy-1/+0
2011-03-20global cleanup to use the new syscall interfaceRich Felker-1/+1
2011-02-19cleanup cruft left from when kernel and user time_t disagreedRich Felker-10/+2
2011-02-15remove standalone syscall cruftRich Felker-1/+0
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-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+19