/titanic_41/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_41/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);
|
/titanic_41/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_41/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_41/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_41/usr/src/cmd/fs.d/cachefs/common/ |
H A D | subr.c | 447 cachefs_create_cache(char *dirp, struct cachefs_user_values *uv, in cachefs_create_cache() argument 465 if (strlen(dirp) > (size_t)PATH_MAX) { in cachefs_create_cache() 466 pr_err(gettext("path name %s is too long."), dirp); in cachefs_create_cache() 471 parent = cachefs_file_to_dir(dirp); in cachefs_create_cache() 489 if (mkdir(dirp, 0) == -1) { in cachefs_create_cache() 492 pr_err(gettext("%s already exists."), dirp); in cachefs_create_cache() 497 dirp, strerror(errno)); in cachefs_create_cache() 506 xx = cachefs_convert_uv2cl(uv, clabel, dirp); in cachefs_create_cache() 516 snprintf(path, sizeof (path), "%s/%s", dirp, CACHEFS_LOCK_FILE); in cachefs_create_cache() 526 snprintf(path, sizeof (path), "%s/%s", dirp, BACKMNT_NAME); in cachefs_create_cache() [all …]
|
/titanic_41/usr/src/cmd/backup/dump/ |
H A D | lftw.c | 144 DIR *dirp; in lf_xftw() local 194 dirp = opendir(path); in lf_xftw() 202 if (dirp == NULL) in lf_xftw() 216 if (rc != 0 || dirp == NULL) in lf_xftw() 226 (void) closedir(dirp); in lf_xftw() 244 while ((dp = readdir(dirp)) != NULL) { in lf_xftw() 258 here = telldir(dirp); in lf_xftw() 259 (void) closedir(dirp); in lf_xftw() 270 (void) closedir(dirp); in lf_xftw() 278 dirp = opendir(path); in lf_xftw() [all …]
|
/titanic_41/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_41/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_41/usr/src/cmd/fs.d/cachefs/cfsadmin/ |
H A D | cfsadmin.c | 103 int update_cachelabel(char *dirp, char *optionp); 106 int cache_stats(char *dirp); 107 int resource_file_grow(char *dirp, int oldcnt, int newcnt); 108 int resource_file_dirty(char *dirp); 585 update_cachelabel(char *dirp, char *optionp) in update_cachelabel() argument 594 if (cachefs_inuse(dirp)) { in update_cachelabel() 596 dirp); in update_cachelabel() 601 if (strlen(dirp) > (size_t)PATH_MAX) { in update_cachelabel() 603 dirp); in update_cachelabel() 608 sprintf(path, "%s/%s", dirp, CACHELABEL_NAME); in update_cachelabel() [all …]
|
/titanic_41/usr/src/cmd/fs.d/cachefs/cachefspack/ |
H A D | funcs.c | 47 prtfn(char *pathnam, char *fnam, DIR *dirp, int depth) in prtfn() argument 57 packfn(char *pathnam, char *fnam, DIR *dirp, int depth) in packfn() argument 71 printf("packfn: dirp = %x depth = %d\n", dirp, depth); in packfn() 101 xx = ioctl(dirp->dd_fd, CACHEFSIO_PACK, &pack); in packfn() 124 unpackfn(char *pathnam, char *fnam, DIR *dirp, int depth) in unpackfn() argument 137 printf("unpackfn: dirp = %x depth = %d\n", dirp, depth); in unpackfn() 162 xx = ioctl(dirp->dd_fd, CACHEFSIO_UNPACK, &pack); in unpackfn() 186 inquirefn(char *pathnam, char *fnam, DIR *dirp, int depth) in inquirefn() argument 199 printf("inquirefn: dirp = %x depth = %d\n", dirp, depth); in inquirefn() 225 xx = ioctl(dirp->dd_fd, CACHEFSIO_PACKINFO, &pack); in inquirefn()
|
/titanic_41/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);
|