[parisc-linux] Re: pipes

Matthew Wilcox matthew@wil.cx
Mon, 26 Feb 2001 21:30:43 +0000

On Mon, Feb 26, 2001 at 05:57:01PM +0000, Richard Hirst wrote:
> Now for us lseek is of type __off64_t (from /usr/include/unistd.h),
> although our kernel has sys_lseek() returning off_t, which is 32
> bits.  Anyway, if I try to print the 64 bit return value from lseek()
> I get 0x00000000ffffffe3.  The lower 32 bits is -ESPIPE, which is the
> expected errno.  I don't know if glibc, kernel, or both are at fault
> here.

Good catch!  The code in sys_lseek seems pretty explicit that it's only
going to return an off_t:

                loff_t res = llseek(file, offset, origin);
                retval = res;
                if (res != (loff_t)retval)
                        retval = -EOVERFLOW;    /* LFS: should only happen on 32
 bit platforms */

and our off_t is:
include/asm-parisc/posix_types.h:typedef long                   __kernel_off_t;

So /usr/include/unistd.h is wrong.  lseek is not 64-bit.

Another way of fixing this would be to make off_t 64-bit... i suspect
that might have performance implications though.

Revolutions do not require corporate support.