qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] lseek beyond 2GB offset for qemu-arm user


From: Peter Maydell
Subject: Re: [Qemu-devel] lseek beyond 2GB offset for qemu-arm user
Date: Thu, 11 Aug 2016 18:20:28 +0100

On 11 August 2016 at 17:06, Chanho Park <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]