/openbsd/gnu/usr.bin/cvs/os2/ |
H A D | dirent.c | 51 dirp = malloc(sizeof(*dirp)); in opendir() 52 if (NULL == dirp) in opendir() 59 free(dirp); in opendir() 63 dirp->max_ent = 0; in opendir() 90 if (dirp->tot_ent >= dirp->max_ent) in opendir() 95 p = realloc(dirp->entp, dirp->max_ent * sizeof(entp)); in opendir() 117 dirp->entp[dirp->tot_ent++] = entp; in opendir() 127 closedir(dirp); in opendir() 134 if (dirp->cur_ent < 0 || dirp->cur_ent >= dirp->tot_ent) in readdir() 137 return(dirp->entp[dirp->cur_ent++]); in readdir() [all …]
|
H A D | dirent.h | 44 struct dirent * readdir(DIR *dirp); 45 long telldir(DIR *dirp); 46 void seekdir(DIR *dirp, long loc); 47 void rewinddir(DIR *dirp); 48 void closedir(DIR *dirp);
|
/openbsd/libexec/ld.so/ |
H A D | dir.c | 54 _dl_DIR *dirp; in _dl_opendir() local 65 dirp->dd_fd = fd; in _dl_opendir() 69 dirp->dd_buf = _dl_malloc(dirp->dd_len); in _dl_opendir() 71 _dl_free(dirp); in _dl_opendir() 76 return (dirp); in _dl_opendir() 90 _dl_free(dirp); in _dl_closedir() 104 if (dirp->dd_loc >= dirp->dd_size) { in _dl_readdir() 108 dirp->dd_size = _dl_getdents(dirp->dd_fd, in _dl_readdir() 109 dirp->dd_buf, dirp->dd_len); in _dl_readdir() 113 dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); in _dl_readdir() [all …]
|
/openbsd/gnu/usr.bin/cvs/vms/ |
H A D | ndir.c | 158 dirp->file_spec.dsc$w_length = strlen (dirp->file_spec.dsc$a_pointer); 166 dirp->dir_spec.dsc$w_length = strlen (dirp->dir_spec.dsc$a_pointer); 169 dirp->context = 0; 170 dirp->uflags = 2; 172 dirp->s_dir.dd_loc = dirp->s_dir.dd_size = 0; /* refill needed */ 192 vms_closedir (dirp) in vms_closedir() argument 276 dirp->dd_size = strlen (dirp->dd_buf); 290 dirp->dd_loc = dirp->dd_size; /* only one record at a time */ 297 vms_readdir (dirp) in vms_readdir() argument 304 if (dirp->dd_loc >= dirp->dd_size) [all …]
|
/openbsd/sbin/fsck_ext2fs/ |
H A D | pass2.c | 208 if (letoh32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 && in pass2check() 236 if (letoh32(dirp->e2d_ino) != 0 && strcmp(dirp->e2d_name, "..") != 0) { in pass2check() 238 dirp->e2d_name); in pass2check() 252 dirp = (struct ext2fs_direct *)((char *)(dirp) + entrysize); in pass2check() 279 dirp = (struct ext2fs_direct *)((char *)(dirp) + n); in pass2check() 302 dirp->e2d_name); in pass2check() 331 dirp->e2d_ino = 0; in pass2check() 338 dirp->e2d_ino = 0; in pass2check() 389 letoh32(dirp->e2d_ino), letoh32(dirp->e2d_ino)); in pass2check() 408 dirp->e2d_type = in pass2check() [all …]
|
H A D | dir.c | 320 if (dirp->e2d_ino != 0) in mkentry() 327 dirp->e2d_reclen = htole16(oldlen); in mkentry() 328 dirp = (struct ext2fs_direct *)(((char *)dirp) + oldlen); in mkentry() 332 dirp->e2d_type = newent.e2d_type; in mkentry() 333 memcpy(dirp->e2d_name, idesc->id_name, (size_t)(dirp->e2d_namlen)); in mkentry() 341 u_int16_t namlen = dirp->e2d_namlen; in chgino() 351 dirp->e2d_type = 0; in chgino() 581 struct ext2fs_dirtemplate *dirp; in allocdir() local 598 dirp = &dirhead; in allocdir() 599 dirp->dot_ino = htole32(ino); in allocdir() [all …]
|
/openbsd/lib/libc/gen/ |
H A D | seekdir.c | 29 seekdir(DIR *dirp, long loc) in seekdir() argument 38 _MUTEX_LOCK(&dirp->dd_lock); in seekdir() 39 if (dirp->dd_size && dirp->dd_bufpos == loc) { in seekdir() 40 dirp->dd_loc = 0; in seekdir() 41 dirp->dd_curpos = loc; in seekdir() 46 for (dirp->dd_loc = 0; in seekdir() 47 dirp->dd_loc < dirp->dd_size; in seekdir() 49 dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); in seekdir() 61 dirp->dd_curpos = loc; in seekdir() 71 dirp->dd_loc = dirp->dd_size; in seekdir() [all …]
|
H A D | opendir.c | 49 DIR *dirp; in opendir() local 55 if (dirp == NULL) in opendir() 57 return (dirp); in opendir() 67 DIR *dirp; in fdopendir() local 79 dirp->dd_bufpos = dirp->dd_curpos = lseek(fd, 0, SEEK_CUR); in fdopendir() 87 return (dirp); in fdopendir() 94 DIR *dirp; in __fdopendir() local 109 dirp->dd_buf = malloc(dirp->dd_len); in __fdopendir() 111 free(dirp); in __fdopendir() 116 dirp->dd_loc = 0; in __fdopendir() [all …]
|
H A D | readdir.c | 46 if (dirp->dd_loc >= dirp->dd_size) { in _readdir_unlocked() 47 dirp->dd_loc = 0; in _readdir_unlocked() 48 dirp->dd_size = getdents(dirp->dd_fd, dirp->dd_buf, in _readdir_unlocked() 49 dirp->dd_len); in _readdir_unlocked() 50 if (dirp->dd_size == 0) in _readdir_unlocked() 52 if (dirp->dd_size < 0) in _readdir_unlocked() 55 dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); in _readdir_unlocked() 58 dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) { in _readdir_unlocked() 65 dirp->dd_curpos = dp->d_off; in _readdir_unlocked() 72 readdir(DIR *dirp) in readdir() argument [all …]
|
H A D | closedir.c | 42 closedir(DIR *dirp) in closedir() argument 46 _MUTEX_LOCK(&dirp->dd_lock); in closedir() 47 fd = dirp->dd_fd; in closedir() 48 dirp->dd_fd = -1; in closedir() 49 free(dirp->dd_buf); in closedir() 50 _MUTEX_UNLOCK(&dirp->dd_lock); in closedir() 51 _MUTEX_DESTROY(&dirp->dd_lock); in closedir() 52 free(dirp); in closedir()
|
H A D | scandir.c | 63 scandir_dirp(DIR *dirp, struct dirent ***namelist, in scandir_dirp() argument 72 if (fstat(dirp->dd_fd, &stb) == -1) in scandir_dirp() 88 while ((d = readdir(dirp)) != NULL) { in scandir_dirp() 99 if (fstat(dirp->dd_fd, &stb) == -1) in scandir_dirp() 127 closedir(dirp); in scandir_dirp() 138 closedir(dirp); in scandir_dirp() 147 DIR *dirp; in scandir() local 149 if ((dirp = opendir(dirname)) == NULL) in scandir() 160 DIR *dirp; in scandirat() local 166 dirp = __fdopendir(fd); in scandirat() [all …]
|
H A D | ttyname.c | 115 struct dirent *dirp; in oldttyname() local 123 while ((dirp = readdir(dp))) { in oldttyname() 124 if (dirp->d_type != DT_CHR && dirp->d_type != DT_UNKNOWN) in oldttyname() 126 if (fstatat(dirfd(dp), dirp->d_name, &dsb, AT_SYMLINK_NOFOLLOW) in oldttyname() 129 if (dirp->d_namlen > len - sizeof(_PATH_DEV)) { in oldttyname() 132 memcpy(buf + sizeof(_PATH_DEV) - 1, dirp->d_name, in oldttyname() 133 dirp->d_namlen + 1); in oldttyname()
|
H A D | readdir_r.c | 39 readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) in readdir_r() argument 43 _MUTEX_LOCK(&dirp->dd_lock); in readdir_r() 44 if (_readdir_unlocked(dirp, &dp) != 0) { in readdir_r() 45 _MUTEX_UNLOCK(&dirp->dd_lock); in readdir_r() 51 _MUTEX_UNLOCK(&dirp->dd_lock); in readdir_r()
|
H A D | telldir.c | 39 telldir(DIR *dirp) in telldir() argument 43 _MUTEX_LOCK(&dirp->dd_lock); in telldir() 44 i = dirp->dd_curpos; in telldir() 45 _MUTEX_UNLOCK(&dirp->dd_lock); in telldir()
|
H A D | devname.c | 50 DIR *dirp; in devname_nodb() local 52 if ((dirp = opendir(_PATH_DEV)) == NULL) in devname_nodb() 54 while ((dp = readdir(dirp)) != NULL) { in devname_nodb() 57 if (fstatat(dirfd(dirp), dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) in devname_nodb() 64 closedir(dirp); in devname_nodb()
|
/openbsd/sbin/fsck_ffs/ |
H A D | pass2.c | 261 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check() 282 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check() 284 dirp->d_name); in pass2check() 298 dirp = (struct direct *)((char *)(dirp) + entrysize); in pass2check() 321 dirp = (struct direct *)((char *)(dirp) + n); in pass2check() 325 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) { in pass2check() 335 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") != 0) { in pass2check() 338 dirp->d_name); in pass2check() 423 dirp->d_ino, dirp->d_ino); in pass2check() 440 if (dirp->d_type != GET_ITYPE(dirp->d_ino)) { in pass2check() [all …]
|
H A D | dir.c | 292 if (dirp->d_ino != 0) in mkentry() 293 oldlen = DIRSIZ(dirp); in mkentry() 299 dirp->d_reclen = oldlen; in mkentry() 300 dirp = (struct direct *)(((char *)dirp) + oldlen); in mkentry() 305 memcpy(dirp->d_name, idesc->id_name, (size_t)dirp->d_namlen + 1); in mkentry() 314 if (memcmp(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1)) in chgino() 316 dirp->d_ino = idesc->id_parent; in chgino() 558 struct dirtemplate *dirp; in allocdir() local 562 dirp = &dirhead; in allocdir() 563 dirp->dot_ino = ino; in allocdir() [all …]
|
/openbsd/gnu/usr.bin/cvs/windows-NT/ |
H A D | ndir.c | 42 DIR *dirp; in opendir() local 66 dirp->dd_loc = 0; in opendir() 67 dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0; in opendir() 71 free (dirp); in opendir() 93 dirp->dd_cp = dirp->dd_cp->_d_next = dp; in opendir() 95 dirp->dd_contents = dirp->dd_cp = dp; in opendir() 103 dirp->dd_cp = dirp->dd_contents; in opendir() 107 return dirp; in opendir() 120 readdir (DIR *dirp) in readdir() argument 132 dirp->dd_cp = dirp->dd_cp->_d_next; in readdir() [all …]
|
/openbsd/sbin/restore/ |
H A D | dirs.c | 465 dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); in rst_seekdir() 478 dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, in rst_readdir() 485 if (dirp->dd_loc >= dirp->dd_size) { in rst_readdir() 489 dp = (struct direct *)(dirp->dd_buf + dirp->dd_loc); in rst_readdir() 515 RST_DIR *dirp; in rst_opendir() local 522 return (dirp); in rst_opendir() 534 free(dirp); in rst_closedir() 545 (off_t)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc); in rst_telldir() 554 RST_DIR *dirp; in opendirfile() local 563 dirp->dd_fd = fd; in opendirfile() [all …]
|
/openbsd/gnu/usr.bin/cvs/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 …]
|
/openbsd/usr.sbin/lpr/common_source/ |
H A D | common.c | 233 DIR *dirp; in getq() local 236 dirp = opendir(SD); in getq() 238 if (dirp == NULL) in getq() 284 closedir(dirp); in getq() 296 closedir(dirp); in getq() 460 DIR *dirp; in ckqueue() local 464 dirp = opendir(spooldir); in ckqueue() 467 dirp = opendir(_PATH_DEFSPOOL); in ckqueue() 469 if (dirp == NULL) in ckqueue() 473 closedir(dirp); in ckqueue() [all …]
|
/openbsd/gnu/usr.bin/perl/win32/include/ |
H A D | dirent.h | 46 struct direct * win32_readdir(DIR *dirp); 47 long win32_telldir(DIR *dirp); 48 void win32_seekdir(DIR *dirp,long loc); 49 void win32_rewinddir(DIR *dirp); 50 int win32_closedir(DIR *dirp);
|
/openbsd/gnu/usr.bin/cvs/src/ |
H A D | find_names.c | 264 DIR *dirp; local 267 if ((dirp = CVS_OPENDIR (dir)) == NULL) 272 while ((dp = CVS_READDIR (dirp)) != NULL) 291 (void) CVS_CLOSEDIR (dirp); 295 (void) CVS_CLOSEDIR (dirp); 317 DIR *dirp; local 330 if ((dirp = CVS_OPENDIR (dir)) == NULL) 335 while ((dp = CVS_READDIR (dirp)) != NULL) 417 (void) CVS_CLOSEDIR (dirp); 421 (void) CVS_CLOSEDIR (dirp);
|
/openbsd/gnu/usr.bin/perl/win32/ |
H A D | win32.c | 971 Newx(dirp->start, dirp->size, char); in win32_opendir() 974 dirp->end = dirp->curr = dirp->start; in win32_opendir() 991 strcpy(dirp->dirstr.d_name, dirp->curr); in win32_readdir() 995 dirp->dirstr.d_ino = dirp->curr - dirp->start; in win32_readdir() 999 if (dirp->curr >= dirp->end) { in win32_readdir() 1025 long endpos = dirp->end - dirp->start; in win32_readdir() 1036 dirp->end = dirp->start + newsize; in win32_readdir() 1057 return dirp->curr ? (dirp->curr - dirp->start) : -1; in win32_telldir() 1069 dirp->curr = dirp->start + loc; in win32_seekdir() 1079 dirp->curr = dirp->start; in win32_rewinddir() [all …]
|
/openbsd/sys/nfs/ |
H A D | nfs_serv.c | 486 if (dirp) { in nfsrv_lookup() 1067 if (dirp) { in nfsrv_create() 1081 if (dirp) in nfsrv_create() 1289 if (dirp) in nfsrv_create() 1358 if (dirp) in nfsrv_mknod() 1366 if (dirp) in nfsrv_mknod() 1475 if (dirp) in nfsrv_mknod() 2077 if (dirp) in nfsrv_symlink() 2154 if (dirp) in nfsrv_mkdir() 2215 if (dirp) in nfsrv_mkdir() [all …]
|