On 11 August 2016 at 17:06, Chanho Park <parkc...@gmail.com> wrote: > Hi, > > When I executed below source in qemu-arm user binary, It was failed > with Invalid Argument. > > gcc lseek_test.c -o lseek_test -D_FILE_OFFSET_BITS=64 > ./lseek_test > error: Invalid argument > > It seems the qemu-arm user does not support the D_FILE_OFFSET_BITS flag. > Is it a known issue or I had wrong test procedure on qemu-arm user > environment?
When I compile it gcc warns me: zz9.c: In function ‘main’: zz9.c:14:32: warning: integer overflow in expression [-Woverflow] so you have a bug in your code and it isn't seeking to where you think it is, and it fails EINVAL on real hardware too. However if you fix this bug (by adding the 'ULL' suffix to the '2' constant) then it works on real hardware and fails in QEMU, so there is a bug here. I'll have a look at it. (Also you close the fd twice.) thanks -- PMM