This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Linux Checkpoints, take 3


> Date: Mon, 26 Dec 2005 16:33:12 +0100 (CET)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: gdb-patches@sources.redhat.com, drow@false.org
> 
> > +       /* Now save the 'state' (file position) of all open file descriptors.
> > + 	 Unfortunately fork does not take care of that for us...  */
> 
> Hmm, fork(2) clones it file descroptors but both file descriptors
> refer to the same open file description.  Nasty.  Wonder whether it'd
> be possible to copy the open file descriptorions too.

`fork' does the equivalent of `dup', AFAIK, so it cannot copy the
system file table entry to which those descriptors point.  If it did
copy the entries, redirection would stop working.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]