Searched refs:dirp (Results 1 - 25 of 108) sorted by relevance

12345

/openbsd-current/lib/libc/gen/
H A Dseekdir.c29 seekdir(DIR *dirp, long loc) argument
38 _MUTEX_LOCK(&dirp->dd_lock);
39 if (dirp->dd_size && dirp->dd_bufpos == loc) {
40 dirp->dd_loc = 0;
41 dirp->dd_curpos = loc;
42 _MUTEX_UNLOCK(&dirp->dd_lock);
46 for (dirp->dd_loc = 0;
47 dirp->dd_loc < dirp
[all...]
H A Drewinddir.c34 rewinddir(DIR *dirp) argument
36 seekdir(dirp, 0);
H A Dreaddir.c40 _readdir_unlocked(DIR *dirp, struct dirent **result) argument
46 if (dirp->dd_loc >= dirp->dd_size) {
47 dirp->dd_loc = 0;
48 dirp->dd_size = getdents(dirp->dd_fd, dirp->dd_buf,
49 dirp->dd_len);
50 if (dirp->dd_size == 0)
52 if (dirp
72 readdir(DIR *dirp) argument
[all...]
H A Dtelldir.c39 telldir(DIR *dirp) argument
43 _MUTEX_LOCK(&dirp->dd_lock);
44 i = dirp->dd_curpos;
45 _MUTEX_UNLOCK(&dirp->dd_lock);
H A Dclosedir.c42 closedir(DIR *dirp) argument
46 _MUTEX_LOCK(&dirp->dd_lock);
47 fd = dirp->dd_fd;
48 dirp->dd_fd = -1;
49 free(dirp->dd_buf);
50 _MUTEX_UNLOCK(&dirp->dd_lock);
51 _MUTEX_DESTROY(&dirp->dd_lock);
52 free(dirp);
H A Ddirfd.c10 dirfd(DIR *dirp) argument
12 return (dirp->dd_fd);
H A Dopendir.c49 DIR *dirp; local
54 dirp = __fdopendir(fd);
55 if (dirp == NULL)
57 return (dirp);
67 DIR *dirp; local
76 dirp = __fdopendir(fd);
77 if (dirp != NULL) {
79 dirp->dd_bufpos = dirp->dd_curpos = lseek(fd, 0, SEEK_CUR);
87 return (dirp);
94 DIR *dirp; local
[all...]
H A Dreaddir_r.c39 readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) argument
43 _MUTEX_LOCK(&dirp->dd_lock);
44 if (_readdir_unlocked(dirp, &dp) != 0) {
45 _MUTEX_UNLOCK(&dirp->dd_lock);
51 _MUTEX_UNLOCK(&dirp->dd_lock);
H A Dscandir.c63 scandir_dirp(DIR *dirp, struct dirent ***namelist, argument
72 if (fstat(dirp->dd_fd, &stb) == -1)
88 while ((d = readdir(dirp)) != NULL) {
99 if (fstat(dirp->dd_fd, &stb) == -1)
127 closedir(dirp);
138 closedir(dirp);
147 DIR *dirp; local
149 if ((dirp = opendir(dirname)) == NULL)
152 return (scandir_dirp(dirp, namelist, select, dcomp));
160 DIR *dirp; local
[all...]
H A Dttyname.c115 struct dirent *dirp; local
123 while ((dirp = readdir(dp))) {
124 if (dirp->d_type != DT_CHR && dirp->d_type != DT_UNKNOWN)
126 if (fstatat(dirfd(dp), dirp->d_name, &dsb, AT_SYMLINK_NOFOLLOW)
129 if (dirp->d_namlen > len - sizeof(_PATH_DEV)) {
132 memcpy(buf + sizeof(_PATH_DEV) - 1, dirp->d_name,
133 dirp->d_namlen + 1);
H A Ddevname.c50 DIR *dirp; local
52 if ((dirp = opendir(_PATH_DEV)) == NULL)
54 while ((dp = readdir(dirp)) != NULL) {
57 if (fstatat(dirfd(dirp), dp->d_name, &sb, AT_SYMLINK_NOFOLLOW)
64 closedir(dirp);
/openbsd-current/libexec/ld.so/
H A Ddir.c54 _dl_DIR *dirp; local
60 if (_dl_fstat(fd, &sb) || (dirp = _dl_malloc(sizeof(*dirp))) == NULL) {
65 dirp->dd_fd = fd;
66 dirp->dd_loc = 0;
67 dirp->dd_size = 0;
68 dirp->dd_len = _dl_round_page(sb.st_blksize);
69 dirp->dd_buf = _dl_malloc(dirp->dd_len);
70 if (dirp
84 _dl_closedir(_dl_DIR *dirp) argument
99 _dl_readdir(_dl_DIR *dirp) argument
[all...]
H A Ddir.h36 int _dl_closedir(_dl_DIR *dirp);
37 struct dirent *_dl_readdir(_dl_DIR *dirp);
/openbsd-current/gnu/usr.bin/cvs/os2/
H A Ddirent.c34 auto DIR *dirp; local
51 dirp = malloc(sizeof(*dirp));
52 if (NULL == dirp)
56 dirp->dirname = malloc(len + 5);
57 if (NULL == dirp->dirname)
59 free(dirp);
63 dirp->max_ent = 0;
64 dirp->tot_ent = 0;
65 dirp
132 readdir(DIR *dirp) argument
141 telldir(DIR *dirp) argument
147 seekdir(DIR *dirp, long loc) argument
154 rewinddir(DIR *dirp) argument
161 closedir(DIR *dirp) argument
[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-current/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
[all...]
H A Dndir.h60 #define rewinddir( dirp ) seekdir( dirp, 0L )
/openbsd-current/gnu/usr.bin/cvs/windows-NT/
H A Dndir.c43 DIR *dirp;
63 dirp = (DIR *) malloc (sizeof (DIR));
64 if (dirp == (DIR *)0)
67 dirp->dd_loc = 0;
68 dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0;
72 free (dirp);
81 free_dircontents (dirp->dd_contents);
89 free_dircontents (dirp->dd_contents);
93 if (dirp
42 DIR *dirp; local
112 closedir(DIR *dirp) argument
120 readdir(DIR *dirp) argument
140 seekdir(DIR *dirp, long off) argument
155 telldir(DIR *dirp) argument
[all...]
H A Dndir.h21 #define rewinddir(dirp) seekdir(dirp, 0L)
/openbsd-current/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-current/sbin/fsck_ext2fs/
H A Dpass2.c194 struct ext2fs_direct *dirp = idesc->id_dirp; local
208 if (letoh32(dirp->e2d_ino) != 0 && dirp->e2d_namlen == 1 &&
209 dirp->e2d_name[0] == '.') {
210 if (letoh32(dirp->e2d_ino) != idesc->id_number) {
212 dirp->e2d_ino = htole32(idesc->id_number);
218 && (dirp->e2d_type != EXT2_FT_DIR)) {
220 dirp->e2d_type = EXT2_FT_DIR;
236 if (letoh32(dirp->e2d_ino) != 0 && strcmp(dirp
[all...]
/openbsd-current/sbin/fsck_ffs/
H A Dpass2.c247 struct direct *dirp = idesc->id_dirp; local
261 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) {
262 if (dirp->d_ino != idesc->id_number) {
264 dirp->d_ino = idesc->id_number;
268 if (dirp->d_type != DT_DIR) {
270 dirp->d_type = DT_DIR;
282 if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) {
284 dirp
[all...]
/openbsd-current/sbin/restore/
H A Ddirs.c103 static RST_DIR *dirp; variable
184 dirp = opendirfile(dirfile);
185 if (dirp == NULL)
249 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
250 dp = rst_readdir(dirp); /* "." */
252 dp = rst_readdir(dirp); /* ".." */
257 dp = rst_readdir(dirp); /* first real entry */
261 bpt = rst_telldir(dirp);
273 rst_seekdir(dirp, bpt, itp->t_seekpt);
275 dp = rst_readdir(dirp);
454 rst_seekdir(RST_DIR *dirp, long loc, long base) argument
472 rst_readdir(RST_DIR *dirp) argument
515 RST_DIR *dirp; local
531 rst_closedir(RST_DIR *dirp) argument
542 rst_telldir(RST_DIR *dirp) argument
554 RST_DIR *dirp; local
[all...]
/openbsd-current/usr.sbin/amd/amd/
H A Dinfo_union.c94 DIR *dirp = opendir(*dir); local
98 if (!dirp) {
106 while ((dp = readdir(dirp))) {
121 closedir(dirp);
/openbsd-current/usr.sbin/lpr/common_source/
H A Dcommon.c233 DIR *dirp; local
236 dirp = opendir(SD);
238 if (dirp == NULL)
240 if (fstat(dirfd(dirp), &stbuf) < 0)
252 while ((d = readdir(dirp)) != NULL) {
284 closedir(dirp);
296 closedir(dirp);
460 DIR *dirp; local
464 dirp = opendir(spooldir);
467 dirp
[all...]

Completed in 169 milliseconds

12345