/freebsd-11-stable/lib/libc/gen/ |
H A D | closedir.c | 52 fdclosedir(DIR *dirp) argument 57 _pthread_mutex_lock(&dirp->dd_lock); 58 fd = dirp->dd_fd; 59 dirp->dd_fd = -1; 60 dirp->dd_loc = 0; 61 free((void *)dirp->dd_buf); 62 _reclaim_telldir(dirp); 64 _pthread_mutex_unlock(&dirp->dd_lock); 65 _pthread_mutex_destroy(&dirp->dd_lock); 67 free((void *)dirp); 72 closedir(DIR *dirp) argument [all...] |
H A D | rewinddir.c | 48 rewinddir(DIR *dirp) argument 52 _pthread_mutex_lock(&dirp->dd_lock); 53 dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ 54 if (dirp->dd_flags & __DTF_READALL) 55 _filldir(dirp, false); 57 (void) lseek(dirp->dd_fd, 0, SEEK_SET); 58 dirp->dd_seek = 0; 60 dirp->dd_loc = 0; 61 _reclaim_telldir(dirp); 63 _pthread_mutex_unlock(&dirp [all...] |
H A D | readdir.c | 52 _readdir_unlocked(DIR *dirp, int skip) argument 59 if (dirp->dd_loc >= dirp->dd_size) { 60 if (dirp->dd_flags & __DTF_READALL) 62 initial_loc = dirp->dd_loc; 63 dirp->dd_flags &= ~__DTF_SKIPREAD; 64 dirp->dd_loc = 0; 66 if (dirp->dd_loc == 0 && 67 !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { 68 initial_seek = dirp 92 readdir(DIR *dirp) argument 107 readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) argument [all...] |
H A D | dirfd.c | 41 dirfd(DIR *dirp) argument 44 return (_dirfd(dirp));
|
H A D | seekdir.c | 51 seekdir(DIR *dirp, long loc) argument 54 _pthread_mutex_lock(&dirp->dd_lock); 55 _seekdir(dirp, loc); 57 _pthread_mutex_unlock(&dirp->dd_lock);
|
H A D | telldir.c | 53 telldir(DIR *dirp) argument 59 _pthread_mutex_lock(&dirp->dd_lock); 66 if (dirp->dd_seek < (1ul << DD_SEEK_BITS) && 67 dirp->dd_loc < (1ul << DD_LOC_BITS)) { 69 ddloc.s.loc = dirp->dd_loc; 70 ddloc.s.seek = dirp->dd_seek; 75 LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { 76 if (lp->loc_seek == dirp->dd_seek) { 79 if (lp->loc_loc == dirp->dd_loc) 90 _pthread_mutex_unlock(&dirp 119 _seekdir(DIR *dirp, long loc) argument 178 _fixtelldir(DIR *dirp, long oldseek, long oldloc) argument 196 _reclaim_telldir(DIR *dirp) argument [all...] |
H A D | gen-private.h | 56 #define _dirfd(dirp) ((dirp)->dd_fd)
|
H A D | opendir.c | 113 * If an error occurs, the existing buffer and state of 'dirp' is left 117 _filldir(DIR *dirp, bool use_current_pos) argument 152 if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) 156 pos = lseek(dirp->dd_fd, 0, SEEK_CUR); 183 n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); 203 dirp->dd_buf = buf; 258 (dirp->dd_flags & DTF_HIDEW)) 271 dirp->dd_len = len; 272 dirp->dd_size = ddptr - dirp 283 DIR *dirp; local [all...] |
H A D | scandir.c | 86 DIR *dirp; local 88 if ((dirp = opendir(dirname)) == NULL) 97 while ((d = readdir(dirp)) != NULL) { 129 closedir(dirp); 144 closedir(dirp);
|
H A D | telldir.h | 105 void _fixtelldir(DIR *dirp, long oldseek, long oldloc);
|
/freebsd-11-stable/lib/libc/tests/gen/ |
H A D | dir2_test.c | 57 DIR *dirp; local 82 dirp = fdopendir(dirfd); 84 beginning = telldir(dirp); 86 de = readdir(dirp); 89 middle = telldir(dirp); 91 de = readdir(dirp); 94 end = telldir(dirp); 102 seekdir(dirp, beginning); 103 td = telldir(dirp); 105 ATF_REQUIRE_MSG(NULL != readdir(dirp), "invali 133 DIR *dirp; local [all...] |
/freebsd-11-stable/sbin/fsck_ffs/ |
H A D | pass2.c | 275 struct direct *dirp = idesc->id_dirp; local 286 if (dirp->d_ino > maxino) 290 if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) { 291 if (dirp->d_ino != idesc->id_number) { 293 dirp->d_ino = idesc->id_number; 297 if (dirp->d_type != DT_DIR) { 299 dirp->d_type = DT_DIR; 311 if (dirp->d_ino != 0 && strcmp(dirp 649 struct direct *dirp = idesc->id_dirp; local [all...] |
H A D | dir.c | 423 struct direct *dirp = idesc->id_dirp; local 429 if (dirp->d_ino != 0) 430 oldlen = DIRSIZ(0, dirp); 433 if (dirp->d_reclen - oldlen < newlen) 435 newent.d_reclen = dirp->d_reclen - oldlen; 436 dirp->d_reclen = oldlen; 437 dirp = (struct direct *)(((char *)dirp) + oldlen); 438 dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */ 439 dirp 449 struct direct *dirp = idesc->id_dirp; local 693 struct dirtemplate *dirp; local [all...] |
/freebsd-11-stable/share/examples/sunrpc/dir/ |
H A D | dir_proc.c | 17 DIR *dirp; local 26 dirp = opendir(*dirname); 27 if (dirp == NULL) { 41 while (d = readdir(dirp)) { 53 closedir(dirp);
|
/freebsd-11-stable/sbin/restore/ |
H A D | dirs.c | 109 static RST_DIR *dirp; variable 188 dirp = opendirfile(dirfile); 189 if (dirp == NULL) 243 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); 244 dp = rst_readdir(dirp); /* "." */ 246 dp = rst_readdir(dirp); /* ".." */ 251 dp = rst_readdir(dirp); /* first real entry */ 255 bpt = rst_telldir(dirp); 267 rst_seekdir(dirp, bpt, itp->t_seekpt); 269 dp = rst_readdir(dirp); 436 rst_seekdir(RST_DIR *dirp, long loc, long base) argument 454 rst_readdir(RST_DIR *dirp) argument 497 RST_DIR *dirp; local 515 RST_DIR *dirp; local 527 rst_telldir(RST_DIR *dirp) argument 539 RST_DIR *dirp; local [all...] |
/freebsd-11-stable/crypto/openssh/openbsd-compat/ |
H A D | bsd-closefrom.c | 75 DIR *dirp; local 80 if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { 81 while ((dent = readdir(dirp)) != NULL) { 84 fd >= 0 && fd < INT_MAX && fd >= lowfd && fd != dirfd(dirp)) 87 (void) closedir(dirp);
|
/freebsd-11-stable/usr.sbin/rpc.umntall/ |
H A D | mounttab.c | 57 add_mtab(char *hostp, char *dirp) argument 65 (long)time(NULL), hostp, dirp); 78 char *hostp, *dirp, *cp; local 110 dirp = strsep(&cp, " \t\n"); 111 if (dirp == NULL || *dirp == '\0') { 112 badline("dir", dirp); 129 memmove(mtabp->mtab_dirp, dirp, MNTPATHLEN); 188 clean_mtab(char *hostp, char *dirp, int verbose) argument 198 if (dirp ! [all...] |
H A D | rpc.umntall.c | 199 * Send a RPC_MNT UMOUNT request for dirp to hostname. 202 do_umount(char *hostname, char *dirp) { argument 216 clnt_stat = clnt_call(clp, MOUNTPROC_UMNT, (xdrproc_t)xdr_dir, dirp, 229 is_mounted(char *hostname, char *dirp) { argument 235 if (strlen(hostname) + strlen(dirp) >= MNAMELEN) 237 snprintf(name, sizeof(name), "%s:%s", hostname, dirp); 259 xdr_dir(XDR *xdrsp, char *dirp) { argument 260 return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
|
/freebsd-11-stable/gnu/usr.bin/grep/ |
H A D | savedir.c | 109 DIR *dirp; local 114 dirp = opendir (dir); 115 if (dirp == NULL) 126 closedir (dirp); 131 while ((dp = readdir (dirp)) != NULL) 161 closedir (dirp); 171 if (CLOSEDIR (dirp))
|
/freebsd-11-stable/usr.sbin/lpr/lpq/ |
H A D | lpq.c | 173 DIR *dirp; local 177 if ((dirp = opendir(spooldir)) == NULL) 179 while ((d = readdir(dirp)) != NULL) { 182 closedir(dirp); 185 closedir(dirp);
|
/freebsd-11-stable/contrib/amd/amd/ |
H A D | info_union.c | 108 DIR *dirp = opendir(*dir); local 109 if (!dirp) { 116 while ((dp = readdir(dirp))) { 128 closedir(dirp);
|
/freebsd-11-stable/libexec/tftpd/ |
H A D | tftpd.c | 196 struct dirlist *dirp; local 199 for (dirp = dirs; optind < argc && dirp < &dirs[MAXDIRS]; 202 dirp->name = argv[optind]; 203 dirp->len = strlen(dirp->name); 204 dirp++; 691 struct dirlist *dirp; local 708 for (dirp = dirs; dirp [all...] |
/freebsd-11-stable/usr.bin/patch/ |
H A D | backupfile.c | 95 DIR *dirp; local 100 dirp = opendir(dir); 101 if (dirp == NULL) 107 while ((dp = readdir(dirp)) != NULL) { 115 closedir(dirp);
|
/freebsd-11-stable/sbin/badsect/ |
H A D | badsect.c | 94 DIR *dirp; local 103 if ((dirp = opendir(name)) == NULL) 106 while ((dp = readdir(dirp)) != NULL) { 114 closedir(dirp);
|
/freebsd-11-stable/usr.bin/whereis/ |
H A D | whereis.c | 263 struct dirent *dirp; local 332 while ((dirp = readdir(dir)) != NULL) { 346 if (dirp->d_name[0] == '.' || 353 (dirp->d_name[0] >= 'A' && dirp->d_name[0] <= 'Z') || 354 strcmp(dirp->d_name, "distfiles") == 0) 356 if ((b = malloc(sizeof PATH_PORTS + 1 + dirp->d_namlen)) 361 strcat(b, dirp->d_name);
|