Home
last modified time | relevance | path

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

1234

/mirbsd/src/libexec/ld.so/
Ddir.c50 long _dl_telldir(const DIR *dirp);
51 void _dl_seekdir(DIR *dirp, long loc);
59 DIR *dirp; in _dl_opendir() local
71 (dirp = (DIR *)_dl_malloc(sizeof(DIR))) == NULL) { in _dl_opendir()
87 dirp->dd_len = incr; in _dl_opendir()
88 dirp->dd_buf = _dl_malloc(dirp->dd_len); in _dl_opendir()
89 if (dirp->dd_buf == NULL) { in _dl_opendir()
90 _dl_free(dirp); in _dl_opendir()
94 dirp->dd_seek = 0; in _dl_opendir()
95 dirp->dd_loc = 0; in _dl_opendir()
[all …]
/mirbsd/src/sbin/fsck_ext2fs/
Dpass2.c193 struct ext2fs_direct *dirp = idesc->id_dirp; in pass2check() local
207 if (fs2h32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 && in pass2check()
208 dirp->e2d_name[0] == '.') { in pass2check()
209 if (fs2h32(dirp->e2d_ino) != idesc->id_number) { in pass2check()
211 dirp->e2d_ino = h2fs32(idesc->id_number); in pass2check()
217 && (dirp->e2d_type != EXT2_FT_DIR)) { in pass2check()
219 dirp->e2d_type = EXT2_FT_DIR; in pass2check()
235 if (fs2h32(dirp->e2d_ino) != 0 && strcmp(dirp->e2d_name, "..") != 0) { in pass2check()
237 dirp->e2d_name); in pass2check()
238 } else if (fs2h16(dirp->e2d_reclen) < entrysize) { in pass2check()
[all …]
Ddir.c317 struct ext2fs_direct *dirp = idesc->id_dirp; in mkentry() local
326 if (dirp->e2d_ino != 0) in mkentry()
327 oldlen = EXT2FS_DIRSIZ(dirp->e2d_namlen); in mkentry()
330 if (fs2h16(dirp->e2d_reclen) - oldlen < newlen) in mkentry()
332 newent.e2d_reclen = h2fs16(fs2h16(dirp->e2d_reclen) - oldlen); in mkentry()
333 dirp->e2d_reclen = h2fs16(oldlen); in mkentry()
334 dirp = (struct ext2fs_direct *)(((char *)dirp) + oldlen); in mkentry()
335 dirp->e2d_ino = h2fs32(idesc->id_parent); /* ino to be entered is in id_parent */ in mkentry()
336 dirp->e2d_reclen = newent.e2d_reclen; in mkentry()
337 dirp->e2d_namlen = newent.e2d_namlen; in mkentry()
[all …]
/mirbsd/src/sbin/fsck_ffs/
Dpass2.c252 struct direct *dirp = idesc->id_dirp; in pass2check() local
264 if (doinglevel2 && dirp->d_ino > 0 && dirp->d_ino < maxino) { in pass2check()
265 dirp->d_type = typemap[dirp->d_ino]; in pass2check()
273 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { in pass2check()
274 if (dirp->d_ino != idesc->id_number) { in pass2check()
276 dirp->d_ino = idesc->id_number; in pass2check()
280 if (newinofmt && dirp->d_type != DT_DIR) { in pass2check()
282 dirp->d_type = DT_DIR; in pass2check()
306 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) { in pass2check()
308 dirp->d_name); in pass2check()
[all …]
Ddir.c322 struct direct *dirp = idesc->id_dirp; in mkentry() local
328 if (dirp->d_ino != 0) in mkentry()
329 oldlen = DIRSIZ(0, dirp); in mkentry()
332 if (dirp->d_reclen - oldlen < newlen) in mkentry()
334 newent.d_reclen = dirp->d_reclen - oldlen; in mkentry()
335 dirp->d_reclen = oldlen; in mkentry()
336 dirp = (struct direct *)(((char *)dirp) + oldlen); in mkentry()
337 dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */ in mkentry()
338 dirp->d_reclen = newent.d_reclen; in mkentry()
340 dirp->d_type = typemap[idesc->id_parent]; in mkentry()
[all …]
/mirbsd/src/lib/libc/gen/
Dreaddir.c41 readdir(DIR *dirp) in readdir() argument
46 if (dirp->dd_loc >= dirp->dd_size) { in readdir()
47 if (dirp->dd_flags & __DTF_READALL) in readdir()
49 dirp->dd_loc = 0; in readdir()
51 if (dirp->dd_loc == 0 && !(dirp->dd_flags & __DTF_READALL)) { in readdir()
52 dirp->dd_size = getdirentries(dirp->dd_fd, in readdir()
53 dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); in readdir()
54 if (dirp->dd_size <= 0) in readdir()
57 dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); in readdir()
61 dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) in readdir()
[all …]
Dopendir.c56 DIR *dirp; in __opendir2() local
70 (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { in __opendir2()
86 dirp->dd_len = incr; in __opendir2()
87 dirp->dd_buf = malloc(dirp->dd_len); in __opendir2()
88 if (dirp->dd_buf == NULL) { in __opendir2()
89 free(dirp); in __opendir2()
94 dirp->dd_seek = 0; in __opendir2()
95 dirp->dd_loc = 0; in __opendir2()
96 dirp->dd_fd = fd; in __opendir2()
97 dirp->dd_flags = flags; in __opendir2()
[all …]
Dclosedir.c41 closedir(DIR *dirp) in closedir() argument
46 if ((ret = _FD_LOCK(dirp->dd_fd, FD_READ, NULL)) != 0) in closedir()
48 seekdir(dirp, dirp->dd_rewind); /* free seekdir storage */ in closedir()
49 fd = dirp->dd_fd; in closedir()
50 dirp->dd_fd = -1; in closedir()
51 dirp->dd_loc = 0; in closedir()
52 free((void *)dirp->dd_buf); in closedir()
53 free((void *)dirp); in closedir()
Dtelldir.c68 telldir(const DIR *dirp) in telldir() argument
77 lp->loc_seek = dirp->dd_seek; in telldir()
78 lp->loc_loc = dirp->dd_loc; in telldir()
89 __seekdir(DIR *dirp, long loc) in __seekdir() argument
105 if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) in __seekdir()
107 (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); in __seekdir()
108 dirp->dd_seek = lp->loc_seek; in __seekdir()
109 dirp->dd_loc = 0; in __seekdir()
110 while (dirp->dd_loc < lp->loc_loc) { in __seekdir()
111 dp = readdir(dirp); in __seekdir()
Drewinddir.c37 rewinddir(DIR *dirp) in rewinddir() argument
40 __seekdir(dirp, dirp->dd_rewind); in rewinddir()
41 dirp->dd_rewind = telldir(dirp); in rewinddir()
Dscandir.c67 DIR *dirp; in scandir() local
69 if ((dirp = opendir(dirname)) == NULL) in scandir()
71 if (fstat(dirp->dd_fd, &stb) < 0) in scandir()
87 while ((d = readdir(dirp)) != NULL) { in scandir()
98 if (fstat(dirp->dd_fd, &stb) < 0) in scandir()
124 closedir(dirp); in scandir()
134 closedir(dirp); in scandir()
Dttyname.c133 struct dirent *dirp; in oldttyname() local
140 while ((dirp = readdir(dp))) { in oldttyname()
141 if (dirp->d_fileno != sb->st_ino) in oldttyname()
143 if (dirp->d_namlen > len - sizeof(_PATH_DEV)) { in oldttyname()
147 memcpy(buf + sizeof(_PATH_DEV) - 1, dirp->d_name, in oldttyname()
148 dirp->d_namlen + 1); in oldttyname()
/mirbsd/src/sbin/restore/
Ddirs.c106 static RST_DIR *dirp; variable
185 dirp = opendirfile(dirfile); in extractdirs()
186 if (dirp == NULL) in extractdirs()
250 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in treescan()
251 dp = rst_readdir(dirp); /* "." */ in treescan()
253 dp = rst_readdir(dirp); /* ".." */ in treescan()
258 dp = rst_readdir(dirp); /* first real entry */ in treescan()
262 bpt = rst_telldir(dirp); in treescan()
274 rst_seekdir(dirp, bpt, itp->t_seekpt); in treescan()
276 dp = rst_readdir(dirp); in treescan()
[all …]
Dinteractive.c91 struct dirent *glob_readdir(RST_DIR *dirp);
515 RST_DIR *dirp; in printlist() local
523 if ((dirp = rst_opendir(name)) == NULL) { in printlist()
535 while ((dp = rst_readdir(dirp))) in printlist()
537 rst_closedir(dirp); in printlist()
543 if ((dirp = rst_opendir(name)) == NULL) in printlist()
553 while ((dp = rst_readdir(dirp))) { in printlist()
572 rst_closedir(dirp); in printlist()
581 if (dirp != NULL) { in printlist()
720 glob_readdir(RST_DIR *dirp) in glob_readdir() argument
[all …]
/mirbsd/src/gnu/usr.bin/cvs/contrib/
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 …]
/mirbsd/src/gnu/usr.bin/perl/wince/
Dwince.c649 DIR *dirp; in win32_opendir() local
670 Newxz(dirp, 1, DIR); in win32_opendir()
688 dirp->handle = fh; in win32_opendir()
694 return dirp; in win32_opendir()
706 Safefree(dirp); in win32_opendir()
716 dirp->size = 128; in win32_opendir()
718 dirp->size = idx; in win32_opendir()
719 Newx(dirp->start, dirp->size, char); in win32_opendir()
720 strcpy(dirp->start, ptr); in win32_opendir()
721 dirp->nfiles++; in win32_opendir()
[all …]
/mirbsd/src/gnu/usr.bin/cvs/lib/
Dgetcwd.c151 register char *dirp; in __getcwd() local
189 dirp = dir + allocated; in __getcwd()
190 *--dirp = '\0'; in __getcwd()
346 dirroom = dirp - dir; in __getcwd()
368 dirp = memcpy (tmp + allocated - (oldsize - dirroom), in __getcwd()
374 dirp -= namlen; in __getcwd()
375 memcpy (dirp, d->d_name, namlen); in __getcwd()
376 *--dirp = '/'; in __getcwd()
388 if (dirp == &dir[allocated - 1]) in __getcwd()
389 *--dirp = '/'; in __getcwd()
[all …]
/mirbsd/src/gnu/usr.bin/perl/win32/include/
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);
/mirbsd/src/usr.sbin/lpr/lpq/
Dlpq.c169 DIR *dirp; in ckqueue() local
174 dirp = opendir(spooldir); in ckqueue()
177 if (dirp == NULL) in ckqueue()
179 while ((d = readdir(dirp)) != NULL) { in ckqueue()
182 closedir(dirp); in ckqueue()
185 closedir(dirp); in ckqueue()
/mirbsd/src/sys/nfs/
Dnfs_serv.c348 struct vnode *vp, *dirp; local
369 &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH));
370 if (dirp) {
372 dirattr_ret = VOP_GETATTR(dirp, &dirattr, cred,
374 vrele(dirp);
1247 struct vnode *vp = NULL, *dirp = NULL; local
1261 &dirp, procp, (nfsd->nd_flag & ND_KERBAUTH));
1262 if (dirp) {
1264 dirfor_ret = VOP_GETATTR(dirp, &dirfor, cred,
1267 vrele(dirp);
[all …]
/mirbsd/src/usr.bin/patch/
Dbackupfile.c89 DIR *dirp; in max_backup_version() local
93 dirp = opendir(dir); in max_backup_version()
94 if (dirp == NULL) in max_backup_version()
100 while ((dp = readdir(dirp)) != NULL) { in max_backup_version()
108 closedir(dirp); in max_backup_version()
/mirbsd/src/sbin/mountd/
Dmountd.c537 xdr_dir(XDR *xdrsp, char *dirp) in xdr_dir() argument
539 return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN)); in xdr_dir()
706 char *cp, *endcp, *dirp = NULL, *hst, *usr, *dom, savedc; in get_exportlist() local
868 dirp = add_expdir(&dirhead, cp, len); in get_exportlist()
979 i = do_mount(ep, grp, exflags, &anon, dirp, dirplen, &fsb); in get_exportlist()
1540 struct ucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb) in do_mount() argument
1618 while (mount(fsb->f_fstypename, dirp, in do_mount()
1623 cp = dirp + dirplen - 1; in do_mount()
1627 dirp, in do_mount()
1638 dirp); in do_mount()
[all …]
/mirbsd/src/sbin/fsdb/
Dfsdb.c396 struct direct *dirp = idesc->id_dirp; in scannames() local
399 slot++, dirp->d_ino, dirp->d_reclen, typename[dirp->d_type], in scannames()
400 dirp->d_namlen, dirp->d_name); in scannames()
514 struct direct *dirp = idesc->id_dirp; in chinumfunc() local
517 dirp->d_ino = idesc->id_parent; in chinumfunc()
557 struct direct *dirp = idesc->id_dirp; in chnamefunc() local
563 if (DIRSIZ(NEWDIRFMT, &testdir) <= dirp->d_reclen) { in chnamefunc()
564 dirp->d_namlen = testdir.d_namlen; in chnamefunc()
565 strlcpy(dirp->d_name, idesc->id_name, sizeof dirp->d_name); in chnamefunc()
/mirbsd/src/gnu/usr.bin/perl/win32/
Dwin32.c738 DIR *dirp; in win32_opendir() local
759 Newxz(dirp, 1, DIR); in win32_opendir()
783 dirp->handle = fh; in win32_opendir()
789 return dirp; in win32_opendir()
801 Safefree(dirp); in win32_opendir()
817 dirp->size = 128; in win32_opendir()
819 dirp->size = idx; in win32_opendir()
820 Newx(dirp->start, dirp->size, char); in win32_opendir()
821 strcpy(dirp->start, ptr); in win32_opendir()
822 dirp->nfiles++; in win32_opendir()
[all …]
/mirbsd/src/usr.sbin/lpr/common_source/
Dcommon.c246 DIR *dirp; in getq() local
249 dirp = opendir(SD); in getq()
251 if (dirp == NULL) in getq()
253 if (fstat(dirfd(dirp), &stbuf) < 0) in getq()
265 while ((d = readdir(dirp)) != NULL) { in getq()
298 closedir(dirp); in getq()
310 closedir(dirp); in getq()

1234