| /netbsd-src/sbin/fsck_lfs/ |
| H A D | pass2.c | 216 LFS_DIRHEADER *dirp = idesc->id_dirp; in pass2check() local 230 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), ".") == 0) { in pass2check() 231 if (lfs_dir_getino(fs, dirp) != idesc->id_number) { in pass2check() 234 lfs_dir_setino(fs, dirp, idesc->id_number); in pass2check() 238 if (lfs_dir_gettype(fs, dirp) != LFS_DT_DIR) { in pass2check() 241 lfs_dir_settype(fs, dirp, LFS_DT_DIR); in pass2check() 253 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), "..") != 0) { in pass2check() 255 lfs_dir_nameptr(fs, dirp)); in pass2check() 256 } else if (lfs_dir_getreclen(fs, dirp) < entrysize) { in pass2check() 258 } else if (lfs_dir_getreclen(fs, dirp) < 2 * entrysize) { in pass2check() [all …]
|
| H A D | dir.c | 371 LFS_DIRHEADER *dirp = idesc->id_dirp; in mkentry() local 380 if (lfs_dir_getino(fs, dirp) != 0) in mkentry() 381 oldreclen = LFS_DIRSIZ(fs, dirp); in mkentry() 386 if (lfs_dir_getreclen(fs, dirp) - oldreclen < newreclen) in mkentry() 390 newreclen = lfs_dir_getreclen(fs, dirp) - oldreclen; in mkentry() 391 lfs_dir_setreclen(fs, dirp, oldreclen); in mkentry() 394 dirp = LFS_NEXTDIR(fs, dirp); in mkentry() 397 lfs_dir_setino(fs, dirp, idesc->id_parent); in mkentry() 398 lfs_dir_setreclen(fs, dirp, newreclen); in mkentry() 399 lfs_dir_settype(fs, dirp, typemap[idesc->id_parent]); in mkentry() [all …]
|
| /netbsd-src/sbin/fsck_ext2fs/ |
| H A D | pass2.c | 225 struct ext2fs_direct *dirp = idesc->id_dirp; in pass2check() local 239 if (fs2h32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 && in pass2check() 240 dirp->e2d_name[0] == '.') { in pass2check() 241 if (fs2h32(dirp->e2d_ino) != idesc->id_number) { in pass2check() 243 dirp->e2d_ino = h2fs32(idesc->id_number); in pass2check() 249 && (dirp->e2d_type != EXT2_FT_DIR)) { in pass2check() 251 dirp->e2d_type = EXT2_FT_DIR; in pass2check() 267 if (fs2h32(dirp->e2d_ino) != 0 && strcmp(dirp->e2d_name, "..") != 0) { in pass2check() 269 dirp->e2d_name); in pass2check() 270 } else if (fs2h16(dirp->e2d_reclen) < entrysize) { in pass2check() [all …]
|
| H A D | dir.c | 350 struct ext2fs_direct *dirp = idesc->id_dirp; in mkentry() local 360 if (dirp->e2d_ino != 0) in mkentry() 361 oldlen = EXT2FS_DIRSIZ(dirp->e2d_namlen); in mkentry() 364 if (fs2h16(dirp->e2d_reclen) - oldlen < newlen) in mkentry() 366 newent.e2d_reclen = h2fs16(fs2h16(dirp->e2d_reclen) - oldlen); in mkentry() 367 dirp->e2d_reclen = h2fs16(oldlen); in mkentry() 368 dirp = (struct ext2fs_direct *)(((char *)dirp) + oldlen); in mkentry() 369 dirp->e2d_ino = h2fs32(idesc->id_parent); /* ino to be entered is in id_parent */ in mkentry() 370 dirp->e2d_reclen = newent.e2d_reclen; in mkentry() 371 dirp->e2d_namlen = newent.e2d_namlen; in mkentry() [all …]
|
| /netbsd-src/lib/libc/gen/ |
| H A D | readdir.c | 57 _readdir_unlocked(DIR *dirp, int skipdeleted) in _readdir_unlocked() argument 63 if (dirp->dd_loc >= dirp->dd_size) { in _readdir_unlocked() 64 if (dirp->dd_flags & __DTF_READALL) in _readdir_unlocked() 66 dirp->dd_loc = 0; in _readdir_unlocked() 68 if (dirp->dd_loc == 0 && !(dirp->dd_flags & __DTF_READALL)) { in _readdir_unlocked() 69 dirp->dd_seek = lseek(dirp->dd_fd, (off_t)0, SEEK_CUR); in _readdir_unlocked() 70 dirp in _readdir_unlocked() 91 readdir(DIR * dirp) readdir() argument 108 readdir_r(DIR * dirp,struct dirent * entry,struct dirent ** result) readdir_r() argument [all...] |
| H A D | telldir.c | 58 telldir(DIR *dirp) in __weak_alias() 63 mutex_lock((mutex_t *)dirp->dd_lock); in __weak_alias() 64 rv = _telldir_unlocked(dirp); in __weak_alias() 65 mutex_unlock((mutex_t *)dirp->dd_lock); in __weak_alias() 68 rv = _telldir_unlocked(dirp); in __weak_alias() 76 _telldir_unlocked(DIR *dirp) in _telldir_unlocked() argument 80 for (lp = dirp->dd_internal; lp; lp = lp->dp_next) in _telldir_unlocked() 81 if (lp->dp_seek == dirp->dd_seek && in _telldir_unlocked() 82 lp->dp_loc == dirp->dd_loc) in _telldir_unlocked() 88 lp->dp_seek = dirp->dd_seek; in _telldir_unlocked() [all …]
|
| H A D | initdir.c | 56 _initdir(DIR *dirp, int fd, const char *name) in _initdir() argument 58 int flags = dirp->dd_flags; in _initdir() 116 dirp->dd_buf = buf; in _initdir() 123 dirp->dd_seek = lseek(fd, (off_t)0, SEEK_CUR); in _initdir() 157 dirp->dd_buf = buf; in _initdir() 166 dirp->dd_buf = buf; in _initdir() 241 dirp->dd_len = (int)len; in _initdir() 242 dirp->dd_size = ddptr - dirp->dd_buf; in _initdir() 244 dirp->dd_len = incr; in _initdir() 245 dirp->dd_size = 0; in _initdir() [all …]
|
| H A D | opendir.c | 78 DIR *dirp; in __opendir2() local 84 dirp = __opendir_common(fd, name, flags); in __opendir2() 85 if (dirp == NULL) { in __opendir2() 90 return dirp; in __opendir2() 118 DIR *dirp; in __opendir_common() local 123 if ((dirp = malloc(sizeof(*dirp))) == NULL) in __opendir_common() 125 dirp->dd_buf = NULL; in __opendir_common() 126 dirp->dd_internal = NULL; in __opendir_common() 129 if ((dirp->dd_lock = malloc(sizeof(mutex_t))) == NULL) in __opendir_common() 131 mutex_init((mutex_t *)dirp->dd_lock, NULL); in __opendir_common() [all …]
|
| H A D | closedir.c | 62 closedir(DIR *dirp) in __weak_alias() 66 _DIAGASSERT(dirp != NULL); in __weak_alias() 70 mutex_lock((mutex_t *)dirp->dd_lock); in __weak_alias() 72 fd = dirp->dd_fd; in __weak_alias() 73 dirp->dd_fd = -1; in __weak_alias() 74 _finidir(dirp); in __weak_alias() 78 mutex_unlock((mutex_t *)dirp->dd_lock); in __weak_alias() 79 mutex_destroy((mutex_t *)dirp->dd_lock); in __weak_alias() 80 free(dirp->dd_lock); in __weak_alias() 83 free((void *)dirp); in __weak_alias()
|
| H A D | rewinddir.c | 56 rewinddir(DIR *dirp) in __weak_alias() 62 mutex_lock((mutex_t *)dirp->dd_lock); in __weak_alias() 65 fd = dirp->dd_fd; in __weak_alias() 66 _finidir(dirp); in __weak_alias() 67 dirp->dd_seek = lseek(fd, (off_t)0, SEEK_SET); in __weak_alias() 68 _initdir(dirp, fd, NULL); in __weak_alias() 71 mutex_unlock((mutex_t *)dirp->dd_lock); in __weak_alias()
|
| /netbsd-src/sbin/fsck_ffs/ |
| H A D | pass2.c | 326 struct direct *dirp = idesc->id_dirp; local 339 if (!is_ufs2 && doinglevel2 && iswap32(dirp->d_ino) > 0 && 340 iswap32(dirp->d_ino) < maxino) { 341 dirp->d_type = inoinfo(iswap32(dirp->d_ino))->ino_type; 349 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { 350 if (iswap32(dirp->d_ino) != idesc->id_number) { 353 dirp->d_ino = iswap32(idesc->id_number); 358 if (newinofmt && dirp->d_type != DT_DIR) { 361 dirp->d_type = DT_DIR; 389 if (iswap16(dirp->d_reclen) < entrysize + UFS_DIRSIZ(0, dirp, 0)) { [all …]
|
| /netbsd-src/sbin/mount_qemufwcfg/ |
| H A D | virtdir.c | 180 VIRTDIR *dirp; in openvirtdir() local 182 dirp = emalloc(sizeof(*dirp)); in openvirtdir() 183 dirp->dirname = estrdup(d); in openvirtdir() 184 dirp->dirnamelen = strlen(d); in openvirtdir() 185 dirp->tp = tp; in openvirtdir() 186 dirp->i = 0; in openvirtdir() 187 return dirp; in openvirtdir() 193 readvirtdir(VIRTDIR *dirp) in readvirtdir() argument 197 for ( ; dirp->i < dirp->tp->c; dirp->i++) { in readvirtdir() 198 from = (strcmp(dirp->dirname, "/") == 0) ? in readvirtdir() [all …]
|
| /netbsd-src/distrib/utils/libhack/ |
| H A D | opendir.c | 60 DIR *dirp; variable 72 (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { 82 dirp->dd_len = DIRBLKSIZ; 83 dirp->dd_buf = malloc((size_t)dirp->dd_len); 84 if (dirp->dd_buf == NULL) { 85 free(dirp); 89 dirp->dd_seek = 0; 92 dirp->dd_loc = 0; 93 dirp->dd_fd = fd; 94 dirp->dd_flags = DTF_HIDEW; [all …]
|
| /netbsd-src/external/gpl3/gdb/dist/gnulib/import/ |
| H A D | opendir.c | 63 DIR *dirp; in opendir() local 65 dirp = opendir (dir_name); in opendir() 66 if (dirp == NULL) in opendir() 72 if (fd == -1 || _gl_register_dirp_fd (fd, dirp)) in opendir() 77 closedir (dirp); in opendir() 91 struct gl_directory *dirp; in opendir() 146 dirp = in opendir() 150 if (dirp == NULL) in opendir() 157 dirp->status = status; in opendir() 158 dirp->current = current; in opendir() [all …]
|
| H A D | rewinddir.c | 31 rewinddir (DIR *dirp) in rewinddir() argument 34 if (dirp->current != INVALID_HANDLE_VALUE) in rewinddir() 35 FindClose (dirp->current); in rewinddir() 38 dirp->status = -1; in rewinddir() 39 dirp->current = FindFirstFile (dirp->dir_name_mask, &dirp->entry); in rewinddir() 40 if (dirp->current == INVALID_HANDLE_VALUE) in rewinddir() 45 dirp->status = -2; in rewinddir() 49 dirp->status = ENOENT; in rewinddir()
|
| H A D | readdir.c | 32 readdir (DIR *dirp) in readdir() argument 46 switch (dirp->status) in readdir() 54 if (!FindNextFile (dirp->current, &dirp->entry)) in readdir() 59 dirp->status = -2; in readdir() 68 errno = dirp->status; in readdir() 72 dirp->status = 0; in readdir() 74 if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) in readdir() 76 else if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) in readdir() 78 else if ((dirp->entry.dwFileAttributes in readdir() 98 ((char *) dirp->entry.cFileName - offsetof (struct dirent, d_name[0])); in readdir()
|
| H A D | closedir.c | 40 closedir (DIR *dirp) in closedir() argument 43 int fd = dirfd (dirp); in closedir() 50 retval = closedir (dirp); in closedir() 58 if (dirp->current != INVALID_HANDLE_VALUE) in closedir() 59 FindClose (dirp->current); in closedir() 60 free (dirp); in closedir()
|
| H A D | fdopendir.c | 72 DIR *dirp; in fdopendir() local 78 dirp = opendir (path); in fdopendir() 79 if (!dirp) in fdopendir() 83 _gl_unregister_dirp_fd (dirfd (dirp)); in fdopendir() 86 if (_gl_register_dirp_fd (fd, dirp)) in fdopendir() 90 closedir (dirp); in fdopendir() 94 dirp = NULL; in fdopendir() 97 return dirp; in fdopendir()
|
| /netbsd-src/share/examples/refuse/virtdir/ |
| H A D | virtdir.c | 210 VIRTDIR *dirp; in openvirtdir() local 212 NEW(VIRTDIR, dirp, "openvirtdir", exit(EXIT_FAILURE)); in openvirtdir() 213 dirp->dirname = strdup(d); in openvirtdir() 214 dirp->dirnamelen = strlen(d); in openvirtdir() 215 dirp->tp = tp; in openvirtdir() 216 dirp->i = 0; in openvirtdir() 217 return dirp; in openvirtdir() 223 readvirtdir(VIRTDIR *dirp) in readvirtdir() argument 227 for ( ; dirp->i < dirp->tp->c ; dirp->i++) { in readvirtdir() 228 from = (strcmp(dirp->dirname, "/") == 0) ? in readvirtdir() [all …]
|
| /netbsd-src/external/bsd/iscsi/dist/src/initiator/ |
| H A D | virtdir.c | 212 VIRTDIR *dirp; in openvirtdir() local 214 NEW(VIRTDIR, dirp, "openvirtdir", exit(EXIT_FAILURE)); in openvirtdir() 215 dirp->dirname = strdup(d); in openvirtdir() 216 dirp->dirnamelen = strlen(d); in openvirtdir() 217 dirp->tp = tp; in openvirtdir() 218 dirp->i = 0; in openvirtdir() 219 return dirp; in openvirtdir() 225 readvirtdir(VIRTDIR *dirp) in readvirtdir() argument 229 for ( ; dirp->i < dirp->tp->c ; dirp->i++) { in readvirtdir() 230 from = (strcmp(dirp->dirname, "/") == 0) ? in readvirtdir() [all …]
|
| /netbsd-src/external/gpl2/xcvs/dist/contrib/ |
| H A D | dirfns.shar | 20 X.B *readdir(dirp) 22 X.B DIR *dirp; 26 X.B telldir(dirp) 28 X.B DIR *dirp; 31 X.B seekdir(dirp, loc) 33 X.B DIR *dirp; 38 X.B rewinddir(dirp) 40 X.B DIR *dirp; 43 X.B closedir(dirp) 45 X.B DIR *dirp; [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/src/filesystem/ |
| H A D | dir-common.h | 76 _Dir_base(posix::DIR* dirp = nullptr) : dirp(dirp) { } in _GLIBCXX_VISIBILITY() function 82 : dirp(posix::opendir(pathname)) in _GLIBCXX_VISIBILITY() 84 if (dirp) in _GLIBCXX_VISIBILITY() 96 _Dir_base(_Dir_base&& d) : dirp(std::exchange(d.dirp, nullptr)) { } in _GLIBCXX_VISIBILITY() 100 ~_Dir_base() { if (dirp) posix::closedir(dirp); } in _GLIBCXX_VISIBILITY() 108 const posix::dirent* entp = posix::readdir(dirp); in _GLIBCXX_VISIBILITY() 141 posix::DIR* dirp; in _GLIBCXX_VISIBILITY() member
|
| /netbsd-src/external/bsd/kyua-cli/dist/utils/fs/ |
| H A D | lua_module.cpp | 129 DIR** dirp = state.to_userdata< DIR* >(state.upvalue_index(1)); in files_iterator() local 130 const struct dirent* entry = ::readdir(*dirp); in files_iterator() 156 DIR** dirp = state.to_userdata< DIR* >(); in files_gc() local 159 if (*dirp != NULL) { in files_gc() 160 ::closedir(*dirp); in files_gc() 161 *dirp = NULL; in files_gc() 183 DIR** dirp = state.new_userdata< DIR* >(); in lua_fs_files() local 192 *dirp = ::opendir(path.c_str()); in lua_fs_files() 193 if (*dirp == NULL) { in lua_fs_files()
|
| /netbsd-src/external/gpl2/xcvs/dist/lib/ |
| H A D | getcwd.c | 152 register char *dirp; in __getcwd() local 190 dirp = dir + allocated; in __getcwd() 191 *--dirp = '\0'; in __getcwd() 322 size_t dirroom = dirp - dir; in __getcwd() 344 dirp = memcpy (tmp + allocated - (oldsize - dirroom), in __getcwd() 350 dirp -= namlen; in __getcwd() 351 memcpy (dirp, d->d_name, namlen); in __getcwd() 352 *--dirp = '/'; in __getcwd() 365 if (dirp == &dir[allocated - 1]) in __getcwd() 366 *--dirp = '/'; in __getcwd() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libstdc++-v3/src/filesystem/ |
| H A D | dir-common.h | 142 : dirp(_Dir_base::openat(atp, nofollow)) in _GLIBCXX_VISIBILITY() 144 if (dirp) in _GLIBCXX_VISIBILITY() 152 _Dir_base(_Dir_base&& d) : dirp(std::exchange(d.dirp, nullptr)) { } in _GLIBCXX_VISIBILITY() 156 ~_Dir_base() { if (dirp) posix::closedir(dirp); } in _GLIBCXX_VISIBILITY() 164 const posix::dirent* entp = posix::readdir(dirp); in _GLIBCXX_VISIBILITY() 250 if (::DIR* dirp = ::fdopendir(fd)) in _GLIBCXX_VISIBILITY() 251 return dirp; in _GLIBCXX_VISIBILITY() 261 posix::DIR* dirp; in _GLIBCXX_VISIBILITY() member
|