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

NAME

6       dpns_readdirxr - read DPNS directory opened by dpns_opendir in the name
7       server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "dpns_api.h"
12
13       struct dpns_direnrep *dpns_readdirxr (dpns_DIR *dirp, char *se)
14

DESCRIPTION

16       dpns_readdirxr reads the DPNS directory opened by dpns_opendir  in  the
17       name  server.  This routine returns a pointer to a structure containing
18       the current directory entry  (basename,  guid  and  filesize)  and  the
19       replica information.
20
21       struct dpns_rep_info {
22            u_signed64     fileid;
23            char      status;
24            char      *host;
25            char      *sfn;
26       };
27
28       struct dpns_direnrep {
29            u_signed64     fileid;
30            char      guid[CA_MAXGUIDLEN+1];
31            mode_t         filemode;
32            u_signed64     filesize;
33            int       nbreplicas;
34            struct dpns_rep_info *rep;    /* array of replica info structures */
35            unsigned short d_reclen; /* length of this entry */
36            char      d_name[1];     /* basename in variable length */
37       };
38
39       dpns_readdirxr  caches  a variable number of such entries, depending on
40       the filename size, to minimize the  number  of  requests  to  the  name
41       server.
42
43       dirp   specifies the pointer value returned by dpns_opendir.
44
45       se     allows to restrict the replica entries to a given SE.
46

RETURN VALUE

48       This  routine  returns  a pointer to a structure containing the current
49       directory entry if the operation was successful or NULL if the  end  of
50       the  directory  was reached or if the operation failed. When the end of
51       the directory is encountered, serrno is not changed. If  the  operation
52       failed, serrno is set appropriately.
53
54       As  dpns_readdirxr returns a null pointer both at the end of the direcā€
55       tory and on error, an application wishing to check for error situations
56       should set serrno to 0, then call dpns_readdirxr, then check serrno and
57       if it is non-zero, assume an error has occurred.
58

ERRORS

60       EBADF        File descriptor in DIR structure is invalid.
61
62       ENOMEM       Memory could not be allocated for unmarshalling the reply.
63
64       EFAULT       dirp is a NULL pointer.
65
66       EINVAL       The length of se exceeds CA_MAXHOSTNAMELEN.
67
68       SENOSHOST    Host unknown.
69
70       SENOSSERV    Service unknown.
71
72       SECOMERR     Communication error.
73
74       ENSNACT      Name server is not running or is being shutdown.
75

SEE ALSO

77       dpns_closedir(3), dpns_opendir(3), dpns_rewinddir(3)
78

AUTHOR

80       LCG Grid Deployment Team
81
82
83
84DPNS                     $Date: 2006/03/16 13:02:57 $        DPNS_READDIRXR(3)
Impressum