1RFIO_LOCKF(3) Rfio Library Functions RFIO_LOCKF(3)
2
3
4
6 rfio_lockf - provide record locking on files
7
9 #include <sys/types.h>
10 #include "rfio_api.h"
11
12 int rfio_lockf (int sd, int op, long siz);
13
14 Under Linux, for large files:
15 #define _LARGEFILE64_SOURCE
16 #include <sys/types.h>
17 #include "rfio_api.h"
18
19 int rfio_lockf64 (int sd, int op, off64_t siz);
20
21 For large files, under other systems:
22 #include <sys/types.h>
23 #include "rfio_api.h"
24
25 int rfio_lockf64 (int sd, int op, off64_t siz);
26
28 rfio_lockf restricts access to regions of files to the calling process.
29
30 sd is the file descriptor returned by a previous rfio_open.
31
32 op specifies the action to be taken:
33
34 F_ULOCK unlock a region.
35
36 F_LOCK lock a region.
37
38 F_TLOCK test and lock a region.
39
40 F_TEST test a region for other locks.
41
42 siz gives the size of the region to be locked, starting at the current
43 file offset.
44
45 rfio_lockf64 must be used for large files and uses an off64_t instead
46 of a long to specify the size of the region to be locked.
47
49 This routine returns 0 if the operation was successful or -1 if the
50 operation failed. In the latter case, serrno is set appropriately.
51
53 EBADF sd is not a valid descriptor.
54
55 EACCES The file region is locked and F_TEST or F_TLOCK was speciā
56 fied.
57
58 EINVAL incorrect value for op or siz.
59
60 SENOSHOST Host unknown.
61
62 SENOSSERV Service unknown.
63
64 SETIMEDOUT Timed out.
65
66 SECONNDROP Connection closed by remote end.
67
68 SECOMERR Communication error.
69
71 rfio_open(3)
72
74 LCG Grid Deployment Team
75
76
77
78LCG $Date: 2005/03/31 13:13:03 $ RFIO_LOCKF(3)