[glibc PATCH] fcntl: put F_OFD_* constants under #ifdef __USE_FILE_OFFSET64

Cyril Hrubis chrubis@suse.cz
Wed Aug 17 21:35:00 GMT 2016


Hi!
> the trouble is that glibc only does fcntl->fcntl64, it doesn't do any
> other cmd or arg translation.  that means users are forced to pick the
> right cmd (FOO or FOO64) that matches the LFS build mode.  i.e. they
> can't use FOO w/LFS turned on, and they can't use FOO64 w/LFS turned
> off.  otherwise there's a mismatch in the struct flock.

One way to fix that would be to add fcntl32() that does the flock <->
flock64 translation for F_OFD_XXX and calls the generall fcntl()
implementation. Then select between fcntl() and fctnt32() on 32bit
architectures based on _FILE_OFFSET_BITS in the preprocessor in the
fcntl header. That way we wouldn't have to touch the kernel at all.

-- 
Cyril Hrubis
chrubis@suse.cz



More information about the Libc-alpha mailing list