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


Manual Reference Pages  -  SETLOCK (1)

NAME

setlock - run a program with a file locked

CONTENTS

Syntax
Description
Options

SYNTAX

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

DESCRIPTION

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.)

OPTIONS

-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.

SEE ALSO

flock(2), lockf(3)
Search for    or go to Top of page |  Section 1 |  Main Index


SETLOCK (1) -->

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