*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: flock | Section: 1 | Source: NetBSD | File: flock.1
FLOCK(1) FreeBSD General Commands Manual FLOCK(1) NAME flock - Provide locking API for shell scripts SYNOPSIS flock [-dnosvx] [-w timeout] file|directory command [args ...] flock [-dnosvx] [-w timeout] file|directory -c command flock [-dnsuvx] [-w timeout] number DESCRIPTION The flock utility provides flock(2) access to the command line or scripts. The first two forms lock the specified file or directory while the provided command is executed. If the path does not exist, then a file of that name is created with mode 0600. The third form can use an arbitrary file descriptor number that is provided from a shell script for example: ( flock -s 100 # commands to be executed under the lock ) 100> /path/to/lockfile The following options are available: -c command Pass a command to a the shell. -d, --debug Provide debugging output. -n, --nb, --nonblock Don't block and fail immediately if the lock could not be obtained. -o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock. -s, --shared Obtain a shared lock. -u, --unlock Unlock an existing lock. This is available only for a file descriptor. -v, --verbose On error print an explanation of the failure. -w, --wait, --timeout seconds Fail if the lock could not be obtained after seconds. -x, --exclusive Obtain an exclusive lock. This is the default. EXIT STATUS The flock utility exits 0 on success, and >0 if an error occurs. SEE ALSO shlock(1), flock(2) HISTORY An flock utility appeared in NetBSD 6.1. FreeBSD 14.1-RELEASE-p8 October 4, 2019 FreeBSD 14.1-RELEASE-p8

Navigation Options