/titanic_50/usr/src/lib/libc/port/gen/ |
H A D | readdir.c | 62 readdir(DIR *dirp) in readdir() argument 67 if (dirp->dd_size != 0) { in readdir() 68 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir() 69 saveloc = dirp->dd_loc; /* save for possible EOF */ in readdir() 70 dirp->dd_loc += (int)dp->d_reclen; in readdir() 72 if (dirp->dd_loc >= dirp->dd_size) in readdir() 73 dirp->dd_loc = dirp->dd_size = 0; in readdir() 75 if (dirp->dd_size == 0 && /* refill buffer */ in readdir() 76 (dirp->dd_size = getdents(dirp->dd_fd, in readdir() 77 (dirent_t *)(uintptr_t)dirp->dd_buf, DIRBUF)) <= 0) { in readdir() [all …]
|
H A D | readdir_r.c | 58 readdir_r(DIR *dirp, dirent_t *entry, dirent_t **result) in readdir_r() argument 60 private_DIR *pdirp = (private_DIR *)dirp; in readdir_r() 65 if (dirp->dd_size != 0) { in readdir_r() 66 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in readdir_r() 67 saveloc = dirp->dd_loc; /* save for possible EOF */ in readdir_r() 68 dirp->dd_loc += (int)dp->d_reclen; 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() 74 if (dirp->dd_size == 0 && /* refill buffer */ in readdir_r() 75 (dirp->dd_size = getdents(dirp->dd_fd, in readdir_r() [all …]
|
H A D | seekdir.c | 53 seekdir(DIR *dirp, long loc) in seekdir() argument 55 private_DIR *pdirp = (private_DIR *)dirp; in seekdir() 60 if (lseek(dirp->dd_fd, 0, SEEK_CUR) != 0) { in seekdir() 61 dp = (dirent_t *)(uintptr_t)&dirp->dd_buf[dirp->dd_loc]; in seekdir() 65 dirp->dd_loc = 0; in seekdir() 66 (void) lseek(dirp->dd_fd, loc, SEEK_SET); in seekdir() 67 dirp->dd_size = 0; in seekdir() 73 ((dirent_t *)(uintptr_t)&dirp->dd_buf[0])->d_off = loc; in seekdir() 86 seekdir64(DIR *dirp, off64_t loc) in seekdir64() argument 88 private_DIR *pdirp = (private_DIR *)(uintptr_t)dirp; in seekdir64() [all …]
|
H A D | _xftw.c | 143 DIR *dirp; in fwalk() local 183 dirp = nocdopendir(path, vp); in fwalk() 191 if (dirp == NULL) in fwalk() 197 (void) closedir(dirp); in fwalk() 206 while (direntp = readdir(dirp)) { in fwalk() 217 (void) closedir(dirp); in fwalk() 233 here = telldir(dirp); in fwalk() 234 if (closedir(dirp) < 0) { in fwalk() 248 (void) closedir(dirp); in fwalk() 256 dirp = nocdopendir(path, vp); in fwalk() [all …]
|
H A D | telldir.c | 55 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 D | fdopendir.c | 53 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 D | scandir.c | 82 DIR *dirp; in scandir64() local 85 if ((dirp = opendir(dirname)) == NULL) in scandir64() 87 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64() 103 while ((d = readdir64(dirp)) != NULL) { 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() [all …]
|
/titanic_50/usr/src/lib/libbc/libc/gen/common/ |
H A D | readdir.c | 36 readdir(dirp) in readdir() argument 37 register DIR *dirp; in readdir() 43 if (dirp->dd_size != 0) { 44 dp = (struct dirent *)&dirp->dd_buf[dirp->dd_loc]; 45 saveloc = dirp->dd_loc; /* save for possible EOF */ 46 dirp->dd_loc += dp->d_reclen; 48 if (dirp->dd_loc >= dirp->dd_size) 49 dirp->dd_loc = dirp->dd_size = 0; 51 if (dirp->dd_size == 0 /* refill buffer */ 52 && (dirp->dd_size = getdents(dirp->dd_fd, dirp->dd_buf, dirp->dd_bsize) [all …]
|
H A D | seekdir.c | 37 seekdir(dirp, tell) in seekdir() argument 38 register DIR *dirp; in seekdir() 44 curloc = telldir(dirp); 47 dirp->dd_loc = 0; 48 (void) lseek(dirp->dd_fd, tell, 0); 49 dirp->dd_size = 0; 50 dirp->dd_off = tell; 56 rewinddir(dirp) in rewinddir() argument 57 DIR *dirp; in rewinddir() 59 seekdir(dirp, 0);
|
H A D | opendir.c | 42 register DIR *dirp; local 60 if (((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) || 61 ((dirp->dd_buf = malloc(sb.st_blksize)) == NULL)) { 62 if (dirp) 63 free(dirp); 67 dirp->dd_fd = fd; 68 dirp->dd_loc = 0; 69 dirp->dd_size = 0; 70 dirp->dd_bsize = sb.st_blksize; 71 dirp->dd_off = 0; [all …]
|
H A D | ftw.c | 114 DIR *dirp; local 153 dirp = opendir(path); 161 if(dirp == NULL) 173 closedir(dirp); 189 while((dp = readdir(dirp)) != NULL) { 202 here = telldir(dirp); 203 closedir(dirp); 214 closedir(dirp); 222 dirp = opendir(path); 223 if(dirp == NULL) { [all …]
|
H A D | closedir.c | 36 closedir(dirp) in closedir() argument 37 register DIR *dirp; in closedir() 43 fd = dirp->dd_fd; 44 dirp->dd_fd = -1; 45 dirp->dd_loc = 0; 46 free(dirp->dd_buf); 47 free((char *)dirp);
|
H A D | scandir.c | 46 DIR *dirp; in scandir() local 48 if ((dirp = opendir(dirname)) == NULL) in scandir() 50 if (fstat(dirp->dd_fd, &stb) < 0) in scandir() 63 while ((d = readdir(dirp)) != NULL) { in scandir() 81 if (fstat(dirp->dd_fd, &stb) < 0) in scandir() 91 closedir(dirp); in scandir()
|
/titanic_50/usr/src/cmd/fs.d/ufs/fsck/ |
H A D | pass2.c | 397 struct direct *dirp = idesc->id_dirp; in pass2check() local 418 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check() 419 if (dirp->d_ino != idesc->id_number) { in pass2check() 421 dirp->d_ino = idesc->id_number; in pass2check() 439 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check() 441 dirp->d_name); in pass2check() 443 } else if ((int)dirp->d_reclen < entrysize) { in pass2check() 446 } else if ((int)dirp->d_reclen < 2 * entrysize) { in pass2check() 455 proto.d_reclen = dirp->d_reclen; in pass2check() 456 (void) memmove((void *)dirp, (void *)&proto, in pass2check() [all …]
|
/titanic_50/usr/src/ucblib/libucb/port/gen/ |
H A D | readdir.c | 60 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() 67 saveloc = dirp->dd_loc; /* save for possible EOF */ 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() 73 if (dirp->dd_size == 0 && /* refill buffer */ in internal_readdir() 74 (dirp->dd_size = getdents64(dirp->dd_fd, in internal_readdir() 75 (struct dirent64 *)dirp->dd_buf, DIRBUF)) <= 0) { in internal_readdir() [all …]
|
H A D | scandir.c | 81 DIR *dirp; in scandir64() local 83 if ((dirp = opendir(dirname)) == NULL) in scandir64() 85 if (fstat64(dirp->dd_fd, &stb) < 0) in scandir64() 99 while ((d = readdir64(dirp)) != NULL) { 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() [all …]
|
/titanic_50/usr/src/lib/libast/common/dir/ |
H A D | opendir.c | 51 register DIR* dirp = 0; 59 !(dirp = freedirp ? freedirp : 68 if (dirp) 70 if (!freedirp) freedirp = dirp; 71 else free(dirp); 76 dirp->dd_fd = fd; 77 dirp->dd_loc = dirp->dd_size = 0; /* refill needed */ 79 dirp->dd_buf = (void*)((char*)dirp + sizeof(DIR)); 81 return(dirp); 85 closedir(register DIR* dirp) [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))
|
/titanic_50/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() 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 …]
|
/titanic_50/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()
|
/titanic_50/usr/src/lib/libast/common/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()
|
/titanic_50/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);
|
/titanic_50/usr/src/cmd/fs.d/ufs/ncheck/ |
H A D | ncheck.c | 414 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() 493 dreaddir(struct dirstuff *dirp) in dreaddir() argument 500 if (dirp->loc >= (int)dirp->ip->di_size) in dreaddir() [all …]
|
/titanic_50/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() 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 …]
|