1 /* @(#)dir_proc.c 2.1 88/08/02 4.0 RPCSRC */
3 * dir_proc.c: remote readdir implementation
10 extern char *malloc();
11 extern char *strcpy();
21 static readdir_res res; /* must be static! */
26 dirp = opendir(*dirname);
33 * Free previous result
35 xdr_free(xdr_readdir_res, &res);
38 * Collect directory entries
40 nlp = &res.readdir_res_u.list;
41 while (d = readdir(dirp)) {
42 nl = *nlp = (namenode *) malloc(sizeof(namenode));
43 nl->name = malloc(strlen(d->d_name)+1);
44 strcpy(nl->name, d->d_name);