1LFC_LISTREPLICA(3) LFC Library Functions
2LFC_LISTREPLICA(3)
3
4
5
6[1mNAME[0m
7 lfc_listreplica ‐ list replica entries for a given file
8
9[1mSYNOPSIS[0m
10 [1m#include <sys/types.h>[0m
11 [1m#include "lfc_api.h"[0m
12
13 [1mstruct lfc_filereplica *lfc_listreplica (const char
14*[4m[22mpath[24m[1m, const char[0m
15 [1m*[4m[22mguid[24m[1m, int [4m[22mflags[24m[1m, lfc_list
16*[4m[22mlistp[24m[1m)[0m
17
18[1mDESCRIPTION[0m
19 [1mlfc_listreplica [22mlists replica entries for a given
20file. This routine
21 returns a pointer to a structure containing the current
22replica entry.
23
24 struct lfc_filereplica {
25 u_signed64 fileid;
26 u_signed64 nbaccesses;
27 time_t atime; /* last access to
28replica */
29 time_t ptime; /* replica pin time */
30 char status;
31 char f_type; /* ’V’ for Volatile, ’P’ for
32Permanent */
33 char poolname[CA_MAXPOOLNAMELEN+1];
34 char host[CA_MAXHOSTNAMELEN+1];
35 char fs[80];
36 char sfn[CA_MAXSFNLEN+1];
37 };
38
39 [4mpath[24m specifies the logical pathname.
40
41 [4mguid[24m specifies the Grid Unique IDentifier.
42
43 [4mflags[24m may be one of the following constant:
44
45 [1mCNS_LIST_BEGIN[0m
46 the first call must have this flag set to
47allocate buf‐
48 fers and initialize pointers.
49
50 [1mCNS_LIST_CONTINUE[0m
51 all the following calls must have this flag
52set.
53
54 [1mCNS_LIST_END[0m
55 final call to terminate the list and free
56resources.
57
58[1mRETURN VALUE[0m
59 This routine returns a pointer to a structure containing
60the current
61 replica entry if the operation was successful or NULL
62if all entries
63 have been returned or if the operation failed. In the lat‐
64ter case, [1mser‐[0m
65 [1mrno [22mis set appropriately.
66
67[1mEXAMPLES[0m
68 A C program listing the replicas fo a given sfn could look
69like:
70
71 int flags;
72 lfc_list list;
73 struct lfc_filereplica *lp;
74
75 flags = CNS_LIST_BEGIN;
76 while ((lp = lfc_listreplica (sfn, NULL, flags,
77&list)) != NULL) {
78 flags = CNS_LIST_CONTINUE;
79 /* process the entry */
80 .....
81 }
82 (void) lfc_listreplica (sfn, NULL, CNS_LIST_END,
83&list);
84
85[1mERRORS[0m
86 [1mENOENT [22mThe named file does not exist.
87
88 [1mEACCES [22mSearch permission is denied on a
89component of the parent
90 directory.
91
92 [1mENOMEM [22mMemory could not be allocated for the
93output buffer.
94
95 [1mEFAULT [4m[22mpath[24m and [4mguid[24m are NULL
96pointers or [4mlistp[24m is a NULL
97 pointer.
98
99 [1mENOTDIR [22mA component of [4mpath[24m prefix is
100not a directory.
101
102 [1mEINVAL [22mThe length of [4mguid[24m exceeds
103[1mCA_MAXGUIDLEN [22mor path and guid
104 are both given and they point at a different
105file.
106
107 [1mENAMETOOLONG [22mThe length of [4mpath[24m exceeds
108[1mCA_MAXPATHNAMELEN[22m.
109
110 [1mSENOSHOST [22mHost unknown.
111
112 [1mSENOSSERV [22mService unknown.
113
114 [1mSECOMERR [22mCommunication error.
115
116 [1mENSNACT [22mName server is not running or is being
117shutdown.
118
119[1mSEE ALSO[0m
120 [1mCastor_limits(4)[22m, [1mlfc_addreplica(3)[0m
121
122
123
124LFC $Date$
125LFC_LISTREPLICA(3)
126
127
128
129
130
131
132