[uClibc]Re: ftruncate64 on arm

Erik Andersen andersen at codepoet.org
Tue Apr 9 14:59:53 UTC 2002


On Mon Apr 01, 2002 at 01:15:29PM +0900, Miles Bader wrote:
> Erik Andersen <andersen at codepoet.org> writes:
> > Mostly, I just poked at the kernel source and saw that for x86
> > and arm, in linux/arch/arm/kernel/calls.S it directly calls
> > sys_ftruncate64 suggesting that it should just work... 
> 
> On the v850 at least the problem with passing 64-bit arguments directly
> is the use of `asm' magic in the user syscall inlines.  The kernel-side
> doesn't have to do anything special, because syscalls basically use the
> same calling conventions as functions for 64-bit args.
> 
> The same seems to be true of the other ports I looked at (but this is
> merely by inspection, I haven't done any testing :-)
> 
> [BTW, it's possible that things will `work' by accident, if the upper
> 32 bits of the offset arg happen to be in the right register (because
> the function and syscall calling-conventions are the same), but I think
> it would be very poor practice to rely on this.]

I spent quite a while looking over how you were doing things, and
how it was done in glibc, and I have now created a new version in
libc/sysdeps/linux/common/ftruncate64.c that I believe addressess
all the potential pitfalls.  Sorry it took me a bit to get around 
to this one,

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list