Recent change to Xprint/attributes.c breaks build

Adam Jackson ajax at nwnk.net
Tue May 3 10:42:28 PDT 2005


On Tuesday 03 May 2005 12:59, Kean Johnston wrote:
> > pread() is Unix98, not POSIX.
> >
> > It's perfectly possible to emulate pread:
> >
> > off_t saved = lseek(fd, 0, SEEK_CUR);
> > lseek(fd, offset, SEEK_SET);
> > read(fd, buf, count);
> > lseek(fd, saved, SEEK_SET);
> >
> > Granted it's a few more system calls and it's not reentrant, but it
> > works.  I would suggest that we add this to os-support/, since it's easy
> > to emulate and part of a relatively well-adopted standard.
>
> And to make it re-entrant-ish you could add a few more calls around the
> above code to lock byte 0 of the file while you're doing the pread()
> to ensure that another process (not thread) doesn't come behind you
> and change the offset.

I thought fd state was per-process and not global.  That'll still work of 
course, except on systems where we don't have posix locking semantics (mingw 
only I think).  But it's moot as long as the server is single-threaded.

> I certainly don't mind adding it to the os-support layer, its not
> a big deal. Just want to make sure that the decision to make X.org
> depend on a Unix98 environment was the intended effect. I think there
> are still a fair number of Unix95 systems out there, but I may be
> mistaken. My UNIX-world view has been a bit narrow in recent years.

http://www.opengroup.org/openbrand/register/

UnixWare, Irix, HP-UX 11, and Tru64 5.0 are Unix95 but not Unix98.  That's a 
fairly large set.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20050503/62672eb9/attachment.pgp>


More information about the xorg mailing list