fcntl.2 (176957) | fcntl.2 (177633) |
---|---|
1.\" Copyright (c) 1983, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 12 unchanged lines hidden (view full) --- 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 | 1.\" Copyright (c) 1983, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 12 unchanged lines hidden (view full) --- 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 |
29.\" $FreeBSD: head/lib/libc/sys/fcntl.2 176957 2008-03-08 22:02:21Z antoine $ | 29.\" $FreeBSD: head/lib/libc/sys/fcntl.2 177633 2008-03-26 15:23:12Z dfr $ |
30.\" 31.Dd March 8, 2008 32.Dt FCNTL 2 33.Os 34.Sh NAME 35.Nm fcntl 36.Nd file control 37.Sh LIBRARY --- 146 unchanged lines hidden (view full) --- 184they all operate on the following structure: 185.Bd -literal 186struct flock { 187 off_t l_start; /* starting offset */ 188 off_t l_len; /* len = 0 means until end of file */ 189 pid_t l_pid; /* lock owner */ 190 short l_type; /* lock type: read/write, etc. */ 191 short l_whence; /* type of l_start */ | 30.\" 31.Dd March 8, 2008 32.Dt FCNTL 2 33.Os 34.Sh NAME 35.Nm fcntl 36.Nd file control 37.Sh LIBRARY --- 146 unchanged lines hidden (view full) --- 184they all operate on the following structure: 185.Bd -literal 186struct flock { 187 off_t l_start; /* starting offset */ 188 off_t l_len; /* len = 0 means until end of file */ 189 pid_t l_pid; /* lock owner */ 190 short l_type; /* lock type: read/write, etc. */ 191 short l_whence; /* type of l_start */ |
192 int l_sysid; /* remote system id or zero for local */ |
|
192}; 193.Ed 194The commands available for advisory record locking are as follows: 195.Bl -tag -width F_SETLKWX 196.It Dv F_GETLK 197Get the first lock that blocks the lock description pointed to by the 198third argument, 199.Fa arg , --- 71 unchanged lines hidden (view full) --- 271is the number of consecutive bytes to be locked. 272If 273.Fa l_len 274is negative, 275.Fa l_start 276means end edge of the region. 277The 278.Fa l_pid | 193}; 194.Ed 195The commands available for advisory record locking are as follows: 196.Bl -tag -width F_SETLKWX 197.It Dv F_GETLK 198Get the first lock that blocks the lock description pointed to by the 199third argument, 200.Fa arg , --- 71 unchanged lines hidden (view full) --- 272is the number of consecutive bytes to be locked. 273If 274.Fa l_len 275is negative, 276.Fa l_start 277means end edge of the region. 278The 279.Fa l_pid |
279field is only used with | 280and 281.Fa l_sysid 282fields are only used with |
280.Dv F_GETLK | 283.Dv F_GETLK |
281to return the process ID of the process holding a blocking lock. | 284to return the process ID of the process holding a blocking lock and 285the system ID of the system that owns that process. 286Locks created by the local system will have a system ID of zero. |
282After a successful 283.Dv F_GETLK 284request, the value of 285.Fa l_whence 286is 287.Dv SEEK_SET . 288.Pp 289Locks may start and extend beyond the current end of a file, --- 329 unchanged lines hidden --- | 287After a successful 288.Dv F_GETLK 289request, the value of 290.Fa l_whence 291is 292.Dv SEEK_SET . 293.Pp 294Locks may start and extend beyond the current end of a file, --- 329 unchanged lines hidden --- |