1LFC_GETREPLICA(3) LFC Library Functions LFC_GETREPLICA(3)
2
3
4
6 lfc_getreplica - get the replica entries associated with a LFC file in
7 the name server
8
10 #include <sys/types.h>
11 #include "lfc_api.h"
12
13 int lfc_getreplica (const char *path, const char *guid, const char *se,
14 int *nbentries, struct lfc_filereplica **rep_entries)
15
17 lfc_getreplica gets the replica entries associated with a LFC file in
18 the name server.
19
20 The file can be specified by path name or by guid. If both are given,
21 they must point at the same file.
22
23 path specifies the logical pathname relative to the current LFC
24 directory or the full LFC pathname.
25
26 guid specifies the Grid Unique IDentifier.
27
28 se allows to restrict the replica entries to a given SE.
29
30 nbentries
31 will be set to the number of entries in the array of replicas.
32
33 rep_entries
34 will be set to the address of an array of lfc_filereplica struc‐
35 tures allocated by the API. The client application is responsi‐
36 ble for freeing the array when not needed anymore.
37
38 struct lfc_filereplica {
39 u_signed64 fileid;
40 u_signed64 nbaccesses;
41 time_t atime; /* last access to replica */
42 time_t ptime; /* replica pin time */
43 char status;
44 char f_type; /* 'V' for Volatile, 'P' for Permanent */
45 char poolname[CA_MAXPOOLNAMELEN+1];
46 char host[CA_MAXHOSTNAMELEN+1];
47 char fs[80];
48 char sfn[CA_MAXSFNLEN+1];
49 };
50
52 This routine returns 0 if the operation was successful or -1 if the
53 operation failed. In the latter case, serrno is set appropriately.
54
56 ENOENT The named file does not exist.
57
58 EACCES Search permission is denied on a component of the path
59 prefix.
60
61 ENOMEM Memory could not be allocated for unmarshalling the reply.
62
63 EFAULT path and guid are NULL pointers or nbentries or
64 rep_entries is a NULL pointer.
65
66 ENOTDIR A component of path prefix is not a directory.
67
68 EINVAL The length of guid exceeds CA_MAXGUIDLEN or the length of
69 se exceeds CA_MAXHOSTNAMELEN or path and guid are both
70 given and they point at a different file.
71
72 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
73 a path component exceeds CA_MAXNAMELEN.
74
75 SENOSHOST Host unknown.
76
77 SENOSSERV Service unknown.
78
79 SECOMERR Communication error.
80
81 ENSNACT Name server is not running or is being shutdown.
82
84 Castor_limits(4), lfc_chdir(3)
85
87 LCG Grid Deployment Team
88
89
90
91LFC $Date: 2006/04/26 10:12:35 $ LFC_GETREPLICA(3)