Recent change to Xprint/attributes.c breaks build
Adam Jackson
ajax at nwnk.net
Tue May 3 09:49:23 PDT 2005
On Tuesday 03 May 2005 12:02, Felix Schulte wrote:
> <On 5/3/05, Kean Johnston <kean at armory.com> wrote:
> > A recent change to Xserver/Xprint/attributes.c breaks the build for
> > me. Its due to a call to pread(). Is there no other way of dealing
> > with the issue that caused this change?
>
> Can you ask in bug #790, pls?
>
> > I can imagine many older
> > systems not having pread() available.
>
> pread() is POSIX AFAIK. Has SCO no way to read from files without changing
> the file offset?
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.
- 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/b061e2f8/attachment.pgp>
More information about the xorg
mailing list