On Thursday 05 December 2013 07:53:43 zenglg.jy wrote:
> --- /dev/null
> +++ b/testcases/kernel/syscalls/fallocate/fallocate.h
>
> +#include "linux_syscall_numbers.h"
> +static inline long fallocate(int fd, int mode, loff_t offset, loff_t len)
> +{
> +#if __WORDSIZE == 32
> +     return (long)ltp_syscall(__NR_fallocate, fd, mode,
> +                              __LONG_LONG_PAIR((off_t) (offset >> 32),
> +                                               (off_t) offset),
> +                              __LONG_LONG_PAIR((off_t) (len >> 32),
> +                                               (off_t) len));
> +#else
> +     return ltp_syscall(__NR_fallocate, fd, mode, offset, len);
> +#endif
> +}

this isn't a new issue, but this code isn't entirely correct.  __WORDSIZE will 
fail on ABI's that have 64bit registers but 32bit longs like MIPS n32 and 
x86_64 x32.  you should at least add a comment above the func noting this 
breakage.

what is a new issue though is that your inline header must include every 
header that it needs.  so the things that provide loff_t and off_t and 
__LONG_LONG_PAIR and ltp_syscall().
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to