Home
last modified time | relevance | path

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

1234567

/illumos-gate/usr/src/lib/libc/port/gen/
H A Dreaddir.c62 readdir(DIR *dirp) in readdir() argument
68 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir()
72 if (dirp->dd_loc >= dirp->dd_size) in readdir()
73 dirp->dd_loc = dirp->dd_size = 0; in readdir()
76 (dirp->dd_size = getdents(dirp->dd_fd, in readdir()
83 return ((dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]); in readdir()
99 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir64()
113 if (dirp->dd_loc >= dirp->dd_size) in readdir64()
114 dirp->dd_loc = dirp->dd_size = 0; in readdir64()
117 (dirp->dd_size = getdents64(dirp->dd_fd, in readdir64()
[all …]
H A Dreaddir_r.c65 if (dirp->dd_size != 0) { in readdir_r()
66 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir_r()
71 if (dirp->dd_loc >= dirp->dd_size) in readdir_r()
72 dirp->dd_loc = dirp->dd_size = 0; in readdir_r()
75 (dirp->dd_size = getdents(dirp->dd_fd, in readdir_r()
88 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir_r()
111 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir64_r()
126 if (dirp->dd_loc >= dirp->dd_size) in readdir64_r()
127 dirp->dd_loc = dirp->dd_size = 0; in readdir64_r()
130 (dirp->dd_size = getdents64(dirp->dd_fd, in readdir64_r()
[all …]
H A Dseekdir.c53 seekdir(DIR *dirp, long loc) in seekdir() argument
55 private_DIR *pdirp = (private_DIR *)dirp; in seekdir()
61 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir()
65 dirp->dd_loc = 0; in seekdir()
67 dirp->dd_size = 0; in seekdir()
86 seekdir64(DIR *dirp, off64_t loc) in seekdir64() argument
94 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir64()
108 dirp->dd_loc = 0; in seekdir64()
110 dirp->dd_size = 0; in seekdir64()
122 seekdir(DIR *dirp, long loc) in seekdir() argument
[all …]
H A D_xftw.c141 DIR *dirp; in fwalk() local
189 if (dirp == NULL) in fwalk()
195 (void) closedir(dirp); in fwalk()
255 if (dirp == NULL) { in fwalk()
259 seekdir(dirp, here); in fwalk()
263 (void) closedir(dirp); in fwalk()
291 (void) free(dirp); in nocdopendir()
308 (void) free(dirp); in nocdopendir()
338 (void) free(dirp); in nocdstat()
347 (void) free(dirp); in nocdstat()
[all …]
H A Dtelldir.c55 telldir(DIR *dirp) in telldir() argument
57 private_DIR *pdirp = (private_DIR *)dirp; in telldir()
63 if (lseek(dirp->dd_fd, 0, SEEK_CUR) != 0) { in telldir()
64 dp = (dirent_t *)(uintptr_t)(&dirp->dd_buf[dirp->dd_loc]); in telldir()
79 telldir64(DIR *dirp) in telldir64() argument
81 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in telldir64()
87 if (lseek64(dirp->dd_fd, 0, SEEK_CUR) != 0) { in telldir64()
88 dp64 = (dirent64_t *)(uintptr_t)(&dirp->dd_buf[dirp->dd_loc]); in telldir64()
106 telldir(DIR *dirp) in telldir() argument
110 off = telldir64(dirp); in telldir()
H A Dfdopendir.c53 DIR *dirp = (DIR *)pdirp; in fdopendir() local
72 dirp->dd_buf = buf; in fdopendir()
73 dirp->dd_fd = fd; in fdopendir()
74 dirp->dd_loc = 0; in fdopendir()
75 dirp->dd_size = 0; in fdopendir()
77 return (dirp); in fdopendir()
90 dirfd(DIR *dirp) in dirfd() argument
92 return (dirp->dd_fd); in dirfd()
H A Dscandir.c82 DIR *dirp; in scandir64() local
85 if ((dirp = opendir(dirname)) == NULL) in scandir64()
87 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
138 (void) closedir(dirp); in scandir64()
152 (void) closedir(dirp); in scandir64()
167 DIR *dirp; in scandir() local
170 if ((dirp = opendir(dirname)) == NULL) in scandir()
172 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir()
188 while ((d = readdir(dirp)) != NULL) { in scandir()
223 (void) closedir(dirp); in scandir()
[all …]
H A Dclosedir.c49 closedir(DIR *dirp) in closedir() argument
51 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in closedir()
52 int fd = dirp->dd_fd; in closedir()
55 lfree(dirp->dd_buf, DIRBUF); in closedir()
/illumos-gate/usr/src/cmd/fs.d/ufs/fsck/
H A Dpass2.c416 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check()
437 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check()
510 dirp = (struct direct *)((char *)(dirp) + entrysize); in pass2check()
584 if (dirp->d_ino > 0 && dirp->d_ino <= maxino) { in pass2check()
607 TRACK_LNCNTP(dirp->d_ino, lncntp[dirp->d_ino]--); in pass2check()
613 dirp = (struct direct *)((char *)(dirp) + reclen); in pass2check()
705 TRACK_LNCNTP(dirp->d_ino, lncntp[dirp->d_ino]--); in pass2check()
750 if (dirp->d_ino > maxino || dirp->d_ino == 0) { in pass2check()
819 TRACK_LNCNTP(dirp->d_ino, lncntp[dirp->d_ino] = 0); in pass2check()
855 getpathname(namebuf, dirp->d_ino, dirp->d_ino); in pass2check()
[all …]
H A Dpass3.c327 struct direct *dirp = idesc->id_dirp; in pass3acheck() local
334 if (dirp->d_ino == 0) in pass3acheck()
338 if ((strcmp(dirp->d_name, ".") == 0) || in pass3acheck()
339 (strcmp(dirp->d_name, "..") == 0)) { in pass3acheck()
343 switch (statemap[dirp->d_ino] & ~(INDELAYD)) { in pass3acheck()
357 dp = ginode(dirp->d_ino); in pass3acheck()
374 fileerror(idesc->id_number, dirp->d_ino, in pass3acheck()
377 dirp->d_ino); in pass3acheck()
378 dp = ginode(dirp->d_ino); in pass3acheck()
391 statemap[dirp->d_ino], dirp->d_ino); in pass3acheck()
/illumos-gate/usr/src/ucblib/libucb/port/gen/
H A Dreaddir.c60 internal_readdir(DIR *dirp) in internal_readdir() argument
65 if (dirp->dd_size != 0) { in internal_readdir()
66 dp = (struct dirent64 *)&dirp->dd_buf[dirp->dd_loc]; in internal_readdir()
68 dirp->dd_loc += dp->d_reclen; in internal_readdir()
70 if (dirp->dd_loc >= dirp->dd_size) in internal_readdir()
71 dirp->dd_loc = dirp->dd_size = 0; in internal_readdir()
74 (dirp->dd_size = getdents64(dirp->dd_fd, in internal_readdir()
81 dp = (struct dirent64 *)&dirp->dd_buf[dirp->dd_loc]; in internal_readdir()
97 readdir(DIR *dirp) in readdir() argument
119 readdir64(DIR *dirp) in readdir64() argument
[all …]
H A Dscandir.c81 DIR *dirp; in scandir64() local
83 if ((dirp = opendir(dirname)) == NULL) in scandir64()
85 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
118 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64()
128 (void) closedir(dirp); in scandir64()
148 DIR *dirp; in scandir() local
150 if ((dirp = opendir(dirname)) == NULL) in scandir()
152 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir()
169 while ((d = readdir(dirp)) != NULL) { in scandir()
188 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir()
[all …]
/illumos-gate/usr/src/contrib/ast/src/lib/libast/dir/
H A Dopendir.c51 register DIR* dirp = 0;
70 if (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)
89 if (dirp)
91 close(dirp->dd_fd);
[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()
222 (void) closedir(dirp); 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()
275 if (dirp == NULL) { in lf_xftw()
279 seekdir(dirp, here); 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/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/cmd/fs.d/ufs/ncheck/
H A Dncheck.c414 struct dirstuff dirp; in pass2() local
420 dirp.loc = 0; in pass2()
421 dirp.ip = ip; in pass2()
423 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass2()
455 struct dirstuff dirp; in pass3() local
460 dirp.loc = 0; in pass3()
461 dirp.ip = ip; in pass3()
463 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass3()
500 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir()
515 (dirp->dbuf + blkoff(&sblock, dirp->loc)); 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()
429 if (dirp == NULL) { in descend()
455 (void) closedir(dirp); in descend()
456 dirp = NULL; in descend()
483 curoff = telldir(dirp); in descend()
490 if (dirp == NULL) { in descend()
501 seekdir(dirp, curoff); in descend()
504 (void) closedir(dirp); in descend()
[all …]
/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
309 (void) closedir(dirp); in dotape()
354 (void) closedir(dirp); in dotape()
444 DIR *dirp; in doaudio() local
515 (void) closedir(dirp); in doaudio()
555 (void) closedir(dirp); in doaudio()
648 DIR *dirp; in dofloppy() local
726 (void) closedir(dirp); in dofloppy()
815 DIR *dirp; in docd() local
893 (void) closedir(dirp); in docd()
[all …]
/illumos-gate/usr/src/cmd/fs.d/ufs/ff/
H A Dff.c457 struct dirstuff dirp; in pass2() local
462 dirp.loc = 0; in pass2()
463 dirp.ip = ip; in pass2()
465 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass2()
495 struct dirstuff dirp; in pass3() local
501 dirp.loc = 0; in pass3()
502 dirp.ip = ip; in pass3()
504 for (dp = dreaddir(&dirp); dp != NULL; dp = dreaddir(&dirp)) { in pass3()
565 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir()
576 (dirp->dbuf + blkoff(&sblock, dirp->loc)); in dreaddir()
[all …]

1234567