Re: file offset pointer accross fork() ?

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

 



On Fri, 30 Sep 2005 21:17:26 +0200
Sebastian Skar <sebastianskar@xxxxxxxxx> wrote:
> we can see that the pointers are shallow copied (not 'copy constructed'...),
> so basically even across fork the same file position is relevant for
> both father and child.

exactly. 

f_pos is stored in a struct file which is instantiated in open
(sys_open()->filp_open()->dentry_open()). forking, cloning, duping, etc
only create references to it and don't effectively copy it, hence the sharing.

Florin

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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