I am totally new with C.
What are the process items that are inherited in a child created using fork();
?
What are the process items
The fork(2) man page on your system (man fork
) should give you better details but generally the child only inherits the parent's list of file descriptors, including open files, sockets, and process handles.
From my system's man page (Mac OS X 10.6.6):
The child process has its own copy of the parent's descriptors. These descriptors reference the same underlying objects, so that, for instance, file pointers in file objects are shared between the child and the parent, so that an lseek(2) on a descriptor in the child process can affect a subsequent read or write by the parent. This descriptor copying is also used by the shell to establish standard input and output for newly cre- ated processes as well as to set up pipes.