1DPNS_GETREPLICA(3)          DPNS Library Functions          DPNS_GETREPLICA(3)
2
3
4

NAME

6       dpns_getreplica  -  get the replica entries associated with a DPNS file
7       in the name server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "dpns_api.h"
12
13       int dpns_getreplica (const char *path, const  char  *guid,  const  char
14       *se, int *nbentries, struct dpns_filereplica **rep_entries)
15

DESCRIPTION

17       dpns_getreplica gets the replica entries associated with a DPNS 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 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_filereplica
35              structures  allocated  by  the  API.  The  client application is
36              responsible for freeing the array when not needed anymore.
37
38       struct dpns_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

RETURN VALUE

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

ERRORS

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

SEE ALSO

84       Castor_limits(4), dpns_chdir(3)
85

AUTHOR

87       LCG Grid Deployment Team
88
89
90
91DPNS                     $Date: 2006/04/26 10:12:35 $       DPNS_GETREPLICA(3)
Impressum