Re: file offset pointer accross fork() ?

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

 



On Wed, 28 Sep 2005 21:26:56 +0200
Sebastian Skar <sebastianskar@xxxxxxxxx> wrote:

> I know the file position is located in the file struct.
> I know that during normal fork, copy_process copies these
> structures and doesn't share them between father and son
> (unless CLONE_FILES is used, like in threads).

That's not quite right: copy_process() copies the files_struct structure
which contains _pointers_ to the file objects not the file structures
themselves. Hence the file structures (including f_pos) are indeed
shared.

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