GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
setlock(1) FreeBSD General Commands Manual setlock(1)

setlock - run a program with a file locked

setlock [ -nNxX ] file program [ arg ... ]

setlock opens file for writing (creating it if it does not exist), obtains an exclusive lock on it, and runs program.

Normally the lock disappears when program exits.

(Here's the complete story: program is given a descriptor for a locked ofile pointing to file. The lock disappears when this ofile is (1) closed by all the processes that have descriptors for it or (2) explicitly unlocked.)

-n
No delay. If file is locked by another process, setlock gives up.
-N
(Default.) Delay. If file is locked by another process, setlock waits until it can obtain a new lock.
-x
If file cannot be opened (or created) or locked, setlock exits zero.
-X
(Default.) If file cannot be opened (or created) or locked, setlock prints an error message and exits nonzero.

flock(2), lockf(3)

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.