1RFIO_LOCKF(3)                    Rfio      Library      Functions
2RFIO_LOCKF(3)
3
4
5
6[1mNAME[0m
7       rfio_lockf ‐ provide record locking on files
8
9[1mSYNOPSIS[0m
10       [1m#include <sys/types.h>[0m
11       [1m#include "rfio_api.h"[0m
12
13       [1mint    rfio_lockf    (int     [4m[22msd[24m[1m,     int
14[4m[22mop[24m[1m, long [4m[22msiz[24m[1m);[0m
15
16       Under Linux, for large files:
17       [1m#define _LARGEFILE64_SOURCE[0m
18       [1m#include <sys/types.h>[0m
19       [1m#include "rfio_api.h"[0m
20
21       [1mint    rfio_lockf64    (int    [4m[22msd[24m[1m,    int
22[4m[22mop[24m[1m, off64_t [4m[22msiz[24m[1m);[0m
23
24       For large files, under other systems:
25       [1m#include <sys/types.h>[0m
26       [1m#include "rfio_api.h"[0m
27
28       [1mint    rfio_lockf64    (int    [4m[22msd[24m[1m,    int
29[4m[22mop[24m[1m, off64_t [4m[22msiz[24m[1m);[0m
30
31[1mDESCRIPTION[0m
32       [1mrfio_lockf  [22mrestricts access to regions of files to
33the calling process.
34
35       [4msd[24m is the file descriptor returned  by  a  previous
36[1mrfio_open[22m.
37
38       [4mop[24m specifies the action to be taken:
39
40              [1mF_ULOCK      [22munlock a region.
41
42              [1mF_LOCK       [22mlock a region.
43
44              [1mF_TLOCK      [22mtest and lock a region.
45
46              [1mF_TEST       [22mtest a region for other locks.
47
48       [4msiz[24m   gives  the  size  of the region to be locked,
49starting at the current
50       file offset.
51
52       [1mrfio_lockf64 [22mmust be used for large files and  uses
53an  off64_t  instead
54       of a long to specify the size of the region to be locked.
55
56[1mRETURN VALUE[0m
57       This  routine  returns  0  if the operation was successful
58or ‐1 if the
59       operation failed. In the latter case, [1mserrno [22mis set
60appropriately.
61
62[1mERRORS[0m
63       [1mEBADF        [4m[22msd[24m is not a valid descriptor.
64
65       [1mEACCES        [22mThe  file region is locked and F_TEST
66or F_TLOCK was speci‐
67                    fied.
68
69       [1mEINVAL        [22mincorrect  value  for  [4mop[24m   or
70[4msiz[24m.
71
72       [1mSENOSHOST    [22mHost unknown.
73
74       [1mSENOSSERV    [22mService unknown.
75
76       [1mSETIMEDOUT   [22mTimed out.
77
78       [1mSECONNDROP   [22mConnection closed by remote end.
79
80       [1mSECOMERR     [22mCommunication error.
81
82[1mSEE ALSO[0m
83       [1mrfio_open(3)[0m
84
85[1mAUTHOR[0m
86       [1mLCG Grid Deployment [22mTeam
87
88
89
90LCG                         $Date:    2005/03/31    13:13:03    $
91RFIO_LOCKF(3)
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum