Page MenuHomeFreeBSD

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

Authored by dchagin on Aug 16 2021, 3:47 PM.
Tags
None
Referenced Files
F157345438: D31561.id93831.diff
Wed, May 20, 12:13 PM
F157329708: D31561.id.diff
Wed, May 20, 9:27 AM
F157329055: D31561.id93757.diff
Wed, May 20, 9:19 AM
Unknown Object (File)
Sun, May 17, 6:43 AM
Unknown Object (File)
Wed, May 13, 9:44 PM
Unknown Object (File)
Wed, May 13, 9:44 PM
Unknown Object (File)
Wed, May 13, 9:44 PM
Unknown Object (File)
Wed, May 13, 9:35 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 Passed
Unit
No Test Coverage
Build Status
Buildable 41073
Build 37962: arc lint + arc unit

Event Timeline

Special handling for -1 also needed

sys/compat/linux/linux_misc.c
1082

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
1082

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?

In D31561#718208, @kib wrote:

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

hmm, no,
seems it's my fault in the https://reviews.freebsd.org/D31552, and should be fixed there