1DPNS_READDIRXR(3) DPNS Library Functions DP‐
2NS_READDIRXR(3)
3
4
5
6[1mNAME[0m
7 dpns_readdirxr ‐ read DPNS directory opened by [1mdp‐
8ns_opendir [22min the name
9 server
10
11[1mSYNOPSIS[0m
12 [1m#include <sys/types.h>[0m
13 [1m#include "dpns_api.h"[0m
14
15 [1mstruct dpns_direnrep *dpns_readdirxr (dpns_DIR
16*[4m[22mdirp[24m[1m, char *[4m[22mse[24m[1m)[0m
17
18[1mDESCRIPTION[0m
19 [1mdpns_readdirxr [22mreads the DPNS directory opened by
20[1mdpns_opendir [22min the
21 name server. This routine returns a pointer to a struc‐
22ture containing
23 the current directory entry (basename, guid and file‐
24size) and the
25 replica information.
26
27 struct dpns_rep_info {
28 u_signed64 fileid;
29 char status;
30 char *host;
31 char *sfn;
32 };
33
34 struct dpns_direnrep {
35 u_signed64 fileid;
36 char guid[CA_MAXGUIDLEN+1];
37 mode_t filemode;
38 u_signed64 filesize;
39 int nbreplicas;
40 struct dpns_rep_info *rep; /* array of replica in‐
41fo structures */
42 unsigned short d_reclen; /* length of this entry */
43 char d_name[1]; /* basename in variable
44length */
45 };
46
47 [1mdpns_readdirxr [22mcaches a variable number of such
48entries, depending on
49 the filename size, to minimize the number of requests
50to the name
51 server.
52
53 [4mdirp[24m specifies the pointer value returned by
54[1mdpns_opendir[22m.
55
56 [4mse[24m allows to restrict the replica entries to a
57given SE.
58
59[1mRETURN VALUE[0m
60 This routine returns a pointer to a structure contain‐
61ing the current
62 directory entry if the operation was successful or NULL if
63the end of
64 the directory was reached or if the operation failed.
65When the end of
66 the directory is encountered, serrno is not changed. If
67the operation
68 failed, [1mserrno [22mis set appropriately.
69
70 As dpns_readdirxr returns a null pointer both at the end
71of the direc‐
72 tory and on error, an application wishing to check for er‐
73ror situations
74 should set [1mserrno [22mto 0, then call dpns_readdirxr,
75then check [1mserrno [22mand
76 if it is non‐zero, assume an error has occurred.
77
78[1mERRORS[0m
79 [1mEBADF [22mFile descriptor in DIR structure is
80invalid.
81
82 [1mENOMEM [22mMemory could not be allocated for un‐
83marshalling the reply.
84
85 [1mEFAULT [4m[22mdirp[24m is a NULL pointer.
86
87 [1mEINVAL [22mThe length of [4mse[24m exceeds
88[1mCA_MAXHOSTNAMELEN[22m.
89
90 [1mSECOMERR [22mCommunication error.
91
92 [1mENSNACT [22mName server is not running or is being
93shutdown.
94
95[1mSEE ALSO[0m
96 [1mdpns_closedir(3)[22m, [1mdpns_opendir(3)[22m, [1mdp‐
97ns_rewinddir(3)[0m
98
99[1mAUTHOR[0m
100 [1mLCG Grid Deployment [22mTeam
101
102
103
104DPNS $Date$ DP‐
105NS_READDIRXR(3)
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132