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
Unknown Object (File)
Wed, Apr 17, 5:16 PM
Unknown Object (File)
Mar 7 2024, 11:32 PM
Unknown Object (File)
Jan 14 2024, 8:08 AM
Unknown Object (File)
Dec 20 2023, 4:52 AM
Unknown Object (File)
Dec 15 2023, 10:44 AM
Unknown Object (File)
Dec 13 2023, 6:59 PM
Unknown Object (File)
Sep 28 2023, 8:38 AM
Unknown Object (File)
Sep 25 2023, 12:11 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 41100
Build 37989: arc lint + arc unit

Event Timeline

Special handling for -1 also needed

sys/compat/linux/linux_misc.c
1090

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
1090

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