public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Question about sysdeps/unix/sysv/linux/fcntl.c
@ 2018-09-13 13:54 Hongzhi, Song
  2018-09-13 15:55 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Hongzhi, Song @ 2018-09-13 13:54 UTC (permalink / raw)
  To: libc-help

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?



I also want to know that under what circumstances should we use fcntl 
and fcntl64.


Under what circumstances are the __OFF_T_MATCHES_OFF64_T and 
_FILE_OFFSET_BITS defined?


Why does 32-bit arch calls fcntl64, but 64-bit arch calls fcntl traced 
by strace tool?


Thanks,

Hongzhi

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about sysdeps/unix/sysv/linux/fcntl.c
  2018-09-13 13:54 Question about sysdeps/unix/sysv/linux/fcntl.c Hongzhi, Song
@ 2018-09-13 15:55 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2018-09-13 15:55 UTC (permalink / raw)
  To: Hongzhi, Song, libc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-13 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 13:54 Question about sysdeps/unix/sysv/linux/fcntl.c Hongzhi, Song
2018-09-13 15:55 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).