Skip to contentSkip to conversation

syscalls/fork02: new test for fork()

PATCH zhaogongyi via ltp 2 participants 2 messages Oct 25, 2022 – Oct 31, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 7 lines

Hi Zhao

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.

As far as I know, the child process inherite:

Uids and gids
Environment
Stack
Share memory
Opened fd
Flags of close-on-exec
Pgid
Cwd
Rootdir
Mask
Rlimit
Tty

Maybe we can verify them similarly.

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

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:

"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.

Signature · 5 lines
Cyril Hrubis
[email protected]

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