[PATCHES] getrusage changes, basic wait4 support, csh import

13 views
Skip to first unread message

David van Moolenbroek

unread,
Sep 30, 2015, 9:29:16 AM9/30/15
to minix-dev
This patch set aims to add and use the wait4 system call. wait4(2) differs from waitpid(2) in that it optionally returns resource usage for the terminated child - the same resource usage information also returned by getrusage(2). However, as it turned out, our implementation for getrusage(2) was not exactly returning the right information. Since it is better to return no information than wrong information, the first few patches actually strip down its implementation to a bare minimum. On top of that, an ABI change allows getrusage and wait4 to use the same information gathering infrastructure in the future.

The wait4 system call itself now returns the absolute minimum information for it to be useful: the user and system times consumed by the terminated child's process tree. All other "rusage" fields will have to be populated later, although this is tricky: at the time that PM completes a wait4 call, the process no longer exists as far as services other than PM is concerned. PM could gather all resource usage information from other services upon process exit, but this may be expensive in the common case (ie when no resource usage is requested). Solving this is part of future work.

As users of the wait4 system call, we import csh and time - the former mainly to support the import of the latter. Since I am not a csh user myself, the csh port may have several rough edges. Please report any issues (aside from missing job control support).

Regards,
David

http://gerrit.minix3.org/#/c/3199/ - PM: make child time accumulation POSIX compliant
http://gerrit.minix3.org/#/c/3200/ - getrusage(2): zero out ru_i[xds]rss fields
http://gerrit.minix3.org/#/c/3201/ - getrusage(2): zero out ru_nsignals field
http://gerrit.minix3.org/#/c/3202/ - Rework getrusage(2) infrastructure
http://gerrit.minix3.org/#/c/3203/ - PM: add support for wait4(2)
http://gerrit.minix3.org/#/c/3204/ - Import NetBSD csh(1)
http://gerrit.minix3.org/#/c/3205/ - Import NetBSD time(1)
Reply all
Reply to author
Forward
0 new messages