Open files not shared with the child process ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
I was reading the "Linux Kernel Development" book by Robert Love.
In the Process chapter, he describes that the creation of a process or a thread is done by calling clone() system call.
 
For creating a thread, the flags passed to clone() are
 
clone( CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, 0);
 
CLONE_FILES meaning open file objects should be shared with the new thread.
 
But for creating a new process, it is like
 
clone( SIG_HAND, 0);
 
Here CLONE_FILES is not passed. i.e open file objects are not shared with the new process (child)...? But I have studied that when a process forks a child process, the files open by the parent will be shared with the new child process. And the reference count will also be incremented by 1.
 
Can anybody pls explain this..?
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Yahoo! DSL Something to write home about. Just $16.99/mo. or less

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux