Home
last modified time | relevance | path

Searched refs:dirp (Results 1 – 25 of 110) sorted by relevance

12345

/openbsd-src/gnu/usr.bin/cvs/os2/
H A Ddirent.c34 auto DIR *dirp; in opendir() local
51 dirp = malloc(sizeof(*dirp)); in opendir()
52 if (NULL == dirp) in opendir()
56 dirp->dirname = malloc(len + 5); in opendir()
57 if (NULL == dirp->dirname) in opendir()
59 free(dirp); in opendir()
63 dirp->max_ent = 0; in opendir()
64 dirp->tot_ent = 0; in opendir()
65 dirp->cur_ent = 0; in opendir()
66 dirp->entp = NULL; in opendir()
[all …]
H A Ddirent.h44 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-src/libexec/ld.so/
H A Ddir.c54 _dl_DIR *dirp; in _dl_opendir() local
60 if (_dl_fstat(fd, &sb) || (dirp = _dl_malloc(sizeof(*dirp))) == NULL) { in _dl_opendir()
65 dirp->dd_fd = fd; in _dl_opendir()
66 dirp->dd_loc = 0; in _dl_opendir()
67 dirp->dd_size = 0; in _dl_opendir()
68 dirp->dd_len = _dl_round_page(sb.st_blksize); in _dl_opendir()
69 dirp->dd_buf = _dl_malloc(dirp->dd_len); in _dl_opendir()
70 if (dirp->dd_buf == NULL) { in _dl_opendir()
71 _dl_free(dirp); in _dl_opendir()
76 return (dirp); in _dl_opendir()
[all …]
/openbsd-src/gnu/usr.bin/cvs/vms/
H A Dndir.c106 register VMS_DIR *dirp; /* -> malloc'ed storage */ local
135 if ((dirp = (VMS_DIR *) xmalloc (sizeof (VMS_DIR))) == 0)
148 dirp->file_spec.dsc$a_pointer =
150 strcpy (dirp->file_spec.dsc$a_pointer, filepattern);
154 dirp->file_spec.dsc$a_pointer =
156 strcpy (dirp->file_spec.dsc$a_pointer, "*.*");
158 dirp->file_spec.dsc$w_length = strlen (dirp->file_spec.dsc$a_pointer);
159 dirp->file_spec.dsc$b_dtype = DSC$K_DTYPE_T;
160 dirp->file_spec.dsc$b_class = DSC$K_CLASS_S;
161 dirp->version_flag = strchr (dirp->file_spec.dsc$a_pointer, ';') != 0;
[all …]
/openbsd-src/sbin/fsck_ext2fs/
H A Dpass2.c194 struct ext2fs_direct *dirp = idesc->id_dirp; in pass2check() local
208 if (letoh32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 && in pass2check()
209 dirp->e2d_name[0] == '.') { in pass2check()
210 if (letoh32(dirp->e2d_ino) != idesc->id_number) { in pass2check()
212 dirp->e2d_ino = htole32(idesc->id_number); in pass2check()
218 && (dirp->e2d_type != EXT2_FT_DIR)) { in pass2check()
220 dirp->e2d_type = EXT2_FT_DIR; in pass2check()
236 if (letoh32(dirp->e2d_ino) != 0 && strcmp(dirp->e2d_name, "..") != 0) { in pass2check()
238 dirp->e2d_name); in pass2check()
239 } else if (letoh16(dirp->e2d_reclen) < entrysize) { in pass2check()
[all …]
H A Ddir.c310 struct ext2fs_direct *dirp = idesc->id_dirp; in mkentry() local
320 if (dirp->e2d_ino != 0) in mkentry()
321 oldlen = EXT2FS_DIRSIZ(dirp->e2d_namlen); in mkentry()
324 if (letoh16(dirp->e2d_reclen) - oldlen < newlen) in mkentry()
326 newent.e2d_reclen = htole16(letoh16(dirp->e2d_reclen) - oldlen); in mkentry()
327 dirp->e2d_reclen = htole16(oldlen); in mkentry()
328 dirp = (struct ext2fs_direct *)(((char *)dirp) + oldlen); in mkentry()
329 dirp->e2d_ino = htole32(idesc->id_parent); /* ino to be entered is in id_parent */ in mkentry()
330 dirp->e2d_reclen = newent.e2d_reclen; in mkentry()
331 dirp->e2d_namlen = newent.e2d_namlen; in mkentry()
[all …]
/openbsd-src/lib/libc/gen/
H A Dseekdir.c29 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()
42 _MUTEX_UNLOCK(&dirp->dd_lock); in seekdir()
46 for (dirp->dd_loc = 0; in seekdir()
47 dirp->dd_loc < dirp->dd_size; in seekdir()
48 dirp->dd_loc += dp->d_reclen) { in seekdir()
49 dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); in seekdir()
[all …]
H A Dopendir.c49 DIR *dirp; in opendir() local
54 dirp = __fdopendir(fd); in opendir()
55 if (dirp == NULL) in opendir()
57 return (dirp); in opendir()
67 DIR *dirp; in fdopendir() local
76 dirp = __fdopendir(fd); in fdopendir()
77 if (dirp != NULL) { in fdopendir()
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
[all …]
H A Dreaddir.c40 _readdir_unlocked(DIR *dirp, struct dirent **result) in _readdir_unlocked() argument
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()
62 dirp->dd_loc += dp->d_reclen; in _readdir_unlocked()
[all …]
H A Dclosedir.c42 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 Dscandir.c63 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()
152 return (scandir_dirp(dirp, namelist, select, dcomp)); in scandir()
160 DIR *dirp; in scandirat() local
[all …]
H A Dttyname.c115 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 Dreaddir_r.c39 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 Dtelldir.c39 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 Ddevname.c50 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-src/sbin/fsck_ffs/
H A Dpass2.c247 struct direct *dirp = idesc->id_dirp; in pass2check() local
261 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check()
262 if (dirp->d_ino != idesc->id_number) { in pass2check()
264 dirp->d_ino = idesc->id_number; in pass2check()
268 if (dirp->d_type != DT_DIR) { in pass2check()
270 dirp->d_type = DT_DIR; in pass2check()
282 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check()
284 dirp->d_name); in pass2check()
285 } else if (dirp->d_reclen < entrysize) { in pass2check()
287 } else if (dirp->d_reclen < 2 * entrysize) { in pass2check()
[all …]
H A Ddir.c286 struct direct *dirp = idesc->id_dirp; in mkentry() local
292 if (dirp->d_ino != 0) in mkentry()
293 oldlen = DIRSIZ(dirp); in mkentry()
296 if (dirp->d_reclen - oldlen < newlen) in mkentry()
298 newent.d_reclen = dirp->d_reclen - oldlen; in mkentry()
299 dirp->d_reclen = oldlen; in mkentry()
300 dirp = (struct direct *)(((char *)dirp) + oldlen); in mkentry()
301 dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */ in mkentry()
302 dirp->d_reclen = newent.d_reclen; in mkentry()
303 dirp->d_type = GET_ITYPE(idesc->id_parent); in mkentry()
[all …]
/openbsd-src/gnu/usr.bin/cvs/windows-NT/
H A Dndir.c42 DIR *dirp; in opendir() local
62 dirp = (DIR *) malloc (sizeof (DIR)); in opendir()
63 if (dirp == (DIR *)0) in opendir()
66 dirp->dd_loc = 0; in opendir()
67 dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0; in opendir()
71 free (dirp); in opendir()
80 free_dircontents (dirp->dd_contents); in opendir()
88 free_dircontents (dirp->dd_contents); in opendir()
92 if (dirp->dd_contents) in opendir()
93 dirp->dd_cp = dirp->dd_cp->_d_next = dp; in opendir()
[all …]
/openbsd-src/sbin/restore/
H A Ddirs.c103 static RST_DIR *dirp; variable
184 dirp = opendirfile(dirfile); in extractdirs()
185 if (dirp == NULL) in extractdirs()
249 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in treescan()
250 dp = rst_readdir(dirp); /* "." */ in treescan()
252 dp = rst_readdir(dirp); /* ".." */ in treescan()
257 dp = rst_readdir(dirp); /* first real entry */ in treescan()
261 bpt = rst_telldir(dirp); in treescan()
273 rst_seekdir(dirp, bpt, itp->t_seekpt); in treescan()
275 dp = rst_readdir(dirp); in treescan()
[all …]
/openbsd-src/gnu/usr.bin/cvs/contrib/
H A Ddirfns.shar20 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 …]
/openbsd-src/usr.sbin/lpr/common_source/
H A Dcommon.c233 DIR *dirp; in getq() local
236 dirp = opendir(SD); in getq()
238 if (dirp == NULL) in getq()
240 if (fstat(dirfd(dirp), &stbuf) < 0) in getq()
252 while ((d = readdir(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()
[all …]
/openbsd-src/gnu/usr.bin/perl/win32/include/
H A Ddirent.h46 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-src/gnu/usr.bin/cvs/src/
H A Dfind_names.c264 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-src/gnu/usr.bin/perl/win32/
H A Dwin32.c893 DIR *dirp; in win32_opendir()
913 Newxz(dirp, 1, DIR); in win32_opendir()
932 dirp->handle = FindFirstFileW(PerlDir_mapW(wscanname), &wFindData); in win32_opendir()
934 if (dirp->handle == INVALID_HANDLE_VALUE) { in win32_opendir()
939 return dirp; in win32_opendir()
951 Safefree(dirp); in win32_opendir()
970 dirp->size = 256; in win32_opendir()
972 dirp->size = idx; in win32_opendir()
973 Newx(dirp->start, dirp in win32_opendir()
891 DIR *dirp; win32_opendir() local
984 win32_readdir(DIR * dirp) win32_readdir() argument
1055 win32_telldir(DIR * dirp) win32_telldir() argument
1065 win32_seekdir(DIR * dirp,long loc) win32_seekdir() argument
1077 win32_rewinddir(DIR * dirp) win32_rewinddir() argument
1084 win32_closedir(DIR * dirp) win32_closedir() argument
1095 win32_dirp_dup(DIR * const dirp,CLONE_PARAMS * const param) win32_dirp_dup() argument
[all...]
/openbsd-src/sys/nfs/
H A Dnfs_serv.c449 struct vnode *vp, *dirp; in nfsrv_lookup() local
485 error = nfs_namei(&nd, fhp, len, slp, nam, &info.nmi_md, &info.nmi_dpos, &dirp, procp); in nfsrv_lookup()
486 if (dirp) { in nfsrv_lookup()
488 dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred, in nfsrv_lookup()
490 vrele(dirp); in nfsrv_lookup()
1030 struct vnode *vp = NULL, *dirp = NULL; in nfsrv_create()
1066 &info.nmi_dpos, &dirp, procp); in nfsrv_create()
1067 if (dirp) { in nfsrv_create()
1069 dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred, procp); in nfsrv_create()
1071 vrele(dirp); in nfsrv_create()
1025 struct vnode *vp = NULL, *dirp = NULL; nfsrv_create() local
1314 struct vnode *vp, *dirp = NULL; nfsrv_mknod() local
1488 struct vnode *vp, *dirp; nfsrv_remove() local
1796 struct vnode *vp, *xp, *dirp = NULL; nfsrv_link() local
1917 struct vnode *dirp = NULL; nfsrv_symlink() local
2077 struct vnode *vp, *dirp = NULL; nfsrv_mkdir() local
2204 struct vnode *vp, *dirp = NULL; nfsrv_rmdir() local
[all...]

12345