Home
last modified time | relevance | path

Searched refs:dirp (Results 1 – 25 of 173) sorted by relevance

1234567

/illumos-gate/usr/src/lib/libc/port/gen/
H A Dreaddir.c60 readdir(DIR *dirp) in readdir() argument
65 if (dirp->dd_size != 0) { in readdir()
66 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir()
67 saveloc = dirp->dd_loc; /* save for possible EOF */ in readdir()
68 dirp->dd_loc += (int)dp->d_reclen; in readdir()
70 if (dirp->dd_loc >= dirp->dd_size) in readdir()
71 dirp->dd_loc = dirp->dd_size = 0; in readdir()
73 if (dirp->dd_size == 0 && /* refill buffer */ in readdir()
74 (dirp->dd_size = getdents(dirp->dd_fd, in readdir()
75 (dirent_t *)(uintptr_t)dirp->dd_buf, DIRBUF)) <= 0) { in readdir()
[all …]
H A Dreaddir_r.c56 readdir_r(DIR *dirp, dirent_t *entry, dirent_t **result) in readdir_r() argument
58 private_DIR *pdirp = (private_DIR *)dirp; in readdir_r()
63 if (dirp->dd_size != 0) { in readdir_r()
64 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir_r()
65 saveloc = dirp->dd_loc; /* save for possible EOF */ in readdir_r()
66 dirp->dd_loc += (int)dp->d_reclen; in readdir_r()
69 if (dirp->dd_loc >= dirp->dd_size) in readdir_r()
70 dirp->dd_loc = dirp->dd_size = 0; in readdir_r()
72 if (dirp->dd_size == 0 && /* refill buffer */ in readdir_r()
73 (dirp->dd_size = getdents(dirp->dd_fd, in readdir_r()
[all …]
H A Dseekdir.c51 seekdir(DIR *dirp, long loc) in seekdir() argument
53 private_DIR *pdirp = (private_DIR *)dirp; in seekdir()
58 if (lseek(dirp->dd_fd, 0, SEEK_CUR) != 0) { in seekdir()
59 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir()
63 dirp->dd_loc = 0; in seekdir()
64 (void) lseek(dirp->dd_fd, loc, SEEK_SET); in seekdir()
65 dirp->dd_size = 0; in seekdir()
71 ((dirent_t *)(uintptr_t)&dirp->dd_buf[0])->d_off = loc; in seekdir()
84 seekdir64(DIR *dirp, off64_t loc) in seekdir64() argument
86 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in seekdir64()
[all …]
H A D_xftw.c140 DIR *dirp; in fwalk() local
180 dirp = nocdopendir(path, vp); in fwalk()
188 if (dirp == NULL) in fwalk()
194 (void) closedir(dirp); in fwalk()
203 while ((direntp = readdir(dirp)) != NULL) { in fwalk()
214 (void) closedir(dirp); in fwalk()
230 here = telldir(dirp); in fwalk()
231 if (closedir(dirp) < 0) { in fwalk()
245 (void) closedir(dirp); in fwalk()
253 dirp = nocdopendir(path, vp); in fwalk()
[all …]
H A Dtelldir.c53 telldir(DIR *dirp) in telldir() argument
55 private_DIR *pdirp = (private_DIR *)dirp; in telldir()
61 if (lseek(dirp->dd_fd, 0, SEEK_CUR) != 0) { in telldir()
62 dp = (dirent_t *)(uintptr_t)(&dirp->dd_buf[dirp->dd_loc]); in telldir()
77 telldir64(DIR *dirp) in telldir64() argument
79 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in telldir64()
85 if (lseek64(dirp->dd_fd, 0, SEEK_CUR) != 0) { in telldir64()
86 dp64 = (dirent64_t *)(uintptr_t)(&dirp->dd_buf[dirp->dd_loc]); in telldir64()
104 telldir(DIR *dirp) in telldir() argument
108 off = telldir64(dirp); in telldir()
H A Dfdopendir.c51 DIR *dirp = (DIR *)pdirp; in fdopendir() local
70 dirp->dd_buf = buf; in fdopendir()
71 dirp->dd_fd = fd; in fdopendir()
72 dirp->dd_loc = 0; in fdopendir()
73 dirp->dd_size = 0; in fdopendir()
75 return (dirp); in fdopendir()
88 dirfd(DIR *dirp) in dirfd() argument
90 return (dirp->dd_fd); in dirfd()
H A Dscandir.c80 DIR *dirp; in scandir64() local
83 if ((dirp = opendir(dirname)) == NULL) in scandir64()
85 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
101 while ((d = readdir64(dirp)) != NULL) { in scandir64()
136 (void) closedir(dirp); in scandir64()
150 (void) closedir(dirp); in scandir64()
165 DIR *dirp; in scandir() local
168 if ((dirp = opendir(dirname)) == NULL) in scandir()
170 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir()
186 while ((d = readdir(dirp)) != NULL) { in scandir()
[all …]
/illumos-gate/usr/src/cmd/fs.d/ufs/fsck/
H A Dpass2.c395 struct direct *dirp = idesc->id_dirp; in pass2check() local
416 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check()
417 if (dirp->d_ino != idesc->id_number) { in pass2check()
419 dirp->d_ino = idesc->id_number; in pass2check()
437 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check()
439 dirp->d_name); in pass2check()
441 } else if ((int)dirp->d_reclen < entrysize) { in pass2check()
444 } else if ((int)dirp->d_reclen < 2 * entrysize) { in pass2check()
453 proto.d_reclen = dirp->d_reclen; in pass2check()
454 (void) memmove((void *)dirp, (void *)&proto, in pass2check()
[all …]
H A Dpass3.c325 struct direct *dirp = idesc->id_dirp; in pass3acheck() local
332 if (dirp->d_ino == 0) in pass3acheck()
336 if ((strcmp(dirp->d_name, ".") == 0) || in pass3acheck()
337 (strcmp(dirp->d_name, "..") == 0)) { in pass3acheck()
341 switch (statemap[dirp->d_ino] & ~(INDELAYD)) { in pass3acheck()
355 dp = ginode(dirp->d_ino); in pass3acheck()
372 fileerror(idesc->id_number, dirp->d_ino, in pass3acheck()
375 dirp->d_ino); in pass3acheck()
376 dp = ginode(dirp->d_ino); in pass3acheck()
389 statemap[dirp->d_ino], dirp->d_ino); in pass3acheck()
/illumos-gate/usr/src/ucblib/libucb/port/gen/
H A Dreaddir.c58 internal_readdir(DIR *dirp) in internal_readdir() argument
63 if (dirp->dd_size != 0) { in internal_readdir()
64 dp = (struct dirent64 *)&dirp->dd_buf[dirp->dd_loc]; in internal_readdir()
65 saveloc = dirp->dd_loc; /* save for possible EOF */ in internal_readdir()
66 dirp->dd_loc += dp->d_reclen; in internal_readdir()
68 if (dirp->dd_loc >= dirp->dd_size) in internal_readdir()
69 dirp->dd_loc = dirp->dd_size = 0; in internal_readdir()
71 if (dirp->dd_size == 0 && /* refill buffer */ in internal_readdir()
72 (dirp->dd_size = getdents64(dirp->dd_fd, in internal_readdir()
73 (struct dirent64 *)dirp->dd_buf, DIRBUF)) <= 0) { in internal_readdir()
[all …]
H A Dscandir.c79 DIR *dirp; in scandir64() local
81 if ((dirp = opendir(dirname)) == NULL) in scandir64()
83 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
97 while ((d = readdir64(dirp)) != NULL) { in scandir64()
116 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
126 (void) closedir(dirp); in scandir64()
146 DIR *dirp; in scandir() local
148 if ((dirp = opendir(dirname)) == NULL) in scandir()
150 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir()
167 while ((d = readdir(dirp)) != NULL) { in scandir()
[all …]
/illumos-gate/usr/src/contrib/ast/src/lib/libast/dir/
H A Dopendir.c51 register DIR* dirp = 0;
61 !(dirp = freedirp ? freedirp :
70 if (dirp)
72 if (!freedirp) freedirp = dirp;
73 else free(dirp);
78 dirp->dd_fd = fd;
79 dirp->dd_loc = dirp->dd_size = 0; /* refill needed */
81 dirp->dd_buf = (void*)((char*)dirp + sizeof(DIR));
83 return(dirp);
87 closedir(register DIR* dirp)
[all …]
H A Dreaddir.c40 readdir(register DIR* dirp)
46 if (dirp->dd_loc >= dirp->dd_size)
48 if (dirp->dd_size < 0) return(0);
49 dirp->dd_loc = 0;
50 if ((dirp->dd_size = getdents(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ)) <= 0)
53 dp = (struct dirent*)((char*)dirp->dd_buf + dirp->dd_loc);
55 dirp->dd_loc += dp->d_reclen;
H A Dseekdir.c41 seekdir(register DIR* dirp, long loc)
46 if (telldir(dirp) != loc)
48 lseek(dirp->dd_fd, 0L, SEEK_SET);
49 dirp->dd_loc = dirp->dd_size = 0;
50 while (telldir(dirp) != loc)
51 if (!readdir(dirp))
/illumos-gate/usr/src/cmd/backup/dump/
H A Dlftw.c140 DIR *dirp; in lf_xftw() local
190 dirp = opendir(path); in lf_xftw()
198 if (dirp == NULL) in lf_xftw()
212 if (rc != 0 || dirp == NULL) in lf_xftw()
222 (void) closedir(dirp); in lf_xftw()
240 while ((dp = readdir(dirp)) != NULL) { in lf_xftw()
254 here = telldir(dirp); in lf_xftw()
255 (void) closedir(dirp); in lf_xftw()
266 (void) closedir(dirp); in lf_xftw()
274 dirp = opendir(path); in lf_xftw()
[all …]
/illumos-gate/usr/src/lib/sun_fc/common/
H A DHBANPIVPort.cc76 struct dirent **dirpp, *dirp; in lookupControllerPath() local
89 dirp = (struct dirent *) dir_buf; in lookupControllerPath()
90 dirpp = &dirp; in lookupControllerPath()
91 while ((readdir_r(dp, dirp, dirpp)) == 0 && dirp != NULL) { in lookupControllerPath()
92 if (strcmp(dirp->d_name, ".") == 0 || in lookupControllerPath()
93 strcmp(dirp->d_name, "..") == 0) { in lookupControllerPath()
96 sprintf(node, "%s/%s", dir, dirp->d_name); in lookupControllerPath()
102 cfg_path += dirp->d_name; in lookupControllerPath()
H A DHBAPort.cc213 struct dirent **dirpp, *dirp; in lookupControllerPath() local
226 dirp = (struct dirent *) dir_buf; in lookupControllerPath()
227 dirpp = &dirp; in lookupControllerPath()
228 while ((readdir_r(dp, dirp, dirpp)) == 0 && dirp != NULL) { in lookupControllerPath()
229 if (strcmp(dirp->d_name, ".") == 0 || in lookupControllerPath()
230 strcmp(dirp->d_name, "..") == 0) { in lookupControllerPath()
233 sprintf(node, "%s/%s", dir, dirp->d_name); in lookupControllerPath()
239 cfg_path += dirp->d_name; in lookupControllerPath()
/illumos-gate/usr/src/contrib/ast/src/lib/libast/preroot/
H A Dgetpreroot.c67 DIR* dirp = 0; in getpreroot() local
102 if (!(dirp = opendir(dots))) ERROR(errno); in getpreroot()
104 if (fstat(dirp->dd_fd, par)) ERROR(errno); in getpreroot()
113 closedir(dirp); in getpreroot()
125 while (entry = readdir(dirp)) in getpreroot()
137 rewinddir(dirp); in getpreroot()
141 if (!(entry = readdir(dirp))) ERROR(ENOENT); in getpreroot()
151 closedir(dirp); in getpreroot()
152 dirp = 0; in getpreroot()
155 if (dirp) closedir(dirp); in getpreroot()
/illumos-gate/usr/src/cmd/fs.d/ufs/ncheck/
H A Dncheck.c412 struct dirstuff dirp; in pass2() local
418 dirp.loc = 0; in pass2()
419 dirp.ip = ip; in pass2()
421 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass2()
453 struct dirstuff dirp; in pass3() local
458 dirp.loc = 0; in pass3()
459 dirp.ip = ip; in pass3()
461 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass3()
491 dreaddir(struct dirstuff *dirp) in dreaddir() argument
498 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir()
[all …]
/illumos-gate/usr/src/cmd/du/
H A Ddu.c282 static DIR *dirp = NULL; in descend() local
418 if (dirp != NULL) in descend()
424 (void) closedir(dirp); in descend()
426 dirp = fdopendir(curfd); in descend()
428 dirp = opendir(curname); in descend()
429 if (dirp == NULL) { in descend()
455 (void) closedir(dirp); in descend()
456 dirp = NULL; in descend()
460 while (dp = readdir(dirp)) { in descend()
483 curoff = telldir(dirp); in descend()
[all …]
/illumos-gate/usr/src/cmd/lp/lib/lp/
H A Dnext.c58 DIR *dirp; local
65 if (!(dirp = Opendir(parent)))
69 Seekdir (dirp, *lastdirp);
72 direntp = Readdir(dirp);
85 *lastdirp = Telldir(dirp);
91 Closedir (dirp);
/illumos-gate/usr/src/lib/sun_sas/common/
H A Ddevlink_disco.c160 struct dirent *newdirp, *dirp; in lookupLink() local
186 dirp = (struct dirent *)malloc(dirplen); in lookupLink()
187 if (dirp == NULL) { in lookupLink()
192 while ((readdir_r(dp, dirp, &newdirp)) == 0 && newdirp != NULL) { in lookupLink()
193 if (strcmp(dirp->d_name, ".") == 0 || in lookupLink()
194 strcmp(dirp->d_name, "..") == 0) { in lookupLink()
201 charptr = dirp->d_name; in lookupLink()
218 S_FREE(dirp); in lookupLink()
226 S_FREE(dirp); in lookupLink()
/illumos-gate/usr/src/cmd/allocate/
H A Dmkdevalloc.c234 DIR *dirp; in dotape() local
255 if ((dirp = opendir("/dev")) == NULL) { in dotape()
261 while (dep = readdir(dirp)) { in dotape()
309 (void) closedir(dirp); in dotape()
315 if ((dirp = opendir("/dev/rmt")) == NULL) { in dotape()
320 while (dep = readdir(dirp)) { in dotape()
354 (void) closedir(dirp); in dotape()
444 DIR *dirp; in doaudio() local
463 if ((dirp = opendir("/dev")) == NULL) { in doaudio()
469 while (dep = readdir(dirp)) { in doaudio()
[all …]
/illumos-gate/usr/src/cmd/fs.d/ufs/ff/
H A Dff.c135 struct direct *dreaddir(struct dirstuff *dirp);
455 struct dirstuff dirp; in pass2() local
460 dirp.loc = 0; in pass2()
461 dirp.ip = ip; in pass2()
463 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass2()
493 struct dirstuff dirp; in pass3() local
499 dirp.loc = 0; in pass3()
500 dirp.ip = ip; in pass3()
502 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass3()
557 dreaddir(struct dirstuff *dirp) in dreaddir() argument
[all …]
/illumos-gate/usr/src/contrib/ast/src/lib/libast/misc/
H A Dgetcwd.c158 DIR* dirp = 0;
239 if (!(dirp = opendir(dots))) ERROR(errno);
241 if (fstat(dirp->dd_fd, par)) ERROR(errno);
250 closedir(dirp);
271 while (entry = readdir(dirp))
283 rewinddir(dirp);
287 if (!(entry = readdir(dirp))) ERROR(ENOENT);
313 closedir(dirp);
314 dirp = 0;
328 if (dirp) closedir(dirp);

1234567