On 7/27/07, Roy Souther <[EMAIL PROTECTED]> wrote:
>
>  I have no man pages for flock.
>

As far as I could tell its a RedHat specific utiltiy.  It would be about 2
hr to program.

To program this:
1) use the first argument as a lock file
2) you can use open with the o_CREAT
3) if this fails the file is already there - use open with O_RDONLY
4) use flock() with LOCK_EX to get an exclusive lock - if this call fails
then exit with error code
5) use one of the exec functions (without reading the man pages I can't
remember which one) to execute the remaining command line args in a new
process

The return value of the new process will become the return value for this
program.  Call it flock.
_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to