This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Question about sysdeps/unix/sysv/linux/fcntl.c
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Hongzhi, Song" <hongzhi dot song at windriver dot com>, libc-help at sourceware dot org
- Date: Thu, 13 Sep 2018 17:54:57 +0200
- Subject: Re: Question about sysdeps/unix/sysv/linux/fcntl.c
- References: <455c36bd-8c00-6228-359b-7c6820e69e6e@windriver.com>
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