Skip to contentSkip to conversation

syscalls/fork02: new test for fork()

PATCH zhaogongyi via ltp 2 participants 2 messages Nov 1, 2022 – Nov 2, 2022

lore
Share & tools
lore
#0 lore raw

Hi Cyril,

Quoted 12 lines

Hi!

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Verify that current workdir correctly inherited by child.

Why test this? Does fork() man-pages menthion this?

Man-pages does not menthion this, and the other field inherited does

not mentioned too.

I guess that this is described in POSIX in:

Quoted 9 lines

"The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:"

at https://pubs.opengroup.org/onlinepubs/9699919799/

And there is nothing about working dir in the list of special cases hence working dir is exactly the same as for parent since it has to be exact copy of parent.

It seems reasonable to not test the result of full inheritance from the parent process, otherwise there are a lot of testcases.

Regards,

Gongyi

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Man-pages does not menthion this, and the other field inherited does

not mentioned too.

I guess that this is described in POSIX in:

"The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:"

Quoted 8 lines
Quoted 6 lines

at https://pubs.opengroup.org/onlinepubs/9699919799/

And there is nothing about working dir in the list of special cases hence working dir is exactly the same as for parent since it has to be exact copy of parent.

It seems reasonable to not test the result of full inheritance from the parent process, otherwise there are a lot of testcases.

Certainly the interesting part would be testing all the exceptions, but having one test that checks a few things that are supposed to be the same wouldn't harm either.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp