News for hackers. Stuff that matters.
Re:All about Linux signals - Linux Programming Blog by spc476 on Monday April 02, 2012 @10:03PM (#3791122)
At work, we have a time-critical program. In that program, we need to lock a file in order to modify it safely. The files themselves are stored on NFS (don't ask---this was a design decision from long ago). fcntl() (used to lock files) does not include a timeout. We need a timeout because the program is time-critical. NFS is not a local filesystem, but across the network. If the network is flaky, we don't want to hang on locking the file.

So we have to rely upon SIGALRM (via setitimer()) to interrupt the fcntl() call so we don't hang indefinitely.

Re:All about Linux signals - Linux Programming Blog by javert on Tuesday April 03, 2012 @01:30AM (#3791617)
Interesting, thanks.