Recent change to Xprint/attributes.c breaks build

Kirby C. Bohling kbohling at birddog.com
Wed May 4 14:35:45 PDT 2005


On Wed, May 04, 2005 at 10:11:59PM +0100, Glynn Clements wrote:
> 
> Felix Schulte wrote:
> 
> > > > I thought fd state was per-process and not global.
> > > 
> > > No; if a descriptor is duplicated, either explicitly by dup() etc or
> > > implicitly by fork(), all copies share the same offset.
> > > 
> > > The only way to get multiple descriptors for a given file which don't
> > > share offsets is to open() the file multiple times.
> > 
> > Does POSIX provide a variant of open() which takes a fd as argument?
> 
> No.
> 
> On Linux, you can open /proc/self/fd/<n>, but I don't recall whether
> that's the same as a "real" open (i.e. gives you a new descriptor with
> its own offset) or if it just duplicates the descriptor.

man fdopen() claims that fdopen is "POSIX.1", and that's probably a
great deal more portable then /proc/self/fd/<n>  It does exactly
what Felix wants.

    Kirby




More information about the xorg mailing list