Re: file offset pointer accross fork() ?

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

 



On 9/29/05, Florin Malita <fmalita@xxxxxxxxx> wrote:
> 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.
>

hmm...
what's the user-perspective difference between forking and threading,
regarding open files, then ?

thanks !

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