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

Ronald Wahl rwa at peppercon.com
Thu Jul 4 10:34:06 UTC 2002


On 04 Jul 2002 17:20:22 +0900, Miles Bader wrote:

> 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.

Now I inserted a printk in the pread syscall that outputs the
offset. The high part has some arbitrary value (and changes during the
execution). So you are right. But what is the solution? Splitting does
not work. 

ron

-- 
\\      Dipl.-Inf. Ronald Wahl   |   Peppercon AG                  //
 \\\         rwa at peppercon.com  |||  http://www.peppercon.com/   /// 
  \OO  -----------------------  OOO  -------------------------  OO/ 
   OO  GnuPG/PGP key available  OOO  Keep Systems running       OO



More information about the uClibc mailing list