As I'm unfamiliar with the lockf() function I googled it and it appears that
in some situations a fcntl() can serve as a substitute. Since fcntl() is
available on the System i, could it do what you need?
You can see the system header file pertaining to this by running this
command on a green-screen command line:
WRKMBRPDM QSYSINC/H FCNTL
Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
Subject: [C400-L] lockf() on system i
I'm quite new to C especially ILE C and am trying to port a software written
in C (with target platform Linux/Unix) to ILE C.
The software uses the lockf() function which is available on other platforms
but not on System i.
The "UNIX C Applications Porting to AS/400 Companion Guide" also points out
that there are problems but gives a function which should be used for
On most (probably all) systems lockf the following declaration:
int lockf(int fildes, int function, off_t size);
But the function from the IBM redbook has:
int lockf(_RFILE *fildes, int function, int size)
This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact