1DPNS_GETREPLICAX(3) DPNS Library Functions DPNS_GETREPLICAX(3)
2
3
4
6 dpns_getreplicax - get the replica entries associated with a DPNS file
7 in the name server
8
10 #include <sys/types.h>
11 #include "dpns_api.h"
12
13 int dpns_getreplicax (const char *path, const char *guid, const char
14 *se, int *nbentries, struct dpns_filereplicax **rep_entries)
15
17 dpns_getreplicax gets the replica entries associated with a DPNS file
18 in 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 DPNS
24 directory or the full DPNS 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 dpns_filereplicax
35 structures allocated by the API. The client application is
36 responsible for freeing the array when not needed anymore.
37
38 struct dpns_filereplicax {
39 u_signed64 fileid;
40 u_signed64 nbaccesses;
41 time_t ctime; /* replica creation time */
42 time_t atime; /* last access to replica */
43 time_t ptime; /* replica pin time */
44 time_t ltime; /* replica lifetime */
45 char r_type; /* 'P' for Primary, 'S' for Secondary */
46 char status;
47 char f_type; /* 'V' for Volatile, 'P' for Permanent */
48 char setname[37];
49 char poolname[CA_MAXPOOLNAMELEN+1];
50 char host[CA_MAXHOSTNAMELEN+1];
51 char fs[80];
52 char sfn[CA_MAXSFNLEN+1];
53 };
54
56 This routine returns 0 if the operation was successful or -1 if the
57 operation failed. In the latter case, serrno is set appropriately.
58
60 ENOENT The named file does not exist.
61
62 EACCES Search permission is denied on a component of the path
63 prefix.
64
65 ENOMEM Memory could not be allocated for unmarshalling the reply.
66
67 EFAULT path and guid are NULL pointers or nbentries or
68 rep_entries is a NULL pointer.
69
70 ENOTDIR A component of path prefix is not a directory.
71
72 EINVAL The length of guid exceeds CA_MAXGUIDLEN or the length of
73 se exceeds CA_MAXHOSTNAMELEN or path and guid are both
74 given and they point at a different file.
75
76 ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of
77 a path component exceeds CA_MAXNAMELEN.
78
79 SENOSHOST Host unknown.
80
81 SENOSSERV Service unknown.
82
83 SECOMERR Communication error.
84
85 ENSNACT Name server is not running or is being shutdown.
86
88 Castor_limits(4), dpns_chdir(3)
89
91 LCG Grid Deployment Team
92
93
94
95DPNS $Date: 2006/12/01 09:19:37 $ DPNS_GETREPLICAX(3)