[uClibc]Re: pread/pwrite broken w/o large file support

Miles Bader miles at lsi.nec.co.jp
Thu Jul 4 08:20:22 UTC 2002


Ronald Wahl <rwa at peppercon.com> writes:
> > As you can see, it's just going to going to toss away the upper bits in
> > any argument type longer than a long.
> 
> Hmm, I see, but why makes my patch a difference then? Very confusing ...

It can work `by accident' if you're calling the syscall routine without
a prototype -- because the caller doesn't know any better, it _thinks_
the function takes a 64-bit argument, and so the compiler splits the arg
and puts the two halves into the right registers.  The syscall routine
will only see one half, but as long as the argument is the last one,
it's possible that nothing will clobber the register it's in, and it
will end up being passed to the kernel in the right place anyway.

However this is obviously not a good thing to do.

-Miles
-- 
`Life is a boundless sea of bitterness'



More information about the uClibc mailing list