Hi Timo,
It doesn't compile for Solaris 10:
gcc concurrency.c -o concurrency -Wall concurrency.c: In function
main': concurrency.c:40: warning: implicit declaration of function
flock' concurrency.c:40: error:LOCK_EX' undeclared (first use in this function) concurrency.c:40: error: (Each undeclared identifier is reported only once concurrency.c:40: error: for each function it appears in.) concurrency.c:50: error:
LOCK_UN' undeclared (first use in this function) concurrency.c:92: warning: long int format, size_t arg (arg 2)
Cheers.
On Thu, 21 Jun 2007, Timo Sirainen wrote:
Attached another test program. I don't expect it to print any errors with any OS, but I'd like to confirm it for non-Linux SMP kernels.
(Except for OpenBSD, it doesn't work correctly in it anyway because it doesn't support mixing write()s and mmap())