Page MenuHomeFreeBSD

linux(4): Fixup wait4 handling pid equal 0 case.
Needs ReviewPublic

Authored by dchagin on Aug 16 2021, 3:47 PM.

Details

Reviewers
None
Group Reviewers
Linux Emulation
Summary

Pid equal 0 meaning wait for any child process whose process group identificator
is equal to that of the calling process.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 41100
Build 37989: arc lint + arc unit

Event Timeline

Special handling for -1 also needed

sys/compat/linux/linux_misc.c
1089

this should be pg_id no?

Special handling for -1 also needed

it handled by pid < 0, as pid == -1 before it

sys/compat/linux/linux_misc.c
1089

ah)) sure!

ah, #define WAIT_ANY (-1) /* any process */

This is what I'd have expected and it LGTM, but I'd defer to @markj or @kib for confirmation

In my copy of the FreeBSD source tree, linux_common_wait() has the following prototype

static int
linux_common_wait(struct thread *td, int pid, int *statusp,
    int options, struct __wrusage *wrup)

So I am not sure what is this about.

In D31561#712206, @kib wrote:

In my copy of the FreeBSD source tree, linux_common_wait() has the following prototype

static int
linux_common_wait(struct thread *td, int pid, int *statusp,
    int options, struct __wrusage *wrup)

So I am not sure what is this about.

ah, it depends on D31552

Do you mean that our native wait4(2) does not correctly handle pid == 0 case?