Question about sysdeps/unix/sysv/linux/fcntl.c

Florian Weimer fweimer@redhat.com
Thu Sep 13 15:55:00 GMT 2018


On 09/13/2018 03:57 PM, Hongzhi, Song wrote:
> Hi all,
> 
> I have a issue on ltp relevant glibc.
> 
> https://github.com/linux-test-project/ltp/issues/395
> 
> 
> Could someone tell how to fix it?

See the other thread.  I submitted a reply on Github us well:

`fcntl` always uses `struct flock` arguments. If you use `struct 
flock64`, you should be using `fcntl64`. The issue also goes away if you 
build with `-D_FILE_OFFSET_BITS=64` because then `struct flock` and 
`struct flock64` are basically identical.

The reason for the change was that there is no 32-bit version of the OFD 
locks and no separate `F_OFD_SETLKW` constant, and that `fcntl` 
defaulting to 64-bit in 32-bit mode was just too confusing. The 
previous/non-OFD locks did not do that.

Thanks,
Florian



More information about the Libc-help mailing list