/illumos-gate/usr/src/lib/libc/port/gen/ |
H A D | readdir.c | 60 readdir(DIR *dirp) in readdir() argument 66 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir() 70 if (dirp->dd_loc >= dirp->dd_size) in readdir() 71 dirp->dd_loc = dirp->dd_size = 0; in readdir() 74 (dirp->dd_size = getdents(dirp->dd_fd, in readdir() 81 return ((dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]); in readdir() 97 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir64() 111 if (dirp->dd_loc >= dirp->dd_size) in readdir64() 112 dirp->dd_loc = dirp->dd_size = 0; in readdir64() 115 (dirp->dd_size = getdents64(dirp->dd_fd, in readdir64() [all …]
|
H A D | readdir_r.c | 63 if (dirp->dd_size != 0) { in readdir_r() 64 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; 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() 73 (dirp->dd_size = getdents(dirp->dd_fd, in readdir_r() 86 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir_r() 109 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir64_r() 124 if (dirp->dd_loc >= dirp->dd_size) in readdir64_r() 125 dirp->dd_loc = dirp->dd_size = 0; in readdir64_r() 128 (dirp->dd_size = getdents64(dirp->dd_fd, in readdir64_r() [all …]
|
H A D | seekdir.c | 51 seekdir(DIR *dirp, long loc) in seekdir() argument 53 private_DIR *pdirp = (private_DIR *)dirp; in seekdir() 59 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir() 63 dirp->dd_loc = 0; in seekdir() 65 dirp->dd_size = 0; in seekdir() 84 seekdir64(DIR *dirp, off64_t loc) in seekdir64() argument 92 dp64 = (dirent64_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir64() 106 dirp->dd_loc = 0; in seekdir64() 108 dirp->dd_size = 0; in seekdir64() 120 seekdir(DIR *dirp, long loc) in seekdir() argument [all …]
|
H A D | _xftw.c | 140 DIR *dirp; in fwalk() local 188 if (dirp == NULL) in fwalk() 254 if (dirp == NULL) { in fwalk() 258 seekdir(dirp, here); in fwalk() 262 (void) closedir(dirp); in fwalk() 290 (void) free(dirp); in nocdopendir() 304 (void) free(dirp); in nocdopendir() 307 (void) free(dirp); in nocdopendir() 337 (void) free(dirp); in nocdstat() 353 (void) free(dirp); in nocdstat() [all …]
|
H A D | telldir.c | 53 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 D | fdopendir.c | 51 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 D | scandir.c | 80 DIR *dirp; in scandir64() local 83 if ((dirp = opendir(dirname)) == NULL) in scandir64() 85 if (fstat64(dirp->dd_fd, &stb) < 0) 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() 221 (void) closedir(dirp); in scandir() [all …]
|
H A D | closedir.c | 47 closedir(DIR *dirp) in closedir() argument 49 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in closedir() 50 int fd = dirp->dd_fd; in closedir() 53 lfree(dirp->dd_buf, DIRBUF); in closedir()
|
/illumos-gate/usr/src/cmd/fs.d/ufs/fsck/ |
H A D | pass2.c | 416 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 D | pass3.c | 325 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 D | readdir.c | 58 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() 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() 72 (dirp->dd_size = getdents64(dirp->dd_fd, in internal_readdir() 79 dp = (struct dirent64 *)&dirp->dd_buf[dirp->dd_loc]; in internal_readdir() 95 readdir(DIR *dirp) in readdir() argument 117 readdir64(DIR *dirp) in readdir64() argument [all …]
|
H A D | scandir.c | 79 DIR *dirp; in scandir64() local 81 if ((dirp = opendir(dirname)) == NULL) in scandir64() 83 if (fstat64(dirp->dd_fd, &stb) < 0) 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() 186 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir() [all …]
|
/illumos-gate/usr/src/contrib/ast/src/lib/libast/dir/ |
H A D | opendir.c | 51 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 D | readdir.c | 40 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 D | seekdir.c | 41 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 D | lftw.c | 140 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 D | HBANPIVPort.cc | 76 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 D | HBAPort.cc | 213 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 D | getpreroot.c | 67 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 D | ncheck.c | 412 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() 498 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir() 513 (dirp->dbuf + blkoff(&sblock, dirp->loc)); in dreaddir() [all …]
|
/illumos-gate/usr/src/cmd/lp/lib/lp/ |
H A D | next.c | 58 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/du/ |
H A D | du.c | 282 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 D | devlink_disco.c | 160 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 D | mkdevalloc.c | 234 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 D | ff.c | 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() 563 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir() 574 (dirp->dbuf + blkoff(&sblock, dirp->loc)); in dreaddir() [all …]
|