Closing the file handle of the parent / child process

If you do fork () for the parent and create a child process, then the child closes the fd inherited from fork.

Will the file remain open in the parent since they are independent? What about standard input / output or stderr?

+3
source share
1 answer

Regardless of whether they represent files or devices (including standard I / O descriptors), if you close one process, the other process still has a valid descriptor.

. , , .

+3

All Articles