/netbsd/sbin/fsck_lfs/ |
H A D | pass2.c | 230 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), ".") == 0) { in pass2check() 253 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), "..") != 0) { in pass2check() 274 dirp = LFS_NEXTDIR(fs, dirp); in pass2check() 290 n = LFS_DIRSIZ(fs, dirp); in pass2check() 297 dirp = (LFS_DIRHEADER *) ((char *) (dirp) + n); in pass2check() 301 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), "..") == 0) { in pass2check() 311 if (lfs_dir_getino(fs, dirp) != 0 && strcmp(lfs_dir_nameptr(fs, dirp), ".") != 0) { in pass2check() 376 (lfs_dir_getino(fs, dirp) != ULFS_WINO && lfs_dir_gettype(fs, dirp) == LFS_DT_WHT))) { in pass2check() 437 if (lfs_dir_gettype(fs, dirp) != typemap[lfs_dir_getino(fs, dirp)]) { in pass2check() 443 lfs_dir_gettype(fs, dirp), typemap[lfs_dir_getino(fs, dirp)]); in pass2check() [all …]
|
H A D | dir.c | 394 dirp = LFS_NEXTDIR(fs, dirp); in mkentry() 594 LFS_DIRHEADER *dirp; in zerodirblk() local 596 dirp = buf; in zerodirblk() 597 lfs_dir_setino(fs, dirp, 0); in zerodirblk() 600 lfs_dir_setnamlen(fs, dirp, 0); in zerodirblk() 674 LFS_DIRHEADER *dirp; in allocdir() local 688 lfs_dir_setino(fs, dirp, ino); in allocdir() 691 lfs_dir_setnamlen(fs, dirp, 1); in allocdir() 695 dirp = LFS_NEXTDIR(fs, dirp); in allocdir() 696 lfs_dir_setino(fs, dirp, parent); in allocdir() [all …]
|
/netbsd/sbin/fsck_ext2fs/ |
H A D | pass2.c | 239 if (fs2h32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 && in pass2check() 267 if (fs2h32(dirp->e2d_ino) != 0 && strcmp(dirp->e2d_name, "..") != 0) { in pass2check() 269 dirp->e2d_name); in pass2check() 283 dirp = (struct ext2fs_direct *)((char *)(dirp) + entrysize); in pass2check() 310 dirp = (struct ext2fs_direct *)((char *)(dirp) + n); in pass2check() 333 dirp->e2d_name); in pass2check() 362 dirp->e2d_ino = 0; in pass2check() 369 dirp->e2d_ino = 0; in pass2check() 440 dirp->e2d_type = in pass2check() 453 statemap[fs2h32(dirp->e2d_ino)], fs2h32(dirp->e2d_ino)); in pass2check() [all …]
|
/netbsd/lib/libc/gen/ |
H A D | readdir.c | 62 if (dirp->dd_loc >= dirp->dd_size) { in _readdir_unlocked() 65 dirp->dd_loc = 0; in _readdir_unlocked() 67 if (dirp->dd_loc == 0 && !(dirp->dd_flags & __DTF_READALL)) { in _readdir_unlocked() 68 dirp->dd_seek = lseek(dirp->dd_fd, (off_t)0, SEEK_CUR); in _readdir_unlocked() 69 dirp->dd_size = getdents(dirp->dd_fd, in _readdir_unlocked() 70 dirp->dd_buf, (size_t)dirp->dd_len); in _readdir_unlocked() 71 if (dirp->dd_size <= 0) in _readdir_unlocked() 75 (void *)(dirp->dd_buf + (size_t)dirp->dd_loc); in _readdir_unlocked() 79 if (dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) in _readdir_unlocked() 81 dirp->dd_loc += dp->d_reclen; in _readdir_unlocked() [all …]
|
H A D | telldir.c | 58 telldir(DIR *dirp) in __weak_alias() 64 rv = _telldir_unlocked(dirp); in __weak_alias() 68 rv = _telldir_unlocked(dirp); in __weak_alias() 76 _telldir_unlocked(DIR *dirp) in _telldir_unlocked() argument 88 lp->dp_seek = dirp->dd_seek; in _telldir_unlocked() 89 lp->dp_loc = dirp->dd_loc; in _telldir_unlocked() 91 dirp->dd_internal = lp; in _telldir_unlocked() 105 _DIAGASSERT(dirp != NULL); in _seekdir_unlocked() 114 if (lp->dp_loc == dirp->dd_loc && lp->dp_seek == dirp->dd_seek) in _seekdir_unlocked() 117 dirp->dd_seek = lseek(dirp->dd_fd, lp->dp_seek, SEEK_SET); in _seekdir_unlocked() [all …]
|
H A D | initdir.c | 157 dirp->dd_buf = buf; in _initdir() 166 dirp->dd_buf = buf; 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() 246 dirp->dd_buf = malloc((size_t)dirp->dd_len); in _initdir() 249 dirp->dd_seek = 0; in _initdir() 252 dirp->dd_loc = 0; in _initdir() 253 dirp->dd_fd = fd; in _initdir() 263 _finidir(DIR *dirp) in _finidir() argument [all …]
|
H A D | opendir.c | 78 DIR *dirp; in __opendir2() local 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() 161 return (dirp); in __opendir_common() 164 if (dirp != NULL) { in __opendir_common() 168 free(dirp->dd_lock); in __opendir_common() 171 free(dirp->dd_buf); 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/sbin/fsck_ffs/ |
H A D | pass2.c | 341 dirp->d_type = inoinfo(iswap32(dirp->d_ino))->ino_type; 349 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { 406 dirp->d_reclen = iswap16(iswap16(dirp->d_reclen) - entrysize); 407 memmove(newdirp, dirp, iswap16(dirp->d_reclen)); 412 dirp = newdirp; 446 dirp = (struct direct *)((char *)(dirp) + n); 450 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) { 465 if (dirp->d_reclen < entrysize + UFS_DIRSIZ(0, dirp, 0)) { 505 memmove(newdirp, dirp, dirp->d_reclen); 599 iswap32(dirp->d_ino), iswap32(dirp->d_ino)); [all …]
|
/netbsd/sbin/mount_qemufwcfg/ |
H A D | virtdir.c | 180 VIRTDIR *dirp; in openvirtdir() local 182 dirp = emalloc(sizeof(*dirp)); in openvirtdir() 185 dirp->tp = tp; in openvirtdir() 186 dirp->i = 0; in openvirtdir() 187 return dirp; in openvirtdir() 197 for ( ; dirp->i < dirp->tp->c; dirp->i++) { in readvirtdir() 199 &dirp->tp->v[dirp->i].name[1] : in readvirtdir() 200 &dirp->tp->v[dirp->i].name[dirp->dirnamelen + 1]; in readvirtdir() 201 if (strncmp(dirp->tp->v[dirp->i].name, dirp->dirname, in readvirtdir() 204 return &dirp->tp->v[dirp->i++]; in readvirtdir() [all …]
|
/netbsd/distrib/utils/libhack/ |
H A D | opendir.c | 60 DIR *dirp; variable 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; 99 dirp->dd_rewind = telldir(dirp); [all …]
|
/netbsd/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() 77 closedir (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() 167 int fd = dirfd (dirp); in opendir() 171 closedir (dirp); 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()
|
/netbsd/external/gpl3/gdb.old/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() 77 closedir (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() 167 int fd = dirfd (dirp); in opendir() 171 closedir (dirp); 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()
|
/netbsd/external/bsd/iscsi/dist/src/initiator/ |
H A D | virtdir.c | 212 VIRTDIR *dirp; in openvirtdir() local 217 dirp->tp = tp; in openvirtdir() 218 dirp->i = 0; in openvirtdir() 219 return dirp; in openvirtdir() 229 for ( ; dirp->i < dirp->tp->c ; dirp->i++) { in readvirtdir() 231 &dirp->tp->v[dirp->i].name[1] : in readvirtdir() 232 &dirp->tp->v[dirp->i].name[dirp->dirnamelen + 1]; in readvirtdir() 233 if (strncmp(dirp->tp->v[dirp->i].name, dirp->dirname, in readvirtdir() 237 return &dirp->tp->v[dirp->i++]; in readvirtdir() 247 free(dirp->dirname); in closevirtdir() [all …]
|
/netbsd/share/examples/refuse/virtdir/ |
H A D | virtdir.c | 210 VIRTDIR *dirp; in openvirtdir() local 215 dirp->tp = tp; in openvirtdir() 216 dirp->i = 0; in openvirtdir() 217 return dirp; in openvirtdir() 227 for ( ; dirp->i < dirp->tp->c ; dirp->i++) { in readvirtdir() 229 &dirp->tp->v[dirp->i].name[1] : in readvirtdir() 230 &dirp->tp->v[dirp->i].name[dirp->dirnamelen + 1]; in readvirtdir() 231 if (strncmp(dirp->tp->v[dirp->i].name, dirp->dirname, in readvirtdir() 235 return &dirp->tp->v[dirp->i++]; in readvirtdir() 245 free(dirp->dirname); in closevirtdir() [all …]
|
/netbsd/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; 33 X.B DIR *dirp; 40 X.B DIR *dirp; 45 X.B DIR *dirp; 294 X#define rewinddir(dirp) seekdir((dirp), (long)0) 403 X dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, 410 X if (dirp->dd_loc >= dirp->dd_size) { [all …]
|
/netbsd/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/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()
|