Martijn wrote:
KDB wrote:
/** lock file */
flock lock = { F_WRLCK, SEEK_SET, 0, 0, 0 };
fcntl(fd, F_SETLKW, &lock);
can anyone suggest how to get a lock in non blocking mode so
that if the lock can not be obtained the function should return
indicating that it could not lock the file.
Use F_SETLK instead of F_SETLKW (the W means Wait)
Please do not answer off topic questions with something other
than a redirection to an appropriate group. There is (in theory)
nobody here to criticize your answers and to correct possible
errors.
--
Replies should be to the newsgroup
Chuck Falconer, on vacation.