Commit [b87a83]  Maximize  Restore  History

fcntl16: Fix incorrect flock strucure

The fcntl16 testcase is being compiled twice, once normal, and the other
time with the _FILE_OFFSET_BITS=64 define set.

When compiled with 64bit file functions (as fcntl16_64) all file
functions will automatically use their 64bit variants, e.g. struct
flock64" instead of "struct flock".

So, when in the code e.g.
fcntl(fd, F_SETLK, thislock)
is called, this will automatically be translated into
fcntl64(fd, F_SETLK64, thislock)
and "thislock" needs to be of type "struct flock64".

We need to make sure that thislock is of the correct type, with the
start and len fields being of type "off_t" which then will be translated
into "loff_t" during compilation when _FILE_OFFSET_BITS=64 is set.

In orded to do that we make use of struct flock instead of the incorrect
version that was defined in the test source.

This fixes the fcntl16_64 testcase on hppa64-linux-gnu with 32bit
userspace running on 64bit kernel.

Signed-off-by: Helge Deller <>
Signed-off-by: Cyril Hrubis <>

Cyril Hrubis Cyril Hrubis 2013-11-07

changed testcases/kernel/syscalls/fcntl/fcntl16.c
testcases/kernel/syscalls/fcntl/fcntl16.c Diff Switch to side-by-side view

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks