Symbol: fd
bin/cat/cat.c
115
int fd;
bin/cat/cat.c
134
if ((fd = open(path, O_RDONLY)) == -1) {
bin/cat/cat.c
139
raw_cat(fd, path);
bin/cat/cat.c
140
close(fd);
bin/cp/utils.c
275
setfile(struct stat *fs, int fd)
bin/cp/utils.c
285
if (fd >= 0 ? futimens(fd, ts) :
bin/cp/utils.c
296
if (fd >= 0 ? fchown(fd, fs->st_uid, fs->st_gid) :
bin/cp/utils.c
304
if (fd >= 0 ? fchmod(fd, fs->st_mode) :
bin/cp/utils.c
318
if (fd >= 0 ? fchflags(fd, fs->st_flags) :
bin/csh/csh.c
823
int fd, ftmp, oldidfds;
bin/csh/csh.c
848
if ((fd = open(short2str(hfile), O_WRONLY | O_CREAT | O_TRUNC,
bin/csh/csh.c
855
SHOUT = fd;
bin/csh/csh.c
859
(void) close(fd);
bin/csh/exec.c
261
int fd;
bin/csh/exec.c
280
if ((fd = open(f, O_RDONLY)) != -1) {
bin/csh/exec.c
281
if (read(fd, (char *) &c, 1) == 1) {
bin/csh/exec.c
283
(void) close(fd);
bin/csh/exec.c
292
(void) close(fd);
bin/csh/exec.c
304
if (fd != -1 && c != '#')
bin/csh/misc.c
154
fdcmp(int fd)
bin/csh/misc.c
161
if (fd == fds[i])
bin/csh/misc.c
166
if (fd > max)
bin/csh/sem.c
516
int fd;
bin/csh/sem.c
535
if ((fd = open(tmp, O_RDONLY)) == -1)
bin/csh/sem.c
537
(void) dmove(fd, 0);
bin/csh/sem.c
564
(fd = open(tmp, O_WRONLY | O_APPEND)) >= 0);
bin/csh/sem.c
571
if ((fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1)
bin/csh/sem.c
574
(void) dmove(fd, 1);
bin/dd/dd.c
110
out.fd = STDOUT_FILENO;
bin/dd/dd.c
115
out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE);
bin/dd/dd.c
121
if (out.fd == -1) {
bin/dd/dd.c
122
out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE);
bin/dd/dd.c
125
if (out.fd == -1)
bin/dd/dd.c
164
(void)ftruncate(out.fd, out.offset * out.dbsz);
bin/dd/dd.c
209
if (fstat(io->fd, &sb))
bin/dd/dd.c
212
io->flags |= ioctl(io->fd, MTIOCGET, &mt) ? ISCHR : ISTAPE;
bin/dd/dd.c
253
n = read(in.fd, in.dbp, in.dbsz);
bin/dd/dd.c
277
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
bin/dd/dd.c
351
if (fsync(out.fd) == -1)
bin/dd/dd.c
383
nw = write(out.fd, outp, cnt);
bin/dd/dd.c
96
in.fd = STDIN_FILENO;
bin/dd/dd.c
98
in.fd = open(in.name, O_RDONLY);
bin/dd/dd.c
99
if (in.fd == -1)
bin/dd/dd.h
54
int fd; /* file descriptor */
bin/dd/position.c
127
if (lseek(out.fd, out.offset * out.dbsz, SEEK_SET) == -1)
bin/dd/position.c
137
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
bin/dd/position.c
144
if ((n = read(out.fd, out.db, out.dbsz)) > 0)
bin/dd/position.c
157
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
bin/dd/position.c
161
if ((n = write(out.fd, out.db, out.dbsz)) != out.dbsz)
bin/dd/position.c
66
if (!(in.flags & (ISPIPE|ISTAPE)) && !isatty(in.fd)) {
bin/dd/position.c
67
if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1)
bin/dd/position.c
78
if ((nr = read(in.fd, in.db, bcnt)) > 0) {
bin/ed/buf.c
203
int fd = -1;
bin/ed/buf.c
207
if ((fd = mkstemp(sfn)) == -1 ||
bin/ed/buf.c
208
(sfp = fdopen(fd, "w+")) == NULL) {
bin/ed/buf.c
209
if (fd != -1)
bin/ed/buf.c
210
close(fd);
bin/ksh/c_ksh.c
212
int fd = 1;
bin/ksh/c_ksh.c
274
if ((fd = coproc_getfd(W_OK, &emsg)) < 0) {
bin/ksh/c_ksh.c
287
fd = 0;
bin/ksh/c_ksh.c
288
else if ((fd = check_fd(s, W_OK, &emsg)) < 0) {
bin/ksh/c_ksh.c
371
if (coproc.write >= 0 && coproc.write == fd) {
bin/ksh/c_ksh.c
376
n = write(fd, s, len);
bin/ksh/c_sh.c
257
int fd = 0;
bin/ksh/c_sh.c
268
if ((fd = coproc_getfd(R_OK, &emsg)) < 0) {
bin/ksh/c_sh.c
281
fd = 0;
bin/ksh/c_sh.c
282
else if ((fd = check_fd(cp, R_OK, &emsg)) < 0) {
bin/ksh/c_sh.c
298
shf = shf_reopen(fd, SHF_RD | SHF_INTERRUPT | can_seek(fd), shl_spare);
bin/ksh/c_sh.c
302
if (isatty(fd)) {
bin/ksh/c_sh.c
360
if (Flag(FTALKING_I) && isatty(fd)) {
bin/ksh/c_sh.c
418
coproc_read_close(fd);
bin/ksh/exec.c
1186
volatile int fd = -1;
bin/ksh/exec.c
1202
if (!(shf = h->shf) || (fd = open(h->name, O_RDONLY)) == -1) {
bin/ksh/exec.c
1217
close(fd);
bin/ksh/exec.c
1235
close(fd);
bin/ksh/exec.c
1241
return fd;
bin/ksh/history.c
254
n = fstat(shf->fd, &statb) == -1 ? 128 :
bin/ksh/history.c
724
int fd, fddup;
bin/ksh/history.c
726
if ((fd = open(hname, O_RDWR | O_CREAT | O_EXLOCK, 0600)) == -1)
bin/ksh/history.c
728
if (fstat(fd, &sb) == -1 || sb.st_uid != getuid()) {
bin/ksh/history.c
729
close(fd);
bin/ksh/history.c
732
fddup = savefd(fd);
bin/ksh/history.c
733
if (fddup != fd)
bin/ksh/history.c
734
close(fd);
bin/ksh/io.c
221
can_seek(int fd)
bin/ksh/io.c
225
return fstat(fd, &statb) == 0 && !S_ISREG(statb.st_mode) ?
bin/ksh/io.c
258
savefd(int fd)
bin/ksh/io.c
262
if (fd < FDBASE) {
bin/ksh/io.c
263
nfd = fcntl(fd, F_DUPFD_CLOEXEC, FDBASE);
bin/ksh/io.c
271
nfd = fd;
bin/ksh/io.c
278
restfd(int fd, int ofd)
bin/ksh/io.c
280
if (fd == 2)
bin/ksh/io.c
281
shf_flush(&shf_iob[fd]);
bin/ksh/io.c
283
close(fd);
bin/ksh/io.c
284
else if (fd != ofd) {
bin/ksh/io.c
285
ksh_dup2(ofd, fd, true); /* XXX: what to do if this fails? */
bin/ksh/io.c
318
int fd, fl;
bin/ksh/io.c
321
fd = name[0] - '0';
bin/ksh/io.c
322
if ((fl = fcntl(fd, F_GETFL)) == -1) {
bin/ksh/io.c
341
return fd;
bin/ksh/io.c
360
coproc_read_close(int fd)
bin/ksh/io.c
362
if (coproc.read >= 0 && fd == coproc.read) {
bin/ksh/io.c
363
coproc_readw_close(fd);
bin/ksh/io.c
373
coproc_readw_close(int fd)
bin/ksh/io.c
375
if (coproc.readw >= 0 && coproc.read >= 0 && fd == coproc.read) {
bin/ksh/io.c
385
coproc_write_close(int fd)
bin/ksh/io.c
387
if (coproc.write >= 0 && fd == coproc.write) {
bin/ksh/io.c
399
int fd = (mode & R_OK) ? coproc.read : coproc.write;
bin/ksh/io.c
401
if (fd >= 0)
bin/ksh/io.c
402
return fd;
bin/ksh/io.c
441
int fd;
bin/ksh/io.c
453
fd = mkstemp(path);
bin/ksh/io.c
454
if (fd >= 0)
bin/ksh/io.c
455
tp->shf = shf_fdopen(fd, SHF_WR, NULL);
bin/ksh/jobs.c
1273
int fd = 2;
bin/ksh/jobs.c
1277
fd = ep->savefd[2];
bin/ksh/jobs.c
1278
shf_reopen(fd, SHF_WR, shl_j);
bin/ksh/jobs.c
510
int fd = open("/dev/null", O_RDONLY);
bin/ksh/jobs.c
511
if (fd != 0) {
bin/ksh/jobs.c
512
(void) ksh_dup2(fd, 0, true);
bin/ksh/jobs.c
513
close(fd);
bin/ksh/main.c
728
int fd;
bin/ksh/main.c
733
for (fd = 0; fd < NUFILE; fd++)
bin/ksh/main.c
735
if (ep->savefd[fd])
bin/ksh/main.c
736
restfd(fd, ep->savefd[fd]);
bin/ksh/main.c
783
int fd;
bin/ksh/main.c
793
for (fd = 0; fd < NUFILE; fd++)
bin/ksh/main.c
794
if (ep->savefd[fd] > 0)
bin/ksh/main.c
795
close(ep->savefd[fd]);
bin/ksh/misc.c
1087
blocking_read(int fd, char *buf, int nbytes)
bin/ksh/misc.c
1092
while ((ret = read(fd, buf, nbytes)) == -1) {
bin/ksh/misc.c
1095
if (reset_nonblock(fd) > 0) {
bin/ksh/misc.c
1111
reset_nonblock(int fd)
bin/ksh/misc.c
1115
if ((flags = fcntl(fd, F_GETFL)) == -1)
bin/ksh/misc.c
1120
if (fcntl(fd, F_SETFL, flags) == -1)
bin/ksh/shf.c
117
shf->fd = fd;
bin/ksh/shf.c
127
fcntl(fd, F_SETFD, FD_CLOEXEC);
bin/ksh/shf.c
133
shf_reopen(int fd, int sflags, struct shf *shf)
bin/ksh/shf.c
139
int flags = fcntl(fd, F_GETFL);
bin/ksh/shf.c
165
shf->fd = fd;
bin/ksh/shf.c
174
fcntl(fd, F_SETFD, FD_CLOEXEC);
bin/ksh/shf.c
205
shf->fd = -1;
bin/ksh/shf.c
224
if (shf->fd >= 0) {
bin/ksh/shf.c
226
if (close(shf->fd) == -1)
bin/ksh/shf.c
243
if (shf->fd >= 0) {
bin/ksh/shf.c
245
if (close(shf->fd) == -1)
bin/ksh/shf.c
250
shf->fd = -1;
bin/ksh/shf.c
284
if (shf->fd < 0)
bin/ksh/shf.c
295
lseek(shf->fd, (off_t) -shf->rnleft, SEEK_CUR);
bin/ksh/shf.c
314
if (!(shf->flags & SHF_STRING) && shf->fd < 0)
bin/ksh/shf.c
352
n = write(shf->fd, buf, ntowrite);
bin/ksh/shf.c
394
if (shf->fd < 0)
bin/ksh/shf.c
41
int fd;
bin/ksh/shf.c
410
shf->rnleft = blocking_read(shf->fd, (char *) shf->buf,
bin/ksh/shf.c
51
fd = open(name, oflags, mode);
bin/ksh/shf.c
52
if (fd == -1) {
bin/ksh/shf.c
56
if ((sflags & SHF_MAPHI) && fd < FDBASE) {
bin/ksh/shf.c
578
if (shf->fd < 0)
bin/ksh/shf.c
584
while ((n = write(shf->fd, &cc, 1)) != 1)
bin/ksh/shf.c
59
nfd = fcntl(fd, F_DUPFD, FDBASE);
bin/ksh/shf.c
60
close(fd);
bin/ksh/shf.c
65
fd = nfd;
bin/ksh/shf.c
651
n = write(shf->fd, buf, ncopy);
bin/ksh/shf.c
71
return shf_reopen(fd, sflags, shf);
bin/ksh/shf.c
76
shf_fdopen(int fd, int sflags, struct shf *shf)
bin/ksh/shf.c
82
int flags = fcntl(fd, F_GETFL);
bin/ksh/shf.h
51
int fd; /* file descriptor */
bin/ksh/var.c
1242
shl_out->fd, &ret) == ERR)
bin/mt/mt.c
107
_rmtmtioctop(int fd, struct mtop *cmd)
bin/mt/mt.c
113
return ioctl(fd, MTIOCTOP, cmd);
bin/mt/mt.c
117
_rmtstatus(int fd)
bin/mt/mt.c
125
if (ioctl(fd, MTIOCGET, &mt_status) == -1)
bin/mt/mt.c
88
int _rmtmtioctop(int fd, struct mtop *cmd);
bin/mt/mt.c
89
struct mtget *_rmtstatus(int fd);
bin/mv/cp.c
578
setfile(struct stat *fs, int fd)
bin/mv/cp.c
588
if (fd >= 0 ? futimens(fd, ts) :
bin/mv/cp.c
599
if (fd >= 0 ? fchown(fd, fs->st_uid, fs->st_gid) :
bin/mv/cp.c
607
if (fd >= 0 ? fchmod(fd, fs->st_mode) :
bin/mv/cp.c
621
if (fd >= 0 ? fchflags(fd, fs->st_flags) :
bin/pax/ar_io.c
1243
ar_start_gzip(int fd, const char *path, int wr)
bin/pax/ar_io.c
1257
dup2(fds[1], fd);
bin/pax/ar_io.c
1259
dup2(fds[0], fd);
bin/pax/ar_io.c
1278
dup2(fd, STDOUT_FILENO);
bin/pax/ar_io.c
1282
dup2(fd, STDIN_FILENO);
bin/pax/ar_subs.c
218
int fd;
bin/pax/ar_subs.c
358
if ((fd = file_creat(arcn)) < 0) {
bin/pax/ar_subs.c
367
res = rd_wrfile(arcn, fd, &cnt);
bin/pax/ar_subs.c
368
file_close(arcn, fd);
bin/pax/ar_subs.c
413
int fd = -1;
bin/pax/ar_subs.c
459
fd = -1;
bin/pax/ar_subs.c
505
if ((fd = open(arcn->org_name, O_RDONLY)) < 0) {
bin/pax/ar_subs.c
513
if (docrc && (set_crc(arcn, fd) < 0)) {
bin/pax/ar_subs.c
518
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
538
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
551
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
563
res = wr_rdfile(arcn, fd, &cnt);
bin/pax/ar_subs.c
564
rdfile_close(arcn, &fd);
bin/pax/file_subs.c
1006
} else if (write(fd, st, wcnt) != wcnt) {
bin/pax/file_subs.c
1023
file_flush(int fd, char *fname, int isempt)
bin/pax/file_subs.c
1037
if (lseek(fd, -1, SEEK_CUR) < 0) {
bin/pax/file_subs.c
1042
if (write(fd, blnk, 1) == -1)
bin/pax/file_subs.c
1053
rdfile_close(ARCHD *arcn, int *fd)
bin/pax/file_subs.c
1058
if (*fd < 0)
bin/pax/file_subs.c
106
if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
bin/pax/file_subs.c
1065
fset_ftime(arcn->org_name, *fd, &arcn->sb.st_mtim,
bin/pax/file_subs.c
1068
(void)close(*fd);
bin/pax/file_subs.c
1069
*fd = -1;
bin/pax/file_subs.c
1082
set_crc(ARCHD *arcn, int fd)
bin/pax/file_subs.c
1092
if (fd < 0) {
bin/pax/file_subs.c
1108
if ((res = read(fd, tbuf, size)) <= 0)
bin/pax/file_subs.c
1121
else if (fstat(fd, &sb) == -1)
bin/pax/file_subs.c
1125
else if (lseek(fd, 0, SEEK_SET) < 0)
bin/pax/file_subs.c
115
return(fd);
bin/pax/file_subs.c
127
file_close(ARCHD *arcn, int fd)
bin/pax/file_subs.c
131
if (fd < 0)
bin/pax/file_subs.c
140
res = fset_ids(arcn->name, fd, arcn->sb.st_uid,
bin/pax/file_subs.c
151
fset_pmode(arcn->name, fd, arcn->sb.st_mode);
bin/pax/file_subs.c
153
fset_ftime(arcn->name, fd, &arcn->sb.st_mtim,
bin/pax/file_subs.c
155
if (close(fd) == -1)
bin/pax/file_subs.c
72
int fd = -1;
bin/pax/file_subs.c
724
fset_ftime(const char *fnm, int fd, const struct timespec *mtimp,
bin/pax/file_subs.c
746
if (futimens(fd, tv) == -1)
bin/pax/file_subs.c
776
fset_ids(char *fnm, int fd, uid_t uid, gid_t gid)
bin/pax/file_subs.c
778
if (fchown(fd, uid, gid) == -1) {
bin/pax/file_subs.c
806
fset_pmode(char *fnm, int fd, mode_t mode)
bin/pax/file_subs.c
809
if (fchmod(fd, mode) == -1)
bin/pax/file_subs.c
823
int fd, r;
bin/pax/file_subs.c
833
fd = open(ft->ft_name, O_RDONLY | O_DIRECTORY);
bin/pax/file_subs.c
834
if (fd == -1) {
bin/pax/file_subs.c
841
if (fstat(fd, &sb) == -1) {
bin/pax/file_subs.c
854
fset_pmode(ft->ft_name, fd, mode);
bin/pax/file_subs.c
859
fset_ftime(ft->ft_name, fd, &ft->ft_mtim,
bin/pax/file_subs.c
863
close(fd);
bin/pax/file_subs.c
88
if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_EXCL,
bin/pax/file_subs.c
90
return(fd);
bin/pax/file_subs.c
918
file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
bin/pax/file_subs.c
966
if (fd > -1 &&
bin/pax/file_subs.c
967
lseek(fd, wcnt, SEEK_CUR) < 0) {
bin/pax/file_subs.c
984
switch (fd) {
bin/pax/tables.c
676
int fd;
bin/pax/tables.c
679
fd = open(path0, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0600);
bin/pax/tables.c
680
if (fd == -1)
bin/pax/tables.c
682
if (fstat(fd, &sb) == -1) {
bin/pax/tables.c
684
close(fd);
bin/pax/tables.c
687
close(fd);
bin/rm/rm.c
297
int fd;
bin/rm/rm.c
300
fd = -1;
bin/rm/rm.c
313
if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW)) == -1)
bin/rm/rm.c
315
if (fstat(fd, &sb2))
bin/rm/rm.c
322
if (fstatfs(fd, &fsb) == -1)
bin/rm/rm.c
328
if (!pass(fd, sbp->st_size, buf, bsize))
bin/rm/rm.c
330
if (fsync(fd))
bin/rm/rm.c
332
close(fd);
bin/rm/rm.c
338
close(fd);
bin/rm/rm.c
345
pass(int fd, off_t len, char *buf, size_t bsize)
bin/rm/rm.c
352
if (write(fd, buf, wlen) != wlen)
bin/stty/key.c
204
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/key.c
207
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/key.c
326
if (ioctl(ip->fd, TIOCSETD, &tmp) == -1)
bin/stty/key.c
333
if (ioctl(ip->fd, TIOCSTART) == -1)
bin/stty/key.c
340
if (ioctl(ip->fd, TIOCSTOP) == -1)
bin/stty/stty.c
157
if (i.set && tcsetattr(i.fd, 0, &i.t) == -1)
bin/stty/stty.c
159
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) == -1)
bin/stty/stty.c
58
i.fd = STDIN_FILENO;
bin/stty/stty.c
72
if ((i.fd = open(optarg, O_RDONLY | O_NONBLOCK)) == -1)
bin/stty/stty.c
90
if (ioctl(i.fd, TIOCGETD, &i.ldisc) == -1)
bin/stty/stty.c
93
if (tcgetattr(i.fd, &i.t) == -1)
bin/stty/stty.c
95
if (ioctl(i.fd, TIOCGWINSZ, &i.win) == -1)
bin/stty/stty.h
36
int fd; /* file descriptor */
distrib/special/libstubs/db.c
83
dbp->fd = (int (*)(const struct __db *))__dberr;
games/cribbage/instr.c
48
int fd;
games/cribbage/instr.c
52
if ((fd = open(_PATH_INSTR, O_RDONLY)) == - 1)
games/cribbage/instr.c
65
if (dup2(fd, 0) == -1)
games/cribbage/instr.c
73
close(fd);
games/fish/fish.c
453
int fd;
games/fish/fish.c
458
if ((fd = open(_PATH_INSTR, O_RDONLY)) == -1)
games/fish/fish.c
469
if (dup2(fd, 0) == -1)
games/fish/fish.c
479
close(fd);
games/fortune/fortune/fortune.c
1004
if (read(fd, &fp->tbl.str_shortlen, sizeof(fp->tbl.str_shortlen)) !=
games/fortune/fortune/fortune.c
1010
if (read(fd, &fp->tbl.str_flags, sizeof(fp->tbl.str_flags)) !=
games/fortune/fortune/fortune.c
1016
if (read(fd, fp->tbl.stuff, sizeof(fp->tbl.stuff)) !=
games/fortune/fortune/fortune.c
1028
(void) close(fd);
games/fortune/fortune/fortune.c
393
int fd;
games/fortune/fortune/fortune.c
427
if ((fd = open(path, O_RDONLY)) < 0) {
games/fortune/fortune/fortune.c
459
fp->fd = fd;
games/fortune/fortune/fortune.c
518
fp->fd = -1;
games/fortune/fortune/fortune.c
562
int fd;
games/fortune/fortune/fortune.c
569
if ((fd = open(offensive, O_RDONLY)) < 0)
games/fortune/fortune/fortune.c
583
fp->fd = -1;
games/fortune/fortune/fortune.c
586
obscene->fd = fd;
games/fortune/fortune/fortune.c
609
(void) close(fp->fd);
games/fortune/fortune/fortune.c
610
fp->fd = -1;
games/fortune/fortune/fortune.c
72
int fd, datfd;
games/fortune/fortune/fortune.c
81
struct fd *child, *parent;
games/fortune/fortune/fortune.c
82
struct fd *next, *prev;
games/fortune/fortune/fortune.c
933
if (fp->inf == NULL && (fp->inf = fdopen(fp->fd, "r")) == NULL) {
games/fortune/fortune/fortune.c
976
int fd;
games/fortune/fortune/fortune.c
982
if ((fd = open(fp->datfile, O_RDONLY)) < 0) {
games/fortune/fortune/fortune.c
986
if (read(fd, &fp->tbl.str_version, sizeof(fp->tbl.str_version)) !=
games/fortune/fortune/fortune.c
992
if (read(fd, &fp->tbl.str_numstr, sizeof(fp->tbl.str_numstr)) !=
games/fortune/fortune/fortune.c
998
if (read(fd, &fp->tbl.str_longlen, sizeof(fp->tbl.str_longlen)) !=
games/grdc/grdc.c
126
pfd.fd = STDIN_FILENO;
games/hack/hack.bones.c
134
if((fd = open(bones, O_CREAT | O_TRUNC | O_WRONLY, FMASK)) == -1) return;
games/hack/hack.bones.c
135
savelev(fd,dlevel);
games/hack/hack.bones.c
136
(void) close(fd);
games/hack/hack.bones.c
142
int fd,x,y;
games/hack/hack.bones.c
147
if((fd = open(bones, O_RDONLY)) == -1) return(0);
games/hack/hack.bones.c
148
getlev(fd, 0, dlevel);
games/hack/hack.bones.c
151
(void) close(fd);
games/hack/hack.bones.c
77
int fd;
games/hack/hack.bones.c
86
if((fd = open(bones, O_RDONLY)) >= 0){
games/hack/hack.bones.c
87
(void) close(fd);
games/hack/hack.do.c
189
int fd;
games/hack/hack.do.c
197
fd = open(lock, O_CREAT | O_TRUNC | O_WRONLY, FMASK);
games/hack/hack.do.c
198
if(fd == -1) {
games/hack/hack.do.c
222
savelev(fd,dlevel);
games/hack/hack.do.c
223
(void) close(fd);
games/hack/hack.do.c
235
if((fd = open(lock, O_RDONLY)) == -1) {
games/hack/hack.do.c
240
getlev(fd, hackpid, dlevel);
games/hack/hack.do.c
241
(void) close(fd);
games/hack/hack.engrave.c
339
save_engravings(int fd)
games/hack/hack.engrave.c
348
bwrite(fd, &(ep->engr_lth), sizeof(ep->engr_lth));
games/hack/hack.engrave.c
349
bwrite(fd, ep, sizeof(struct engr) + ep->engr_lth);
games/hack/hack.engrave.c
352
bwrite(fd, nul, sizeof(unsigned));
games/hack/hack.engrave.c
357
rest_engravings(int fd)
games/hack/hack.engrave.c
364
mread(fd, (char *) &lth, sizeof(unsigned));
games/hack/hack.engrave.c
367
mread(fd, (char *) ep, sizeof(struct engr) + lth);
games/hack/hack.lev.c
100
bwrite(fd, &yupstair,sizeof(yupstair));
games/hack/hack.lev.c
101
bwrite(fd, &xdnstair,sizeof(xdnstair));
games/hack/hack.lev.c
102
bwrite(fd, &ydnstair,sizeof(ydnstair));
games/hack/hack.lev.c
103
savemonchn(fd, fmon);
games/hack/hack.lev.c
104
savegoldchn(fd, fgold);
games/hack/hack.lev.c
105
savetrapchn(fd, ftrap);
games/hack/hack.lev.c
106
saveobjchn(fd, fobj);
games/hack/hack.lev.c
107
saveobjchn(fd, billobjs);
games/hack/hack.lev.c
109
save_engravings(fd);
games/hack/hack.lev.c
111
bwrite(fd, rooms,sizeof(rooms));
games/hack/hack.lev.c
112
bwrite(fd, doors,sizeof(doors));
games/hack/hack.lev.c
119
bwrite(fd, wsegs,sizeof(wsegs));
games/hack/hack.lev.c
123
bwrite(fd, wtmp,sizeof(struct wseg));
games/hack/hack.lev.c
127
bwrite(fd, wgrowtime,sizeof(wgrowtime));
games/hack/hack.lev.c
132
bwrite(int fd, const void *loc, ssize_t num)
games/hack/hack.lev.c
134
if(write(fd, loc, num) != num)
games/hack/hack.lev.c
135
panic("cannot write %zd bytes to file #%d", num, fd);
games/hack/hack.lev.c
139
saveobjchn(int fd, struct obj *otmp)
games/hack/hack.lev.c
148
bwrite(fd, &xl, sizeof(int));
games/hack/hack.lev.c
149
bwrite(fd, otmp, xl + sizeof(struct obj));
games/hack/hack.lev.c
153
bwrite(fd, &minusone, sizeof(int));
games/hack/hack.lev.c
157
savemonchn(int fd, struct monst *mtmp)
games/hack/hack.lev.c
164
bwrite(fd, &monbegin, sizeof(monbegin));
games/hack/hack.lev.c
169
bwrite(fd, &xl, sizeof(int));
games/hack/hack.lev.c
170
bwrite(fd, mtmp, xl + sizeof(struct monst));
games/hack/hack.lev.c
171
if(mtmp->minvent) saveobjchn(fd,mtmp->minvent);
games/hack/hack.lev.c
175
bwrite(fd, &minusone, sizeof(int));
games/hack/hack.lev.c
179
savegoldchn(int fd, struct gold *gold)
games/hack/hack.lev.c
184
bwrite(fd, gold, sizeof(struct gold));
games/hack/hack.lev.c
188
bwrite(fd, nul, sizeof(struct gold));
games/hack/hack.lev.c
192
savetrapchn(int fd, struct trap *trap)
games/hack/hack.lev.c
197
bwrite(fd, trap, sizeof(struct trap));
games/hack/hack.lev.c
201
bwrite(fd, nul, sizeof(struct trap));
games/hack/hack.lev.c
205
getlev(int fd, int pid, xchar lev)
games/hack/hack.lev.c
218
mread(fd, (char *) &hpid, sizeof(hpid));
games/hack/hack.lev.c
219
mread(fd, (char *) &dlvl, sizeof(dlvl));
games/hack/hack.lev.c
229
mread(fd, (char *) levl, sizeof(levl));
games/hack/hack.lev.c
230
mread(fd, (char *)&omoves, sizeof(omoves));
games/hack/hack.lev.c
231
mread(fd, (char *)&xupstair, sizeof(xupstair));
games/hack/hack.lev.c
232
mread(fd, (char *)&yupstair, sizeof(yupstair));
games/hack/hack.lev.c
233
mread(fd, (char *)&xdnstair, sizeof(xdnstair));
games/hack/hack.lev.c
234
mread(fd, (char *)&ydnstair, sizeof(ydnstair));
games/hack/hack.lev.c
236
fmon = restmonchn(fd);
games/hack/hack.lev.c
268
mread(fd, (char *)gold, sizeof(struct gold));
games/hack/hack.lev.c
273
mread(fd, (char *)gold, sizeof(struct gold));
games/hack/hack.lev.c
277
mread(fd, (char *)trap, sizeof(struct trap));
games/hack/hack.lev.c
282
mread(fd, (char *)trap, sizeof(struct trap));
games/hack/hack.lev.c
285
fobj = restobjchn(fd);
games/hack/hack.lev.c
286
billobjs = restobjchn(fd);
games/hack/hack.lev.c
287
rest_engravings(fd);
games/hack/hack.lev.c
289
mread(fd, (char *)rooms, sizeof(rooms));
games/hack/hack.lev.c
290
mread(fd, (char *)doors, sizeof(doors));
games/hack/hack.lev.c
293
mread(fd, (char *)wsegs, sizeof(wsegs));
games/hack/hack.lev.c
297
mread(fd, (char *)wtmp, sizeof(struct wseg));
games/hack/hack.lev.c
303
mread(fd, (char *)wgrowtime, sizeof(wgrowtime));
games/hack/hack.lev.c
308
mread(int fd, char *buf, unsigned len)
games/hack/hack.lev.c
313
rlen = read(fd, buf, (int) len);
games/hack/hack.lev.c
83
savelev(int fd, xchar lev)
games/hack/hack.lev.c
90
if (fd < 0)
games/hack/hack.lev.c
95
bwrite(fd, &hackpid,sizeof(hackpid));
games/hack/hack.lev.c
96
bwrite(fd, &lev,sizeof(lev));
games/hack/hack.lev.c
97
bwrite(fd, levl,sizeof(levl));
games/hack/hack.lev.c
98
bwrite(fd, &moves,sizeof(long));
games/hack/hack.lev.c
99
bwrite(fd, &xupstair,sizeof(xupstair));
games/hack/hack.main.c
106
int fd;
games/hack/hack.main.c
291
if((fd = open(SAVEF, O_RDONLY)) >= 0) {
games/hack/hack.main.c
295
if(!dorecover(fd))
games/hack/hack.main.c
535
int fd;
games/hack/hack.main.c
539
if((fd = open(RECORD, O_RDWR | O_CREAT, FMASK)) == -1) {
games/hack/hack.main.c
543
(void) close(fd);
games/hack/hack.main.c
544
if((fd = open(HLOCK, O_RDONLY | O_CREAT, FMASK)) == -1) {
games/hack/hack.main.c
548
(void) close(fd);
games/hack/hack.o_init.c
172
savenames(int fd)
games/hack/hack.o_init.c
178
bwrite(fd, bases, sizeof bases);
games/hack/hack.o_init.c
179
bwrite(fd, objects, sizeof objects);
games/hack/hack.o_init.c
183
bwrite(fd, &len, sizeof len);
games/hack/hack.o_init.c
184
bwrite(fd, objects[i].oc_name, len);
games/hack/hack.o_init.c
186
bwrite(fd, &zero, sizeof len);
games/hack/hack.o_init.c
189
bwrite(fd, &len, sizeof len);
games/hack/hack.o_init.c
190
bwrite(fd, objects[i].oc_descr, len);
games/hack/hack.o_init.c
192
bwrite(fd, &zero, sizeof len);
games/hack/hack.o_init.c
195
bwrite(fd, &len, sizeof len);
games/hack/hack.o_init.c
196
bwrite(fd, objects[i].oc_uname, len);
games/hack/hack.o_init.c
198
bwrite(fd, &zero, sizeof len);
games/hack/hack.o_init.c
203
restnames(int fd)
games/hack/hack.o_init.c
208
mread(fd, (char *) bases, sizeof bases);
games/hack/hack.o_init.c
209
mread(fd, (char *) objects, sizeof objects);
games/hack/hack.o_init.c
211
mread(fd, (char *) &len, sizeof len);
games/hack/hack.o_init.c
214
mread(fd, objects[i].oc_name, len);
games/hack/hack.o_init.c
217
mread(fd, (char *) &len, sizeof len);
games/hack/hack.o_init.c
220
mread(fd, objects[i].oc_descr, len);
games/hack/hack.o_init.c
223
mread(fd, (char *) &len, sizeof len);
games/hack/hack.o_init.c
226
mread(fd, objects[i].oc_uname, len);
games/hack/hack.pager.c
370
int fd = open(fnam, O_RDONLY);
games/hack/hack.pager.c
372
if(fd == -1) {
games/hack/hack.pager.c
383
if(dup(fd)) {
games/hack/hack.pager.c
391
(void) close(fd);
games/hack/hack.save.c
104
if((fd = open(SAVEF, O_CREAT | O_TRUNC | O_WRONLY, FMASK)) == -1) {
games/hack/hack.save.c
111
savelev(fd,dlevel);
games/hack/hack.save.c
112
saveobjchn(fd, invent);
games/hack/hack.save.c
113
saveobjchn(fd, fcobj);
games/hack/hack.save.c
114
savemonchn(fd, fallen_down);
games/hack/hack.save.c
116
bwrite(fd, &tmp, sizeof tmp);
games/hack/hack.save.c
117
bwrite(fd, &flags, sizeof(struct flag));
games/hack/hack.save.c
118
bwrite(fd, &dlevel, sizeof dlevel);
games/hack/hack.save.c
119
bwrite(fd, &maxdlevel, sizeof maxdlevel);
games/hack/hack.save.c
120
bwrite(fd, &moves, sizeof moves);
games/hack/hack.save.c
121
bwrite(fd, &u, sizeof(struct you));
games/hack/hack.save.c
123
bwrite(fd, &(u.ustuck->m_id), sizeof u.ustuck->m_id);
games/hack/hack.save.c
124
bwrite(fd, pl_character, sizeof pl_character);
games/hack/hack.save.c
125
bwrite(fd, genocided, sizeof genocided);
games/hack/hack.save.c
126
bwrite(fd, fut_geno, sizeof fut_geno);
games/hack/hack.save.c
127
savenames(fd);
games/hack/hack.save.c
136
(void) close(fd);
games/hack/hack.save.c
143
bwrite(fd, &tmp, sizeof tmp); /* level number */
games/hack/hack.save.c
144
savelev(fd,tmp); /* actual level */
games/hack/hack.save.c
147
(void) close(fd);
games/hack/hack.save.c
156
dorecover(int fd)
games/hack/hack.save.c
165
getlev(fd, 0, 0);
games/hack/hack.save.c
166
invent = restobjchn(fd);
games/hack/hack.save.c
170
fcobj = restobjchn(fd);
games/hack/hack.save.c
171
fallen_down = restmonchn(fd);
games/hack/hack.save.c
172
mread(fd, (char *) &tmp, sizeof tmp);
games/hack/hack.save.c
174
(void) close(fd);
games/hack/hack.save.c
180
mread(fd, (char *) &flags, sizeof(struct flag));
games/hack/hack.save.c
181
mread(fd, (char *) &dlevel, sizeof dlevel);
games/hack/hack.save.c
182
mread(fd, (char *) &maxdlevel, sizeof maxdlevel);
games/hack/hack.save.c
183
mread(fd, (char *) &moves, sizeof moves);
games/hack/hack.save.c
184
mread(fd, (char *) &u, sizeof(struct you));
games/hack/hack.save.c
186
mread(fd, (char *) &mid, sizeof mid);
games/hack/hack.save.c
187
mread(fd, (char *) pl_character, sizeof pl_character);
games/hack/hack.save.c
188
mread(fd, (char *) genocided, sizeof genocided);
games/hack/hack.save.c
189
mread(fd, (char *) fut_geno, sizeof fut_geno);
games/hack/hack.save.c
190
restnames(fd);
games/hack/hack.save.c
192
if(read(fd, (char *) &tmp, sizeof tmp) != sizeof tmp)
games/hack/hack.save.c
194
getlev(fd, 0, tmp);
games/hack/hack.save.c
201
(void) lseek(fd, (off_t)0, SEEK_SET);
games/hack/hack.save.c
202
getlev(fd, 0, 0);
games/hack/hack.save.c
203
(void) close(fd);
games/hack/hack.save.c
238
restobjchn(int fd)
games/hack/hack.save.c
244
mread(fd, (char *) &xl, sizeof(xl));
games/hack/hack.save.c
249
mread(fd, (char *) otmp, (unsigned) xl + sizeof(struct obj));
games/hack/hack.save.c
261
restmonchn(int fd)
games/hack/hack.save.c
270
mread(fd, (char *)&monbegin, sizeof(monbegin));
games/hack/hack.save.c
274
mread(fd, (char *) &xl, sizeof(xl));
games/hack/hack.save.c
279
mread(fd, (char *) mtmp, (unsigned) xl + sizeof(struct monst));
games/hack/hack.save.c
285
mtmp->minvent = restobjchn(fd);
games/hack/hack.save.c
99
int fd, ofd;
games/hack/hack.unix.c
160
veryold(int fd)
games/hack/hack.unix.c
165
if(fstat(fd, &buf)) return(0); /* cannot get status */
games/hack/hack.unix.c
171
if(read(fd, (char *)&lockedpid, sizeof(lockedpid)) !=
games/hack/hack.unix.c
182
(void) close(fd);
games/hack/hack.unix.c
196
int i = 0, fd;
games/hack/hack.unix.c
230
if((fd = open(lock, O_RDONLY)) == -1) {
games/hack/hack.unix.c
237
if(veryold(fd)) /* if true, this closes fd and unlinks lock */
games/hack/hack.unix.c
239
(void) close(fd);
games/hack/hack.unix.c
246
fd = open(lock, O_CREAT | O_TRUNC | O_WRONLY, FMASK);
games/hack/hack.unix.c
249
if(fd == -1) {
games/hack/hack.unix.c
252
if(write(fd, (char *) &hackpid, sizeof(hackpid))
games/hack/hack.unix.c
256
if(close(fd) == -1) {
games/hack/makedefs.c
139
int n = read(fd, lp0, (line+LINSZ)-lp0);
games/hack/makedefs.c
76
int fd;
games/hack/makedefs.c
96
if ((fd = open(argv[1], O_RDONLY)) == -1) {
games/hunt/hunt/list.c
215
int fd, inlen = 8192;
games/hunt/hunt/list.c
255
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
games/hunt/hunt/list.c
264
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) == -1)
games/hunt/hunt/list.c
282
if (ioctl(fd, SIOCGIFFLAGS, (caddr_t)ifr) == -1) {
games/hunt/hunt/list.c
289
if (ioctl(fd, SIOCGIFBRDADDR, (caddr_t)ifr) == -1) {
games/hunt/hunt/list.c
295
if (ioctl(fd, SIOCGIFDSTADDR, (caddr_t)ifr) == -1) {
games/hunt/hunt/list.c
306
(void) close(fd);
games/hunt/hunt/list.c
46
next_driver_fd(int fd)
games/hunt/hunt/list.c
55
if (fd == -1 && numprobes == 0)
games/hunt/hunt/list.c
60
if (fd != -1) {
games/hunt/hunt/list.c
61
FD_SET(fd, &r);
games/hunt/hunt/list.c
62
maxfd = fd;
games/hunt/hunt/list.c
88
if (fd != -1 && FD_ISSET(fd, &r))
games/hunt/huntd/answer.c
102
sp->fd = newsock;
games/hunt/huntd/answer.c
103
FD_SET(sp->fd, &Fds_mask);
games/hunt/huntd/answer.c
104
if (sp->fd >= Num_fds)
games/hunt/huntd/answer.c
105
Num_fds = sp->fd + 1;
games/hunt/huntd/answer.c
129
len = read(sp->fd, sp->msg + sp->msglen,
games/hunt/huntd/answer.c
151
len = read(sp->fd, sp->inbuf + sp->inlen,
games/hunt/huntd/answer.c
196
(void) write(sp->fd, &version, sizeof version);
games/hunt/huntd/answer.c
206
conn = fdopen(sp->fd, "w");
games/hunt/huntd/answer.c
240
pp->p_fd = sp->fd;
games/hunt/huntd/answer.c
265
FD_CLR(sp->fd, &Fds_mask);
games/hunt/huntd/answer.c
266
close(sp->fd);
games/hunt/huntd/answer.c
528
sp->fd, sp->inlen + (sp->reading_msg ? sp->msglen : 0),
games/hunt/huntd/driver.c
1114
handle_wkport(int fd)
games/hunt/huntd/driver.c
1122
if (recvfrom(fd, &query, sizeof query, 0, &fromaddr, &fromlen) == -1)
games/hunt/huntd/driver.c
1167
if (sendto(fd, &response, sizeof response, 0,
games/hunt/huntd/driver.c
195
fd = sp->fd;
games/hunt/huntd/driver.c
196
if (FD_ISSET(fd, &Have_inp) && answer_next(sp)) {
games/hunt/huntd/driver.c
207
FD_CLR(fd, &Have_inp);
games/hunt/huntd/driver.c
90
int fd;
games/hunt/huntd/server.h
192
int fd;
games/phantasia/setup.c
123
if ((fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0660)) == -1)
games/phantasia/setup.c
126
close(fd); /* close newly created file */
games/phantasia/setup.c
74
int fd; /* file descriptor */
games/robots/move.c
99
pfd[0].fd = STDIN_FILENO;
games/sail/main.c
47
int fd;
games/sail/main.c
53
fd = open("/dev/null", O_RDONLY);
games/sail/main.c
54
if (fd < 3)
games/sail/main.c
56
close(fd);
games/tetris/input.c
72
pfd[0].fd = STDIN_FILENO;
games/worm/worm.c
170
pfd[0].fd = STDIN_FILENO;
games/wump/wump.c
868
int fd;
games/wump/wump.c
877
if ((fd = open(_PATH_WUMPINFO, O_RDONLY)) == -1) {
games/wump/wump.c
892
if (dup2(fd, 0) == -1)
games/wump/wump.c
902
close(fd);
include/db.h
101
int (*fd)(const struct __db *);
include/icdb.h
39
int icdb_save(struct icdb *db, int fd);
lib/libagentx/agentx.c
230
agentx_connect(struct agentx *ax, int fd)
lib/libagentx/agentx.c
232
agentx_finalize(ax, fd);
lib/libagentx/agentx.c
267
agentx_finalize(struct agentx *ax, int fd)
lib/libagentx/agentx.c
281
if ((ax->ax_ax = ax_new(fd)) == NULL) {
lib/libagentx/agentx.c
283
close(fd);
lib/libagentx/agentx.c
288
agentx_log_ax_info(ax, "new connection: %d", fd);
lib/libagentx/agentx.c
290
ax->ax_fd = fd;
lib/libagentx/agentx.c
300
agentx_wantwritenow(struct agentx *ax, int fd)
lib/libagentx/ax.c
60
ax_new(int fd)
lib/libagentx/ax.c
64
if (fd == -1) {
lib/libagentx/ax.c
71
ax->ax_fd = fd;
lib/libc/asr/asr.c
241
fds[0].fd = ar->ar_fd;
lib/libc/asr/asr.c
432
int fd;
lib/libc/asr/asr.c
448
fd = __pledge_open(_PATH_RESCONF, O_RDONLY|O_CLOEXEC);
lib/libc/asr/asr.c
449
if (fd == -1)
lib/libc/asr/asr.c
451
if (fstat(fd, &st) == -1 ||
lib/libc/asr/asr.c
454
close(fd);
lib/libc/asr/asr.c
460
if (asr_ctx_from_fd(ac, fd) == -1) {
lib/libc/asr/asr.c
744
asr_ctx_from_fd(struct asr_ctx *ac, int fd)
lib/libc/asr/asr.c
750
cf = fdopen(fd, "r");
lib/libc/asr/asr.c
752
close(fd);
lib/libc/asr/getaddrinfo_async.c
118
int i, family, r, is_localhost = 0, fd;
lib/libc/asr/getaddrinfo_async.c
417
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
lib/libc/asr/getaddrinfo_async.c
418
if (fd != -1)
lib/libc/asr/getaddrinfo_async.c
419
f = fdopen(fd, "r");
lib/libc/asr/getaddrinfo_async.c
421
close(fd);
lib/libc/asr/gethostnamadr_async.c
151
int r, type, saved_errno, fd;
lib/libc/asr/gethostnamadr_async.c
290
fd = __pledge_open(_PATH_HOSTS, O_RDONLY|O_CLOEXEC);
lib/libc/asr/gethostnamadr_async.c
291
if (fd == -1)
lib/libc/asr/gethostnamadr_async.c
293
if ((f = fdopen(fd, "r")) == NULL) {
lib/libc/asr/gethostnamadr_async.c
294
close(fd);
lib/libc/asr/res_send_async.c
608
pfd.fd = as->as_fd;
lib/libc/db/btree/bt_close.c
59
int fd;
lib/libc/db/btree/bt_close.c
94
fd = t->bt_fd;
lib/libc/db/btree/bt_close.c
97
return (close(fd) ? RET_ERROR : RET_SUCCESS);
lib/libc/db/btree/bt_open.c
171
dbp->fd = __bt_fd;
lib/libc/db/btree/bt_open.c
196
} else if (fd != -1) {
lib/libc/db/btree/bt_open.c
207
t->bt_fd = fd;
lib/libc/db/btree/bt_open.c
395
int fd, len;
lib/libc/db/btree/bt_open.c
410
if ((fd = mkostemp(path, O_CLOEXEC)) != -1)
lib/libc/db/btree/bt_open.c
413
return(fd);
lib/libc/db/btree/bt_open.c
83
__bt_open(const char *fname, int fd, int flags, int mode, const BTREEINFO *openinfo,
lib/libc/db/db/db.c
88
dbp->fd = (int (*)(const struct __db *))__dberr;
lib/libc/db/hash/hash.c
122
} else if (fd != -1) {
lib/libc/db/hash/hash.c
123
hashp->fp = fd;
lib/libc/db/hash/hash.c
196
dbp->fd = hash_fd;
lib/libc/db/hash/hash.c
91
__hash_open(const char *file, int fd, int flags, int mode,
lib/libc/db/hash/hash_page.c
513
int fd, page, size, rsize;
lib/libc/db/hash/hash_page.c
516
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
519
if ((fd == -1) || !is_disk) {
lib/libc/db/hash/hash_page.c
527
if ((rsize = pread(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/hash/hash_page.c
567
int fd, page, size, wsize;
lib/libc/db/hash/hash_page.c
572
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
591
if ((wsize = pwrite(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/mpool/mpool.c
211
if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != mp->pagesize) {
lib/libc/db/mpool/mpool.c
320
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
lib/libc/db/mpool/mpool.c
397
if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize)
lib/libc/db/mpool/mpool.c
55
mpool_open(void *key, int fd, pgno_t pagesize, pgno_t maxcache)
lib/libc/db/mpool/mpool.c
67
if (fstat(fd, &sb))
lib/libc/db/mpool/mpool.c
83
mp->fd = fd;
lib/libc/db/recno/rec_open.c
156
dbp->fd = __rec_fd;
lib/libc/db/recno/rec_open.c
50
__rec_open(const char *fname, int fd, int flags, int mode, const RECNOINFO *openinfo,
lib/libc/db/recno/rec_open.c
64
} else if (fd != -1) {
lib/libc/db/recno/rec_open.c
65
rfd = fd;
lib/libc/gen/auth_subr.c
1000
_recv_fd(auth_session_t *as, int fd)
lib/libc/gen/auth_subr.c
1012
if (recvmsg(fd, &msg, 0) == -1)
lib/libc/gen/auth_subr.c
1031
if (as->fd != -1)
lib/libc/gen/auth_subr.c
1032
close(as->fd);
lib/libc/gen/auth_subr.c
1033
as->fd = *(int *)CMSG_DATA(cmp);
lib/libc/gen/auth_subr.c
1039
_auth_spool(auth_session_t *as, int fd)
lib/libc/gen/auth_subr.c
1045
r = read(fd, as->spool + as->index,
lib/libc/gen/auth_subr.c
1063
_recv_fd(as, fd);
lib/libc/gen/auth_subr.c
111
int fd; /* connection to authenticator */
lib/libc/gen/auth_subr.c
170
as->fd = -1;
lib/libc/gen/auth_subr.c
217
if (as->fd != -1) {
lib/libc/gen/auth_subr.c
218
close(as->fd);
lib/libc/gen/auth_subr.c
219
as->fd = -1;
lib/libc/gen/auth_subr.c
825
if (as->fd != -1) {
lib/libc/gen/auth_subr.c
875
if (as->fd != -1) {
lib/libc/gen/auth_subr.c
876
if (dup2(as->fd, AUTH_FD) == -1)
lib/libc/gen/auth_subr.c
886
if (as->fd != -1) {
lib/libc/gen/auth_subr.c
887
close(as->fd); /* so child has only ref */
lib/libc/gen/auth_subr.c
888
as->fd = -1;
lib/libc/gen/authenticate.c
164
int fd, nchars;
lib/libc/gen/authenticate.c
167
if ((fd = open(file, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/gen/authenticate.c
169
while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0)
lib/libc/gen/authenticate.c
171
(void)close(fd);
lib/libc/gen/closedir.c
44
int fd;
lib/libc/gen/closedir.c
47
fd = dirp->dd_fd;
lib/libc/gen/closedir.c
53
return (close(fd));
lib/libc/gen/daemon.c
39
int fd;
lib/libc/gen/daemon.c
56
if (!noclose && (fd = __pledge_open(_PATH_DEVNULL, O_RDWR)) != -1) {
lib/libc/gen/daemon.c
57
(void)dup2(fd, STDIN_FILENO);
lib/libc/gen/daemon.c
58
(void)dup2(fd, STDOUT_FILENO);
lib/libc/gen/daemon.c
59
(void)dup2(fd, STDERR_FILENO);
lib/libc/gen/daemon.c
60
if (fd > 2)
lib/libc/gen/daemon.c
61
(void)close(fd);
lib/libc/gen/fdatasync.c
10
fdatasync(int fd)
lib/libc/gen/fdatasync.c
12
return (fsync(fd));
lib/libc/gen/fts.c
1023
fts_safe_changedir(FTS *sp, FTSENT *p, int fd, const char *path)
lib/libc/gen/fts.c
1028
newfd = fd;
lib/libc/gen/fts.c
1031
if (fd == -1 && (newfd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
1045
if (fd == -1)
lib/libc/gen/fts.c
467
int fd;
lib/libc/gen/fts.c
520
if ((fd = open(".", O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
523
if (fchdir(fd)) {
lib/libc/gen/fts.c
524
(void)close(fd);
lib/libc/gen/fts.c
527
(void)close(fd);
lib/libc/gen/fts.c
63
#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
lib/libc/gen/getgrent.c
201
int fd;
lib/libc/gen/getgrent.c
216
fd = __pledge_open(_PATH_GROUP, O_RDONLY|O_CLOEXEC);
lib/libc/gen/getgrent.c
217
if (fd == -1)
lib/libc/gen/getgrent.c
219
if ((_gr_fp = fdopen(fd, "r")) == NULL)
lib/libc/gen/getgrent.c
220
close(fd);
lib/libc/gen/getgrouplist.c
117
int found = 0, fd;
lib/libc/gen/getgrouplist.c
119
fd = __pledge_open(_PATH_NETID, O_RDONLY|O_CLOEXEC);
lib/libc/gen/getgrouplist.c
120
if (fd == -1)
lib/libc/gen/getgrouplist.c
122
fp = fdopen(fd, "r");
lib/libc/gen/getgrouplist.c
124
close(fd);
lib/libc/gen/getpwent.c
955
int saved_errno = errno, fd;
lib/libc/gen/getpwent.c
962
fd = __pledge_open(_PATH_SMP_DB, O_RDONLY | O_CLOEXEC);
lib/libc/gen/getpwent.c
963
if (fd != -1)
lib/libc/gen/getpwent.c
964
_pw_db = __hash_open(NULL, fd, O_RDONLY, 0, NULL, 0);
lib/libc/gen/getpwent.c
966
close(fd);
lib/libc/gen/getpwent.c
969
fd = __pledge_open(_PATH_MP_DB, O_RDONLY | O_CLOEXEC);
lib/libc/gen/getpwent.c
970
if (fd != -1)
lib/libc/gen/getpwent.c
971
_pw_db = __hash_open(NULL, fd, O_RDONLY, 0, NULL, 0);
lib/libc/gen/getpwent.c
973
close(fd);
lib/libc/gen/isatty.c
35
isatty(int fd)
lib/libc/gen/isatty.c
37
return fcntl(fd, F_ISATTY) != -1;
lib/libc/gen/isfdtype.c
27
isfdtype(int fd, int fdtype)
lib/libc/gen/isfdtype.c
31
if (fstat(fd, &sb) != 0)
lib/libc/gen/login_cap.c
578
int fd = -1;
lib/libc/gen/login_cap.c
588
fd = open(rundir, O_RDONLY|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
lib/libc/gen/login_cap.c
589
if (fd == -1) {
lib/libc/gen/login_cap.c
593
if (fstat(fd, &sb) == -1) {
lib/libc/gen/login_cap.c
603
if (fchown(fd, uid, pwd->pw_gid) == -1) {
lib/libc/gen/login_cap.c
620
if (fd != -1)
lib/libc/gen/login_cap.c
621
close(fd);
lib/libc/gen/nlist.c
104
if (pread(fd, &ehdr, sizeof(Elf_Ehdr), 0) != sizeof(Elf_Ehdr) ||
lib/libc/gen/nlist.c
105
!__elf_is_okay__(&ehdr) || fstat(fd, &st) == -1)
lib/libc/gen/nlist.c
119
shdr = mmap(NULL, shdr_size, PROT_READ, MAP_SHARED|MAP_FILE, fd,
lib/libc/gen/nlist.c
126
if (pread(fd, shdr, shdr_size, ehdr.e_shoff) != shdr_size) {
lib/libc/gen/nlist.c
196
if (pread(fd, strtab, symstrsize, symstroff) != symstrsize) {
lib/libc/gen/nlist.c
202
fd, symstroff);
lib/libc/gen/nlist.c
209
if (pread(fd, sbuf, cc, symoff) != cc)
lib/libc/gen/nlist.c
293
int fd, n;
lib/libc/gen/nlist.c
295
fd = open(name, O_RDONLY | O_CLOEXEC);
lib/libc/gen/nlist.c
296
if (fd == -1)
lib/libc/gen/nlist.c
298
n = __fdnlist(fd, list);
lib/libc/gen/nlist.c
299
(void)close(fd);
lib/libc/gen/nlist.c
87
__fdnlist(int fd, struct nlist *list)
lib/libc/gen/opendir.c
100
if (fstat(fd, &sb))
lib/libc/gen/opendir.c
119
dirp->dd_fd = fd;
lib/libc/gen/opendir.c
50
int fd;
lib/libc/gen/opendir.c
52
if ((fd = open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) == -1)
lib/libc/gen/opendir.c
54
dirp = __fdopendir(fd);
lib/libc/gen/opendir.c
56
close(fd);
lib/libc/gen/opendir.c
65
fdopendir(int fd)
lib/libc/gen/opendir.c
70
if ((flags = fcntl(fd, F_GETFL)) == -1)
lib/libc/gen/opendir.c
76
dirp = __fdopendir(fd);
lib/libc/gen/opendir.c
79
dirp->dd_bufpos = dirp->dd_curpos = lseek(fd, 0, SEEK_CUR);
lib/libc/gen/opendir.c
85
flags = fcntl(fd, F_GETFD);
lib/libc/gen/opendir.c
87
(void)fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
lib/libc/gen/opendir.c
94
__fdopendir(int fd)
lib/libc/gen/posix_spawn.c
138
int fd;
lib/libc/gen/posix_spawn.c
143
fd = open(fae->fae_path, fae->fae_oflag, fae->fae_mode);
lib/libc/gen/posix_spawn.c
144
if (fd == -1)
lib/libc/gen/posix_spawn.c
146
if (fd != fae->fae_fildes) {
lib/libc/gen/posix_spawn.c
147
if (dup2(fd, fae->fae_fildes) == -1)
lib/libc/gen/posix_spawn.c
149
if (close(fd) != 0) {
lib/libc/gen/posix_spawn.c
159
fd = fae->fae_fildes;
lib/libc/gen/posix_spawn.c
160
if (fd == fae->fae_newfildes) {
lib/libc/gen/posix_spawn.c
161
int flags = fcntl(fd, F_GETFD);
lib/libc/gen/posix_spawn.c
165
fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC) == -1))
lib/libc/gen/posix_spawn.c
167
} else if (dup2(fd, fae->fae_newfildes) == -1)
lib/libc/gen/scandir.c
161
int fd;
lib/libc/gen/scandir.c
163
fd = HIDDEN(openat)(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
lib/libc/gen/scandir.c
164
if (fd == -1)
lib/libc/gen/scandir.c
166
dirp = __fdopendir(fd);
lib/libc/gen/scandir.c
168
HIDDEN(close)(fd);
lib/libc/gen/shm_open.c
104
fd = -1;
lib/libc/gen/shm_open.c
109
fd = shm_open(t, O_RDWR | O_EXCL | O_CREAT, 0600);
lib/libc/gen/shm_open.c
110
if (fd != -1) {
lib/libc/gen/shm_open.c
117
return fd;
lib/libc/gen/shm_open.c
52
int fd;
lib/libc/gen/shm_open.c
65
fd = HIDDEN(open)(shmpath, flags, mode);
lib/libc/gen/shm_open.c
66
if (fd == -1)
lib/libc/gen/shm_open.c
68
if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) {
lib/libc/gen/shm_open.c
69
HIDDEN(close)(fd);
lib/libc/gen/shm_open.c
74
HIDDEN(close)(fd);
lib/libc/gen/shm_open.c
78
return fd;
lib/libc/gen/shm_open.c
96
int i, fd;
lib/libc/gen/statvfs.c
47
fstatvfs(int fd, struct statvfs *p)
lib/libc/gen/statvfs.c
52
ret = fstatfs(fd, &sb);
lib/libc/gen/ttyname.c
47
ttyname(int fd)
lib/libc/gen/ttyname.c
56
err = ttyname_r(fd, bufp, sizeof buf);
lib/libc/gen/ttyname.c
67
ttyname_r(int fd, char *buf, size_t len)
lib/libc/gen/ttyname.c
78
if (!isatty(fd))
lib/libc/gen/ttyname.c
81
if (fstat(fd, &sb))
lib/libc/gmon/gmon.c
378
close(fd);
lib/libc/hash/helper.c
65
int fd, save_errno;
lib/libc/hash/helper.c
70
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/hash/helper.c
73
if (fstat(fd, &sb) == -1) {
lib/libc/hash/helper.c
75
close(fd);
lib/libc/hash/helper.c
81
if (off > 0 && lseek(fd, off, SEEK_SET) == -1) {
lib/libc/hash/helper.c
83
close(fd);
lib/libc/hash/helper.c
88
while ((nr = read(fd, buffer, MINIMUM(sizeof(buffer), len))) > 0) {
lib/libc/hash/helper.c
95
close(fd);
lib/libc/hidden/dirent.h
24
DIR *__fdopendir(int fd);
lib/libc/include/mpool.h
71
int fd; /* file descriptor */
lib/libc/net/getprotoent.c
47
int fd = __pledge_open(_PATH_PROTOCOLS, O_RDONLY|O_CLOEXEC);
lib/libc/net/getprotoent.c
48
if (fd != -1)
lib/libc/net/getprotoent.c
49
pd->fp = fdopen(fd, "r" );
lib/libc/net/getprotoent.c
51
close(fd);
lib/libc/net/getservent.c
47
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
lib/libc/net/getservent.c
48
if (fd != -1)
lib/libc/net/getservent.c
49
sd->fp = fdopen(fd, "r" );
lib/libc/net/getservent.c
51
close(fd);
lib/libc/net/getservent.c
83
int fd = __pledge_open(_PATH_SERVICES, O_RDONLY|O_CLOEXEC);
lib/libc/net/getservent.c
84
if (fd == -1)
lib/libc/net/getservent.c
86
if ((sd->fp = fdopen(fd, "r" )) == NULL) {
lib/libc/net/getservent.c
87
close(fd);
lib/libc/net/rcmd.c
205
pfd[0].fd = s;
lib/libc/net/rcmd.c
207
pfd[1].fd = s2;
lib/libc/nls/catopen.c
169
int fd;
lib/libc/nls/catopen.c
173
if ((fd = open(path, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/nls/catopen.c
176
if (fstat(fd, &st) != 0) {
lib/libc/nls/catopen.c
177
close (fd);
lib/libc/nls/catopen.c
183
close (fd);
lib/libc/nls/catopen.c
187
data = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
lib/libc/nls/catopen.c
188
close (fd);
lib/libc/rpc/clnt_tcp.c
396
pfd[0].fd = ct->ct_sock;
lib/libc/rpc/clnt_udp.c
209
pfd[0].fd = cu->cu_sock;
lib/libc/rpc/pmap_rmt.c
254
pfd[0].fd = sock;
lib/libc/rpc/svc.c
159
svc_pollfd[slot].fd = -1;
lib/libc/rpc/svc.c
187
svc_pollfd[slot].fd = sock;
lib/libc/rpc/svc.c
215
if (svc_pollfd[slot].fd == sock) {
lib/libc/rpc/svc.c
216
svc_pollfd[slot].fd = -1;
lib/libc/rpc/svc.c
239
if (svc_pollfd[i].fd == -1)
lib/libc/rpc/svc.c
247
svc_pollfd[i].fd = -1;
lib/libc/rpc/svc.c
257
svc_pollfd[svc_max_pollfd - 1].fd == -1)
lib/libc/rpc/svc.c
544
if (pfd[i].fd == -1)
lib/libc/rpc/svc.c
550
svc_getreq_common(pfd[i].fd);
lib/libc/rpc/svc.c
556
svc_getreq_common(int fd)
lib/libc/rpc/svc.c
572
xprt = xports[fd];
lib/libc/rpc/svc_tcp.c
191
svcfd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_tcp.c
194
return (makefd_xprt(fd, sendsize, recvsize));
lib/libc/rpc/svc_tcp.c
198
makefd_xprt(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_tcp.c
222
xprt->xp_sock = fd;
lib/libc/rpc/svc_tcp.c
346
pfd[0].fd = sock;
lib/libc/rpc/svc_tcp.c
93
static SVCXPRT *makefd_xprt(int fd, u_int sendsize, u_int recvsize);
lib/libc/stdio/dprintf.c
39
dprintf(int fd, const char * __restrict fmt, ...)
lib/libc/stdio/dprintf.c
45
ret = vdprintf(fd, fmt, ap);
lib/libc/stdio/fdopen.c
43
fdopen(int fd, const char *mode)
lib/libc/stdio/fdopen.c
52
if ((fdflags = fcntl(fd, F_GETFL)) == -1)
lib/libc/stdio/fdopen.c
75
if ((oflags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC))
lib/libc/stdio/fdopen.c
76
fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
lib/libc/stdio/fdopen.c
78
fp->_file = fd;
lib/libc/stdio/tmpfile.c
47
int fd, sverrno;
lib/libc/stdio/tmpfile.c
53
fd = mkstemp(buf);
lib/libc/stdio/tmpfile.c
54
if (fd != -1)
lib/libc/stdio/tmpfile.c
59
if (fd == -1)
lib/libc/stdio/tmpfile.c
62
if ((fp = fdopen(fd, "w+")) == NULL) {
lib/libc/stdio/tmpfile.c
64
(void)close(fd);
lib/libc/stdio/vdprintf.c
51
vdprintf(int fd, const char * __restrict fmt, va_list ap)
lib/libc/stdio/vdprintf.c
61
f._cookie = &fd;
lib/libc/stdlib/icdb.c
102
int fd;
lib/libc/stdlib/icdb.c
137
db->fd = -1;
lib/libc/stdlib/icdb.c
161
int fd, i, saved_errno;
lib/libc/stdlib/icdb.c
163
if ((fd = open(name, flags | O_CLOEXEC)) == -1)
lib/libc/stdlib/icdb.c
165
if (fstat(fd, &sb) != 0)
lib/libc/stdlib/icdb.c
170
((flags & O_RDWR) ? PROT_WRITE : 0), MAP_SHARED, fd, 0);
lib/libc/stdlib/icdb.c
192
db->fd = fd;
lib/libc/stdlib/icdb.c
199
if (fd != -1)
lib/libc/stdlib/icdb.c
200
close(fd);
lib/libc/stdlib/icdb.c
279
if (db->fd != -1) {
lib/libc/stdlib/icdb.c
346
icdb_save(struct icdb *db, int fd)
lib/libc/stdlib/icdb.c
359
if (ftruncate(fd, 0) != 0)
lib/libc/stdlib/icdb.c
361
if (write(fd, info, sizeof(*info)) != sizeof(*info))
lib/libc/stdlib/icdb.c
364
if (write(fd, db->idxdata[i], idxlen) != idxlen)
lib/libc/stdlib/icdb.c
367
if (write(fd, db->entries, info->nentries * entrysize) !=
lib/libc/stdlib/icdb.c
379
if (db->fd == -1) {
lib/libc/stdlib/icdb.c
386
close(db->fd);
lib/libc/stdlib/posix_pty.c
35
int fd, mfd = -1;
lib/libc/stdlib/posix_pty.c
45
fd = open(PATH_PTMDEV, O_RDWR);
lib/libc/stdlib/posix_pty.c
46
if (fd != -1) {
lib/libc/stdlib/posix_pty.c
47
if (ioctl(fd, PTMGET, &ptm) != -1) {
lib/libc/stdlib/posix_pty.c
51
close(fd);
lib/libc/sys/w_close.c
22
close(int fd)
lib/libc/sys/w_close.c
27
ret = HIDDEN(close)(fd);
lib/libc/sys/w_closefrom.c
22
closefrom(int fd)
lib/libc/sys/w_closefrom.c
27
ret = HIDDEN(closefrom)(fd);
lib/libc/sys/w_fcntl.c
23
fcntl(int fd, int cmd, ...)
lib/libc/sys/w_fcntl.c
36
ret = HIDDEN(fcntl)(fd, cmd, va_arg(ap, int));
lib/libc/sys/w_fcntl.c
42
ret = HIDDEN(fcntl)(fd, cmd);
lib/libc/sys/w_fcntl.c
46
ret = HIDDEN(fcntl)(fd, cmd, va_arg(ap, struct flock *));
lib/libc/sys/w_fcntl.c
50
ret = HIDDEN(fcntl)(fd, cmd, va_arg(ap, struct flock *));
lib/libc/sys/w_fcntl.c
54
ret = HIDDEN(fcntl)(fd, cmd, va_arg(ap, void *));
lib/libc/sys/w_fsync.c
22
fsync(int fd)
lib/libc/sys/w_fsync.c
27
ret = HIDDEN(fsync)(fd);
lib/libc/sys/w_openat.c
23
openat(int fd, const char *path, int flags, ...)
lib/libc/sys/w_openat.c
36
ret = HIDDEN(openat)(fd, path, flags, mode);
lib/libc/sys/w_pread.c
22
pread(int fd, void *buf, size_t nbyte, off_t offset)
lib/libc/sys/w_pread.c
27
ret = HIDDEN(pread)(fd, buf, nbyte, offset);
lib/libc/sys/w_preadv.c
23
preadv(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
lib/libc/sys/w_preadv.c
28
ret = HIDDEN(preadv)(fd, iovp, iovcnt, offset);
lib/libc/sys/w_pwrite.c
22
pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
lib/libc/sys/w_pwrite.c
27
ret = HIDDEN(pwrite)(fd, buf, nbyte, offset);
lib/libc/sys/w_pwritev.c
23
pwritev(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
lib/libc/sys/w_pwritev.c
28
ret = HIDDEN(pwritev)(fd, iovp, iovcnt, offset);
lib/libc/sys/w_read.c
22
read(int fd, void *buf, size_t nbytes)
lib/libc/sys/w_read.c
27
ret = HIDDEN(read)(fd, buf, nbytes);
lib/libc/sys/w_readv.c
22
readv(int fd, const struct iovec *iov, int iovcnt)
lib/libc/sys/w_readv.c
27
ret = HIDDEN(readv)(fd, iov, iovcnt);
lib/libc/sys/w_recvfrom.c
22
recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr,
lib/libc/sys/w_recvfrom.c
28
ret = HIDDEN(recvfrom)(fd, buf, len, flags, addr, addrlen);
lib/libc/sys/w_recvmmsg.c
22
recvmmsg(int fd, struct mmsghdr *mmsg, unsigned int vlen, int flags,
lib/libc/sys/w_recvmmsg.c
28
ret = HIDDEN(recvmmsg)(fd, mmsg, vlen, flags, ts);
lib/libc/sys/w_recvmsg.c
22
recvmsg(int fd, struct msghdr *msg, int flags)
lib/libc/sys/w_recvmsg.c
27
ret = HIDDEN(recvmsg)(fd, msg, flags);
lib/libc/sys/w_sendto.c
22
sendto(int fd, const void *msg, size_t len, int flags,
lib/libc/sys/w_sendto.c
28
ret = HIDDEN(sendto)(fd, msg, len, flags, to, tolen);
lib/libc/sys/w_write.c
22
write(int fd, const void *buf, size_t nbytes)
lib/libc/sys/w_write.c
27
ret = HIDDEN(write)(fd, buf, nbytes);
lib/libc/sys/w_writev.c
22
writev(int fd, const struct iovec *iov, int iovcnt)
lib/libc/sys/w_writev.c
27
ret = HIDDEN(writev)(fd, iov, iovcnt);
lib/libc/termios/tcdrain.c
37
tcdrain(int fd)
lib/libc/termios/tcdrain.c
42
ret = ioctl(fd, TIOCDRAIN, 0);
lib/libc/termios/tcflow.c
37
tcflow(int fd, int action)
lib/libc/termios/tcflow.c
44
return (ioctl(fd, TIOCSTOP, 0));
lib/libc/termios/tcflow.c
46
return (ioctl(fd, TIOCSTART, 0));
lib/libc/termios/tcflow.c
49
if (tcgetattr(fd, &term) == -1)
lib/libc/termios/tcflow.c
53
HIDDEN(write)(fd, &c, sizeof(c)) == -1)
lib/libc/termios/tcflush.c
37
tcflush(int fd, int which)
lib/libc/termios/tcflush.c
55
return (ioctl(fd, TIOCFLUSH, &com));
lib/libc/termios/tcgetattr.c
35
tcgetattr(int fd, struct termios *t)
lib/libc/termios/tcgetattr.c
37
return (ioctl(fd, TIOCGETA, t));
lib/libc/termios/tcgetpgrp.c
35
tcgetpgrp(int fd)
lib/libc/termios/tcgetpgrp.c
39
if (ioctl(fd, TIOCGPGRP, &s) == -1)
lib/libc/termios/tcgetsid.c
35
tcgetsid(int fd)
lib/libc/termios/tcgetsid.c
39
if (ioctl(fd, TIOCGSID, &s) == -1)
lib/libc/termios/tcsendbreak.c
36
tcsendbreak(int fd, int len)
lib/libc/termios/tcsendbreak.c
43
if (ioctl(fd, TIOCSBRK, 0) == -1)
lib/libc/termios/tcsendbreak.c
46
if (ioctl(fd, TIOCCBRK, 0) == -1)
lib/libc/termios/tcsetattr.c
36
tcsetattr(int fd, int opt, const struct termios *t)
lib/libc/termios/tcsetattr.c
47
return (ioctl(fd, TIOCSETA, t));
lib/libc/termios/tcsetattr.c
49
return (ioctl(fd, TIOCSETAW, t));
lib/libc/termios/tcsetattr.c
51
return (ioctl(fd, TIOCSETAF, t));
lib/libc/termios/tcsetpgrp.c
35
tcsetpgrp(int fd, pid_t pgrp)
lib/libc/termios/tcsetpgrp.c
40
return (ioctl(fd, TIOCSPGRP, &s));
lib/libc/time/localtime.c
340
int i, fd;
lib/libc/time/localtime.c
370
fd = __pledge_open(name, O_RDONLY|O_CLOEXEC);
lib/libc/time/localtime.c
371
if (fd == -1)
lib/libc/time/localtime.c
373
if (fstat(fd, &st) == -1 || !S_ISREG(st.st_mode)) {
lib/libc/time/localtime.c
374
close(fd);
lib/libc/time/localtime.c
377
return fd;
lib/libcrypto/arc4random/getentropy_aix.c
125
int fd, flags;
lib/libcrypto/arc4random/getentropy_aix.c
137
fd = open(path, flags);
lib/libcrypto/arc4random/getentropy_aix.c
138
if (fd == -1) {
lib/libcrypto/arc4random/getentropy_aix.c
144
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
lib/libcrypto/arc4random/getentropy_aix.c
148
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) {
lib/libcrypto/arc4random/getentropy_aix.c
149
close(fd);
lib/libcrypto/arc4random/getentropy_aix.c
154
ssize_t ret = read(fd, (char *)buf + i, wanted);
lib/libcrypto/arc4random/getentropy_aix.c
159
close(fd);
lib/libcrypto/arc4random/getentropy_aix.c
164
close(fd);
lib/libcrypto/arc4random/getentropy_hpux.c
129
int fd, flags;
lib/libcrypto/arc4random/getentropy_hpux.c
141
fd = open(path, flags);
lib/libcrypto/arc4random/getentropy_hpux.c
142
if (fd == -1) {
lib/libcrypto/arc4random/getentropy_hpux.c
148
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
lib/libcrypto/arc4random/getentropy_hpux.c
152
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) {
lib/libcrypto/arc4random/getentropy_hpux.c
153
close(fd);
lib/libcrypto/arc4random/getentropy_hpux.c
158
ssize_t ret = read(fd, (char *)buf + i, wanted);
lib/libcrypto/arc4random/getentropy_hpux.c
163
close(fd);
lib/libcrypto/arc4random/getentropy_hpux.c
168
close(fd);
lib/libcrypto/arc4random/getentropy_linux.c
203
int fd, cnt, flags;
lib/libcrypto/arc4random/getentropy_linux.c
215
fd = open("/dev/urandom", flags);
lib/libcrypto/arc4random/getentropy_linux.c
216
if (fd == -1) {
lib/libcrypto/arc4random/getentropy_linux.c
222
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
lib/libcrypto/arc4random/getentropy_linux.c
226
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) {
lib/libcrypto/arc4random/getentropy_linux.c
227
close(fd);
lib/libcrypto/arc4random/getentropy_linux.c
230
if (ioctl(fd, RNDGETENTCNT, &cnt) == -1) {
lib/libcrypto/arc4random/getentropy_linux.c
231
close(fd);
lib/libcrypto/arc4random/getentropy_linux.c
236
ssize_t ret = read(fd, (char *)buf + i, wanted);
lib/libcrypto/arc4random/getentropy_linux.c
241
close(fd);
lib/libcrypto/arc4random/getentropy_linux.c
246
close(fd);
lib/libcrypto/arc4random/getentropy_osx.c
149
int fd, flags;
lib/libcrypto/arc4random/getentropy_osx.c
161
fd = open("/dev/urandom", flags);
lib/libcrypto/arc4random/getentropy_osx.c
162
if (fd == -1) {
lib/libcrypto/arc4random/getentropy_osx.c
168
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
lib/libcrypto/arc4random/getentropy_osx.c
172
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) {
lib/libcrypto/arc4random/getentropy_osx.c
173
close(fd);
lib/libcrypto/arc4random/getentropy_osx.c
178
ssize_t ret = read(fd, (char *)buf + i, wanted);
lib/libcrypto/arc4random/getentropy_osx.c
183
close(fd);
lib/libcrypto/arc4random/getentropy_osx.c
188
close(fd);
lib/libcrypto/arc4random/getentropy_solaris.c
155
int fd, flags;
lib/libcrypto/arc4random/getentropy_solaris.c
167
fd = open(path, flags);
lib/libcrypto/arc4random/getentropy_solaris.c
168
if (fd == -1) {
lib/libcrypto/arc4random/getentropy_solaris.c
174
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
lib/libcrypto/arc4random/getentropy_solaris.c
178
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode) ||
lib/libcrypto/arc4random/getentropy_solaris.c
180
close(fd);
lib/libcrypto/arc4random/getentropy_solaris.c
185
ssize_t ret = read(fd, (char *)buf + i, wanted);
lib/libcrypto/arc4random/getentropy_solaris.c
190
close(fd);
lib/libcrypto/arc4random/getentropy_solaris.c
195
close(fd);
lib/libcrypto/bio/b_sock.c
117
BIO_socket_ioctl(int fd, long type, void *arg)
lib/libcrypto/bio/b_sock.c
121
ret = ioctl(fd, type, arg);
lib/libcrypto/bio/bio.h
421
#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
lib/libcrypto/bio/bio.h
605
int BIO_socket_ioctl(int fd, long type, void *arg);
lib/libcrypto/bio/bio.h
606
int BIO_socket_nbio(int fd, int mode);
lib/libcrypto/bio/bio.h
616
BIO *BIO_new_dgram(int fd, int close_flag);
lib/libcrypto/bio/bio.h
617
BIO *BIO_new_fd(int fd, int close_flag);
lib/libcrypto/bio/bss_dgram.c
125
BIO_new_dgram(int fd, int close_flag)
lib/libcrypto/bio/bss_dgram.c
132
BIO_set_fd(ret, fd, close_flag);
lib/libcrypto/bio/bss_fd.c
105
BIO_set_fd(ret, fd, close_flag);
lib/libcrypto/bio/bss_fd.c
99
BIO_new_fd(int fd, int close_flag)
lib/libcrypto/bio/bss_sock.c
104
BIO_set_fd(ret, fd, close_flag);
lib/libcrypto/bio/bss_sock.c
97
BIO_new_socket(int fd, int close_flag)
lib/libcrypto/rand/randfile.c
108
fd = open(file, O_WRONLY|O_CREAT|O_CLOEXEC, 0600);
lib/libcrypto/rand/randfile.c
109
if (fd == -1)
lib/libcrypto/rand/randfile.c
111
out = fdopen(fd, "wb");
lib/libcrypto/rand/randfile.c
114
close(fd);
lib/libcrypto/rand/randfile.c
96
int n, fd;
lib/libcurses/base/lib_getch.c
142
_nc_get_handle(int fd)
lib/libcurses/base/lib_getch.c
144
intptr_t value = _get_osfhandle(fd);
lib/libcurses/base/lib_getch.c
171
HANDLE fd = _nc_get_handle(sp->_ifd);
lib/libcurses/base/lib_getch.c
172
rc = _nc_mingw_testmouse(sp, fd, delay EVENTLIST_2nd(evl));
lib/libcurses/curses.priv.h
2485
#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
lib/libcurses/curses.priv.h
2486
_nc_setupterm_ex(tpp, name, fd, err, reuse)
lib/libcurses/curses.priv.h
2493
#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
lib/libcurses/curses.priv.h
2494
_nc_setupterm(name, fd, err, reuse)
lib/libcurses/curses.priv.h
2504
extern NCURSES_EXPORT(int) _nc_mingw_isatty(int fd);
lib/libcurses/curses.priv.h
2505
extern NCURSES_EXPORT(int) _nc_mingw_isconsole(int fd);
lib/libcurses/curses.priv.h
2508
HANDLE fd,
lib/libcurses/curses.priv.h
2512
HANDLE fd,
lib/libcurses/curses.priv.h
2521
#define NC_ISATTY(fd) (0 != _nc_console_isatty(fd))
lib/libcurses/curses.priv.h
2523
#define NC_ISATTY(fd) _nc_mingw_isatty(fd)
lib/libcurses/curses.priv.h
2525
#define NC_ISATTY(fd) isatty(fd)
lib/libcurses/nc_termios.h
149
#define tcsetattr(fd, opt, arg) _nc_mingw_tcsetattr(fd, opt, arg)
lib/libcurses/nc_termios.h
153
#define tcgetattr(fd, arg) _nc_mingw_tcgetattr(fd, arg)
lib/libcurses/nc_termios.h
157
#define tcflush(fd, queue) _nc_mingw_tcflush(fd, queue)
lib/libcurses/nc_termios.h
161
#define ttyname(fd) NULL
lib/libcurses/nc_termios.h
58
#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
lib/libcurses/nc_termios.h
61
#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
lib/libcurses/nc_termios.h
70
#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
lib/libcurses/term.h
142
#define GET_TTY(fd, buf) tcgetattr(fd, buf)
lib/libcurses/term.h
143
#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
lib/libcurses/term.h
145
#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)
lib/libcurses/term.h
146
#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)
lib/libcurses/term.h
148
#define GET_TTY(fd, buf) gtty(fd, buf)
lib/libcurses/term.h
149
#define SET_TTY(fd, buf) stty(fd, buf)
lib/libcurses/tinfo/lib_kernel.c
154
flush_input(int fd)
lib/libcurses/tinfo/lib_kernel.c
157
tcflush(fd, TCIFLUSH);
lib/libcurses/tinfo/lib_kernel.c
162
_nc_console_flush(_nc_console_fd2handle(fd));
lib/libcurses/tinfo/lib_kernel.c
164
ioctl(fd, TIOCFLUSH, 0);
lib/libcurses/tinfo/lib_options.c
244
NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
lib/libcurses/tinfo/lib_options.c
246
T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd));
lib/libcurses/tinfo/lib_options.c
248
SP_PARM->_checkfd = fd;
lib/libcurses/tinfo/lib_options.c
257
typeahead(int fd)
lib/libcurses/tinfo/lib_options.c
259
return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd);
lib/libcurses/tinfo/lib_win32con.c
1096
_nc_console_isatty(int fd)
lib/libcurses/tinfo/lib_win32con.c
1099
T((T_CALLED("lib_win32con::_nc_console_isatty(%d"), fd));
lib/libcurses/tinfo/lib_win32con.c
1101
if (_isatty(fd))
lib/libcurses/tinfo/lib_win32con.c
1105
if (_nc_console_checkmintty(fd, NULL)) {
lib/libcurses/tinfo/lib_win32con.c
159
_nc_console_handle(int fd)
lib/libcurses/tinfo/lib_win32con.c
161
intptr_t value = _get_osfhandle(fd);
lib/libcurses/tinfo/lib_win32con.c
194
_nc_console_test(int fd)
lib/libcurses/tinfo/lib_win32con.c
198
T((T_CALLED("lib_win32con::_nc_console_test(%d)"), fd));
lib/libcurses/tinfo/lib_win32con.c
199
hdl = _nc_console_handle(fd);
lib/libcurses/tinfo/lib_win32con.c
216
_nc_console_fd2handle(int fd)
lib/libcurses/tinfo/lib_win32con.c
218
HANDLE hdl = _nc_console_handle(fd);
lib/libcurses/tinfo/lib_win32con.c
220
T(("lib_win32con:validateHandle %d -> WINCONSOLE.inp", fd));
lib/libcurses/tinfo/lib_win32con.c
222
T(("lib_win32con:validateHandle %d -> WINCONSOLE.hdl", fd));
lib/libcurses/tinfo/lib_win32con.c
224
T(("lib_win32con:validateHandle %d -> WINCONSOLE.out", fd));
lib/libcurses/tinfo/lib_win32con.c
226
T(("lib_win32con:validateHandle %d maps to unknown HANDLE", fd));
lib/libcurses/tinfo/lib_win32util.c
62
_nc_console_checkmintty(int fd, LPHANDLE pMinTTY)
lib/libcurses/tinfo/lib_win32util.c
64
HANDLE handle = _nc_console_handle(fd);
lib/libcurses/tinfo/lib_win32util.c
68
T((T_CALLED("lib_winhelper::_nc_console_checkmintty(%d, %p)"), fd, pMinTTY));
lib/libcurses/tinfo/read_termcap.c
273
int fd,
lib/libcurses/tinfo/read_termcap.c
326
if (fd >= 0) {
lib/libcurses/tinfo/read_termcap.c
327
(void) lseek(fd, (off_t) 0, SEEK_SET);
lib/libcurses/tinfo/read_termcap.c
329
|| (fd = safe_open2(db_array[current], O_RDONLY)) < 0) {
lib/libcurses/tinfo/read_termcap.c
370
n = (int) read(fd, buf, sizeof(buf));
lib/libcurses/tinfo/read_termcap.c
373
(void) close(fd);
lib/libcurses/tinfo/read_termcap.c
378
fd = -1;
lib/libcurses/tinfo/read_termcap.c
415
(void) close(fd);
lib/libcurses/tinfo/read_termcap.c
502
iret = _nc_getent(&icap, &ilen, &oline, current, db_array, fd,
lib/libcurses/tinfo/read_termcap.c
510
(void) close(fd);
lib/libcurses/tinfo/read_termcap.c
555
(void) close(fd);
lib/libcurses/tinfo/read_termcap.c
588
(void) close(fd);
lib/libcurses/tty/lib_twait.c
183
int fd;
lib/libcurses/tty/lib_twait.c
253
fds[count].fd = sp->_ifd;
lib/libcurses/tty/lib_twait.c
258
&& (fd = sp->_mouse_fd) >= 0) {
lib/libcurses/tty/lib_twait.c
259
fds[count].fd = fd;
lib/libcurses/tty/lib_twait.c
270
fds[count].fd = ev->data.fev.fd;
lib/libcurses/tty/lib_twait.c
294
if (fds[c].fd == ev->data.fev.fd
lib/libcurses/tty/lib_twait.c
363
&& (fd = sp->_mouse_fd) >= 0) {
lib/libcurses/tty/lib_twait.c
364
FD_SET(fd, &set);
lib/libcurses/tty/lib_twait.c
365
count = max(fd, count) + 1;
lib/libcurses/tty/lib_twait.c
374
FD_SET(ev->data.fev.fd, &set);
lib/libcurses/tty/lib_twait.c
375
count = max(ev->data.fev.fd + 1, count);
lib/libcurses/tty/lib_twait.c
425
if (FD_ISSET(ev->data.fev.fd, &set)) {
lib/libcurses/tty/lib_twait.c
502
&& (fd = sp->_mouse_fd) >= 0
lib/libcurses/tty/lib_twait.c
503
&& FD_ISSET(fd, &set))
lib/libcurses/tty/tty_update.c
385
fds[0].fd = SP_PARM->_checkfd;
lib/libedit/readline.c
1192
int fd;
lib/libedit/readline.c
1203
if ((fd = mkstemp(template)) == -1) {
lib/libedit/readline.c
1208
if ((tp = fdopen(fd, "r+")) == NULL) {
lib/libedit/readline.c
1209
close(fd);
lib/libedit/vi.c
1000
write(fd, "\n", 1);
lib/libedit/vi.c
1004
close(fd);
lib/libedit/vi.c
1010
close(fd);
lib/libedit/vi.c
1017
lseek(fd, (off_t)0, SEEK_SET);
lib/libedit/vi.c
1018
st = read(fd, cp, TMP_BUFSIZ - 1);
lib/libedit/vi.c
1035
close(fd);
lib/libedit/vi.c
962
int fd;
lib/libedit/vi.c
976
fd = mkstemp(tempfile);
lib/libedit/vi.c
977
if (fd == -1)
lib/libedit/vi.c
983
close(fd);
lib/libedit/vi.c
989
close(fd);
lib/libedit/vi.c
999
write(fd, cp, len);
lib/libelf/elf_begin.c
34
elf_begin(int fd, Elf_Cmd c, Elf *a)
lib/libelf/elf_begin.c
71
((a->e_fd != -1 && a->e_fd != fd) || c != a->e_cmd)) {
lib/libelf/elf_begin.c
84
e = _libelf_open_object(fd, c, 1);
lib/libelf/elf_open.c
38
elf_open(int fd)
lib/libelf/elf_open.c
45
return (_libelf_open_object(fd, ELF_C_READ, 0));
lib/libelf/libelf_ar.c
208
_libelf_ar_open_member(int fd, Elf_Cmd c, Elf *elf)
lib/libelf/libelf_ar.c
284
e->e_fd = fd;
lib/libelf/libelf_open.c
124
_libelf_open_object(int fd, Elf_Cmd c, int reporterror)
lib/libelf/libelf_open.c
135
if (fstat(fd, &sb) < 0) {
lib/libelf/libelf_open.c
159
e->e_fd = fd;
lib/libelf/libelf_open.c
194
m = mmap(NULL, fsize, PROT_READ, MAP_PRIVATE, fd, (off_t) 0);
lib/libelf/libelf_open.c
212
if (read(fd, m, fsize) != (ssize_t) fsize) {
lib/libelf/libelf_open.c
220
} else if ((m = _libelf_read_special_file(fd, &fsize)) != NULL)
lib/libelf/libelf_open.c
245
e->e_fd = fd;
lib/libelf/libelf_open.c
50
_libelf_read_special_file(int fd, size_t *fsz)
lib/libelf/libelf_open.c
78
if ((readsz = read(fd, t, bufsz - datasz)) <= 0)
lib/libevent/buffer.c
424
evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
lib/libevent/buffer.c
430
if (ioctl(fd, FIONREAD, &n) == -1 || n <= 0) {
lib/libevent/buffer.c
455
n = read(fd, p, howmuch);
lib/libevent/buffer.c
471
evbuffer_write(struct evbuffer *buffer, int fd)
lib/libevent/buffer.c
475
n = write(fd, buffer->buffer, buffer->off);
lib/libevent/evbuffer.c
110
res = evbuffer_read(bufev->input, fd, howmuch);
lib/libevent/evbuffer.c
152
bufferevent_writecb(int fd, short event, void *arg)
lib/libevent/evbuffer.c
164
res = evbuffer_write(bufev->output, fd);
lib/libevent/evbuffer.c
214
bufferevent_new(int fd, evbuffercb readcb, evbuffercb writecb,
lib/libevent/evbuffer.c
233
event_set(&bufev->ev_read, fd, EV_READ, bufferevent_readcb, bufev);
lib/libevent/evbuffer.c
234
event_set(&bufev->ev_write, fd, EV_WRITE, bufferevent_writecb, bufev);
lib/libevent/evbuffer.c
260
bufferevent_setfd(struct bufferevent *bufev, int fd)
lib/libevent/evbuffer.c
265
event_set(&bufev->ev_read, fd, EV_READ, bufferevent_readcb, bufev);
lib/libevent/evbuffer.c
266
event_set(&bufev->ev_write, fd, EV_WRITE, bufferevent_writecb, bufev);
lib/libevent/evbuffer.c
81
bufferevent_readcb(int fd, short event, void *arg)
lib/libevent/event.c
364
event_loopexit_cb(int fd, short what, void *arg)
lib/libevent/event.c
509
event_once_cb(int fd, short events, void *arg)
lib/libevent/event.c
513
(*eonce->cb)(fd, events, eonce->arg);
lib/libevent/event.c
519
event_once(int fd, short events,
lib/libevent/event.c
522
return event_base_once(current_base, fd, events, callback, arg, tv);
lib/libevent/event.c
527
event_base_once(struct event_base *base, int fd, short events,
lib/libevent/event.c
554
event_set(&eonce->ev, fd, events, event_once_cb, eonce);
lib/libevent/event.c
573
event_set(struct event *ev, int fd, short events,
lib/libevent/event.c
581
ev->ev_fd = fd;
lib/libevent/event.c
936
event_asr_dispatch(int fd __attribute__((__unused__)),
lib/libevent/event.h
573
int event_base_once(struct event_base *base, int fd, short events,
lib/libevent/event.h
815
struct bufferevent *bufferevent_new(int fd,
lib/libevent/event.h
871
void bufferevent_setfd(struct bufferevent *bufev, int fd);
lib/libevent/evutil.c
47
evutil_socketpair(int family, int type, int protocol, int fd[2])
lib/libevent/evutil.c
49
return socketpair(family, type, protocol, fd);
lib/libevent/evutil.c
53
evutil_make_socket_nonblocking(int fd)
lib/libevent/evutil.c
57
if ((flags = fcntl(fd, F_GETFL)) == -1) {
lib/libevent/evutil.c
58
event_warn("fcntl(%d, F_GETFL)", fd);
lib/libevent/evutil.c
61
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
lib/libevent/evutil.c
62
event_warn("fcntl(%d, F_SETFL)", fd);
lib/libevent/poll.c
106
assert(pop->event_set[idx].fd == i);
lib/libevent/poll.c
122
assert(pop->idxplus1_by_fd[pfd->fd] == i+1);
lib/libevent/poll.c
280
pfd->fd = ev->ev_fd;
lib/libevent/poll.c
349
pop->idxplus1_by_fd[pop->event_set[i].fd] = i + 1;
lib/libevent/signal.c
55
evsignal_cb(int fd, short what, void *arg)
lib/libevent/signal.c
60
n = recv(fd, signals, sizeof(signals), 0);
lib/libexpat/tests/benchmark/benchmark.c
101
if (fstat(fd, &fileAttr) != 0) {
lib/libexpat/tests/benchmark/benchmark.c
102
close(fd);
lib/libexpat/tests/benchmark/benchmark.c
107
file = fdopen(fd, "r");
lib/libexpat/tests/benchmark/benchmark.c
109
close(fd);
lib/libexpat/tests/benchmark/benchmark.c
73
int fd;
lib/libexpat/tests/benchmark/benchmark.c
95
fd = open(argv[j + 1], O_RDONLY);
lib/libexpat/tests/benchmark/benchmark.c
96
if (fd == -1) {
lib/libfido2/src/hid_openbsd.c
122
pfd.fd = ctx->fd;
lib/libfido2/src/hid_openbsd.c
152
(ret->fd = fido_hid_unix_open(path)) == -1) {
lib/libfido2/src/hid_openbsd.c
178
if (close(ctx->fd) == -1)
lib/libfido2/src/hid_openbsd.c
207
if (fido_hid_unix_wait(ctx->fd, ms, ctx->sigmaskp) < 0) {
lib/libfido2/src/hid_openbsd.c
212
if ((r = read(ctx->fd, buf, len)) == -1) {
lib/libfido2/src/hid_openbsd.c
237
if ((r = write(ctx->fd, buf + 1, len - 1)) == -1) {
lib/libfido2/src/hid_openbsd.c
28
int fd;
lib/libfido2/src/hid_openbsd.c
40
int fd;
lib/libfido2/src/hid_openbsd.c
52
if ((fd = fido_hid_unix_open(path)) == -1)
lib/libfido2/src/hid_openbsd.c
54
if (close(fd) == -1)
lib/libfido2/src/hid_unix.c
23
int fd;
lib/libfido2/src/hid_unix.c
26
if ((fd = open(path, O_RDWR|O_CLOEXEC)) == -1) {
lib/libfido2/src/hid_unix.c
32
if (fstat(fd, &st) == -1) {
lib/libfido2/src/hid_unix.c
34
if (close(fd) == -1)
lib/libfido2/src/hid_unix.c
41
if (close(fd) == -1)
lib/libfido2/src/hid_unix.c
46
return (fd);
lib/libfido2/src/hid_unix.c
50
fido_hid_unix_wait(int fd, int ms, const fido_sigset_t *sigmask)
lib/libfido2/src/hid_unix.c
58
pfd.fd = fd;
lib/libfuse/fuse.c
144
if ((fc->fd = open("/dev/fuse0", O_RDWR|O_CLOEXEC)) == -1) {
lib/libfuse/fuse.c
166
fargs.fd = fc->fd;
lib/libfuse/fuse.c
188
if (fc->fd != -1)
lib/libfuse/fuse.c
189
close(fc->fd);
lib/libfuse/fuse.c
206
if (close(ch->fd) == -1)
lib/libfuse/fuse_chan.c
30
return (ch->fd);
lib/libfuse/fuse_chan.c
39
n = read((*chp)->fd, buf, size);
lib/libfuse/fuse_chan.c
52
n = writev(ch->fd, iov, count);
lib/libfuse/fuse_ops.c
217
struct fuse_dirhandle *fd = dh;
lib/libfuse/fuse_ops.c
223
f = fd->fuse;
lib/libfuse/fuse_ops.c
229
if (fd->full || (fd->len + len > fd->size)) {
lib/libfuse/fuse_ops.c
230
fd->full = 1;
lib/libfuse/fuse_ops.c
235
if (fd->start != 0 && fd->idx < fd->start) {
lib/libfuse/fuse_ops.c
236
fd->idx += len;
lib/libfuse/fuse_ops.c
248
v = get_vn_by_name_and_parent(f, name, fd->ino);
lib/libfuse/fuse_ops.c
251
attr.st_ino = fd->ino;
lib/libfuse/fuse_ops.c
265
buf = (char *) fd->buf + fd->len;
lib/libfuse/fuse_ops.c
266
resid = fd->size - fd->len;
lib/libfuse/fuse_ops.c
267
fd->len += len;
lib/libfuse/fuse_ops.c
268
fd->idx += len;
lib/libfuse/fuse_ops.c
274
fd->idx);
lib/libfuse/fuse_ops.c
280
ifuse_fill_getdir(fuse_dirh_t fd, const char *name, int type, ino_t ino)
lib/libfuse/fuse_ops.c
291
return (fd->filler(fd, name, &st, 0));
lib/libfuse/fuse_ops.c
299
struct fuse_dirhandle fd;
lib/libfuse/fuse_ops.c
303
fd.buf = calloc(1, size);
lib/libfuse/fuse_ops.c
304
if (fd.buf == NULL) {
lib/libfuse/fuse_ops.c
309
fd.filler = ifuse_fill_readdir;
lib/libfuse/fuse_ops.c
310
fd.full = 0;
lib/libfuse/fuse_ops.c
311
fd.len = 0;
lib/libfuse/fuse_ops.c
312
fd.size = size;
lib/libfuse/fuse_ops.c
313
fd.idx = 0;
lib/libfuse/fuse_ops.c
314
fd.fuse = f;
lib/libfuse/fuse_ops.c
315
fd.start = offset;
lib/libfuse/fuse_ops.c
316
fd.ino = ino;
lib/libfuse/fuse_ops.c
326
err = f->op.readdir(realname, &fd, ifuse_fill_readdir,
lib/libfuse/fuse_ops.c
329
err = f->op.getdir(realname, &fd, ifuse_fill_getdir);
lib/libfuse/fuse_ops.c
337
fuse_reply_buf(req, fd.buf, fd.len);
lib/libfuse/fuse_ops.c
341
free(fd.buf);
lib/libfuse/fuse_private.h
70
int fd;
lib/libkeynote/keynote-sign.c
106
fd = open(argv[2 + flg], O_RDONLY);
lib/libkeynote/keynote-sign.c
107
if (fd == -1)
lib/libkeynote/keynote-sign.c
113
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-sign.c
133
if (read(fd, buf, buflen - 1) == -1)
lib/libkeynote/keynote-sign.c
139
close(fd);
lib/libkeynote/keynote-sign.c
142
fd = open(argv[3 + flg], O_RDONLY);
lib/libkeynote/keynote-sign.c
143
if (fd == -1)
lib/libkeynote/keynote-sign.c
149
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-sign.c
168
if (read(fd, buf2, sb.st_size) == -1)
lib/libkeynote/keynote-sign.c
174
close(fd);
lib/libkeynote/keynote-sign.c
51
int fd, flg = 0, buflen;
lib/libkeynote/keynote-sigver.c
49
int fd, i, n, j;
lib/libkeynote/keynote-sigver.c
59
fd = open(argv[1], O_RDONLY);
lib/libkeynote/keynote-sigver.c
60
if (fd == -1)
lib/libkeynote/keynote-sigver.c
66
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-sigver.c
85
if (read(fd, buf, sb.st_size) == -1)
lib/libkeynote/keynote-sigver.c
91
close(fd);
lib/libkeynote/keynote-verify.c
107
if ((fd = open(optarg, O_RDONLY)) == -1)
lib/libkeynote/keynote-verify.c
113
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-verify.c
131
i = read(fd, buf, sb.st_size);
lib/libkeynote/keynote-verify.c
138
close(fd);
lib/libkeynote/keynote-verify.c
227
if ((fd = open(optarg, O_RDONLY)) == -1)
lib/libkeynote/keynote-verify.c
233
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-verify.c
251
i = read(fd, buf, sb.st_size);
lib/libkeynote/keynote-verify.c
258
close(fd);
lib/libkeynote/keynote-verify.c
311
if ((fd = open(argv[argc], O_RDONLY)) == -1)
lib/libkeynote/keynote-verify.c
317
if (fstat(fd, &sb) == -1)
lib/libkeynote/keynote-verify.c
335
i = read(fd, buf, sb.st_size);
lib/libkeynote/keynote-verify.c
342
close(fd);
lib/libkeynote/keynote-verify.c
58
int fd, i, ch, se = 0, cl = 8192, sk = 0, sl = 0, p, ac = argc;
lib/libkvm/kvm.c
102
_kvm_pwrite(kvm_t *kd, int fd, const void *buf, size_t nbytes, off_t offset)
lib/libkvm/kvm.c
107
rval = pwrite(fd, buf, nbytes, offset);
lib/libkvm/kvm.c
301
int fd;
lib/libkvm/kvm.c
304
fd = open(uf, O_RDONLY | O_CLOEXEC);
lib/libkvm/kvm.c
306
fd = open(_PATH_KSYMS, O_RDONLY | O_CLOEXEC);
lib/libkvm/kvm.c
308
if (fd == -1)
lib/libkvm/kvm.c
309
fd = open(uf, O_RDONLY | O_CLOEXEC);
lib/libkvm/kvm.c
311
if (fd == -1) {
lib/libkvm/kvm.c
316
kd->nlfd = fd;
lib/libkvm/kvm.c
86
_kvm_pread(kvm_t *kd, int fd, void *buf, size_t nbytes, off_t offset)
lib/libkvm/kvm.c
91
rval = pread(fd, buf, nbytes, offset);
lib/libkvm/kvm_file2.c
469
struct vnode *vp, struct process *pr, int fd, pid_t pid)
lib/libkvm/kvm_file2.c
475
kf->fd_fd = fd; /* might not really be an fd */
lib/libkvm/kvm_file2.c
506
if (fd == KERN_FILE_TRACE)
lib/libkvm/kvm_file2.c
725
kf->fd_ofileflags = pr->ps_fd->fd_ofileflags[fd];
lib/libossaudio/ossaudio.c
222
mixer_ioctl(int fd, unsigned long com, void *argp)
lib/libossaudio/ossaudio.c
73
_oss_ioctl(int fd, unsigned long com, ...)
lib/libossaudio/ossaudio.c
84
return mixer_ioctl(fd, com, argp);
lib/libossaudio/ossaudio.c
86
return (ioctl)(fd, com, argp);
lib/libpcap/inet.c
156
int fd, minunit, n;
lib/libpcap/inet.c
164
fd = socket(AF_INET, SOCK_DGRAM, 0);
lib/libpcap/inet.c
165
if (fd == -1) {
lib/libpcap/inet.c
174
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) == -1 ||
lib/libpcap/inet.c
178
(void)close(fd);
lib/libpcap/inet.c
206
if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifr) == -1) {
lib/libpcap/inet.c
213
(void)close(fd);
lib/libpcap/inet.c
232
(void)close(fd);
lib/libpcap/inet.c
248
int fd;
lib/libpcap/inet.c
252
fd = socket(AF_INET, SOCK_DGRAM, 0);
lib/libpcap/inet.c
253
if (fd == -1) {
lib/libpcap/inet.c
264
if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) == -1) {
lib/libpcap/inet.c
273
(void)close(fd);
lib/libpcap/inet.c
278
if (ioctl(fd, SIOCGIFNETMASK, (char *)&ifr) == -1) {
lib/libpcap/inet.c
281
(void)close(fd);
lib/libpcap/inet.c
284
(void)close(fd);
lib/libpcap/pcap-bpf.c
189
return (write(p->fd, buf, len));
lib/libpcap/pcap-bpf.c
201
int fd;
lib/libpcap/pcap-bpf.c
203
fd = open("/dev/bpf", O_RDWR);
lib/libpcap/pcap-bpf.c
204
if (fd == -1 && errno == EACCES)
lib/libpcap/pcap-bpf.c
205
fd = open("/dev/bpf", O_RDONLY);
lib/libpcap/pcap-bpf.c
207
if (fd == -1) {
lib/libpcap/pcap-bpf.c
209
fd = PCAP_ERROR_PERM_DENIED;
lib/libpcap/pcap-bpf.c
211
fd = PCAP_ERROR;
lib/libpcap/pcap-bpf.c
218
return (fd);
lib/libpcap/pcap-bpf.c
222
get_dlt_list(int fd, int v, struct bpf_dltlist *bdlp, char *ebuf)
lib/libpcap/pcap-bpf.c
225
if (ioctl(fd, BIOCGDLTLIST, (caddr_t)bdlp) == 0) {
lib/libpcap/pcap-bpf.c
233
if (ioctl(fd, BIOCGDLTLIST, (caddr_t)bdlp) == -1) {
lib/libpcap/pcap-bpf.c
348
if (p->fd >= 0) {
lib/libpcap/pcap-bpf.c
349
close(p->fd);
lib/libpcap/pcap-bpf.c
350
p->fd = -1;
lib/libpcap/pcap-bpf.c
409
int fd;
lib/libpcap/pcap-bpf.c
416
fd = bpf_open(p);
lib/libpcap/pcap-bpf.c
417
if (fd < 0) {
lib/libpcap/pcap-bpf.c
418
status = fd;
lib/libpcap/pcap-bpf.c
422
p->fd = fd;
lib/libpcap/pcap-bpf.c
424
if (ioctl(fd, BIOCVERSION, (caddr_t)&bv) == -1) {
lib/libpcap/pcap-bpf.c
446
(void) ioctl(fd, BIOCSBLEN, (caddr_t)&v);
lib/libpcap/pcap-bpf.c
456
if (ioctl(fd, BIOCSBLEN,
lib/libpcap/pcap-bpf.c
470
if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) == -1) {
lib/libpcap/pcap-bpf.c
475
if (ioctl(fd, BIOCGDLT, (caddr_t)&v) == -1) {
lib/libpcap/pcap-bpf.c
487
if (get_dlt_list(fd, v, &bdl, p->errbuf) == -1) {
lib/libpcap/pcap-bpf.c
527
if (ioctl(p->fd, BIOCSDLT, &new_dlt) != -1) {
lib/libpcap/pcap-bpf.c
544
if (ioctl(p->fd, BIOCSRTIMEOUT, (caddr_t)&to) == -1) {
lib/libpcap/pcap-bpf.c
554
if (ioctl(p->fd, BIOCIMMEDIATE, &v) == -1) {
lib/libpcap/pcap-bpf.c
564
if (ioctl(p->fd, BIOCPROMISC, NULL) == -1) {
lib/libpcap/pcap-bpf.c
57
if (ioctl(p->fd, BIOCGSTATS, (caddr_t)&s) == -1) {
lib/libpcap/pcap-bpf.c
571
if (ioctl(fd, BIOCGBLEN, (caddr_t)&v) == -1) {
lib/libpcap/pcap-bpf.c
828
p->fd = -1; /* not opened yet */
lib/libpcap/pcap-bpf.c
91
cc = read(p->fd, (char *)p->buffer, p->bufsize);
lib/libpcap/pcap-bpf.c
918
} else if (ioctl(p->fd, BIOCSETF, (caddr_t)fp) == -1) {
lib/libpcap/pcap-bpf.c
945
if (ioctl(p->fd, BIOCSDIRFILT, &dirfilt) == -1) {
lib/libpcap/pcap-bpf.c
979
if (ioctl(p->fd, BIOCSDLT, &dlt) == -1) {
lib/libpcap/pcap-int.h
80
int fd;
lib/libpcap/pcap.c
414
return (p->fd);
lib/libpcap/pcap.c
426
return (p->fd);
lib/libpcap/pcap.c
440
fdflags = fcntl(p->fd, F_GETFL);
lib/libpcap/pcap.c
457
fdflags = fcntl(p->fd, F_GETFL);
lib/libpcap/pcap.c
467
if (fcntl(p->fd, F_SETFL, fdflags) == -1) {
lib/libpcap/pcap.c
650
p->fd = -1;
lib/libpcap/savefile.c
141
p->fd = -1;
lib/librthread/rthread_sem.c
320
int created = 0, fd;
lib/librthread/rthread_sem.c
345
fd = open(sempath, O_RDWR | O_NOFOLLOW | oflag, 0600);
lib/librthread/rthread_sem.c
346
if (fd == -1)
lib/librthread/rthread_sem.c
348
if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) {
lib/librthread/rthread_sem.c
349
close(fd);
lib/librthread/rthread_sem.c
354
close(fd);
lib/librthread/rthread_sem.c
360
close(fd);
lib/librthread/rthread_sem.c
365
close(fd);
lib/librthread/rthread_sem.c
369
if (ftruncate(fd, SEM_MMAP_SIZE) == -1) {
lib/librthread/rthread_sem.c
370
close(fd);
lib/librthread/rthread_sem.c
378
MAP_SHARED, fd, 0);
lib/librthread/rthread_sem.c
379
close(fd);
lib/librthread/rthread_sem_compat.c
335
int created = 0, fd;
lib/librthread/rthread_sem_compat.c
360
fd = open(sempath, O_RDWR | O_NOFOLLOW | oflag, 0600);
lib/librthread/rthread_sem_compat.c
361
if (fd == -1)
lib/librthread/rthread_sem_compat.c
363
if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode)) {
lib/librthread/rthread_sem_compat.c
364
close(fd);
lib/librthread/rthread_sem_compat.c
369
close(fd);
lib/librthread/rthread_sem_compat.c
375
close(fd);
lib/librthread/rthread_sem_compat.c
380
close(fd);
lib/librthread/rthread_sem_compat.c
384
if (ftruncate(fd, SEM_MMAP_SIZE) == -1) {
lib/librthread/rthread_sem_compat.c
385
close(fd);
lib/librthread/rthread_sem_compat.c
393
MAP_SHARED, fd, 0);
lib/librthread/rthread_sem_compat.c
394
close(fd);
lib/libskey/skeylogin.c
110
if (fd == -1) {
lib/libskey/skeylogin.c
117
if ((fd = open(filename, O_RDWR | O_NOFOLLOW | O_NONBLOCK,
lib/libskey/skeylogin.c
126
if (flock(fd, LOCK_EX) != 0 || fstat(fd, &statbuf) != 0) {
lib/libskey/skeylogin.c
127
close(fd);
lib/libskey/skeylogin.c
136
(keyfile = fdopen(fd, "r+")) == NULL) {
lib/libskey/skeylogin.c
137
close(fd);
lib/libskey/skeylogin.c
178
if (fd != -1)
lib/libskey/skeylogin.c
179
close(fd);
lib/libskey/skeylogin.c
51
skeychallenge2(int fd, struct skey *mp, char *name, char *ss)
lib/libskey/skeylogin.c
56
rval = skeygetent(fd, mp, name);
lib/libskey/skeylogin.c
563
tgetline(int fd, char *buf, size_t bufsiz, int timeout)
lib/libskey/skeylogin.c
583
pfd[0].fd = fd;
lib/libskey/skeylogin.c
595
ss = read(fd, &c, 1);
lib/libskey/skeylogin.c
602
while (--left && read(fd, &c, 1) == 1 && c != '\n' && c != '\r')
lib/libskey/skeylogin.c
94
skeygetent(int fd, struct skey *mp, const char *name)
lib/libsndio/aucat.c
101
while ((n = write(hdl->fd, data, hdl->wtodo)) == -1) {
lib/libsndio/aucat.c
133
while ((n = read(hdl->fd, buf, len)) == -1) {
lib/libsndio/aucat.c
186
while ((n = write(hdl->fd, buf, len)) == -1) {
lib/libsndio/aucat.c
209
int fd, len;
lib/libsndio/aucat.c
221
fd = open(path, O_RDONLY|O_CLOEXEC);
lib/libsndio/aucat.c
222
if (fd == -1) {
lib/libsndio/aucat.c
227
if (fstat(fd, &sb) == -1) {
lib/libsndio/aucat.c
235
len = read(fd, cookie, AMSG_COOKIELEN);
lib/libsndio/aucat.c
244
close(fd);
lib/libsndio/aucat.c
247
close(fd);
lib/libsndio/aucat.c
264
fd = mkstemp(tmp);
lib/libsndio/aucat.c
265
if (fd == -1) {
lib/libsndio/aucat.c
269
if (write(fd, cookie, AMSG_COOKIELEN) == -1) {
lib/libsndio/aucat.c
272
close(fd);
lib/libsndio/aucat.c
275
close(fd);
lib/libsndio/aucat.c
331
hdl->fd = s;
lib/libsndio/aucat.c
366
hdl->fd = s;
lib/libsndio/aucat.c
504
while (close(hdl->fd) == -1 && errno == EINTR)
lib/libsndio/aucat.c
526
n = read(hdl->fd, dummy, sizeof(dummy));
lib/libsndio/aucat.c
537
while (close(hdl->fd) == -1 && errno == EINTR)
lib/libsndio/aucat.c
544
if (fcntl(hdl->fd, F_SETFL, nbio ? O_NONBLOCK : 0) == -1) {
lib/libsndio/aucat.c
55
while ((n = read(hdl->fd, data, hdl->rtodo)) == -1) {
lib/libsndio/aucat.c
557
pfd->fd = hdl->fd;
lib/libsndio/aucat.h
24
int fd; /* socket */
lib/libsndio/mio_rmidi.c
102
return fd;
lib/libsndio/mio_rmidi.c
106
mio_rmidi_fdopen(int fd, unsigned int mode, int nbio)
lib/libsndio/mio_rmidi.c
117
hdl->fd = fd;
lib/libsndio/mio_rmidi.c
125
int fd;
lib/libsndio/mio_rmidi.c
127
fd = mio_rmidi_getfd(str, mode, nbio);
lib/libsndio/mio_rmidi.c
128
if (fd == -1)
lib/libsndio/mio_rmidi.c
130
hdl = mio_rmidi_fdopen(fd, mode, nbio);
lib/libsndio/mio_rmidi.c
133
while (close(fd) == -1 && errno == EINTR)
lib/libsndio/mio_rmidi.c
145
rc = close(hdl->fd);
lib/libsndio/mio_rmidi.c
156
while ((n = read(hdl->fd, buf, len)) == -1) {
lib/libsndio/mio_rmidi.c
179
while ((n = write(hdl->fd, buf, len)) == -1) {
lib/libsndio/mio_rmidi.c
202
pfd->fd = hdl->fd;
lib/libsndio/mio_rmidi.c
39
int fd;
lib/libsndio/mio_rmidi.c
64
int fd, flags;
lib/libsndio/mio_rmidi.c
96
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
lib/libsndio/sio_sun.c
166
if (ioctl(hdl->fd, AUDIO_GETPAR, &savepar) == -1) {
lib/libsndio/sio_sun.c
259
if (ioctl(hdl->fd, AUDIO_SETPAR, &savepar) == -1) {
lib/libsndio/sio_sun.c
273
int fd, flags;
lib/libsndio/sio_sun.c
301
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) == -1) {
lib/libsndio/sio_sun.c
307
return fd;
lib/libsndio/sio_sun.c
311
sio_sun_fdopen(int fd, unsigned int mode, int nbio)
lib/libsndio/sio_sun.c
326
if (ioctl(fd, AUDIO_STOP) == -1) {
lib/libsndio/sio_sun.c
331
hdl->fd = fd;
lib/libsndio/sio_sun.c
340
int fd;
lib/libsndio/sio_sun.c
342
fd = sio_sun_getfd(str, mode, nbio);
lib/libsndio/sio_sun.c
343
if (fd == -1)
lib/libsndio/sio_sun.c
345
hdl = sio_sun_fdopen(fd, mode, nbio);
lib/libsndio/sio_sun.c
348
while (close(fd) == -1 && errno == EINTR)
lib/libsndio/sio_sun.c
358
while (close(hdl->fd) == -1 && errno == EINTR)
lib/libsndio/sio_sun.c
385
if (ioctl(hdl->fd, AUDIO_START) == -1) {
lib/libsndio/sio_sun.c
403
if (ioctl(hdl->fd, AUDIO_STOP) == -1) {
lib/libsndio/sio_sun.c
41
int fd;
lib/libsndio/sio_sun.c
438
if (ioctl(hdl->fd, AUDIO_SETPAR, &ap) == -1) {
lib/libsndio/sio_sun.c
452
if (ioctl(hdl->fd, AUDIO_GETPAR, &ap) == -1) {
lib/libsndio/sio_sun.c
477
while ((n = read(hdl->fd, buf, len)) == -1) {
lib/libsndio/sio_sun.c
502
while ((n = write(hdl->fd, data, todo)) == -1) {
lib/libsndio/sio_sun.c
515
if (ioctl(hdl->fd, AUDIO_START) == -1) {
lib/libsndio/sio_sun.c
538
pfd->fd = hdl->fd;
lib/libsndio/sio_sun.c
554
if (ioctl(hdl->fd, AUDIO_GETPOS, &ap) == -1) {
lib/libsndio/sio_sun.c
82
if (ioctl(hdl->fd, AUDIO_SETPAR, ap) == -1) {
lib/libsndio/sio_sun.c
87
if (ioctl(hdl->fd, AUDIO_GETPAR, ap) == -1) {
lib/libsndio/sioctl_sun.c
114
if (ioctl(hdl->fd, AUDIO_MIXER_DEVINFO, &dev) < 0)
lib/libsndio/sioctl_sun.c
119
if (ioctl(hdl->fd, AUDIO_MIXER_DEVINFO, &cls) < 0)
lib/libsndio/sioctl_sun.c
173
if (ioctl(hdl->fd, AUDIO_GETDEV, &getdev) == -1)
lib/libsndio/sioctl_sun.c
199
if (ioctl(hdl->fd, AUDIO_MIXER_WRITE, &ctrl) < 0) {
lib/libsndio/sioctl_sun.c
219
if (ioctl(hdl->fd, AUDIO_MIXER_WRITE, &ctrl) < 0) {
lib/libsndio/sioctl_sun.c
244
if (ioctl(hdl->fd, AUDIO_MIXER_READ, &ctrl) < 0) {
lib/libsndio/sioctl_sun.c
265
if (ioctl(hdl->fd, AUDIO_MIXER_READ, &ctrl) < 0) {
lib/libsndio/sioctl_sun.c
299
if (ioctl(hdl->fd, AUDIO_MIXER_READ, &ctrl) == -1) {
lib/libsndio/sioctl_sun.c
332
int fd, flags;
lib/libsndio/sioctl_sun.c
364
while ((fd = open(path, flags | O_NONBLOCK | O_CLOEXEC)) < 0) {
lib/libsndio/sioctl_sun.c
370
return fd;
lib/libsndio/sioctl_sun.c
374
sioctl_sun_fdopen(int fd, unsigned int mode, int nbio)
lib/libsndio/sioctl_sun.c
385
hdl->fd = fd;
lib/libsndio/sioctl_sun.c
394
int fd;
lib/libsndio/sioctl_sun.c
396
fd = sioctl_sun_getfd(str, mode, nbio);
lib/libsndio/sioctl_sun.c
397
if (fd < 0)
lib/libsndio/sioctl_sun.c
399
hdl = sioctl_sun_fdopen(fd, mode, nbio);
lib/libsndio/sioctl_sun.c
402
while (close(fd) < 0 && errno == EINTR)
lib/libsndio/sioctl_sun.c
412
close(hdl->fd);
lib/libsndio/sioctl_sun.c
485
pfd->fd = hdl->fd;
lib/libsndio/sioctl_sun.c
502
n = read(hdl->fd, &idx, sizeof(int));
lib/libsndio/sioctl_sun.c
59
int fd, events;
lib/libsndio/sioctl_sun.c
90
if (ioctl(hdl->fd, AUDIO_MIXER_DEVINFO, &mi) < 0)
lib/libsndio/sioctl_sun.c
99
if (ioctl(hdl->fd, AUDIO_MIXER_DEVINFO, &mi) < 0)
lib/libssl/ssl.h
1128
int SSL_set_fd(SSL *s, int fd);
lib/libssl/ssl.h
1129
int SSL_set_rfd(SSL *s, int fd);
lib/libssl/ssl.h
1130
int SSL_set_wfd(SSL *s, int fd);
lib/libssl/ssl_lib.c
688
SSL_set_fd(SSL *s, int fd)
lib/libssl/ssl_lib.c
699
BIO_set_fd(bio, fd, BIO_NOCLOSE);
lib/libssl/ssl_lib.c
708
SSL_set_wfd(SSL *s, int fd)
lib/libssl/ssl_lib.c
714
|| ((int)BIO_get_fd(s->rbio, NULL) != fd)) {
lib/libssl/ssl_lib.c
721
BIO_set_fd(bio, fd, BIO_NOCLOSE);
lib/libssl/ssl_lib.c
732
SSL_set_rfd(SSL *s, int fd)
lib/libssl/ssl_lib.c
738
|| ((int)BIO_get_fd(s->wbio, NULL) != fd)) {
lib/libssl/ssl_lib.c
745
BIO_set_fd(bio, fd, BIO_NOCLOSE);
lib/libtls/tls_config.c
45
int fd = -1;
lib/libtls/tls_config.c
52
if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1) {
lib/libtls/tls_config.c
58
if (fstat(fd, &st) != 0) {
lib/libtls/tls_config.c
73
n = read(fd, *buf, *len);
lib/libtls/tls_config.c
80
close(fd);
lib/libtls/tls_config.c
84
if (fd != -1)
lib/libtls/tls_config.c
85
close(fd);
lib/libtls/tls_util.c
160
int fd = -1;
lib/libtls/tls_util.c
165
if ((fd = open(name, O_RDONLY|O_CLOEXEC)) == -1)
lib/libtls/tls_util.c
170
if (fstat(fd, &st) != 0)
lib/libtls/tls_util.c
177
n = read(fd, buf, size);
lib/libtls/tls_util.c
180
close(fd);
lib/libtls/tls_util.c
185
if ((fp = fdopen(fd, "r")) == NULL)
lib/libtls/tls_util.c
187
fd = -1;
lib/libtls/tls_util.c
213
if (fd != -1)
lib/libtls/tls_util.c
214
close(fd);
lib/libusbhid/descr.c
44
hid_get_report_desc(int fd)
lib/libusbhid/descr.c
49
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) == -1)
lib/libutil/imsg-buffer.c
1051
if (buf->fd == IBUF_FD_MARK_ON_STACK)
lib/libutil/imsg-buffer.c
109
if (buf->fd == IBUF_FD_MARK_ON_STACK) {
lib/libutil/imsg-buffer.c
376
if (buf->fd == IBUF_FD_MARK_ON_STACK) {
lib/libutil/imsg-buffer.c
414
if (buf->fd == IBUF_FD_MARK_ON_STACK)
lib/libutil/imsg-buffer.c
426
if (buf->fd == IBUF_FD_MARK_ON_STACK) {
lib/libutil/imsg-buffer.c
452
buf->fd = IBUF_FD_MARK_ON_STACK;
lib/libutil/imsg-buffer.c
601
if (buf->fd == IBUF_FD_MARK_ON_STACK)
lib/libutil/imsg-buffer.c
603
if (buf->fd >= 0)
lib/libutil/imsg-buffer.c
604
close(buf->fd);
lib/libutil/imsg-buffer.c
613
return (buf->fd >= 0);
lib/libutil/imsg-buffer.c
619
int fd;
lib/libutil/imsg-buffer.c
622
if (buf->fd < 0)
lib/libutil/imsg-buffer.c
624
fd = buf->fd;
lib/libutil/imsg-buffer.c
625
buf->fd = -1;
lib/libutil/imsg-buffer.c
626
return (fd);
lib/libutil/imsg-buffer.c
630
ibuf_fd_set(struct ibuf *buf, int fd)
lib/libutil/imsg-buffer.c
633
if (buf->fd == IBUF_FD_MARK_ON_STACK)
lib/libutil/imsg-buffer.c
635
if (buf->fd >= 0)
lib/libutil/imsg-buffer.c
636
close(buf->fd);
lib/libutil/imsg-buffer.c
637
buf->fd = -1;
lib/libutil/imsg-buffer.c
638
if (fd >= 0)
lib/libutil/imsg-buffer.c
639
buf->fd = fd;
lib/libutil/imsg-buffer.c
70
buf->fd = -1;
lib/libutil/imsg-buffer.c
726
ibuf_write(int fd, struct msgbuf *msgbuf)
lib/libutil/imsg-buffer.c
745
if ((n = writev(fd, iov, i)) == -1) {
lib/libutil/imsg-buffer.c
759
msgbuf_write(int fd, struct msgbuf *msgbuf)
lib/libutil/imsg-buffer.c
778
if (i > 0 && buf->fd != -1)
lib/libutil/imsg-buffer.c
783
if (buf->fd != -1)
lib/libutil/imsg-buffer.c
800
*(int *)CMSG_DATA(cmsg) = buf0->fd;
lib/libutil/imsg-buffer.c
804
if ((n = sendmsg(fd, &msg, 0)) == -1) {
lib/libutil/imsg-buffer.c
818
close(buf0->fd);
lib/libutil/imsg-buffer.c
819
buf0->fd = -1;
lib/libutil/imsg-buffer.c
828
ibuf_read_process(struct msgbuf *msgbuf, int fd)
lib/libutil/imsg-buffer.c
843
msgbuf->rarg, &fd)) == NULL)
lib/libutil/imsg-buffer.c
867
if (fd != -1)
lib/libutil/imsg-buffer.c
868
close(fd);
lib/libutil/imsg-buffer.c
873
if (fd != -1)
lib/libutil/imsg-buffer.c
874
close(fd);
lib/libutil/imsg-buffer.c
879
ibuf_read(int fd, struct msgbuf *msgbuf)
lib/libutil/imsg-buffer.c
893
if ((n = readv(fd, &iov, 1)) == -1) {
lib/libutil/imsg-buffer.c
910
msgbuf_read(int fd, struct msgbuf *msgbuf)
lib/libutil/imsg-buffer.c
938
if ((n = recvmsg(fd, &msg, 0)) == -1) {
lib/libutil/imsg-buffer.c
95
buf->fd = -1;
lib/libutil/imsg.c
248
int fd, const void *data, size_t datalen)
lib/libutil/imsg.c
258
ibuf_fd_set(wbuf, fd);
lib/libutil/imsg.c
270
int fd, const struct iovec *iov, int iovcnt)
lib/libutil/imsg.c
286
ibuf_fd_set(wbuf, fd);
lib/libutil/imsg.c
40
imsgbuf_init(struct imsgbuf *imsgbuf, int fd)
lib/libutil/imsg.c
432
imsg_parse_hdr(struct ibuf *buf, void *arg, int *fd)
lib/libutil/imsg.c
451
ibuf_fd_set(b, *fd);
lib/libutil/imsg.c
452
*fd = -1;
lib/libutil/imsg.c
48
imsgbuf->fd = fd;
lib/libutil/imsg.c
79
return msgbuf_read(imsgbuf->fd, imsgbuf->w);
lib/libutil/imsg.c
81
return ibuf_read(imsgbuf->fd, imsgbuf->w);
lib/libutil/imsg.c
88
return msgbuf_write(imsgbuf->fd, imsgbuf->w);
lib/libutil/imsg.c
90
return ibuf_write(imsgbuf->fd, imsgbuf->w);
lib/libutil/imsg.h
41
int fd;
lib/libutil/imsg.h
51
int fd;
lib/libutil/login.c
46
int fd, tty;
lib/libutil/login.c
50
if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT|O_CLOEXEC, 0644))
lib/libutil/login.c
59
pread(fd, &old_ut, sizeof(struct utmp), pos) ==
lib/libutil/login.c
65
(void)pwrite(fd, utp, sizeof(struct utmp), pos);
lib/libutil/login.c
66
(void)close(fd);
lib/libutil/login.c
68
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) >= 0) {
lib/libutil/login.c
69
(void)write(fd, utp, sizeof(struct utmp));
lib/libutil/login.c
70
(void)close(fd);
lib/libutil/login_tty.c
38
login_tty(int fd)
lib/libutil/login_tty.c
41
if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
lib/libutil/login_tty.c
43
(void) dup2(fd, STDIN_FILENO);
lib/libutil/login_tty.c
44
(void) dup2(fd, STDOUT_FILENO);
lib/libutil/login_tty.c
45
(void) dup2(fd, STDERR_FILENO);
lib/libutil/login_tty.c
46
if (fd > STDERR_FILENO)
lib/libutil/login_tty.c
47
(void) close(fd);
lib/libutil/logout.c
47
int fd, rval;
lib/libutil/logout.c
50
if ((fd = open(_PATH_UTMP, O_RDWR|O_CLOEXEC)) == -1)
lib/libutil/logout.c
53
while (read(fd, &ut, sizeof(UTMP)) == sizeof(UTMP)) {
lib/libutil/logout.c
59
(void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR);
lib/libutil/logout.c
60
(void)write(fd, &ut, sizeof(UTMP));
lib/libutil/logout.c
63
(void)close(fd);
lib/libutil/logwtmp.c
47
int fd;
lib/libutil/logwtmp.c
49
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND|O_CLOEXEC)) == -1)
lib/libutil/logwtmp.c
51
if (fstat(fd, &buf) == 0) {
lib/libutil/logwtmp.c
56
if (write(fd, &ut, sizeof(struct utmp)) !=
lib/libutil/logwtmp.c
58
(void) ftruncate(fd, buf.st_size);
lib/libutil/logwtmp.c
60
(void) close(fd);
lib/libutil/opendev.c
104
fd = open(namebuf, oflags);
lib/libutil/opendev.c
110
return (fd);
lib/libutil/opendev.c
54
int fd, ret;
lib/libutil/opendev.c
57
fd = -1;
lib/libutil/opendev.c
67
fd = open(namebuf, oflags);
lib/libutil/opendev.c
70
if ((fd = open("/dev/diskmap", oflags)) != -1) {
lib/libutil/opendev.c
73
dm.fd = fd;
lib/libutil/opendev.c
79
if (ioctl(fd, DIOCMAP, &dm) == -1) {
lib/libutil/opendev.c
80
close(fd);
lib/libutil/opendev.c
81
fd = -1;
lib/libutil/opendev.c
86
if (!slash && fd == -1 && errno == ENOENT) {
lib/libutil/opendev.c
96
fd = open(namebuf, oflags);
lib/libutil/opendev.c
98
if (fd == -1 && errno == ENOENT) {
lib/libutil/passwd.c
103
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
lib/libutil/passwd.c
104
for (i = 0; i < retries && fd == -1 && errno == EEXIST; i++) {
lib/libutil/passwd.c
106
fd = open(pw_lck, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0600);
lib/libutil/passwd.c
109
return (fd);
lib/libutil/passwd.c
94
int i, fd;
lib/libutil/readlabel.c
108
fd = open(rpath, O_RDONLY|O_CLOEXEC);
lib/libutil/readlabel.c
109
if (fd == -1) {
lib/libutil/readlabel.c
113
fd = open(rpath, O_RDONLY|O_CLOEXEC);
lib/libutil/readlabel.c
114
if (fd == -1) {
lib/libutil/readlabel.c
131
close(fd);
lib/libutil/readlabel.c
134
if (ioctl(fd, DIOCGDINFO, &dk) == -1) {
lib/libutil/readlabel.c
137
close(fd);
lib/libutil/readlabel.c
140
close(fd);
lib/libutil/readlabel.c
58
int fd = -1, partno;
lib/libutil/readlabel.c
62
if ((fd = open("/dev/diskmap", O_RDONLY|O_CLOEXEC)) != -1) {
lib/libutil/readlabel.c
67
dm.fd = fd;
lib/libutil/readlabel.c
69
if (ioctl(fd, DIOCMAP, &dm) == -1)
lib/libutil/readlabel.c
70
close(fd);
lib/libutil/uucplock.c
113
(void)close(fd);
lib/libutil/uucplock.c
126
int fd, err, ret;
lib/libutil/uucplock.c
130
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) == -1)
lib/libutil/uucplock.c
132
if (get_pid(fd, &err) != getpid())
lib/libutil/uucplock.c
135
lseek(fd, 0, SEEK_SET);
lib/libutil/uucplock.c
136
ret = put_pid(fd, pid) ? UU_LOCK_OK : UU_LOCK_WRITE_ERR;
lib/libutil/uucplock.c
139
close(fd);
lib/libutil/uucplock.c
194
put_pid(int fd, pid_t pid)
lib/libutil/uucplock.c
203
if (write(fd, buf, len) != len)
lib/libutil/uucplock.c
207
ftruncate(fd, (off_t)len);
lib/libutil/uucplock.c
212
get_pid(int fd, int *err)
lib/libutil/uucplock.c
218
bytes_read = read(fd, buf, sizeof (buf) - 1);
lib/libutil/uucplock.c
54
static int put_pid(int fd, pid_t pid);
lib/libutil/uucplock.c
55
static pid_t get_pid(int fd,int *err);
lib/libutil/uucplock.c
65
int fd, tmpfd, i, err, uuerr;
lib/libutil/uucplock.c
86
if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) == -1)
lib/libutil/uucplock.c
89
if ((pid_old = get_pid(fd, &err)) == -1)
lib/libutil/uucplock.c
92
close(fd);
lib/libz/gzguts.h
178
int fd; /* file descriptor */
lib/libz/gzlib.c
201
if (fd == -2)
lib/libz/gzlib.c
212
if (fd == -2) {
lib/libz/gzlib.c
247
if (fd == -1)
lib/libz/gzlib.c
248
state->fd = open((const char *)path, oflag, 0666);
lib/libz/gzlib.c
250
else if (fd == -2)
lib/libz/gzlib.c
251
state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
lib/libz/gzlib.c
256
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
lib/libz/gzlib.c
260
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
lib/libz/gzlib.c
262
state->fd = fd;
lib/libz/gzlib.c
264
if (state->fd == -1) {
lib/libz/gzlib.c
270
LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
lib/libz/gzlib.c
276
state->start = LSEEK(state->fd, 0, SEEK_CUR);
lib/libz/gzlib.c
298
gzFile ZEXPORT gzdopen(int fd, const char *mode) {
lib/libz/gzlib.c
302
if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
lib/libz/gzlib.c
305
(void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
lib/libz/gzlib.c
307
sprintf(path, "<fd:%d>", fd); /* for debugging */
lib/libz/gzlib.c
309
gz = gz_open(path, fd, mode);
lib/libz/gzlib.c
360
if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
lib/libz/gzlib.c
398
ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
lib/libz/gzlib.c
481
offset = LSEEK(state->fd, 0, SEEK_CUR);
lib/libz/gzlib.c
87
local gzFile gz_open(const void *path, int fd, const char *mode) {
lib/libz/gzread.c
30
ret = (int)read(state->fd, buf + *have, get);
lib/libz/gzread.c
665
ret = close(state->fd);
lib/libz/gzwrite.c
115
writ = (int)write(state->fd, state->x.next, put);
lib/libz/gzwrite.c
696
if (close(state->fd) == -1)
lib/libz/gzwrite.c
80
writ = (int)write(state->fd, strm->next_in, put);
lib/libz/zlib.h
1404
ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
libexec/comsat/comsat.c
247
int fd;
libexec/comsat/comsat.c
271
fd = open(tty, O_WRONLY);
libexec/comsat/comsat.c
272
if (fd == -1 || (tp = fdopen(fd, "w")) == NULL) {
libexec/ftpd/ftpd.c
1192
int fd;
libexec/ftpd/ftpd.c
1200
fd = guniquefd(name, &nam);
libexec/ftpd/ftpd.c
1201
if (fd == -1) {
libexec/ftpd/ftpd.c
1206
fout = fdopen(fd, mode);
libexec/ftpd/ftpd.c
2535
int count, fd;
libexec/ftpd/ftpd.c
2554
fd = open(new, O_RDWR|O_CREAT|O_EXCL, 0666);
libexec/ftpd/ftpd.c
2555
if (fd == -1)
libexec/ftpd/ftpd.c
2559
return (fd);
libexec/ftpd/ftpd.c
392
int *fds, fd;
libexec/ftpd/ftpd.c
465
pfds[n].fd = fds[n];
libexec/ftpd/ftpd.c
490
fd = accept(pfds[i].fd,
libexec/ftpd/ftpd.c
493
if (fd != -1) {
libexec/ftpd/ftpd.c
496
close(fd);
libexec/ftpd/ftpd.c
503
(void)dup2(fd, STDIN_FILENO);
libexec/ftpd/ftpd.c
504
(void)dup2(fd, STDOUT_FILENO);
libexec/ftpd/logutmp.c
108
if (fd < 0)
libexec/ftpd/logutmp.c
111
(void)lseek(fd, 0, SEEK_SET);
libexec/ftpd/logutmp.c
113
while (read(fd, &ut, sizeof(struct utmp)) == sizeof(struct utmp)) {
libexec/ftpd/logutmp.c
121
(void)lseek(fd, -(off_t)sizeof(struct utmp), SEEK_CUR);
libexec/ftpd/logutmp.c
122
(void)write(fd, &ut, sizeof(struct utmp));
libexec/ftpd/logutmp.c
50
static int fd = -1;
libexec/ftpd/logutmp.c
72
if ((topslot < 0) || ((fd < 0) &&
libexec/ftpd/logutmp.c
73
(fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) == -1))
libexec/ftpd/logutmp.c
79
(void)lseek(fd, (off_t)topslot * sizeof(struct utmp), SEEK_SET);
libexec/ftpd/logutmp.c
82
if (read(fd, &ubuf, sizeof(struct utmp)) ==
libexec/ftpd/logutmp.c
85
(void)lseek(fd, -(off_t)sizeof(struct utmp),
libexec/ftpd/logutmp.c
91
(void)lseek(fd, (off_t)topslot * sizeof(struct utmp),
libexec/ftpd/logutmp.c
97
(void)write(fd, ut, sizeof(struct utmp));
libexec/ftpd/logwtmp.c
49
static int fd = -1;
libexec/ftpd/logwtmp.c
63
if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND)) == -1)
libexec/ftpd/logwtmp.c
65
if (fstat(fd, &buf) == 0) {
libexec/ftpd/logwtmp.c
71
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
libexec/ftpd/logwtmp.c
73
(void)ftruncate(fd, buf.st_size);
libexec/ftpd/monitor_fdpass.c
107
fd = (*(int *)CMSG_DATA(cmsg));
libexec/ftpd/monitor_fdpass.c
108
return (fd);
libexec/ftpd/monitor_fdpass.c
32
send_fd(int sock, int fd)
libexec/ftpd/monitor_fdpass.c
46
if (fd >= 0) {
libexec/ftpd/monitor_fdpass.c
53
*(int *)CMSG_DATA(cmsg) = fd;
libexec/ftpd/monitor_fdpass.c
81
int fd;
libexec/getty/subr.c
413
pfd[0].fd = 0;
libexec/ld.so/dir.c
55
int fd;
libexec/ld.so/dir.c
58
if ((fd = _dl_open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) < 0)
libexec/ld.so/dir.c
60
if (_dl_fstat(fd, &sb) || (dirp = _dl_malloc(sizeof(*dirp))) == NULL) {
libexec/ld.so/dir.c
61
_dl_close(fd);
libexec/ld.so/dir.c
65
dirp->dd_fd = fd;
libexec/ld.so/dir.c
72
_dl_close(fd);
libexec/ld.so/dl_printf.c
112
_dl_dprintf(int fd, const char *fmt, ...)
libexec/ld.so/dl_printf.c
117
kdoprnt(fd, fmt, ap);
libexec/ld.so/dl_printf.c
128
kdoprnt(int fd, const char *fmt, va_list ap)
libexec/ld.so/dl_printf.c
140
putcharfd(ch, fd);
libexec/ld.so/dl_printf.c
154
kprintn(fd, ul, *p++);
libexec/ld.so/dl_printf.c
161
putcharfd(set ? ',' : '<', fd);
libexec/ld.so/dl_printf.c
163
putcharfd(n, fd);
libexec/ld.so/dl_printf.c
169
putcharfd('>', fd);
libexec/ld.so/dl_printf.c
174
putcharfd(ch & 0x7f, fd);
libexec/ld.so/dl_printf.c
179
putcharfd(ch, fd);
libexec/ld.so/dl_printf.c
184
putcharfd('-', fd);
libexec/ld.so/dl_printf.c
187
kprintn(fd, ul, 10);
libexec/ld.so/dl_printf.c
191
kprintn(fd, ul, 8);
libexec/ld.so/dl_printf.c
195
kprintn(fd, ul, 10);
libexec/ld.so/dl_printf.c
198
putcharfd('0', fd);
libexec/ld.so/dl_printf.c
199
putcharfd('x', fd);
libexec/ld.so/dl_printf.c
203
kprintn(fd, ul, 16);
libexec/ld.so/dl_printf.c
215
putcharfd("0123456789abcdef"[(ul >> l) & 0xf], fd);
libexec/ld.so/dl_printf.c
221
putcharfd('%', fd);
libexec/ld.so/dl_printf.c
223
putcharfd('l', fd);
libexec/ld.so/dl_printf.c
224
putcharfd(ch, fd);
libexec/ld.so/dl_printf.c
230
kprintn(int fd, unsigned long ul, int base)
libexec/ld.so/dl_printf.c
240
putcharfd(*--p, fd);
libexec/ld.so/dl_printf.c
75
putcharfd(int c, int fd)
libexec/ld.so/dl_printf.c
80
if (fd != lastfd) {
libexec/ld.so/dl_printf.c
82
lastfd = fd;
libexec/ld.so/dlfcn.c
407
_dl_tracefmt(int fd, elf_object_t *object, const char *fmt1, const char *fmt2,
libexec/ld.so/dlfcn.c
417
_dl_dprintf(fd, "%c", fmt[i]);
libexec/ld.so/dlfcn.c
426
_dl_dprintf(fd, "%c", '%');
libexec/ld.so/dlfcn.c
429
_dl_dprintf(fd, "%s", _dl_traceprog ?
libexec/ld.so/dlfcn.c
433
_dl_dprintf(fd, "%s", __progname);
libexec/ld.so/dlfcn.c
436
_dl_dprintf(fd, "%lX",
libexec/ld.so/dlfcn.c
441
_dl_dprintf(fd, "%d", object->grprefcount);
libexec/ld.so/dlfcn.c
444
_dl_dprintf(fd, "%d", object->sod.sod_major);
libexec/ld.so/dlfcn.c
447
_dl_dprintf(fd, "%d", object->sod.sod_minor);
libexec/ld.so/dlfcn.c
450
_dl_dprintf(fd, "%d", object->opencount);
libexec/ld.so/dlfcn.c
453
_dl_dprintf(fd, "%s", object->sod.sod_name);
libexec/ld.so/dlfcn.c
456
_dl_dprintf(fd, "%s", object->load_name);
libexec/ld.so/dlfcn.c
459
_dl_dprintf(fd, "%d", object->refcount);
libexec/ld.so/dlfcn.c
462
_dl_dprintf(fd, "%s", objtypename);
libexec/ld.so/dlfcn.c
465
_dl_dprintf(fd, "%lX", object->load_base);
libexec/ld.so/dlfcn.c
475
_dl_dprintf(fd, "%c", '\n');
libexec/ld.so/dlfcn.c
478
_dl_dprintf(fd, "%c", '\r');
libexec/ld.so/dlfcn.c
481
_dl_dprintf(fd, "%c", '\t');
libexec/ld.so/dlfcn.c
484
_dl_dprintf(fd, "%c", fmt[i]);
libexec/ld.so/ldconfig/ldconfig.c
300
int strtab_sz = 0, nhints = 0, fd = -1, i, ret = -1, str_index = 0;
libexec/ld.so/ldconfig/ldconfig.c
385
if ((fd = mkstemp(tmpfilenam)) == -1) {
libexec/ld.so/ldconfig/ldconfig.c
389
if (fchmod(fd, 0444) == -1) {
libexec/ld.so/ldconfig/ldconfig.c
394
if (write(fd, &hdr, sizeof(struct hints_header)) !=
libexec/ld.so/ldconfig/ldconfig.c
399
if (write(fd, blist, hdr.hh_nbucket * sizeof(struct hints_bucket)) !=
libexec/ld.so/ldconfig/ldconfig.c
404
if (write(fd, strtab, strtab_sz) != strtab_sz) {
libexec/ld.so/ldconfig/ldconfig.c
416
if (fd != -1)
libexec/ld.so/ldconfig/ldconfig.c
417
close(fd);
libexec/ld.so/ldconfig/ldconfig.c
433
int fd, i;
libexec/ld.so/ldconfig/ldconfig.c
435
if ((fd = open(_PATH_LD_HINTS, O_RDONLY)) == -1) {
libexec/ld.so/ldconfig/ldconfig.c
439
if (fstat(fd, &sb) != 0 || !S_ISREG(sb.st_mode) ||
libexec/ld.so/ldconfig/ldconfig.c
446
addr = mmap(0, msize, PROT_READ, MAP_PRIVATE, fd, 0);
libexec/ld.so/ldconfig/ldconfig.c
471
close(fd);
libexec/ld.so/ldd/ldd.c
103
int fd, i, status, interp=0;
libexec/ld.so/ldd/ldd.c
108
if ((fd = open(name, O_RDONLY)) < 0) {
libexec/ld.so/ldd/ldd.c
113
if (fstat(fd, &st) == -1) {
libexec/ld.so/ldd/ldd.c
115
close(fd);
libexec/ld.so/ldd/ldd.c
121
close(fd);
libexec/ld.so/ldd/ldd.c
125
if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) {
libexec/ld.so/ldd/ldd.c
127
close(fd);
libexec/ld.so/ldd/ldd.c
133
close(fd);
libexec/ld.so/ldd/ldd.c
139
close(fd);
libexec/ld.so/ldd/ldd.c
147
if (pread(fd, phdr, size, ehdr.e_phoff) != size) {
libexec/ld.so/ldd/ldd.c
149
close(fd);
libexec/ld.so/ldd/ldd.c
153
close(fd);
libexec/ld.so/library_mquery.c
275
int fd, flags;
libexec/ld.so/library_mquery.c
281
fd = -1;
libexec/ld.so/library_mquery.c
285
fd = libfile;
libexec/ld.so/library_mquery.c
299
fd, foff);
libexec/ld.so/library_mquery.c
306
ld->prot, flags | MAP_FIXED | __MAP_NOREPLACE, fd, foff);
libexec/ld.so/util.h
67
ssize_t _dl_write(int fd, const char* buf, size_t len);
libexec/lockspool/lockspool.c
89
pfd.fd = STDIN_FILENO;
libexec/login_ldap/aldap.c
112
if (tls_connect_socket(ldap->tls, ldap->fd, name) == -1) {
libexec/login_ldap/aldap.c
149
wrote = write(ldap->fd, data + done, len);
libexec/login_ldap/aldap.c
370
ret = read(ldap->fd, rbuf, sizeof(rbuf));
libexec/login_ldap/aldap.c
76
close(al->fd);
libexec/login_ldap/aldap.c
85
aldap_init(int fd)
libexec/login_ldap/aldap.c
92
a->fd = fd;
libexec/login_ldap/aldap.h
46
int fd;
libexec/login_ldap/util.c
322
int fd, code;
libexec/login_ldap/util.c
334
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1 ||
libexec/login_ldap/util.c
335
connect(fd, (struct sockaddr *)&un, sizeof(un)) == -1) {
libexec/login_ldap/util.c
350
for (res = res0; res; res = res->ai_next, fd = -1) {
libexec/login_ldap/util.c
351
if ((fd = socket(res->ai_family, res->ai_socktype,
libexec/login_ldap/util.c
355
if (connect(fd, res->ai_addr, res->ai_addrlen) >= 0)
libexec/login_ldap/util.c
358
close(fd);
libexec/login_ldap/util.c
361
if (fd == -1)
libexec/login_ldap/util.c
365
ctx->ld = aldap_init(fd);
libexec/login_skey/login_skey.c
133
haskey = (skeychallenge2(fd, &skey, user, challenge) == 0);
libexec/login_skey/login_skey.c
158
haskey = (skeychallenge2(fd, &skey, user, challenge) == 0);
libexec/login_skey/login_skey.c
213
haskey = (skeychallenge2(fd, &skey, user, challenge) == 0);
libexec/login_skey/login_skey.c
61
int ch, fd = -1, haskey = 0, mode = MODE_LOGIN;
libexec/login_skey/login_skey.c
95
fd = strtonum(optarg + 3, 0, INT_MAX, &errstr);
libexec/login_skey/login_skey.c
99
fd = -1;
libexec/login_token/tokendb.c
120
if (flock((tokendb->fd)(tokendb), LOCK_EX)) {
libexec/login_token/tokendb.c
144
if (flock((tokendb->fd)(tokendb), LOCK_EX)) {
libexec/login_token/tokendb.c
213
if (flock((tokendb->fd)(tokendb), LOCK_SH)) {
libexec/login_token/tokendb.c
217
if (must_set_perms && fchown((tokendb->fd)(tokendb), 0, grp->gr_gid))
libexec/login_token/tokendb.c
220
if (must_set_mode && fchmod((tokendb->fd)(tokendb), 0640))
libexec/login_token/tokendb.c
237
(void)flock((tokendb->fd)(tokendb), LOCK_UN);
libexec/login_token/tokendb.c
328
if (flock((tokendb->fd)(tokendb), LOCK_EX)) {
libexec/mail.local/mail.local.c
101
fd = storemail(from);
libexec/mail.local/mail.local.c
103
if ((ch = deliver(fd, *argv, lockfile)) != 0)
libexec/mail.local/mail.local.c
114
int fd, eline = 1;
libexec/mail.local/mail.local.c
121
if ((fd = mkstemp(tbuf)) == -1 || !(fp = fdopen(fd, "w+")))
libexec/mail.local/mail.local.c
151
return(fd);
libexec/mail.local/mail.local.c
155
deliver(int fd, char *name, int lockfile)
libexec/mail.local/mail.local.c
240
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
libexec/mail.local/mail.local.c
245
while ((nr = read(fd, buf, sizeof(buf))) > 0)
libexec/mail.local/mail.local.c
59
int ch, fd, eval, lockfile=1;
libexec/rpc.rquotad/rquotad.c
230
int qcmd, fd, ret = 0;
libexec/rpc.rquotad/rquotad.c
246
if ((fd = open(fs->qfpathname, O_RDONLY)) == -1) {
libexec/rpc.rquotad/rquotad.c
250
if (lseek(fd, (off_t)(id * sizeof(struct dqblk)), SEEK_SET) ==
libexec/rpc.rquotad/rquotad.c
252
close(fd);
libexec/rpc.rquotad/rquotad.c
255
switch (read(fd, dqblk, sizeof(struct dqblk))) {
libexec/rpc.rquotad/rquotad.c
269
close(fd);
libexec/rpc.rquotad/rquotad.c
272
close(fd);
libexec/rpc.rusersd/rusers_proc.c
107
int fd;
libexec/rpc.rusersd/rusers_proc.c
109
fd = dup(utmp_fd);
libexec/rpc.rusersd/rusers_proc.c
110
if (fd == -1) {
libexec/rpc.rusersd/rusers_proc.c
114
lseek(fd, 0, SEEK_SET);
libexec/rpc.rusersd/rusers_proc.c
115
ufp = fdopen(fd, "r");
libexec/rpc.rusersd/rusers_proc.c
117
close(fd);
libexec/rpc.rusersd/rusers_proc.c
136
int fd, nusers = 0;
libexec/rpc.rusersd/rusers_proc.c
141
fd = dup(utmp_fd);
libexec/rpc.rusersd/rusers_proc.c
142
if (fd == -1) {
libexec/rpc.rusersd/rusers_proc.c
146
lseek(fd, 0, SEEK_SET);
libexec/rpc.rusersd/rusers_proc.c
147
ufp = fdopen(fd, "r");
libexec/rpc.rusersd/rusers_proc.c
149
close(fd);
libexec/rpc.rusersd/rusers_proc.c
199
int fd, nusers = 0;
libexec/rpc.rusersd/rusers_proc.c
205
fd = dup(utmp_fd);
libexec/rpc.rusersd/rusers_proc.c
206
if (fd == -1) {
libexec/rpc.rusersd/rusers_proc.c
210
lseek(fd, 0, SEEK_SET);
libexec/rpc.rusersd/rusers_proc.c
211
ufp = fdopen(fd, "r");
libexec/rpc.rusersd/rusers_proc.c
213
close(fd);
libexec/rpc.rusersd/rusers_proc.c
263
int fd, nusers = 0;
libexec/rpc.rusersd/rusers_proc.c
269
fd = dup(utmp_fd);
libexec/rpc.rusersd/rusers_proc.c
270
if (fd == -1) {
libexec/rpc.rusersd/rusers_proc.c
274
lseek(fd, 0, SEEK_SET);
libexec/rpc.rusersd/rusers_proc.c
275
ufp = fdopen(fd, "r");
libexec/rpc.rusersd/rusers_proc.c
277
close(fd);
libexec/snmpd/snmpd_metrics/kroute.c
1297
dispatch_rtmsg(int fd, short event, void *arg)
libexec/snmpd/snmpd_metrics/kroute.c
1302
if ((n = read(fd, &buf, sizeof(buf))) == -1) {
libexec/snmpd/snmpd_metrics/mib.c
4427
snmp_tryconnect(int fd, short event, void *cookie)
libexec/snmpd/snmpd_metrics/mib.c
4437
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1 ||
libexec/snmpd/snmpd_metrics/mib.c
4438
connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
libexec/snmpd/snmpd_metrics/mib.c
4439
if (fd != -1)
libexec/snmpd/snmpd_metrics/mib.c
4440
close(fd);
libexec/snmpd/snmpd_metrics/mib.c
4447
event_set(&connev, fd, EV_READ | EV_PERSIST, snmp_read, sa);
libexec/snmpd/snmpd_metrics/mib.c
4450
agentx_connect(sa, fd);
libexec/snmpd/snmpd_metrics/mib.c
4454
snmp_read(int fd, short event, void *cookie)
libexec/snmpd/snmpd_metrics/mib.c
824
kinfo_timer_cb(int fd, short event, void *arg)
libexec/snmpd/snmpd_metrics/timer.c
54
timer_cpu(int fd, short event, void *arg)
libexec/spamd-setup/spamd-setup.c
400
int fd;
libexec/spamd-setup/spamd-setup.c
414
fd = open(msg, O_RDONLY);
libexec/spamd-setup/spamd-setup.c
415
if (fd == -1)
libexec/spamd-setup/spamd-setup.c
426
n = read(fd, buf + bu, bs - bu);
libexec/spamd-setup/spamd-setup.c
695
int fd, black = 0, serror;
libexec/spamd-setup/spamd-setup.c
742
fd = open_file(method, file);
libexec/spamd-setup/spamd-setup.c
743
if (fd == -1)
libexec/spamd-setup/spamd-setup.c
748
gzf = gzdopen(fd, "r");
libexec/spamd/spamd.c
1096
n = read(cp->pfd->fd, cp->ip, cp->il);
libexec/spamd/spamd.c
1150
n = write(cp->pfd->fd, "\r", 1);
libexec/spamd/spamd.c
1178
n = write(cp->pfd->fd, cp->op,
libexec/spamd/spamd.c
1412
con[i].pfd->fd = -1;
libexec/spamd/spamd.c
1552
pfd[PFD_TRAPFD].fd = trapfd;
libexec/spamd/spamd.c
1555
pfd[PFD_TRAPFD].fd = -1;
libexec/spamd/spamd.c
1559
pfd[PFD_SYNCFD].fd = syncfd;
libexec/spamd/spamd.c
1562
pfd[PFD_SYNCFD].fd = -1;
libexec/spamd/spamd.c
1566
pfd[PFD_GREYBACK].fd = greyback[1];
libexec/spamd/spamd.c
1569
pfd[PFD_GREYBACK].fd = -1;
libexec/spamd/spamd.c
1574
pfd[PFD_SMTPLISTEN].fd = smtplisten;
libexec/spamd/spamd.c
1575
pfd[PFD_CONFLISTEN].fd = conflisten;
libexec/spamd/spamd.c
1584
if (con[i].pfd->fd == -1)
libexec/spamd/spamd.c
1615
pfd[PFD_CONFFD].fd = conffd;
libexec/spamd/spamd.c
1644
if (con[i].pfd->fd == -1)
libexec/spamd/spamd.c
1657
if (con[i].pfd->fd != -1 &&
libexec/spamd/spamd.c
1688
if (con[i].pfd->fd == -1)
libexec/spamd/spamd.c
1742
blackcheck(int fd)
libexec/spamd/spamd.c
1750
nread = recv(fd, &ss, sizeof(ss), 0);
libexec/spamd/spamd.c
1771
if (send(fd, &ch, sizeof(ch), 0) == -1) {
libexec/spamd/spamd.c
673
if (getsockname(cp->pfd->fd, odp, &len) == -1)
libexec/spamd/spamd.c
704
initcon(struct con *cp, int fd, struct sockaddr *sa)
libexec/spamd/spamd.c
722
cp->pfd->fd = fd;
libexec/spamd/spamd.c
766
close(cp->pfd->fd);
libexec/spamd/spamd.c
767
cp->pfd->fd = -1;
libexec/spamd/spamd.c
968
if (tls_accept_socket(tlsctx, &cp->cctx, cp->pfd->fd) == -1) {
libexec/spamd/spamd.c
986
if (window && setsockopt(cp->pfd->fd, SOL_SOCKET,
libexec/spamlogd/spamlogd.c
115
int fd;
libexec/spamlogd/spamlogd.c
129
if ((fd = open("/dev/bpf", O_RDONLY)) == -1)
libexec/spamlogd/spamlogd.c
132
if (ioctl(fd, BIOCVERSION, &bv) == -1) {
libexec/spamlogd/spamlogd.c
146
if (ioctl(fd, BIOCSETIF, &ifr) == -1) {
libexec/spamlogd/spamlogd.c
152
if (dlt != (u_int) -1 && ioctl(fd, BIOCSDLT, &dlt)) {
libexec/spamlogd/spamlogd.c
158
p->fd = fd;
libexec/spamlogd/spamlogd.c
167
if (ioctl(p->fd, BIOCSRTIMEOUT, &to) == -1) {
libexec/spamlogd/spamlogd.c
175
ioctl(fd, BIOCPROMISC, NULL);
libexec/spamlogd/spamlogd.c
177
if (ioctl(fd, BIOCGBLEN, &v) == -1) {
libexec/tradcpp/files.c
177
file_read(const struct placefile *pf, int fd, const char *name, bool toplevel)
libexec/tradcpp/files.c
228
result = read(fd, buf+bufend, bufmax - bufend);
libexec/tradcpp/files.c
345
int fd;
libexec/tradcpp/files.c
349
fd = open(file, O_RDONLY);
libexec/tradcpp/files.c
350
if (fd == -1) {
libexec/tradcpp/files.c
357
return fd;
libexec/tradcpp/files.c
368
int fd;
libexec/tradcpp/files.c
373
fd = file_tryopen(name);
libexec/tradcpp/files.c
374
if (fd >= 0) {
libexec/tradcpp/files.c
376
file_read(pf, fd, name, false);
libexec/tradcpp/files.c
377
close(fd);
libexec/tradcpp/files.c
385
fd = file_tryopen(file);
libexec/tradcpp/files.c
386
if (fd >= 0) {
libexec/tradcpp/files.c
388
file_read(pf, fd, file, false);
libexec/tradcpp/files.c
390
close(fd);
libexec/tradcpp/files.c
416
int fd;
libexec/tradcpp/files.c
421
fd = STDIN_FILENO;
libexec/tradcpp/files.c
424
fd = file_tryopen(name);
libexec/tradcpp/files.c
425
if (fd < 0) {
libexec/tradcpp/files.c
432
file_read(pf, fd, name, true);
libexec/tradcpp/files.c
435
close(fd);
regress/bin/ksh/edit/edit.c
101
pfd.fd = ptyfd;
regress/lib/libagentx/main.c
127
int fd = -1;
regress/lib/libagentx/main.c
324
event_set(&rev, fd, EV_READ|EV_PERSIST, regress_read, NULL);
regress/lib/libagentx/main.c
348
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1 ||
regress/lib/libagentx/main.c
349
connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
regress/lib/libagentx/main.c
352
agentx_connect(sa2, fd);
regress/lib/libagentx/main.c
358
regress_read(int fd, short event, void *cookie)
regress/lib/libagentx/main.c
366
regress_usr1(int fd, short event, void *cookie)
regress/lib/libagentx/main.c
382
regress_usr2(int fd, short event, void *cookie)
regress/lib/libc/db/dbtest.c
677
int fd;
regress/lib/libc/db/dbtest.c
683
if ((fd = open(name, O_RDONLY)) < 0 ||
regress/lib/libc/db/dbtest.c
684
fstat(fd, &sb))
regress/lib/libc/db/dbtest.c
690
(void)read(fd, p, (int)sb.st_size);
regress/lib/libc/db/dbtest.c
692
(void)close(fd);
regress/lib/libc/fread/fread.c
58
dochild(int fd)
regress/lib/libc/fread/fread.c
66
nwritten = write(fd, ts, left);
regress/lib/libc/fread/fread.c
72
close(fd);
regress/lib/libc/mkstemp/mkstemp_test.c
103
fd = mkstemps(p, slen);
regress/lib/libc/mkstemp/mkstemp_test.c
104
if (check(fd, p, prefix, plen, suffix, slen, len))
regress/lib/libc/mkstemp/mkstemp_test.c
38
check(int fd, char const *path, char const *prefix, size_t plen,
regress/lib/libc/mkstemp/mkstemp_test.c
45
if (fd >= 0)
regress/lib/libc/mkstemp/mkstemp_test.c
51
if (fd < 0)
regress/lib/libc/mkstemp/mkstemp_test.c
55
if (fstat(fd, &fsb))
regress/lib/libc/mkstemp/mkstemp_test.c
56
err(1, "fstat(%d==%s)", fd, path);
regress/lib/libc/mkstemp/mkstemp_test.c
59
close(fd);
regress/lib/libc/mkstemp/mkstemp_test.c
78
int tries, fd;
regress/lib/libc/mkstemp/mkstemp_test.c
84
fd = mkstemp(p);
regress/lib/libc/mkstemp/mkstemp_test.c
85
if (check(fd, p, prefix, plen, "", 0, len))
regress/lib/libc/mkstemp/mkstemp_test.c
97
int tries, fd;
regress/lib/libc/orientation/orientation_test.c
120
int fd, r;
regress/lib/libc/orientation/orientation_test.c
124
if ((fd = dup(1)) == -1)
regress/lib/libc/orientation/orientation_test.c
126
if ((dup_stdout = fdopen(fd, "w")) == NULL)
regress/lib/libc/orientation/orientation_test.c
128
if ((fd = mkstemp(filename)) == -1)
regress/lib/libc/orientation/orientation_test.c
130
if (write(fd, "0123456789\n\n", 12) != 12 || close(fd))
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
47
int fd, i;
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
50
if ((fd = mkstemp(sfn)) == -1 ||
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
51
(sfp = fdopen(fd, "w+")) == NULL) {
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
53
if (fd != -1) {
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
55
close(fd);
regress/lib/libc/stdio_threading/fgetln/fgetln_test.c
67
close(fd);
regress/lib/libc/stdio_threading/fgets/fgets_test.c
46
int fd, i;
regress/lib/libc/stdio_threading/fgets/fgets_test.c
49
if ((fd = mkstemp(sfn)) == -1 ||
regress/lib/libc/stdio_threading/fgets/fgets_test.c
50
(sfp = fdopen(fd, "w+")) == NULL) {
regress/lib/libc/stdio_threading/fgets/fgets_test.c
52
if (fd != -1) {
regress/lib/libc/stdio_threading/fgets/fgets_test.c
54
close(fd);
regress/lib/libc/stdio_threading/fgets/fgets_test.c
66
close(fd);
regress/lib/libc/stdio_threading/flockfile/flockfile_test.c
50
int fd, r;
regress/lib/libc/stdio_threading/fputs/fputs_test.c
44
int fd;
regress/lib/libc/stdio_threading/fputs/fputs_test.c
47
if ((fd = mkstemp(sfn)) == -1 ||
regress/lib/libc/stdio_threading/fputs/fputs_test.c
48
(sfp = fdopen(fd, "w+")) == NULL) {
regress/lib/libc/stdio_threading/fputs/fputs_test.c
50
if (fd != -1) {
regress/lib/libc/stdio_threading/fputs/fputs_test.c
52
close(fd);
regress/lib/libc/stdio_threading/fputs/fputs_test.c
64
close(fd);
regress/lib/libc/stdio_threading/fread/fread_test.c
48
int fd, i;
regress/lib/libc/stdio_threading/fread/fread_test.c
51
if ((fd = mkstemp(sfn)) == -1 ||
regress/lib/libc/stdio_threading/fread/fread_test.c
52
(sfp = fdopen(fd, "w+")) == NULL) {
regress/lib/libc/stdio_threading/fread/fread_test.c
54
if (fd != -1) {
regress/lib/libc/stdio_threading/fread/fread_test.c
56
close(fd);
regress/lib/libc/stdio_threading/fread/fread_test.c
68
close(fd);
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
44
int fd;
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
47
if ((fd = mkstemp(sfn)) == -1 ||
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
48
(sfp = fdopen(fd, "w+")) == NULL) {
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
50
if (fd != -1) {
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
52
close(fd);
regress/lib/libc/stdio_threading/fwrite/fwrite_test.c
64
close(fd);
regress/lib/libc/sys/macros.h
20
#define fchroot(fd) 0
regress/lib/libc/sys/t_access.c
60
int fd;
regress/lib/libc/sys/t_access.c
62
fd = open(path, O_RDONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_access.c
64
if (fd < 0)
regress/lib/libc/sys/t_access.c
69
ATF_REQUIRE(fchmod(fd, perm[i]) == 0);
regress/lib/libc/sys/t_access.c
77
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_chroot.c
102
fd = open(buf, O_RDONLY);
regress/lib/libc/sys/t_chroot.c
104
if (fd < 0)
regress/lib/libc/sys/t_chroot.c
107
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_chroot.c
182
int fd, sta;
regress/lib/libc/sys/t_chroot.c
192
fd = open(buf, O_RDONLY);
regress/lib/libc/sys/t_chroot.c
193
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_chroot.c
200
if (fchroot(fd) != 0)
regress/lib/libc/sys/t_chroot.c
203
if (close(fd) != 0)
regress/lib/libc/sys/t_chroot.c
206
fd = open("file", O_RDONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_chroot.c
208
if (fd < 0)
regress/lib/libc/sys/t_chroot.c
211
if (close(fd) != 0)
regress/lib/libc/sys/t_chroot.c
225
fd = open(buf, O_RDONLY);
regress/lib/libc/sys/t_chroot.c
227
if (fd < 0)
regress/lib/libc/sys/t_chroot.c
230
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_chroot.c
243
int fd;
regress/lib/libc/sys/t_chroot.c
245
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_chroot.c
246
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_chroot.c
252
ATF_REQUIRE_ERRNO(ENOTDIR, fchroot(fd) == -1);
regress/lib/libc/sys/t_chroot.c
254
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_chroot.c
268
int fd, sta;
regress/lib/libc/sys/t_chroot.c
275
fd = open(buf, O_RDONLY);
regress/lib/libc/sys/t_chroot.c
277
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_chroot.c
289
if (fchroot(fd) != -1)
regress/lib/libc/sys/t_chroot.c
57
int fd, sta;
regress/lib/libc/sys/t_chroot.c
83
fd = open("file", O_RDONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_chroot.c
85
if (fd < 0)
regress/lib/libc/sys/t_chroot.c
88
if (close(fd) != 0)
regress/lib/libc/sys/t_dup.c
113
int fd, fd1, fd2;
regress/lib/libc/sys/t_dup.c
121
fd = dup2(fd1, fd2);
regress/lib/libc/sys/t_dup.c
122
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_dup.c
124
if (fd != fd2)
regress/lib/libc/sys/t_dup.c
127
(void)close(fd);
regress/lib/libc/sys/t_dup.c
141
int fd;
regress/lib/libc/sys/t_dup.c
143
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_dup.c
144
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_dup.c
150
ATF_REQUIRE_ERRNO(EBADF, dup2(fd, -1) == -1);
regress/lib/libc/sys/t_dup.c
153
ATF_REQUIRE_ERRNO(EBADF, dup2(-1, fd) == -1);
regress/lib/libc/sys/t_dup.c
158
ATF_REQUIRE(dup2(fd, fd) != -1);
regress/lib/libc/sys/t_dup.c
160
(void)close(fd);
regress/lib/libc/sys/t_dup.c
206
int fd;
regress/lib/libc/sys/t_dup.c
208
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_dup.c
209
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_dup.c
213
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
215
ATF_REQUIRE(dup3(fd, fd, O_CLOEXEC) != -1);
regress/lib/libc/sys/t_dup.c
226
ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
229
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
regress/lib/libc/sys/t_dup.c
232
ATF_REQUIRE_ERRNO(EINVAL, dup3(fd, 1, O_NOFOLLOW) == -1);
regress/lib/libc/sys/t_dup.c
234
(void)close(fd);
regress/lib/libc/sys/t_dup.c
293
int *buf, fd, sta;
regress/lib/libc/sys/t_dup.c
347
fd = dup(buf[0]);
regress/lib/libc/sys/t_dup.c
349
if (fd != -1 || errno != EMFILE)
regress/lib/libc/sys/t_dup.c
59
int fd, fd1, fd2;
regress/lib/libc/sys/t_dup.c
77
fd = dup(fd1);
regress/lib/libc/sys/t_dup.c
79
fd = dup2(fd1, fd2);
regress/lib/libc/sys/t_dup.c
81
fd = dup3(fd1, fd2, O_CLOEXEC);
regress/lib/libc/sys/t_dup.c
83
fd = -1;
regress/lib/libc/sys/t_dup.c
86
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_dup.c
91
ATF_REQUIRE(fstat(fd, &st) == 0);
regress/lib/libc/sys/t_dup.c
97
(void)close(fd);
regress/lib/libc/sys/t_fsync.c
104
fd = open(buf, O_CREAT|O_EXCL|O_RDWR, 0600);
regress/lib/libc/sys/t_fsync.c
106
fd = mkstemp(buf);
regress/lib/libc/sys/t_fsync.c
109
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_fsync.c
110
ATF_REQUIRE(write(fd, "0", 1) == 1);
regress/lib/libc/sys/t_fsync.c
111
ATF_REQUIRE(fsync(fd) == 0);
regress/lib/libc/sys/t_fsync.c
114
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_fsync.c
53
int i, fd[2];
regress/lib/libc/sys/t_fsync.c
72
ATF_REQUIRE(pipe(fd) == 0);
regress/lib/libc/sys/t_fsync.c
76
ATF_REQUIRE(fsync(fd[0]) == -1);
regress/lib/libc/sys/t_fsync.c
81
ATF_REQUIRE(fsync(fd[1]) == -1);
regress/lib/libc/sys/t_fsync.c
84
ATF_REQUIRE(close(fd[0]) == 0);
regress/lib/libc/sys/t_fsync.c
85
ATF_REQUIRE(close(fd[1]) == 0);
regress/lib/libc/sys/t_fsync.c
97
int fd, i;
regress/lib/libc/sys/t_getrusage.c
138
int i, fd;
regress/lib/libc/sys/t_getrusage.c
142
fd = open(DUMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0222);
regress/lib/libc/sys/t_getrusage.c
143
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_getrusage.c
153
write(fd, p, CHUNK);
regress/lib/libc/sys/t_getrusage.c
155
close(fd);
regress/lib/libc/sys/t_kevent.c
162
int fd, kq;
regress/lib/libc/sys/t_kevent.c
165
fd = open(DRVCTLDEV, O_RDONLY);
regress/lib/libc/sys/t_kevent.c
166
if (fd == -1) {
regress/lib/libc/sys/t_kevent.c
174
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_kevent.c
177
EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
regress/lib/libc/sys/t_kevent.c
184
(void)close(fd);
regress/lib/libc/sys/t_link.c
112
int fd;
regress/lib/libc/sys/t_link.c
117
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_link.c
119
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_link.c
144
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_link.c
186
int fd;
regress/lib/libc/sys/t_link.c
192
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_link.c
194
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_link.c
210
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_link.c
74
int fd;
regress/lib/libc/sys/t_link.c
80
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_link.c
82
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_link.c
92
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_mkdir.c
57
int fd;
regress/lib/libc/sys/t_mkdir.c
61
fd = open("/etc", O_RDONLY);
regress/lib/libc/sys/t_mkdir.c
63
if (fd >= 0) {
regress/lib/libc/sys/t_mkdir.c
65
(void)close(fd);
regress/lib/libc/sys/t_mkfifo.c
107
(void)close(fd);
regress/lib/libc/sys/t_mkfifo.c
162
int fd, sta;
regress/lib/libc/sys/t_mkfifo.c
167
fd = -1;
regress/lib/libc/sys/t_mkfifo.c
180
fd = open(path, O_RDONLY | O_NONBLOCK);
regress/lib/libc/sys/t_mkfifo.c
182
if (fd >= 0)
regress/lib/libc/sys/t_mkfifo.c
199
(void)close(fd);
regress/lib/libc/sys/t_mkfifo.c
76
int sta, fd = -1;
regress/lib/libc/sys/t_mkfifo.c
93
fd = open(path, O_RDONLY);
regress/lib/libc/sys/t_mknod.c
89
int fd;
regress/lib/libc/sys/t_mknod.c
91
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_mknod.c
93
if (fd >= 0) {
regress/lib/libc/sys/t_mknod.c
95
(void)close(fd);
regress/lib/libc/sys/t_mmap.c
173
int fd = -1;
regress/lib/libc/sys/t_mmap.c
198
if ((fd = open(dev, O_RDONLY)) >= 0) {
regress/lib/libc/sys/t_mmap.c
206
if (fd < 0)
regress/lib/libc/sys/t_mmap.c
209
map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0);
regress/lib/libc/sys/t_mmap.c
213
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_mmap.c
259
int fd;
regress/lib/libc/sys/t_mmap.c
261
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_mmap.c
262
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_mmap.c
265
(void)write(fd, buf, sizeof(buf));
regress/lib/libc/sys/t_mmap.c
268
MAP_FILE | MAP_PRIVATE, fd, 0);
regress/lib/libc/sys/t_mmap.c
280
MAP_FILE | MAP_SHARED, fd, 0);
regress/lib/libc/sys/t_mmap.c
283
MAP_FILE | MAP_SHARED, fd, 0);
regress/lib/libc/sys/t_mmap.c
308
int fd;
regress/lib/libc/sys/t_mmap.c
314
fd = open(path, O_WRONLY | O_CREAT, 0700);
regress/lib/libc/sys/t_mmap.c
316
if (fd < 0)
regress/lib/libc/sys/t_mmap.c
319
ATF_REQUIRE(write(fd, "XXX", 3) == 3);
regress/lib/libc/sys/t_mmap.c
321
map = mmap(NULL, 3, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
regress/lib/libc/sys/t_mmap.c
324
map = mmap(NULL, 3, PROT_WRITE, MAP_FILE|MAP_PRIVATE, fd, 0);
regress/lib/libc/sys/t_mmap.c
327
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_mmap.c
379
int fd, sta;
regress/lib/libc/sys/t_mmap.c
389
fd = open(path, O_RDWR | O_CREAT, 0700);
regress/lib/libc/sys/t_mmap.c
391
if (fd < 0)
regress/lib/libc/sys/t_mmap.c
394
ATF_REQUIRE(write(fd, "XXX", 3) == 3);
regress/lib/libc/sys/t_mmap.c
395
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_mmap.c
398
fd = open(path, O_RDONLY);
regress/lib/libc/sys/t_mmap.c
399
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_mmap.c
401
map = mmap(NULL, 3, PROT_NONE, MAP_FILE | MAP_SHARED, fd, 0);
regress/lib/libc/sys/t_mmap.c
435
int fd;
regress/lib/libc/sys/t_mmap.c
437
fd = open(path, O_RDWR | O_CREAT, 0700);
regress/lib/libc/sys/t_mmap.c
439
if (fd < 0)
regress/lib/libc/sys/t_mmap.c
446
ATF_REQUIRE(ftruncate(fd, page) == 0);
regress/lib/libc/sys/t_mmap.c
449
fd, 0);
regress/lib/libc/sys/t_mmap.c
455
ATF_REQUIRE(ftruncate(fd, 0) == 0);
regress/lib/libc/sys/t_mmap.c
456
ATF_REQUIRE(ftruncate(fd, page / 8) == 0);
regress/lib/libc/sys/t_mmap.c
457
ATF_REQUIRE(ftruncate(fd, page / 4) == 0);
regress/lib/libc/sys/t_mmap.c
458
ATF_REQUIRE(ftruncate(fd, page / 2) == 0);
regress/lib/libc/sys/t_mmap.c
459
ATF_REQUIRE(ftruncate(fd, page / 12) == 0);
regress/lib/libc/sys/t_mmap.c
460
ATF_REQUIRE(ftruncate(fd, page / 64) == 0);
regress/lib/libc/sys/t_mmap.c
463
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_mmap.c
482
int fd, sta;
regress/lib/libc/sys/t_mmap.c
485
fd = open(path, O_RDWR | O_CREAT, 0700);
regress/lib/libc/sys/t_mmap.c
487
if (fd < 0)
regress/lib/libc/sys/t_mmap.c
490
ATF_REQUIRE(write(fd, "foo\n", 5) == 5);
regress/lib/libc/sys/t_mmap.c
492
map = mmap(NULL, page, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
regress/lib/libc/sys/t_mmap.c
500
ATF_REQUIRE(ftruncate(fd, 0) == 0);
regress/lib/libc/sys/t_mmap.c
516
(void)close(fd);
regress/lib/libc/sys/t_mmap.c
527
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_msync.c
122
(void)close(fd);
regress/lib/libc/sys/t_msync.c
57
int fd, rv;
regress/lib/libc/sys/t_msync.c
70
fd = open(path, O_RDWR | O_CREAT, 0700);
regress/lib/libc/sys/t_msync.c
72
if (fd < 0) {
regress/lib/libc/sys/t_msync.c
77
ATF_REQUIRE_MSG(write(fd, buf, page) != -1, "write(2) failed: %s",
regress/lib/libc/sys/t_msync.c
81
fd, 0);
regress/lib/libc/sys/t_msync.c
92
if (lseek(fd, off, SEEK_SET) != off) {
regress/lib/libc/sys/t_msync.c
98
rv = write(fd, garbage, len);
regress/lib/libc/sys/t_pipe2.c
181
int fd[2];
regress/lib/libc/sys/t_pipe2.c
182
ATF_REQUIRE_ERRNO(EINVAL, pipe2(fd, O_ASYNC) == -1);
regress/lib/libc/sys/t_pipe2.c
52
int fd[2], i;
regress/lib/libc/sys/t_pipe2.c
60
ATF_REQUIRE(pipe2(fd, flags) == 0);
regress/lib/libc/sys/t_pipe2.c
62
ATF_REQUIRE(fd[0] == 3);
regress/lib/libc/sys/t_pipe2.c
63
ATF_REQUIRE(fd[1] == 4);
regress/lib/libc/sys/t_pipe2.c
66
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
regress/lib/libc/sys/t_pipe2.c
67
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
regress/lib/libc/sys/t_pipe2.c
69
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
regress/lib/libc/sys/t_pipe2.c
70
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
regress/lib/libc/sys/t_pipe2.c
74
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
regress/lib/libc/sys/t_pipe2.c
75
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
regress/lib/libc/sys/t_pipe2.c
77
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
regress/lib/libc/sys/t_pipe2.c
78
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
regress/lib/libc/sys/t_pipe2.c
84
ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0);
regress/lib/libc/sys/t_pipe2.c
85
ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0);
regress/lib/libc/sys/t_pipe2.c
87
ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) == 0);
regress/lib/libc/sys/t_pipe2.c
88
ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) == 0);
regress/lib/libc/sys/t_pipe2.c
92
ATF_REQUIRE(close(fd[0]) != -1);
regress/lib/libc/sys/t_pipe2.c
93
ATF_REQUIRE(close(fd[1]) != -1);
regress/lib/libc/sys/t_poll.c
167
pfds[0].fd = fds[0];
regress/lib/libc/sys/t_poll.c
169
pfds[1].fd = fds[1];
regress/lib/libc/sys/t_poll.c
227
int fd = 0;
regress/lib/libc/sys/t_poll.c
229
pfd.fd = fd;
regress/lib/libc/sys/t_poll.c
54
pfd.fd = desc;
regress/lib/libc/sys/t_poll.c
66
pfd.fd = desc;
regress/lib/libc/sys/t_poll.c
81
pfd.fd = desc;
regress/lib/libc/sys/t_pollts.c
132
int fd = 0;
regress/lib/libc/sys/t_pollts.c
134
pfd.fd = fd;
regress/lib/libc/sys/t_pollts.c
160
int fd;
regress/lib/libc/sys/t_pollts.c
166
fd = open(_PATH_DEVNULL, O_RDONLY);
regress/lib/libc/sys/t_pollts.c
167
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_pollts.c
169
pfd.fd = fd;
regress/lib/libc/sys/t_pollts.c
192
ATF_REQUIRE_EQ(close(fd), 0);
regress/lib/libc/sys/t_pollts.c
67
pfds[0].fd = fds[0];
regress/lib/libc/sys/t_pollts.c
69
pfds[1].fd = fds[1];
regress/lib/libc/sys/t_recvmmsg.c
131
cnt = recvmmsg(fd[1], mmsghdr, min(mmsgcnt, n),
regress/lib/libc/sys/t_recvmmsg.c
169
error = send(fd[0], DGRAM, sizeof(DGRAM), 0);
regress/lib/libc/sys/t_recvmmsg.c
78
int fd[2], error, i, cnt;
regress/lib/libc/sys/t_recvmmsg.c
89
error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
regress/lib/libc/sys/t_revoke.c
138
int fd, sta;
regress/lib/libc/sys/t_revoke.c
142
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_revoke.c
144
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_revoke.c
164
if (close(fd) != 0)
regress/lib/libc/sys/t_revoke.c
175
(void)close(fd);
regress/lib/libc/sys/t_select.c
101
int fd;
regress/lib/libc/sys/t_select.c
105
if ((fd = open("/dev/null", O_RDONLY)) == -1)
regress/lib/libc/sys/t_select.c
123
FD_SET(fd, &rset);
regress/lib/libc/sys/t_sendmmsg.c
100
setsock(fd[1], SO_SNDBUF);
regress/lib/libc/sys/t_sendmmsg.c
150
ATF_REQUIRE(ioctl(fd[1], FIONSPACE, &a) != -1);
regress/lib/libc/sys/t_sendmmsg.c
152
ATF_REQUIRE(ioctl(fd[0], FIONSPACE, &a) != -1);
regress/lib/libc/sys/t_sendmmsg.c
156
cnt = sendmmsg(fd[1], mmsghdr + n, npkt, 0);
regress/lib/libc/sys/t_sendmmsg.c
190
cnt = recv(fd[0], rgram, sizeof(rgram), 0);
regress/lib/libc/sys/t_sendmmsg.c
70
setsock(int fd, int type)
regress/lib/libc/sys/t_sendmmsg.c
75
ATF_REQUIRE_MSG(setsockopt(fd, SOL_SOCKET, type,
regress/lib/libc/sys/t_sendmmsg.c
82
int fd[2], error, cnt;
regress/lib/libc/sys/t_sendmmsg.c
94
error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
regress/lib/libc/sys/t_sendrecv.c
115
int fd[2], sd[2], error;
regress/lib/libc/sys/t_sendrecv.c
121
error = pipe(fd);
regress/lib/libc/sys/t_sendrecv.c
146
read(fd[1], &c, sizeof(c));
regress/lib/libc/sys/t_sendrecv.c
152
write(fd[0], &c, sizeof(c));
regress/lib/libc/sys/t_setrlimit.c
190
int fd, sta;
regress/lib/libc/sys/t_setrlimit.c
193
fd = open(path, O_RDWR | O_CREAT, 0700);
regress/lib/libc/sys/t_setrlimit.c
195
if (fd < 0)
regress/lib/libc/sys/t_setrlimit.c
215
(void)write(fd, "X", 1);
regress/lib/libc/sys/t_setrlimit.c
216
(void)write(fd, "X", 1);
regress/lib/libc/sys/t_setrlimit.c
217
(void)write(fd, "X", 1);
regress/lib/libc/sys/t_setrlimit.c
222
(void)close(fd);
regress/lib/libc/sys/t_setrlimit.c
311
int fd, i, rv, sta;
regress/lib/libc/sys/t_setrlimit.c
336
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_setrlimit.c
338
if (fd >= 0 || errno != EMFILE)
regress/lib/libc/sys/t_setrlimit.c
360
int fd, i, rv, sta;
regress/lib/libc/sys/t_setrlimit.c
385
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_setrlimit.c
387
if (fd < 0)
regress/lib/libc/sys/t_setrlimit.c
395
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_setrlimit.c
397
if (fd >= 0 || errno != EMFILE)
regress/lib/libc/sys/t_socketpair.c
51
connected(int fd)
regress/lib/libc/sys/t_socketpair.c
55
ATF_REQUIRE(getpeername(fd, (struct sockaddr*)(void *)&addr,
regress/lib/libc/sys/t_socketpair.c
62
int fd[2], i;
regress/lib/libc/sys/t_socketpair.c
69
ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);
regress/lib/libc/sys/t_socketpair.c
71
ATF_REQUIRE(fd[0] == 3);
regress/lib/libc/sys/t_socketpair.c
72
ATF_REQUIRE(fd[1] == 4);
regress/lib/libc/sys/t_socketpair.c
74
connected(fd[0]);
regress/lib/libc/sys/t_socketpair.c
75
connected(fd[1]);
regress/lib/libc/sys/t_socketpair.c
78
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
regress/lib/libc/sys/t_socketpair.c
79
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
regress/lib/libc/sys/t_socketpair.c
81
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
regress/lib/libc/sys/t_socketpair.c
82
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
regress/lib/libc/sys/t_socketpair.c
86
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
regress/lib/libc/sys/t_socketpair.c
87
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
regress/lib/libc/sys/t_socketpair.c
89
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
regress/lib/libc/sys/t_socketpair.c
90
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
regress/lib/libc/sys/t_socketpair.c
93
ATF_REQUIRE(close(fd[0]) != -1);
regress/lib/libc/sys/t_socketpair.c
94
ATF_REQUIRE(close(fd[1]) != -1);
regress/lib/libc/sys/t_stat.c
206
int fd[3];
regress/lib/libc/sys/t_stat.c
209
for (i = 0; i < __arraycount(fd); i++) {
regress/lib/libc/sys/t_stat.c
214
fd[i] = open(path, O_WRONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_stat.c
216
ATF_REQUIRE(fd[i] != -1);
regress/lib/libc/sys/t_stat.c
217
ATF_REQUIRE(write(fd[i], "X", 1) == 1);
regress/lib/libc/sys/t_stat.c
222
ATF_REQUIRE(write(fd[i], "X", 1) == 1);
regress/lib/libc/sys/t_stat.c
225
ATF_REQUIRE(close(fd[i]) == 0);
regress/lib/libc/sys/t_stat.c
250
int fd;
regress/lib/libc/sys/t_stat.c
258
fd = open(path, O_RDONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_stat.c
260
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_stat.c
261
ATF_REQUIRE(fstat(fd, &sa) == 0);
regress/lib/libc/sys/t_stat.c
270
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_stat.c
290
int fd;
regress/lib/libc/sys/t_stat.c
292
fd = open(path, O_WRONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_stat.c
293
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_stat.c
301
ATF_REQUIRE(fstat(fd, &sa) == 0);
regress/lib/libc/sys/t_stat.c
302
ATF_REQUIRE(write(fd, "X", 1) == 1);
regress/lib/libc/sys/t_stat.c
303
ATF_REQUIRE(fstat(fd, &sb) == 0);
regress/lib/libc/sys/t_stat.c
313
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_stat.c
334
int fd, flags;
regress/lib/libc/sys/t_stat.c
339
fd = socket(AF_INET, SOCK_STREAM, 0);
regress/lib/libc/sys/t_stat.c
340
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_stat.c
342
flags = fcntl(fd, F_GETFL);
regress/lib/libc/sys/t_stat.c
345
ATF_REQUIRE(fcntl(fd, F_SETFL, flags | O_NONBLOCK) != -1);
regress/lib/libc/sys/t_stat.c
355
connect(fd, (struct sockaddr *)&addr,
regress/lib/libc/sys/t_stat.c
360
if (fstat(fd, &st) != 0 || errno != 0)
regress/lib/libc/sys/t_stat.c
363
(void)close(fd);
regress/lib/libc/sys/t_stat.c
376
int fd;
regress/lib/libc/sys/t_stat.c
381
fd = open(path, O_WRONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_stat.c
383
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_stat.c
397
(void)close(fd);
regress/lib/libc/sys/t_stat.c
63
int fd;
regress/lib/libc/sys/t_stat.c
68
fd = open(path, O_RDONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_stat.c
70
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_stat.c
78
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_truncate.c
103
ATF_REQUIRE_ERRNO(EINVAL, ftruncate(fd, 999) == -1);
regress/lib/libc/sys/t_truncate.c
105
(void)close(fd);
regress/lib/libc/sys/t_truncate.c
118
int fd;
regress/lib/libc/sys/t_truncate.c
120
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_truncate.c
121
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_truncate.c
128
ATF_REQUIRE(fstat(fd, &st) == 0);
regress/lib/libc/sys/t_truncate.c
136
(void)close(fd);
regress/lib/libc/sys/t_truncate.c
58
int fd;
regress/lib/libc/sys/t_truncate.c
60
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_truncate.c
61
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_truncate.c
67
ATF_REQUIRE(ftruncate(fd, sizes[i]) == 0);
regress/lib/libc/sys/t_truncate.c
68
ATF_REQUIRE(fstat(fd, &st) == 0);
regress/lib/libc/sys/t_truncate.c
76
(void)close(fd);
regress/lib/libc/sys/t_truncate.c
94
int fd;
regress/lib/libc/sys/t_truncate.c
96
fd = open("/etc/passwd", O_RDONLY);
regress/lib/libc/sys/t_truncate.c
97
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_umask.c
122
int fd;
regress/lib/libc/sys/t_umask.c
128
fd = open(path, O_RDWR | O_CREAT, 0777);
regress/lib/libc/sys/t_umask.c
130
if (fd < 0)
regress/lib/libc/sys/t_umask.c
133
(void)close(fd);
regress/lib/libc/sys/t_unlink.c
56
int fd;
regress/lib/libc/sys/t_unlink.c
60
fd = open(path, O_RDWR | O_CREAT, 0666);
regress/lib/libc/sys/t_unlink.c
62
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_unlink.c
63
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_write.c
142
int fd;
regress/lib/libc/sys/t_write.c
144
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_write.c
145
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_write.c
148
ATF_REQUIRE(write(fd, "x", 1) == 1);
regress/lib/libc/sys/t_write.c
149
ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == (off_t)(i + 1));
regress/lib/libc/sys/t_write.c
152
ATF_REQUIRE(close(fd) == 0);
regress/lib/libc/sys/t_write.c
172
int fd;
regress/lib/libc/sys/t_write.c
174
fd = open(path, O_WRONLY | O_CREAT, 0600);
regress/lib/libc/sys/t_write.c
175
ATF_REQUIRE(fd >= 0);
regress/lib/libc/sys/t_write.c
180
j += write(fd, buf, sizeof(buf));
regress/lib/libc/sys/t_write.c
185
(void)close(fd);
regress/lib/libc/sys/t_write.c
228
int fd[2];
regress/lib/libc/sys/t_write.c
229
ATF_REQUIRE(pipe(fd) != -1);
regress/lib/libc/sys/t_write.c
235
ssize_t retval = write(fd[1], map, SIZE);
regress/lib/libc/sys/t_write.c
241
close(fd[0]);
regress/lib/libc/sys/t_write.c
242
close(fd[1]);
regress/lib/libc/sys/t_write.c
255
int fd = open(_PATH_DEVZERO, O_RDONLY);
regress/lib/libc/sys/t_write.c
256
ATF_REQUIRE(fd != -1);
regress/lib/libc/sys/t_write.c
261
ssize_t retval = read(fd, map, SIZE);
regress/lib/libc/sys/t_write.c
267
close(fd);
regress/lib/libc/sys/t_write.c
67
int fd;
regress/lib/libc/sys/t_write.c
72
fd = open(path, O_RDWR | O_CREAT, 0600);
regress/lib/libc/sys/t_write.c
74
if (fd >= 0) {
regress/lib/libc/sys/t_write.c
77
ATF_REQUIRE_ERRNO(0, write(fd, wbuf, 3) == 3);
regress/lib/libc/sys/t_write.c
80
ATF_REQUIRE_ERRNO(EINVAL, write(fd, wbuf, SIZE_MAX) == -1);
regress/lib/libc/sys/t_write.c
83
ATF_REQUIRE_ERRNO(EFAULT, write(fd, (void *)-1, 1) == -1);
regress/lib/libc/sys/t_write.c
89
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
regress/lib/libc/sys/t_write.c
90
ATF_REQUIRE(read(fd, rbuf, 3) == 3);
regress/lib/libc/sys/t_write.c
93
(void)close(fd);
regress/lib/libc/telldir/utils.c
20
int i, fd;
regress/lib/libc/telldir/utils.c
26
if ((fd = open(file, O_CREAT | O_WRONLY, 0600)) == -1)
regress/lib/libc/telldir/utils.c
28
close(fd);
regress/lib/libevent/event_regress.c
103
len = read(fd, buf, sizeof(buf));
regress/lib/libevent/event_regress.c
117
simple_write_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
124
len = write(fd, TEST1, strlen(TEST1) + 1);
regress/lib/libevent/event_regress.c
132
multiple_write_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
1408
test_priorities_cb(int fd, short what, void *arg)
regress/lib/libevent/event_regress.c
141
len = write(fd, wbuf + woff, len);
regress/lib/libevent/event_regress.c
1479
test_multiple_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
1511
read_once_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
1516
len = read(fd, buf, sizeof(buf));
regress/lib/libevent/event_regress.c
152
shutdown(fd, SHUT_WR);
regress/lib/libevent/event_regress.c
165
multiple_read_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
170
len = read(fd, rbuf + roff, sizeof(rbuf) - roff);
regress/lib/libevent/event_regress.c
187
timeout_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
214
signal_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
229
combined_read_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
235
len = read(fd, buf, sizeof(buf));
regress/lib/libevent/event_regress.c
247
combined_write_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
257
len = write(fd, buf, len);
regress/lib/libevent/event_regress.c
261
shutdown(fd, SHUT_WR);
regress/lib/libevent/event_regress.c
517
child_signal_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
838
timeout_cb_swp(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
90
#define write(fd,buf,len) send((fd),(buf),(len),0)
regress/lib/libevent/event_regress.c
91
#define read(fd,buf,len) recv((fd),(buf),(len),0)
regress/lib/libevent/event_regress.c
95
simple_read_cb(int fd, short event, void *arg)
regress/lib/libevent/event_regress.c
971
break_cb(int fd, short events, void *arg)
regress/lib/libevent/event_regress.c
978
fail_cb(int fd, short events, void *arg)
regress/lib/libevent/test-eof.c
37
read_cb(int fd, short event, void *arg)
regress/lib/libevent/test-eof.c
42
len = recv(fd, buf, sizeof(buf), 0);
regress/lib/libevent/test-time.c
46
time_cb(int fd, short event, void *arg)
regress/lib/libevent/test-weof.c
39
write_cb(int fd, short event, void *arg)
regress/lib/libevent/test-weof.c
44
len = send(fd, test, strlen(test) + 1, 0);
regress/lib/libpthread/blocked_close/blocked_close.c
46
int fd = *(int *)arg;
regress/lib/libpthread/blocked_close/blocked_close.c
51
n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len);
regress/lib/libpthread/blocked_close/blocked_close.c
65
int fd, i, j;
regress/lib/libpthread/blocked_close/blocked_close.c
81
CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
regress/lib/libpthread/blocked_close/blocked_close.c
82
CHECKr(bind(fd, (struct sockaddr *)&addr, sizeof(addr)));
regress/lib/libpthread/blocked_close/blocked_close.c
85
waiting_read, (void *)&fd));
regress/lib/libpthread/blocked_close/blocked_close.c
87
CHECKr(close(fd));
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
46
int fd = *(int *)arg;
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
51
n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len);
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
65
int fd, newfd, i, j;
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
80
CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
81
CHECKr(bind(fd, (struct sockaddr *)&addr, sizeof(addr)));
regress/lib/libpthread/blocked_dup2/blocked_dup2.c
91
CHECKe(dup2(fd, newfd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
110
CHECKe(fd = open(FIFO, O_RDONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
112
CHECKe(fstat(fd, &st));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
114
CHECKe(rlen = read(fd, buf, sizeof buf));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
119
CHECKe(close(fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
133
CHECKe(fd = open(FIFO, O_RDONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
135
ASSERT(fd == expected_fd);
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
136
ASSERT(close(fd) == -1);
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
49
int fd;
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
55
CHECKe(fd = open(FILE, O_RDONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
56
CHECKe(close(fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
59
CHECKe(fd = open(FIFO, O_WRONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
60
CHECKe(write(fd, "test", 4));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
61
CHECKe(close(fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
69
int fd;
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
75
CHECKe(fd = open(FILE, O_RDONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
76
CHECKe(dup2(fd, expected_fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
77
CHECKe(close(fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
81
CHECKe(fd = open(FIFO, O_WRONLY));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
82
CHECKe(write(fd, "test", 4));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
83
CHECKe(close(fd));
regress/lib/libpthread/blocked_fifo/blocked_fifo.c
94
int fd;
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
46
int fd = *(int *)arg;
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
51
n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len);
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
65
int fd, i, j;
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
80
CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
82
CHECKr(bind(fd, (struct sockaddr *)&addr, sizeof(addr)));
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
85
waiting_read, (void *)&fd));
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
87
CHECKr(shutdown(fd, SHUT_RDWR));
regress/lib/libpthread/blocked_shutdown/blocked_shutdown.c
92
CHECKr(close(fd));
regress/lib/libpthread/cancel/cancel.c
53
int fd, dummy;
regress/lib/libpthread/cancel/cancel.c
60
CHECKe(openpty(&dummy, &fd, NULL, NULL, NULL));
regress/lib/libpthread/cancel/cancel.c
61
pthread_cleanup_push(c1handler, (void *)&fd);
regress/lib/libpthread/cancel/cancel.c
64
CHECKe(len = read(fd, &buf, sizeof buf));
regress/lib/libpthread/cancel2/cancel2.c
54
pfd.fd = read_fd;
regress/lib/libpthread/cancel2/cancel2.c
70
pfd.fd = read_fd;
regress/lib/libpthread/close/close.c
105
FD_SET(fd, &r);
regress/lib/libpthread/close/close.c
107
printf("child: writing some garbage to fd %d\n", fd);
regress/lib/libpthread/close/close.c
108
CHECKe(write(fd, garbage, sizeof garbage));
regress/lib/libpthread/close/close.c
109
printf("child: calling select() with fd %d\n", fd);
regress/lib/libpthread/close/close.c
110
ASSERT((ret = select(fd + 1, &r, NULL, NULL, NULL)) == -1);
regress/lib/libpthread/close/close.c
142
CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0));
regress/lib/libpthread/close/close.c
143
printf("main: connecting to test port with fd %d\n", fd);
regress/lib/libpthread/close/close.c
144
ret = connect(fd, (struct sockaddr *)&addr, sizeof addr);
regress/lib/libpthread/close/close.c
148
printf("main: connected on fd %d\n", fd);
regress/lib/libpthread/close/close.c
155
printf("main: closing fd %d\n", fd);
regress/lib/libpthread/close/close.c
156
CHECKe(close(fd));
regress/lib/libpthread/close/close.c
52
int fd;
regress/lib/libpthread/close_race/close_race.c
43
int fd = *(int *)arg;
regress/lib/libpthread/close_race/close_race.c
46
while(fcntl(fd, F_GETFD, NULL) != -1);
regress/lib/libpthread/close_race/close_race.c
55
int fd, i, j;
regress/lib/libpthread/close_race/close_race.c
66
CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
regress/lib/libpthread/close_race/close_race.c
69
busy_thread, (void *)&fd));
regress/lib/libpthread/close_race/close_race.c
71
CHECKr(close(fd));
regress/lib/libpthread/closefrom/closefrom.c
27
int fd;
regress/lib/libpthread/closefrom/closefrom.c
31
fd = STDERR_FILENO + 1;
regress/lib/libpthread/closefrom/closefrom.c
32
result = closefrom(fd);
regress/lib/libpthread/closefrom/closefrom.c
33
printf("closefrom(%d) == %d/%d\n", fd, result, errno);
regress/lib/libpthread/closefrom/closefrom.c
36
result = closefrom(fd);
regress/lib/libpthread/closefrom/closefrom.c
37
printf("closefrom(%d) == %d/%d\n", fd, result, errno);
regress/lib/libpthread/dlopen/dlopen.c
260
pfd.fd = 0;
regress/lib/libpthread/dup2_race/dup2_race.c
43
int fd = *(int *)arg;
regress/lib/libpthread/dup2_race/dup2_race.c
46
while(fcntl(fd, F_GETFD, NULL) != -1);
regress/lib/libpthread/dup2_race/dup2_race.c
55
int fd, newfd, i, j;
regress/lib/libpthread/dup2_race/dup2_race.c
65
CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
regress/lib/libpthread/dup2_race/dup2_race.c
73
CHECKe(dup2(fd, newfd));
regress/lib/libpthread/execve/execve.c
73
int fd;
regress/lib/libpthread/execve/execve.c
82
CHECKe(fd = open(ttynm, O_RDWR));
regress/lib/libpthread/execve/execve.c
94
CHECKe(dup2(fd, STDOUT_FILENO));
regress/lib/libpthread/include/test.h
29
#define _thread_sys_write(fd,buf,len) write(fd,buf,len)
regress/lib/libpthread/poll/poll.c
110
p[0].fd = tube[0];
regress/lib/libpthread/poll/poll.c
112
p[1].fd = tube[1];
regress/lib/libpthread/poll/poll.c
124
p[0].fd = tube[0];
regress/lib/libpthread/poll/poll.c
21
p->fd,
regress/lib/libpthread/poll/poll.c
36
int fd = *(int *)arg;
regress/lib/libpthread/poll/poll.c
39
ASSERTe(write(fd, &msg, sizeof msg), == sizeof msg);
regress/lib/libpthread/poll/poll.c
46
int fd = *(int *)arg;
regress/lib/libpthread/poll/poll.c
49
ASSERTe(read(fd, &buf, sizeof buf), == sizeof buf);
regress/lib/libpthread/poll/poll.c
70
p[0].fd = zero;
regress/lib/libpthread/poll/poll.c
73
p[1].fd = null;
regress/lib/libpthread/poll/poll.c
90
p[0].fd = zero;
regress/lib/libpthread/poll/poll.c
92
p[1].fd = null;
regress/lib/libpthread/select/select.c
101
FD_SET(fd, &r);
regress/lib/libpthread/select/select.c
102
maxfd = fd;
regress/lib/libpthread/select/select.c
110
while ((nb = read(fd, buf, sizeof(buf) - 1)) > 0) {
regress/lib/libpthread/select/select.c
79
int fd = fileno((FILE *) arg);
regress/lib/libpthread/select/select.c
80
int tty = isatty(fd);
regress/lib/libpthread/select/select.c
88
flags = fcntl(fd, F_GETFL);
regress/lib/libpthread/select/select.c
89
CHECKr(fcntl(fd, F_SETFL, flags | O_NONBLOCK));
regress/lib/libpthread/sleep/sleep.c
51
int fd = 1;
regress/lib/libpthread/sleep/sleep.c
59
write(fd, buf + (long) arg, 1);
regress/lib/libpthread/socket/1/socket1.c
108
int fd = *(int *)arg;
regress/lib/libpthread/socket/1/socket1.c
110
CHECKe(write(fd, "5", 1));
regress/lib/libpthread/socket/1/socket1.c
119
int a_sin_size, a_fd, fd;
regress/lib/libpthread/socket/1/socket1.c
147
CHECKe(fd = accept(a_fd, &a_sin, &a_sin_size));
regress/lib/libpthread/socket/1/socket1.c
149
CHECKe(close(fd));
regress/lib/libpthread/socket/1/socket1.c
154
CHECKe(fd = accept(a_fd, &a_sin, &a_sin_size));
regress/lib/libpthread/socket/1/socket1.c
158
CHECKr(pthread_create(&thread, &attr, sock_write, &fd));
regress/lib/libpthread/socket/1/socket1.c
160
CHECKe(read(fd, buf, 1024));
regress/lib/libpthread/socket/1/socket1.c
164
CHECKe(close(fd));
regress/lib/libpthread/socket/1/socket1.c
67
int fd;
regress/lib/libpthread/socket/1/socket1.c
73
CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0));
regress/lib/libpthread/socket/1/socket1.c
78
CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)));
regress/lib/libpthread/socket/1/socket1.c
79
CHECKe(close(fd));
regress/lib/libpthread/socket/1/socket1.c
81
CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0));
regress/lib/libpthread/socket/1/socket1.c
85
CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)));
regress/lib/libpthread/socket/1/socket1.c
93
CHECKe(read(fd, buf, 1024));
regress/lib/libpthread/socket/1/socket1.c
96
write(fd, "6", 1);
regress/lib/libpthread/socket/1/socket1.c
98
CHECKe(close(fd));
regress/lib/libpthread/socket/2/socket2.c
142
CHECKe(fd = accept(a_fd, &a_sin, &a_sin_size));
regress/lib/libpthread/socket/2/socket2.c
143
CHECKe(close(fd));
regress/lib/libpthread/socket/2/socket2.c
151
CHECKe(fd = accept(a_fd, &a_sin, &a_sin_size));
regress/lib/libpthread/socket/2/socket2.c
155
CHECKr(pthread_create(&thread, NULL, sock_write, &fd));
regress/lib/libpthread/socket/2/socket2.c
156
CHECKe(read(fd, buf, 1024));
regress/lib/libpthread/socket/2/socket2.c
160
CHECKe(close(fd));
regress/lib/libpthread/socket/2/socket2.c
65
int fd = *(int *)arg;
regress/lib/libpthread/socket/2/socket2.c
68
CHECKe(write(fd, MESSAGE5, sizeof(MESSAGE5)));
regress/lib/libpthread/socket/2/socket2.c
96
int a_sin_size, a_fd, fd;
regress/lib/libpthread/socket/2a/socket2a.c
64
int fd;
regress/lib/libpthread/socket/2a/socket2a.c
72
CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0));
regress/lib/libpthread/socket/2a/socket2a.c
76
CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)));
regress/lib/libpthread/socket/2a/socket2a.c
77
CHECKe(close(fd));
regress/lib/libpthread/socket/2a/socket2a.c
79
CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0));
regress/lib/libpthread/socket/2a/socket2a.c
83
CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)));
regress/lib/libpthread/socket/2a/socket2a.c
87
CHECKe(read(fd, buf, 1024));
regress/lib/libpthread/socket/2a/socket2a.c
88
CHECKe(write(fd, MESSAGE6, sizeof(MESSAGE6)));
regress/lib/libpthread/socket/2a/socket2a.c
92
CHECKe(close(fd));
regress/lib/libpthread/socket/3/socket3.c
89
fds.fd = listen_fd;
regress/lib/libsndio/fd/fd.c
48
buf_read(struct buf *buf, int fd)
regress/lib/libsndio/fd/fd.c
63
n = read(fd, buf->data + end, count);
regress/lib/libsndio/fd/fd.c
80
buf_write(struct buf *buf, int fd)
regress/lib/libsndio/fd/fd.c
89
n = write(fd, buf->data + buf->start, count);
regress/lib/libsndio/vol/vol.c
118
pfd[0].fd = tty;
regress/lib/libssl/dtls/dtlstest.c
992
pfd[0].fd = client_sock;
regress/lib/libssl/dtls/dtlstest.c
994
pfd[1].fd = server_sock;
regress/lib/libssl/interop/util.c
111
int fd;
regress/lib/libssl/interop/util.c
113
if (BIO_get_fd(bio, &fd) <= 0)
regress/lib/libssl/interop/util.c
116
if (getpeername(fd, (struct sockaddr *)&ss, &slen) == -1)
regress/lib/libssl/interop/util.c
90
int fd;
regress/lib/libssl/interop/util.c
92
if (BIO_get_fd(bio, &fd) <= 0)
regress/lib/libssl/interop/util.c
95
if (getsockname(fd, (struct sockaddr *)&ss, &slen) == -1)
regress/lib/libtls/keypair/keypairtest.c
43
int fd;
regress/lib/libtls/keypair/keypairtest.c
45
if ((fd = open(filename, O_RDONLY)) == -1)
regress/lib/libtls/keypair/keypairtest.c
47
if ((fstat(fd, &sb)) == -1)
regress/lib/libtls/keypair/keypairtest.c
54
n = read(fd, buf, len);
regress/lib/libtls/keypair/keypairtest.c
57
close(fd);
regress/lib/libtls/signer/signertest.c
63
int fd;
regress/lib/libtls/signer/signertest.c
67
if ((fd = open(filepath, O_RDONLY)) == -1)
regress/lib/libtls/signer/signertest.c
69
if ((fstat(fd, &sb)) == -1)
regress/lib/libtls/signer/signertest.c
76
n = read(fd, buf, len);
regress/lib/libtls/signer/signertest.c
79
close(fd);
regress/lib/libz/minigzip.c
170
static gzFile gz_open(const char *path, int fd, const char *mode) {
regress/lib/libz/minigzip.c
192
gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
regress/lib/libz/minigzip.c
208
static gzFile gzdopen(int fd, const char *mode) {
regress/lib/libz/minigzip.c
209
return gz_open(NULL, fd, mode);
regress/sbin/isakmpd/x509/x509test.c
72
int fd;
regress/sbin/isakmpd/x509/x509test.c
79
fd = open (name, O_RDONLY);
regress/sbin/isakmpd/x509/x509test.c
80
if (fd == -1)
regress/sbin/isakmpd/x509/x509test.c
83
fd, 0);
regress/sbin/isakmpd/x509/x509test.c
86
"%d, 0)", file_sz, fd);
regress/sbin/isakmpd/x509/x509test.c
87
close (fd);
regress/sys/arch/amd64/seves_mmio/seves_mmio.c
48
int fd;
regress/sys/arch/amd64/seves_mmio/seves_mmio.c
58
fd = open("/dev/xf86", O_RDWR);
regress/sys/arch/amd64/seves_mmio/seves_mmio.c
59
if (fd == -1)
regress/sys/arch/amd64/seves_mmio/seves_mmio.c
62
p = mmap(NULL, sizeof(v), PROT_READ, 0, fd, PCI_MMIO_BAR_BASE);
regress/sys/arch/amd64/vmm/vcpu.c
102
fd = open(VMM_NODE, O_RDWR);
regress/sys/arch/amd64/vmm/vcpu.c
103
if (fd == -1)
regress/sys/arch/amd64/vmm/vcpu.c
121
if (ioctl(fd, VMM_IOC_CREATE, &vcp) == -1)
regress/sys/arch/amd64/vmm/vcpu.c
135
if (ioctl(fd, VMM_IOC_SHAREMEM, &vsp) == -1)
regress/sys/arch/amd64/vmm/vcpu.c
208
if (ioctl(fd, VMM_IOC_INFO, &vip) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
226
if (ioctl(fd, VMM_IOC_INFO, &vip) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
263
if (ioctl(fd, VMM_IOC_RESETCPU, &vresetp) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
285
if (ioctl(fd, VMM_IOC_RUN, &vrunp) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
336
if (ioctl(fd, VMM_IOC_RUN, &vrunp) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
391
if (ioctl(fd, VMM_IOC_TERM, &vtp) == -1) {
regress/sys/arch/amd64/vmm/vcpu.c
397
close(fd);
regress/sys/arch/amd64/vmm/vcpu.c
97
int fd, ret = 1;
regress/sys/dev/fdesc/confuse.c
18
int fd, newfd;
regress/sys/dev/fdesc/confuse.c
20
if ((fd = open("/dev/null", O_RDONLY)) < 0)
regress/sys/dev/fdesc/confuse.c
24
close(fd);
regress/sys/dev/fdesc/confuse.c
26
snprintf(fname, sizeof(fname), "/dev/fd/%d", fd);
regress/sys/dev/fdesc/confuse.c
28
if ((newfd = open(fname, O_RDONLY)) == fd)
regress/sys/dev/fdesc/confuse.c
29
errx(1, "open of %s to %d succeeded, beware.", fname, fd);
regress/sys/dev/fdesc/confuse.c
32
errx(1, "open(%s) gave us the unexpected %d", fname, fd);
regress/sys/dev/kcov/kcov.c
254
int fd;
regress/sys/dev/kcov/kcov.c
256
fd = open("/dev/kcov", O_RDWR);
regress/sys/dev/kcov/kcov.c
257
if (fd == -1)
regress/sys/dev/kcov/kcov.c
259
return fd;
regress/sys/dev/kcov/kcov.c
263
kcov_enable(int fd, int mode)
regress/sys/dev/kcov/kcov.c
265
if (ioctl(fd, KIOENABLE, &mode) == -1)
regress/sys/dev/kcov/kcov.c
270
kcov_disable(int fd)
regress/sys/dev/kcov/kcov.c
272
if (ioctl(fd, KIODISABLE) == -1)
regress/sys/dev/kcov/kcov.c
282
int fd;
regress/sys/dev/kcov/kcov.c
284
fd = kcov_open();
regress/sys/dev/kcov/kcov.c
285
close(fd);
regress/sys/dev/kcov/kcov.c
450
int fd;
regress/sys/dev/kcov/kcov.c
453
fd = kcov_open();
regress/sys/dev/kcov/kcov.c
454
if (ioctl(fd, KIOSETBUFSIZE, &ctx->c_bufsize) == -1)
regress/sys/dev/kcov/kcov.c
457
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
regress/sys/dev/kcov/kcov.c
461
kcov_enable(fd, ctx->c_mode);
regress/sys/dev/kcov/kcov.c
463
kcov_disable(fd);
regress/sys/dev/kcov/kcov.c
469
close(fd);
regress/sys/dev/video/videotest.c
110
int i, fd, r;
regress/sys/dev/video/videotest.c
120
fd = open(dev_full, O_RDWR);
regress/sys/dev/video/videotest.c
121
if (fd == -1) {
regress/sys/dev/video/videotest.c
127
r = test_ioctl_querycap(fd);
regress/sys/dev/video/videotest.c
131
r = test_ioctl_g_fmt(fd);
regress/sys/dev/video/videotest.c
135
r = test_ioctl_enum_fmt(fd);
regress/sys/dev/video/videotest.c
140
close(fd);
regress/sys/dev/video/videotest.c
164
test_ioctl_querycap(int fd)
regress/sys/dev/video/videotest.c
172
r = ioctl(fd, VIDIOC_QUERYCAP, &caps);
regress/sys/dev/video/videotest.c
195
test_ioctl_g_fmt(int fd)
regress/sys/dev/video/videotest.c
204
r = ioctl(fd, VIDIOC_G_FMT, &fmt);
regress/sys/dev/video/videotest.c
220
test_ioctl_enum_fmt(int fd)
regress/sys/dev/video/videotest.c
230
while ((r = ioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc)) == 0) {
regress/sys/dev/video/videotest.c
233
(void)test_ioctl_enum_fsizes(fd, fmtdesc.pixelformat,
regress/sys/dev/video/videotest.c
245
test_ioctl_enum_fsizes(int fd, uint32_t pixelformat, int index)
regress/sys/dev/video/videotest.c
255
while ((r = ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &fsizes)) == 0) {
regress/sys/dev/video/videotest.c
434
test_capture_read(int fd, char *buf, int buf_size, int use_poll)
regress/sys/dev/video/videotest.c
453
pfds[0].fd = fd;
regress/sys/dev/video/videotest.c
466
n1 = read(fd, buf, buf_size);
regress/sys/dev/video/videotest.c
476
test_capture_mmap(int fd, char *buf, int buf_size, int use_poll)
regress/sys/dev/video/videotest.c
489
r = ioctl(fd, VIDIOC_REQBUFS, &reqbufs);
regress/sys/dev/video/videotest.c
499
r = ioctl(fd, VIDIOC_QUERYBUF, &buffer);
regress/sys/dev/video/videotest.c
504
mmap(0, buffer.length, PROT_READ, MAP_SHARED, fd,
regress/sys/dev/video/videotest.c
517
r = ioctl(fd, VIDIOC_QBUF, &buffer);
regress/sys/dev/video/videotest.c
524
r = ioctl(fd, VIDIOC_STREAMON, &type);
regress/sys/dev/video/videotest.c
533
pfds[0].fd = fd;
regress/sys/dev/video/videotest.c
549
r = ioctl(fd, VIDIOC_DQBUF, &buffer);
regress/sys/dev/video/videotest.c
558
r = ioctl(fd, VIDIOC_STREAMOFF, &type);
regress/sys/dev/wscons/sigio.c
111
if (ioctl(fd, FIOSETOWN, &arg) == -1)
regress/sys/dev/wscons/sigio.c
116
if (ioctl(fd, FIOASYNC, &arg) == -1)
regress/sys/dev/wscons/sigio.c
130
if (ioctl(fd, WSMUXIO_INJECTEVENT, &ev) == -1)
regress/sys/dev/wscons/sigio.c
158
n = read(fd, &ev, len);
regress/sys/dev/wscons/sigio.c
166
if (ioctl(fd, FIOASYNC, &arg) == -1)
regress/sys/dev/wscons/sigio.c
173
test_spgrp(int fd)
regress/sys/dev/wscons/sigio.c
179
if (ioctl(fd, TIOCSPGRP, &arg) == -1)
regress/sys/dev/wscons/sigio.c
184
if (ioctl(fd, TIOCSPGRP, &arg) != -1)
regress/sys/dev/wscons/sigio.c
187
if (ioctl(fd, TIOCSPGRP, &arg) != -1)
regress/sys/dev/wscons/sigio.c
194
test_common_getown(int fd, int dofcntl)
regress/sys/dev/wscons/sigio.c
199
pgrp = fcntl(fd, F_GETOWN);
regress/sys/dev/wscons/sigio.c
205
if (ioctl(fd, FIOGETOWN, &pgrp) == -1)
regress/sys/dev/wscons/sigio.c
212
if (ioctl(fd, FIOSETOWN, &arg) == -1)
regress/sys/dev/wscons/sigio.c
215
pgrp = fcntl(fd, F_GETOWN);
regress/sys/dev/wscons/sigio.c
222
if (ioctl(fd, FIOGETOWN, &pgrp) == -1)
regress/sys/dev/wscons/sigio.c
233
test_common_setown(int fd, int dofcntl)
regress/sys/dev/wscons/sigio.c
240
if (fcntl(fd, F_SETOWN, arg) == -1)
regress/sys/dev/wscons/sigio.c
243
if (ioctl(fd, FIOSETOWN, &arg) == -1)
regress/sys/dev/wscons/sigio.c
250
if (fcntl(fd, F_SETOWN, arg) == -1)
regress/sys/dev/wscons/sigio.c
253
if (ioctl(fd, FIOSETOWN, &arg) == -1)
regress/sys/dev/wscons/sigio.c
260
if (fcntl(fd, F_SETOWN, arg) != -1)
regress/sys/dev/wscons/sigio.c
263
if (ioctl(fd, FIOSETOWN, &arg) != -1)
regress/sys/dev/wscons/sigio.c
270
if (fcntl(fd, F_SETOWN, arg) != -1)
regress/sys/dev/wscons/sigio.c
273
if (ioctl(fd, FIOSETOWN, &arg) != -1)
regress/sys/dev/wscons/sigio.c
287
syncrecv(int fd, int id)
regress/sys/dev/wscons/sigio.c
291
if (read(fd, &r, sizeof(r)) == -1)
regress/sys/dev/wscons/sigio.c
298
syncsend(int fd, int id)
regress/sys/dev/wscons/sigio.c
300
if (write(fd, &id, sizeof(id)) == -1)
regress/sys/dev/wscons/sigio.c
52
test_getown_fcntl(int fd)
regress/sys/dev/wscons/sigio.c
54
return test_common_getown(fd, 1);
regress/sys/dev/wscons/sigio.c
58
test_getown_ioctl(int fd)
regress/sys/dev/wscons/sigio.c
60
return test_common_getown(fd, 0);
regress/sys/dev/wscons/sigio.c
64
test_gpgrp(int fd)
regress/sys/dev/wscons/sigio.c
68
if (ioctl(fd, TIOCGPGRP, &pgrp) == -1)
regress/sys/dev/wscons/sigio.c
74
if (ioctl(fd, TIOCSPGRP, &arg) == -1)
regress/sys/dev/wscons/sigio.c
76
if (ioctl(fd, TIOCGPGRP, &pgrp) == -1)
regress/sys/dev/wscons/sigio.c
85
test_setown_fcntl(int fd)
regress/sys/dev/wscons/sigio.c
87
return test_common_setown(fd, 1);
regress/sys/dev/wscons/sigio.c
91
test_setown_ioctl(int fd)
regress/sys/dev/wscons/sigio.c
93
return test_common_setown(fd, 0);
regress/sys/dev/wscons/sigio.c
97
test_sigio(int fd)
regress/sys/dev/wscons/util.c
35
int c, fd;
regress/sys/dev/wscons/util.c
50
fd = open(dev, O_RDWR);
regress/sys/dev/wscons/util.c
51
if (fd == -1)
regress/sys/dev/wscons/util.c
61
return test->t_func(fd);
regress/sys/dev/wscons/wscons.c
33
test_ioctl_unknown(int fd)
regress/sys/dev/wscons/wscons.c
35
if (ioctl(fd, TIOCSCTTY) == -1) {
regress/sys/fifofs/fifotest.c
107
dopoll(-1, fd, POLLIN|POLLOUT, "POLLIN|POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
108
dopoll(-1, fd, POLLIN, "POLLIN", timeout);
regress/sys/fifofs/fifotest.c
109
dopoll(-1, fd, POLLOUT, "POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
110
dopoll(-1, fd, 0, "(none)", timeout);
regress/sys/fifofs/fifotest.c
111
doselect(-1, fd, fd, timeout);
regress/sys/fifofs/fifotest.c
112
doselect(-1, fd, -1, timeout);
regress/sys/fifofs/fifotest.c
113
doselect(-1, -1, fd, timeout);
regress/sys/fifofs/fifotest.c
116
if (write(fd, "test", 4) != 4) {
regress/sys/fifofs/fifotest.c
122
dopoll(-1, fd, POLLIN|POLLOUT, "POLLIN|POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
123
dopoll(-1, fd, POLLIN, "POLLIN", timeout);
regress/sys/fifofs/fifotest.c
124
dopoll(-1, fd, POLLOUT, "POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
125
dopoll(-1, fd, 0, "(none)", timeout);
regress/sys/fifofs/fifotest.c
126
doselect(-1, fd, fd, timeout);
regress/sys/fifofs/fifotest.c
127
doselect(-1, fd, -1, timeout);
regress/sys/fifofs/fifotest.c
128
doselect(-1, -1, fd, timeout);
regress/sys/fifofs/fifotest.c
131
if ((nread = read(fd, buf, sizeof(buf))) <= 0) {
regress/sys/fifofs/fifotest.c
142
int fd;
regress/sys/fifofs/fifotest.c
171
fd = open(fifo, O_WRONLY | flags);
regress/sys/fifofs/fifotest.c
173
if (fd == -1) {
regress/sys/fifofs/fifotest.c
183
close(fd);
regress/sys/fifofs/fifotest.c
191
int fd = -1, pass, status;
regress/sys/fifofs/fifotest.c
204
if (fd != -1)
regress/sys/fifofs/fifotest.c
205
close(fd);
regress/sys/fifofs/fifotest.c
214
if ((fd = open(fifo, O_RDONLY | flags, 0644)) == -1) {
regress/sys/fifofs/fifotest.c
237
dopoll(writer, fd, POLLIN|POLLOUT, "POLLIN|POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
241
dopoll(writer, fd, POLLIN, "POLLIN", timeout);
regress/sys/fifofs/fifotest.c
245
dopoll(writer, fd, POLLOUT, "POLLOUT", timeout);
regress/sys/fifofs/fifotest.c
249
dopoll(writer, fd, 0, "(none)", timeout);
regress/sys/fifofs/fifotest.c
253
doselect(writer, fd, fd, timeout);
regress/sys/fifofs/fifotest.c
257
doselect(writer, fd, -1, timeout);
regress/sys/fifofs/fifotest.c
261
doselect(writer, -1, fd, timeout);
regress/sys/fifofs/fifotest.c
269
if ((nread = read(fd, buf, sizeof(buf))) < 0) {
regress/sys/fifofs/fifotest.c
277
close(fd);
regress/sys/fifofs/fifotest.c
282
dopoll(pid_t writer, int fd, int events, char *str, int timeout)
regress/sys/fifofs/fifotest.c
287
pfd.fd = fd;
regress/sys/fifofs/fifotest.c
86
int fd;
regress/sys/fifofs/fifotest.c
97
if ((fd = open(fifo, O_RDWR | flags)) == -1) {
regress/sys/fileops/fileops.c
102
ssize_t ret = read(fd, buf, size);
regress/sys/fileops/fileops.c
110
int ret = fsync(fd);
regress/sys/fileops/fileops.c
117
off_t ret = lseek(fd, offset, whence);
regress/sys/fileops/fileops.c
136
mbuf = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, curpos);
regress/sys/fileops/fileops.c
155
fd = open(fname, flags, S_IRUSR|S_IWUSR);
regress/sys/fileops/fileops.c
156
if (fd == -1)
regress/sys/fileops/fileops.c
32
static int fd = -1;
regress/sys/fileops/fileops.c
94
ssize_t ret = write(fd, buf, size);
regress/sys/kern/accept/accept.c
28
int fd, lastfd;
regress/sys/kern/accept/accept.c
57
while ((fd = open("/dev/null", O_RDONLY)) >= 0)
regress/sys/kern/accept/accept.c
58
lastfd = fd;
regress/sys/kern/accept/accept.c
85
int i, fd, sock;
regress/sys/kern/access/access.c
95
int fd;
regress/sys/kern/access/access.c
97
if ((fd = open(filename, O_WRONLY|O_CREAT, 600)) < 0)
regress/sys/kern/access/access.c
99
close(fd);
regress/sys/kern/descrip/descrip.c
31
int fd, kq, status;
regress/sys/kern/descrip/descrip.c
37
fd = open("/etc/hosts", O_RDONLY);
regress/sys/kern/descrip/descrip.c
38
assert(fd == 4);
regress/sys/kern/descrip/descrip.c
54
fd = open("/etc/hosts", O_RDONLY);
regress/sys/kern/descrip/descrip.c
55
assert(fd == 5);
regress/sys/kern/dup2_accept/dup2_accept.c
73
int error, s, len, fd;
regress/sys/kern/dup2_accept/dup2_accept.c
97
fd = accept(s, &client_addr, &len);
regress/sys/kern/fchdir/fchdir.c
21
int fd;
regress/sys/kern/fchdir/fchdir.c
23
if ((fd = open("/etc/passwd", O_RDONLY)) == -1)
regress/sys/kern/fchdir/fchdir.c
25
if (fchdir(fd) == 0)
regress/sys/kern/fchdir/fchdir.c
29
close(fd);
regress/sys/kern/fchdir/fchdir.c
40
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
regress/sys/kern/fchdir/fchdir.c
42
if (fchdir(fd) == 0)
regress/sys/kern/fchdir/fchdir.c
46
close(fd);
regress/sys/kern/fchdir/fchdir.c
48
if (fchdir(fd) == 0)
regress/sys/kern/fchown/fchown.c
30
int fd;
regress/sys/kern/fchown/fchown.c
32
fd = open(path, O_WRONLY);
regress/sys/kern/fchown/fchown.c
33
if (fd == -1)
regress/sys/kern/fchown/fchown.c
35
if (fchown(fd, 0, -1) == -1)
regress/sys/kern/fchown/fchown.c
37
close(fd);
regress/sys/kern/flock/flock.c
1027
res = fcntl(fd, F_SETLKW, &fl);
regress/sys/kern/flock/flock.c
1037
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
1047
test14(int fd)
regress/sys/kern/flock/flock.c
105
test2(int fd)
regress/sys/kern/flock/flock.c
1115
if (fcntl(fd, F_SETLKW, &fl) < 0) {
regress/sys/kern/flock/flock.c
1161
if (pwrite(fd, &buf[start], len,
regress/sys/kern/flock/flock.c
1176
if (pread(fd, &buf[start], len,
regress/sys/kern/flock/flock.c
1194
if (pread(fd, tbuf, sizeof(tbuf), 0) != sizeof(tbuf)) {
regress/sys/kern/flock/flock.c
1240
test15(int fd)
regress/sys/kern/flock/flock.c
1275
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
1290
fd2 = dup(fd);
regress/sys/kern/flock/flock.c
1292
if (flock(fd, LOCK_SH) < 0)
regress/sys/kern/flock/flock.c
1302
flock(fd, LOCK_EX);
regress/sys/kern/flock/flock.c
1314
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
1333
test16(int fd)
regress/sys/kern/flock/flock.c
1345
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
135
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
1350
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1355
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1360
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1373
test17(int fd)
regress/sys/kern/flock/flock.c
1380
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1388
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1396
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1404
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1412
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1420
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1428
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1436
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1444
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1459
test18(int fd)
regress/sys/kern/flock/flock.c
1469
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1471
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1483
test19(int fd)
regress/sys/kern/flock/flock.c
1490
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1498
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1506
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1514
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1522
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1530
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1538
nfd = dup(fd);
regress/sys/kern/flock/flock.c
1546
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
155
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1554
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1569
test20(int fd)
regress/sys/kern/flock/flock.c
1579
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1587
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1599
test21(int fd)
regress/sys/kern/flock/flock.c
1609
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1617
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1629
test22(int fd)
regress/sys/kern/flock/flock.c
1639
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1647
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1657
test23(int fd)
regress/sys/kern/flock/flock.c
1667
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1678
test24(int fd)
regress/sys/kern/flock/flock.c
1691
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1698
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1708
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
1725
test25(int fd)
regress/sys/kern/flock/flock.c
176
test3(int fd)
regress/sys/kern/flock/flock.c
1770
test26(int fd)
regress/sys/kern/flock/flock.c
1782
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1794
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1806
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
1816
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
1833
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
1845
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
1895
int c, fd, i;
regress/sys/kern/flock/flock.c
1917
fd = make_file(1024);
regress/sys/kern/flock/flock.c
1926
error |= tests[i].testfn(fd);
regress/sys/kern/flock/flock.c
206
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
229
res = fcntl(fd, F_SETLKW, &fl);
regress/sys/kern/flock/flock.c
246
test4(int fd)
regress/sys/kern/flock/flock.c
275
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
294
if (fcntl(fd, F_GETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
320
test5(int fd)
regress/sys/kern/flock/flock.c
347
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
360
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
363
if (fcntl(fd, F_SETLKW, &fl) < 0)
regress/sys/kern/flock/flock.c
383
res = fcntl(fd, F_SETLKW, &fl);
regress/sys/kern/flock/flock.c
393
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
414
test6(int fd)
regress/sys/kern/flock/flock.c
433
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
446
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
463
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
466
if (fcntl(fd, F_SETLKW, &fl) < 0)
regress/sys/kern/flock/flock.c
487
res = fcntl(fd, F_SETLKW, &fl);
regress/sys/kern/flock/flock.c
496
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
517
test7(int fd)
regress/sys/kern/flock/flock.c
547
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
569
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
589
test8(int fd)
regress/sys/kern/flock/flock.c
619
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
641
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
651
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
666
test9(int fd)
regress/sys/kern/flock/flock.c
696
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
718
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/flock.c
738
test10(int fd)
regress/sys/kern/flock/flock.c
76
test1(int fd)
regress/sys/kern/flock/flock.c
768
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
785
if (fcntl(fd, F_GETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
805
test11(int fd)
regress/sys/kern/flock/flock.c
823
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
827
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
831
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
840
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
849
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
85
if (fcntl(fd, F_GETLK, &fl1) < 0)
regress/sys/kern/flock/flock.c
853
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
858
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
862
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/flock.c
869
res = fcntl(fd, F_SETLK_REMOTE, &fl);
regress/sys/kern/flock/flock.c
885
test12(int fd)
regress/sys/kern/flock/flock.c
915
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
939
res = fcntl(fd, F_SETLKW, &fl);
regress/sys/kern/flock/flock.c
949
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/flock.c
962
test13(int fd)
regress/sys/kern/flock/flock.c
998
if (fcntl(fd, F_SETLK, &fl) < 0)
regress/sys/kern/flock/lockf.c
114
int c, error, fd, i;
regress/sys/kern/flock/lockf.c
135
fd = make_file(1024);
regress/sys/kern/flock/lockf.c
140
error |= tests[i].testfn(fd);
regress/sys/kern/flock/lockf.c
33
test1(int fd)
regress/sys/kern/flock/lockf.c
43
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/lockf.c
50
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/lockf.c
65
test2(int fd)
regress/sys/kern/flock/lockf.c
72
if (lseek(fd, len, SEEK_SET) == -1)
regress/sys/kern/flock/lockf.c
79
res = fcntl(fd, F_SETLK, &fl);
regress/sys/kern/flock/lockf.c
86
if (lseek(fd, 0, SEEK_SET) == -1)
regress/sys/kern/flock/lockf.c
92
res = fcntl(fd, F_GETLK, &fl);
regress/sys/kern/flock/util.c
39
int fd, n;
regress/sys/kern/flock/util.c
46
fd = mkstemp(template);
regress/sys/kern/flock/util.c
47
if (fd == -1)
regress/sys/kern/flock/util.c
49
if (ftruncate(fd, size) == -1)
regress/sys/kern/flock/util.c
54
return (fd);
regress/sys/kern/fork-exit/fork-exit.c
163
run_child(int fd)
regress/sys/kern/fork-exit/fork-exit.c
167
if (fcntl(fd, F_SETFD, FD_CLOEXEC))
regress/sys/kern/fork-exit/fork-exit.c
179
if (close(fd) == -1)
regress/sys/kern/ftruncate/ftruncate.c
32
int fd;
regress/sys/kern/ftruncate/ftruncate.c
34
fd = open(path, O_RDWR);
regress/sys/kern/ftruncate/ftruncate.c
35
if (fd == -1)
regress/sys/kern/ftruncate/ftruncate.c
37
if (ftruncate(fd, 0) == -1)
regress/sys/kern/ftruncate/ftruncate.c
39
close(fd);
regress/sys/kern/futex/futex.c
48
int fd, i, status;
regress/sys/kern/futex/futex.c
81
fd = mkstemp(filename);
regress/sys/kern/futex/futex.c
82
assert(fd != -1);
regress/sys/kern/futex/futex.c
84
assert(ftruncate(fd, 65536) == 0);
regress/sys/kern/futex/futex.c
86
MAP_SHARED, fd, 0);
regress/sys/kern/futex/futex.c
88
close(fd);
regress/sys/kern/getpeereid/getpeereid_test.c
100
problem = check_id(fd);
regress/sys/kern/getpeereid/getpeereid_test.c
20
check_id(int fd)
regress/sys/kern/getpeereid/getpeereid_test.c
26
if (getpeereid(fd, &sockuid, &sockgid) == -1) {
regress/sys/kern/getpeereid/getpeereid_test.c
76
int s, fd;
regress/sys/kern/getpeereid/getpeereid_test.c
93
fd = accept(s, (struct sockaddr *)&client_addr, &client_len);
regress/sys/kern/getpeereid/getpeereid_test.c
94
if (fd == -1) {
regress/sys/kern/kqueue/kqueue-exec.c
101
if (kevent(fd, NULL, 0, NULL, 0, 0) == -1) {
regress/sys/kern/kqueue/kqueue-exec.c
109
if (kevent(fd, NULL, 0, NULL, 0, 0) == -1) {
regress/sys/kern/kqueue/kqueue-exec.c
87
int cloexec, fd;
regress/sys/kern/kqueue/kqueue-exec.c
92
fd = atoi(arg);
regress/sys/kern/kqueue/kqueue-fdpass.c
33
int pfd[2], fd, status;
regress/sys/kern/kqueue/kqueue-fdpass.c
45
fd = kqueue();
regress/sys/kern/kqueue/kqueue-fdpass.c
48
if (kevent(fd, &ke, 1, NULL, 0, NULL) != 0)
regress/sys/kern/kqueue/kqueue-fdpass.c
61
*(int *)CMSG_DATA(cmp) = fd;
regress/sys/kern/kqueue/kqueue-flock.c
24
check_lock(int fd, const char *msg)
regress/sys/kern/kqueue/kqueue-flock.c
36
if (fcntl(fd, F_SETLK, &fl) == 0) {
regress/sys/kern/kqueue/kqueue-flock.c
42
if (fcntl(fd, F_GETLK, &fl))
regress/sys/kern/kqueue/kqueue-flock.c
48
close(fd);
regress/sys/kern/kqueue/kqueue-flock.c
60
int fd, kq;
regress/sys/kern/kqueue/kqueue-flock.c
64
fd = open(FILE, O_CREAT|O_RDWR, 0666);
regress/sys/kern/kqueue/kqueue-flock.c
65
if (fd < 0)
regress/sys/kern/kqueue/kqueue-flock.c
69
if (fcntl(fd, F_SETLK, &fl))
regress/sys/kern/kqueue/kqueue-flock.c
72
check_lock(fd, "before");
regress/sys/kern/kqueue/kqueue-flock.c
75
EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD, NOTE_LINK, 0, NULL);
regress/sys/kern/kqueue/kqueue-flock.c
79
check_lock(fd, "after add");
regress/sys/kern/kqueue/kqueue-flock.c
81
EV_SET(&kev, fd, EVFILT_VNODE, EV_DELETE, NOTE_LINK, 0, NULL);
regress/sys/kern/kqueue/kqueue-flock.c
85
check_lock(fd, "after delete");
regress/sys/kern/kqueue/kqueue-flock.c
89
check_lock(fd, "after kq close");
regress/sys/kern/kqueue/kqueue-flock.c
91
close(fd);
regress/sys/kern/kqueue/kqueue-pipe.c
49
int fd[2];
regress/sys/kern/kqueue/kqueue-pipe.c
54
ASS(pipe(fd) == 0,
regress/sys/kern/kqueue/kqueue-pipe.c
56
ASS(fcntl(fd[1], F_SETFL, O_NONBLOCK) == 0,
regress/sys/kern/kqueue/kqueue-pipe.c
63
ev.ident = fd[1];
regress/sys/kern/kqueue/kqueue-pipe.c
70
while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
regress/sys/kern/kqueue/kqueue-pipe.c
78
read(fd[0], buf, sizeof(buf));
regress/sys/kern/kqueue/kqueue-pipe.c
85
close(fd[0]);
regress/sys/kern/kqueue/kqueue-pipe.c
86
close(fd[1]);
regress/sys/kern/kqueue/kqueue-pty.c
63
int fd, kq, massa, slave;
regress/sys/kern/kqueue/kqueue-pty.c
66
ASS((fd = open("/dev/console", O_RDONLY, &tt)) > 0,
regress/sys/kern/kqueue/kqueue-pty.c
68
ASS(tcgetattr(fd, &tt) == 0,
regress/sys/kern/kqueue/kqueue-random.c
22
int n, fd, kq;
regress/sys/kern/kqueue/kqueue-random.c
27
ASS((fd = open("/dev/random", O_RDONLY)) >= 0,
regress/sys/kern/kqueue/kqueue-random.c
29
ASS(fcntl(fd, F_SETFL, O_NONBLOCK) == 0,
regress/sys/kern/kqueue/kqueue-random.c
36
ev.ident = fd;
regress/sys/kern/kqueue/kqueue-random.c
48
ASSX(read(fd, buf, n) > 0);
regress/sys/kern/kqueue/kqueue-random.c
51
close(fd);
regress/sys/kern/kqueue/kqueue-regress.c
276
pfd[0].fd = kq;
regress/sys/kern/kqueue/kqueue-regress.c
299
pfd[0].fd = kq;
regress/sys/kern/kqueue/kqueue-tun.c
104
if ((rlen = readv(fd, iv, 2)) > 0) {
regress/sys/kern/kqueue/kqueue-tun.c
116
tunnel_ping(int fd, short which, void *arg)
regress/sys/kern/kqueue/kqueue-tun.c
69
tunnel_write(int fd, short which, void *arg)
regress/sys/kern/kqueue/kqueue-tun.c
74
int fdkey = (fd == tunfd[0]) ? 0 : 1;
regress/sys/kern/kqueue/kqueue-tun.c
82
if ((rlen = writev(fd, iv, 2)) > 0)
regress/sys/kern/kqueue/kqueue-tun.c
90
tunnel_read(int fd, short which, void *arg)
regress/sys/kern/kqueue/kqueue-tun.c
95
int fdkey = (fd == tunfd[0]) ? 0 : 1;
regress/sys/kern/kqueue/kqueue-tun.c
96
int oppfdkey = (fd == tunfd[0]) ? 1 : 0;
regress/sys/kern/mmap/mmaptest.c
43
int fd;
regress/sys/kern/mmap/mmaptest.c
50
fd = mkstemp(nm);
regress/sys/kern/mmap/mmaptest.c
51
if (fd == -1)
regress/sys/kern/mmap/mmaptest.c
56
if (ftruncate(fd, sz) == -1)
regress/sys/kern/mmap/mmaptest.c
58
v = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
regress/sys/kern/mmap/mmaptest.c
66
if (close(fd) == -1)
regress/sys/kern/mmap/mmaptest.c
68
fd = open(nm, O_RDONLY);
regress/sys/kern/mmap/mmaptest.c
69
if (fd == -1)
regress/sys/kern/mmap/mmaptest.c
73
n = read(fd, &i, sizeof i);
regress/sys/kern/mmap/mmaptest.c
78
if (close(fd) == -1)
regress/sys/kern/mmap2/mmaptest.c
27
int fd;
regress/sys/kern/mmap2/mmaptest.c
30
if ((fd = mkstemp(fname)) < 0)
regress/sys/kern/mmap2/mmaptest.c
39
if (ftruncate(fd, 2 * page_size) < 0)
regress/sys/kern/mmap2/mmaptest.c
45
MAP_SHARED, fd, 0);
regress/sys/kern/mmap2/mmaptest.c
52
MAP_SHARED|MAP_FIXED, fd, 0);
regress/sys/kern/mmap2/mmaptest.c
67
close(fd);
regress/sys/kern/mmap3/mmaptest.c
44
int fd;
regress/sys/kern/mmap3/mmaptest.c
50
fd = open("test.out", O_WRONLY|O_CREAT|O_TRUNC, 0600);
regress/sys/kern/mmap3/mmaptest.c
51
if (fd == -1)
regress/sys/kern/mmap3/mmaptest.c
53
if (write(fd, area, AREA) != AREA)
regress/sys/kern/mmap3/mmaptest.c
55
if (close(fd))
regress/sys/kern/mmap3/mmaptest.c
57
fd = open("test.out", O_RDWR);
regress/sys/kern/mmap3/mmaptest.c
58
if (fd == -1)
regress/sys/kern/mmap3/mmaptest.c
60
a2 = mmap(NULL, AREA, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
regress/sys/kern/mmap3/mmaptest.c
67
if (ftruncate(fd, 128))
regress/sys/kern/mmap3/mmaptest.c
71
if (close(fd))
regress/sys/kern/mmap3/mmaptest.c
73
fd = open("test.out", O_RDONLY);
regress/sys/kern/mmap3/mmaptest.c
74
if (fd == -1)
regress/sys/kern/mmap3/mmaptest.c
76
if (read(fd, area, AREA) != 128)
regress/sys/kern/mmap3/mmaptest.c
80
if (close(fd))
regress/sys/kern/open/open.c
30
int fd;
regress/sys/kern/open/open.c
32
fd = open(path, O_WRONLY | O_TRUNC | O_SHLOCK);
regress/sys/kern/open/open.c
33
if (fd == -1)
regress/sys/kern/open/open.c
35
close(fd);
regress/sys/kern/pipe/test-kqueue.c
259
int fd, filter, nevents;
regress/sys/kern/pipe/test-kqueue.c
264
fd = ctx->c_pipe[0];
regress/sys/kern/pipe/test-kqueue.c
269
fd = ctx->c_pipe[1];
regress/sys/kern/pipe/test-kqueue.c
274
EV_SET(&kev, fd, filter, EV_ADD, 0, 0, NULL);
regress/sys/kern/pipe/test-kqueue.c
284
if ((int)kev.ident != fd)
regress/sys/kern/pipe/test-kqueue.c
303
close(fd);
regress/sys/kern/pledge/generic/main.c
52
int fd = socket(AF_INET, SOCK_STREAM, 0);
regress/sys/kern/pledge/generic/main.c
54
close(fd);
regress/sys/kern/pledge/generic/main.c
74
int fd;
regress/sys/kern/pledge/generic/main.c
77
if ((fd = open("/dev/zero", O_RDONLY)) == -1)
regress/sys/kern/pledge/generic/main.c
80
if (read(fd, data, sizeof(data)) == -1)
regress/sys/kern/pledge/generic/main.c
83
close(fd);
regress/sys/kern/pledge/generic/main.c
89
int fd;
regress/sys/kern/pledge/generic/main.c
92
if ((fd = open("/dev/null", O_WRONLY)) == -1)
regress/sys/kern/pledge/generic/main.c
95
if (write(fd, data, sizeof(data)) == -1)
regress/sys/kern/pledge/generic/main.c
98
close(fd);
regress/sys/kern/pledge/generic/manager.c
61
int fd;
regress/sys/kern/pledge/generic/manager.c
63
if ((fd = open(coredump, O_RDONLY)) == -1) {
regress/sys/kern/pledge/generic/manager.c
70
(void)close(fd);
regress/sys/kern/pledge/generic/pty.c
55
int fd;
regress/sys/kern/pledge/generic/pty.c
57
fd = open("/dev/tty", O_RDWR | O_NOCTTY);
regress/sys/kern/pledge/generic/pty.c
58
if (fd >= 0) {
regress/sys/kern/pledge/generic/pty.c
59
(void)ioctl(fd, TIOCNOTTY, NULL);
regress/sys/kern/pledge/generic/pty.c
60
close(fd);
regress/sys/kern/pledge/generic/test_tty.c
33
int amaster, fd;
regress/sys/kern/pledge/generic/test_tty.c
38
if (openpty(&amaster, &fd, NULL, NULL, NULL) == -1)
regress/sys/kern/pledge/generic/test_tty.c
47
if ((tcsetpgrp(fd, 1) == -1) && (errno != ENOTTY))
regress/sys/kern/pledge/generic/test_tty.c
57
if (ioctl(fd, TIOCGETA, &ts) == -1)
regress/sys/kern/pledge/generic/test_tty.c
61
if (ioctl(fd, TIOCGWINSZ, &ws) == -1)
regress/sys/kern/pledge/generic/test_tty.c
65
if ((ioctl(fd, TIOCSBRK, NULL) == -1) && (errno != ENOTTY))
regress/sys/kern/pledge/generic/test_tty.c
70
if ((ioctl(fd, TIOCCDTR, NULL) == -1) && (errno != ENOTTY))
regress/sys/kern/pledge/generic/test_tty.c
75
if (tcsetattr(fd, TCSANOW, &ts) == -1)
regress/sys/kern/pledge/generic/test_tty.c
79
if (tcsetattr(fd, TCSADRAIN, &ts) == -1)
regress/sys/kern/pledge/generic/test_tty.c
83
if (tcsetattr(fd, TCSAFLUSH, &ts) == -1)
regress/sys/kern/pledge/open/open.c
36
int fd, i;
regress/sys/kern/pledge/open/open.c
57
fd = _libc___pledge_open(path, O_RDONLY);
regress/sys/kern/pledge/open/open.c
58
if (fd == -1)
regress/sys/kern/pledge/open/open.c
61
if (fstat(fd, &sb) == -1)
regress/sys/kern/pledge/open/open.c
66
if (fchmod(fd, 0) != -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
132
*(int *)CMSG_DATA(cmsg) = fd;
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
151
int fd;
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
187
if ((fd = open("/etc/passwd", O_RDONLY)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
191
if ((fd = open("/dev", O_RDONLY)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
195
if ((fd = open("/dev/vnd0c", O_RDONLY)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
199
if ((fd = open("/dev/null", O_RDONLY)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
203
if ((fd = open("/etc/termcap", O_RDONLY)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
208
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
220
if ((fd = open("fifo", O_RDONLY|O_NONBLOCK)) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
243
close(fd);
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
252
do_sender(type, sv[0], fd);
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
40
static void do_sender(enum testtype type, int sock, int fd);
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
87
int fd = *(int *)CMSG_DATA(cmsg);
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
91
if (fstat(fd, &sb) == -1)
regress/sys/kern/pledge/sendrecvfd/sendrecvfd.c
98
do_sender(enum testtype type, int sock, int fd)
regress/sys/kern/poll/poll_close.c
46
pfd[0].fd = sock[1];
regress/sys/kern/poll/poll_close.c
60
pfd[0].fd = sock[1];
regress/sys/kern/poll/poll_iocond.c
298
proc_barrier(int fd)
regress/sys/kern/poll/poll_iocond.c
303
ret = write(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
305
ret = read(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
310
proc_child(int fd, int bfd)
regress/sys/kern/poll/poll_iocond.c
322
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
331
ret = write(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
351
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
358
ret = write(fd, buf, sizeof(buf));
regress/sys/kern/poll/poll_iocond.c
380
ret = write(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
383
if (ioctl(fd, UIOCCMD(42), NULL) == -1)
regress/sys/kern/poll/poll_iocond.c
386
ret = write(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
399
ret = send(fd, &b, 1, 0);
regress/sys/kern/poll/poll_iocond.c
402
ret = send(fd, &b, 1, MSG_OOB);
regress/sys/kern/poll/poll_iocond.c
405
ret = send(fd, &b, 1, 0);
regress/sys/kern/poll/poll_iocond.c
423
ret = write(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
426
ret = shutdown(fd, SHUT_WR);
regress/sys/kern/poll/poll_iocond.c
439
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
441
pfd[1].fd = fd;
regress/sys/kern/poll/poll_iocond.c
477
close(fd);
regress/sys/kern/poll/poll_iocond.c
481
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
490
proc_parent(int fd, int bfd)
regress/sys/kern/poll/poll_iocond.c
502
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
551
ret = read(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
554
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
573
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
586
ret = read(fd, buf, MIN(sizeof(buf), nbytes));
regress/sys/kern/poll/poll_iocond.c
602
if (ioctl(fd, TIOCUCNTL, &on) == -1)
regress/sys/kern/poll/poll_iocond.c
611
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
613
pfd[1].fd = fd;
regress/sys/kern/poll/poll_iocond.c
622
ret = read(fd, buf, sizeof(buf));
regress/sys/kern/poll/poll_iocond.c
631
ret = read(fd, buf, sizeof(buf));
regress/sys/kern/poll/poll_iocond.c
639
if (ioctl(fd, TIOCUCNTL, &off) == -1)
regress/sys/kern/poll/poll_iocond.c
653
if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &on,
regress/sys/kern/poll/poll_iocond.c
659
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
661
pfd[1].fd = fd;
regress/sys/kern/poll/poll_iocond.c
671
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/poll/poll_iocond.c
674
ret = recv(fd, buf, sizeof(buf), 0);
regress/sys/kern/poll/poll_iocond.c
684
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/poll/poll_iocond.c
687
ret = recv(fd, &b, 1, 0);
regress/sys/kern/poll/poll_iocond.c
697
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/poll/poll_iocond.c
700
ret = recv(fd, buf, sizeof(buf), 0);
regress/sys/kern/poll/poll_iocond.c
728
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
735
ret = read(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
742
ret = read(fd, &b, 1);
regress/sys/kern/poll/poll_iocond.c
745
ret = shutdown(fd, SHUT_WR);
regress/sys/kern/poll/poll_iocond.c
750
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
752
pfd[1].fd = fd;
regress/sys/kern/poll/poll_iocond.c
792
pfd[0].fd = fd;
regress/sys/kern/poll/poll_iocond.c
794
pfd[1].fd = fd;
regress/sys/kern/poll/poll_iocond.c
831
close(fd);
regress/sys/kern/poll/poll_regevent.c
48
pfd[0].fd = p1[0];
regress/sys/kern/poll/poll_regevent.c
52
pfd[1].fd = p2[1];
regress/sys/kern/poll/pollnval.c
32
fds[0].fd = 0;
regress/sys/kern/poll/pollretval.c
16
pfd[i].fd = 0;
regress/sys/kern/pread/pread.c
19
int fd, ret;
regress/sys/kern/pread/pread.c
21
if ((fd = mkstemp(temp)) < 0)
regress/sys/kern/pread/pread.c
25
if (write(fd, magic, sizeof(magic)) != sizeof(magic))
regress/sys/kern/pread/pread.c
28
if (lseek(fd, 0, SEEK_SET) != 0)
regress/sys/kern/pread/pread.c
31
if (read(fd, &c, 1) != 1)
regress/sys/kern/pread/pread.c
37
if (pread(fd, &c, 1, 7) != 1)
regress/sys/kern/pread/pread.c
43
if (read(fd, &c, 1) != 1)
regress/sys/kern/pread/pread.c
49
if ((ret = pread(fd, &c, 1, -1)) != -1)
regress/sys/kern/pread/pread.c
55
if ((ret = pread(fd, &c, 3, LLONG_MAX)) != -1)
regress/sys/kern/pread/pread.c
61
if (read(fd, &c, 1) != 1)
regress/sys/kern/pread/pread.c
67
close(fd);
regress/sys/kern/pread/pread.c
70
fd = open("/dev/tty", O_RDWR);
regress/sys/kern/pread/pread.c
71
if (fd < 0)
regress/sys/kern/pread/pread.c
73
else if ((ret = pread(fd, &c, 1, 7)) != -1)
regress/sys/kern/preadv/preadv.c
21
int fd, ret;
regress/sys/kern/preadv/preadv.c
24
if ((fd = mkstemp(temp)) < 0)
regress/sys/kern/preadv/preadv.c
28
if (write(fd, magic, sizeof(magic)) != sizeof(magic))
regress/sys/kern/preadv/preadv.c
31
if (lseek(fd, 0, SEEK_SET) != 0)
regress/sys/kern/preadv/preadv.c
34
if (read(fd, &c, 1) != 1)
regress/sys/kern/preadv/preadv.c
45
if (preadv(fd, iv, 2, 7) != 2)
regress/sys/kern/preadv/preadv.c
54
if (read(fd, &c, 1) != 1)
regress/sys/kern/preadv/preadv.c
60
if ((ret = preadv(fd, iv, 2, -1)) != -1)
regress/sys/kern/preadv/preadv.c
66
if ((ret = preadv(fd, iv, 2, LLONG_MAX)) != -1)
regress/sys/kern/preadv/preadv.c
72
if (read(fd, &c, 1) != 1)
regress/sys/kern/preadv/preadv.c
78
close(fd);
regress/sys/kern/preadv/preadv.c
81
fd = open("/dev/tty", O_RDWR);
regress/sys/kern/preadv/preadv.c
82
if (fd < 0)
regress/sys/kern/preadv/preadv.c
84
else if ((ret = preadv(fd, iv, 2, 7)) != -1)
regress/sys/kern/ptmget/ptmget.c
23
int fd;
regress/sys/kern/ptmget/ptmget.c
34
fd = open("/dev/ptm", O_RDWR);
regress/sys/kern/ptmget/ptmget.c
35
if (fd == -1)
regress/sys/kern/ptmget/ptmget.c
37
if ((ioctl(fd, PTMGET, &ptm) == -1))
regress/sys/kern/ptrace2/macros.h
20
#define fchroot(fd) 0
regress/sys/kern/pwrite/pwrite.c
22
int fd, ret;
regress/sys/kern/pwrite/pwrite.c
24
if ((fd = mkstemp(temp)) < 0)
regress/sys/kern/pwrite/pwrite.c
28
if (write(fd, zeroes, sizeof(zeroes)) != sizeof(zeroes))
regress/sys/kern/pwrite/pwrite.c
31
if (lseek(fd, 5, SEEK_SET) != 5)
regress/sys/kern/pwrite/pwrite.c
34
if (pwrite(fd, &magic[1], 4, 4) != 4)
regress/sys/kern/pwrite/pwrite.c
37
if (read(fd, &c, 1) != 1)
regress/sys/kern/pwrite/pwrite.c
44
if (write(fd, &c, 1) != 1)
regress/sys/kern/pwrite/pwrite.c
47
if (write(fd, &c, 0) != 0)
regress/sys/kern/pwrite/pwrite.c
50
if (pread(fd, buf, 10, 0) != 10)
regress/sys/kern/pwrite/pwrite.c
56
if ((ret = pwrite(fd, &magic[5], 1, -1)) != -1)
regress/sys/kern/pwrite/pwrite.c
62
if ((ret = pwrite(fd, &magic[5], 1, LLONG_MAX)) != -1)
regress/sys/kern/pwrite/pwrite.c
69
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_APPEND))
regress/sys/kern/pwrite/pwrite.c
71
if (pwrite(fd, &magic[2], 3, 2) != 3)
regress/sys/kern/pwrite/pwrite.c
73
if (pread(fd, buf, 10, 0) != 10)
regress/sys/kern/pwrite/pwrite.c
78
close(fd);
regress/sys/kern/pwrite/pwrite.c
81
fd = open("/dev/tty", O_RDWR);
regress/sys/kern/pwrite/pwrite.c
82
if (fd < 0)
regress/sys/kern/pwrite/pwrite.c
84
else if ((ret = pwrite(fd, &c, 1, 7)) != -1)
regress/sys/kern/pwritev/pwritev.c
25
int fd, ret;
regress/sys/kern/pwritev/pwritev.c
27
if ((fd = mkstemp(temp)) < 0)
regress/sys/kern/pwritev/pwritev.c
31
if (write(fd, zeroes, sizeof(zeroes)) != sizeof(zeroes))
regress/sys/kern/pwritev/pwritev.c
34
if (lseek(fd, 5, SEEK_SET) != 5)
regress/sys/kern/pwritev/pwritev.c
42
if (pwritev(fd, iov, 2, 4) != 4)
regress/sys/kern/pwritev/pwritev.c
45
if (read(fd, &c, 1) != 1)
regress/sys/kern/pwritev/pwritev.c
52
if (write(fd, &c, 1) != 1)
regress/sys/kern/pwritev/pwritev.c
55
if (pread(fd, buf, 10, 0) != 10)
regress/sys/kern/pwritev/pwritev.c
60
if ((ret = pwritev(fd, iov, 2, -1)) != -1)
regress/sys/kern/pwritev/pwritev.c
66
if ((ret = pwritev(fd, iov, 2, LLONG_MAX)) != -1)
regress/sys/kern/pwritev/pwritev.c
76
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_APPEND))
regress/sys/kern/pwritev/pwritev.c
78
if (pwritev(fd, iov, 2, 2) != 4)
regress/sys/kern/pwritev/pwritev.c
80
if (pread(fd, buf, 10, 0) != 10)
regress/sys/kern/pwritev/pwritev.c
85
close(fd);
regress/sys/kern/pwritev/pwritev.c
88
fd = open("/dev/tty", O_RDWR);
regress/sys/kern/pwritev/pwritev.c
89
if (fd < 0)
regress/sys/kern/pwritev/pwritev.c
91
else if ((ret = pwritev(fd, iov, 2, 7)) != -1)
regress/sys/kern/recvwait/mcontrol-stream.c
30
int fd, s[2], status;
regress/sys/kern/recvwait/mcontrol-stream.c
40
if ((fd = open("/dev/null", O_RDONLY)) == -1)
regress/sys/kern/recvwait/mcontrol-stream.c
79
*(int *)CMSG_DATA(cmsg) = fd;
regress/sys/kern/rlimit-file/rlim-file.c
17
int lim, fd, fds[2];
regress/sys/kern/rlimit-file/rlim-file.c
25
fd = -1;
regress/sys/kern/rlimit-file/rlim-file.c
26
while (fd < lim - 2)
regress/sys/kern/rlimit-file/rlim-file.c
27
if ((fd = open("/dev/null", O_RDONLY)) < 0)
regress/sys/kern/select/select_iocond.c
299
proc_barrier(int fd)
regress/sys/kern/select/select_iocond.c
304
ret = write(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
306
ret = read(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
311
fdset_init(fd_set *rfd, fd_set *wfd, fd_set *efd, int fd)
regress/sys/kern/select/select_iocond.c
316
FD_SET(fd, rfd);
regress/sys/kern/select/select_iocond.c
317
FD_SET(fd, wfd);
regress/sys/kern/select/select_iocond.c
318
FD_SET(fd, efd);
regress/sys/kern/select/select_iocond.c
322
proc_child(int fd, int bfd)
regress/sys/kern/select/select_iocond.c
334
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
335
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
337
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
338
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
339
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
343
ret = write(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
348
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
349
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
351
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
352
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
353
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
367
FD_SET(fd, &wfd);
regress/sys/kern/select/select_iocond.c
368
ret = select(fd + 1, NULL, &wfd, NULL, &zerotv);
regress/sys/kern/select/select_iocond.c
372
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
373
ret = write(fd, buf, sizeof(buf));
regress/sys/kern/select/select_iocond.c
395
ret = write(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
398
if (ioctl(fd, UIOCCMD(42), NULL) == -1)
regress/sys/kern/select/select_iocond.c
401
ret = write(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
414
ret = send(fd, &b, 1, 0);
regress/sys/kern/select/select_iocond.c
417
ret = send(fd, &b, 1, MSG_OOB);
regress/sys/kern/select/select_iocond.c
420
ret = send(fd, &b, 1, 0);
regress/sys/kern/select/select_iocond.c
438
ret = write(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
441
ret = shutdown(fd, SHUT_WR);
regress/sys/kern/select/select_iocond.c
454
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
455
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
457
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
458
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
459
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
472
close(fd);
regress/sys/kern/select/select_iocond.c
476
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
477
ret = select(fd + 1, &rfd, &wfd, &efd, NULL);
regress/sys/kern/select/select_iocond.c
483
proc_parent(int fd, int bfd)
regress/sys/kern/select/select_iocond.c
495
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
497
FD_CLR(fd, &wfd);
regress/sys/kern/select/select_iocond.c
498
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
503
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
504
assert(FD_ISSET(fd, &wfd) == 0);
regress/sys/kern/select/select_iocond.c
505
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
509
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
510
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
511
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
526
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
528
FD_CLR(fd, &wfd);
regress/sys/kern/select/select_iocond.c
529
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
534
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
535
assert(FD_ISSET(fd, &wfd) == 0);
regress/sys/kern/select/select_iocond.c
536
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
543
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
544
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
545
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
553
ret = read(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
556
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
557
ret = select(fd + 1, &rfd, NULL, NULL, &tv);
regress/sys/kern/select/select_iocond.c
574
FD_SET(fd, &rfd);
regress/sys/kern/select/select_iocond.c
575
ret = select(fd + 1, &rfd, NULL, NULL, &zerotv);
regress/sys/kern/select/select_iocond.c
584
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
586
ret = read(fd, buf, MIN(sizeof(buf), nbytes));
regress/sys/kern/select/select_iocond.c
602
if (ioctl(fd, TIOCUCNTL, &on) == -1)
regress/sys/kern/select/select_iocond.c
611
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
612
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
614
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
615
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
616
assert(FD_ISSET(fd, &efd) != 0);
regress/sys/kern/select/select_iocond.c
619
ret = read(fd, buf, sizeof(buf));
regress/sys/kern/select/select_iocond.c
622
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
623
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
625
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
626
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
627
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
630
ret = read(fd, buf, sizeof(buf));
regress/sys/kern/select/select_iocond.c
633
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
634
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
636
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
637
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
638
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
640
if (ioctl(fd, TIOCUCNTL, &off) == -1)
regress/sys/kern/select/select_iocond.c
654
if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &on,
regress/sys/kern/select/select_iocond.c
660
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
661
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
663
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
664
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
665
assert(FD_ISSET(fd, &efd) != 0);
regress/sys/kern/select/select_iocond.c
669
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/select/select_iocond.c
672
ret = recv(fd, buf, sizeof(buf), 0);
regress/sys/kern/select/select_iocond.c
675
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
676
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
678
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
679
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
680
assert(FD_ISSET(fd, &efd) != 0);
regress/sys/kern/select/select_iocond.c
684
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/select/select_iocond.c
687
ret = recv(fd, &b, 1, 0);
regress/sys/kern/select/select_iocond.c
690
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
691
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
693
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
694
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
695
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
699
if (ioctl(fd, SIOCATMARK, &atmark) == -1)
regress/sys/kern/select/select_iocond.c
702
ret = recv(fd, buf, sizeof(buf), 0);
regress/sys/kern/select/select_iocond.c
705
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
706
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
708
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
709
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
710
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
732
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
733
ret = select(fd + 1, &rfd, NULL, NULL, &tv);
regress/sys/kern/select/select_iocond.c
735
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
737
ret = read(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
740
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
741
ret = select(fd + 1, &rfd, NULL, NULL, &tv);
regress/sys/kern/select/select_iocond.c
743
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
745
ret = read(fd, &b, 1);
regress/sys/kern/select/select_iocond.c
748
ret = shutdown(fd, SHUT_WR);
regress/sys/kern/select/select_iocond.c
753
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
754
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
756
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
757
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
758
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
775
fdset_init(&rfd, &wfd, &efd, fd);
regress/sys/kern/select/select_iocond.c
777
FD_CLR(fd, &wfd);
regress/sys/kern/select/select_iocond.c
778
ret = select(fd + 1, &rfd, &wfd, &efd, &tv);
regress/sys/kern/select/select_iocond.c
783
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
784
assert(FD_ISSET(fd, &wfd) == 0);
regress/sys/kern/select/select_iocond.c
785
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
791
assert(FD_ISSET(fd, &rfd) != 0);
regress/sys/kern/select/select_iocond.c
792
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
793
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
797
assert(FD_ISSET(fd, &rfd) == 0);
regress/sys/kern/select/select_iocond.c
798
assert(FD_ISSET(fd, &wfd) != 0);
regress/sys/kern/select/select_iocond.c
799
assert(FD_ISSET(fd, &efd) == 0);
regress/sys/kern/select/select_iocond.c
805
close(fd);
regress/sys/kern/signal/siginfo-fault/siginfo-fault.c
160
int fd;
regress/sys/kern/signal/siginfo-fault/siginfo-fault.c
161
CHECK_LE(0, (fd = mkstemp(filename)));
regress/sys/kern/signal/siginfo-fault/siginfo-fault.c
163
CHECK_EQ(0, ftruncate(fd, 0)); /* just in case */
regress/sys/kern/signal/siginfo-fault/siginfo-fault.c
165
MAP_SHARED, fd, 0)));
regress/sys/kern/signal/siginfo-fault/siginfo-fault.c
166
CHECK_EQ(0, close(fd));
regress/sys/kern/signal/sigio/sigio_common.c
147
test_common_getown(int fd)
regress/sys/kern/signal/sigio/sigio_common.c
151
assert(fcntl(fd, F_GETOWN) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
154
assert(fcntl(fd, F_SETOWN, pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
155
assert(fcntl(fd, F_GETOWN) == pgid);
regress/sys/kern/signal/sigio/sigio_common.c
158
assert(fcntl(fd, F_SETOWN, pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
159
assert(fcntl(fd, F_GETOWN) == pgid);
regress/sys/kern/signal/sigio/sigio_common.c
161
assert(fcntl(fd, F_SETOWN, 0) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
162
assert(fcntl(fd, F_GETOWN) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
165
assert(ioctl(fd, FIOGETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
169
assert(ioctl(fd, FIOSETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
171
assert(ioctl(fd, FIOGETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
175
assert(ioctl(fd, FIOSETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
177
assert(ioctl(fd, FIOGETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
181
assert(ioctl(fd, FIOSETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
183
assert(ioctl(fd, FIOGETOWN, &pgid) == 0);
regress/sys/kern/signal/sigio/sigio_common.c
33
test_common_badpgid(int fd)
regress/sys/kern/signal/sigio/sigio_common.c
40
assert(fcntl(fd, F_SETOWN, pgid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
43
assert(ioctl(fd, FIOSETOWN, &pgid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
49
assert(fcntl(fd, F_SETOWN, pgid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
52
assert(ioctl(fd, FIOSETOWN, &pgid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
59
test_common_badsession(int fd)
regress/sys/kern/signal/sigio/sigio_common.c
73
assert(fcntl(fd, F_SETOWN, ppid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
76
assert(fcntl(fd, F_SETOWN, -ppid) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
80
assert(ioctl(fd, FIOSETOWN, &arg) == -1);
regress/sys/kern/signal/sigio/sigio_common.c
84
assert(ioctl(fd, FIOSETOWN, &arg) == -1);
regress/sys/kern/sysvmsg/msgtest.c
89
int fd, ch;
regress/sys/kern/sysvmsg/msgtest.c
91
if ((fd = mkstemp(keyname)) < 0)
regress/sys/kern/sysvmsg/msgtest.c
94
close(fd);
regress/sys/kern/sysvsem/semtest.c
83
int fd, ch;
regress/sys/kern/sysvsem/semtest.c
85
if ((fd = mkstemp(keyname)) < 0)
regress/sys/kern/sysvsem/semtest.c
88
close(fd);
regress/sys/kern/sysvshm/shmtest.c
77
int fd, ch;
regress/sys/kern/sysvshm/shmtest.c
79
if ((fd = mkstemp(keyname)) < 0)
regress/sys/kern/sysvshm/shmtest.c
82
close(fd);
regress/sys/kern/unfdpass/unfdpass.c
105
if ((fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
regress/sys/kern/unfdpass/unfdpass.c
108
if (write(fd, buf, strlen(buf)) != (ssize_t) strlen(buf))
regress/sys/kern/unfdpass/unfdpass.c
110
(void) close(fd);
regress/sys/kern/unfdpass/unfdpass.c
261
int i, fd, nfds = 3;
regress/sys/kern/unfdpass/unfdpass.c
303
if ((fd = open(fname, O_RDONLY)) == -1)
regress/sys/kern/unfdpass/unfdpass.c
305
files[i] = fd;
regress/sys/kern/unfdpass/unfdpass.c
61
int sock, pfd[2], fd, i;
regress/sys/kern/unixsockets/unfdpassfail.c
102
close(fd);
regress/sys/kern/unixsockets/unfdpassfail.c
52
int s[2], fd, kqfd;
regress/sys/kern/unixsockets/unfdpassfail.c
68
if ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0)
regress/sys/kern/unixsockets/unfdpassfail.c
84
*((int *)CMSG_DATA(cmsgh) + 0) = fd;
regress/sys/kern/unixsockets/unfdpassfail.c
87
error = pthread_create(&thr, NULL, thr_close, &fd);
regress/sys/kern/unixsockets/unsopassgc.c
146
int i, fd;
regress/sys/kern/unixsockets/unsopassgc.c
174
if(cmsgh->cmsg_len != CMSG_LEN(sizeof(fd) * PASSFD_NUM))
regress/sys/kern/unixsockets/unsopassgc.c
178
fd = *((int *)CMSG_DATA(cmsgh) + i);
regress/sys/kern/unixsockets/unsopassgc.c
179
close(fd);
regress/sys/kern/unveil-unmount/unveil-unlink.c
27
int fd;
regress/sys/kern/unveil-unmount/unveil-unlink.c
37
fd = open(path, O_WRONLY|O_CREAT, 0755);
regress/sys/kern/unveil-unmount/unveil-unlink.c
38
if (fd == -1)
regress/sys/kern/unveil-unmount/unveil-unlink.c
40
close(fd);
regress/sys/kern/unveil/access.c
37
int fd;
regress/sys/kern/unveil/access.c
38
UV_SHOULD_SUCCEED(((fd = open(filename, O_WRONLY|O_CREAT, 0700)) == -1), "open");
regress/sys/kern/unveil/access.c
39
UV_SHOULD_SUCCEED((close(fd) == -1), "close");
regress/sys/kern/unveil/syscalls.c
336
int fd;
regress/sys/kern/unveil/syscalls.c
344
if ((fd = mkstemp(filename3)) == -1)
regress/sys/kern/unveil/syscalls.c
834
int fd2, fd;
regress/sys/kern/unveil/syscalls.c
846
UV_SHOULD_ENOENT((fd = (open("subdir", O_RDONLY | O_DIRECTORY)) == -1), "open");
regress/sys/mfs_noperm/nopermtest.c
112
int fd;
regress/sys/net/pflow/gen_traffic.c
141
gen_traffic_paused(int fd, short events, void *arg)
regress/sys/net/pflow/gen_traffic.c
148
gen_traffic_sender_paused(int fd, short events, void *arg)
regress/sys/net/pflow/gen_traffic.c
155
gen_traffic_accept(int fd, short events, void *arg)
regress/sys/net/pflow/gen_traffic.c
168
s = accept(fd, (struct sockaddr *)&ss, &len);
regress/sys/net/pflow/gen_traffic.c
192
r->fd = s;
regress/sys/net/pflow/gen_traffic.c
199
gen_traffic_request(int fd, short events, void *arg)
regress/sys/net/pflow/gen_traffic.c
208
n = read(fd, buf, 4096);
regress/sys/net/pflow/gen_traffic.c
231
gen_traffic_write(int fd, short events, void *arg)
regress/sys/net/pflow/gen_traffic.c
244
close(fd);
regress/sys/net/pflow/gen_traffic.c
247
if (write(fd, buf, 4096) == -1)
regress/sys/net/pflow/gen_traffic.c
52
int fd;
regress/sys/net/pflow/gen_traffic.c
57
int fd;
regress/sys/netinet/bindconnect/bindconnect.c
164
int fd;
regress/sys/netinet/bindconnect/bindconnect.c
169
fd = socket(af, type | SOCK_NONBLOCK, proto);
regress/sys/netinet/bindconnect/bindconnect.c
170
if (fd < 0 || !reuse_port)
regress/sys/netinet/bindconnect/bindconnect.c
173
setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt));
regress/sys/netinet/bindconnect/bindconnect.c
184
int fd;
regress/sys/netinet/bindconnect/bindconnect.c
187
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/netinet/bindconnect/bindconnect.c
188
close(fd);
regress/sys/netinet/bindconnect/bindconnect.c
199
int fd;
regress/sys/netinet/bindconnect/bindconnect.c
205
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/netinet/bindconnect/bindconnect.c
206
bind(fd, &su.su_sa, su.su_sa.sa_len);
regress/sys/netinet/bindconnect/bindconnect.c
217
int fd;
regress/sys/netinet/bindconnect/bindconnect.c
223
fd = fd_base + arc4random_uniform(fd_num);
regress/sys/netinet/bindconnect/bindconnect.c
229
connect(fd, &su.su_sa, su.su_sa.sa_len);
regress/sys/netinet/mcast/mcroute.c
192
fd = open("/dev/null", O_RDWR);
regress/sys/netinet/mcast/mcroute.c
193
if (fd == -1)
regress/sys/netinet/mcast/mcroute.c
195
if (dup2(fd, 0) == -1)
regress/sys/netinet/mcast/mcroute.c
197
if (dup2(fd, 1) == -1)
regress/sys/netinet/mcast/mcroute.c
199
if (dup2(fd, 2) == -1)
regress/sys/netinet/mcast/mcroute.c
96
int value, ch, s, fd, background, norecv;
regress/sys/netinet/sendsrcaddr/runtest.c
257
pfd[0].fd = s;
regress/sys/netinet6/mcast6/mc6route.c
195
fd = open("/dev/null", O_RDWR);
regress/sys/netinet6/mcast6/mc6route.c
196
if (fd == -1)
regress/sys/netinet6/mcast6/mc6route.c
198
if (dup2(fd, 0) == -1)
regress/sys/netinet6/mcast6/mc6route.c
200
if (dup2(fd, 1) == -1)
regress/sys/netinet6/mcast6/mc6route.c
202
if (dup2(fd, 2) == -1)
regress/sys/netinet6/mcast6/mc6route.c
97
int value, ch, s, fd, background, norecv;
regress/sys/nfs/mmap-sysctl-copyin.c
33
int fd, val;
regress/sys/nfs/mmap-sysctl-copyin.c
41
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0777)) == -1)
regress/sys/nfs/mmap-sysctl-copyin.c
48
if (write(fd, &val, len) == -1)
regress/sys/nfs/mmap-sysctl-copyin.c
50
if (close(fd) == -1)
regress/sys/nfs/mmap-sysctl-copyin.c
58
if ((fd = open(path, O_RDWR)) == -1)
regress/sys/nfs/mmap-sysctl-copyin.c
60
p = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
regress/sys/nfs/mmap-sysctl-copyin.c
65
if (close(fd) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
34
int fd;
regress/sys/nfs/mmap-sysctl-copyout.c
42
if ((fd = open(path, O_RDWR|O_CREAT|O_TRUNC, 0777)) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
46
if ((n = write(fd, &stats, len)) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
50
if (close(fd) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
57
if ((fd = open(path, O_RDWR)) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
59
p = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
regress/sys/nfs/mmap-sysctl-copyout.c
66
if (close(fd) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
73
if ((fd = open(path, O_RDONLY)) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
75
if ((n = read(fd, &stats, len)) == -1)
regress/sys/nfs/mmap-sysctl-copyout.c
79
if (close(fd) == -1)
regress/sys/uvm/minherit_zero/minherit_zero.c
124
int fd = open(_PATH_BSHELL, O_RDONLY);
regress/sys/uvm/minherit_zero/minherit_zero.c
125
CHECK_GE(fd, 0);
regress/sys/uvm/minherit_zero/minherit_zero.c
126
dotest(fd, len, MAP_FILE|MAP_PRIVATE);
regress/sys/uvm/minherit_zero/minherit_zero.c
127
CHECK_EQ(0, close(fd));
regress/sys/uvm/minherit_zero/minherit_zero.c
68
dotest(int fd, size_t len, int flags)
regress/sys/uvm/minherit_zero/minherit_zero.c
73
p = mmap(NULL, len, PROT_READ|PROT_WRITE, flags, fd, 0);
regress/sys/uvm/mmap0/mmap0.c
38
int fd;
regress/sys/uvm/mmap0/mmap0.c
40
fd = open("/dev/zero", O_RDWR);
regress/sys/uvm/mmap0/mmap0.c
41
if (fd == -1)
regress/sys/uvm/mmap0/mmap0.c
54
ptr = mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
regress/sys/uvm/mmap_4g/mmap_4g.c
23
int fd;
regress/sys/uvm/mmap_4g/mmap_4g.c
29
fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
regress/sys/uvm/mmap_4g/mmap_4g.c
30
if (fd == -1)
regress/sys/uvm/mmap_4g/mmap_4g.c
36
if (lseek(fd, offset, SEEK_SET) != offset)
regress/sys/uvm/mmap_4g/mmap_4g.c
39
if (write(fd, buf, sz) != sz)
regress/sys/uvm/mmap_4g/mmap_4g.c
41
close(fd);
regress/sys/uvm/mmap_4g/mmap_4g.c
43
fd = open(file, O_RDWR);
regress/sys/uvm/mmap_4g/mmap_4g.c
44
if (fd == -1)
regress/sys/uvm/mmap_4g/mmap_4g.c
47
fd, offset);
regress/sys/uvm/mmap_4g/mmap_4g.c
54
close(fd);
regress/sys/uvm/mmap_4g/mmap_4g.c
56
fd = open(file, O_RDONLY);
regress/sys/uvm/mmap_4g/mmap_4g.c
57
if (fd == -1)
regress/sys/uvm/mmap_4g/mmap_4g.c
59
if (read(fd, buf, sz) != sz)
regress/sys/uvm/mmap_4g/mmap_4g.c
66
if (lseek(fd, offset, SEEK_SET) != offset)
regress/sys/uvm/mmap_4g/mmap_4g.c
68
if (read(fd, buf, sz) != sz)
regress/sys/uvm/mmap_4g/mmap_4g.c
75
close(fd);
regress/sys/uvm/mmap_mod/mmap_mod.c
25
int fd;
regress/sys/uvm/mmap_mod/mmap_mod.c
29
if ((fd = mkstemp(name)) == -1)
regress/sys/uvm/mmap_mod/mmap_mod.c
35
if (ftruncate(fd, ps))
regress/sys/uvm/mmap_mod/mmap_mod.c
43
if (pwrite(fd, pat, ps, 0) != ps)
regress/sys/uvm/mmap_mod/mmap_mod.c
46
buf = mmap(NULL, ps, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0);
regress/sys/uvm/mmap_mod/mmap_mod.c
58
buf = mmap(NULL, ps, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0);
regress/sys/uvm/mmap_mod/mmap_mod.c
68
if (pread(fd, pat, ps, 0) != ps)
regress/sys/uvm/mmap_write_self/mmap_write_self.c
37
int fd;
regress/sys/uvm/mmap_write_self/mmap_write_self.c
41
if ((fd = mkstemp(name)) == -1)
regress/sys/uvm/mmap_write_self/mmap_write_self.c
47
buf = mmap(NULL, ps, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0);
regress/sys/uvm/mmap_write_self/mmap_write_self.c
51
if (pwrite(fd, buf, ps, 0) == ps)
regress/sys/uvm/vnode/test-deadlock.c
100
if (ftruncate(fd, npages * PAGE_SIZE) == -1)
regress/sys/uvm/vnode/test-deadlock.c
104
fd, 0);
regress/sys/uvm/vnode/test-deadlock.c
113
close(fd);
regress/sys/uvm/vnode/test-deadlock.c
120
int fd;
regress/sys/uvm/vnode/test-deadlock.c
123
fd = open(path, O_RDONLY);
regress/sys/uvm/vnode/test-deadlock.c
124
if (fd == -1)
regress/sys/uvm/vnode/test-deadlock.c
127
fd, 0);
regress/sys/uvm/vnode/test-deadlock.c
89
int fd;
regress/sys/uvm/vnode/test-deadlock.c
95
fd = open(path, O_RDWR | O_TRUNC);
regress/sys/uvm/vnode/test-deadlock.c
96
if (fd == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
31
int fd, rev;
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
52
if ((fd = open("1", O_WRONLY | O_CREAT | O_EXCL, 0644)) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
54
if (fstat(fd, &sb1) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
56
if (close(fd) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
58
if ((fd = open("2", O_WRONLY | O_CREAT | O_EXCL, 0644)) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
60
if (fstat(fd, &sb2) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
62
if (close(fd) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
65
if ((fd = open("3", O_WRONLY | O_CREAT | O_EXCL, 0644)) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
67
if (fstat(fd, &sb2) == -1)
regress/usr.bin/mandoc/db/makeinodes/makeinodes.c
69
if (close(fd) == -1)
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
20
int fd;
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
22
fd = open(name, O_RDONLY | O_NONBLOCK);
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
23
if (fd == -1)
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
25
return fd;
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
34
int fd, ch, timeout = 0;
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
56
pfd[0].fd = 0;
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
58
pfd[1].fd = fd = fifo_open(fifo);
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
83
n = read(fd, buf, sizeof(buf));
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
93
close(fd);
regress/usr.sbin/bgpd/integrationtests/api-exabgp.c
94
pfd[1].fd = fd = fifo_open(fifo);
regress/usr.sbin/ospfd/opentap.c
43
int fd, tap;
regress/usr.sbin/ospfd/opentap.c
56
fd = strtonum(argv[1], 0, INT_MAX, &errstr);
regress/usr.sbin/ospfd/opentap.c
77
if (sendmsg(fd, &msg, 0) == -1)
regress/usr.sbin/ospfd/opentap.c
78
err(1, "sendmsg %d", fd);
regress/usr.sbin/rpki-client/test-http.c
124
int error, fd[2], outfd, httpfd;
regress/usr.sbin/rpki-client/test-http.c
137
if (socketpair(AF_UNIX, fl, 0, fd) == -1)
regress/usr.sbin/rpki-client/test-http.c
144
close(fd[1]);
regress/usr.sbin/rpki-client/test-http.c
149
proc_http(NULL, fd[0]);
regress/usr.sbin/rpki-client/test-http.c
153
close(fd[0]);
regress/usr.sbin/rpki-client/test-http.c
154
httpfd = fd[1];
regress/usr.sbin/rpki-client/test-http.c
61
http_request(unsigned int id, const char *uri, const char *last_mod, int fd)
regress/usr.sbin/rpki-client/test-http.c
70
b->fd = fd;
regress/usr.sbin/rpki-client/test-http.c
90
http_response(int fd)
regress/usr.sbin/rpki-client/test-http.c
98
switch (msgbuf_read(fd, httpq)) {
regress/usr.sbin/snmpd/agentx.c
3115
.fd = s,
regress/usr.sbin/snmpd/agentx.c
3145
.fd = s,
regress/usr.sbin/snmpd/snmp.c
309
.fd = s,
regress/usr.sbin/snmpd/snmp.c
641
.fd = s,
regress/usr.sbin/syslogd/ttylog.c
149
int fd, on;
regress/usr.sbin/syslogd/ttylog.c
154
if ((fd = open("/dev/console", O_WRONLY)) == -1)
regress/usr.sbin/syslogd/ttylog.c
156
if (ioctl(fd, TIOCCONS, &on) == -1)
regress/usr.sbin/syslogd/ttylog.c
158
close(fd);
sbin/atactl/atactl.c
394
if ((fd = opendev(argv[1], O_RDWR, OPENDEV_PART, NULL)) == -1)
sbin/atactl/atactl.c
433
if (ioctl(fd, ATAIOCCOMMAND, req) == -1)
sbin/atactl/atactl.c
529
if (ioctl(fd, ATAIOGETTRACE, &agt) == -1)
sbin/atactl/atactl.c
79
int fd; /* file descriptor for device */
sbin/bioctl/bioctl.c
1004
int fd;
sbin/bioctl/bioctl.c
1018
fd = opendev(dev, O_RDONLY, OPENDEV_BLCK, NULL);
sbin/bioctl/bioctl.c
1019
if (fd == -1)
sbin/bioctl/bioctl.c
1021
if (fstat(fd, &sb) == -1) {
sbin/bioctl/bioctl.c
1023
close(fd);
sbin/bioctl/bioctl.c
1026
close(fd);
sbin/bioctl/bioctl.c
836
int rv, no_dev, fd;
sbin/bioctl/bioctl.c
916
fd = opendev(key_disk, O_RDONLY, OPENDEV_BLCK, NULL);
sbin/bioctl/bioctl.c
917
if (fd == -1)
sbin/bioctl/bioctl.c
919
if (fstat(fd, &sb) == -1) {
sbin/bioctl/bioctl.c
921
close(fd);
sbin/bioctl/bioctl.c
924
close(fd);
sbin/clri/clri.c
115
if (pwrite(fd, sblock, sizeof(sblock), offset) != sizeof(sblock))
sbin/clri/clri.c
117
(void)fsync(fd);
sbin/clri/clri.c
132
if (pread(fd, ibuf, bsize, offset) != bsize)
sbin/clri/clri.c
154
if (pwrite(fd, ibuf, bsize, offset) != bsize)
sbin/clri/clri.c
156
(void)fsync(fd);
sbin/clri/clri.c
158
(void)close(fd);
sbin/clri/clri.c
71
int i, fd;
sbin/clri/clri.c
81
if ((fd = opendev(fs, O_RDWR, 0, NULL)) == -1)
sbin/clri/clri.c
89
if (pread(fd, sblock, sizeof(sblock), offset) != sizeof(sblock))
sbin/dhcp6leased/control.c
100
return (fd);
sbin/dhcp6leased/control.c
104
control_listen(int fd)
sbin/dhcp6leased/control.c
106
if (control_state.fd != -1)
sbin/dhcp6leased/control.c
109
control_state.fd = fd;
sbin/dhcp6leased/control.c
110
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
sbin/dhcp6leased/control.c
115
event_set(&control_state.ev, control_state.fd, EV_READ,
sbin/dhcp6leased/control.c
167
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
sbin/dhcp6leased/control.c
175
control_connbyfd(int fd)
sbin/dhcp6leased/control.c
180
if (c->iev.ibuf.fd == fd)
sbin/dhcp6leased/control.c
201
control_close(int fd)
sbin/dhcp6leased/control.c
205
if ((c = control_connbyfd(fd)) == NULL) {
sbin/dhcp6leased/control.c
206
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/dhcp6leased/control.c
214
close(c->iev.ibuf.fd);
sbin/dhcp6leased/control.c
226
control_dispatch_imsg(int fd, short event, void *bula)
sbin/dhcp6leased/control.c
233
if ((c = control_connbyfd(fd)) == NULL) {
sbin/dhcp6leased/control.c
234
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/dhcp6leased/control.c
240
control_close(fd);
sbin/dhcp6leased/control.c
246
control_close(fd);
sbin/dhcp6leased/control.c
253
control_close(fd);
sbin/dhcp6leased/control.c
46
int fd;
sbin/dhcp6leased/control.c
47
} control_state = {.fd = -1};
sbin/dhcp6leased/control.c
64
int fd;
sbin/dhcp6leased/control.c
67
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
sbin/dhcp6leased/control.c
80
close(fd);
sbin/dhcp6leased/control.c
85
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
sbin/dhcp6leased/control.c
87
close(fd);
sbin/dhcp6leased/control.c
95
close(fd);
sbin/dhcp6leased/dhcp6leased.c
1003
int len, fd, rem;
sbin/dhcp6leased/dhcp6leased.c
1058
if ((fd = mkstemp(tmpl)) == -1) {
sbin/dhcp6leased/dhcp6leased.c
1063
if (write(fd, lease_buf, len) < len)
sbin/dhcp6leased/dhcp6leased.c
1066
if (fchmod(fd, 0644) == -1)
sbin/dhcp6leased/dhcp6leased.c
1069
if (close(fd) == -1)
sbin/dhcp6leased/dhcp6leased.c
1071
fd = -1;
sbin/dhcp6leased/dhcp6leased.c
1078
if (fd != -1)
sbin/dhcp6leased/dhcp6leased.c
1079
close(fd);
sbin/dhcp6leased/dhcp6leased.c
1190
int fd, len;
sbin/dhcp6leased/dhcp6leased.c
1195
if ((fd = open(_PATH_UUID, O_RDONLY)) == -1) {
sbin/dhcp6leased/dhcp6leased.c
1207
if ((fd = mkstemp(tmpl)) == -1) {
sbin/dhcp6leased/dhcp6leased.c
1211
if (write(fd, strbuf, len) < len) {
sbin/dhcp6leased/dhcp6leased.c
1215
if (fchmod(fd, 0644) == -1) {
sbin/dhcp6leased/dhcp6leased.c
1220
if (close(fd) == -1) {
sbin/dhcp6leased/dhcp6leased.c
1224
fd = -1;
sbin/dhcp6leased/dhcp6leased.c
1230
read(fd, strbuf, sizeof(strbuf));
sbin/dhcp6leased/dhcp6leased.c
1231
close(fd);
sbin/dhcp6leased/dhcp6leased.c
1246
if (fd != -1)
sbin/dhcp6leased/dhcp6leased.c
1247
close(fd);
sbin/dhcp6leased/dhcp6leased.c
275
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/dhcp6leased/dhcp6leased.c
280
event_set(&iev_engine->ev, iev_engine->ibuf.fd, iev_engine->events,
sbin/dhcp6leased/dhcp6leased.c
347
close(iev_frontend->ibuf.fd);
sbin/dhcp6leased/dhcp6leased.c
349
close(iev_engine->ibuf.fd);
sbin/dhcp6leased/dhcp6leased.c
373
start_child(enum dhcp6leased_process p, char *argv0, int fd, int debug, int
sbin/dhcp6leased/dhcp6leased.c
386
close(fd);
sbin/dhcp6leased/dhcp6leased.c
390
if (fd != 3) {
sbin/dhcp6leased/dhcp6leased.c
391
if (dup2(fd, 3) == -1)
sbin/dhcp6leased/dhcp6leased.c
393
} else if (fcntl(fd, F_SETFD, 0) == -1)
sbin/dhcp6leased/dhcp6leased.c
420
main_dispatch_frontend(int fd, short event, void *bula)
sbin/dhcp6leased/dhcp6leased.c
501
main_dispatch_engine(int fd, short event, void *bula)
sbin/dhcp6leased/dhcp6leased.c
605
main_imsg_compose_frontend(int type, int fd, void *data, uint16_t datalen)
sbin/dhcp6leased/dhcp6leased.c
608
return (imsg_compose_event(iev_frontend, type, 0, 0, fd, data,
sbin/dhcp6leased/dhcp6leased.c
615
main_imsg_compose_engine(int type, int fd, void *data, uint16_t datalen)
sbin/dhcp6leased/dhcp6leased.c
618
return(imsg_compose_event(iev_engine, type, 0, 0, fd, data,
sbin/dhcp6leased/dhcp6leased.c
632
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
sbin/dhcp6leased/dhcp6leased.c
638
pid_t pid, int fd, void *data, uint16_t datalen)
sbin/dhcp6leased/dhcp6leased.c
642
if ((ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data,
sbin/dhcp6leased/engine.c
1225
iface_timeout(int fd, short events, void *arg)
sbin/dhcp6leased/engine.c
229
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/dhcp6leased/engine.c
245
close(iev_frontend->ibuf.fd);
sbin/dhcp6leased/engine.c
247
close(iev_main->ibuf.fd);
sbin/dhcp6leased/engine.c
273
engine_dispatch_frontend(int fd, short event, void *bula)
sbin/dhcp6leased/engine.c
380
engine_dispatch_main(int fd, short event, void *bula)
sbin/dhcp6leased/engine.c
424
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcp6leased/engine.c
432
if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
sbin/dhcp6leased/engine.c
437
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/dhcp6leased/frontend.c
188
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/dhcp6leased/frontend.c
204
close(iev_engine->ibuf.fd);
sbin/dhcp6leased/frontend.c
207
close(iev_main->ibuf.fd);
sbin/dhcp6leased/frontend.c
235
frontend_dispatch_main(int fd, short event, void *bula)
sbin/dhcp6leased/frontend.c
278
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcp6leased/frontend.c
287
if (imsgbuf_init(&iev_engine->ibuf, fd) == -1)
sbin/dhcp6leased/frontend.c
292
event_set(&iev_engine->ev, iev_engine->ibuf.fd,
sbin/dhcp6leased/frontend.c
308
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcp6leased/frontend.c
312
event_set(&ev_route, fd, EV_READ | EV_PERSIST,
sbin/dhcp6leased/frontend.c
428
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcp6leased/frontend.c
433
control_listen(fd);
sbin/dhcp6leased/frontend.c
455
frontend_dispatch_engine(int fd, short event, void *bula)
sbin/dhcp6leased/frontend.c
628
route_receive(int fd, short events, void *arg)
sbin/dhcp6leased/frontend.c
642
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
sbin/dhcp6leased/frontend.c
711
udp_receive(int fd, short events, void *arg)
sbin/dhcp6leased/frontend.c
720
if ((len = read(fd, imsg_dhcp.packet, 1500)) == -1) {
sbin/dhcp6leased/parse.y
523
check_file_secrecy(int fd, const char *fname)
sbin/dhcp6leased/parse.y
527
if (fstat(fd, &st)) {
sbin/dhcpleased/control.c
100
return (fd);
sbin/dhcpleased/control.c
104
control_listen(int fd)
sbin/dhcpleased/control.c
106
if (control_state.fd != -1)
sbin/dhcpleased/control.c
109
control_state.fd = fd;
sbin/dhcpleased/control.c
110
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
sbin/dhcpleased/control.c
115
event_set(&control_state.ev, control_state.fd, EV_READ,
sbin/dhcpleased/control.c
167
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
sbin/dhcpleased/control.c
175
control_connbyfd(int fd)
sbin/dhcpleased/control.c
180
if (c->iev.ibuf.fd == fd)
sbin/dhcpleased/control.c
201
control_close(int fd)
sbin/dhcpleased/control.c
205
if ((c = control_connbyfd(fd)) == NULL) {
sbin/dhcpleased/control.c
206
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/dhcpleased/control.c
214
close(c->iev.ibuf.fd);
sbin/dhcpleased/control.c
226
control_dispatch_imsg(int fd, short event, void *bula)
sbin/dhcpleased/control.c
235
if ((c = control_connbyfd(fd)) == NULL) {
sbin/dhcpleased/control.c
236
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/dhcpleased/control.c
242
control_close(fd);
sbin/dhcpleased/control.c
248
control_close(fd);
sbin/dhcpleased/control.c
255
control_close(fd);
sbin/dhcpleased/control.c
46
int fd;
sbin/dhcpleased/control.c
47
} control_state = {.fd = -1};
sbin/dhcpleased/control.c
64
int fd;
sbin/dhcpleased/control.c
67
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
sbin/dhcpleased/control.c
80
close(fd);
sbin/dhcpleased/control.c
85
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
sbin/dhcpleased/control.c
87
close(fd);
sbin/dhcpleased/control.c
95
close(fd);
sbin/dhcpleased/dhcpleased.c
1282
int len, fd;
sbin/dhcpleased/dhcpleased.c
1305
if ((fd = open(lease_file_buf, O_RDONLY)) == -1)
sbin/dhcpleased/dhcpleased.c
1309
read(fd, imsg_ifinfo->lease, sizeof(imsg_ifinfo->lease) - 1);
sbin/dhcpleased/dhcpleased.c
1310
close(fd);
sbin/dhcpleased/dhcpleased.c
287
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/dhcpleased/dhcpleased.c
292
event_set(&iev_engine->ev, iev_engine->ibuf.fd, iev_engine->events,
sbin/dhcpleased/dhcpleased.c
360
close(iev_frontend->ibuf.fd);
sbin/dhcpleased/dhcpleased.c
362
close(iev_engine->ibuf.fd);
sbin/dhcpleased/dhcpleased.c
388
start_child(enum dhcpleased_process p, char *argv0, int fd, int debug, int
sbin/dhcpleased/dhcpleased.c
401
close(fd);
sbin/dhcpleased/dhcpleased.c
405
if (fd != 3) {
sbin/dhcpleased/dhcpleased.c
406
if (dup2(fd, 3) == -1)
sbin/dhcpleased/dhcpleased.c
408
} else if (fcntl(fd, F_SETFD, 0) == -1)
sbin/dhcpleased/dhcpleased.c
435
main_dispatch_frontend(int fd, short event, void *bula)
sbin/dhcpleased/dhcpleased.c
521
main_dispatch_engine(int fd, short event, void *bula)
sbin/dhcpleased/dhcpleased.c
667
main_imsg_compose_frontend(int type, int fd, void *data, uint16_t datalen)
sbin/dhcpleased/dhcpleased.c
670
return (imsg_compose_event(iev_frontend, type, 0, 0, fd, data,
sbin/dhcpleased/dhcpleased.c
677
main_imsg_compose_engine(int type, int fd, void *data, uint16_t datalen)
sbin/dhcpleased/dhcpleased.c
680
return(imsg_compose_event(iev_engine, type, 0, 0, fd, data,
sbin/dhcpleased/dhcpleased.c
694
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
sbin/dhcpleased/dhcpleased.c
700
pid_t pid, int fd, void *data, uint16_t datalen)
sbin/dhcpleased/dhcpleased.c
704
if ((ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data,
sbin/dhcpleased/dhcpleased.c
817
int found = 0, udpsock, opt = 1, len, fd = -1;
sbin/dhcpleased/dhcpleased.c
951
if ((fd = mkstemp(tmpl)) == -1) {
sbin/dhcpleased/dhcpleased.c
956
if (write(fd, lease_buf, len) < len)
sbin/dhcpleased/dhcpleased.c
959
if (fchmod(fd, 0644) == -1)
sbin/dhcpleased/dhcpleased.c
962
if (close(fd) == -1)
sbin/dhcpleased/dhcpleased.c
964
fd = -1;
sbin/dhcpleased/dhcpleased.c
971
if (fd != -1)
sbin/dhcpleased/dhcpleased.c
972
close(fd);
sbin/dhcpleased/engine.c
1545
iface_timeout(int fd, short events, void *arg)
sbin/dhcpleased/engine.c
240
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/dhcpleased/engine.c
256
close(iev_frontend->ibuf.fd);
sbin/dhcpleased/engine.c
258
close(iev_main->ibuf.fd);
sbin/dhcpleased/engine.c
284
engine_dispatch_frontend(int fd, short event, void *bula)
sbin/dhcpleased/engine.c
402
engine_dispatch_main(int fd, short event, void *bula)
sbin/dhcpleased/engine.c
450
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcpleased/engine.c
458
if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
sbin/dhcpleased/engine.c
463
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/dhcpleased/frontend.c
185
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/dhcpleased/frontend.c
201
close(iev_engine->ibuf.fd);
sbin/dhcpleased/frontend.c
204
close(iev_main->ibuf.fd);
sbin/dhcpleased/frontend.c
234
frontend_dispatch_main(int fd, short event, void *bula)
sbin/dhcpleased/frontend.c
282
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcpleased/frontend.c
291
if (imsgbuf_init(&iev_engine->ibuf, fd) == -1)
sbin/dhcpleased/frontend.c
296
event_set(&iev_engine->ev, iev_engine->ibuf.fd,
sbin/dhcpleased/frontend.c
341
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcpleased/frontend.c
345
event_set(&ev_route, fd, EV_READ | EV_PERSIST,
sbin/dhcpleased/frontend.c
463
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/dhcpleased/frontend.c
468
control_listen(fd);
sbin/dhcpleased/frontend.c
490
frontend_dispatch_engine(int fd, short event, void *bula)
sbin/dhcpleased/frontend.c
768
route_receive(int fd, short events, void *arg)
sbin/dhcpleased/frontend.c
782
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
sbin/dhcpleased/frontend.c
861
bpf_receive(int fd, short events, void *arg)
sbin/dhcpleased/frontend.c
871
if ((len = read(fd, iface->bpfev.buf, BPFLEN)) == -1) {
sbin/dhcpleased/parse.y
651
check_file_secrecy(int fd, const char *fname)
sbin/dhcpleased/parse.y
655
if (fstat(fd, &st)) {
sbin/disklabel/disklabel.c
606
int first, ch, fd, error = 0;
sbin/disklabel/disklabel.c
610
if ((fd = mkstemp(tmpfil)) == -1 || (fp = fdopen(fd, "w")) == NULL) {
sbin/disklabel/disklabel.c
612
if (fd != -1)
sbin/disklabel/disklabel.c
613
close(fd);
sbin/dump/itime.c
164
int fd, i;
sbin/dump/itime.c
172
fd = fileno(df);
sbin/dump/itime.c
173
(void) flock(fd, LOCK_EX);
sbin/dump/itime.c
212
if (ftruncate(fd, ftello(df)))
sbin/dump/main.c
680
int fd;
sbin/dump/main.c
685
if ((fd = opendev(path, O_RDONLY | O_NOFOLLOW, 0, NULL)) >= 0) {
sbin/dump/main.c
686
if (ioctl(fd, DIOCGDINFO, (char *)&lab) == -1) {
sbin/dump/main.c
687
close(fd);
sbin/dump/main.c
691
close(fd);
sbin/dump/tape.c
102
int fd; /* FD for this slave */
sbin/dump/tape.c
288
if (atomic((ssize_t (*)(int, void *, size_t))write, slp->fd,
sbin/dump/tape.c
300
if (atomic(read, slp->fd, (char *)&got, sizeof(got))
sbin/dump/tape.c
317
if (atomic(read, slaves[i].fd,
sbin/dump/tape.c
375
if (atomic(read, slaves[f].fd, (char *)&got, sizeof(got))
sbin/dump/tape.c
387
(void) close(slaves[f].fd);
sbin/dump/tape.c
501
slp->fd, (char *)q, size) != size) {
sbin/dump/tape.c
541
if (atomic(read, slp->fd, (char *)&got, sizeof(got))
sbin/dump/tape.c
762
slaves[i].fd = cmd[1];
sbin/dump/tape.c
766
(void) close(slaves[j].fd);
sbin/dump/tape.c
776
slaves[i].fd, (char *) &slaves[(i + 1) % SLAVES].pid,
sbin/dump/tape.c
918
atomic(ssize_t (*func)(int, void *, size_t), int fd, char *buf, int count)
sbin/dump/tape.c
922
while ((got = (*func)(fd, buf, need)) > 0 && (need -= got) > 0)
sbin/dumpfs/dumpfs.c
110
if ((fd = open_disk(name)) == -1) {
sbin/dumpfs/dumpfs.c
117
eval |= dumpfs(fd, name);
sbin/dumpfs/dumpfs.c
118
close(fd);
sbin/dumpfs/dumpfs.c
126
int fd, i, sbtry[] = SBLOCKSEARCH;
sbin/dumpfs/dumpfs.c
130
if ((fd = opendev(name, O_RDONLY, 0, NULL)) == -1) {
sbin/dumpfs/dumpfs.c
137
n = pread(fd, &afs, SBLOCKSIZE, (off_t)sbtry[i]);
sbin/dumpfs/dumpfs.c
149
close(fd);
sbin/dumpfs/dumpfs.c
153
return (fd);
sbin/dumpfs/dumpfs.c
157
dumpfs(int fd, const char *name)
sbin/dumpfs/dumpfs.c
305
if (pread(fd, (char *)afs.fs_csp + i, size, off) != size)
sbin/dumpfs/dumpfs.c
325
if (dumpcg(name, fd, cg))
sbin/dumpfs/dumpfs.c
334
dumpcg(const char *name, int fd, u_int c)
sbin/dumpfs/dumpfs.c
343
if (pread(fd, &acg, afs.fs_bsize, cur) != afs.fs_bsize) {
sbin/dumpfs/dumpfs.c
83
int ch, domarshal, eval, fd;
sbin/fdisk/fdisk.c
293
int fd;
sbin/fdisk/fdisk.c
302
fd = open(mbrfile, O_RDONLY);
sbin/fdisk/fdisk.c
303
if (fd == -1)
sbin/fdisk/fdisk.c
307
len = read(fd, dmbr, sz);
sbin/fdisk/fdisk.c
313
close(fd);
sbin/fsck_ext2fs/setup.c
500
getdisklabel(char *s, int fd)
sbin/fsck_ext2fs/setup.c
504
if (ioctl(fd, DIOCGDINFO, (char *)&lab) == -1) {
sbin/fsck_ext2fs/utilities.c
196
flush(int fd, struct bufarea *bp)
sbin/fsck_ext2fs/utilities.c
208
bwrite(fd, bp->b_un.b_buf, bp->b_bno, (long)bp->b_size);
sbin/fsck_ext2fs/utilities.c
282
bread(int fd, char *buf, daddr32_t blk, long size)
sbin/fsck_ext2fs/utilities.c
290
if (pread(fd, buf, size, offset) == size)
sbin/fsck_ext2fs/utilities.c
297
if (pread(fd, cp, secsize, offset + i) != secsize) {
sbin/fsck_ext2fs/utilities.c
313
bwrite(int fd, char *buf, daddr32_t blk, long size)
sbin/fsck_ext2fs/utilities.c
319
if (fd < 0)
sbin/fsck_ext2fs/utilities.c
323
if (pwrite(fd, buf, size, offset) == size) {
sbin/fsck_ext2fs/utilities.c
330
if (pwrite(fd, cp, secsize, offset + i) != secsize) {
sbin/fsck_ffs/setup.c
659
getdisklabel(char *s, int fd)
sbin/fsck_ffs/setup.c
663
if (ioctl(fd, DIOCGDINFO, (char *)&lab) == -1) {
sbin/fsck_ffs/utilities.c
258
flush(int fd, struct bufarea *bp)
sbin/fsck_ffs/utilities.c
270
bwrite(fd, bp->b_un.b_buf, bp->b_bno, (long)bp->b_size);
sbin/fsck_ffs/utilities.c
377
bread(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ffs/utilities.c
385
if (pread(fd, buf, size, offset) == size)
sbin/fsck_ffs/utilities.c
392
if (pread(fd, cp, secsize, offset + i) != secsize) {
sbin/fsck_ffs/utilities.c
408
bwrite(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ffs/utilities.c
414
if (fd < 0)
sbin/fsck_ffs/utilities.c
418
if (pwrite(fd, buf, size, offset) == size) {
sbin/fsck_ffs/utilities.c
425
if (pwrite(fd, cp, secsize, offset + i) != secsize) {
sbin/fsdb/fsdb.h
33
extern int bread(int fd, char *buf, daddr_t blk, long size);
sbin/fsdb/fsdb.h
34
extern void bwrite(int fd, char *buf, daddr_t blk, long size);
sbin/growfs/growfs.c
1957
return_disklabel(int fd, struct disklabel *lp, unsigned int Nflag)
sbin/growfs/growfs.c
1977
if (ioctl(fd, DIOCWDINFO, (char *)lp) == -1)
sbin/growfs/growfs.c
1989
get_disklabel(int fd)
sbin/growfs/growfs.c
1996
if (ioctl(fd, DIOCGDINFO, (char *)lab) != 0)
sbin/ifconfig/brconfig.c
301
u_int8_t ht, fd, ma, hc, proto;
sbin/ifconfig/brconfig.c
315
fd = ifbp.ifbop_fwddelay;
sbin/ifconfig/brconfig.c
321
"holdcnt %u proto %s\n", pri, ht, fd, ma, hc, stpproto[proto]);
sbin/iked/ca.c
332
ca_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/ca.c
375
ca_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/ca.c
397
ca_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/config.c
736
int fd = imsg_get_fd(imsg);
sbin/iked/config.c
738
log_debug("%s: received pfkey fd %d", __func__, fd);
sbin/iked/config.c
739
pfkey_init(env, fd);
sbin/iked/control.c
104
close(fd);
sbin/iked/control.c
116
if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) {
sbin/iked/control.c
118
close(fd);
sbin/iked/control.c
126
close(fd);
sbin/iked/control.c
131
cs->cs_fd = fd;
sbin/iked/control.c
203
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
sbin/iked/control.c
217
control_connbyfd(int fd)
sbin/iked/control.c
222
if (c->iev.ibuf.fd == fd)
sbin/iked/control.c
230
control_close(int fd, struct control_sock *cs)
sbin/iked/control.c
234
if ((c = control_connbyfd(fd)) == NULL) {
sbin/iked/control.c
235
log_warn("%s: fd %d: not found", __func__, fd);
sbin/iked/control.c
243
close(c->iev.ibuf.fd);
sbin/iked/control.c
255
control_dispatch_imsg(int fd, short event, void *arg)
sbin/iked/control.c
263
if ((c = control_connbyfd(fd)) == NULL) {
sbin/iked/control.c
264
log_warn("%s: fd %d: not found", __func__, fd);
sbin/iked/control.c
270
control_close(fd, cs);
sbin/iked/control.c
276
control_close(fd, cs);
sbin/iked/control.c
283
control_close(fd, cs);
sbin/iked/control.c
369
control_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/control.c
384
control_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/control.c
82
int fd;
sbin/iked/control.c
88
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) {
sbin/iked/control.c
97
close(fd);
sbin/iked/iked.c
430
parent_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/iked.c
450
parent_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/iked.c
489
parent_dispatch_ikev2(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/iked.h
1295
void pfkey_init(struct iked *, int fd);
sbin/iked/ikev2.c
235
ikev2_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/ikev2.c
323
ikev2_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/ikev2.c
523
ikev2_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/ikev2_msg.c
100
msg.msg_fd = fd;
sbin/iked/ikev2_msg.c
57
ikev2_msg_cb(int fd, short event, void *arg)
sbin/iked/ikev2_msg.c
76
if ((len = recvfromto(fd, buf, sizeof(buf), 0,
sbin/iked/ocsp.c
120
if ((fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) {
sbin/iked/ocsp.c
148
oc->oc_sock.sock_fd = fd;
sbin/iked/ocsp.c
160
if (connect(fd, res->ai_addr, res->ai_addrlen) == -1) {
sbin/iked/ocsp.c
165
event_set(&oc->oc_sock.sock_ev, fd, EV_WRITE,
sbin/iked/ocsp.c
173
ocsp_connect_finish(env, fd, oc, &sh);
sbin/iked/ocsp.c
185
if (fd >= 0)
sbin/iked/ocsp.c
186
close(fd);
sbin/iked/ocsp.c
193
ocsp_connect_cb(int fd, short event, void *arg)
sbin/iked/ocsp.c
206
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
sbin/iked/ocsp.c
213
send_fd = fd;
sbin/iked/ocsp.c
220
close(fd);
sbin/iked/ocsp.c
225
ocsp_connect_finish(struct iked *env, int fd, struct ocsp_connect *oc,
sbin/iked/ocsp.c
235
if (oc && fd >= 0) {
sbin/iked/ocsp.c
241
IMSG_OCSP_FD, -1, fd, iov, iovcnt);
sbin/iked/ocsp.c
251
if (fd >= 0)
sbin/iked/ocsp.c
252
close(fd);
sbin/iked/ocsp.c
369
int fd, ret = -1;
sbin/iked/ocsp.c
388
if ((fd = imsg_get_fd(imsg)) != -1) /* XXX */
sbin/iked/ocsp.c
389
close(fd);
sbin/iked/ocsp.c
396
if ((fd = imsg_get_fd(imsg)) == -1)
sbin/iked/ocsp.c
403
sock->sock_fd = fd;
sbin/iked/ocsp.c
477
ocsp_callback(int fd, short event, void *arg)
sbin/iked/ocsp.c
89
int use_ssl, fd = -1, ret = -1, error;
sbin/iked/parse.y
1922
check_file_secrecy(int fd, const char *fname)
sbin/iked/parse.y
1926
if (fstat(fd, &st)) {
sbin/iked/parse.y
2191
int fd, ret;
sbin/iked/parse.y
2194
if ((fd = open(filename, O_RDONLY)) == -1)
sbin/iked/parse.y
2196
if (check_file_secrecy(fd, filename) == -1)
sbin/iked/parse.y
2198
if (fstat(fd, &sb) == -1)
sbin/iked/parse.y
2205
if (read(fd, hex, sb.st_size) < sb.st_size)
sbin/iked/parse.y
2207
close(fd);
sbin/iked/pfkey.c
1383
pfkey_reply(int fd, uint8_t **datap, ssize_t *lenp)
sbin/iked/pfkey.c
1392
pfd[0].fd = fd;
sbin/iked/pfkey.c
1413
if (recv(fd, &hdr, sizeof(hdr), MSG_PEEK) != sizeof(hdr)) {
sbin/iked/pfkey.c
1430
if (read(fd, data, len) != len) {
sbin/iked/pfkey.c
1714
int fd;
sbin/iked/pfkey.c
1719
if ((fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2)) == -1)
sbin/iked/pfkey.c
1722
return (fd);
sbin/iked/pfkey.c
1726
pfkey_init(struct iked *env, int fd)
sbin/iked/pfkey.c
1739
env->sc_pfkey = fd;
sbin/iked/pfkey.c
1795
pfkey_dispatch(int fd, short event, void *arg)
sbin/iked/pfkey.c
1803
if (recv(fd, &hdr, sizeof(hdr), MSG_PEEK) != sizeof(hdr)) {
sbin/iked/pfkey.c
1820
if (read(fd, data, len) != len) {
sbin/iked/proc.c
114
fd = ps->ps_pipes[p->p_id][i].pp_pipes[PROC_PARENT][0];
sbin/iked/proc.c
123
if (fd != PROC_PARENT_SOCK_FILENO) {
sbin/iked/proc.c
124
if (dup2(fd, PROC_PARENT_SOCK_FILENO) ==
sbin/iked/proc.c
127
} else if (fcntl(fd, F_SETFD, 0) == -1)
sbin/iked/proc.c
135
close(fd);
sbin/iked/proc.c
169
event_set(&iev->ev, iev->ibuf.fd, iev->events,
sbin/iked/proc.c
271
proc_accept(struct privsep *ps, int fd, enum privsep_procid dst,
sbin/iked/proc.c
277
if (fd == -1 || dst < 0 || dst >= PROC_MAX ||
sbin/iked/proc.c
289
close(fd);
sbin/iked/proc.c
295
pp->pp_pipes[dst][n] = fd;
sbin/iked/proc.c
298
if (imsgbuf_init(&iev->ibuf, fd) == -1)
sbin/iked/proc.c
301
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
sbin/iked/proc.c
606
proc_dispatch(int fd, short event, void *arg)
sbin/iked/proc.c
661
if ((p->p_cb)(fd, p, &imsg) == 0) {
sbin/iked/proc.c
731
proc_dispatch_null(int fd, struct privsep_proc *p, struct imsg *imsg)
sbin/iked/proc.c
753
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
sbin/iked/proc.c
759
pid_t pid, int fd, void *data, uint16_t datalen)
sbin/iked/proc.c
764
pid, fd, data, datalen)) == -1)
sbin/iked/proc.c
772
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
sbin/iked/proc.c
777
pid, fd, iov, iovcnt)) == -1)
sbin/iked/proc.c
79
int fd;
sbin/iked/proc.c
798
uint16_t type, uint32_t peerid, int fd, void *data, uint16_t datalen)
sbin/iked/proc.c
805
type, peerid, ps->ps_instance + 1, fd, data, datalen) == -1)
sbin/iked/proc.c
821
uint16_t type, uint32_t peerid, int fd, const struct iovec *iov, int iovcnt)
sbin/iked/proc.c
828
type, peerid, ps->ps_instance + 1, fd, iov, iovcnt) == -1)
sbin/iked/radius.c
149
iked_radius_on_event(int fd, short ev, void *ctx)
sbin/iked/radius.c
832
iked_radius_dae_on_event(int fd, short ev, void *ctx)
sbin/iked/timer.c
67
timer_callback(int fd, short event, void *arg)
sbin/iked/vroute.c
104
vroute_rtmsg_cb(int fd, short events, void *arg)
sbin/iked/vroute.c
119
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
sbin/init/init.c
1026
int fd;
sbin/init/init.c
1029
fd = open(sp->se_device, O_RDONLY | O_NONBLOCK);
sbin/init/init.c
1030
if (fd == -1 && (errno == ENXIO || errno == ENOENT ||
sbin/init/init.c
1038
close(fd);
sbin/init/init.c
194
int c, fd;
sbin/init/init.c
209
if ((fd = open(_PATH_DEVNULL, O_RDWR)) != -1) {
sbin/init/init.c
210
(void)dup2(fd, STDIN_FILENO);
sbin/init/init.c
211
(void)dup2(fd, STDOUT_FILENO);
sbin/init/init.c
212
(void)dup2(fd, STDERR_FILENO);
sbin/init/init.c
213
if (fd > 2)
sbin/init/init.c
214
(void)close(fd);
sbin/init/init.c
471
int fd;
sbin/init/init.c
475
if ((fd = open(name, O_RDWR)) == -1) {
sbin/init/init.c
479
if (login_tty(fd) == -1) {
sbin/ipsecctl/ike.c
110
fprintf(fd, SET "[%s]:ID=id-%s force\n", r->p1name,
sbin/ipsecctl/ike.c
112
fprintf(fd, SET "[id-%s]:ID-type=%s force\n", r->auth->srcid,
sbin/ipsecctl/ike.c
116
fprintf(fd, SET "[id-%s]:Address=%s force\n",
sbin/ipsecctl/ike.c
119
fprintf(fd, SET "[id-%s]:Name=%s force\n",
sbin/ipsecctl/ike.c
123
fprintf(fd, SET "[%s]:Remote-ID=id-%s force\n", r->p1name,
sbin/ipsecctl/ike.c
125
fprintf(fd, SET "[id-%s]:ID-type=%s force\n", r->auth->dstid,
sbin/ipsecctl/ike.c
129
fprintf(fd, SET "[id-%s]:Address=%s force\n",
sbin/ipsecctl/ike.c
132
fprintf(fd, SET "[id-%s]:Name=%s force\n",
sbin/ipsecctl/ike.c
138
ike_section_ipsec(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
140
fprintf(fd, SET "[%s]:Phase=2 force\n", r->p2name);
sbin/ipsecctl/ike.c
141
fprintf(fd, SET "[%s]:ISAKMP-peer=%s force\n", r->p2name, r->p1name);
sbin/ipsecctl/ike.c
142
fprintf(fd, SET "[%s]:Configuration=phase2-%s force\n", r->p2name,
sbin/ipsecctl/ike.c
144
fprintf(fd, SET "[%s]:Local-ID=%s force\n", r->p2name, r->p2lid);
sbin/ipsecctl/ike.c
146
fprintf(fd, SET "[%s]:NAT-ID=%s force\n", r->p2name, r->p2nid);
sbin/ipsecctl/ike.c
147
fprintf(fd, SET "[%s]:Remote-ID=%s force\n", r->p2name, r->p2rid);
sbin/ipsecctl/ike.c
150
fprintf(fd, SET "[%s]:PF-Tag=%s force\n", r->p2name, r->tag);
sbin/ipsecctl/ike.c
152
fprintf(fd, SET "[%s]:Interface=%u force\n", r->p2name,
sbin/ipsecctl/ike.c
158
ike_section_p2(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
174
fprintf(fd, SET "[phase2-%s]:EXCHANGE_TYPE=%s force\n", r->p2name,
sbin/ipsecctl/ike.c
176
fprintf(fd, SET "[phase2-%s]:Suites=phase2-suite-%s force\n", r->p2name,
sbin/ipsecctl/ike.c
179
fprintf(fd, SET "[phase2-suite-%s]:Protocols=phase2-protocol-%s "
sbin/ipsecctl/ike.c
182
fprintf(fd, SET "[phase2-protocol-%s]:PROTOCOL_ID=", r->p2name);
sbin/ipsecctl/ike.c
186
fprintf(fd, "IPSEC_ESP");
sbin/ipsecctl/ike.c
189
fprintf(fd, "IPSEC_AH");
sbin/ipsecctl/ike.c
195
fprintf(fd, " force\n");
sbin/ipsecctl/ike.c
408
fprintf(fd, SET "[phase2-protocol-%s]:Transforms=%s force\n",
sbin/ipsecctl/ike.c
411
fprintf(fd, SET "[%s]:TRANSFORM_ID=%s force\n", transform,
sbin/ipsecctl/ike.c
414
fprintf(fd, SET "[%s]:KEY_LENGTH=%s force\n", transform,
sbin/ipsecctl/ike.c
416
fprintf(fd, SET "[%s]:ENCAPSULATION_MODE=%s force\n", transform, encap);
sbin/ipsecctl/ike.c
418
fprintf(fd, SET "[%s]:AUTHENTICATION_ALGORITHM=HMAC_%s force\n",
sbin/ipsecctl/ike.c
421
fprintf(fd, SET "[%s]:GROUP_DESCRIPTION=%s force\n", transform,
sbin/ipsecctl/ike.c
425
fprintf(fd, SET "[%s]:Life=%s-life force\n",
sbin/ipsecctl/ike.c
427
fprintf(fd, SET "[%s-life]:LIFE_TYPE=SECONDS force\n",
sbin/ipsecctl/ike.c
429
fprintf(fd, SET "[%s-life]:LIFE_DURATION=%d force\n",
sbin/ipsecctl/ike.c
432
fprintf(fd, SET "[%s]:Life=LIFE_QUICK_MODE force\n",
sbin/ipsecctl/ike.c
440
ike_section_p1(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
458
fprintf(fd, SET "[%s]:Configuration=phase1-%s force\n", r->p1name,
sbin/ipsecctl/ike.c
460
fprintf(fd, SET "[phase1-%s]:EXCHANGE_TYPE=%s force\n", r->p1name,
sbin/ipsecctl/ike.c
604
fprintf(fd, ADD "[phase1-%s]:Transforms=%s force\n", r->p1name,
sbin/ipsecctl/ike.c
606
fprintf(fd, SET "[%s]:AUTHENTICATION_METHOD=%s force\n", transform,
sbin/ipsecctl/ike.c
608
fprintf(fd, SET "[%s]:HASH_ALGORITHM=%s force\n", transform, auth_alg);
sbin/ipsecctl/ike.c
609
fprintf(fd, SET "[%s]:ENCRYPTION_ALGORITHM=%s_CBC force\n", transform,
sbin/ipsecctl/ike.c
612
fprintf(fd, SET "[%s]:KEY_LENGTH=%s force\n", transform,
sbin/ipsecctl/ike.c
614
fprintf(fd, SET "[%s]:GROUP_DESCRIPTION=%s force\n", transform,
sbin/ipsecctl/ike.c
618
fprintf(fd, SET "[%s]:Life=%s-life force\n",
sbin/ipsecctl/ike.c
620
fprintf(fd, SET "[%s-life]:LIFE_TYPE=SECONDS force\n",
sbin/ipsecctl/ike.c
622
fprintf(fd, SET "[%s-life]:LIFE_DURATION=%d force\n",
sbin/ipsecctl/ike.c
625
fprintf(fd, SET "[%s]:Life=LIFE_MAIN_MODE force\n", transform);
sbin/ipsecctl/ike.c
633
char *p2xid, FILE *fd)
sbin/ipsecctl/ike.c
64
ike_section_general(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
665
fprintf(fd, SET "[%s]:ID-type=IPV%d_ADDR_SUBNET force\n",
sbin/ipsecctl/ike.c
667
fprintf(fd, SET "[%s]:Network=%s force\n", p2xid, network);
sbin/ipsecctl/ike.c
668
fprintf(fd, SET "[%s]:Netmask=%s force\n", p2xid, mask);
sbin/ipsecctl/ike.c
67
fprintf(fd, SET "[General]:Check-interval=%d force\n",
sbin/ipsecctl/ike.c
674
ike_section_p2ids(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
682
r->p2lid, fd);
sbin/ipsecctl/ike.c
684
fprintf(fd, SET "[%s]:ID-type=IPV%d_ADDR force\n",
sbin/ipsecctl/ike.c
688
fprintf(fd, SET "[%s]:Address=%s force\n", r->p2lid,
sbin/ipsecctl/ike.c
69
fprintf(fd, SET "[General]:DPD-check-interval=%d force\n",
sbin/ipsecctl/ike.c
694
r->p2nid, fd);
sbin/ipsecctl/ike.c
696
fprintf(fd, SET "[%s]:ID-type=IPV%d_ADDR force\n",
sbin/ipsecctl/ike.c
700
fprintf(fd, SET "[%s]:Address=%s force\n", r->p2nid,
sbin/ipsecctl/ike.c
706
r->p2rid, fd);
sbin/ipsecctl/ike.c
708
fprintf(fd, SET "[%s]:ID-type=IPV%d_ADDR force\n",
sbin/ipsecctl/ike.c
712
fprintf(fd, SET "[%s]:Address=%s force\n", r->p2rid,
sbin/ipsecctl/ike.c
716
fprintf(fd, SET "[%s]:Protocol=%d force\n",
sbin/ipsecctl/ike.c
718
fprintf(fd, SET "[%s]:Protocol=%d force\n",
sbin/ipsecctl/ike.c
722
fprintf(fd, SET "[%s]:Port=%d force\n", r->p2lid,
sbin/ipsecctl/ike.c
725
fprintf(fd, SET "[%s]:Port=%d force\n", r->p2rid,
sbin/ipsecctl/ike.c
730
ike_connect(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
735
fprintf(fd, ADD "[Phase 2]:Connections=%s\n", r->p2name);
sbin/ipsecctl/ike.c
738
fprintf(fd, ADD "[Phase 2]:Passive-Connections=%s\n",
sbin/ipsecctl/ike.c
748
ike_gen_config(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
75
ike_section_peer(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
751
ike_section_general(r, fd);
sbin/ipsecctl/ike.c
752
ike_section_peer(r, fd);
sbin/ipsecctl/ike.c
753
if (ike_section_p1(r, fd) == -1) {
sbin/ipsecctl/ike.c
756
ike_section_ids(r, fd);
sbin/ipsecctl/ike.c
757
ike_section_ipsec(r, fd);
sbin/ipsecctl/ike.c
758
if (ike_section_p2(r, fd) == -1) {
sbin/ipsecctl/ike.c
761
ike_section_p2ids(r, fd);
sbin/ipsecctl/ike.c
763
if (ike_connect(r, fd) == -1)
sbin/ipsecctl/ike.c
769
ike_delete_config(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/ike.c
776
fprintf(fd, "t %s\n", r->p2name);
sbin/ipsecctl/ike.c
779
fprintf(fd, DELETE "[Phase 2]\n");
sbin/ipsecctl/ike.c
78
fprintf(fd, SET "[Phase 1]:%s=%s force\n", r->peer->name,
sbin/ipsecctl/ike.c
780
fprintf(fd, "t %s\n", r->p2name);
sbin/ipsecctl/ike.c
787
fprintf(fd, DELETE "[%s]\n", r->p1name);
sbin/ipsecctl/ike.c
788
fprintf(fd, DELETE "[phase1-%s]\n", r->p1name);
sbin/ipsecctl/ike.c
792
fprintf(fd, DELETE "[%s-ID]\n", r->auth->srcid);
sbin/ipsecctl/ike.c
794
fprintf(fd, DELETE "[%s-ID]\n", r->auth->dstid);
sbin/ipsecctl/ike.c
796
fprintf(fd, DELETE "[%s]\n", r->p2name);
sbin/ipsecctl/ike.c
797
fprintf(fd, DELETE "[phase2-%s]\n", r->p2name);
sbin/ipsecctl/ike.c
798
fprintf(fd, DELETE "[%s]\n", r->p2lid);
sbin/ipsecctl/ike.c
799
fprintf(fd, DELETE "[%s]\n", r->p2rid);
sbin/ipsecctl/ike.c
801
fprintf(fd, "t %s\n", r->p2name);
sbin/ipsecctl/ike.c
805
fprintf(fd, RMV "[Phase 2]:Connections=%s\n", r->p2name);
sbin/ipsecctl/ike.c
808
fprintf(fd, RMV "[Phase 2]:Passive-Connections=%s\n",
sbin/ipsecctl/ike.c
81
fprintf(fd, SET "[Phase 1]:Default=%s force\n", r->p1name);
sbin/ipsecctl/ike.c
814
fprintf(fd, DELETE "[%s]\n", r->p2name);
sbin/ipsecctl/ike.c
815
fprintf(fd, DELETE "[phase2-%s]\n", r->p2name);
sbin/ipsecctl/ike.c
82
fprintf(fd, SET "[%s]:Phase=1 force\n", r->p1name);
sbin/ipsecctl/ike.c
84
fprintf(fd, SET "[%s]:Address=%s force\n", r->p1name,
sbin/ipsecctl/ike.c
87
fprintf(fd, SET "[%s]:Local-address=%s force\n", r->p1name,
sbin/ipsecctl/ike.c
892
int fd, ret = 0;
sbin/ipsecctl/ike.c
894
if ((fd = open(fifo, O_WRONLY)) == -1)
sbin/ipsecctl/ike.c
896
if (fstat(fd, &sb) == -1)
sbin/ipsecctl/ike.c
90
fprintf(fd, SET "[%s]:Authentication=%s force\n", r->p1name,
sbin/ipsecctl/ike.c
900
if ((fdp = fdopen(fd, "w")) == NULL)
sbin/ipsecctl/ike.c
95
ike_section_ids(struct ipsec_rule *r, FILE *fd)
sbin/ipsecctl/parse.y
1357
check_file_secrecy(int fd, const char *fname)
sbin/ipsecctl/parse.y
1361
if (fstat(fd, &st)) {
sbin/ipsecctl/parse.y
1611
int fd;
sbin/ipsecctl/parse.y
1614
if ((fd = open(filename, O_RDONLY)) < 0)
sbin/ipsecctl/parse.y
1616
if (fstat(fd, &sb) < 0)
sbin/ipsecctl/parse.y
1623
if (read(fd, hex, sb.st_size) < sb.st_size)
sbin/ipsecctl/parse.y
1625
close(fd);
sbin/ipsecctl/pfkey.c
1149
ret = pfkey_flow(fd, satype, SADB_X_ADDFLOW, direction,
sbin/ipsecctl/pfkey.c
1155
ret = pfkey_flow(fd, satype, SADB_X_DELFLOW, direction,
sbin/ipsecctl/pfkey.c
1184
ret = pfkey_sa(fd, satype, SADB_ADD, r->spi,
sbin/ipsecctl/pfkey.c
1189
ret = pfkey_sa(fd, satype, SADB_DELETE, r->spi,
sbin/ipsecctl/pfkey.c
1236
ret = pfkey_sabundle(fd, satype, satype2,
sbin/ipsecctl/pfkey.c
1249
if (pfkey_reply(fd, NULL, NULL) < 0)
sbin/ipsecctl/pfkey.c
1278
if ((n = writev(fd, iov, iov_cnt)) == -1) {
sbin/ipsecctl/pfkey.c
1286
if (pfkey_reply(fd, NULL, NULL) < 0)
sbin/ipsecctl/pfkey.c
1304
if (write(fd, &msg, sizeof(msg)) != sizeof(msg)) {
sbin/ipsecctl/pfkey.c
1308
if (pfkey_reply(fd, NULL, NULL) < 0)
sbin/ipsecctl/pfkey.c
1330
pfd[0].fd = fd;
sbin/ipsecctl/pfkey.c
1339
if (pfkey_reply(fd, &data, &len) < 0)
sbin/ipsecctl/pfkey.c
1354
close(fd);
sbin/ipsecctl/pfkey.c
1361
if ((fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2)) == -1)
sbin/ipsecctl/pfkey.c
42
static int fd;
sbin/isakmpd/conf.c
611
int fd, trans;
sbin/isakmpd/conf.c
616
fd = monitor_open(conf_path, O_RDONLY, 0);
sbin/isakmpd/conf.c
617
if (fd == -1 || check_file_secrecy_fd(fd, conf_path, &sz) == -1) {
sbin/isakmpd/conf.c
618
if (fd == -1 && errno != ENOENT)
sbin/isakmpd/conf.c
621
if (fd != -1)
sbin/isakmpd/conf.c
622
close(fd);
sbin/isakmpd/conf.c
633
if (read(fd, new_conf_addr, sz) != (int)sz) {
sbin/isakmpd/conf.c
635
fd, new_conf_addr, (unsigned long)sz);
sbin/isakmpd/conf.c
638
close(fd);
sbin/isakmpd/conf.c
664
close(fd);
sbin/isakmpd/ike_auth.c
141
int fd;
sbin/isakmpd/ike_auth.c
198
fd = monitor_open(keyfile, O_RDONLY, 0);
sbin/isakmpd/ike_auth.c
199
if (fd < 0) {
sbin/isakmpd/ike_auth.c
204
if (fstat(fd, &sb) == -1) {
sbin/isakmpd/ike_auth.c
207
close(fd);
sbin/isakmpd/ike_auth.c
217
close(fd);
sbin/isakmpd/ike_auth.c
220
if (read(fd, buf, size) != (ssize_t)size) {
sbin/isakmpd/ike_auth.c
226
close(fd);
sbin/isakmpd/ike_auth.c
229
close(fd);
sbin/isakmpd/ike_auth.c
260
fd = -1;
sbin/isakmpd/ike_auth.c
278
fd = monitor_open(keyfile, O_RDONLY, 0);
sbin/isakmpd/ike_auth.c
279
if (fd == -1 && errno != ENOENT) {
sbin/isakmpd/ike_auth.c
288
if (fd == -1) {
sbin/isakmpd/ike_auth.c
293
fd = monitor_open(keyfile, O_RDONLY, 0);
sbin/isakmpd/ike_auth.c
294
if (fd == -1) {
sbin/isakmpd/ike_auth.c
301
if (check_file_secrecy_fd(fd, keyfile, &fsize)) {
sbin/isakmpd/ike_auth.c
303
close(fd);
sbin/isakmpd/ike_auth.c
307
if ((keyfp = fdopen(fd, "r")) == NULL) {
sbin/isakmpd/ike_auth.c
310
close(fd);
sbin/isakmpd/monitor.c
201
int fd, err, cmd;
sbin/isakmpd/monitor.c
226
fd = mm_receive_fd(m_state.s);
sbin/isakmpd/monitor.c
227
if (fd < 0) {
sbin/isakmpd/monitor.c
232
return fd;
sbin/isakmpd/monitor.c
239
int fd, flags = 0, saved_errno;
sbin/isakmpd/monitor.c
267
fd = monitor_open(path, flags, mask);
sbin/isakmpd/monitor.c
268
if (fd < 0)
sbin/isakmpd/monitor.c
272
fp = fdopen(fd, mode);
sbin/isakmpd/monitor.c
276
close(fd);
sbin/isakmpd/monitor.c
286
int fd, r, saved_errno;
sbin/isakmpd/monitor.c
289
fd = monitor_open(path, O_RDONLY | O_NONBLOCK, 0);
sbin/isakmpd/monitor.c
290
if (fd < 0)
sbin/isakmpd/monitor.c
293
r = fstat(fd, sb);
sbin/isakmpd/monitor.c
295
close(fd);
sbin/isakmpd/monitor.c
370
int fd;
sbin/isakmpd/monitor.c
380
fd = mm_receive_fd(m_state.s);
sbin/isakmpd/monitor.c
381
return fd;
sbin/isakmpd/monitor.c
486
int fd, err = 0;
sbin/isakmpd/monitor.c
488
fd = pf_key_v2_open();
sbin/isakmpd/monitor.c
489
if (fd < 0)
sbin/isakmpd/monitor.c
494
if (fd > 0 && mm_send_fd(m_state.s, fd)) {
sbin/isakmpd/monitor.c
496
close(fd);
sbin/isakmpd/monitor.c
499
close(fd);
sbin/isakmpd/monitor.c
830
int off, size, fd, ret, serrno;
sbin/isakmpd/monitor.c
861
fd = open(path, O_RDONLY);
sbin/isakmpd/monitor.c
862
if (fd == -1) {
sbin/isakmpd/monitor.c
867
if ((fstat(fd, &sb) == -1) ||
sbin/isakmpd/monitor.c
869
close(fd);
sbin/isakmpd/monitor.c
877
mm_send_fd(m_state.s, fd);
sbin/isakmpd/monitor.c
878
close(fd);
sbin/isakmpd/monitor_fdpass.c
117
fd = (*(int *)CMSG_DATA(cmsg));
sbin/isakmpd/monitor_fdpass.c
118
return fd;
sbin/isakmpd/monitor_fdpass.c
39
mm_send_fd(int socket, int fd)
sbin/isakmpd/monitor_fdpass.c
58
*(int *)CMSG_DATA(cmsg) = fd;
sbin/isakmpd/monitor_fdpass.c
66
log_error("mm_send_fd: sendmsg(%d)", fd);
sbin/isakmpd/monitor_fdpass.c
88
int fd;
sbin/isakmpd/pf_key_v2.c
213
pfd[0].fd = pf_key_v2_socket;
sbin/isakmpd/pf_key_v2.c
3209
pf_key_v2_handler(int fd)
sbin/isakmpd/pf_key_v2.c
427
int fd = -1, err;
sbin/isakmpd/pf_key_v2.c
433
fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2);
sbin/isakmpd/pf_key_v2.c
434
if (fd == -1) {
sbin/isakmpd/pf_key_v2.c
439
pf_key_v2_socket = fd;
sbin/isakmpd/pf_key_v2.c
501
return fd;
sbin/isakmpd/policy.c
1936
int fd, i;
sbin/isakmpd/policy.c
1951
fd = monitor_open(policy_file, O_RDONLY, 0);
sbin/isakmpd/policy.c
1952
if (fd == -1)
sbin/isakmpd/policy.c
1957
if (check_file_secrecy_fd(fd, policy_file, &sz)) {
sbin/isakmpd/policy.c
1958
close(fd);
sbin/isakmpd/policy.c
1970
i = read(fd, ptr + len, sz - len);
sbin/isakmpd/policy.c
1972
log_fatal("policy_init: read (%d, %p, %lu) failed", fd,
sbin/isakmpd/policy.c
1977
close(fd);
sbin/isakmpd/policy.c
1990
for (fd = 0; fd < policy_asserts_num; fd++)
sbin/isakmpd/policy.c
1992
free(policy_asserts[fd]);
sbin/isakmpd/policy.c
2127
int idtype, fd, len;
sbin/isakmpd/policy.c
2184
fd = monitor_open(file, O_RDONLY, 0);
sbin/isakmpd/policy.c
2185
if (fd < 0) {
sbin/isakmpd/policy.c
2192
if (fstat(fd, &sb) == -1) {
sbin/isakmpd/policy.c
2196
close(fd);
sbin/isakmpd/policy.c
2206
close(fd);
sbin/isakmpd/policy.c
2210
if (read(fd, *cert, size) != (int)size) {
sbin/isakmpd/policy.c
2217
close(fd);
sbin/isakmpd/policy.c
2220
close(fd);
sbin/isakmpd/sa.c
508
report_spi(FILE *fd, const u_int8_t *buf, size_t sz, int spi)
sbin/isakmpd/sa.c
520
fprintf(fd, "%s", s);
sbin/isakmpd/sa.c
529
fprintf(fd, "SPI %d: %s\n", spi, s);
sbin/isakmpd/sa.c
539
report_proto(FILE *fd, struct proto *proto)
sbin/isakmpd/sa.c
548
fprintf(fd, "Transform: IPsec ESP\n");
sbin/isakmpd/sa.c
549
fprintf(fd, "Encryption key length: %d\n", keylen);
sbin/isakmpd/sa.c
550
fprintf(fd, "Authentication key length: %d\n", hashlen);
sbin/isakmpd/sa.c
552
fprintf(fd, "Encryption algorithm: ");
sbin/isakmpd/sa.c
555
fprintf(fd, "3DES\n");
sbin/isakmpd/sa.c
559
fprintf(fd, "AES (CBC)\n");
sbin/isakmpd/sa.c
563
fprintf(fd, "AES (CTR)\n");
sbin/isakmpd/sa.c
567
fprintf(fd, "AES (GCM)\n");
sbin/isakmpd/sa.c
571
fprintf(fd, "AES (GMAC)\n");
sbin/isakmpd/sa.c
575
fprintf(fd, "Cast-128\n");
sbin/isakmpd/sa.c
579
fprintf(fd, "Blowfish\n");
sbin/isakmpd/sa.c
583
fprintf(fd, "unknown (%d)\n", proto->id);
sbin/isakmpd/sa.c
586
fprintf(fd, "Authentication algorithm: ");
sbin/isakmpd/sa.c
589
fprintf(fd, "none\n");
sbin/isakmpd/sa.c
596
fprintf(fd, "HMAC-MD5\n");
sbin/isakmpd/sa.c
600
fprintf(fd, "HMAC-SHA1\n");
sbin/isakmpd/sa.c
604
fprintf(fd, "HMAC-RIPEMD-160\n");
sbin/isakmpd/sa.c
608
fprintf(fd, "HMAC-SHA2-256\n");
sbin/isakmpd/sa.c
612
fprintf(fd, "HMAC-SHA2-384\n");
sbin/isakmpd/sa.c
616
fprintf(fd, "HMAC-SHA2-512\n");
sbin/isakmpd/sa.c
622
fprintf(fd, "unknown (%d)", iproto->auth);
sbin/isakmpd/sa.c
626
fprintf(fd, "none\n");
sbin/isakmpd/sa.c
632
fprintf(fd, "Transform: IPsec AH\n");
sbin/isakmpd/sa.c
633
fprintf(fd, "Encryption not used.\n");
sbin/isakmpd/sa.c
634
fprintf(fd, "Authentication key length: %d\n", hashlen);
sbin/isakmpd/sa.c
636
fprintf(fd, "Authentication algorithm: ");
sbin/isakmpd/sa.c
639
fprintf(fd, "HMAC-MD5\n");
sbin/isakmpd/sa.c
643
fprintf(fd, "HMAC-SHA1\n");
sbin/isakmpd/sa.c
647
fprintf(fd, "HMAC-RIPEMD-160\n");
sbin/isakmpd/sa.c
651
fprintf(fd, "HMAC-SHA2-256\n");
sbin/isakmpd/sa.c
655
fprintf(fd, "HMAC-SHA2-384\n");
sbin/isakmpd/sa.c
659
fprintf(fd, "HMAC-SHA2-512\n");
sbin/isakmpd/sa.c
663
fprintf(fd, "unknown (%d)", proto->id);
sbin/isakmpd/sa.c
668
fprintf(fd, "report_proto: invalid proto %d\n", proto->proto);
sbin/isakmpd/sa.c
676
report_lifetimes(FILE *fd, struct sa *sa)
sbin/isakmpd/sa.c
681
fprintf(fd, "Lifetime: %llu seconds\n", sa->seconds);
sbin/isakmpd/sa.c
686
fprintf(fd, "<no soft timeout>\n");
sbin/isakmpd/sa.c
688
fprintf(fd, "Soft timeout in %ld seconds\n", timeout);
sbin/isakmpd/sa.c
694
fprintf(fd, "No hard timeout>\n");
sbin/isakmpd/sa.c
696
fprintf(fd, "Hard timeout in %ld seconds\n", timeout);
sbin/isakmpd/sa.c
700
fprintf(fd, "Lifetime: %llu kilobytes\n", sa->kilobytes);
sbin/isakmpd/sa.c
707
report_phase1(FILE *fd, struct sa *sa)
sbin/isakmpd/sa.c
710
fprintf(fd, "icookie %08x%08x rcookie %08x%08x\n",
sbin/isakmpd/sa.c
719
report_phase2(FILE *fd, struct sa *sa)
sbin/isakmpd/sa.c
731
report_spi(fd, proto->spi[i],
sbin/isakmpd/sa.c
734
fprintf(fd, "SPI %d not defined.\n", i);
sbin/isakmpd/sa.c
737
report_proto(fd, proto);
sbin/isakmpd/sa.c
757
sa_dump_all(FILE *fd, struct sa *sa)
sbin/isakmpd/sa.c
760
fprintf(fd, "SA name: %s", sa->name ? sa->name : "<unnamed>");
sbin/isakmpd/sa.c
761
fprintf(fd, " (Phase %d%s)\n", sa->phase, sa->phase == 1 ?
sbin/isakmpd/sa.c
765
fprintf(fd, "%s", sa->transport == NULL ? "<no transport>" :
sbin/isakmpd/sa.c
767
fprintf(fd, "\n");
sbin/isakmpd/sa.c
770
report_lifetimes(fd, sa);
sbin/isakmpd/sa.c
772
fprintf(fd, "Flags 0x%08x\n", sa->flags);
sbin/isakmpd/sa.c
775
report_phase1(fd, sa);
sbin/isakmpd/sa.c
777
report_phase2(fd, sa);
sbin/isakmpd/sa.c
780
fprintf(fd, "<unknown phase>\n");
sbin/isakmpd/sa.c
784
fprintf(fd, "\n");
sbin/isakmpd/sa.c
789
sa_report_all(FILE *fd)
sbin/isakmpd/sa.c
796
sa_dump_all(fd, sa);
sbin/isakmpd/sysdep/openbsd/sysdep.c
101
if (monitor_setsockopt(fd, optsw[sw].ip_proto, optsw[sw].auth_level,
sbin/isakmpd/sysdep/openbsd/sysdep.c
104
"setsockopt (%d, %d, IP_AUTH_LEVEL, ...) failed", fd,
sbin/isakmpd/sysdep/openbsd/sysdep.c
108
if (monitor_setsockopt(fd, optsw[sw].ip_proto, optsw[sw].esp_trans_level,
sbin/isakmpd/sysdep/openbsd/sysdep.c
111
"setsockopt (%d, %d, IP_ESP_TRANS_LEVEL, ...) failed", fd,
sbin/isakmpd/sysdep/openbsd/sysdep.c
115
if (monitor_setsockopt(fd, optsw[sw].ip_proto, optsw[sw].esp_network_level,
sbin/isakmpd/sysdep/openbsd/sysdep.c
118
"setsockopt (%d, %d, IP_ESP_NETWORK_LEVEL, ...) failed", fd,
sbin/isakmpd/sysdep/openbsd/sysdep.c
123
monitor_setsockopt(fd, optsw[sw].ip_proto, optsw[sw].ipcomp_level,
sbin/isakmpd/sysdep/openbsd/sysdep.c
127
"setsockopt (%d, %d, IP_IPCOMP_LEVEL, ...) failed,", fd,
sbin/isakmpd/sysdep/openbsd/sysdep.c
48
sysdep_cleartext(int fd, int af)
sbin/isakmpd/util.c
205
int fd = 0, seq, len, b;
sbin/isakmpd/util.c
222
fd = socket(AF_ROUTE, SOCK_RAW, af);
sbin/isakmpd/util.c
249
close(fd);
sbin/isakmpd/util.c
255
if ((b = write(fd, buf, rtm->rtm_msglen)) == -1) {
sbin/isakmpd/util.c
256
close(fd);
sbin/isakmpd/util.c
262
while ((len = read(fd, buf, sizeof(buf))) > 0) {
sbin/isakmpd/util.c
264
close(fd);
sbin/isakmpd/util.c
274
close(fd);
sbin/isakmpd/util.c
280
close(fd);
sbin/isakmpd/util.c
529
check_file_secrecy_fd(int fd, char *name, size_t *file_size)
sbin/isakmpd/util.c
533
if (fstat(fd, &st) == -1) {
sbin/isakmpd/x509.c
618
int fd;
sbin/isakmpd/x509.c
634
while ((fd = monitor_readdir(file, sizeof file)) != -1) {
sbin/isakmpd/x509.c
639
if (fstat(fd, &sb) == -1) {
sbin/isakmpd/x509.c
641
close(fd);
sbin/isakmpd/x509.c
646
close(fd);
sbin/isakmpd/x509.c
650
if ((certfp = fdopen(fd, "r")) == NULL) {
sbin/isakmpd/x509.c
652
close(fd);
sbin/isakmpd/x509.c
702
int fd;
sbin/isakmpd/x509.c
718
while ((fd = monitor_readdir(file, sizeof file)) != -1) {
sbin/isakmpd/x509.c
722
if (fstat(fd, &sb) == -1) {
sbin/isakmpd/x509.c
724
close(fd);
sbin/isakmpd/x509.c
729
close(fd);
sbin/isakmpd/x509.c
733
if ((crlfp = fdopen(fd, "r")) == NULL) {
sbin/isakmpd/x509.c
735
close(fd);
sbin/kbd/kbd_wscons.c
129
kbd_get_encs(int fd, struct wskbd_encoding_data *encs)
sbin/kbd/kbd_wscons.c
139
if (ioctl(fd, WSKBDIO_GETENCODINGS, encs) == -1)
sbin/kbd/kbd_wscons.c
153
int fd, i, kbtype, t, error = 0;
sbin/kbd/kbd_wscons.c
162
fd = open(device, O_WRONLY);
sbin/kbd/kbd_wscons.c
163
if (fd == -1)
sbin/kbd/kbd_wscons.c
164
fd = open(device, O_RDONLY);
sbin/kbd/kbd_wscons.c
165
if (fd == -1) {
sbin/kbd/kbd_wscons.c
173
if (ioctl(fd, WSKBDIO_GTYPE, &kbtype) == -1)
sbin/kbd/kbd_wscons.c
213
kbd_get_encs(fd, &encs[t]);
sbin/kbd/kbd_wscons.c
215
close(fd);
sbin/kbd/kbd_wscons.c
235
int map = 0, v, i, fd, error = 0;
sbin/kbd/kbd_wscons.c
271
fd = open(device, O_WRONLY);
sbin/kbd/kbd_wscons.c
272
if (fd == -1)
sbin/kbd/kbd_wscons.c
273
fd = open(device, O_RDONLY);
sbin/kbd/kbd_wscons.c
274
if (fd == -1) {
sbin/kbd/kbd_wscons.c
282
if (ioctl(fd, WSKBDIO_SETENCODING, &map) == -1) {
sbin/kbd/kbd_wscons.c
291
close(fd);
sbin/kbd/kbd_wscons.c
87
void kbd_get_encs(int fd, struct wskbd_encoding_data *encs);
sbin/ldattach/atomicio.c
44
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
sbin/ldattach/atomicio.c
51
pfd.fd = fd;
sbin/ldattach/atomicio.c
54
res = (f) (fd, s + pos, n - pos);
sbin/ldattach/atomicio.c
78
atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
sbin/ldattach/atomicio.c
93
pfd.fd = fd;
sbin/ldattach/atomicio.c
96
res = (f) (fd, iov, iovcnt);
sbin/ldattach/ldattach.c
105
atomicio(vwrite, pfd[1 - n].fd, buf, nread);
sbin/ldattach/ldattach.c
118
int ch, fd, master = -1, slave, pty = 0, ldisc, nodaemon = 0;
sbin/ldattach/ldattach.c
212
if ((fd = open(dev, O_RDWR)) == -1) {
sbin/ldattach/ldattach.c
223
if (tcgetattr(fd, &tty) == -1) {
sbin/ldattach/ldattach.c
260
if (ioctl(fd, TIOCSDTR, 0) == -1)
sbin/ldattach/ldattach.c
262
if (ioctl(fd, TIOCSETD, &ldisc) == -1) {
sbin/ldattach/ldattach.c
273
if (ioctl(fd, TIOCSTSTAMP, &tstamps) == -1) {
sbin/ldattach/ldattach.c
287
if (tcsetattr(fd, TCSADRAIN, &tty) == -1) {
sbin/ldattach/ldattach.c
319
relay(fd, master);
sbin/ldattach/ldattach.c
71
pfd[0].fd = device;
sbin/ldattach/ldattach.c
72
pfd[1].fd = pty;
sbin/ldattach/ldattach.c
94
nread = read(pfd[n].fd, buf, sizeof(buf));
sbin/mount_udf/mount_udf.c
54
int fd, error;
sbin/mount_udf/mount_udf.c
58
fd = open(dev, O_RDONLY);
sbin/mount_udf/mount_udf.c
59
if (fd == -1)
sbin/mount_udf/mount_udf.c
67
error = ioctl(fd, CDIOREADTOCENTRIES, &t);
sbin/mount_udf/mount_udf.c
69
close(fd);
sbin/mount_vnd/mount_vnd.c
147
int fd;
sbin/mount_vnd/mount_vnd.c
149
fd = open(saltfile, O_RDONLY);
sbin/mount_vnd/mount_vnd.c
150
if (fd == -1) {
sbin/mount_vnd/mount_vnd.c
155
fd = open(saltfile, O_RDWR|O_CREAT|O_EXCL, 0600);
sbin/mount_vnd/mount_vnd.c
156
if (fd == -1)
sbin/mount_vnd/mount_vnd.c
162
if (write(fd, saltbuf, sizeof(saltbuf))
sbin/mount_vnd/mount_vnd.c
169
if (read(fd, saltbuf, sizeof(saltbuf))
sbin/mount_vnd/mount_vnd.c
174
close(fd);
sbin/mount_vnd/mount_vnd.c
191
int fd, rv = -1;
sbin/mount_vnd/mount_vnd.c
193
if ((fd = opendev(dev, O_RDONLY, OPENDEV_PART, &rdev)) == -1) {
sbin/mount_vnd/mount_vnd.c
208
rv = ioctl(fd, VNDIOCSET, &vndio);
sbin/mount_vnd/mount_vnd.c
212
close(fd);
sbin/mountd/mountd.c
402
pfd[0].fd = ibuf.fd;
sbin/newfs/newfs.c
571
getdisklabel(char *s, int fd)
sbin/newfs/newfs.c
575
if (ioctl(fd, DIOCGDINFO, (char *)&lab) == -1) {
sbin/newfs/newfs.c
593
rewritelabel(char *s, int fd, struct disklabel *lp)
sbin/newfs/newfs.c
600
if (ioctl(fd, DIOCWDINFO, (char *)lp) == -1) {
sbin/newfs_ext2fs/mke2fs.c
1368
n = pread(fd, bf, size, offset * sectorsize);
sbin/newfs_ext2fs/mke2fs.c
1386
n = pwrite(fd, bf, size, offset * sectorsize);
sbin/newfs_ext2fs/mke2fs.c
177
static int fd;
sbin/newfs_ext2fs/mke2fs.c
193
fd = f;
sbin/newfs_ext2fs/newfs_ext2fs.c
117
int ch, fd, len, n, Fflag, Iflag, Zflag;
sbin/newfs_ext2fs/newfs_ext2fs.c
243
fd = open(special, fl, 0666);
sbin/newfs_ext2fs/newfs_ext2fs.c
244
if (fd == -1)
sbin/newfs_ext2fs/newfs_ext2fs.c
246
if (fstat(fd, &sb) == -1)
sbin/newfs_ext2fs/newfs_ext2fs.c
249
fd = opendev(special, fl, 0, &special);
sbin/newfs_ext2fs/newfs_ext2fs.c
250
if (fd == -1 || fstat(fd, &sb) == -1)
sbin/newfs_ext2fs/newfs_ext2fs.c
279
pp = getpartition(fd, special, argv, &lp);
sbin/newfs_ext2fs/newfs_ext2fs.c
307
&& ftruncate(fd, (off_t)fssize * sectorsize) == -1)
sbin/newfs_ext2fs/newfs_ext2fs.c
316
if (fstatfs(fd, &sfs) == -1) {
sbin/newfs_ext2fs/newfs_ext2fs.c
331
i = write(fd, buf, MINIMUM(bufsize, bufrem));
sbin/newfs_ext2fs/newfs_ext2fs.c
368
mke2fs(special, fd);
sbin/newfs_ext2fs/newfs_ext2fs.c
370
close(fd);
sbin/newfs_ext2fs/newfs_ext2fs.c
441
getdisklabel(const char *s, int fd)
sbin/newfs_ext2fs/newfs_ext2fs.c
445
if (ioctl(fd, DIOCGDINFO, (char *)&lab) == -1) {
sbin/newfs_msdos/newfs_msdos.c
252
int ch, fd, fd1;
sbin/newfs_msdos/newfs_msdos.c
346
if ((fd = opendev(sname, opt_N ? O_RDONLY : O_RDWR, 0, &fname)) == -1 ||
sbin/newfs_msdos/newfs_msdos.c
347
fstat(fd, &sb))
sbin/newfs_msdos/newfs_msdos.c
374
getdiskinfo(fd, fname, dtype, oflag, &bpb);
sbin/newfs_msdos/newfs_msdos.c
657
if ((n = write(fd, img, bpb.bps)) == -1)
sbin/newfs_msdos/newfs_msdos.c
713
getdiskinfo(int fd, const char *fname, const char *dtype, int oflag,
sbin/newfs_msdos/newfs_msdos.c
737
i = ioctl(fd, DIOCGDINFO, lp);
sbin/pdisk/file_media.c
105
write_block(int fd, uint64_t sector, void *address)
sbin/pdisk/file_media.c
109
off = pwrite(fd, address, DEV_BSIZE, sector * DEV_BSIZE);
sbin/pdisk/file_media.c
118
read_block0(int fd, struct partition_map *map)
sbin/pdisk/file_media.c
128
if (read_block(fd, 0, block0_ondisk) == 0)
sbin/pdisk/file_media.c
174
write_block0(int fd, struct partition_map *map)
sbin/pdisk/file_media.c
222
rslt = write_block(fd, 0, block0_ondisk);
sbin/pdisk/file_media.c
228
read_dpme(int fd, uint64_t sector, struct entry *entry)
sbin/pdisk/file_media.c
236
if (read_block(fd, sector, dpme_ondisk) == 0)
sbin/pdisk/file_media.c
298
write_dpme(int fd, uint64_t sector, struct entry *entry)
sbin/pdisk/file_media.c
362
rslt = write_block(fd, sector, dpme_ondisk);
sbin/pdisk/file_media.c
86
read_block(int fd, uint64_t sector, void *address)
sbin/pdisk/file_media.c
90
off = pread(fd, address, DEV_BSIZE, sector * DEV_BSIZE);
sbin/pdisk/partition_map.c
114
map = create_partition_map(fd, name, mediasz, sectorsz);
sbin/pdisk/partition_map.c
155
if (read_dpme(map->fd, ix, entry) == 0) {
sbin/pdisk/partition_map.c
248
result = write_block0(map->fd, map);
sbin/pdisk/partition_map.c
253
result = write_dpme(map->fd, entry->disk_address, entry);
sbin/pdisk/partition_map.c
261
create_partition_map(int fd, char *name, u_int64_t mediasz, uint32_t sectorsz)
sbin/pdisk/partition_map.c
271
map->fd = fd;
sbin/pdisk/partition_map.c
60
open_partition_map(int fd, char *name, uint64_t mediasz, uint32_t sectorsz)
sbin/pdisk/partition_map.c
69
map->fd = fd;
sbin/pdisk/partition_map.c
83
if (read_block0(map->fd, map) == 0) {
sbin/pdisk/partition_map.h
50
int fd;
sbin/pdisk/pdisk.c
102
fd = opendev(*argv, oflags, OPENDEV_PART, NULL);
sbin/pdisk/pdisk.c
103
if (fd == -1)
sbin/pdisk/pdisk.c
106
if (fstat(fd, &st) == -1)
sbin/pdisk/pdisk.c
111
if (ioctl(fd, DIOCGPDINFO, &dl) == -1)
sbin/pdisk/pdisk.c
119
map = open_partition_map(fd, *argv, DL_GETDSIZE(&dl), dl.d_secsize);
sbin/pdisk/pdisk.c
128
close(fd);
sbin/pdisk/pdisk.c
201
map = create_partition_map(oldmap->fd,
sbin/pdisk/pdisk.c
77
int c, fd, oflags;
sbin/pfctl/parse.y
5912
check_file_secrecy(int fd, const char *fname)
sbin/pfctl/parse.y
5916
if (fstat(fd, &st)) {
sbin/pflogd/pflogd.c
205
int fd;
sbin/pflogd/pflogd.c
219
if ((fd = open("/dev/bpf", O_RDONLY)) == -1)
sbin/pflogd/pflogd.c
222
if (ioctl(fd, BIOCVERSION, &bv) == -1) {
sbin/pflogd/pflogd.c
236
if (ioctl(fd, BIOCSETIF, &ifr) == -1) {
sbin/pflogd/pflogd.c
242
if (dlt != (u_int) -1 && ioctl(fd, BIOCSDLT, &dlt)) {
sbin/pflogd/pflogd.c
248
p->fd = fd;
sbin/pflogd/pflogd.c
257
if (ioctl(p->fd, BIOCSWTIMEOUT, &to) == -1) {
sbin/pflogd/pflogd.c
265
ioctl(fd, BIOCPROMISC, NULL);
sbin/pflogd/pflogd.c
267
if (ioctl(fd, BIOCGBLEN, &v) == -1) {
sbin/pflogd/pflogd.c
333
int fd;
sbin/pflogd/pflogd.c
349
fd = priv_open_log();
sbin/pflogd/pflogd.c
350
if (fd < 0)
sbin/pflogd/pflogd.c
353
fp = fdopen(fd, "a+");
sbin/pflogd/pflogd.c
357
close(fd);
sbin/pflogd/privsep.c
169
fd = pcap_fileno(hpcap);
sbin/pflogd/privsep.c
170
send_fd(socks[0], fd);
sbin/pflogd/privsep.c
171
if (fd < 0) {
sbin/pflogd/privsep.c
238
int cmd, fd;
sbin/pflogd/privsep.c
248
fd = receive_fd(priv_fd);
sbin/pflogd/privsep.c
249
if (fd < 0)
sbin/pflogd/privsep.c
258
hpcap->fd = fd;
sbin/pflogd/privsep.c
302
int cmd, fd;
sbin/pflogd/privsep.c
309
fd = receive_fd(priv_fd);
sbin/pflogd/privsep.c
311
return (fd);
sbin/pflogd/privsep.c
327
may_read(int fd, void *buf, size_t n)
sbin/pflogd/privsep.c
333
res = read(fd, s + pos, n - pos);
sbin/pflogd/privsep.c
350
must_read(int fd, void *buf, size_t n)
sbin/pflogd/privsep.c
356
res = read(fd, s + pos, n - pos);
sbin/pflogd/privsep.c
372
must_write(int fd, void *buf, size_t n)
sbin/pflogd/privsep.c
378
res = write(fd, s + pos, n - pos);
sbin/pflogd/privsep.c
68
int i, fd = -1, bpfd = -1, nargc, socks[2], cmd;
sbin/pflogd/privsep_fdpass.c
100
int fd;
sbin/pflogd/privsep_fdpass.c
126
fd = (*(int *)CMSG_DATA(cmsg));
sbin/pflogd/privsep_fdpass.c
127
return fd;
sbin/pflogd/privsep_fdpass.c
50
send_fd(int sock, int fd)
sbin/pflogd/privsep_fdpass.c
64
if (fd >= 0) {
sbin/pflogd/privsep_fdpass.c
71
*(int *)CMSG_DATA(cmsg) = fd;
sbin/ping/ping.c
812
pfd.fd = s;
sbin/ping/ping.c
920
pfd.fd = s;
sbin/quotacheck/quotacheck.c
500
int i, fd;
sbin/quotacheck/quotacheck.c
503
fd = opendev(target, O_RDONLY, 0, &tmp);
sbin/quotacheck/quotacheck.c
504
if (fd == -1)
sbin/quotacheck/quotacheck.c
506
close(fd);
sbin/quotacheck/quotacheck.c
510
fd = opendev(list[i], O_RDONLY, 0, &argvdev);
sbin/quotacheck/quotacheck.c
511
if (fd == -1)
sbin/quotacheck/quotacheck.c
513
close(fd);
sbin/reboot/reboot.c
187
int fd, status;
sbin/reboot/reboot.c
197
fd = open(_PATH_CONSOLE, O_RDWR);
sbin/reboot/reboot.c
198
if (fd == -1)
sbin/reboot/reboot.c
200
dup2(fd, 0);
sbin/reboot/reboot.c
201
dup2(fd, 1);
sbin/reboot/reboot.c
202
dup2(fd, 2);
sbin/reboot/reboot.c
203
if (fd > 2)
sbin/reboot/reboot.c
204
close(fd);
sbin/resolvd/resolvd.c
351
route_receive(int fd)
sbin/resolvd/resolvd.c
359
if ((n = read(fd, rsock_buf, sizeof(rsock_buf))) == -1) {
sbin/resolvd/resolvd.c
583
int i, fd, len, iovcnt = 0;
sbin/resolvd/resolvd.c
587
if ((fd = open(_PATH_RESCONF_NEW, O_CREAT|O_TRUNC|O_RDWR, 0644)) == -1) {
sbin/resolvd/resolvd.c
674
if (writev(fd, iov, iovcnt) == -1) {
sbin/resolvd/resolvd.c
680
if (fsync(fd) == -1) {
sbin/resolvd/resolvd.c
688
close(fd);
sbin/resolvd/resolvd.c
691
dup2(fd, resolvfd);
sbin/resolvd/resolvd.c
692
close(fd);
sbin/resolvd/resolvd.c
699
if (fd != -1)
sbin/resolvd/resolvd.c
700
close(fd);
sbin/restore/dirs.c
140
int fd;
sbin/restore/dirs.c
147
fd = mkstemp(dirfile);
sbin/restore/dirs.c
149
fd = open(dirfile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/restore/dirs.c
150
if (fd == -1 || (df = fdopen(fd, "w")) == NULL) {
sbin/restore/dirs.c
152
if (fd != -1)
sbin/restore/dirs.c
153
close(fd);
sbin/restore/dirs.c
162
fd = mkstemp(modefile);
sbin/restore/dirs.c
164
fd = open(modefile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/restore/dirs.c
165
if (fd == -1 || (mf = fdopen(fd, "w")) == NULL) {
sbin/restore/dirs.c
167
if (fd != -1)
sbin/restore/dirs.c
168
close(fd);
sbin/restore/dirs.c
555
int fd;
sbin/restore/dirs.c
557
if ((fd = open(name, O_RDONLY)) == -1)
sbin/restore/dirs.c
560
(void)close(fd);
sbin/restore/dirs.c
563
dirp->dd_fd = fd;
sbin/restore/symtab.c
527
int fd;
sbin/restore/symtab.c
539
if ((fd = open(filename, O_RDONLY)) == -1) {
sbin/restore/symtab.c
543
if (fstat(fd, &stbuf) == -1) {
sbin/restore/symtab.c
551
if (read(fd, base, tblsize) == -1 ||
sbin/restore/symtab.c
552
read(fd, &hdr, sizeof(struct symtableheader)) == -1) {
sbin/restore/symtab.c
556
close(fd);
sbin/savecore/savecore.c
625
int fd;
sbin/savecore/savecore.c
633
if ((fd = open(dirn, O_RDONLY)) == -1 || fstatfs(fd, &fsbuf) == -1) {
sbin/savecore/savecore.c
637
close(fd);
sbin/savecore/zopen.c
526
int fd;
sbin/savecore/zopen.c
528
if ((fd = open(name, (*mode=='r'? O_RDONLY:O_WRONLY|O_CREAT),
sbin/savecore/zopen.c
531
if ((cookie = z_open(fd, mode, NULL, bits, 0, 0)) == NULL) {
sbin/savecore/zopen.c
532
close(fd);
sbin/savecore/zopen.c
537
close(fd);
sbin/savecore/zopen.c
545
z_open(int fd, const char *mode, char *name, int bits,
sbin/savecore/zopen.c
577
zs->zs_fd = fd;
sbin/scan_ffs/scan_ffs.c
142
int ch, fd, flags = 0;
sbin/scan_ffs/scan_ffs.c
180
fd = opendev(argv[0], O_RDONLY, OPENDEV_PART, NULL);
sbin/scan_ffs/scan_ffs.c
181
if (fd == -1)
sbin/scan_ffs/scan_ffs.c
187
return (ufsscan(fd, beg, end, flags));
sbin/scan_ffs/scan_ffs.c
73
ufsscan(int fd, daddr_t beg, daddr_t end, int flags)
sbin/scan_ffs/scan_ffs.c
86
if (lseek(fd, (off_t)blk * 512, SEEK_SET) == -1)
sbin/scan_ffs/scan_ffs.c
88
if (read(fd, buf, SBSIZE * SBCOUNT) == -1)
sbin/scsi/libscsi.c
1062
int fd = open(path, flags);
sbin/scsi/libscsi.c
1064
if (fd != -1) {
sbin/scsi/libscsi.c
1078
return fd;
sbin/scsi/scsi.c
115
if ((fd = scsi_open(optarg, O_RDWR)) < 0)
sbin/scsi/scsi.c
251
do_cmd(int fd, char *fmt, int argc, char **argv)
sbin/scsi/scsi.c
339
if (scsireq_enter(fd, scsireq) == -1)
sbin/scsi/scsi.c
374
void mode_sense(int fd, u_char *data, int len, int pc, int page)
sbin/scsi/scsi.c
382
if (scsireq_enter(fd, scsireq_build(scsireq,
sbin/scsi/scsi.c
400
void mode_select(int fd, u_char *data, int len, int perm)
sbin/scsi/scsi.c
406
if (scsireq_enter(fd, scsireq_build(scsireq,
sbin/scsi/scsi.c
558
int fd;
sbin/scsi/scsi.c
562
if ((fd = mkstemp(edit_name)) == -1)
sbin/scsi/scsi.c
564
if ( (edit_file = fdopen(fd, "w+")) == 0)
sbin/scsi/scsi.c
63
int fd;
sbin/scsi/scsi.c
695
mode_edit(int fd, int page, int edit, int argc, char *argv[])
sbin/scsi/scsi.c
736
mode_sense(fd, data, sizeof(data), 1, page);
sbin/scsi/scsi.c
748
mode_sense(fd, data, sizeof(data), 0, page);
sbin/scsi/scsi.c
79
void mode_sense(int fd, u_char *data, int len, int pc, int page);
sbin/scsi/scsi.c
794
mode_select(fd, (char *)mh,
sbin/scsi/scsi.c
80
void mode_select(int fd, u_char *data, int len, int perm);
sbin/scsi/scsi.c
801
mode_sense(fd, data, sizeof(data), pagectl, page);
sbin/scsi/scsi.c
830
if (ioctl(fd,SCIOCDEBUG,&debuglevel) == -1)
sbin/scsi/scsi.c
846
do_cmd(fd, fmt, argc, argv);
sbin/scsi/scsi.c
848
mode_edit(fd, modepage, editflag, argc, argv);
sbin/shutdown/shutdown.c
308
int fd[2];
sbin/shutdown/shutdown.c
314
if (pipe(fd) == -1) {
sbin/shutdown/shutdown.c
321
close(fd[0]);
sbin/shutdown/shutdown.c
322
close(fd[1]);
sbin/shutdown/shutdown.c
325
if (dup2(fd[0], STDIN_FILENO) == -1) {
sbin/shutdown/shutdown.c
329
if (fd[0] != STDIN_FILENO)
sbin/shutdown/shutdown.c
330
close(fd[0]);
sbin/shutdown/shutdown.c
331
close(fd[1]);
sbin/shutdown/shutdown.c
338
close(fd[0]);
sbin/shutdown/shutdown.c
341
dprintf(fd[1],
sbin/shutdown/shutdown.c
350
dprintf(fd[1], "System going down at %s\n\n", when);
sbin/shutdown/shutdown.c
352
dprintf(fd[1], "System going down in %lld minute%s\n\n",
sbin/shutdown/shutdown.c
356
dprintf(fd[1], "System going down in %lld minute%s\n\n",
sbin/shutdown/shutdown.c
359
dprintf(fd[1], "System going down in 30 seconds\n\n");
sbin/shutdown/shutdown.c
361
dprintf(fd[1], "System going down IMMEDIATELY\n\n");
sbin/shutdown/shutdown.c
364
(void)write(fd[1], mbuf, mbuflen);
sbin/shutdown/shutdown.c
365
close(fd[1]);
sbin/shutdown/shutdown.c
457
int fd;
sbin/shutdown/shutdown.c
467
fd = open(_PATH_CONSOLE, O_RDWR);
sbin/shutdown/shutdown.c
468
if (fd == -1)
sbin/shutdown/shutdown.c
470
dup2(fd, 0);
sbin/shutdown/shutdown.c
471
dup2(fd, 1);
sbin/shutdown/shutdown.c
472
dup2(fd, 2);
sbin/shutdown/shutdown.c
473
if (fd > 2)
sbin/shutdown/shutdown.c
474
close(fd);
sbin/slaacd/control.c
101
return (fd);
sbin/slaacd/control.c
105
control_listen(int fd)
sbin/slaacd/control.c
107
if (control_state.fd != -1)
sbin/slaacd/control.c
110
control_state.fd = fd;
sbin/slaacd/control.c
111
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
sbin/slaacd/control.c
116
event_set(&control_state.ev, control_state.fd, EV_READ,
sbin/slaacd/control.c
168
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
sbin/slaacd/control.c
176
control_connbyfd(int fd)
sbin/slaacd/control.c
181
if (c->iev.ibuf.fd == fd)
sbin/slaacd/control.c
202
control_close(int fd)
sbin/slaacd/control.c
206
if ((c = control_connbyfd(fd)) == NULL) {
sbin/slaacd/control.c
207
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/slaacd/control.c
215
close(c->iev.ibuf.fd);
sbin/slaacd/control.c
227
control_dispatch_imsg(int fd, short event, void *bula)
sbin/slaacd/control.c
236
if ((c = control_connbyfd(fd)) == NULL) {
sbin/slaacd/control.c
237
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/slaacd/control.c
243
control_close(fd);
sbin/slaacd/control.c
249
control_close(fd);
sbin/slaacd/control.c
256
control_close(fd);
sbin/slaacd/control.c
47
int fd;
sbin/slaacd/control.c
48
} control_state = {.fd = -1};
sbin/slaacd/control.c
65
int fd;
sbin/slaacd/control.c
68
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
sbin/slaacd/control.c
81
close(fd);
sbin/slaacd/control.c
86
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
sbin/slaacd/control.c
88
close(fd);
sbin/slaacd/control.c
96
close(fd);
sbin/slaacd/engine.c
2444
address_proposal_timeout(int fd, short events, void *arg)
sbin/slaacd/engine.c
2508
dfr_proposal_timeout(int fd, short events, void *arg)
sbin/slaacd/engine.c
2552
rdns_proposal_timeout(int fd, short events, void *arg)
sbin/slaacd/engine.c
2596
iface_timeout(int fd, short events, void *arg)
sbin/slaacd/engine.c
406
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/slaacd/engine.c
422
close(iev_frontend->ibuf.fd);
sbin/slaacd/engine.c
424
close(iev_main->ibuf.fd);
sbin/slaacd/engine.c
450
engine_dispatch_frontend(int fd, short event, void *bula)
sbin/slaacd/engine.c
627
engine_dispatch_main(int fd, short event, void *bula)
sbin/slaacd/engine.c
670
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/slaacd/engine.c
678
if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
sbin/slaacd/engine.c
683
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/slaacd/frontend.c
187
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/slaacd/frontend.c
252
close(iev_engine->ibuf.fd);
sbin/slaacd/frontend.c
255
close(iev_main->ibuf.fd);
sbin/slaacd/frontend.c
281
frontend_dispatch_main(int fd, short event, void *bula)
sbin/slaacd/frontend.c
323
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/slaacd/frontend.c
332
if (imsgbuf_init(&iev_engine->ibuf, fd) == -1)
sbin/slaacd/frontend.c
337
event_set(&iev_engine->ev, iev_engine->ibuf.fd,
sbin/slaacd/frontend.c
353
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/slaacd/frontend.c
358
event_set(&ev_route, fd, EV_READ | EV_PERSIST,
sbin/slaacd/frontend.c
366
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/slaacd/frontend.c
372
control_listen(fd);
sbin/slaacd/frontend.c
394
frontend_dispatch_engine(int fd, short event, void *bula)
sbin/slaacd/frontend.c
673
route_receive(int fd, short events, void *arg)
sbin/slaacd/frontend.c
687
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
sbin/slaacd/frontend.c
926
icmp6_receive(int fd, short events, void *arg)
sbin/slaacd/frontend.c
941
if ((len = recvmsg(fd, &icmp6ev->rcvmhdr, 0)) == -1) {
sbin/slaacd/slaacd.c
248
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/slaacd/slaacd.c
253
event_set(&iev_engine->ev, iev_engine->ibuf.fd, iev_engine->events,
sbin/slaacd/slaacd.c
317
close(iev_frontend->ibuf.fd);
sbin/slaacd/slaacd.c
319
close(iev_engine->ibuf.fd);
sbin/slaacd/slaacd.c
341
start_child(enum slaacd_process p, char *argv0, int fd, int debug, int verbose)
sbin/slaacd/slaacd.c
353
close(fd);
sbin/slaacd/slaacd.c
357
if (fd != 3) {
sbin/slaacd/slaacd.c
358
if (dup2(fd, 3) == -1)
sbin/slaacd/slaacd.c
360
} else if (fcntl(fd, F_SETFD, 0) == -1)
sbin/slaacd/slaacd.c
387
main_dispatch_frontend(int fd, short event, void *bula)
sbin/slaacd/slaacd.c
469
main_dispatch_engine(int fd, short event, void *bula)
sbin/slaacd/slaacd.c
562
main_imsg_compose_frontend(int type, int fd, void *data, uint16_t datalen)
sbin/slaacd/slaacd.c
565
return (imsg_compose_event(iev_frontend, type, 0, 0, fd, data,
sbin/slaacd/slaacd.c
589
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
sbin/slaacd/slaacd.c
595
pid_t pid, int fd, void *data, uint16_t datalen)
sbin/slaacd/slaacd.c
599
if ((ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data,
sbin/slaacd/slaacd.c
936
int fd = -1;
sbin/slaacd/slaacd.c
939
if ((fd = open("/etc/soii.key", O_RDONLY)) == -1)
sbin/slaacd/slaacd.c
942
if (read(fd, buf, sizeof(buf) - 1) == -1)
sbin/slaacd/slaacd.c
944
close(fd);
sbin/slaacd/slaacd.c
945
fd = -1;
sbin/slaacd/slaacd.c
951
if (fd != -1)
sbin/slaacd/slaacd.c
952
close(fd);
sbin/ttyflags/ttyflags.c
158
int fd, flags = 0, rval = 0, st, sep = 0;
sbin/ttyflags/ttyflags.c
201
if ((fd = open(path, O_RDONLY | O_NONBLOCK)) == -1) {
sbin/ttyflags/ttyflags.c
210
if (ioctl(fd, TIOCSFLAGS, &flags) == -1)
sbin/ttyflags/ttyflags.c
216
if (ioctl(fd, TIOCGFLAGS, &flags) == -1)
sbin/ttyflags/ttyflags.c
242
if (close(fd) == -1) {
sbin/tunefs/tunefs.c
318
int fd;
sbin/tunefs/tunefs.c
329
fd = opendev(name, flags, 0, devicep);
sbin/tunefs/tunefs.c
330
if (fd == -1 && errno == ENOENT)
sbin/tunefs/tunefs.c
332
return (fd);
sbin/unwind/control.c
100
return (fd);
sbin/unwind/control.c
104
control_listen(int fd)
sbin/unwind/control.c
106
if (control_state.fd != -1)
sbin/unwind/control.c
109
control_state.fd = fd;
sbin/unwind/control.c
110
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
sbin/unwind/control.c
115
event_set(&control_state.ev, control_state.fd, EV_READ,
sbin/unwind/control.c
167
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, c->iev.handler,
sbin/unwind/control.c
175
control_connbyfd(int fd)
sbin/unwind/control.c
180
if (c->iev.ibuf.fd == fd)
sbin/unwind/control.c
201
control_close(int fd)
sbin/unwind/control.c
205
if ((c = control_connbyfd(fd)) == NULL) {
sbin/unwind/control.c
206
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/unwind/control.c
214
close(c->iev.ibuf.fd);
sbin/unwind/control.c
226
control_dispatch_imsg(int fd, short event, void *bula)
sbin/unwind/control.c
235
if ((c = control_connbyfd(fd)) == NULL) {
sbin/unwind/control.c
236
log_warnx("%s: fd %d: not found", __func__, fd);
sbin/unwind/control.c
242
control_close(fd);
sbin/unwind/control.c
248
control_close(fd);
sbin/unwind/control.c
253
if (getpeereid(fd, &euid, &egid) == -1) {
sbin/unwind/control.c
254
control_close(fd);
sbin/unwind/control.c
260
control_close(fd);
sbin/unwind/control.c
271
control_close(fd);
sbin/unwind/control.c
45
int fd;
sbin/unwind/control.c
46
} control_state = {.fd = -1};
sbin/unwind/control.c
63
int fd;
sbin/unwind/control.c
66
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
sbin/unwind/control.c
79
close(fd);
sbin/unwind/control.c
84
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
sbin/unwind/control.c
86
close(fd);
sbin/unwind/control.c
95
close(fd);
sbin/unwind/control.h
20
int control_listen(int fd);
sbin/unwind/dns64_synth.c
110
if(fd->count > RR_COUNT_MAX) {
sbin/unwind/dns64_synth.c
115
packed_rrset_data) + fd->count * dns64_prefix_count *
sbin/unwind/dns64_synth.c
122
dd->ttl = fd->ttl;
sbin/unwind/dns64_synth.c
123
dd->count = fd->count * dns64_prefix_count;
sbin/unwind/dns64_synth.c
125
dd->trust = fd->trust;
sbin/unwind/dns64_synth.c
126
dd->security = fd->security;
sbin/unwind/dns64_synth.c
132
for(i = 0, pos = 0; i < fd->count; ++i) {
sbin/unwind/dns64_synth.c
133
if (fd->rr_len[i] != 6 || fd->rr_data[i][0] != 0 ||
sbin/unwind/dns64_synth.c
134
fd->rr_data[i][1] != 4) {
sbin/unwind/dns64_synth.c
140
dd->rr_ttl[pos] = fd->rr_ttl[i];
sbin/unwind/dns64_synth.c
146
dns64_prefixes[j].prefixlen, &fd->rr_data[i][2],
sbin/unwind/dns64_synth.c
147
fd->rr_len[i]-2, &dd->rr_data[pos][2],
sbin/unwind/dns64_synth.c
97
packed_rrset_data* fd, struct ub_packed_rrset_key *dk, struct
sbin/unwind/frontend.c
1037
pq->fd = opq->fd;
sbin/unwind/frontend.c
1038
opq->fd = -1;
sbin/unwind/frontend.c
1059
event_set(&pq->ev, pq->fd, EV_READ | EV_PERSIST, tcp_request,
sbin/unwind/frontend.c
1061
event_set(&pq->resp_ev, pq->fd, EV_WRITE | EV_PERSIST,
sbin/unwind/frontend.c
111
int fd;
sbin/unwind/frontend.c
1221
if(sendto(pq->fd, sldns_buffer_current(pq->abuf),
sbin/unwind/frontend.c
1279
route_receive(int fd, short events, void *arg)
sbin/unwind/frontend.c
1293
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
sbin/unwind/frontend.c
1447
parse_trust_anchor(struct trust_anchor_head *tah, int fd)
sbin/unwind/frontend.c
1457
while ((n = read(fd, buf, sizeof(buf))) > 0) {
sbin/unwind/frontend.c
1510
write_trust_anchors(struct trust_anchor_head *tah, int fd)
sbin/unwind/frontend.c
1517
if (lseek(fd, 0, SEEK_SET) == -1) {
sbin/unwind/frontend.c
1529
if (write(fd, str, n) != n) {
sbin/unwind/frontend.c
1538
ftruncate(fd, len);
sbin/unwind/frontend.c
1539
fsync(fd);
sbin/unwind/frontend.c
1543
parse_blocklist(int fd)
sbin/unwind/frontend.c
1551
if((f = fdopen(fd, "r")) == NULL) {
sbin/unwind/frontend.c
1553
close(fd);
sbin/unwind/frontend.c
1624
accept_paused(int fd, short events, void *arg)
sbin/unwind/frontend.c
1642
tcp_accept(int fd, short events, void *arg)
sbin/unwind/frontend.c
1655
if ((s = accept_reserve(fd, (struct sockaddr *)&ss, &len)) == -1) {
sbin/unwind/frontend.c
1684
pq->fd = s;
sbin/unwind/frontend.c
1703
tcp_request(int fd, short events, void *arg)
sbin/unwind/frontend.c
1710
n = read(fd, sldns_buffer_current(pq->qbuf),
sbin/unwind/frontend.c
1756
shutdown(fd, SHUT_RD);
sbin/unwind/frontend.c
1766
tcp_response(int fd, short events, void *arg)
sbin/unwind/frontend.c
1773
n = write(fd, sldns_buffer_current(pq->abuf),
sbin/unwind/frontend.c
1788
tcp_timeout(int fd, short events, void *arg)
sbin/unwind/frontend.c
244
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/unwind/frontend.c
281
close(iev_resolver->ibuf.fd);
sbin/unwind/frontend.c
284
close(iev_main->ibuf.fd);
sbin/unwind/frontend.c
310
frontend_dispatch_main(int fd, short event, void *bula)
sbin/unwind/frontend.c
350
if ((fd = imsg_get_fd(&imsg)) == -1) {
sbin/unwind/frontend.c
363
if (imsgbuf_init(&iev_resolver->ibuf, fd) == -1)
sbin/unwind/frontend.c
368
event_set(&iev_resolver->ev, iev_resolver->ibuf.fd,
sbin/unwind/frontend.c
441
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/unwind/frontend.c
445
routesock = fd;
sbin/unwind/frontend.c
446
event_set(&ev_route, fd, EV_READ | EV_PERSIST,
sbin/unwind/frontend.c
454
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/unwind/frontend.c
458
control_listen(fd);
sbin/unwind/frontend.c
467
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/unwind/frontend.c
470
parse_blocklist(fd);
sbin/unwind/frontend.c
489
frontend_dispatch_resolver(int fd, short event, void *bula)
sbin/unwind/frontend.c
696
if (pq->fd != -1)
sbin/unwind/frontend.c
697
close(pq->fd);
sbin/unwind/frontend.c
703
udp_receive(int fd, short events, void *arg)
sbin/unwind/frontend.c
709
if ((len = recvmsg(fd, &udpev->rcvmhdr, 0)) == -1) {
sbin/unwind/frontend.c
726
pq->fd = fd;
sbin/unwind/libunbound/daemon/remote.h
119
int fd;
sbin/unwind/libunbound/daemon/remote.h
369
void fast_reload_service_cb(int fd, short bits, void* arg);
sbin/unwind/libunbound/daemon/remote.h
79
int fd;
sbin/unwind/libunbound/dns64/dns64.c
727
const struct packed_rrset_data* fd,
sbin/unwind/libunbound/dns64/dns64.c
739
if(fd->count > RR_COUNT_MAX) {
sbin/unwind/libunbound/dns64/dns64.c
745
+ fd->count * (sizeof(size_t) + sizeof(time_t) +
sbin/unwind/libunbound/dns64/dns64.c
752
dd->ttl = fd->ttl;
sbin/unwind/libunbound/dns64/dns64.c
753
dd->count = fd->count;
sbin/unwind/libunbound/dns64/dns64.c
755
dd->trust = fd->trust;
sbin/unwind/libunbound/dns64/dns64.c
756
dd->security = fd->security;
sbin/unwind/libunbound/dns64/dns64.c
765
for(i = 0; i < fd->count; ++i) {
sbin/unwind/libunbound/dns64/dns64.c
766
if (fd->rr_len[i] != 6 || fd->rr_data[i][0] != 0
sbin/unwind/libunbound/dns64/dns64.c
767
|| fd->rr_data[i][1] != 4) {
sbin/unwind/libunbound/dns64/dns64.c
779
dns64_env->prefix_net, &fd->rr_data[i][2],
sbin/unwind/libunbound/dns64/dns64.c
780
fd->rr_len[i]-2, &dd->rr_data[i][2],
sbin/unwind/libunbound/dns64/dns64.c
782
dd->rr_ttl[i] = fd->rr_ttl[i];
sbin/unwind/libunbound/dns64/dns64.c
826
struct packed_rrset_data* fd, *dd;
sbin/unwind/libunbound/dns64/dns64.c
867
fd = (struct packed_rrset_data*)fk->entry.data;
sbin/unwind/libunbound/dns64/dns64.c
873
dns64_synth_aaaa_data(fk, fd, dk, &dd, super->region, dns64_env);
sbin/unwind/libunbound/dns64/dns64.c
895
s = packed_rrset_sizeof(fd);
sbin/unwind/libunbound/dns64/dns64.c
897
super->region, fd, s);
sbin/unwind/libunbound/libunbound/libworker.c
1046
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
sbin/unwind/libunbound/libunbound/libworker.c
1059
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
sbin/unwind/libunbound/libunbound/libworker.c
1067
void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
sbin/unwind/libunbound/libunbound/libworker.c
1074
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
sbin/unwind/libunbound/libunbound/libworker.c
1089
void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
sbin/unwind/libunbound/libunbound/libworker.c
1097
void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
sbin/unwind/libunbound/libunbound/unbound-event.h
101
struct ub_event* (*new_signal)(struct ub_event_base*, int fd,
sbin/unwind/libunbound/libunbound/unbound-event.h
98
int fd, short bits, void (*cb)(int, short, void*), void* arg);
sbin/unwind/libunbound/services/listen_dnsport.c
1173
item->fd = s;
sbin/unwind/libunbound/services/listen_dnsport.c
1563
cp = comm_point_create_udp(base, ports->fd,
sbin/unwind/libunbound/services/listen_dnsport.c
1572
cp = comm_point_create_doq(base, ports->fd,
sbin/unwind/libunbound/services/listen_dnsport.c
1577
cp = comm_point_create_tcp(base, ports->fd,
sbin/unwind/libunbound/services/listen_dnsport.c
1585
cp = comm_point_create_tcp(base, ports->fd,
sbin/unwind/libunbound/services/listen_dnsport.c
1617
cp = comm_point_create_udp_ancil(base, ports->fd,
sbin/unwind/libunbound/services/listen_dnsport.c
2077
if(list->fd != -1) {
sbin/unwind/libunbound/services/listen_dnsport.c
2078
sock_close(list->fd);
sbin/unwind/libunbound/services/listen_dnsport.c
2302
verbose(VERB_ALGO, "tcp channel read side closed %d", req->cp->fd);
sbin/unwind/libunbound/services/listen_dnsport.h
143
int fd;
sbin/unwind/libunbound/services/listen_dnsport.h
889
void doq_client_event_cb(int fd, short event, void* arg);
sbin/unwind/libunbound/services/listen_dnsport.h
892
void doq_client_timer_cb(int fd, short event, void* arg);
sbin/unwind/libunbound/services/outside_network.c
1039
reuse->pending->c->fd, reuse->pending,
sbin/unwind/libunbound/services/outside_network.c
1387
outnet_tcp_take_query_setup(pend->c->fd, pend,
sbin/unwind/libunbound/services/outside_network.c
2065
int fd, noproto;
sbin/unwind/libunbound/services/outside_network.c
2076
fd = create_udp_sock(AF_INET6, SOCK_DGRAM,
sbin/unwind/libunbound/services/outside_network.c
2082
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
sbin/unwind/libunbound/services/outside_network.c
2086
return fd;
sbin/unwind/libunbound/services/outside_network.c
2162
int my_if, fd, portno, inuse, tries=0;
sbin/unwind/libunbound/services/outside_network.c
2200
fd = udp_sockport(&pif->addr, pif->addrlen, pif->pfxlen,
sbin/unwind/libunbound/services/outside_network.c
2202
if(fd == -1 && !inuse) {
sbin/unwind/libunbound/services/outside_network.c
2210
if(fd != -1) {
sbin/unwind/libunbound/services/outside_network.c
2215
if(connect(fd, (struct sockaddr*)&pend->addr,
sbin/unwind/libunbound/services/outside_network.c
2223
sock_close(fd);
sbin/unwind/libunbound/services/outside_network.c
2242
comm_point_start_listening(pend->pc->cp, fd, -1);
sbin/unwind/libunbound/services/outside_network.c
2580
outnet_tcp_take_query_setup(pend->c->fd, pend,
sbin/unwind/libunbound/services/outside_network.c
2783
if(pend_tcp->c->fd == -1) {
sbin/unwind/libunbound/services/outside_network.c
2797
if(pend_tcp->c->fd != -1 && sq->outnet->tcp_reuse.count <
sbin/unwind/libunbound/services/outside_network.c
3657
int fd = -1;
sbin/unwind/libunbound/services/outside_network.c
3698
fd = create_udp_sock(AF_INET6, SOCK_DGRAM,
sbin/unwind/libunbound/services/outside_network.c
3704
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
sbin/unwind/libunbound/services/outside_network.c
3716
if(fd != -1) {
sbin/unwind/libunbound/services/outside_network.c
3717
return fd;
sbin/unwind/libunbound/services/outside_network.c
3734
int fd = fd_for_dest(outnet, to_addr, to_addrlen);
sbin/unwind/libunbound/services/outside_network.c
3735
if(fd == -1) {
sbin/unwind/libunbound/services/outside_network.c
3738
cp = comm_point_create_udp(outnet->base, fd, outnet->udp_buff, 0,
sbin/unwind/libunbound/services/outside_network.c
3742
close(fd);
sbin/unwind/libunbound/services/outside_network.c
3751
int fd, char* host)
sbin/unwind/libunbound/services/outside_network.c
3753
cp->ssl = outgoing_ssl_fd(outnet->sslctx, fd);
sbin/unwind/libunbound/services/outside_network.c
3811
int fd = outnet_get_tcp_fd(to_addr, to_addrlen, outnet->tcp_mss,
sbin/unwind/libunbound/services/outside_network.c
3813
if(fd == -1) {
sbin/unwind/libunbound/services/outside_network.c
3816
fd_set_nonblock(fd);
sbin/unwind/libunbound/services/outside_network.c
3817
if(!outnet_tcp_connect(fd, to_addr, to_addrlen)) {
sbin/unwind/libunbound/services/outside_network.c
3824
close(fd);
sbin/unwind/libunbound/services/outside_network.c
3832
if(!setup_comm_ssl(cp, outnet, fd, host)) {
sbin/unwind/libunbound/services/outside_network.c
3840
comm_point_start_listening(cp, fd, timeout);
sbin/unwind/libunbound/services/outside_network.c
3887
int fd = outnet_get_tcp_fd(to_addr, to_addrlen, outnet->tcp_mss,
sbin/unwind/libunbound/services/outside_network.c
3889
if(fd == -1) {
sbin/unwind/libunbound/services/outside_network.c
3892
fd_set_nonblock(fd);
sbin/unwind/libunbound/services/outside_network.c
3893
if(!outnet_tcp_connect(fd, to_addr, to_addrlen)) {
sbin/unwind/libunbound/services/outside_network.c
3901
close(fd);
sbin/unwind/libunbound/services/outside_network.c
3909
if(!setup_comm_ssl(cp, outnet, fd, host)) {
sbin/unwind/libunbound/services/outside_network.c
3917
comm_point_start_listening(cp, fd, timeout);
sbin/unwind/libunbound/services/outside_network.c
395
reuse->pending->c->fd);
sbin/unwind/libunbound/services/outside_network.c
756
pend->c->fd = s;
sbin/unwind/libunbound/services/outside_network.c
772
pend->c->fd = s;
sbin/unwind/libunbound/services/outside_network.c
783
pend->c->fd = s;
sbin/unwind/libunbound/util/data/msgreply.c
793
struct packed_rrset_data* fd, *dd;
sbin/unwind/libunbound/util/data/msgreply.c
798
fd = (struct packed_rrset_data*)fk->entry.data;
sbin/unwind/libunbound/util/data/msgreply.c
810
s = packed_rrset_sizeof(fd);
sbin/unwind/libunbound/util/data/msgreply.c
813
region, fd, s);
sbin/unwind/libunbound/util/data/msgreply.c
814
else dd = (struct packed_rrset_data*)memdup(fd, s);
sbin/unwind/libunbound/util/data/packed_rrset.c
387
struct packed_rrset_data* fd, *dd;
sbin/unwind/libunbound/util/data/packed_rrset.c
390
fd = (struct packed_rrset_data*)key->entry.data;
sbin/unwind/libunbound/util/data/packed_rrset.c
398
dd = (struct packed_rrset_data*)memdup(fd, packed_rrset_sizeof(fd));
sbin/unwind/libunbound/util/mini_event.c
271
void event_set(struct event* ev, int fd, short bits,
sbin/unwind/libunbound/util/mini_event.c
275
ev->ev_fd = fd;
sbin/unwind/libunbound/util/net_help.c
1647
void* incoming_ssl_fd(void* sslctx, int fd)
sbin/unwind/libunbound/util/net_help.c
1657
if(!SSL_set_fd(ssl, fd)) {
sbin/unwind/libunbound/util/net_help.c
1664
(void)sslctx; (void)fd;
sbin/unwind/libunbound/util/net_help.c
1669
void* outgoing_ssl_fd(void* sslctx, int fd)
sbin/unwind/libunbound/util/net_help.c
1679
if(!SSL_set_fd(ssl, fd)) {
sbin/unwind/libunbound/util/net_help.c
1686
(void)sslctx; (void)fd;
sbin/unwind/libunbound/util/net_help.h
528
void* incoming_ssl_fd(void* sslctx, int fd);
sbin/unwind/libunbound/util/net_help.h
536
void* outgoing_ssl_fd(void* sslctx, int fd);
sbin/unwind/libunbound/util/netevent.c
1018
log_assert(rep.c && rep.c->buffer && rep.c->fd == fd);
sbin/unwind/libunbound/util/netevent.c
1024
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
1037
rcv = recvmsg(fd, &msg, MSG_DONTWAIT);
sbin/unwind/libunbound/util/netevent.c
1123
if(!rep.c || rep.c->fd == -1) /* commpoint closed */
sbin/unwind/libunbound/util/netevent.c
1130
comm_point_udp_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
1142
log_assert(rep.c && rep.c->buffer && rep.c->fd == fd);
sbin/unwind/libunbound/util/netevent.c
1147
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
1149
rcv = recvfrom(fd, (void*)sldns_buffer_begin(rep.c->buffer),
sbin/unwind/libunbound/util/netevent.c
1157
fd, strerror(errno));
sbin/unwind/libunbound/util/netevent.c
1196
if(!rep.c || rep.c->fd != fd) /* commpoint closed to -1 or reused for
sbin/unwind/libunbound/util/netevent.c
1213
doq_set_ecn(int fd, int family, uint32_t ecn)
sbin/unwind/libunbound/util/netevent.c
1217
if(setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val,
sbin/unwind/libunbound/util/netevent.c
1224
if(setsockopt(fd, IPPROTO_IP, IP_TOS, &val,
sbin/unwind/libunbound/util/netevent.c
1374
doq_set_ecn(c->fd, paddr->addr.sockaddr.in.sin_family, ecn);
sbin/unwind/libunbound/util/netevent.c
1377
ret = sendmsg(c->fd, &msg, MSG_DONTWAIT);
sbin/unwind/libunbound/util/netevent.c
1588
rcv = recvmsg(c->fd, &msg, MSG_DONTWAIT);
sbin/unwind/libunbound/util/netevent.c
2512
comm_point_doq_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
2524
log_assert(c && c->doq_socket->pkt_buf && c->fd == fd);
sbin/unwind/libunbound/util/netevent.c
2613
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
2922
setup_tcp_handler(struct comm_point* c, int fd, int cur, int max)
sbin/unwind/libunbound/util/netevent.c
2926
log_assert(c->fd == -1);
sbin/unwind/libunbound/util/netevent.c
2954
comm_point_start_listening(c, fd, adjusted_tcp_timeout(c));
sbin/unwind/libunbound/util/netevent.c
2957
void comm_base_handle_slow_accept(int ATTR_UNUSED(fd),
sbin/unwind/libunbound/util/netevent.c
2976
new_fd = accept(c->fd, (struct sockaddr*)addr, addrlen);
sbin/unwind/libunbound/util/netevent.c
2979
new_fd = accept4(c->fd, (struct sockaddr*)addr, addrlen, SOCK_NONBLOCK);
sbin/unwind/libunbound/util/netevent.c
3198
comm_point_tcp_accept_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
3262
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
3263
(void)fd;
sbin/unwind/libunbound/util/netevent.c
3282
c_hdl->fd = new_fd;
sbin/unwind/libunbound/util/netevent.c
400
log_assert(c->fd != -1);
sbin/unwind/libunbound/util/netevent.c
4006
comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok)
sbin/unwind/libunbound/util/netevent.c
4016
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
4035
r = recv(fd, (void*)sldns_buffer_at(c->buffer,
sbin/unwind/libunbound/util/netevent.c
407
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
sbin/unwind/libunbound/util/netevent.c
4080
r = recv(fd, (void*)sldns_buffer_at(c->buffer,
sbin/unwind/libunbound/util/netevent.c
411
sent = send(c->fd, (void*)sldns_buffer_begin(packet),
sbin/unwind/libunbound/util/netevent.c
4120
r = recv(fd,(void*)sldns_buffer_at(c->buffer,c->tcp_byte_count),
sbin/unwind/libunbound/util/netevent.c
4153
r = recv(fd, (void*)sldns_buffer_current(c->buffer),
sbin/unwind/libunbound/util/netevent.c
4252
comm_point_tcp_handle_write(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
4264
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
4270
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
sbin/unwind/libunbound/util/netevent.c
4338
r = sendmsg(fd, &msg, MSG_FASTOPEN);
sbin/unwind/libunbound/util/netevent.c
4369
if(connect(fd, (struct sockaddr *)&c->repinfo.remote_addr,
sbin/unwind/libunbound/util/netevent.c
4427
r = writev(fd, iov, 2);
sbin/unwind/libunbound/util/netevent.c
4430
r = send(fd, (void*)(((uint8_t*)&len)+c->tcp_write_byte_count),
sbin/unwind/libunbound/util/netevent.c
4433
r = send(fd, (void*)(((uint8_t*)&len)+c->tcp_byte_count),
sbin/unwind/libunbound/util/netevent.c
4496
r = send(fd, (void*)(c->tcp_write_pkt + c->tcp_write_byte_count - 2),
sbin/unwind/libunbound/util/netevent.c
4499
r = send(fd, (void*)sldns_buffer_current(buffer),
sbin/unwind/libunbound/util/netevent.c
4541
tcp_req_info_read_again(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
4547
r = comm_point_tcp_handle_read(fd, c, 0);
sbin/unwind/libunbound/util/netevent.c
4548
else r = comm_point_tcp_handle_write(fd, c);
sbin/unwind/libunbound/util/netevent.c
4565
tcp_more_read_again(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
4574
if(!comm_point_tcp_handle_read(fd, c, 0)) {
sbin/unwind/libunbound/util/netevent.c
458
p.fd = c->fd;
sbin/unwind/libunbound/util/netevent.c
4589
tcp_more_write_again(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
4598
if(!comm_point_tcp_handle_write(fd, c)) {
sbin/unwind/libunbound/util/netevent.c
4612
comm_point_tcp_handle_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
4618
if(c->fd == -1 || c->fd != fd)
sbin/unwind/libunbound/util/netevent.c
4659
if(!comm_point_tcp_handle_read(fd, c, 0)) {
sbin/unwind/libunbound/util/netevent.c
4670
if(!tcp_req_info_read_again(fd, c))
sbin/unwind/libunbound/util/netevent.c
4674
tcp_more_read_again(fd, c);
sbin/unwind/libunbound/util/netevent.c
4680
if(!comm_point_tcp_handle_write(fd, c)) {
sbin/unwind/libunbound/util/netevent.c
4691
if(!tcp_req_info_read_again(fd, c))
sbin/unwind/libunbound/util/netevent.c
4695
tcp_more_write_again(fd, c);
sbin/unwind/libunbound/util/netevent.c
4774
http_read_more(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
4778
r = recv(fd, (void*)sldns_buffer_current(c->buffer),
sbin/unwind/libunbound/util/netevent.c
5215
ret = recv(h2_session->c->fd, (void*)buf, len, MSG_DONTWAIT);
sbin/unwind/libunbound/util/netevent.c
5252
comm_point_http2_handle_read(int ATTR_UNUSED(fd), struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5291
comm_point_http_handle_read(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5294
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
5310
return comm_point_http2_handle_read(fd, c);
sbin/unwind/libunbound/util/netevent.c
5325
if(!http_read_more(fd, c))
sbin/unwind/libunbound/util/netevent.c
5389
http_check_connect(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5395
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
sbin/unwind/libunbound/util/netevent.c
542
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
sbin/unwind/libunbound/util/netevent.c
546
sent = send(c->fd, (void*)sldns_buffer_begin(packet),
sbin/unwind/libunbound/util/netevent.c
5476
http_write_more(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5480
r = send(fd, (void*)sldns_buffer_current(c->buffer),
sbin/unwind/libunbound/util/netevent.c
5543
ret = send(h2_session->c->fd, (void*)buf, len, 0);
sbin/unwind/libunbound/util/netevent.c
5586
comm_point_http2_handle_write(int ATTR_UNUSED(fd), struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5619
comm_point_http_handle_write(int fd, struct comm_point* c)
sbin/unwind/libunbound/util/netevent.c
5622
log_assert(fd != -1);
sbin/unwind/libunbound/util/netevent.c
5627
int r = http_check_connect(fd, c);
sbin/unwind/libunbound/util/netevent.c
5645
return comm_point_http2_handle_write(fd, c);
sbin/unwind/libunbound/util/netevent.c
5660
if(!http_write_more(fd, c))
sbin/unwind/libunbound/util/netevent.c
5680
comm_point_http_handle_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
5697
if(!comm_point_http_handle_read(fd, c)) {
sbin/unwind/libunbound/util/netevent.c
5709
if(!comm_point_http_handle_write(fd, c)) {
sbin/unwind/libunbound/util/netevent.c
5723
void comm_point_local_handle_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
5730
if(!comm_point_tcp_handle_read(fd, c, 1)) {
sbin/unwind/libunbound/util/netevent.c
5740
void comm_point_raw_handle_callback(int ATTR_UNUSED(fd),
sbin/unwind/libunbound/util/netevent.c
5755
comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer,
sbin/unwind/libunbound/util/netevent.c
5771
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
5802
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
5809
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
sbin/unwind/libunbound/util/netevent.c
5820
comm_point_create_udp_ancil(struct comm_base *base, int fd,
sbin/unwind/libunbound/util/netevent.c
5836
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
5867
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
5874
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
sbin/unwind/libunbound/util/netevent.c
5885
comm_point_create_doq(struct comm_base *base, int fd, sldns_buffer* buffer,
sbin/unwind/libunbound/util/netevent.c
5905
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
5943
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
5950
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
sbin/unwind/libunbound/util/netevent.c
5968
sock_close(fd);
sbin/unwind/libunbound/util/netevent.c
5991
c->fd = -1;
sbin/unwind/libunbound/util/netevent.c
6057
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6092
c->fd = -1;
sbin/unwind/libunbound/util/netevent.c
6179
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6196
comm_point_create_tcp(struct comm_base *base, int fd, int num,
sbin/unwind/libunbound/util/netevent.c
6218
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
6258
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6314
c->fd = -1;
sbin/unwind/libunbound/util/netevent.c
6352
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6383
c->fd = -1;
sbin/unwind/libunbound/util/netevent.c
640
log_assert(c->fd != -1);
sbin/unwind/libunbound/util/netevent.c
6421
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6439
comm_point_create_local(struct comm_base *base, int fd, size_t bufsize,
sbin/unwind/libunbound/util/netevent.c
6454
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
6488
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6508
comm_point_create_raw(struct comm_base* base, int fd, int writing,
sbin/unwind/libunbound/util/netevent.c
6523
c->fd = fd;
sbin/unwind/libunbound/util/netevent.c
6554
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
sbin/unwind/libunbound/util/netevent.c
6578
if(c->fd != -1) {
sbin/unwind/libunbound/util/netevent.c
6579
verbose(5, "comm_point_close of %d: event_del", c->fd);
sbin/unwind/libunbound/util/netevent.c
6599
if(c->fd != -1 && !c->do_not_close) {
sbin/unwind/libunbound/util/netevent.c
6607
verbose(VERB_ALGO, "close fd %d", c->fd);
sbin/unwind/libunbound/util/netevent.c
6608
sock_close(c->fd);
sbin/unwind/libunbound/util/netevent.c
6610
c->fd = -1;
sbin/unwind/libunbound/util/netevent.c
6794
verbose(VERB_ALGO, "comm point stop listening %d", c->fd);
sbin/unwind/libunbound/util/netevent.c
6807
c->fd==-1?newfd:c->fd, msec);
sbin/unwind/libunbound/util/netevent.c
6840
verbose(5, "startlistening %d mode rw", (newfd==-1?c->fd:newfd));
sbin/unwind/libunbound/util/netevent.c
6843
verbose(5, "startlistening %d mode r", (newfd==-1?c->fd:newfd));
sbin/unwind/libunbound/util/netevent.c
6846
verbose(5, "startlistening %d mode w", (newfd==-1?c->fd:newfd));
sbin/unwind/libunbound/util/netevent.c
6851
if(c->fd != -1 && c->fd != newfd) {
sbin/unwind/libunbound/util/netevent.c
6852
verbose(5, "cpsl close of fd %d for %d", c->fd, newfd);
sbin/unwind/libunbound/util/netevent.c
6853
sock_close(c->fd);
sbin/unwind/libunbound/util/netevent.c
6855
c->fd = newfd;
sbin/unwind/libunbound/util/netevent.c
6856
ub_event_set_fd(c->ev->ev, c->fd);
sbin/unwind/libunbound/util/netevent.c
6867
verbose(VERB_ALGO, "comm point listen_for_rw %d %d", c->fd, wr);
sbin/unwind/libunbound/util/netevent.c
6970
comm_timer_callback(int ATTR_UNUSED(fd), short event, void* arg)
sbin/unwind/libunbound/util/netevent.c
730
sent = sendmsg(c->fd, &msg, 0);
sbin/unwind/libunbound/util/netevent.c
773
p.fd = c->fd;
sbin/unwind/libunbound/util/netevent.c
856
sent = sendmsg(c->fd, &msg, 0);
sbin/unwind/libunbound/util/netevent.c
995
comm_point_udp_ancil_callback(int fd, short event, void* arg)
sbin/unwind/libunbound/util/netevent.h
1142
void comm_timer_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
1152
void comm_signal_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
1162
void comm_point_local_handle_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
1172
void comm_point_raw_handle_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
1182
void comm_base_handle_slow_accept(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
214
int fd;
sbin/unwind/libunbound/util/netevent.h
576
int fd, struct sldns_buffer* buffer, int pp2_enabled,
sbin/unwind/libunbound/util/netevent.h
594
int fd, struct sldns_buffer* buffer, int pp2_enabled,
sbin/unwind/libunbound/util/netevent.h
614
int fd, struct sldns_buffer* buffer,
sbin/unwind/libunbound/util/netevent.h
649
int fd, int num, int idle_timeout, int harden_large_queries,
sbin/unwind/libunbound/util/netevent.h
691
int fd, size_t bufsize,
sbin/unwind/libunbound/util/netevent.h
704
int fd, int writing,
sbin/unwind/libunbound/util/netevent.h
877
void comm_point_udp_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
887
void comm_point_udp_ancil_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
897
void comm_point_doq_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
907
void comm_point_tcp_accept_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
917
void comm_point_tcp_handle_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/netevent.h
927
void comm_point_http_handle_callback(int fd, short event, void* arg);
sbin/unwind/libunbound/util/tube.c
162
r = read(c->fd, ((uint8_t*)&tube->cmd_len) + tube->cmd_read,
sbin/unwind/libunbound/util/tube.c
192
r = read(c->fd, tube->cmd_msg+tube->cmd_read-sizeof(tube->cmd_len),
sbin/unwind/libunbound/util/tube.c
242
r = write(c->fd, ((uint8_t*)&item->len) + tube->res_write,
sbin/unwind/libunbound/util/tube.c
259
r = write(c->fd, item->buf + tube->res_write - sizeof(item->len),
sbin/unwind/libunbound/util/tube.c
292
int fd = tube->sw;
sbin/unwind/libunbound/util/tube.c
296
r = write(fd, &len, sizeof(len));
sbin/unwind/libunbound/util/tube.c
304
if(!fd_set_block(fd))
sbin/unwind/libunbound/util/tube.c
309
if((r=write(fd, ((char*)&len)+d, sizeof(len)-d)) == -1) {
sbin/unwind/libunbound/util/tube.c
313
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
320
if((r=write(fd, buf+d, len-d)) == -1) {
sbin/unwind/libunbound/util/tube.c
324
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
329
if(!fd_set_nonblock(fd))
sbin/unwind/libunbound/util/tube.c
338
int fd = tube->sr;
sbin/unwind/libunbound/util/tube.c
343
r = read(fd, len, sizeof(*len));
sbin/unwind/libunbound/util/tube.c
353
if(!fd_set_block(fd))
sbin/unwind/libunbound/util/tube.c
358
if((r=read(fd, ((char*)len)+d, sizeof(*len)-d)) == -1) {
sbin/unwind/libunbound/util/tube.c
360
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
364
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
371
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
377
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
382
if((r=read(fd, (*buf)+d, (size_t)((ssize_t)*len)-d)) == -1) {
sbin/unwind/libunbound/util/tube.c
384
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
389
(void)fd_set_nonblock(fd);
sbin/unwind/libunbound/util/tube.c
395
if(!fd_set_nonblock(fd)) {
sbin/unwind/libunbound/util/tube.c
404
pollit(int fd, struct timeval* t)
sbin/unwind/libunbound/util/tube.c
410
fds.fd = fd;
sbin/unwind/libunbound/util/tube.c
446
fds.fd = tube->sr;
sbin/unwind/libunbound/util/tube.c
520
void tube_handle_signal(int ATTR_UNUSED(fd), short ATTR_UNUSED(events),
sbin/unwind/libunbound/util/tube.c
781
void tube_handle_signal(int ATTR_UNUSED(fd), short ATTR_UNUSED(events),
sbin/unwind/libunbound/util/tube.h
278
void tube_handle_signal(int fd, short events, void* arg);
sbin/unwind/libunbound/util/ub_event.h
102
void ub_event_set_fd(struct ub_event*, int fd);
sbin/unwind/libunbound/util/ub_event.h
89
int fd, short bits, void (*cb)(int, short, void*), void* arg);
sbin/unwind/libunbound/util/ub_event.h
91
struct ub_event* ub_signal_new(struct ub_event_base*, int fd,
sbin/unwind/libunbound/util/ub_event_pluggable.c
168
my_event_set_fd(struct ub_event* ev, int fd)
sbin/unwind/libunbound/util/ub_event_pluggable.c
170
AS_MY_EVENT(ev)->ev.ev_fd = fd;
sbin/unwind/libunbound/util/ub_event_pluggable.c
276
my_event_new(struct ub_event_base* base, int fd, short bits,
sbin/unwind/libunbound/util/ub_event_pluggable.c
285
event_set(&my_ev->ev, fd, NATIVE_BITS(bits), NATIVE_BITS_CB(cb), arg);
sbin/unwind/libunbound/util/ub_event_pluggable.c
296
my_signal_new(struct ub_event_base* base, int fd,
sbin/unwind/libunbound/util/ub_event_pluggable.c
305
signal_set(&my_ev->ev, fd, NATIVE_BITS_CB(cb), arg);
sbin/unwind/libunbound/util/ub_event_pluggable.c
508
ub_event_new(struct ub_event_base* base, int fd, short bits,
sbin/unwind/libunbound/util/ub_event_pluggable.c
514
return (*base->vmt->new_event)(base, fd, bits, cb, arg);
sbin/unwind/libunbound/util/ub_event_pluggable.c
520
ub_signal_new(struct ub_event_base* base, int fd,
sbin/unwind/libunbound/util/ub_event_pluggable.c
526
return (*base->vmt->new_signal)(base, fd, cb, arg);
sbin/unwind/libunbound/util/ub_event_pluggable.c
565
ub_event_set_fd(struct ub_event* ev, int fd)
sbin/unwind/libunbound/util/ub_event_pluggable.c
570
(*ev->vmt->set_fd)(ev, fd);
sbin/unwind/libunbound/util/ub_event_pluggable.c
89
# define UB_EV_BITS_CB(C) void my_ ## C (int fd, short bits, void *arg) \
sbin/unwind/libunbound/util/ub_event_pluggable.c
90
{ (C)(fd, UB_EV_BITS(bits), arg); }
sbin/unwind/libunbound/util/winsock_event.c
469
void event_set(struct event *ev, int fd, short bits,
sbin/unwind/libunbound/util/winsock_event.c
473
ev->ev_fd = fd;
sbin/unwind/libunbound/util/winsock_event.c
93
find_fd(struct event_base* base, int fd)
sbin/unwind/libunbound/util/winsock_event.c
97
if(base->items[i]->ev_fd == fd)
sbin/unwind/libunbound/validator/autotrust.c
1004
if (!(fd = fopen(nm, "r"))) {
sbin/unwind/libunbound/validator/autotrust.c
1010
while ( (r=read_multiline(line, sizeof(line), fd, &line_nr)) != 0) {
sbin/unwind/libunbound/validator/autotrust.c
1014
fclose(fd);
sbin/unwind/libunbound/validator/autotrust.c
1022
fclose(fd);
sbin/unwind/libunbound/validator/autotrust.c
1043
fclose(fd);
sbin/unwind/libunbound/validator/autotrust.c
1050
fclose(fd);
sbin/unwind/libunbound/validator/autotrust.c
992
FILE* fd;
sbin/unwind/libunbound/validator/val_sigcrypt.c
1198
struct packed_rrset_data fd;
sbin/unwind/libunbound/validator/val_sigcrypt.c
1218
memset(&fd, 0, sizeof(fd));
sbin/unwind/libunbound/validator/val_sigcrypt.c
1219
fk.entry.data = &fd;
sbin/unwind/libunbound/validator/val_sigcrypt.c
1220
fd.count = 2;
sbin/unwind/libunbound/validator/val_sigcrypt.c
1221
fd.rr_len = flen;
sbin/unwind/libunbound/validator/val_sigcrypt.c
1222
fd.rr_data = fdata;
sbin/unwind/parse.y
715
check_file_secrecy(int fd, const char *fname)
sbin/unwind/parse.y
719
if (fstat(fd, &st)) {
sbin/unwind/resolver.c
1537
resolver_check_timo(int fd, short events, void *arg)
sbin/unwind/resolver.c
1543
resolver_free_timo(int fd, short events, void *arg)
sbin/unwind/resolver.c
1938
trust_anchor_timo(int fd, short events, void *arg)
sbin/unwind/resolver.c
2209
decay_latest_histograms(int fd, short events, void *arg)
sbin/unwind/resolver.c
425
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
sbin/unwind/resolver.c
459
close(iev_frontend->ibuf.fd);
sbin/unwind/resolver.c
461
close(iev_main->ibuf.fd);
sbin/unwind/resolver.c
487
resolver_dispatch_frontend(int fd, short event, void *bula)
sbin/unwind/resolver.c
629
resolver_dispatch_main(int fd, short event, void *bula)
sbin/unwind/resolver.c
671
if ((fd = imsg_get_fd(&imsg)) == -1)
sbin/unwind/resolver.c
679
if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
sbin/unwind/resolver.c
684
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/unwind/resolver.c
793
try_resolver_timo(int fd, short events, void *arg)
sbin/unwind/unwind.c
253
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
sbin/unwind/unwind.c
258
event_set(&iev_resolver->ev, iev_resolver->ibuf.fd,
sbin/unwind/unwind.c
320
close(iev_frontend->ibuf.fd);
sbin/unwind/unwind.c
322
close(iev_resolver->ibuf.fd);
sbin/unwind/unwind.c
346
start_child(enum uw_process p, char *argv0, int fd, int debug, int verbose)
sbin/unwind/unwind.c
358
close(fd);
sbin/unwind/unwind.c
362
if (fd != 3) {
sbin/unwind/unwind.c
363
if (dup2(fd, 3) == -1)
sbin/unwind/unwind.c
365
} else if (fcntl(fd, F_SETFD, 0) == -1)
sbin/unwind/unwind.c
394
main_dispatch_frontend(int fd, short event, void *bula)
sbin/unwind/unwind.c
459
main_dispatch_resolver(int fd, short event, void *bula)
sbin/unwind/unwind.c
516
main_imsg_compose_frontend_fd(int type, pid_t pid, int fd)
sbin/unwind/unwind.c
519
imsg_compose_event(iev_frontend, type, 0, pid, fd, NULL, 0);
sbin/unwind/unwind.c
538
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
sbin/unwind/unwind.c
544
pid_t pid, int fd, void *data, uint16_t datalen)
sbin/unwind/unwind.c
548
if ((ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data,
sbin/vnconfig/vnconfig.c
186
int fd;
sbin/vnconfig/vnconfig.c
188
fd = open(saltfile, O_RDONLY);
sbin/vnconfig/vnconfig.c
189
if (fd == -1) {
sbin/vnconfig/vnconfig.c
194
fd = open(saltfile, O_RDWR|O_CREAT|O_EXCL, 0600);
sbin/vnconfig/vnconfig.c
195
if (fd == -1)
sbin/vnconfig/vnconfig.c
201
if (write(fd, saltbuf, sizeof(saltbuf))
sbin/vnconfig/vnconfig.c
208
if (read(fd, saltbuf, sizeof(saltbuf))
sbin/vnconfig/vnconfig.c
213
close(fd);
sbin/vnconfig/vnconfig.c
285
int fd, rv = -1;
sbin/vnconfig/vnconfig.c
295
if ((fd = opendev(dev, O_RDONLY, OPENDEV_PART, &rdev)) == -1) {
sbin/vnconfig/vnconfig.c
312
rv = ioctl(fd, VNDIOCSET, &vndio);
sbin/vnconfig/vnconfig.c
323
close(fd);
sbin/vnconfig/vnconfig.c
336
int fd, rv = -1;
sbin/vnconfig/vnconfig.c
339
if ((fd = opendev(vnd, O_RDONLY, OPENDEV_PART, &rdev)) == -1)
sbin/vnconfig/vnconfig.c
348
rv = ioctl(fd, VNDIOCCLR, &vndio);
sbin/vnconfig/vnconfig.c
354
close(fd);
sbin/wsconsctl/display.c
147
if (!cmd || ioctl(fd, cmd, ptr) == -1) {
sbin/wsconsctl/display.c
174
emuls.idx=fd;
sbin/wsconsctl/display.c
176
screens.idx=fd;
sbin/wsconsctl/display.c
194
display_put_values(int fd)
sbin/wsconsctl/display.c
268
if (!cmd || ioctl(fd, cmd, ptr) == -1) {
sbin/wsconsctl/display.c
79
display_get_values(int fd)
sbin/wsconsctl/keyboard.c
102
ioctl(fd, WSKBDIO_GETDEFAULTBELL, &dfbell) == -1)
sbin/wsconsctl/keyboard.c
107
if (ioctl(fd, WSKBDIO_GETMAP, &kbmap) == -1)
sbin/wsconsctl/keyboard.c
109
if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) == -1)
sbin/wsconsctl/keyboard.c
120
ioctl(fd, WSKBDIO_GETKEYREPEAT, &repeat) == -1)
sbin/wsconsctl/keyboard.c
129
ioctl(fd, WSKBDIO_GETDEFAULTKEYREPEAT, &dfrepeat) == -1)
sbin/wsconsctl/keyboard.c
133
if (ioctl(fd, WSKBDIO_GETLEDS, &ledstate) == -1)
sbin/wsconsctl/keyboard.c
137
if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) == -1)
sbin/wsconsctl/keyboard.c
143
if (ioctl(fd, WSKBDIO_GETBACKLIGHT, &kbl) == -1) {
sbin/wsconsctl/keyboard.c
157
keyboard_put_values(int fd)
sbin/wsconsctl/keyboard.c
169
if (bell.which != 0 && ioctl(fd, WSKBDIO_SETBELL, &bell) == -1) {
sbin/wsconsctl/keyboard.c
182
ioctl(fd, WSKBDIO_SETDEFAULTBELL, &dfbell) == -1) {
sbin/wsconsctl/keyboard.c
188
if (ioctl(fd, WSKBDIO_SETMAP, &kbmap) == -1) {
sbin/wsconsctl/keyboard.c
200
ioctl(fd, WSKBDIO_SETKEYREPEAT, &repeat) == -1) {
sbin/wsconsctl/keyboard.c
211
ioctl(fd, WSKBDIO_SETDEFAULTKEYREPEAT, &dfrepeat) == -1) {
sbin/wsconsctl/keyboard.c
217
if (ioctl(fd, WSKBDIO_SETLEDS, &ledstate) == -1) {
sbin/wsconsctl/keyboard.c
224
if (ioctl(fd, WSKBDIO_SETENCODING, &kbdencoding) == -1) {
sbin/wsconsctl/keyboard.c
236
if (ioctl(fd, WSKBDIO_SETBACKLIGHT, &kbl) == -1) {
sbin/wsconsctl/keyboard.c
75
keyboard_get_values(int fd)
sbin/wsconsctl/keyboard.c
81
if (ioctl(fd, WSKBDIO_GTYPE, &kbtype) == -1)
sbin/wsconsctl/keyboard.c
91
if (bell.which != 0 && ioctl(fd, WSKBDIO_GETBELL, &bell) == -1)
sbin/wsconsctl/mouse.c
122
mouse_get_values(int fd)
sbin/wsconsctl/mouse.c
127
if (ioctl(fd, WSMOUSEIO_GTYPE, &mstype) == -1)
sbin/wsconsctl/mouse.c
131
if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, &wmcoords) == -1) {
sbin/wsconsctl/mouse.c
142
if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, &wmcoords) == -1) {
sbin/wsconsctl/mouse.c
162
mouse_put_values(int fd)
sbin/wsconsctl/mouse.c
167
if (ioctl(fd, WSMOUSEIO_SRES, &resolution) == -1) {
sbin/wsconsctl/mouse.c
174
if (ioctl(fd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) == -1) {
sbin/wsconsctl/mouse.c
185
if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, &wmcoords_save) == -1) {
sbin/wsconsctl/mouse.c
193
if (ioctl(fd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) == -1) {
sbin/wsconsctl/mouse.c
207
if (mousecfg_put_field(fd,
sbin/wsconsctl/mousecfg.c
206
mousecfg_put_field(int fd, struct wsmouse_parameters *field)
sbin/wsconsctl/mousecfg.c
221
if ((err = ioctl(fd, WSMOUSEIO_SETPARAMS, field))
sbin/wsconsctl/mousecfg.c
222
|| (err = ioctl(fd, WSMOUSEIO_GETPARAMS, field)))
sbin/wsconsctl/util.c
522
int fd,i;
sbin/wsconsctl/util.c
525
fd=emuls->idx;
sbin/wsconsctl/util.c
527
i = ioctl(fd, WSDISPLAYIO_GETEMULTYPE, &e);
sbin/wsconsctl/util.c
534
i = ioctl(fd, WSDISPLAYIO_GETEMULTYPE, &e);
sbin/wsconsctl/util.c
542
int fd,i;
sbin/wsconsctl/util.c
545
fd=screens->idx;
sbin/wsconsctl/util.c
547
i = ioctl(fd, WSDISPLAYIO_GETSCREENTYPE, &s);
sbin/wsconsctl/util.c
554
i = ioctl(fd, WSDISPLAYIO_GETSCREENTYPE, &s);
sys/arch/alpha/alpha/conf.c
105
cdev_decl(fd);
sys/arch/alpha/alpha/conf.c
170
cdev_disk_init(NFD,fd), /* 37: Floppy disk */
sys/arch/alpha/alpha/conf.c
46
bdev_decl(fd);
sys/arch/alpha/alpha/conf.c
62
bdev_disk_init(NFD,fd), /* 4: Floppy disk */
sys/arch/alpha/include/conf.h
20
bdev_decl(fd);
sys/arch/alpha/include/conf.h
21
cdev_decl(fd);
sys/arch/alpha/stand/boot/boot.c
73
int fd, i, error = 0;
sys/arch/alpha/stand/boot/boot.c
75
fd = open(name, O_RDONLY);
sys/arch/alpha/stand/boot/boot.c
76
if (fd == -1) {
sys/arch/alpha/stand/boot/boot.c
81
if (fstat(fd, &sb) == -1) {
sys/arch/alpha/stand/boot/boot.c
85
if (read(fd, buf, buflen) != buflen) {
sys/arch/alpha/stand/boot/boot.c
94
fchmod(fd, sb.st_mode | S_ISTXT);
sys/arch/alpha/stand/boot/boot.c
96
close(fd);
sys/arch/alpha/stand/bootxx.c
109
if (!open_dev(&fd)) {
sys/arch/alpha/stand/bootxx.c
118
ret.bits = prom_read(fd, bbinfop->bsize, cp,
sys/arch/alpha/stand/bootxx.c
128
prom_close(fd);
sys/arch/alpha/stand/bootxx.c
48
open_dev(fd)
sys/arch/alpha/stand/bootxx.c
49
int *fd;
sys/arch/alpha/stand/bootxx.c
67
*fd = ret.u.retval;
sys/arch/alpha/stand/bootxx.c
81
int i, n, fd, rv;
sys/arch/alpha/stand/installboot.c
240
int fd, sz;
sys/arch/alpha/stand/installboot.c
248
if ((fd = open(fname, O_RDONLY)) < 0) {
sys/arch/alpha/stand/installboot.c
252
if (fstat(fd, &statbuf) != 0) {
sys/arch/alpha/stand/installboot.c
254
close(fd);
sys/arch/alpha/stand/installboot.c
260
close(fd);
sys/arch/alpha/stand/installboot.c
263
if (read(fd, bp, statbuf.st_size) != statbuf.st_size) {
sys/arch/alpha/stand/installboot.c
266
close(fd);
sys/arch/alpha/stand/installboot.c
269
close(fd);
sys/arch/alpha/stand/installboot.c
309
devread(int fd, void *buf, daddr_t blk, size_t size, char *msg)
sys/arch/alpha/stand/installboot.c
311
if (pread(fd, buf, size, dbtob((off_t)blk)) != (ssize_t)size)
sys/arch/alpha/stand/installboot.c
320
int i, fd, ndb;
sys/arch/alpha/stand/installboot.c
335
if ((fd = open(boot, O_RDONLY)) < 0)
sys/arch/alpha/stand/installboot.c
338
if (fstatfs(fd, &statfsbuf) != 0)
sys/arch/alpha/stand/installboot.c
370
if (fsync(fd) != 0)
sys/arch/alpha/stand/installboot.c
373
if (fstat(fd, &statbuf) != 0)
sys/arch/alpha/stand/installboot.c
376
close(fd);
sys/arch/alpha/stand/installboot.c
536
sbread(int fd, daddr_t poffset, struct fs **fs, char *sblock)
sys/arch/alpha/stand/installboot.c
543
devread(fd, sblock, poffset + sboff, SBSIZE, "superblock");
sys/arch/alpha/stand/nboot/machdep.c
180
ttyname(int fd)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
171
if ((fd = open(netboot, O_RDONLY)) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
173
if (fstat(fd, &sb) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
184
if (read(fd, netbb, sb.st_size) != sb.st_size)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
190
close(fd);
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
234
if ((fd = open(outfilename, O_WRONLY | O_CREAT, 0666)) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
239
if (write(fd, netbb, sb.st_size) != sb.st_size)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
245
close(fd);
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
76
int c, fd, i;
sys/arch/amd64/amd64/conf.c
118
cdev_decl(fd);
sys/arch/amd64/amd64/conf.c
186
cdev_disk_init(NFD,fd), /* 9: floppy disk */
sys/arch/amd64/amd64/conf.c
45
bdev_decl(fd);
sys/arch/amd64/amd64/conf.c
57
bdev_disk_init(NFD,fd), /* 2: floppy diskette */
sys/arch/amd64/include/conf.h
39
bdev_decl(fd);
sys/arch/amd64/include/conf.h
40
cdev_decl(fd);
sys/arch/amd64/stand/efiboot/dev_i386.c
175
ttyname(int fd)
sys/arch/amd64/stand/efiboot/exec_i386.c
179
int fd;
sys/arch/amd64/stand/efiboot/exec_i386.c
213
fd = open(path, O_RDONLY);
sys/arch/amd64/stand/efiboot/exec_i386.c
214
if (fd == -1)
sys/arch/amd64/stand/efiboot/exec_i386.c
217
if (fstat(fd, &sb) == -1)
sys/arch/amd64/stand/efiboot/exec_i386.c
229
if (read(fd, buf, buflen) != buflen) {
sys/arch/amd64/stand/efiboot/exec_i386.c
230
close(fd);
sys/arch/amd64/stand/efiboot/exec_i386.c
238
close(fd);
sys/arch/amd64/stand/libsa/dev_i386.c
158
ttyname(int fd)
sys/arch/amd64/stand/libsa/exec_i386.c
201
int fd;
sys/arch/amd64/stand/libsa/exec_i386.c
235
fd = open(path, O_RDONLY);
sys/arch/amd64/stand/libsa/exec_i386.c
236
if (fd == -1)
sys/arch/amd64/stand/libsa/exec_i386.c
239
if (fstat(fd, &sb) == -1)
sys/arch/amd64/stand/libsa/exec_i386.c
250
if (read(fd, buf, buflen) != buflen) {
sys/arch/amd64/stand/libsa/exec_i386.c
251
close(fd);
sys/arch/amd64/stand/libsa/exec_i386.c
259
close(fd);
sys/arch/amd64/stand/pxeboot/devopen.c
150
ttyname(int fd)
sys/arch/amd64/stand/pxeboot/open.c
106
return fd;
sys/arch/amd64/stand/pxeboot/open.c
113
return fd;
sys/arch/amd64/stand/pxeboot/open.c
122
return (fd);
sys/arch/amd64/stand/pxeboot/open.c
80
int fd, i, error;
sys/arch/amd64/stand/pxeboot/open.c
84
for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++)
sys/arch/amd64/stand/rdboot/cmd.c
106
int fd, rc = 0;
sys/arch/amd64/stand/rdboot/cmd.c
122
if ((fd = open(path, O_RDONLY)) == -1) {
sys/arch/amd64/stand/rdboot/cmd.c
132
(void) fstat(fd, &sb);
sys/arch/amd64/stand/rdboot/cmd.c
144
rc = read(fd, p, 1);
sys/arch/amd64/stand/rdboot/cmd.c
174
if (fd != -1)
sys/arch/amd64/stand/rdboot/cmd.c
175
close(fd);
sys/arch/amd64/stand/rdboot/disk.c
161
int fd;
sys/arch/amd64/stand/rdboot/disk.c
183
fd = opendev(devname, O_RDONLY, OPENDEV_BLCK, &devpath);
sys/arch/amd64/stand/rdboot/disk.c
184
if (fd != -1) {
sys/arch/amd64/stand/rdboot/disk.c
185
if (ioctl(fd, DIOCGDINFO, &label) != -1) {
sys/arch/amd64/stand/rdboot/disk.c
189
close(fd);
sys/arch/amd64/stand/rdboot/rdboot.c
123
int fd, ret = 0;
sys/arch/amd64/stand/rdboot/rdboot.c
128
fd = open(BOOTRANDOM, O_RDONLY);
sys/arch/amd64/stand/rdboot/rdboot.c
129
if (fd == -1) {
sys/arch/amd64/stand/rdboot/rdboot.c
135
if (fstat(fd, &sb) == 0) {
sys/arch/amd64/stand/rdboot/rdboot.c
140
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
sys/arch/amd64/stand/rdboot/rdboot.c
142
fchmod(fd, sb.st_mode | S_ISTXT);
sys/arch/amd64/stand/rdboot/rdboot.c
146
close(fd);
sys/arch/amd64/stand/rdboot/rdboot.c
154
fd = open(DEVRANDOM, O_WRONLY);
sys/arch/amd64/stand/rdboot/rdboot.c
155
if (fd == -1) {
sys/arch/amd64/stand/rdboot/rdboot.c
160
write(fd, buf, sizeof(buf));
sys/arch/amd64/stand/rdboot/rdboot.c
161
close(fd);
sys/arch/amd64/stand/rdboot/rdboot.c
175
int fd = -1, ret;
sys/arch/amd64/stand/rdboot/rdboot.c
182
fd = open(path, O_RDONLY);
sys/arch/amd64/stand/rdboot/rdboot.c
183
if (fd == -1)
sys/arch/amd64/stand/rdboot/rdboot.c
185
if (fstat(fd, &sb) == -1)
sys/arch/amd64/stand/rdboot/rdboot.c
195
if (fchmod(fd, sb.st_mode) == -1)
sys/arch/amd64/stand/rdboot/rdboot.c
199
gzfd = gzdopen(fd, "r");
sys/arch/amd64/stand/rdboot/rdboot.c
248
if (fd != -1)
sys/arch/amd64/stand/rdboot/rdboot.c
249
close(fd);
sys/arch/amd64/stand/rdboot/rdboot.c
61
int fd, hasboot, isupgrade = 0;
sys/arch/amd64/stand/rdboot/rdboot.c
63
fd = open(_PATH_CONSOLE, O_RDWR);
sys/arch/amd64/stand/rdboot/rdboot.c
64
login_tty(fd);
sys/arch/arm/include/conf.h
55
bdev_decl(fd);
sys/arch/arm/include/conf.h
56
cdev_decl(fd);
sys/arch/arm64/stand/efiboot/efiboot.c
1222
int fd;
sys/arch/arm64/stand/efiboot/efiboot.c
1234
fd = open(path, O_RDONLY);
sys/arch/arm64/stand/efiboot/efiboot.c
1235
if (fd < 0 || fstat(fd, &sb) == -1) {
sys/arch/arm64/stand/efiboot/efiboot.c
1246
if (read(fd, (void *)addr, sb.st_size) != sb.st_size) {
sys/arch/arm64/stand/efiboot/efiboot.c
1258
lseek(fd, 0, SEEK_SET);
sys/arch/arm64/stand/efiboot/efiboot.c
913
ttyname(int fd)
sys/arch/armv7/stand/efiboot/efiboot.c
1019
int fd;
sys/arch/armv7/stand/efiboot/efiboot.c
1031
fd = open(path, O_RDONLY);
sys/arch/armv7/stand/efiboot/efiboot.c
1032
if (fd < 0 || fstat(fd, &sb) == -1) {
sys/arch/armv7/stand/efiboot/efiboot.c
1043
if (read(fd, (void *)addr, sb.st_size) != sb.st_size) {
sys/arch/armv7/stand/efiboot/efiboot.c
1055
lseek(fd, 0, SEEK_SET);
sys/arch/armv7/stand/efiboot/efiboot.c
786
ttyname(int fd)
sys/arch/hppa/hppa/conf.c
150
cdev_disk_init(NFD,fd), /* 24: floppy drive */
sys/arch/hppa/hppa/conf.c
58
bdev_decl(fd);
sys/arch/hppa/hppa/conf.c
59
cdev_decl(fd);
sys/arch/hppa/hppa/conf.c
70
bdev_disk_init(NFD,fd), /* 7: floppy drive */
sys/arch/hppa/include/conf.h
35
cdev_decl(fd);
sys/arch/hppa/include/conf.h
36
bdev_decl(fd);
sys/arch/hppa/stand/cdboot/elf64.c
33
ELFNAME(exec)(int fd, Elf_Ehdr *elf, uint64_t *marks, int flags)
sys/arch/hppa/stand/libsa/dev_hppa.c
174
ttyname(fd)
sys/arch/hppa/stand/libsa/dev_hppa.c
175
int fd;
sys/arch/i386/i386/conf.c
107
cdev_decl(fd);
sys/arch/i386/i386/conf.c
173
cdev_disk_init(NFD,fd), /* 9: floppy disk */
sys/arch/i386/i386/conf.c
45
bdev_decl(fd);
sys/arch/i386/i386/conf.c
57
bdev_disk_init(NFD,fd), /* 2: floppy diskette */
sys/arch/i386/include/conf.h
39
bdev_decl(fd);
sys/arch/i386/include/conf.h
40
cdev_decl(fd);
sys/arch/i386/stand/libsa/dev_i386.c
158
ttyname(int fd)
sys/arch/i386/stand/libsa/exec_i386.c
167
int fd, psl_check;
sys/arch/i386/stand/libsa/exec_i386.c
223
fd = open(path, O_RDONLY);
sys/arch/i386/stand/libsa/exec_i386.c
224
if (fd == -1)
sys/arch/i386/stand/libsa/exec_i386.c
227
if (fstat(fd, &sb) == -1)
sys/arch/i386/stand/libsa/exec_i386.c
238
if (read(fd, buf, buflen) != buflen) {
sys/arch/i386/stand/libsa/exec_i386.c
239
close(fd);
sys/arch/i386/stand/libsa/exec_i386.c
247
close(fd);
sys/arch/i386/stand/pxeboot/devopen.c
150
ttyname(int fd)
sys/arch/i386/stand/pxeboot/open.c
106
return fd;
sys/arch/i386/stand/pxeboot/open.c
113
return fd;
sys/arch/i386/stand/pxeboot/open.c
122
return (fd);
sys/arch/i386/stand/pxeboot/open.c
80
int fd, i, error;
sys/arch/i386/stand/pxeboot/open.c
84
for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++)
sys/arch/landisk/stand/xxboot/boot1.c
68
int fd = -1;
sys/arch/landisk/stand/xxboot/boot1.c
88
fd = open("boot", O_RDONLY);
sys/arch/landisk/stand/xxboot/boot1.c
91
if (fd == -1 || fstat(fd, &sb) == -1)
sys/arch/landisk/stand/xxboot/boot1.c
99
if (read(fd, (void *)LOADADDRESS, sb.st_size) != sb.st_size)
sys/arch/loongson/loongson/conf.c
93
cdev_decl(fd);
sys/arch/loongson/stand/boot/dev.c
134
pi->fd = rc;
sys/arch/loongson/stand/boot/dev.c
173
rc = pmon_close(pi->fd);
sys/arch/loongson/stand/boot/dev.c
60
int fd;
sys/arch/loongson/stand/boot/dev.c
86
pos = pmon_lseek(pi->fd, offs, 0 /* SEEK_SET */);
sys/arch/loongson/stand/boot/dev.c
92
rc = pmon_read(pi->fd, buf, size);
sys/arch/macppc/stand/netif_of.c
111
netif_close(int fd)
sys/arch/macppc/stand/netif_of.c
117
printf("netif_close(%x)...", fd);
sys/arch/macppc/stand/netif_of.c
119
if (fd != 0) {
sys/arch/macppc/stand/netif_of.c
127
io = &sockets[fd];
sys/arch/mips64/include/mips_opcode.h
117
unsigned fd: 5;
sys/arch/mips64/include/mips_opcode.h
128
unsigned fd: 5;
sys/arch/mips64/include/mips_opcode.h
79
unsigned fd: 5;
sys/arch/mips64/include/mips_opcode.h
88
unsigned fd: 5;
sys/arch/mips64/mips64/db_disasm.c
887
i.FRType.fd, i.FRType.fs, i.FRType.ft >> 2);
sys/arch/mips64/mips64/db_disasm.c
895
i.FRType.fd, i.FRType.fs, i.FRType.ft);
sys/arch/mips64/mips64/db_disasm.c
934
i.FQType.fd, i.FQType.fr,
sys/arch/mips64/mips64/db_disasm.c
943
i.FQType.fd, reg_name[i.FQType.ft],
sys/arch/mips64/mips64/fp_emulate.c
1010
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1017
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1041
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1048
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1069
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1076
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1100
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1107
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1123
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1130
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1133
return fpu_int_l(p, tf, fmt, ft, fs, fd, FP_RM);
sys/arch/mips64/mips64/fp_emulate.c
1138
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1141
return fpu_int_w(p, tf, fmt, ft, fs, fd, FP_RM);
sys/arch/mips64/mips64/fp_emulate.c
1146
uint fs, uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1167
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1174
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1184
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1191
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1207
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1215
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1225
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1233
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1243
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1251
uint fs, uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1272
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1279
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1295
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1302
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1330
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1337
uint fs, uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1366
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1373
uint fs, uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1402
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1409
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1426
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1433
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1436
return fpu_int_l(p, tf, fmt, ft, fs, fd, FP_RN);
sys/arch/mips64/mips64/fp_emulate.c
1441
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1444
return fpu_int_w(p, tf, fmt, ft, fs, fd, FP_RN);
sys/arch/mips64/mips64/fp_emulate.c
1449
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1472
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1479
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1496
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
1503
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1519
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
1526
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1529
return fpu_int_l(p, tf, fmt, ft, fs, fd, FP_RZ);
sys/arch/mips64/mips64/fp_emulate.c
1534
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
1537
return fpu_int_w(p, tf, fmt, ft, fs, fd, FP_RZ);
sys/arch/mips64/mips64/fp_emulate.c
1557
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1565
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1574
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1592
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1598
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1606
if (inst.FRType.fd != 0 || inst.FRType.func != 0)
sys/arch/mips64/mips64/fp_emulate.c
1699
if ((tf->sr & SR_FR_32) != 0 || (inst.FQType.fd & 1) == 0)
sys/arch/mips64/mips64/fp_emulate.c
1700
fpu_store(p, tf, FMT_L, inst.FQType.fd, ddata);
sys/arch/mips64/mips64/fp_emulate.c
1715
((uint64_t *)p->p_md.md_regs)[FPBASE + inst.FQType.fd] = wdata;
sys/arch/mips64/mips64/fp_emulate.c
1718
if (inst.FQType.fd != 0)
sys/arch/mips64/mips64/fp_emulate.c
1738
if (inst.FQType.fd != 0)
sys/arch/mips64/mips64/fp_emulate.c
523
uint ft, fs, fd;
sys/arch/mips64/mips64/fp_emulate.c
631
fd = inst.FRType.fd;
sys/arch/mips64/mips64/fp_emulate.c
633
if ((ft | fs | fd) & 1)
sys/arch/mips64/mips64/fp_emulate.c
643
fpu_c(p, tf, inst.FRType.fmt, ft, fs, fd, inst.FRType.func);
sys/arch/mips64/mips64/fp_emulate.c
645
return (*fpu_op)(p, tf, inst.FRType.fmt, ft, fs, fd);
sys/arch/mips64/mips64/fp_emulate.c
655
uint fr, ft, fs, fd;
sys/arch/mips64/mips64/fp_emulate.c
701
fd = inst.FQType.fd;
sys/arch/mips64/mips64/fp_emulate.c
703
if ((fr | ft | fs | fd) & 1)
sys/arch/mips64/mips64/fp_emulate.c
711
return (*fpu_op)(p, tf, inst.FRType.fmt, fr, ft, fs, fd);
sys/arch/mips64/mips64/fp_emulate.c
776
uint fd, uint rm)
sys/arch/mips64/mips64/fp_emulate.c
799
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
806
uint fd, uint rm)
sys/arch/mips64/mips64/fp_emulate.c
829
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
840
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
868
fpu_store(p, tf, fmt, fd, raw);
sys/arch/mips64/mips64/fp_emulate.c
875
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
891
fpu_store(p, tf, fmt, fd, rslt);
sys/arch/mips64/mips64/fp_emulate.c
898
uint fd, uint op)
sys/arch/mips64/mips64/fp_emulate.c
903
if ((fd & 0x03) != 0)
sys/arch/mips64/mips64/fp_emulate.c
909
cc = fd >> 2;
sys/arch/mips64/mips64/fp_emulate.c
973
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
976
return fpu_int_l(p, tf, fmt, ft, fs, fd, FP_RP);
sys/arch/mips64/mips64/fp_emulate.c
981
uint fd)
sys/arch/mips64/mips64/fp_emulate.c
984
return fpu_int_w(p, tf, fmt, ft, fs, fd, FP_RP);
sys/arch/mips64/mips64/fp_emulate.c
989
uint fd)
sys/arch/octeon/dev/cn30xxfau.c
113
cn30xxfau_op_init(struct cn30xxfau_desc *fd, size_t scroff, size_t regno)
sys/arch/octeon/dev/cn30xxfau.c
115
fd->fd_scroff = scroff;
sys/arch/octeon/dev/cn30xxfau.c
116
fd->fd_regno = regno;
sys/arch/octeon/dev/cn30xxfau.c
120
cn30xxfau_op_save(struct cn30xxfau_desc *fd)
sys/arch/octeon/dev/cn30xxfau.c
123
return octeon_cvmseg_read_8(fd->fd_scroff);
sys/arch/octeon/dev/cn30xxfau.c
127
cn30xxfau_op_restore(struct cn30xxfau_desc *fd, uint64_t backup)
sys/arch/octeon/dev/cn30xxfau.c
129
octeon_cvmseg_write_8(fd->fd_scroff, backup);
sys/arch/octeon/dev/cn30xxfau.c
133
cn30xxfau_op_inc_8(struct cn30xxfau_desc *fd, int64_t v)
sys/arch/octeon/dev/cn30xxfau.c
135
cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 0, OCT_FAU_OP_SIZE_64/* XXX */,
sys/arch/octeon/dev/cn30xxfau.c
136
fd->fd_regno);
sys/arch/octeon/dev/cn30xxfau.c
138
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
sys/arch/octeon/dev/cn30xxfau.c
142
cn30xxfau_op_incwait_8(struct cn30xxfau_desc *fd, int v)
sys/arch/octeon/dev/cn30xxfau.c
144
cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 1, OCT_FAU_OP_SIZE_64/* XXX */,
sys/arch/octeon/dev/cn30xxfau.c
145
fd->fd_regno);
sys/arch/octeon/dev/cn30xxfau.c
147
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
sys/arch/octeon/dev/cn30xxfau.c
151
cn30xxfau_op_add_8(struct cn30xxfau_desc *fd, int64_t v)
sys/arch/octeon/dev/cn30xxfau.c
153
cn30xxfau_op_store_paddr(0, fd->fd_regno, v);
sys/arch/octeon/dev/cn30xxfau.c
157
cn30xxfau_op_set_8(struct cn30xxfau_desc *fd, int64_t v)
sys/arch/octeon/dev/cn30xxfau.c
159
cn30xxfau_op_store_paddr(1, fd->fd_regno, v);
sys/arch/octeon/dev/cn30xxfauvar.h
101
cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 0, OCT_FAU_OP_SIZE_64/* XXX */,
sys/arch/octeon/dev/cn30xxfauvar.h
102
fd->fd_regno);
sys/arch/octeon/dev/cn30xxfauvar.h
106
cn30xxfau_op_inc_read_8(struct cn30xxfau_desc *fd)
sys/arch/octeon/dev/cn30xxfauvar.h
109
return octeon_cvmseg_read_8(fd->fd_scroff);
sys/arch/octeon/dev/cn30xxfauvar.h
99
cn30xxfau_op_inc_fetch_8(struct cn30xxfau_desc *fd, int64_t v)
sys/arch/octeon/octeon/conf.c
103
cdev_decl(fd);
sys/arch/octeon/stand/rdboot/cmd.c
102
int fd, rc = 0;
sys/arch/octeon/stand/rdboot/cmd.c
118
if ((fd = open(path, O_RDONLY)) == -1) {
sys/arch/octeon/stand/rdboot/cmd.c
128
(void) fstat(fd, &sb);
sys/arch/octeon/stand/rdboot/cmd.c
140
rc = read(fd, p, 1);
sys/arch/octeon/stand/rdboot/cmd.c
170
if (fd != -1)
sys/arch/octeon/stand/rdboot/cmd.c
171
close(fd);
sys/arch/octeon/stand/rdboot/disk.c
146
int fd;
sys/arch/octeon/stand/rdboot/disk.c
168
fd = opendev(devname, O_RDONLY, OPENDEV_BLCK, &devpath);
sys/arch/octeon/stand/rdboot/disk.c
169
if (fd != -1) {
sys/arch/octeon/stand/rdboot/disk.c
170
if (ioctl(fd, DIOCGDINFO, &label) != -1) {
sys/arch/octeon/stand/rdboot/disk.c
174
close(fd);
sys/arch/octeon/stand/rdboot/rdboot.c
124
int fd, ret = 0;
sys/arch/octeon/stand/rdboot/rdboot.c
129
fd = open(BOOTRANDOM, O_RDONLY);
sys/arch/octeon/stand/rdboot/rdboot.c
130
if (fd == -1) {
sys/arch/octeon/stand/rdboot/rdboot.c
136
if (fstat(fd, &sb) == 0) {
sys/arch/octeon/stand/rdboot/rdboot.c
141
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
sys/arch/octeon/stand/rdboot/rdboot.c
143
fchmod(fd, sb.st_mode | S_ISTXT);
sys/arch/octeon/stand/rdboot/rdboot.c
147
close(fd);
sys/arch/octeon/stand/rdboot/rdboot.c
155
fd = open(DEVRANDOM, O_WRONLY);
sys/arch/octeon/stand/rdboot/rdboot.c
156
if (fd == -1) {
sys/arch/octeon/stand/rdboot/rdboot.c
161
write(fd, buf, sizeof(buf));
sys/arch/octeon/stand/rdboot/rdboot.c
162
close(fd);
sys/arch/octeon/stand/rdboot/rdboot.c
177
int argc, fd = -1, ret;
sys/arch/octeon/stand/rdboot/rdboot.c
183
fd = open(path, O_RDONLY);
sys/arch/octeon/stand/rdboot/rdboot.c
184
if (fd == -1)
sys/arch/octeon/stand/rdboot/rdboot.c
186
if (fstat(fd, &sb) == -1)
sys/arch/octeon/stand/rdboot/rdboot.c
196
if (fchmod(fd, sb.st_mode) == -1)
sys/arch/octeon/stand/rdboot/rdboot.c
206
n = read(fd, kimg + pos, sb.st_size - pos);
sys/arch/octeon/stand/rdboot/rdboot.c
212
close(fd);
sys/arch/octeon/stand/rdboot/rdboot.c
247
if (fd != -1)
sys/arch/octeon/stand/rdboot/rdboot.c
248
close(fd);
sys/arch/octeon/stand/rdboot/rdboot.c
60
int fd, hasboot, isupgrade = 0;
sys/arch/octeon/stand/rdboot/rdboot.c
62
fd = open(_PATH_CONSOLE, O_RDWR);
sys/arch/octeon/stand/rdboot/rdboot.c
63
login_tty(fd);
sys/arch/powerpc64/stand/rdboot/cmd.c
100
int fd, rc = 0;
sys/arch/powerpc64/stand/rdboot/cmd.c
116
if ((fd = open(path, O_RDONLY)) == -1) {
sys/arch/powerpc64/stand/rdboot/cmd.c
126
(void) fstat(fd, &sb);
sys/arch/powerpc64/stand/rdboot/cmd.c
138
rc = read(fd, p, 1);
sys/arch/powerpc64/stand/rdboot/cmd.c
168
if (fd != -1)
sys/arch/powerpc64/stand/rdboot/cmd.c
169
close(fd);
sys/arch/powerpc64/stand/rdboot/disk.c
161
int fd;
sys/arch/powerpc64/stand/rdboot/disk.c
183
fd = opendev(devname, O_RDONLY, OPENDEV_BLCK, &devpath);
sys/arch/powerpc64/stand/rdboot/disk.c
184
if (fd != -1) {
sys/arch/powerpc64/stand/rdboot/disk.c
185
if (ioctl(fd, DIOCGDINFO, &label) != -1) {
sys/arch/powerpc64/stand/rdboot/disk.c
189
close(fd);
sys/arch/powerpc64/stand/rdboot/rdboot.c
122
int fd, ret = 0;
sys/arch/powerpc64/stand/rdboot/rdboot.c
127
fd = open(BOOTRANDOM, O_RDONLY);
sys/arch/powerpc64/stand/rdboot/rdboot.c
128
if (fd == -1) {
sys/arch/powerpc64/stand/rdboot/rdboot.c
134
if (fstat(fd, &sb) == 0) {
sys/arch/powerpc64/stand/rdboot/rdboot.c
139
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
sys/arch/powerpc64/stand/rdboot/rdboot.c
141
fchmod(fd, sb.st_mode | S_ISTXT);
sys/arch/powerpc64/stand/rdboot/rdboot.c
145
close(fd);
sys/arch/powerpc64/stand/rdboot/rdboot.c
153
fd = open(DEVRANDOM, O_WRONLY);
sys/arch/powerpc64/stand/rdboot/rdboot.c
154
if (fd == -1) {
sys/arch/powerpc64/stand/rdboot/rdboot.c
159
write(fd, buf, sizeof(buf));
sys/arch/powerpc64/stand/rdboot/rdboot.c
160
close(fd);
sys/arch/powerpc64/stand/rdboot/rdboot.c
173
int fd = -1, ret;
sys/arch/powerpc64/stand/rdboot/rdboot.c
179
fd = open(path, O_RDONLY);
sys/arch/powerpc64/stand/rdboot/rdboot.c
180
if (fd == -1)
sys/arch/powerpc64/stand/rdboot/rdboot.c
182
if (fstat(fd, &sb) == -1)
sys/arch/powerpc64/stand/rdboot/rdboot.c
192
if (fchmod(fd, sb.st_mode) == -1)
sys/arch/powerpc64/stand/rdboot/rdboot.c
202
n = read(fd, kimg + pos, sb.st_size - pos);
sys/arch/powerpc64/stand/rdboot/rdboot.c
208
close(fd);
sys/arch/powerpc64/stand/rdboot/rdboot.c
230
if (fd != -1)
sys/arch/powerpc64/stand/rdboot/rdboot.c
231
close(fd);
sys/arch/powerpc64/stand/rdboot/rdboot.c
60
int fd, hasboot, isupgrade = 0;
sys/arch/powerpc64/stand/rdboot/rdboot.c
62
fd = open(_PATH_CONSOLE, O_RDWR);
sys/arch/powerpc64/stand/rdboot/rdboot.c
63
login_tty(fd);
sys/arch/riscv64/stand/efiboot/efiboot.c
1044
int fd;
sys/arch/riscv64/stand/efiboot/efiboot.c
1056
fd = open(path, O_RDONLY);
sys/arch/riscv64/stand/efiboot/efiboot.c
1057
if (fd < 0 || fstat(fd, &sb) == -1) {
sys/arch/riscv64/stand/efiboot/efiboot.c
1068
if (read(fd, (void *)addr, sb.st_size) != sb.st_size) {
sys/arch/riscv64/stand/efiboot/efiboot.c
1080
lseek(fd, 0, SEEK_SET);
sys/arch/riscv64/stand/efiboot/efiboot.c
791
ttyname(int fd)
sys/arch/sparc64/dev/fd.c
1036
struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sparc64/dev/fd.c
1051
fd ? fd->sc_dv.dv_xname : "fdc", s, fdc->sc_state);
sys/arch/sparc64/dev/fd.c
1081
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
1085
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sparc64/dev/fd.c
1086
if (fd == NULL) {
sys/arch/sparc64/dev/fd.c
1093
if (fd->sc_bp != NULL)
sys/arch/sparc64/dev/fd.c
1239
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
1259
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sparc64/dev/fd.c
1260
if (fd == NULL) {
sys/arch/sparc64/dev/fd.c
1266
bp = fd->sc_bp;
sys/arch/sparc64/dev/fd.c
1268
fd->sc_ops = 0;
sys/arch/sparc64/dev/fd.c
1269
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fd.c
1277
(FD_BSIZE(fd) * fd->sc_type->seccyl);
sys/arch/sparc64/dev/fd.c
1282
fd->sc_skip = 0;
sys/arch/sparc64/dev/fd.c
1283
fd->sc_bcount = bp->b_bcount;
sys/arch/sparc64/dev/fd.c
1284
fd->sc_blkno = (bp->b_blkno * DEV_BSIZE) / FD_BSIZE(fd);
sys/arch/sparc64/dev/fd.c
1285
timeout_del(&fd->sc_motoroff_to);
sys/arch/sparc64/dev/fd.c
1286
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/sparc64/dev/fd.c
1290
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/sparc64/dev/fd.c
1292
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/sparc64/dev/fd.c
1297
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fd.c
1302
timeout_add_msec(&fd->sc_motoron_to, 250);
sys/arch/sparc64/dev/fd.c
1304
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fd.c
1320
fd->sc_cylin = cylin;
sys/arch/sparc64/dev/fd.c
1325
if (fd->sc_cylin == cylin)
sys/arch/sparc64/dev/fd.c
1328
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fd.c
1332
fd->sc_dk.dk_seek++;
sys/arch/sparc64/dev/fd.c
1334
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fd.c
1339
FDC_WRFIFO(fdc, fd->sc_type->steprate);
sys/arch/sparc64/dev/fd.c
1346
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc64/dev/fd.c
1347
FDC_WRFIFO(fdc, cylin * fd->sc_type->step);
sys/arch/sparc64/dev/fd.c
1356
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fd.c
1358
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fd.c
1365
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc64/dev/fd.c
1366
FDC_WRFIFO(fdc, 1 * fd->sc_type->step);
sys/arch/sparc64/dev/fd.c
1371
disk_unbusy(&fd->sc_dk, 0, 0, 0);
sys/arch/sparc64/dev/fd.c
1373
cyl != 1 * fd->sc_type->step) {
sys/arch/sparc64/dev/fd.c
1389
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/sparc64/dev/fd.c
1391
type = fd->sc_type;
sys/arch/sparc64/dev/fd.c
1392
sec = fd->sc_blkno % type->seccyl;
sys/arch/sparc64/dev/fd.c
1394
nblks = min(nblks, fd->sc_bcount / FD_BSIZE(fd));
sys/arch/sparc64/dev/fd.c
1395
nblks = min(nblks, FDC_MAXIOSIZE / FD_BSIZE(fd));
sys/arch/sparc64/dev/fd.c
1396
fd->sc_nblks = nblks;
sys/arch/sparc64/dev/fd.c
1397
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FD_BSIZE(fd);
sys/arch/sparc64/dev/fd.c
1404
block = (fd->sc_cylin * type->heads + head) *
sys/arch/sparc64/dev/fd.c
1406
if (block != fd->sc_blkno) {
sys/arch/sparc64/dev/fd.c
1408
(long long)block, (long long)fd->sc_blkno);
sys/arch/sparc64/dev/fd.c
1418
fdc->sc_data = bp->b_data + fd->sc_skip;
sys/arch/sparc64/dev/fd.c
1419
fdc->sc_tc = fd->sc_nbytes;
sys/arch/sparc64/dev/fd.c
1429
fd->sc_drive, fd->sc_cylin, head, sec, nblks);
sys/arch/sparc64/dev/fd.c
1435
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fd.c
1443
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc64/dev/fd.c
1453
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc64/dev/fd.c
1454
FDC_WRFIFO(fdc, fd->sc_cylin); /*track*/
sys/arch/sparc64/dev/fd.c
1476
disk_unbusy(&fd->sc_dk, 0, 0, 0);
sys/arch/sparc64/dev/fd.c
1480
cyl != cylin * fd->sc_type->step) {
sys/arch/sparc64/dev/fd.c
1488
fd->sc_cylin = cylin;
sys/arch/sparc64/dev/fd.c
1520
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc64/dev/fd.c
1528
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc64/dev/fd.c
1540
(long long)fd->sc_blkno, fd->sc_nblks,
sys/arch/sparc64/dev/fd.c
1573
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc64/dev/fd.c
1593
fd->sc_blkno += fd->sc_nblks;
sys/arch/sparc64/dev/fd.c
1594
fd->sc_skip += fd->sc_nbytes;
sys/arch/sparc64/dev/fd.c
1595
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/sparc64/dev/fd.c
1596
bp->b_resid -= fd->sc_nbytes;
sys/arch/sparc64/dev/fd.c
1597
if (finfo == NULL && fd->sc_bcount > 0) {
sys/arch/sparc64/dev/fd.c
1598
cylin = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/sparc64/dev/fd.c
1601
fdfinish(fd, bp);
sys/arch/sparc64/dev/fd.c
1627
FDC_WRFIFO(fdc, fd->sc_drive);
sys/arch/sparc64/dev/fd.c
1648
fd->sc_cylin = 0;
sys/arch/sparc64/dev/fd.c
1652
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/sparc64/dev/fd.c
1682
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
1686
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sparc64/dev/fd.c
1687
bp = fd->sc_bp;
sys/arch/sparc64/dev/fd.c
1690
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/sparc64/dev/fd.c
1698
printf("%s: read-only medium\n", fd->sc_dv.dv_xname);
sys/arch/sparc64/dev/fd.c
1723
printf("%s: no medium?\n", fd->sc_dv.dv_xname);
sys/arch/sparc64/dev/fd.c
1734
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/sparc64/dev/fd.c
1736
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc64/dev/fd.c
1746
fdfinish(fd, bp);
sys/arch/sparc64/dev/fd.c
1770
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
1783
fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/arch/sparc64/dev/fd.c
1784
fdc = (struct fdc_softc *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
1789
fdgetdisklabel(dev, fd, lp, 0);
sys/arch/sparc64/dev/fd.c
1790
bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp));
sys/arch/sparc64/dev/fd.c
1795
fdgetdisklabel(dev, fd, (struct disklabel *)addr, 1);
sys/arch/sparc64/dev/fd.c
1799
*(struct disklabel *)addr = *(fd->sc_dk.dk_label);
sys/arch/sparc64/dev/fd.c
1803
((struct partinfo *)addr)->disklab = fd->sc_dk.dk_label;
sys/arch/sparc64/dev/fd.c
1805
&fd->sc_dk.dk_label->d_partitions[FDPART(dev)];
sys/arch/sparc64/dev/fd.c
1813
error = setdisklabel(fd->sc_dk.dk_label,
sys/arch/sparc64/dev/fd.c
1818
fdstrategy, fd->sc_dk.dk_label);
sys/arch/sparc64/dev/fd.c
1835
fd_do_eject(fd);
sys/arch/sparc64/dev/fd.c
1849
*(struct fd_type *)addr = *fd->sc_type;
sys/arch/sparc64/dev/fd.c
1853
*(int *)addr = fd->sc_opts;
sys/arch/sparc64/dev/fd.c
1857
fd->sc_opts = *(int *)addr;
sys/arch/sparc64/dev/fd.c
1894
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/arch/sparc64/dev/fd.c
1895
struct fd_type *type = fd->sc_type;
sys/arch/sparc64/dev/fd.c
1912
+ finfo->head * type->sectrac) * FD_BSIZE(fd))
sys/arch/sparc64/dev/fd.c
1953
fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp,
sys/arch/sparc64/dev/fd.c
1959
lp->d_secsize = FD_BSIZE(fd);
sys/arch/sparc64/dev/fd.c
1960
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/sparc64/dev/fd.c
1961
lp->d_nsectors = fd->sc_type->sectrac;
sys/arch/sparc64/dev/fd.c
1962
lp->d_ncylinders = fd->sc_type->tracks;
sys/arch/sparc64/dev/fd.c
1963
lp->d_ntracks = fd->sc_type->heads; /* Go figure... */
sys/arch/sparc64/dev/fd.c
1982
fd_do_eject(struct fd_softc *fd)
sys/arch/sparc64/dev/fd.c
1984
struct fdc_softc *fdc = (void *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
310
void fdfinish(struct fd_softc *fd, struct buf *bp);
sys/arch/sparc64/dev/fd.c
623
struct fd_softc *fd = (void *)self;
sys/arch/sparc64/dev/fd.c
628
timeout_set(&fd->sc_motoron_to, fd_motor_on, fd);
sys/arch/sparc64/dev/fd.c
629
timeout_set(&fd->sc_motoroff_to, fd_motor_off, fd);
sys/arch/sparc64/dev/fd.c
639
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fd.c
640
fd->sc_drive = drive;
sys/arch/sparc64/dev/fd.c
641
fd->sc_deftype = type;
sys/arch/sparc64/dev/fd.c
642
fdc->sc_fd[drive] = fd;
sys/arch/sparc64/dev/fd.c
652
fd->sc_dk.dk_flags = DKF_NOLABELREAD;
sys/arch/sparc64/dev/fd.c
653
fd->sc_dk.dk_name = fd->sc_dv.dv_xname;
sys/arch/sparc64/dev/fd.c
654
bufq_init(&fd->sc_bufq, BUFQ_DEFAULT);
sys/arch/sparc64/dev/fd.c
655
disk_attach(&fd->sc_dv, &fd->sc_dk);
sys/arch/sparc64/dev/fd.c
674
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/sparc64/dev/fd.c
680
return (type ? &fd_types[type - 1] : fd->sc_deftype);
sys/arch/sparc64/dev/fd.c
686
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
693
(fd = fd_cd.cd_devs[unit]) == 0 ||
sys/arch/sparc64/dev/fd.c
695
(((bp->b_bcount % FD_BSIZE(fd)) != 0 ||
sys/arch/sparc64/dev/fd.c
696
(bp->b_blkno * DEV_BSIZE) % FD_BSIZE(fd) != 0) &&
sys/arch/sparc64/dev/fd.c
709
if (bp->b_blkno + sz > (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)) {
sys/arch/sparc64/dev/fd.c
710
sz = (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)
sys/arch/sparc64/dev/fd.c
729
(long long)fd->sc_blkno);
sys/arch/sparc64/dev/fd.c
733
bufq_queue(&fd->sc_bufq, bp);
sys/arch/sparc64/dev/fd.c
737
timeout_del(&fd->sc_motoroff_to); /* a good idea */
sys/arch/sparc64/dev/fd.c
738
if (fd->sc_bp == NULL)
sys/arch/sparc64/dev/fd.c
739
fdstart(fd);
sys/arch/sparc64/dev/fd.c
742
struct fdc_softc *fdc = (void *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
762
fdstart(struct fd_softc *fd)
sys/arch/sparc64/dev/fd.c
764
struct fdc_softc *fdc = (void *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
768
fd->sc_bp = bufq_dequeue(&fd->sc_bufq);
sys/arch/sparc64/dev/fd.c
769
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fd.c
777
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/sparc64/dev/fd.c
779
struct fdc_softc *fdc = (void *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
781
fd->sc_skip = 0;
sys/arch/sparc64/dev/fd.c
782
fd->sc_bp = bufq_dequeue(&fd->sc_bufq);
sys/arch/sparc64/dev/fd.c
790
if (TAILQ_NEXT(fd, sc_drivechain) != NULL && ++fd->sc_ops >= 8) {
sys/arch/sparc64/dev/fd.c
791
fd->sc_ops = 0;
sys/arch/sparc64/dev/fd.c
792
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fd.c
793
if (fd->sc_bp != NULL)
sys/arch/sparc64/dev/fd.c
794
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fd.c
799
timeout_add_sec(&fd->sc_motoroff_to, 5);
sys/arch/sparc64/dev/fd.c
826
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
831
if ((fd = TAILQ_FIRST(&fdc->sc_drives)) != NULL)
sys/arch/sparc64/dev/fd.c
832
status |= fd->sc_drive;
sys/arch/sparc64/dev/fd.c
835
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/sparc64/dev/fd.c
844
struct fd_softc *fd = arg;
sys/arch/sparc64/dev/fd.c
848
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/sparc64/dev/fd.c
849
fd_set_motor((struct fdc_softc *)fd->sc_dv.dv_parent);
sys/arch/sparc64/dev/fd.c
856
struct fd_softc *fd = arg;
sys/arch/sparc64/dev/fd.c
857
struct fdc_softc *fdc = (void *)fd->sc_dv.dv_parent;
sys/arch/sparc64/dev/fd.c
861
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fd.c
862
if (fd == TAILQ_FIRST(&fdc->sc_drives) && fdc->sc_state == MOTORWAIT)
sys/arch/sparc64/dev/fd.c
936
struct fd_softc *fd;
sys/arch/sparc64/dev/fd.c
942
fd = fd_cd.cd_devs[unit];
sys/arch/sparc64/dev/fd.c
943
if (fd == NULL)
sys/arch/sparc64/dev/fd.c
945
type = fd_dev_to_type(fd, dev);
sys/arch/sparc64/dev/fd.c
949
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/sparc64/dev/fd.c
950
fd->sc_type != type)
sys/arch/sparc64/dev/fd.c
953
fd->sc_type = type;
sys/arch/sparc64/dev/fd.c
954
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fd.c
955
fd->sc_flags |= FD_OPEN;
sys/arch/sparc64/dev/fd.c
960
if (fd->sc_dk.dk_openmask == 0)
sys/arch/sparc64/dev/fd.c
961
fdgetdisklabel(dev, fd, fd->sc_dk.dk_label, 0);
sys/arch/sparc64/dev/fd.c
967
fd->sc_dk.dk_copenmask |= pmask;
sys/arch/sparc64/dev/fd.c
971
fd->sc_dk.dk_bopenmask |= pmask;
sys/arch/sparc64/dev/fd.c
974
fd->sc_dk.dk_openmask =
sys/arch/sparc64/dev/fd.c
975
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc64/dev/fd.c
983
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/arch/sparc64/dev/fd.c
986
fd->sc_flags &= ~FD_OPEN;
sys/arch/sparc64/dev/fd.c
987
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/sparc64/dev/fd.c
991
fd->sc_dk.dk_copenmask &= ~pmask;
sys/arch/sparc64/dev/fd.c
995
fd->sc_dk.dk_bopenmask &= ~pmask;
sys/arch/sparc64/dev/fd.c
998
fd->sc_dk.dk_openmask =
sys/arch/sparc64/dev/fd.c
999
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc64/dev/fdvar.h
33
#define FD_BSIZE(fd) (128 << fd->sc_type->secsize)
sys/arch/sparc64/include/conf.h
72
bdev_decl(fd);
sys/arch/sparc64/include/conf.h
73
cdev_decl(fd);
sys/arch/sparc64/sparc64/conf.c
137
bdev_disk_init(NFD,fd), /* 16: floppy disk */
sys/arch/sparc64/sparc64/conf.c
210
cdev_disk_init(NFD,fd), /* 54: floppy disk */
sys/arch/sparc64/stand/ofwboot/boot.c
214
loadfile(int fd, char *args, int isupgrade)
sys/arch/sparc64/stand/ofwboot/boot.c
231
if ((rval = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) {
sys/arch/sparc64/stand/ofwboot/boot.c
245
rval = elf64_exec(fd, &hdr.elf64, &entry, &ssym, &esym);
sys/arch/sparc64/stand/ofwboot/boot.c
260
if (fstat(fd, &st) == 0) {
sys/arch/sparc64/stand/ofwboot/boot.c
262
if (fchmod(fd, st.st_mode) == -1)
sys/arch/sparc64/stand/ofwboot/boot.c
266
close(fd);
sys/arch/sparc64/stand/ofwboot/boot.c
277
close(fd);
sys/arch/sparc64/stand/ofwboot/boot.c
299
int fd, error = 0;
sys/arch/sparc64/stand/ofwboot/boot.c
301
fd = open(path, O_RDONLY);
sys/arch/sparc64/stand/ofwboot/boot.c
302
if (fd == -1)
sys/arch/sparc64/stand/ofwboot/boot.c
304
if (fstat(fd, &sb) == -1) {
sys/arch/sparc64/stand/ofwboot/boot.c
308
if (read(fd, buf, buflen) != buflen) {
sys/arch/sparc64/stand/ofwboot/boot.c
317
fchmod(fd, sb.st_mode | S_ISTXT);
sys/arch/sparc64/stand/ofwboot/boot.c
319
close(fd);
sys/arch/sparc64/stand/ofwboot/boot.c
432
int fd;
sys/arch/sparc64/stand/ofwboot/boot.c
522
if ((fd = open(bootline, O_RDONLY)) < 0) {
sys/arch/sparc64/stand/ofwboot/boot.c
531
(void)loadfile(fd, opened_name, isupgrade);
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
152
(void)lseek(fd, (size_t)phdr.p_offset, SEEK_SET);
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
168
if (read(fd, (void *)(long)phdr.p_vaddr, phdr.p_filesz) !=
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
194
(void)lseek(fd, (off_t)elf->e_shoff, SEEK_SET);
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
195
if (read(fd, addr, (size_t)(elf->e_shnum * sizeof(Elf_Shdr))) !=
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
203
if (lseek(fd, (off_t)shp[elf->e_shstrndx].sh_offset, SEEK_SET) == -1) {
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
207
if (read(fd, shstr, shstrsz) != shstrsz) {
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
258
(void)lseek(fd, shp->sh_offset, SEEK_SET);
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
259
if (read(fd, addr, shp->sh_size) != shp->sh_size) {
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
78
elf64_exec(int fd, Elf_Ehdr *elf, u_int64_t *entryp, void **ssymp, void **esymp){
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
96
size = lseek(fd, (size_t)(elf->e_phoff + sizeof(phdr) * i),
sys/arch/sparc64/stand/ofwboot/elf64_exec.c
98
if (read(fd, (void *)&phdr, sizeof(phdr)) != sizeof(phdr)) {
sys/arch/sparc64/stand/ofwboot/netif_of.c
104
DNPRINTF(BOOT_D_OFNET, "netif_close(%x)...", fd);
sys/arch/sparc64/stand/ofwboot/netif_of.c
106
if (fd != 0) {
sys/arch/sparc64/stand/ofwboot/netif_of.c
112
io = &sockets[fd];
sys/arch/sparc64/stand/ofwboot/netif_of.c
99
netif_close(int fd)
sys/ddb/db_dwarf.c
449
int fd = open(filename, O_RDONLY);
sys/ddb/db_dwarf.c
450
if (fd == -1)
sys/ddb/db_dwarf.c
454
if (fstat(fd, &st) == -1)
sys/ddb/db_dwarf.c
462
const char *p = mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0);
sys/ddb/db_dwarf.c
466
close(fd);
sys/dev/diskmap.c
105
if (fdp->fd_ofiles[fd] != fp0) {
sys/dev/diskmap.c
118
KASSERT(fdp->fd_ofiles[fd] == fp0);
sys/dev/diskmap.c
119
flags = fdp->fd_ofileflags[fd];
sys/dev/diskmap.c
120
fdp->fd_ofiles[fd] = NULL;
sys/dev/diskmap.c
121
fdp->fd_ofileflags[fd] = 0;
sys/dev/diskmap.c
129
fdinsert(fdp, fd, flags, fp);
sys/dev/diskmap.c
62
int error, fd;
sys/dev/diskmap.c
73
fd = dm->fd;
sys/dev/diskmap.c
84
if ((error = getvnode(p, fd, &fp0)) != 0)
sys/dev/dt/dt_dev.c
675
int fd;
sys/dev/dt/dt_dev.c
707
err = falloc(p, &fp, &fd);
sys/dev/dt/dt_dev.c
720
dtrv->dtrv_fd = fd;
sys/dev/dt/dt_dev.c
722
fdinsert(p->p_fd, fd, UF_EXCLOSE, fp);
sys/dev/dt/dt_dev.c
730
fdremove(p->p_fd, fd);
sys/dev/isa/fd.c
1001
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/dev/isa/fd.c
1013
fdgetdisklabel(dev, fd, lp, 0);
sys/dev/isa/fd.c
1014
bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp));
sys/dev/isa/fd.c
1019
fdgetdisklabel(dev, fd, (struct disklabel *)addr, 1);
sys/dev/isa/fd.c
1023
*(struct disklabel *)addr = *(fd->sc_dk.dk_label);
sys/dev/isa/fd.c
1027
((struct partinfo *)addr)->disklab = fd->sc_dk.dk_label;
sys/dev/isa/fd.c
1029
&fd->sc_dk.dk_label->d_partitions[FDPART(dev)];
sys/dev/isa/fd.c
1037
error = setdisklabel(fd->sc_dk.dk_label,
sys/dev/isa/fd.c
1042
fdstrategy, fd->sc_dk.dk_label);
sys/dev/isa/fd.c
1057
*(struct fd_type *)addr = *fd->sc_type;
sys/dev/isa/fd.c
1061
*(int *)addr = fd->sc_opts;
sys/dev/isa/fd.c
1065
fd->sc_opts = *(int *)addr;
sys/dev/isa/fd.c
1081
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/dev/isa/fd.c
1082
struct fd_type *type = fd->sc_type;
sys/dev/isa/fd.c
1084
int fd_bsize = FD_BSIZE(fd);
sys/dev/isa/fd.c
148
void fdfinish(struct fd_softc *fd, struct buf *bp);
sys/dev/isa/fd.c
155
fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp,
sys/dev/isa/fd.c
161
lp->d_secsize = FD_BSIZE(fd);
sys/dev/isa/fd.c
162
lp->d_secpercyl = fd->sc_type->seccyl;
sys/dev/isa/fd.c
163
lp->d_nsectors = fd->sc_type->sectrac;
sys/dev/isa/fd.c
164
lp->d_ncylinders = fd->sc_type->tracks;
sys/dev/isa/fd.c
165
lp->d_ntracks = fd->sc_type->heads; /* Go figure... */
sys/dev/isa/fd.c
166
DL_SETDSIZE(lp, fd->sc_type->size);
sys/dev/isa/fd.c
247
struct fd_softc *fd = (void *)self;
sys/dev/isa/fd.c
289
fd->sc_cylin = -1;
sys/dev/isa/fd.c
290
fd->sc_drive = drive;
sys/dev/isa/fd.c
291
fd->sc_deftype = type;
sys/dev/isa/fd.c
293
fdc->sc_link.fdlink.sc_fd[drive] = fd;
sys/dev/isa/fd.c
298
fd->sc_dk.dk_flags = DKF_NOLABELREAD;
sys/dev/isa/fd.c
299
fd->sc_dk.dk_name = fd->sc_dev.dv_xname;
sys/dev/isa/fd.c
300
bufq_init(&fd->sc_bufq, BUFQ_DEFAULT);
sys/dev/isa/fd.c
301
disk_attach(&fd->sc_dev, &fd->sc_dk);
sys/dev/isa/fd.c
304
timeout_set(&fd->fd_motor_on_to, fd_motor_on, fd);
sys/dev/isa/fd.c
305
timeout_set(&fd->fd_motor_off_to, fd_motor_off, fd);
sys/dev/isa/fd.c
306
timeout_set(&fd->fdtimeout_to, fdtimeout, fd);
sys/dev/isa/fd.c
312
struct fd_softc *fd = (void *)self;
sys/dev/isa/fd.c
313
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
319
timeout_del(&fd->fd_motor_on_to);
sys/dev/isa/fd.c
320
timeout_del(&fd->fd_motor_off_to);
sys/dev/isa/fd.c
321
timeout_del(&fd->fdtimeout_to);
sys/dev/isa/fd.c
373
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/dev/isa/fd.c
379
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/dev/isa/fd.c
385
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(bp->b_dev)];
sys/dev/isa/fd.c
388
int fd_bsize = FD_BSIZE(fd);
sys/dev/isa/fd.c
406
if (bp->b_blkno + sz > fd->sc_type->size * bf) {
sys/dev/isa/fd.c
407
sz = fd->sc_type->size * bf - bp->b_blkno;
sys/dev/isa/fd.c
425
(long long)fd->sc_blkno, sz);
sys/dev/isa/fd.c
429
bufq_queue(&fd->sc_bufq, bp);
sys/dev/isa/fd.c
433
timeout_del(&fd->fd_motor_off_to); /* a good idea */
sys/dev/isa/fd.c
434
if (fd->sc_bp == NULL)
sys/dev/isa/fd.c
435
fdstart(fd);
sys/dev/isa/fd.c
438
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
459
fdstart(struct fd_softc *fd)
sys/dev/isa/fd.c
461
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
465
fd->sc_bp = bufq_dequeue(&fd->sc_bufq);
sys/dev/isa/fd.c
466
TAILQ_INSERT_TAIL(&fdc->sc_link.fdlink.sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
474
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/dev/isa/fd.c
476
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
480
fd->sc_skip = 0;
sys/dev/isa/fd.c
481
fd->sc_bp = bufq_dequeue(&fd->sc_bufq);
sys/dev/isa/fd.c
489
if (TAILQ_NEXT(fd, sc_drivechain) != NULL && ++fd->sc_ops >= 8) {
sys/dev/isa/fd.c
490
fd->sc_ops = 0;
sys/dev/isa/fd.c
491
TAILQ_REMOVE(&fdc->sc_link.fdlink.sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
492
if (fd->sc_bp != NULL) {
sys/dev/isa/fd.c
493
TAILQ_INSERT_TAIL(&fdc->sc_link.fdlink.sc_drives, fd,
sys/dev/isa/fd.c
500
timeout_add_sec(&fd->fd_motor_off_to, 5);
sys/dev/isa/fd.c
519
struct fd_softc *fd;
sys/dev/isa/fd.c
523
if ((fd = TAILQ_FIRST(&fdc->sc_link.fdlink.sc_drives)) != NULL)
sys/dev/isa/fd.c
524
status = fd->sc_drive;
sys/dev/isa/fd.c
530
if ((fd = fdc->sc_link.fdlink.sc_fd[n])
sys/dev/isa/fd.c
531
&& (fd->sc_flags & FD_MOTOR))
sys/dev/isa/fd.c
539
struct fd_softc *fd = arg;
sys/dev/isa/fd.c
543
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/dev/isa/fd.c
544
fd_set_motor((struct fdc_softc *)fd->sc_dev.dv_parent, 0);
sys/dev/isa/fd.c
551
struct fd_softc *fd = arg;
sys/dev/isa/fd.c
552
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
556
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/dev/isa/fd.c
557
if ((TAILQ_FIRST(&fdc->sc_link.fdlink.sc_drives) == fd)
sys/dev/isa/fd.c
568
struct fd_softc *fd;
sys/dev/isa/fd.c
574
fd = fd_cd.cd_devs[unit];
sys/dev/isa/fd.c
575
if (fd == 0)
sys/dev/isa/fd.c
577
type = fd_dev_to_type(fd, dev);
sys/dev/isa/fd.c
581
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/dev/isa/fd.c
582
fd->sc_type != type)
sys/dev/isa/fd.c
585
fd->sc_type = type;
sys/dev/isa/fd.c
586
fd->sc_cylin = -1;
sys/dev/isa/fd.c
587
fd->sc_flags |= FD_OPEN;
sys/dev/isa/fd.c
592
if (fd->sc_dk.dk_openmask == 0)
sys/dev/isa/fd.c
593
fdgetdisklabel(dev, fd, fd->sc_dk.dk_label, 0);
sys/dev/isa/fd.c
599
fd->sc_dk.dk_copenmask |= pmask;
sys/dev/isa/fd.c
603
fd->sc_dk.dk_bopenmask |= pmask;
sys/dev/isa/fd.c
606
fd->sc_dk.dk_openmask =
sys/dev/isa/fd.c
607
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/dev/isa/fd.c
615
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
sys/dev/isa/fd.c
618
fd->sc_flags &= ~FD_OPEN;
sys/dev/isa/fd.c
619
fd->sc_opts &= ~FDOPT_NORETRY;
sys/dev/isa/fd.c
623
fd->sc_dk.dk_copenmask &= ~pmask;
sys/dev/isa/fd.c
627
fd->sc_dk.dk_bopenmask &= ~pmask;
sys/dev/isa/fd.c
630
fd->sc_dk.dk_openmask =
sys/dev/isa/fd.c
631
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/dev/isa/fd.c
658
struct fd_softc *fd;
sys/dev/isa/fd.c
670
fd = TAILQ_FIRST(&fdc->sc_link.fdlink.sc_drives);
sys/dev/isa/fd.c
671
if (fd == NULL) {
sys/dev/isa/fd.c
675
fd_bsize = FD_BSIZE(fd);
sys/dev/isa/fd.c
677
bp = fd->sc_bp;
sys/dev/isa/fd.c
679
fd->sc_ops = 0;
sys/dev/isa/fd.c
680
TAILQ_REMOVE(&fdc->sc_link.fdlink.sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
688
(fd_bsize * fd->sc_type->seccyl);
sys/dev/isa/fd.c
693
fd->sc_skip = 0;
sys/dev/isa/fd.c
694
fd->sc_bcount = bp->b_bcount;
sys/dev/isa/fd.c
695
fd->sc_blkno = bp->b_blkno / (fd_bsize / DEV_BSIZE);
sys/dev/isa/fd.c
696
timeout_del(&fd->fd_motor_off_to);
sys/dev/isa/fd.c
697
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/dev/isa/fd.c
701
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/dev/isa/fd.c
704
fdc->sc_link.fdlink.sc_fd[fd->sc_drive ^ 1];
sys/dev/isa/fd.c
709
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/dev/isa/fd.c
713
timeout_add_msec(&fd->fd_motor_on_to, 250);
sys/dev/isa/fd.c
722
if (fd->sc_cylin == cylin)
sys/dev/isa/fd.c
726
out_fdc(iot, ioh, fd->sc_type->steprate);
sys/dev/isa/fd.c
730
out_fdc(iot, ioh, fd->sc_drive); /* drive number */
sys/dev/isa/fd.c
731
out_fdc(iot, ioh, cylin * fd->sc_type->step);
sys/dev/isa/fd.c
733
fd->sc_cylin = -1;
sys/dev/isa/fd.c
736
fd->sc_dk.dk_seek++;
sys/dev/isa/fd.c
737
disk_busy(&fd->sc_dk);
sys/dev/isa/fd.c
739
timeout_add_sec(&fd->fdtimeout_to, 4);
sys/dev/isa/fd.c
744
type = fd->sc_type;
sys/dev/isa/fd.c
746
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/dev/isa/fd.c
748
sec = fd->sc_blkno % type->seccyl;
sys/dev/isa/fd.c
750
nblks = min(nblks, fd->sc_bcount / fd_bsize);
sys/dev/isa/fd.c
752
fd->sc_nblks = nblks;
sys/dev/isa/fd.c
753
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * fd_bsize;
sys/dev/isa/fd.c
758
block = (fd->sc_cylin * type->heads + head) * type->sectrac + sec;
sys/dev/isa/fd.c
759
if (block != fd->sc_blkno) {
sys/dev/isa/fd.c
760
panic("fdintr: block %d != blkno %llu", block, fd->sc_blkno);
sys/dev/isa/fd.c
764
isadma_start(bp->b_data + fd->sc_skip, fd->sc_nbytes,
sys/dev/isa/fd.c
769
read ? "read" : "write", fd->sc_drive, fd->sc_cylin, head,
sys/dev/isa/fd.c
776
fdretry(fd);
sys/dev/isa/fd.c
779
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/dev/isa/fd.c
789
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/dev/isa/fd.c
790
out_fdc(iot, ioh, fd->sc_cylin); /* track */
sys/dev/isa/fd.c
800
disk_busy(&fd->sc_dk);
sys/dev/isa/fd.c
803
timeout_add_sec(&fd->fdtimeout_to, 2);
sys/dev/isa/fd.c
807
timeout_del(&fd->fdtimeout_to);
sys/dev/isa/fd.c
814
disk_unbusy(&fd->sc_dk, 0, 0, 0); /* no data on seek */
sys/dev/isa/fd.c
819
cyl != cylin * fd->sc_type->step) {
sys/dev/isa/fd.c
821
fdcstatus(&fd->sc_dev, 2, "seek failed");
sys/dev/isa/fd.c
823
fdretry(fd);
sys/dev/isa/fd.c
826
fd->sc_cylin = cylin;
sys/dev/isa/fd.c
834
fdretry(fd);
sys/dev/isa/fd.c
838
timeout_del(&fd->fdtimeout_to);
sys/dev/isa/fd.c
840
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/dev/isa/fd.c
841
fd->sc_blkno, (bp->b_flags & B_READ));
sys/dev/isa/fd.c
846
fdcstatus(&fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/dev/isa/fd.c
849
(long long)fd->sc_blkno, fd->sc_nblks);
sys/dev/isa/fd.c
851
fdretry(fd);
sys/dev/isa/fd.c
858
fd->sc_skip / fd_bsize, (struct disklabel *)NULL);
sys/dev/isa/fd.c
863
fd->sc_blkno += fd->sc_nblks;
sys/dev/isa/fd.c
864
fd->sc_skip += fd->sc_nbytes;
sys/dev/isa/fd.c
865
fd->sc_bcount -= fd->sc_nbytes;
sys/dev/isa/fd.c
866
bp->b_resid -= fd->sc_nbytes;
sys/dev/isa/fd.c
867
if (!finfo && fd->sc_bcount > 0) {
sys/dev/isa/fd.c
868
cylin = fd->sc_blkno / fd->sc_type->seccyl;
sys/dev/isa/fd.c
871
fdfinish(fd, bp);
sys/dev/isa/fd.c
880
timeout_add_msec(&fd->fdtimeout_to, 500);
sys/dev/isa/fd.c
884
timeout_del(&fd->fdtimeout_to);
sys/dev/isa/fd.c
894
out_fdc(iot, ioh, fd->sc_drive);
sys/dev/isa/fd.c
896
timeout_add_sec(&fd->fdtimeout_to, 5);
sys/dev/isa/fd.c
900
timeout_del(&fd->fdtimeout_to);
sys/dev/isa/fd.c
910
fdcstatus(&fd->sc_dev, 2, "recalibrate failed");
sys/dev/isa/fd.c
912
fdretry(fd);
sys/dev/isa/fd.c
915
fd->sc_cylin = 0;
sys/dev/isa/fd.c
919
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/dev/isa/fd.c
924
fdcstatus(&fd->sc_dev, 0, "stray interrupt");
sys/dev/isa/fd.c
937
struct fd_softc *fd = arg;
sys/dev/isa/fd.c
938
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
945
fdcstatus(&fd->sc_dev, 0, "timeout");
sys/dev/isa/fd.c
947
if (fd->sc_bp != NULL)
sys/dev/isa/fd.c
957
fdretry(struct fd_softc *fd)
sys/dev/isa/fd.c
959
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
sys/dev/isa/fd.c
960
struct buf *bp = fd->sc_bp;
sys/dev/isa/fd.c
962
if (fd->sc_opts & FDOPT_NORETRY)
sys/dev/isa/fd.c
983
fd->sc_skip / FD_BSIZE(fd), (struct disklabel *)NULL);
sys/dev/isa/fd.c
993
fdfinish(fd, bp);
sys/dev/isa/fdreg.h
65
#define FD_BSIZE(fd) (128 << fd->sc_type->secsize)
sys/dev/microcode/afb/build.c
34
int fd;
sys/dev/microcode/afb/build.c
37
fd = open(AFB_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/afb/build.c
38
if (fd == -1)
sys/dev/microcode/afb/build.c
41
len = write(fd, afb_fw, sizeof(afb_fw));
sys/dev/microcode/afb/build.c
47
close(fd);
sys/dev/microcode/atmel/build.c
37
int fd;
sys/dev/microcode/atmel/build.c
40
fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/atmel/build.c
41
if (fd == -1)
sys/dev/microcode/atmel/build.c
44
rlen = write(fd, buf, buflen);
sys/dev/microcode/atmel/build.c
49
close(fd);
sys/dev/microcode/bnx/build.c
124
int fd, i, total;
sys/dev/microcode/bnx/build.c
128
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/bnx/build.c
129
if (fd == -1)
sys/dev/microcode/bnx/build.c
132
rlen = write(fd, header, hlen);
sys/dev/microcode/bnx/build.c
143
rlen = write(fd, chunks[i].start, *chunks[i].len);
sys/dev/microcode/bnx/build.c
159
close(fd);
sys/dev/microcode/cirruslogic/build.c
31
int fd;
sys/dev/microcode/cirruslogic/build.c
34
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/cirruslogic/build.c
35
if (fd == -1)
sys/dev/microcode/cirruslogic/build.c
38
rlen = write(fd, &BA1Struct, sizeof BA1Struct);
sys/dev/microcode/cirruslogic/build.c
43
close(fd);
sys/dev/microcode/fxp/build.c
44
int fd, i;
sys/dev/microcode/fxp/build.c
49
fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/fxp/build.c
50
if (fd == -1)
sys/dev/microcode/fxp/build.c
54
rlen = write(fd, &dword, sizeof(dword));
sys/dev/microcode/fxp/build.c
60
close(fd);
sys/dev/microcode/kue/build.c
34
int len, fd;
sys/dev/microcode/kue/build.c
59
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/kue/build.c
60
if (fd == -1)
sys/dev/microcode/kue/build.c
63
rlen = write(fd, kf, len);
sys/dev/microcode/kue/build.c
69
close(fd);
sys/dev/microcode/neomagic/build.c
35
int fd;
sys/dev/microcode/neomagic/build.c
37
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/neomagic/build.c
38
if (fd == -1)
sys/dev/microcode/neomagic/build.c
46
rlen = write(fd, &nf, sizeof nf);
sys/dev/microcode/neomagic/build.c
52
close(fd);
sys/dev/microcode/ral/build.c
33
int fd;
sys/dev/microcode/ral/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/ral/build.c
38
if (fd == -1)
sys/dev/microcode/ral/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/ral/build.c
47
close(fd);
sys/dev/microcode/rsu/build.c
33
int fd;
sys/dev/microcode/rsu/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/rsu/build.c
38
if (fd == -1)
sys/dev/microcode/rsu/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/rsu/build.c
47
close(fd);
sys/dev/microcode/rtwn/build.c
33
int fd;
sys/dev/microcode/rtwn/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/rtwn/build.c
38
if (fd == -1)
sys/dev/microcode/rtwn/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/rtwn/build.c
47
close(fd);
sys/dev/microcode/rum/build.c
33
int fd;
sys/dev/microcode/rum/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/rum/build.c
38
if (fd == -1)
sys/dev/microcode/rum/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/rum/build.c
47
close(fd);
sys/dev/microcode/tht/build.c
34
int fd;
sys/dev/microcode/tht/build.c
37
fd = open(THT_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/tht/build.c
38
if (fd == -1)
sys/dev/microcode/tht/build.c
44
len = write(fd, tht_fw, sizeof(tht_fw));
sys/dev/microcode/tht/build.c
50
close(fd);
sys/dev/microcode/tigon/build.c
44
int len, fd, i, cnt;
sys/dev/microcode/tigon/build.c
89
fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/tigon/build.c
90
if (fd == -1)
sys/dev/microcode/tigon/build.c
93
rlen = write(fd, tf, len);
sys/dev/microcode/tigon/build.c
99
close(fd);
sys/dev/microcode/tusb3410/build.c
32
int fd;
sys/dev/microcode/tusb3410/build.c
35
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/tusb3410/build.c
36
if (fd == -1)
sys/dev/microcode/tusb3410/build.c
39
rlen = write(fd, uticom_fw_3410, sizeof uticom_fw_3410);
sys/dev/microcode/typhoon/build.c
28
fullwrite(int fd, const void *buf, size_t nbytes)
sys/dev/microcode/typhoon/build.c
32
r = write(fd, buf, nbytes);
sys/dev/microcode/typhoon/build.c
42
int fd;
sys/dev/microcode/typhoon/build.c
46
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/typhoon/build.c
47
if (fd == -1)
sys/dev/microcode/typhoon/build.c
50
rlen = write(fd, tc990image, sizeof tc990image);
sys/dev/microcode/typhoon/build.c
55
close(fd);
sys/dev/microcode/urtwn/build.c
33
int fd;
sys/dev/microcode/urtwn/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/urtwn/build.c
38
if (fd == -1)
sys/dev/microcode/urtwn/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/urtwn/build.c
47
close(fd);
sys/dev/microcode/yds/build.c
43
int len, fd;
sys/dev/microcode/yds/build.c
75
fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
sys/dev/microcode/yds/build.c
76
if (fd == -1)
sys/dev/microcode/yds/build.c
79
rlen = write(fd, yf, len);
sys/dev/microcode/yds/build.c
85
close(fd);
sys/dev/microcode/zydas/build.c
33
int fd;
sys/dev/microcode/zydas/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/zydas/build.c
38
if (fd == -1)
sys/dev/microcode/zydas/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/zydas/build.c
47
close(fd);
sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h
332
int amdgpu_amdkfd_gpuvm_import_dmabuf_fd(struct amdgpu_device *adev, int fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
2423
int amdgpu_amdkfd_gpuvm_import_dmabuf_fd(struct amdgpu_device *adev, int fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
2432
ret = drm_gem_prime_fd_to_handle(&adev->ddev, adev->kfd.client.file, fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1574
int fd, r;
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1603
fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1604
if (fd < 0) {
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1606
return fd;
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1612
put_unused_fd(fd);
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1616
fd_install(fd, sync_file->file);
sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c
1617
info->out.handle = fd;
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
122
args->in.fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
127
args->in.fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
35
int fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
41
CLASS(fd, f)(fd);
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
66
int fd,
sys/dev/pci/drm/amd/amdgpu/amdgpu_sched.c
73
CLASS(fd, f)(fd);
sys/dev/pci/drm/amd/amdkfd/kfd_debug.c
772
int kfd_dbg_trap_enable(struct kfd_process *target, uint32_t fd,
sys/dev/pci/drm/amd/amdkfd/kfd_debug.c
796
f = fget(fd);
sys/dev/pci/drm/amd/amdkfd/kfd_debug.c
798
pr_err("Failed to get file for (%i)\n", fd);
sys/dev/pci/drm/amd/amdkfd/kfd_debug.h
47
int kfd_dbg_trap_enable(struct kfd_process *target, uint32_t fd,
sys/dev/pci/drm/amd/amdkfd/kfd_smi_events.c
368
int kfd_smi_event_open(struct kfd_node *dev, uint32_t *fd)
sys/dev/pci/drm/amd/amdkfd/kfd_smi_events.c
408
*fd = ret;
sys/dev/pci/drm/amd/amdkfd/kfd_smi_events.h
29
int kfd_smi_event_open(struct kfd_node *dev, uint32_t *fd);
sys/dev/pci/drm/drm_atomic_uapi.c
1178
int fd;
sys/dev/pci/drm/drm_atomic_uapi.c
1184
fence_state->fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_atomic_uapi.c
1185
if (fence_state->fd < 0)
sys/dev/pci/drm/drm_atomic_uapi.c
1186
return fence_state->fd;
sys/dev/pci/drm/drm_atomic_uapi.c
1188
if (put_user(fence_state->fd, fence_state->out_fence_ptr))
sys/dev/pci/drm/drm_atomic_uapi.c
1355
fd_install(fence_state[i].fd,
sys/dev/pci/drm/drm_atomic_uapi.c
1381
if (fence_state[i].fd >= 0)
sys/dev/pci/drm/drm_atomic_uapi.c
1382
put_unused_fd(fence_state[i].fd);
sys/dev/pci/drm/drm_linux.c
2713
dma_buf_get(int fd)
sys/dev/pci/drm/drm_linux.c
2719
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/dev/pci/drm/drm_linux.c
2745
int fd, cloexec, error;
sys/dev/pci/drm/drm_linux.c
2751
if ((error = fdalloc(p, 0, &fd)) != 0) {
sys/dev/pci/drm/drm_linux.c
2760
fdinsert(fdp, fd, cloexec, fp);
sys/dev/pci/drm/drm_linux.c
2763
return fd;
sys/dev/pci/drm/drm_linux.c
3280
fd_install(int fd, struct file *fp)
sys/dev/pci/drm/drm_linux.c
3287
fdinsert(fdp, fd, UF_EXCLOSE, fp);
sys/dev/pci/drm/drm_linux.c
3302
int error, fd;
sys/dev/pci/drm/drm_linux.c
3308
if ((error = fdalloc(p, 0, &fd)) != 0) {
sys/dev/pci/drm/drm_linux.c
3318
return fd;
sys/dev/pci/drm/drm_linux.c
3322
put_unused_fd(int fd)
sys/dev/pci/drm/drm_linux.c
3327
fdremove(fdp, fd);
sys/dev/pci/drm/drm_linux.c
3332
sync_file_get_fence(int fd)
sys/dev/pci/drm/drm_linux.c
3340
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/dev/pci/drm/drm_prime.c
369
return dev->driver->prime_fd_to_handle(dev, file_priv, args->fd,
sys/dev/pci/drm/drm_prime.c
373
return drm_gem_prime_fd_to_handle(dev, file_priv, args->fd, &args->handle);
sys/dev/pci/drm/drm_prime.c
519
int fd = get_unused_fd_flags(flags);
sys/dev/pci/drm/drm_prime.c
521
if (fd < 0)
sys/dev/pci/drm/drm_prime.c
522
return fd;
sys/dev/pci/drm/drm_prime.c
526
put_unused_fd(fd);
sys/dev/pci/drm/drm_prime.c
530
fd_install(fd, dmabuf->file);
sys/dev/pci/drm/drm_prime.c
531
*prime_fd = fd;
sys/dev/pci/drm/drm_prime.c
548
&args->fd);
sys/dev/pci/drm/drm_prime.c
551
args->flags, &args->fd);
sys/dev/pci/drm/drm_syncobj.c
1577
ev_fd_ctx = eventfd_ctx_fdget(args->fd);
sys/dev/pci/drm/drm_syncobj.c
693
int fd;
sys/dev/pci/drm/drm_syncobj.c
695
fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_syncobj.c
696
if (fd < 0)
sys/dev/pci/drm/drm_syncobj.c
697
return fd;
sys/dev/pci/drm/drm_syncobj.c
703
put_unused_fd(fd);
sys/dev/pci/drm/drm_syncobj.c
708
fd_install(fd, file);
sys/dev/pci/drm/drm_syncobj.c
710
*p_fd = fd;
sys/dev/pci/drm/drm_syncobj.c
731
int fd, u32 *handle)
sys/dev/pci/drm/drm_syncobj.c
737
CLASS(fd, f)(fd);
sys/dev/pci/drm/drm_syncobj.c
767
int fd, int handle, u64 point)
sys/dev/pci/drm/drm_syncobj.c
769
struct dma_fence *fence = sync_file_get_fence(fd);
sys/dev/pci/drm/drm_syncobj.c
803
int fd = get_unused_fd_flags(O_CLOEXEC);
sys/dev/pci/drm/drm_syncobj.c
805
if (fd < 0)
sys/dev/pci/drm/drm_syncobj.c
806
return fd;
sys/dev/pci/drm/drm_syncobj.c
821
fd_install(fd, sync_file->file);
sys/dev/pci/drm/drm_syncobj.c
823
*p_fd = fd;
sys/dev/pci/drm/drm_syncobj.c
826
put_unused_fd(fd);
sys/dev/pci/drm/drm_syncobj.c
923
point, &args->fd);
sys/dev/pci/drm/drm_syncobj.c
929
&args->fd);
sys/dev/pci/drm/drm_syncobj.c
955
args->fd,
sys/dev/pci/drm/drm_syncobj.c
962
return drm_syncobj_fd_to_handle(file_private, args->fd,
sys/dev/pci/drm/i915/gvt/kvmgt.c
1088
int fd = *(int *)data;
sys/dev/pci/drm/i915/gvt/kvmgt.c
1090
trigger = eventfd_ctx_fdget(fd);
sys/dev/pci/drm/include/uapi/drm/amdgpu_drm.h
615
__u32 fd;
sys/dev/pci/drm/include/uapi/drm/drm.h
1023
__s32 fd;
sys/dev/pci/drm/include/uapi/drm/drm.h
927
__s32 fd;
sys/dev/pci/drm/include/uapi/drm/drm.h
949
__s32 fd;
sys/dev/pci/drm/include/uapi/drm/drm_mode.h
1272
__u32 fd;
sys/dev/usb/ugen.c
1131
struct usb_full_desc *fd = (struct usb_full_desc *)addr;
sys/dev/usb/ugen.c
1134
cdesc = usbd_get_cdesc(sc->sc_udev, fd->ufd_config_index,
sys/dev/usb/ugen.c
1139
if (len > fd->ufd_size)
sys/dev/usb/ugen.c
1140
len = fd->ufd_size;
sys/dev/usb/ugen.c
1141
iov.iov_base = (caddr_t)fd->ufd_data;
sys/dev/usb/uvideo.c
1398
struct usb_video_frame_desc *fd =
sys/dev/usb/uvideo.c
1412
sc->sc_fmtgrp[fmtidx].frame[frame_num] = fd;
sys/dev/usb/uvideo.c
1415
sc->sc_fmtgrp[fmtidx].format_dfidx == fd->bFrameIndex)
sys/dev/usb/uvideo.c
1416
sc->sc_fmtgrp[fmtidx].frame_cur = fd;
sys/dev/usb/uvideo.c
1427
fbuf_size = UGETW(fd->u.uc.wWidth) * UGETW(fd->u.uc.wHeight) *
sys/dev/usb/uvideo.c
1431
fbuf_size, UGETW(fd->u.uc.wWidth), UGETW(fd->u.uc.wHeight),
sys/dev/usb/uvideo.c
1434
fbuf_size = UGETDW(fd->u.uc.dwMaxVideoFrameBufferSize);
sys/dev/usb/uvideo.c
1456
struct usb_video_frame_desc *fd =
sys/dev/usb/uvideo.c
1471
sc->sc_fmtgrp[fmtidx].frame[frame_num] = fd;
sys/dev/usb/uvideo.c
1474
sc->sc_fmtgrp[fmtidx].format_dfidx == fd->bFrameIndex)
sys/dev/usb/uvideo.c
1475
sc->sc_fmtgrp[fmtidx].frame_cur = fd;
sys/dev/usb/uvideo.c
1483
frame_ival = UGETDW(fd->u.h264.dwDefaultFrameInterval);
sys/dev/usb/uvideo.c
1485
p = (uint8_t *)desc + UVIDEO_FRAME_MIN_LEN(fd);
sys/dev/usb/uvideo.c
1486
length = fd->bLength - UVIDEO_FRAME_MIN_LEN(fd);
sys/dev/usb/uvideo.c
1488
nivals = UVIDEO_FRAME_NUM_INTERVALS(fd);
sys/dev/usb/uvideo.c
1502
fbuf_size = UGETDW(UVIDEO_FRAME_FIELD(fd, dwMaxBitRate)) * frame_ival;
sys/kern/kern_descrip.c
1192
int fd;
sys/kern/kern_descrip.c
1196
for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
sys/kern/kern_descrip.c
1197
fp = fdp->fd_ofiles[fd];
sys/kern/kern_descrip.c
1199
fdp->fd_ofiles[fd] = NULL;
sys/kern/kern_descrip.c
1200
knote_fdclose(p, fd);
sys/kern/kern_descrip.c
130
find_last_set(struct filedesc *fd, int last)
sys/kern/kern_descrip.c
1302
syscallarg(int) fd;
sys/kern/kern_descrip.c
1305
int fd = SCARG(uap, fd);
sys/kern/kern_descrip.c
1313
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/kern/kern_descrip.c
133
u_int *bitmap = fd->fd_lomap;
sys/kern/kern_descrip.c
1439
int fd;
sys/kern/kern_descrip.c
1442
for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
sys/kern/kern_descrip.c
1443
fdp->fd_ofileflags[fd] &= ~(UF_PLEDGED | UF_FORKCLOSE);
sys/kern/kern_descrip.c
1444
if (fdp->fd_ofileflags[fd] & UF_EXCLOSE) {
sys/kern/kern_descrip.c
1446
(void) fdrelease(p, fd);
sys/kern/kern_descrip.c
146
while (i > 0 && !fd_inuse(fd, i))
sys/kern/kern_descrip.c
1460
startfd = SCARG(uap, fd);
sys/kern/kern_descrip.c
152
fd_inuse(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
154
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
156
if (fdp->fd_lomap[off] & (1U << (fd & NDENTRYMASK)))
sys/kern/kern_descrip.c
163
fd_used(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
165
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
167
fdp->fd_lomap[off] |= 1U << (fd & NDENTRYMASK);
sys/kern/kern_descrip.c
171
if (fd > fdp->fd_lastfile)
sys/kern/kern_descrip.c
172
fdp->fd_lastfile = fd;
sys/kern/kern_descrip.c
177
fd_unused(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
179
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
181
if (fd < fdp->fd_freefile)
sys/kern/kern_descrip.c
182
fdp->fd_freefile = fd;
sys/kern/kern_descrip.c
186
fdp->fd_lomap[off] &= ~(1U << (fd & NDENTRYMASK));
sys/kern/kern_descrip.c
189
if (fd > fdp->fd_lastfile)
sys/kern/kern_descrip.c
192
if (fd == fdp->fd_lastfile)
sys/kern/kern_descrip.c
193
fdp->fd_lastfile = find_last_set(fdp, fd);
sys/kern/kern_descrip.c
228
fd_getfile(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
234
if ((u_int)fd >= fdp->fd_nfiles)
sys/kern/kern_descrip.c
238
fp = fdp->fd_ofiles[fd];
sys/kern/kern_descrip.c
247
fd_getfile_mode(struct filedesc *fdp, int fd, int mode)
sys/kern/kern_descrip.c
253
fp = fd_getfile(fdp, fd);
sys/kern/kern_descrip.c
266
fd_checkclosed(struct filedesc *fdp, int fd, struct file *fp)
sys/kern/kern_descrip.c
271
KASSERT(fd < fdp->fd_nfiles);
sys/kern/kern_descrip.c
272
closed = (fdp->fd_ofiles[fd] != fp);
sys/kern/kern_descrip.c
288
syscallarg(int) fd;
sys/kern/kern_descrip.c
291
int old = SCARG(uap, fd);
sys/kern/kern_descrip.c
406
syscallarg(int) fd;
sys/kern/kern_descrip.c
410
int fd = SCARG(uap, fd);
sys/kern/kern_descrip.c
423
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/kern/kern_descrip.c
455
error = finishdup(p, fp, fd, i, retval, dupflags);
sys/kern/kern_descrip.c
461
*retval = (fdp->fd_ofileflags[fd] & UF_EXCLOSE ? FD_CLOEXEC : 0)
sys/kern/kern_descrip.c
462
| (fdp->fd_ofileflags[fd] & UF_FORKCLOSE ? FD_CLOFORK : 0);
sys/kern/kern_descrip.c
470
fdp->fd_ofileflags[fd] = (fdp->fd_ofileflags[fd] &
sys/kern/kern_descrip.c
574
if (fd_checkclosed(fdp, fd, fp)) {
sys/kern/kern_descrip.c
702
fdinsert(struct filedesc *fdp, int fd, int flags, struct file *fp)
sys/kern/kern_descrip.c
720
KASSERT(fdp->fd_ofiles[fd] == NULL);
sys/kern/kern_descrip.c
721
fdp->fd_ofiles[fd] = fp;
sys/kern/kern_descrip.c
724
fdp->fd_ofileflags[fd] |= (flags & (UF_EXCLOSE | UF_FORKCLOSE |
sys/kern/kern_descrip.c
729
fdremove(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
738
fdp->fd_ofiles[fd] = NULL;
sys/kern/kern_descrip.c
741
fdp->fd_ofileflags[fd] = 0;
sys/kern/kern_descrip.c
743
fd_unused(fdp, fd);
sys/kern/kern_descrip.c
747
fdrelease(struct proc *p, int fd)
sys/kern/kern_descrip.c
754
fp = fd_getfile(fdp, fd);
sys/kern/kern_descrip.c
759
fdremove(fdp, fd);
sys/kern/kern_descrip.c
760
knote_fdclose(p, fd);
sys/kern/kern_descrip.c
772
syscallarg(int) fd;
sys/kern/kern_descrip.c
774
int fd = SCARG(uap, fd), error;
sys/kern/kern_descrip.c
779
error = fdrelease(p, fd);
sys/kern/kern_descrip.c
791
syscallarg(int) fd;
sys/kern/kern_descrip.c
794
int fd = SCARG(uap, fd);
sys/kern/kern_descrip.c
800
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/kern/kern_descrip.c
828
syscallarg(int) fd;
sys/kern/kern_descrip.c
831
int fd = SCARG(uap, fd);
sys/kern/kern_descrip.c
837
if ((fp = fd_getfile(fdp, fd)) == NULL)
sys/kern/kern_event.c
1197
int cloexec, error, fd;
sys/kern/kern_event.c
1204
error = falloc(p, &fp, &fd);
sys/kern/kern_event.c
1211
*retval = fd;
sys/kern/kern_event.c
1214
fdinsert(fdp, fd, cloexec, fp);
sys/kern/kern_event.c
1247
syscallarg(int) fd;
sys/kern/kern_event.c
1263
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
sys/kern/kern_event.c
2008
kqueue_expand_list(struct kqueue *kq, int fd)
sys/kern/kern_event.c
2015
if (kq->kq_knlistsize <= fd) {
sys/kern/kern_event.c
2018
while (size <= fd)
sys/kern/kern_event.c
2022
if (kq->kq_knlistsize <= fd) {
sys/kern/kern_event.c
2206
knote_fdclose(struct proc *p, int fd)
sys/kern/kern_event.c
2220
if (fd < kq->kq_knlistsize)
sys/kern/kern_event.c
2221
knote_remove(p, kq, &kq->kq_knlist, fd, 0);
sys/kern/kern_event.c
95
static void kqueue_expand_list(struct kqueue *kq, int fd);
sys/kern/kern_ktrace.c
228
ktrgenio(struct proc *p, int fd, enum uio_rw rw, struct iovec *iov,
sys/kern/kern_ktrace.c
246
ktp.ktr_fd = fd;
sys/kern/kern_sysctl.c
1451
int fd, struct vnode *vp, struct process *pr, struct proc *p,
sys/kern/kern_sysctl.c
1458
kf->fd_fd = fd; /* might not really be an fd */
sys/kern/kern_sysctl.c
1492
if (fd == KERN_FILE_TRACE)
sys/kern/kern_sysctl.c
1670
kf->fd_ofileflags = fdp->fd_ofileflags[fd];
sys/kern/sys_generic.c
1074
pl->fd, pl->revents, p->p_kq_serial, kevp->filter,
sys/kern/sys_generic.c
1103
if (pl[i].fd < 0)
sys/kern/sys_generic.c
1114
i+1, nfds, pl[i].fd, pl[i].events, p->p_kq_serial);
sys/kern/sys_generic.c
1120
EV_SET(kevp, pl[i].fd, EVFILT_READ,
sys/kern/sys_generic.c
1127
EV_SET(kevp, pl[i].fd, EVFILT_WRITE,
sys/kern/sys_generic.c
1136
EV_SET(kevp, pl[i].fd, EVFILT_EXCEPT,
sys/kern/sys_generic.c
1175
if ((int)kevp->ident != pl[i].fd) {
sys/kern/sys_generic.c
1177
__func__, kevp, i + 1, nfds, (int)kevp->ident, pl[i].fd,
sys/kern/sys_generic.c
1229
i+1, nfds, pl[i].fd, pl[i].revents, (unsigned long)kevp->udata,
sys/kern/sys_generic.c
1243
p->p_p->ps_comm, p->p_tid, i, pl[i].fd,
sys/kern/sys_generic.c
156
syscallarg(int) fd;
sys/kern/sys_generic.c
172
return (dofilereadv(p, SCARG(uap, fd), &auio, 0, retval));
sys/kern/sys_generic.c
182
syscallarg(int) fd;
sys/kern/sys_generic.c
199
error = dofilereadv(p, SCARG(uap, fd), &auio, 0, retval);
sys/kern/sys_generic.c
206
dofilereadv(struct proc *p, int fd, struct uio *uio, int flags,
sys/kern/sys_generic.c
220
if ((fp = fd_getfile_mode(fdp, fd, FREAD)) == NULL)
sys/kern/sys_generic.c
267
ktrgenio(p, fd, UIO_READ, ktriov, cnt);
sys/kern/sys_generic.c
284
syscallarg(int) fd;
sys/kern/sys_generic.c
300
return (dofilewritev(p, SCARG(uap, fd), &auio, 0, retval));
sys/kern/sys_generic.c
310
syscallarg(int) fd;
sys/kern/sys_generic.c
327
error = dofilewritev(p, SCARG(uap, fd), &auio, 0, retval);
sys/kern/sys_generic.c
334
dofilewritev(struct proc *p, int fd, struct uio *uio, int flags,
sys/kern/sys_generic.c
348
if ((fp = fd_getfile_mode(fdp, fd, FWRITE)) == NULL)
sys/kern/sys_generic.c
350
else if (p->p_fd->fd_ofileflags[fd] & UF_PLEDGEOPEN) {
sys/kern/sys_generic.c
401
ktrgenio(p, fd, UIO_WRITE, ktriov, cnt);
sys/kern/sys_generic.c
418
syscallarg(int) fd;
sys/kern/sys_generic.c
432
if ((fp = fd_getfile_mode(fdp, SCARG(uap, fd), FREAD|FWRITE)) == NULL)
sys/kern/sys_generic.c
453
fdp->fd_ofileflags[SCARG(uap, fd)] &= ~UF_EXCLOSE;
sys/kern/sys_generic.c
455
fdp->fd_ofileflags[SCARG(uap, fd)] |= UF_EXCLOSE;
sys/kern/sys_generic.c
749
int msk, i, j, fd, nevents = 0, error = 0;
sys/kern/sys_generic.c
756
while ((j = ffs(bits)) && (fd = i + --j) < nfd) {
sys/kern/sys_generic.c
760
fd, msk, p->p_kq_serial);
sys/kern/sys_generic.c
761
EV_SET(&kev, fd, evf[msk],
sys/kern/uipc_socket.c
1309
sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
sys/kern/uipc_socket.c
1323
if (fd < 0) {
sys/kern/uipc_socket.c
1340
if ((error = getsock(curproc, fd, &fp)) != 0)
sys/kern/uipc_syscalls.c
107
error = falloc(p, &fp, &fd);
sys/kern/uipc_syscalls.c
117
fdinsert(fdp, fd, fdflags, fp);
sys/kern/uipc_syscalls.c
120
*retval = fd;
sys/kern/uipc_syscalls.c
1524
int error, fd = -1;
sys/kern/uipc_syscalls.c
1652
error = falloc(p, &fp, &fd);
sys/kern/uipc_syscalls.c
1663
fdinsert(fdp, fd, UF_EXCLOSE, fp);
sys/kern/uipc_syscalls.c
1666
*retval = fd;
sys/kern/uipc_syscalls.c
84
int fd, fdflags, nonblock, fflag, error;
sys/kern/uipc_usrreq.c
1218
int nfds, *ip, fd, neededspace;
sys/kern/uipc_usrreq.c
1279
memcpy(&fd, ip, sizeof fd);
sys/kern/uipc_usrreq.c
1281
if ((fp = fd_getfile(fdp, fd)) == NULL) {
sys/kern/uipc_usrreq.c
1288
} else if (p->p_fd->fd_ofileflags[fd] & UF_PLEDGEOPEN) {
sys/kern/uipc_usrreq.c
1309
rp->flags = fdp->fd_ofileflags[fd] & UF_PLEDGED;
sys/kern/vfs_syscalls.c
1096
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1102
return (doopenat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1107
doopenat(struct proc *p, int fd, const char *path, int oflags, mode_t mode,
sys/kern/vfs_syscalls.c
1154
NDINITAT(&nd, 0, 0, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
1508
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1514
return (domknodat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1519
domknodat(struct proc *p, int fd, const char *path, mode_t mode, dev_t dev)
sys/kern/vfs_syscalls.c
1528
NDINITAT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
1612
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1617
return (domknodat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1724
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1728
return (dosymlinkat(p, SCARG(uap, path), SCARG(uap, fd),
sys/kern/vfs_syscalls.c
1733
dosymlinkat(struct proc *p, const char *upath, int fd, const char *link)
sys/kern/vfs_syscalls.c
1744
NDINITAT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, fd, link, p);
sys/kern/vfs_syscalls.c
1784
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1789
return (dounlinkat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1794
dounlinkat(struct proc *p, int fd, const char *path, int flag)
sys/kern/vfs_syscalls.c
1804
fd, path, p);
sys/kern/vfs_syscalls.c
1863
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1872
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
sys/kern/vfs_syscalls.c
1913
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
1919
return (dofaccessat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1924
dofaccessat(struct proc *p, int fd, const char *path, int amode, int flag)
sys/kern/vfs_syscalls.c
1951
NDINITAT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
1999
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2005
return (dofstatat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2010
dofstatat(struct proc *p, int fd, const char *path, struct stat *buf, int flag)
sys/kern/vfs_syscalls.c
2021
NDINITAT(&nd, LOOKUP, follow | LOCKLEAF, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2079
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2085
return dopathconfat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2090
dopathconfat(struct proc *p, int fd, const char *path, int name, int flag,
sys/kern/vfs_syscalls.c
2100
NDINITAT(&nd, LOOKUP, follow | LOCKLEAF, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2130
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2136
return (doreadlinkat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2141
doreadlinkat(struct proc *p, int fd, const char *path, char *buf,
sys/kern/vfs_syscalls.c
2150
NDINITAT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2194
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2200
return (dochflagsat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2205
dochflagsat(struct proc *p, int fd, const char *path, u_int flags, int atflags)
sys/kern/vfs_syscalls.c
2214
NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2229
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2236
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
2238
if (p->p_fd->fd_ofileflags[SCARG(uap, fd)] & UF_PLEDGEOPEN) {
sys/kern/vfs_syscalls.c
2296
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2302
return (dofchmodat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2307
dofchmodat(struct proc *p, int fd, const char *path, mode_t mode, int flag)
sys/kern/vfs_syscalls.c
2322
NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2347
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2361
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
2367
else if (p->p_fd->fd_ofileflags[SCARG(uap, fd)] & UF_PLEDGEOPEN)
sys/kern/vfs_syscalls.c
2399
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2406
return (dofchownat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2411
dofchownat(struct proc *p, int fd, const char *path, uid_t uid, gid_t gid,
sys/kern/vfs_syscalls.c
2424
NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2514
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2526
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
2532
else if (p->p_fd->fd_ofileflags[SCARG(uap, fd)] & UF_PLEDGEOPEN)
sys/kern/vfs_syscalls.c
2597
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2627
return (doutimensat(p, SCARG(uap, fd), SCARG(uap, path), ts,
sys/kern/vfs_syscalls.c
2632
doutimensat(struct proc *p, int fd, const char *path,
sys/kern/vfs_syscalls.c
2643
NDINITAT(&nd, LOOKUP, follow, UIO_USERSPACE, fd, path, p);
sys/kern/vfs_syscalls.c
2706
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2732
return (dofutimens(p, SCARG(uap, fd), ts));
sys/kern/vfs_syscalls.c
2739
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2766
return (dofutimens(p, SCARG(uap, fd), ts));
sys/kern/vfs_syscalls.c
2770
dofutimens(struct proc *p, int fd, struct timespec ts[2])
sys/kern/vfs_syscalls.c
2776
if ((error = getvnode(p, fd, &fp)) != 0)
sys/kern/vfs_syscalls.c
2848
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2855
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
2860
} else if (p->p_fd->fd_ofileflags[SCARG(uap, fd)] & UF_PLEDGEOPEN) {
sys/kern/vfs_syscalls.c
2880
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
2886
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3027
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3032
return (domkdirat(p, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
3037
domkdirat(struct proc *p, int fd, const char *path, mode_t mode)
sys/kern/vfs_syscalls.c
3045
fd, path, p);
sys/kern/vfs_syscalls.c
3089
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3104
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3208
getvnode(struct proc *p, int fd, struct file **fpp)
sys/kern/vfs_syscalls.c
3213
if ((fp = fd_getfile(p->p_fd, fd)) == NULL)
sys/kern/vfs_syscalls.c
3239
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3257
return (dofilereadv(p, SCARG(uap, fd), &auio, FO_POSITION, retval));
sys/kern/vfs_syscalls.c
3267
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3286
error = dofilereadv(p, SCARG(uap, fd), &auio, FO_POSITION, retval);
sys/kern/vfs_syscalls.c
3299
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3317
return (dofilewritev(p, SCARG(uap, fd), &auio, FO_POSITION, retval));
sys/kern/vfs_syscalls.c
3327
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
3346
error = dofilewritev(p, SCARG(uap, fd), &auio, FO_POSITION, retval);
sys/kern/vfs_syscalls.c
637
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
645
if ((error = getvnode(p, SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
726
syscallarg(int) fd;
sys/kern/vfs_syscalls.c
734
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
sys/lib/libsa/close.c
69
close(int fd)
sys/lib/libsa/close.c
71
oclose(int fd)
sys/lib/libsa/close.c
74
struct open_file *f = &files[fd];
sys/lib/libsa/close.c
77
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/cread.c
102
s->stream.avail_in = oread(s->fd, s->inbuf, Z_BUFSIZE);
sys/lib/libsa/cread.c
197
int fd;
sys/lib/libsa/cread.c
200
if (((fd = oopen(fname, mode)) == -1) ||
sys/lib/libsa/cread.c
202
return(fd);
sys/lib/libsa/cread.c
204
ss[fd] = s = alloc(sizeof(struct sd));
sys/lib/libsa/cread.c
218
s->fd = fd;
sys/lib/libsa/cread.c
220
return(fd);
sys/lib/libsa/cread.c
225
oclose(fd);
sys/lib/libsa/cread.c
230
close(int fd)
sys/lib/libsa/cread.c
235
if ((unsigned)fd >= SOPEN_MAX) {
sys/lib/libsa/cread.c
239
f = &files[fd];
sys/lib/libsa/cread.c
242
return(oclose(fd));
sys/lib/libsa/cread.c
244
s = ss[fd];
sys/lib/libsa/cread.c
252
return(oclose(fd));
sys/lib/libsa/cread.c
256
read(int fd, void *buf, size_t len)
sys/lib/libsa/cread.c
261
s = ss[fd];
sys/lib/libsa/cread.c
289
n = oread(fd, s->stream.next_out,
sys/lib/libsa/cread.c
310
s->stream.avail_in = oread(fd, s->inbuf, Z_BUFSIZE);
sys/lib/libsa/cread.c
359
lseek(int fd, off_t offset, int where)
sys/lib/libsa/cread.c
364
if ((unsigned)fd >= SOPEN_MAX) {
sys/lib/libsa/cread.c
368
f = &files[fd];
sys/lib/libsa/cread.c
371
return(olseek(fd, offset, where));
sys/lib/libsa/cread.c
373
s = ss[fd];
sys/lib/libsa/cread.c
376
off_t res = olseek(fd, offset, where);
sys/lib/libsa/cread.c
395
res = olseek(fd, 0, SEEK_SET);
sys/lib/libsa/cread.c
408
s->fd = fd;
sys/lib/libsa/cread.c
424
n = read(fd, dummybuf, len);
sys/lib/libsa/cread.c
66
int fd;
sys/lib/libsa/fchmod.c
38
fchmod(int fd, mode_t m)
sys/lib/libsa/fchmod.c
40
struct open_file *f = &files[fd];
sys/lib/libsa/fchmod.c
46
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/fstat.c
38
fstat(int fd, struct stat *sb)
sys/lib/libsa/fstat.c
40
struct open_file *f = &files[fd];
sys/lib/libsa/fstat.c
42
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/getfile.c
43
int fd;
sys/lib/libsa/getfile.c
51
} while ((fd = open(buf, mode)) < 0);
sys/lib/libsa/getfile.c
53
return (fd);
sys/lib/libsa/ioctl.c
67
ioctl(int fd, u_long cmd, char *arg)
sys/lib/libsa/ioctl.c
69
struct open_file *f = &files[fd];
sys/lib/libsa/ioctl.c
71
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/loadfile.c
118
int fd, rval;
sys/lib/libsa/loadfile.c
121
if ((fd = open(fname, O_RDONLY)) < 0) {
sys/lib/libsa/loadfile.c
127
if ((nr = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) {
sys/lib/libsa/loadfile.c
135
rval = elf32_exec(fd, &hdr.elf32, marks, flags);
sys/lib/libsa/loadfile.c
141
rval = elf64_exec(fd, &hdr.elf64, marks, flags);
sys/lib/libsa/loadfile.c
152
return fd;
sys/lib/libsa/loadfile.c
155
(void)close(fd);
sys/lib/libsa/loadfile_elf.c
142
if (lseek(fd, (off_t)phdr[i].p_offset, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf.c
147
if (READ(fd, phdr[i].p_paddr, phdr[i].p_filesz) !=
sys/lib/libsa/loadfile_elf.c
190
if (lseek(fd, (off_t)elf->e_shoff, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf.c
197
if (read(fd, shp, sz) != sz) {
sys/lib/libsa/loadfile_elf.c
208
if (lseek(fd, (off_t)shp[elf->e_shstrndx].sh_offset, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf.c
214
if (read(fd, shstr, shstrsz) != shstrsz) {
sys/lib/libsa/loadfile_elf.c
240
if (lseek(fd, (off_t)shp[i].sh_offset,
sys/lib/libsa/loadfile_elf.c
247
if (READ(fd, maxp, shp[i].sh_size) !=
sys/lib/libsa/loadfile_elf.c
73
ELFNAME(exec)(int fd, Elf_Ehdr *elf, uint64_t *marks, int flags)
sys/lib/libsa/loadfile_elf.c
88
if (lseek(fd, (off_t)elf->e_phoff, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf.c
93
if (read(fd, phdr, sz) != sz) {
sys/lib/libsa/lseek.c
68
lseek(int fd, off_t offset, int where)
sys/lib/libsa/lseek.c
70
olseek(int fd, off_t offset, int where)
sys/lib/libsa/lseek.c
73
struct open_file *f = &files[fd];
sys/lib/libsa/lseek.c
75
if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/netif.c
275
int fd;
sys/lib/libsa/netif.c
280
for (fd = 0, s = sockets; fd < SOPEN_MAX; fd++, s++)
sys/lib/libsa/netif.c
300
return(fd);
sys/lib/libsa/open.c
106
return (fd);
sys/lib/libsa/open.c
115
return (fd);
sys/lib/libsa/open.c
80
int fd, i, error;
sys/lib/libsa/open.c
84
for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++)
sys/lib/libsa/read.c
69
read(int fd, void *dest, size_t bcount)
sys/lib/libsa/read.c
71
oread(int fd, void *dest, size_t bcount)
sys/lib/libsa/read.c
74
struct open_file *f = &files[fd];
sys/lib/libsa/read.c
77
if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) {
sys/lib/libsa/readdir.c
43
int fd;
sys/lib/libsa/readdir.c
55
if ((fd = oopen(name, O_RDONLY)) >= 0)
sys/lib/libsa/readdir.c
56
olseek(fd, 0, 0);
sys/lib/libsa/readdir.c
58
if ((fd = open(name, O_RDONLY)) >= 0)
sys/lib/libsa/readdir.c
59
lseek(fd, 0, SEEK_SET);
sys/lib/libsa/readdir.c
62
return fd;
sys/lib/libsa/readdir.c
66
readdir(int fd, char *dest)
sys/lib/libsa/readdir.c
70
if (fd < 0 || fd >= SOPEN_MAX) {
sys/lib/libsa/readdir.c
74
f = &files[fd];
sys/lib/libsa/readdir.c
90
closedir(int fd)
sys/lib/libsa/readdir.c
93
oclose(fd);
sys/lib/libsa/readdir.c
95
close(fd);
sys/lib/libsa/stand.h
172
int fstat(int fd, struct stat *sb);
sys/lib/libsa/stat.c
40
int fd, rv;
sys/lib/libsa/stat.c
43
if ((fd = oopen(str, 0)) < 0)
sys/lib/libsa/stat.c
45
if ((fd = open(str, O_RDONLY)) < 0)
sys/lib/libsa/stat.c
48
rv = fstat(fd, sb);
sys/lib/libsa/stat.c
50
(void)oclose(fd);
sys/lib/libsa/stat.c
52
(void)close(fd);
sys/lib/libsa/write.c
68
write(int fd, void *dest, size_t bcount)
sys/lib/libsa/write.c
70
struct open_file *f = &files[fd];
sys/lib/libsa/write.c
73
if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_WRITE)) {
sys/lib/libz/zlib.h
1404
ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
sys/miscfs/fuse/fuse_device.c
102
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
105
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
106
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
111
rw_enter_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
112
SIMPLEQ_FOREACH_SAFE(f, &fd->fd_fbufs_in, fb_next, ftmp) {
sys/miscfs/fuse/fuse_device.c
115
SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_in, fb_next);
sys/miscfs/fuse/fuse_device.c
117
SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_in, lprev,
sys/miscfs/fuse/fuse_device.c
126
knote_locked(&fd->fd_rklist, 0);
sys/miscfs/fuse/fuse_device.c
127
rw_exit_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
131
SIMPLEQ_FOREACH_SAFE(f, &fd->fd_fbufs_wait, fb_next, ftmp) {
sys/miscfs/fuse/fuse_device.c
134
SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_wait, fb_next);
sys/miscfs/fuse/fuse_device.c
136
SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_wait, lprev,
sys/miscfs/fuse/fuse_device.c
146
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
152
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
154
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
155
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
158
rw_enter_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
159
SIMPLEQ_INSERT_TAIL(&fd->fd_fbufs_in, fbuf, fb_next);
sys/miscfs/fuse/fuse_device.c
160
knote_locked(&fd->fd_rklist, 0);
sys/miscfs/fuse/fuse_device.c
161
rw_exit_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
165
wakeup_one(&fd->fd_fbufs_in);
sys/miscfs/fuse/fuse_device.c
167
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
173
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
175
fd = fuse_lookup(minor(fmp->dev));
sys/miscfs/fuse/fuse_device.c
176
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
180
fd->fd_fmp = fmp;
sys/miscfs/fuse/fuse_device.c
182
fd->fd_fmp = NULL;
sys/miscfs/fuse/fuse_device.c
185
wakeup(&fd->fd_fbufs_in);
sys/miscfs/fuse/fuse_device.c
188
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
200
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
206
if ((fd = fuse_lookup(unit)) != NULL) {
sys/miscfs/fuse/fuse_device.c
207
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
211
fd = malloc(sizeof(*fd), M_DEVBUF, M_WAITOK | M_ZERO);
sys/miscfs/fuse/fuse_device.c
212
fd->fd_unit = unit;
sys/miscfs/fuse/fuse_device.c
213
SIMPLEQ_INIT(&fd->fd_fbufs_in);
sys/miscfs/fuse/fuse_device.c
214
SIMPLEQ_INIT(&fd->fd_fbufs_wait);
sys/miscfs/fuse/fuse_device.c
215
rw_init(&fd->fd_lock, "fusedlk");
sys/miscfs/fuse/fuse_device.c
216
klist_init_rwlock(&fd->fd_rklist, &fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
217
refcnt_init(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
219
LIST_INSERT_HEAD(&fuse_d_list, fd, fd_list);
sys/miscfs/fuse/fuse_device.c
228
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
230
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
231
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
240
if (fd->fd_fmp) {
sys/miscfs/fuse/fuse_device.c
241
fd->fd_fmp->sess_init = 0;
sys/miscfs/fuse/fuse_device.c
242
fuse_device_set_fmp(fd->fd_fmp, 0);
sys/miscfs/fuse/fuse_device.c
245
LIST_REMOVE(fd, fd_list);
sys/miscfs/fuse/fuse_device.c
247
refcnt_rele(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
248
refcnt_finalize(&fd->fd_refcnt, "fusedfd");
sys/miscfs/fuse/fuse_device.c
249
free(fd, M_DEVBUF, sizeof(*fd));
sys/miscfs/fuse/fuse_device.c
257
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
261
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
262
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
265
if (fd->fd_fmp == NULL) {
sys/miscfs/fuse/fuse_device.c
266
refcnt_rele(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
270
rw_enter_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
273
fbuf = SIMPLEQ_FIRST(&fd->fd_fbufs_in);
sys/miscfs/fuse/fuse_device.c
280
error = rwsleep_nsec(&fd->fd_fbufs_in, &fd->fd_lock,
sys/miscfs/fuse/fuse_device.c
284
if (fd->fd_fmp == NULL) {
sys/miscfs/fuse/fuse_device.c
293
fbuf = SIMPLEQ_FIRST(&fd->fd_fbufs_in);
sys/miscfs/fuse/fuse_device.c
319
SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_in, fb_next);
sys/miscfs/fuse/fuse_device.c
328
SIMPLEQ_INSERT_TAIL(&fd->fd_fbufs_wait, fbuf, fb_next);
sys/miscfs/fuse/fuse_device.c
332
rw_exit_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
333
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
341
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
346
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
347
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
370
SIMPLEQ_FOREACH(fbuf, &fd->fd_fbufs_wait, fb_next) {
sys/miscfs/fuse/fuse_device.c
404
if (fbuf->fb_len > fd->fd_fmp->max_read || fbuf->fb_len < 0) {
sys/miscfs/fuse/fuse_device.c
462
fd->fd_fmp->max_write = MIN(fbuf->op.out.init.max_write,
sys/miscfs/fuse/fuse_device.c
464
if (fd->fd_fmp->max_write == 0)
sys/miscfs/fuse/fuse_device.c
465
fd->fd_fmp->max_write = FUSEBUFMAXSIZE;
sys/miscfs/fuse/fuse_device.c
466
fd->fd_fmp->sess_init = 1;
sys/miscfs/fuse/fuse_device.c
471
if (fbuf == SIMPLEQ_FIRST(&fd->fd_fbufs_wait))
sys/miscfs/fuse/fuse_device.c
472
SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_wait, fb_next);
sys/miscfs/fuse/fuse_device.c
474
SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_wait, lastfbuf,
sys/miscfs/fuse/fuse_device.c
488
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
495
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
499
fd = fuse_lookup(minor(dev));
sys/miscfs/fuse/fuse_device.c
500
if (fd == NULL)
sys/miscfs/fuse/fuse_device.c
505
klist = &fd->fd_rklist;
sys/miscfs/fuse/fuse_device.c
516
kn->kn_hook = fd;
sys/miscfs/fuse/fuse_device.c
521
refcnt_rele_wake(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
529
struct fuse_d *fd = kn->kn_hook;
sys/miscfs/fuse/fuse_device.c
530
struct klist *klist = &fd->fd_rklist;
sys/miscfs/fuse/fuse_device.c
538
struct fuse_d *fd = kn->kn_hook;
sys/miscfs/fuse/fuse_device.c
541
rw_assert_wrlock(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
543
if (!SIMPLEQ_EMPTY(&fd->fd_fbufs_in))
sys/miscfs/fuse/fuse_device.c
552
struct fuse_d *fd = kn->kn_hook;
sys/miscfs/fuse/fuse_device.c
555
rw_enter_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
557
rw_exit_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
565
struct fuse_d *fd = kn->kn_hook;
sys/miscfs/fuse/fuse_device.c
568
rw_enter_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
570
rw_exit_write(&fd->fd_lock);
sys/miscfs/fuse/fuse_device.c
86
struct fuse_d *fd;
sys/miscfs/fuse/fuse_device.c
88
LIST_FOREACH(fd, &fuse_d_list, fd_list)
sys/miscfs/fuse/fuse_device.c
89
if (fd->fd_unit == unit) {
sys/miscfs/fuse/fuse_device.c
90
refcnt_take(&fd->fd_refcnt);
sys/miscfs/fuse/fuse_device.c
91
return (fd);
sys/miscfs/fuse/fuse_vfsops.c
87
if ((fp = fd_getfile(p->p_fd, args->fd)) == NULL)
sys/stand/boot/boot.c
128
if ((fd = loadfile(cmd.path, marks, LOAD_ALL)) != -1) {
sys/stand/boot/boot.c
134
if (fstat(fd, &st) == 0) {
sys/stand/boot/boot.c
136
if (fchmod(fd, st.st_mode) == -1)
sys/stand/boot/boot.c
141
close(fd);
sys/stand/boot/boot.c
169
int fd, i, error = 0;
sys/stand/boot/boot.c
184
fd = open(path, O_RDONLY);
sys/stand/boot/boot.c
185
if (fd == -1) {
sys/stand/boot/boot.c
190
if (fstat(fd, &sb) == -1) {
sys/stand/boot/boot.c
194
if (read(fd, buf, buflen) != buflen) {
sys/stand/boot/boot.c
203
fchmod(fd, sb.st_mode | S_ISTXT);
sys/stand/boot/boot.c
205
close(fd);
sys/stand/boot/boot.c
64
int fd, isupgrade = 0;
sys/stand/boot/cmd.c
107
int fd, rc = 0;
sys/stand/boot/cmd.c
117
if ((fd = open(qualify(cmd.conf), O_RDONLY)) < 0) {
sys/stand/boot/cmd.c
126
(void) fstat(fd, &sb);
sys/stand/boot/cmd.c
129
close(fd);
sys/stand/boot/cmd.c
139
rc = read(fd, p, 1);
sys/stand/boot/cmd.c
167
close(fd);
sys/stand/boot/cmd.c
443
int fd;
sys/stand/boot/cmd.c
453
if ((fd = opendir(cmd.path)) < 0) {
sys/stand/boot/cmd.c
465
while (readdir(fd, p) >= 0) {
sys/stand/boot/cmd.c
472
closedir (fd);
sys/sys/dkio.h
72
int fd;
sys/sys/event.h
310
extern void knote_fdclose(struct proc *p, int fd);
sys/sys/mount.h
247
int fd;
sys/sys/poll.h
32
int fd;
sys/sys/select.h
79
__fd_set(int fd, fd_set *p)
sys/sys/select.h
81
p->fds_bits[fd / __NFDBITS] |= (1U << (fd % __NFDBITS));
sys/sys/select.h
86
__fd_clr(int fd, fd_set *p)
sys/sys/select.h
88
p->fds_bits[fd / __NFDBITS] &= ~(1U << (fd % __NFDBITS));
sys/sys/select.h
93
__fd_isset(int fd, const fd_set *p)
sys/sys/select.h
95
return (p->fds_bits[fd / __NFDBITS] & (1U << (fd % __NFDBITS)));
sys/sys/syscallargs.h
1003
syscallarg(int) fd;
sys/sys/syscallargs.h
1077
syscallarg(int) fd;
sys/sys/syscallargs.h
1084
syscallarg(int) fd;
sys/sys/syscallargs.h
1091
syscallarg(int) fd;
sys/sys/syscallargs.h
1107
syscallarg(int) fd;
sys/sys/syscallargs.h
1113
syscallarg(int) fd;
sys/sys/syscallargs.h
1119
syscallarg(int) fd;
sys/sys/syscallargs.h
1126
syscallarg(int) fd;
sys/sys/syscallargs.h
1133
syscallarg(int) fd;
sys/sys/syscallargs.h
1148
syscallarg(int) fd;
sys/sys/syscallargs.h
1153
syscallarg(int) fd;
sys/sys/syscallargs.h
185
syscallarg(int) fd;
sys/sys/syscallargs.h
200
syscallarg(int) fd;
sys/sys/syscallargs.h
204
syscallarg(int) fd;
sys/sys/syscallargs.h
233
syscallarg(int) fd;
sys/sys/syscallargs.h
246
syscallarg(int) fd;
sys/sys/syscallargs.h
251
syscallarg(int) fd;
sys/sys/syscallargs.h
301
syscallarg(int) fd;
sys/sys/syscallargs.h
31
syscallarg(int) fd;
sys/sys/syscallargs.h
340
syscallarg(int) fd;
sys/sys/syscallargs.h
37
syscallarg(int) fd;
sys/sys/syscallargs.h
371
syscallarg(int) fd;
sys/sys/syscallargs.h
380
syscallarg(int) fd;
sys/sys/syscallargs.h
408
syscallarg(int) fd;
sys/sys/syscallargs.h
415
syscallarg(int) fd;
sys/sys/syscallargs.h
451
syscallarg(int) fd;
sys/sys/syscallargs.h
472
syscallarg(int) fd;
sys/sys/syscallargs.h
49
syscallarg(int) fd;
sys/sys/syscallargs.h
494
syscallarg(int) fd;
sys/sys/syscallargs.h
539
syscallarg(int) fd;
sys/sys/syscallargs.h
616
syscallarg(int) fd;
sys/sys/syscallargs.h
622
syscallarg(int) fd;
sys/sys/syscallargs.h
633
syscallarg(int) fd;
sys/sys/syscallargs.h
639
syscallarg(int) fd;
sys/sys/syscallargs.h
665
syscallarg(int) fd;
sys/sys/syscallargs.h
771
syscallarg(int) fd;
sys/sys/syscallargs.h
782
syscallarg(int) fd;
sys/sys/syscallargs.h
787
syscallarg(int) fd;
sys/sys/syscallargs.h
794
syscallarg(int) fd;
sys/sys/syscallargs.h
801
syscallarg(int) fd;
sys/sys/syscallargs.h
808
syscallarg(int) fd;
sys/sys/syscallargs.h
83
syscallarg(int) fd;
sys/sys/syscallargs.h
836
syscallarg(int) fd;
sys/sys/syscallargs.h
848
syscallarg(int) fd;
sys/sys/videoio.h
4716
int32_t fd;
sys/sys/videoio.h
4773
int32_t fd;
sys/sys/videoio.h
4859
int32_t fd;
sys/uvm/uvm_mmap.c
125
syscallarg(int) fd;
sys/uvm/uvm_mmap.c
135
int fd;
sys/uvm/uvm_mmap.c
140
fd = SCARG(uap, fd);
sys/uvm/uvm_mmap.c
148
if (fd >= 0) {
sys/uvm/uvm_mmap.c
149
if ((error = getvnode(p, fd, &fp)) != 0)
sys/uvm/uvm_mmap.c
216
syscallarg(int) fd;
sys/uvm/uvm_mmap.c
224
int flags, fd;
sys/uvm/uvm_mmap.c
236
fd = SCARG(uap, fd);
sys/uvm/uvm_mmap.c
293
if ((fp = fd_getfile(fdp, fd)) == NULL) {
sys/uvm/uvm_mmap.c
401
if (fd != -1)
usr.bin/at/at.c
161
int fd, i;
usr.bin/at/at.c
171
fd = open(atfile, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR);
usr.bin/at/at.c
172
if (fd >= 0)
usr.bin/at/at.c
173
return (fd);
usr.bin/at/at.c
191
int fd;
usr.bin/at/at.c
216
if ((fd = newjob(runtimer, queue)) == -1)
usr.bin/at/at.c
225
if ((fp = fdopen(fd, "w")) == NULL)
usr.bin/aucat/afile.c
222
if (lseek(f->fd, 0, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
226
if (read(f->fd, addr, size) != size) {
usr.bin/aucat/afile.c
236
if (lseek(f->fd, 0, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
240
if (write(f->fd, addr, size) != size) {
usr.bin/aucat/afile.c
286
if (read(f->fd, &fmt, csize) != csize) {
usr.bin/aucat/afile.c
356
if (read(f->fd, &chunk, sizeof(chunk)) != sizeof(chunk)) {
usr.bin/aucat/afile.c
381
if (lseek(f->fd, sizeof(riff) + pos, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
437
if (read(f->fd, &comm, csize_min) != csize_min) {
usr.bin/aucat/afile.c
488
if (read(f->fd, &data, csize) != csize) {
usr.bin/aucat/afile.c
524
if (read(f->fd, &chunk, sizeof(chunk)) != sizeof(chunk)) {
usr.bin/aucat/afile.c
556
if (lseek(f->fd, sizeof(form) + pos, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
665
if (lseek(f->fd, f->startpos, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
728
n = read(f->fd, data, count);
usr.bin/aucat/afile.c
754
n = write(f->fd, data, count);
usr.bin/aucat/afile.c
778
if (lseek(f->fd, pos, SEEK_SET) == -1) {
usr.bin/aucat/afile.c
798
close(f->fd);
usr.bin/aucat/afile.c
836
f->fd = STDIN_FILENO;
usr.bin/aucat/afile.c
839
f->fd = open(f->path, O_RDONLY);
usr.bin/aucat/afile.c
840
if (f->fd == -1) {
usr.bin/aucat/afile.c
863
f->fd = STDOUT_FILENO;
usr.bin/aucat/afile.c
866
f->fd = open(f->path,
usr.bin/aucat/afile.c
868
if (f->fd == -1) {
usr.bin/aucat/afile.c
921
close(f->fd);
usr.bin/aucat/afile.h
38
int fd; /* file descriptor */
usr.bin/audioctl/audioctl.c
230
if (ioctl(fd, AUDIO_GETSTATUS, &rstatus) == -1)
usr.bin/audioctl/audioctl.c
232
if (ioctl(fd, AUDIO_GETDEV, &rname) == -1)
usr.bin/audioctl/audioctl.c
234
if (ioctl(fd, AUDIO_GETPAR, &rpar) == -1)
usr.bin/audioctl/audioctl.c
236
if (ioctl(fd, AUDIO_GETPOS, &rpos) == -1)
usr.bin/audioctl/audioctl.c
257
if (ioctl(fd, AUDIO_SETPAR, &wpar) == -1)
usr.bin/audioctl/audioctl.c
259
if (ioctl(fd, AUDIO_GETPAR, &wpar) == -1)
usr.bin/audioctl/audioctl.c
312
fd = open(path, O_WRONLY);
usr.bin/audioctl/audioctl.c
313
if (fd == -1)
usr.bin/audioctl/audioctl.c
318
close(fd);
usr.bin/audioctl/audioctl.c
69
int fd, show_names = 1, quiet = 0, wait_sec = 0;
usr.bin/bgplg/bgplg.c
231
int fd, len;
usr.bin/bgplg/bgplg.c
233
if ((fd = open(file, O_RDONLY)) == -1)
usr.bin/bgplg/bgplg.c
237
len = read(fd, buf, sizeof(buf));
usr.bin/bgplg/bgplg.c
241
close(fd);
usr.bin/cdio/cdio.c
1037
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1059
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1079
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1088
rc = ioctl(fd, CDIOCSTOP);
usr.bin/cdio/cdio.c
1090
(void) ioctl(fd, CDIOCALLOW);
usr.bin/cdio/cdio.c
1155
rc = ioctl(fd, CDIOCREADSUBCHANNEL, (char *) &ss);
usr.bin/cdio/cdio.c
1170
rc = ioctl(fd, CDIOCGETVOL, &v);
usr.bin/cdio/cdio.c
1189
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1218
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1256
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/cdio.c
1391
return ioctl(fd, CDIOCPLAYTRACKS, &t);
usr.bin/cdio/cdio.c
1402
return ioctl(fd, CDIOCPLAYBLOCKS, &t);
usr.bin/cdio/cdio.c
1415
return ioctl(fd, CDIOCSETVOL, &v);
usr.bin/cdio/cdio.c
1440
return (ioctl(fd, CDIOREADTOCENTRYS, (char *) &t));
usr.bin/cdio/cdio.c
1455
return ioctl(fd, CDIOCPLAYMSF, (char *) &a);
usr.bin/cdio/cdio.c
1471
if (ioctl(fd, CDIOCREADSUBCHANNEL, (char *) &s) == -1)
usr.bin/cdio/cdio.c
155
int fd = -1;
usr.bin/cdio/cdio.c
1600
if (fd > -1) {
usr.bin/cdio/cdio.c
1602
close(fd);
usr.bin/cdio/cdio.c
1603
fd = -1;
usr.bin/cdio/cdio.c
1608
for (tries = 0; fd < 0 && tries < 10; tries++) {
usr.bin/cdio/cdio.c
1610
fd = opendev(dev, O_RDWR, OPENDEV_PART, &realdev);
usr.bin/cdio/cdio.c
1612
fd = opendev(dev, O_RDONLY, OPENDEV_PART, &realdev);
usr.bin/cdio/cdio.c
1613
if (fd == -1) {
usr.bin/cdio/cdio.c
1629
if (fd == -1) {
usr.bin/cdio/cdio.c
318
close(fd);
usr.bin/cdio/cdio.c
319
fd = -1;
usr.bin/cdio/cdio.c
364
return ioctl(fd, CDIOCPAUSE);
usr.bin/cdio/cdio.c
370
return ioctl(fd, CDIOCRESUME);
usr.bin/cdio/cdio.c
376
rc = ioctl(fd, CDIOCSTOP);
usr.bin/cdio/cdio.c
378
(void) ioctl(fd, CDIOCALLOW);
usr.bin/cdio/cdio.c
386
rc = ioctl(fd, CDIOCRESET);
usr.bin/cdio/cdio.c
389
close(fd);
usr.bin/cdio/cdio.c
390
fd = -1;
usr.bin/cdio/cdio.c
398
return ioctl(fd, CDIOCSETDEBUG);
usr.bin/cdio/cdio.c
401
return ioctl(fd, CDIOCCLRDEBUG);
usr.bin/cdio/cdio.c
409
if (fd > -1) {
usr.bin/cdio/cdio.c
410
(void) ioctl(fd, CDIOCALLOW);
usr.bin/cdio/cdio.c
411
close(fd);
usr.bin/cdio/cdio.c
412
fd = -1;
usr.bin/cdio/cdio.c
431
(void) ioctl(fd, CDIOCALLOW);
usr.bin/cdio/cdio.c
432
rc = ioctl(fd, CDIOCEJECT);
usr.bin/cdio/cdio.c
435
close(fd);
usr.bin/cdio/cdio.c
436
fd = -1;
usr.bin/cdio/cdio.c
446
(void) ioctl(fd, CDIOCALLOW);
usr.bin/cdio/cdio.c
447
rc = ioctl(fd, CDIOCCLOSE);
usr.bin/cdio/cdio.c
450
close(fd);
usr.bin/cdio/cdio.c
451
fd = -1;
usr.bin/cdio/cdio.c
477
return ioctl(fd, CDIOCSETLEFT);
usr.bin/cdio/cdio.c
480
return ioctl(fd, CDIOCSETRIGHT);
usr.bin/cdio/cdio.c
483
return ioctl(fd, CDIOCSETMONO);
usr.bin/cdio/cdio.c
486
return ioctl(fd, CDIOCSETSTEREO);
usr.bin/cdio/cdio.c
489
return ioctl(fd, CDIOCSETMUTE);
usr.bin/cdio/cdio.c
558
is_wave(int fd)
usr.bin/cdio/cdio.c
564
if (read(fd, buf, sizeof(buf)) == sizeof(buf)) {
usr.bin/cdio/cdio.c
642
tr->fd = open(tr->file, O_RDONLY);
usr.bin/cdio/cdio.c
643
if (tr->fd == -1)
usr.bin/cdio/cdio.c
645
if (fstat(tr->fd, &sb) == -1)
usr.bin/cdio/cdio.c
650
if (is_wave(tr->fd)) {
usr.bin/cdio/cdio.c
694
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/extern.h
37
int fd;
usr.bin/cdio/mmc.c
164
error = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
202
error = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
300
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
321
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
34
extern int fd;
usr.bin/cdio/mmc.c
341
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
361
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
382
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
477
if (lseek(tr->fd, tr->off, SEEK_SET) == -1)
usr.bin/cdio/mmc.c
481
read(tr->fd, databuf, nblk * tr->blklen);
usr.bin/cdio/mmc.c
485
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
518
close(tr->fd);
usr.bin/cdio/mmc.c
542
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
571
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
596
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/mmc.c
622
r = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/rip.c
303
write_sector(int fd, u_char *sec, u_int32_t secsize)
usr.bin/cdio/rip.c
308
res = write(fd, sec, secsize);
usr.bin/cdio/rip.c
351
error = ioctl(fd, SCIOCCOMMAND, &scr);
usr.bin/cdio/rip.c
394
if (ti->fd >= 0 &&
usr.bin/cdio/rip.c
395
(write_sector(ti->fd, sec, blksize) != 0)) {
usr.bin/cdio/rip.c
434
info->fd = open(info->name, O_CREAT | O_TRUNC | O_RDWR,
usr.bin/cdio/rip.c
436
if (info->fd == -1) {
usr.bin/cdio/rip.c
448
error = write_sector(info->fd, wavehdr, sizeof(wavehdr));
usr.bin/cdio/rip.c
46
extern int fd;
usr.bin/cdio/rip.c
527
info.fd = -1;
usr.bin/cdio/rip.c
567
if (info.fd >= 0) {
usr.bin/cdio/rip.c
568
close(info.fd);
usr.bin/cdio/rip.c
569
info.fd = -1;
usr.bin/cdio/rip.c
601
rc = ioctl(fd, CDIOREADTOCHEADER, &h);
usr.bin/cdio/rip.c
92
int fd; /* descriptor of output file */
usr.bin/chpass/edit.c
124
(void)fchown(fd, getuid(), getgid());
usr.bin/chpass/edit.c
138
int fd;
usr.bin/chpass/edit.c
140
if ((fd = open(tempname, O_RDONLY|O_NOFOLLOW)) == -1 ||
usr.bin/chpass/edit.c
141
(fp = fdopen(fd, "r")) == NULL)
usr.bin/chpass/edit.c
143
if (fstat(fd, &sb))
usr.bin/chpass/edit.c
79
display(char *tempname, int fd, struct passwd *pw)
usr.bin/chpass/edit.c
85
if (!(fp = fdopen(fd, "w")))
usr.bin/compress/gzopen.c
104
gz_ropen(int fd, char *name, int gotmagic)
usr.bin/compress/gzopen.c
108
if (fd < 0)
usr.bin/compress/gzopen.c
137
s->z_fd = fd;
usr.bin/compress/gzopen.c
379
gz_wopen(int fd, char *name, int bits, u_int32_t mtime)
usr.bin/compress/gzopen.c
383
if (fd < 0)
usr.bin/compress/gzopen.c
418
s->z_fd = fd;
usr.bin/compress/main.c
494
int fd;
usr.bin/compress/main.c
496
fd = pipin ? dup(STDIN_FILENO) : open(in, O_RDONLY);
usr.bin/compress/main.c
497
if (fd == -1) {
usr.bin/compress/main.c
502
if (decomp && !force && isatty(fd)) {
usr.bin/compress/main.c
506
close(fd);
usr.bin/compress/main.c
510
return fd;
usr.bin/compress/main.c
517
int fd, error = FAILURE;
usr.bin/compress/main.c
520
fd = dup(STDOUT_FILENO);
usr.bin/compress/main.c
521
if (fd == -1)
usr.bin/compress/main.c
525
fd = open(out, O_WRONLY, S_IWUSR);
usr.bin/compress/main.c
526
if (fd != -1) {
usr.bin/compress/main.c
527
if (fstat(fd, &sb) == -1)
usr.bin/compress/main.c
533
if (ftruncate(fd, 0) == -1)
usr.bin/compress/main.c
536
fd = open(out, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR);
usr.bin/compress/main.c
537
if (fd == -1 || fstat(fd, &sb) == -1)
usr.bin/compress/main.c
544
return fd;
usr.bin/compress/main.c
548
if (fd != -1)
usr.bin/compress/main.c
549
close(fd);
usr.bin/compress/main.c
650
check_method(int fd)
usr.bin/compress/main.c
655
if (read(fd, magic, sizeof(magic)) != 2)
usr.bin/compress/main.c
791
setfile(const char *name, int fd, struct stat *fs)
usr.bin/compress/main.c
804
fchmod(fd, DEFFILEMODE & ~mask);
usr.bin/compress/main.c
815
if (fchown(fd, fs->st_uid, fs->st_gid)) {
usr.bin/compress/main.c
820
if (fchmod(fd, fs->st_mode))
usr.bin/compress/main.c
823
if (fs->st_flags && fchflags(fd, fs->st_flags))
usr.bin/compress/main.c
828
if (futimens(fd, ts))
usr.bin/compress/nullopen.c
105
setfile(name, s->fd, sb);
usr.bin/compress/nullopen.c
106
err = close(s->fd);
usr.bin/compress/nullopen.c
148
return read(s->fd, buf, len);
usr.bin/compress/nullopen.c
161
return write(s->fd, buf, len);
usr.bin/compress/nullopen.c
41
int fd;
usr.bin/compress/nullopen.c
50
null_ropen(int fd, char *name, int gotmagic)
usr.bin/compress/nullopen.c
54
if (fd < 0)
usr.bin/compress/nullopen.c
60
s->fd = fd;
usr.bin/compress/nullopen.c
69
null_wopen(int fd, char *name, int bits, u_int32_t mtime)
usr.bin/compress/nullopen.c
73
if (fd < 0)
usr.bin/compress/nullopen.c
79
s->fd = fd;
usr.bin/compress/zipopen.c
256
zip_ropen(int fd, char *name, int gotmagic)
usr.bin/compress/zipopen.c
260
if (fd < 0)
usr.bin/compress/zipopen.c
266
s->z_fd = fd;
usr.bin/compress/zopen.c
733
z_wopen(int fd, char *name, int bits, u_int32_t mtime)
usr.bin/compress/zopen.c
763
zs->zs_fd = fd;
usr.bin/compress/zopen.c
768
z_ropen(int fd, char *name, int gotmagic)
usr.bin/compress/zopen.c
793
zs->zs_fd = fd;
usr.bin/ctfconv/ctfconv.c
184
int fd, error = 1;
usr.bin/ctfconv/ctfconv.c
187
fd = open(path, O_RDONLY);
usr.bin/ctfconv/ctfconv.c
188
if (fd == -1) {
usr.bin/ctfconv/ctfconv.c
192
if (fstat(fd, &st) == -1) {
usr.bin/ctfconv/ctfconv.c
194
close(fd);
usr.bin/ctfconv/ctfconv.c
199
close(fd);
usr.bin/ctfconv/ctfconv.c
203
p = mmap(NULL, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
usr.bin/ctfconv/ctfconv.c
211
close(fd);
usr.bin/ctfconv/generate.c
366
int error = 0, fd;
usr.bin/ctfconv/generate.c
414
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
usr.bin/ctfconv/generate.c
415
if (fd == -1) {
usr.bin/ctfconv/generate.c
421
if (write(fd, ctfdata, ctflen) != ctflen) {
usr.bin/ctfconv/generate.c
426
close(fd);
usr.bin/ctfdump/ctfdump.c
133
int fd, error = 1;
usr.bin/ctfdump/ctfdump.c
135
fd = open(path, O_RDONLY);
usr.bin/ctfdump/ctfdump.c
136
if (fd == -1) {
usr.bin/ctfdump/ctfdump.c
141
if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
usr.bin/ctfdump/ctfdump.c
153
if (fstat(fd, &st) == -1) {
usr.bin/ctfdump/ctfdump.c
162
p = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
usr.bin/ctfdump/ctfdump.c
172
close(fd);
usr.bin/cu/command.c
49
int fd;
usr.bin/cu/command.c
62
fd = open(_PATH_DEVNULL, O_RDWR);
usr.bin/cu/command.c
63
if (fd == -1 || dup2(fd, STDIN_FILENO) == -1)
usr.bin/cu/command.c
65
close(fd);
usr.bin/cu/cu.c
241
signal_event(int fd, short events, void *data)
usr.bin/cu/cu.c
244
printf("\r\n[SIG%s]\n", sys_signame[fd]);
usr.bin/cu/cu.c
250
set_blocking(int fd, int state)
usr.bin/cu/cu.c
255
if ((mode = fcntl(fd, F_GETFL)) == -1)
usr.bin/cu/cu.c
259
if (fcntl(fd, F_SETFL, mode) == -1)
usr.bin/cvs/add.c
243
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/atomicio.c
41
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.bin/cvs/atomicio.c
48
pfd.fd = fd;
usr.bin/cvs/atomicio.c
51
res = (f) (fd, s + pos, n - pos);
usr.bin/cvs/buf.c
103
if (fstat(fd, &st) == -1)
usr.bin/cvs/buf.c
106
if (lseek(fd, 0, SEEK_SET) == -1)
usr.bin/cvs/buf.c
112
if (atomicio(read, fd, buf->cb_buf, buf->cb_size) != buf->cb_size)
usr.bin/cvs/buf.c
200
buf_write_fd(BUF *b, int fd)
usr.bin/cvs/buf.c
202
if (atomicio(vwrite, fd, b->cb_buf, b->cb_len) != b->cb_len)
usr.bin/cvs/buf.c
214
int fd;
usr.bin/cvs/buf.c
216
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
usr.bin/cvs/buf.c
223
if (buf_write_fd(b, fd) == -1) {
usr.bin/cvs/buf.c
228
if (fchmod(fd, mode) == -1)
usr.bin/cvs/buf.c
231
(void)close(fd);
usr.bin/cvs/buf.c
245
int fd;
usr.bin/cvs/buf.c
247
if ((fd = mkstemp(template)) == -1)
usr.bin/cvs/buf.c
250
if (buf_write_fd(b, fd) == -1) {
usr.bin/cvs/buf.c
256
if (futimes(fd, tv) == -1)
usr.bin/cvs/buf.c
262
if (lseek(fd, 0, SEEK_SET) == -1)
usr.bin/cvs/buf.c
265
return (fd);
usr.bin/cvs/buf.c
85
int fd;
usr.bin/cvs/buf.c
88
if ((fd = open(path, O_RDONLY)) == -1)
usr.bin/cvs/buf.c
92
bp = buf_load_fd(fd);
usr.bin/cvs/buf.c
93
(void)close(fd);
usr.bin/cvs/buf.c
98
buf_load_fd(int fd)
usr.bin/cvs/checkout.c
520
(void)close(cf->fd);
usr.bin/cvs/checkout.c
523
cf->fd = open(cf->file_path,
usr.bin/cvs/checkout.c
525
if (cf->fd == -1)
usr.bin/cvs/checkout.c
529
rcs_rev_write_fd(cf->file_rcs, rnum, cf->fd, 0);
usr.bin/cvs/checkout.c
538
if (fchmod(cf->fd, mode) == -1)
usr.bin/cvs/checkout.c
550
if (futimes(cf->fd, tv) == -1)
usr.bin/cvs/checkout.c
647
cvs_remote_send_file(tosend, cf->fd);
usr.bin/cvs/client.c
529
cvs_remote_send_file(cf->file_path, cf->fd);
usr.bin/cvs/client.c
542
cvs_remote_send_file(cf->file_path, cf->fd);
usr.bin/cvs/client.c
692
int fd;
usr.bin/cvs/client.c
771
if ((fd = open(fpath, O_CREAT | O_WRONLY | O_TRUNC)) == -1)
usr.bin/cvs/client.c
775
cvs_remote_receive_file(fd, flen);
usr.bin/cvs/client.c
781
if (futimes(fd, tv) == -1)
usr.bin/cvs/client.c
784
if (fchmod(fd, fmode) == -1)
usr.bin/cvs/client.c
787
(void)close(fd);
usr.bin/cvs/client.c
795
int fd;
usr.bin/cvs/client.c
850
if ((fd = open(fpath, O_CREAT | O_WRONLY | O_TRUNC)) == -1)
usr.bin/cvs/client.c
854
cvs_remote_receive_file(fd, flen);
usr.bin/cvs/client.c
860
if (futimes(fd, tv) == -1)
usr.bin/cvs/client.c
863
if (fchmod(fd, fmode) == -1)
usr.bin/cvs/client.c
866
(void)close(fd);
usr.bin/cvs/commit.c
572
b = buf_load_fd(cf->fd);
usr.bin/cvs/commit.c
618
(void)close(cf->fd);
usr.bin/cvs/commit.c
619
cf->fd = -1;
usr.bin/cvs/commit.c
697
b = buf_load_fd(cf->fd);
usr.bin/cvs/commit.c
731
int fd;
usr.bin/cvs/commit.c
737
if ((fd = open(desc_path, O_RDONLY)) == -1)
usr.bin/cvs/commit.c
740
bp = buf_load_fd(fd);
usr.bin/cvs/commit.c
746
(void)close(fd);
usr.bin/cvs/diff.c
513
if (cvs_server_active == 1 && cf->fd == -1) {
usr.bin/cvs/diff.c
524
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/diff.c
526
b1 = buf_load_fd(cf->fd);
usr.bin/cvs/diff3.c
174
b1 = buf_load_fd(cf->fd);
usr.bin/cvs/diff3.c
242
(void)close(cf->fd);
usr.bin/cvs/diff3.c
243
cf->fd = open(cf->file_path, O_CREAT | O_RDWR | O_TRUNC, 0644);
usr.bin/cvs/diff3.c
244
if (cf->fd == -1) {
usr.bin/cvs/diff3.c
253
if (atomicio(vwrite, cf->fd, lp->l_line, lp->l_len) !=
usr.bin/cvs/diff3.c
438
readin(int fd, struct diff **dd)
usr.bin/cvs/diff3.c
444
fp[0] = fdopen(fd, "r");
usr.bin/cvs/diff_internals.c
450
prepare(int i, FILE *fd, off_t filesize, int flags)
usr.bin/cvs/diff_internals.c
456
rewind(fd);
usr.bin/cvs/diff_internals.c
463
for (j = 0; (h = readhash(fd, flags));) {
usr.bin/cvs/diff_internals.c
864
preadline(int fd, size_t rlen, off_t off)
usr.bin/cvs/diff_internals.c
870
if ((nr = pread(fd, line, rlen, off)) == -1)
usr.bin/cvs/edit.c
303
if (fchmod(cf->fd, 0644) == -1)
usr.bin/cvs/edit.c
420
if (fchmod(cf->fd, 0644) == -1)
usr.bin/cvs/file.c
230
cvs_file_get_cf(const char *d, const char *f, const char *fpath, int fd,
usr.bin/cvs/file.c
244
cf->fd = fd;
usr.bin/cvs/file.c
252
if (cf->fd != -1)
usr.bin/cvs/file.c
264
int fd, type;
usr.bin/cvs/file.c
289
if ((fd = open(l->file_path, O_RDONLY)) != -1) {
usr.bin/cvs/file.c
291
if (fstat(fd, &st) == -1) {
usr.bin/cvs/file.c
293
(void)close(fd);
usr.bin/cvs/file.c
305
(void)close(fd);
usr.bin/cvs/file.c
325
if ((fd = open(fpath, O_RDONLY)) == -1) {
usr.bin/cvs/file.c
327
fd = open(fpath, O_RDONLY);
usr.bin/cvs/file.c
330
if (fd != -1 && type == 0) {
usr.bin/cvs/file.c
331
if (fstat(fd, &st) == -1)
usr.bin/cvs/file.c
343
(void)close(fd);
usr.bin/cvs/file.c
348
(void)close(fd);
usr.bin/cvs/file.c
349
fd = -1;
usr.bin/cvs/file.c
350
} else if (fd != -1) {
usr.bin/cvs/file.c
351
close(fd);
usr.bin/cvs/file.c
352
fd = -1;
usr.bin/cvs/file.c
356
cf = cvs_file_get_cf(d, f, l->file_path, fd, type, l->flags);
usr.bin/cvs/file.c
466
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/file.c
479
while ((nbytes = getdents(cf->fd, buf, bufsize)) > 0) {
usr.bin/cvs/file.c
722
else if (cf->fd == -1 && stat(rcsfile, &st) != -1)
usr.bin/cvs/file.c
795
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/file.c
809
if ((server_has_file == 1) || (cf->fd != -1))
usr.bin/cvs/file.c
817
b2 = buf_load_fd(cf->fd);
usr.bin/cvs/file.c
991
if (cf->fd != -1)
usr.bin/cvs/file.c
992
(void)close(cf->fd);
usr.bin/cvs/file.h
45
int fd;
usr.bin/cvs/history.c
166
if ((fd = open(fpath, O_WRONLY|O_APPEND)) == -1) {
usr.bin/cvs/history.c
170
if ((fp = fdopen(fd, "a")) != NULL) {
usr.bin/cvs/history.c
178
(void)close(fd);
usr.bin/cvs/history.c
70
int fd;
usr.bin/cvs/import.c
324
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/import.c
335
bp = buf_load_fd(cf->fd);
usr.bin/cvs/import.c
410
b2 = buf_load_fd(cf->fd);
usr.bin/cvs/import.c
478
b1 = buf_load_fd(cf->fd);
usr.bin/cvs/init.c
146
int fd, rcsflags;
usr.bin/cvs/init.c
153
if ((fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0444)) == -1)
usr.bin/cvs/init.c
159
if (atomicio(vwrite, fd, *p, len) != len)
usr.bin/cvs/init.c
170
(void)fchmod(fd, 0666);
usr.bin/cvs/init.c
171
(void)close(fd);
usr.bin/cvs/init.c
191
(void)close(fd);
usr.bin/cvs/logmsg.c
115
if ((fd = mkstemp(fpath)) == -1)
usr.bin/cvs/logmsg.c
120
if ((fp = fdopen(fd, "w")) == NULL) {
usr.bin/cvs/logmsg.c
215
if (fstat(fd, &st1) == -1) {
usr.bin/cvs/logmsg.c
227
if (fstat(fd, &st2) == -1) {
usr.bin/cvs/logmsg.c
327
int fd, ret = 0;
usr.bin/cvs/logmsg.c
338
if ((fd = mkstemp(fpath)) == -1)
usr.bin/cvs/logmsg.c
352
(void)close(fd);
usr.bin/cvs/logmsg.c
43
int fd;
usr.bin/cvs/logmsg.c
50
if ((fd = open(path, O_RDONLY)) == -1)
usr.bin/cvs/logmsg.c
53
if (fstat(fd, &st) == -1)
usr.bin/cvs/logmsg.c
59
if ((fp = fdopen(fd, "r")) == NULL)
usr.bin/cvs/logmsg.c
99
int c, fd, rd, saved_errno;
usr.bin/cvs/rcs.c
154
rcs_open(const char *path, int fd, int flags, ...)
usr.bin/cvs/rcs.c
173
if (fstat(fd, &st) == -1)
usr.bin/cvs/rcs.c
185
if (fd == -1)
usr.bin/cvs/rcs.c
187
else if ((rfp->rf_file = fdopen(fd, "r")) == NULL)
usr.bin/cvs/rcs.c
2089
int fd;
usr.bin/cvs/rcs.c
2113
fd = dup(_fd);
usr.bin/cvs/rcs.c
2114
if (fd == -1)
usr.bin/cvs/rcs.c
2117
if ((fp = fdopen(fd, "w")) == NULL)
usr.bin/cvs/rcs.c
2164
int fd;
usr.bin/cvs/rcs.c
2166
if ((fd = mkstemp(template)) == -1)
usr.bin/cvs/rcs.c
2170
rcs_rev_write_fd(rfp, rev, fd, mode);
usr.bin/cvs/rcs.c
2172
if (lseek(fd, 0, SEEK_SET) == -1)
usr.bin/cvs/rcs.c
2175
return (fd);
usr.bin/cvs/rcs.c
290
int fd, saved_errno;
usr.bin/cvs/rcs.c
292
fd = -1;
usr.bin/cvs/rcs.c
308
if ((fd = mkstemp(fn)) == -1)
usr.bin/cvs/rcs.c
311
if ((fp = fdopen(fd, "w")) == NULL) {
usr.bin/cvs/rcs.c
419
if (fchmod(fd, rfp->rf_mode) == -1) {
usr.bin/cvs/remote.c
129
cvs_remote_receive_file(int fd, size_t len)
usr.bin/cvs/remote.c
149
if (atomicio(vwrite, fd, data, nread) != nread)
usr.bin/cvs/remote.c
164
int fd;
usr.bin/cvs/remote.c
176
fd = dup(_fd);
usr.bin/cvs/remote.c
177
if (fd == -1)
usr.bin/cvs/remote.c
180
if (lseek(fd, 0, SEEK_SET) == -1)
usr.bin/cvs/remote.c
184
if (fstat(fd, &st) == -1)
usr.bin/cvs/remote.c
194
if ((in = fdopen(fd, "r")) == NULL)
usr.bin/cvs/remote.c
257
if (cf->fd != -1)
usr.bin/cvs/remote.c
275
if (cf->fd != -1)
usr.bin/cvs/remote.c
279
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/remove.c
131
(void)close(cf->fd);
usr.bin/cvs/remove.c
132
cf->fd = -1;
usr.bin/cvs/server.c
395
int fd;
usr.bin/cvs/server.c
420
if ((fd = open(fpath, O_WRONLY | O_CREAT | O_TRUNC)) == -1)
usr.bin/cvs/server.c
423
cvs_remote_receive_file(fd, flen);
usr.bin/cvs/server.c
425
if (fchmod(fd, 0600) == -1)
usr.bin/cvs/server.c
428
(void)close(fd);
usr.bin/cvs/update.c
209
if ((cf->fd = open(cf->file_path, O_RDONLY)) == -1)
usr.bin/cvs/update.c
259
if (fstat(cf->fd, &st) == -1)
usr.bin/cvs/update.c
271
if (lseek(cf->fd, 0, SEEK_SET) == -1)
usr.bin/cvs/update.c
274
while ((nbytes = getdents(cf->fd, buf, bufsize)) > 0) {
usr.bin/cvs/update.c
546
bp = buf_load_fd(cf->fd);
usr.bin/cvs/update.c
647
(void)close(cf->fd);
usr.bin/cvs/update.c
648
cf->fd = -1;
usr.bin/cvs/util.c
502
int fd;
usr.bin/cvs/util.c
548
if ((fd = open(buf, O_WRONLY|O_CREAT|O_EXCL, 0666 & ~cvs_umask))
usr.bin/cvs/util.c
555
if (atomicio(vwrite, fd, "D\n", 2) != 2)
usr.bin/cvs/util.c
557
close(fd);
usr.bin/deroff/deroff.c
390
FILE *fd;
usr.bin/deroff/deroff.c
392
if ((fd = fopen(p, "r")) == NULL)
usr.bin/deroff/deroff.c
395
return(fd);
usr.bin/diff/diffreg.c
499
prepare(int i, FILE *fd, off_t filesize, int flags)
usr.bin/diff/diffreg.c
505
rewind(fd);
usr.bin/diff/diffreg.c
512
for (j = 0; (h = readhash(fd, flags));) {
usr.bin/diff/diffreg.c
931
preadline(int fd, size_t rlen, off_t off)
usr.bin/diff/diffreg.c
937
if ((nr = pread(fd, line, rlen, off)) == -1)
usr.bin/dig/lib/dns/gen.c
338
FILE *fd;
usr.bin/dig/lib/dns/gen.c
552
if ((fd = fopen(prefix,"r")) != NULL) {
usr.bin/dig/lib/dns/gen.c
553
while (fgets(buf, sizeof(buf), fd) != NULL)
usr.bin/dig/lib/dns/gen.c
555
fclose(fd);
usr.bin/dig/lib/dns/gen.c
561
if ((fd = fopen(buf,"r")) != NULL) {
usr.bin/dig/lib/dns/gen.c
562
while (fgets(buf, sizeof(buf), fd) != NULL)
usr.bin/dig/lib/dns/gen.c
564
fclose(fd);
usr.bin/dig/lib/dns/gen.c
568
if ((fd = fopen(suffix,"r")) != NULL) {
usr.bin/dig/lib/dns/gen.c
569
while (fgets(buf, sizeof(buf), fd) != NULL)
usr.bin/dig/lib/dns/gen.c
571
fclose(fd);
usr.bin/dig/lib/isc/unix/socket.c
1006
cc = sendmsg(sock->fd, &msghdr, 0);
usr.bin/dig/lib/isc/unix/socket.c
1094
socketclose(isc_socketmgr_t *manager, isc_socket_t *sock, int fd) {
usr.bin/dig/lib/isc/unix/socket.c
1099
manager->fds[fd] = NULL;
usr.bin/dig/lib/isc/unix/socket.c
1100
manager->fdstate[fd] = CLOSE_PENDING;
usr.bin/dig/lib/isc/unix/socket.c
1101
select_poke(manager, fd, SELECT_POKE_CLOSE);
usr.bin/dig/lib/isc/unix/socket.c
1111
if (manager->maxfd == fd) {
usr.bin/dig/lib/isc/unix/socket.c
1115
for (i = fd - 1; i >= 0; i--) {
usr.bin/dig/lib/isc/unix/socket.c
1127
int fd;
usr.bin/dig/lib/isc/unix/socket.c
1136
INSIST(sock->fd >= -1 && sock->fd < (int)manager->maxsocks);
usr.bin/dig/lib/isc/unix/socket.c
1138
if (sock->fd >= 0) {
usr.bin/dig/lib/isc/unix/socket.c
1139
fd = sock->fd;
usr.bin/dig/lib/isc/unix/socket.c
1140
sock->fd = -1;
usr.bin/dig/lib/isc/unix/socket.c
1141
socketclose(manager, sock, fd);
usr.bin/dig/lib/isc/unix/socket.c
1165
sock->fd = -1;
usr.bin/dig/lib/isc/unix/socket.c
1228
(void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU,
usr.bin/dig/lib/isc/unix/socket.c
1236
(void)setsockopt(sock->fd, IPPROTO_TCP, TCP_MAXSEG,
usr.bin/dig/lib/isc/unix/socket.c
1249
sock->fd = socket(sock->pf, SOCK_DGRAM, IPPROTO_UDP);
usr.bin/dig/lib/isc/unix/socket.c
1252
sock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP);
usr.bin/dig/lib/isc/unix/socket.c
1256
if (sock->fd < 0) {
usr.bin/dig/lib/isc/unix/socket.c
1285
result = make_nonblock(sock->fd);
usr.bin/dig/lib/isc/unix/socket.c
1287
(void)close(sock->fd);
usr.bin/dig/lib/isc/unix/socket.c
1301
if (setsockopt(sock->fd, SOL_SOCKET, SO_TIMESTAMP,
usr.bin/dig/lib/isc/unix/socket.c
1306
sock->fd, "failed", strerror(errno));
usr.bin/dig/lib/isc/unix/socket.c
1312
&& (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
usr.bin/dig/lib/isc/unix/socket.c
1316
"%s: %s", sock->fd, "failed",
usr.bin/dig/lib/isc/unix/socket.c
1374
manager->fds[sock->fd] = sock;
usr.bin/dig/lib/isc/unix/socket.c
1375
manager->fdstate[sock->fd] = MANAGED;
usr.bin/dig/lib/isc/unix/socket.c
1378
if (manager->maxfd < sock->fd)
usr.bin/dig/lib/isc/unix/socket.c
1379
manager->maxfd = sock->fd;
usr.bin/dig/lib/isc/unix/socket.c
141
int fd;
usr.bin/dig/lib/isc/unix/socket.c
1626
select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
1674
select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);
usr.bin/dig/lib/isc/unix/socket.c
1682
process_fd(isc_socketmgr_t *manager, int fd, int readable,
usr.bin/dig/lib/isc/unix/socket.c
1691
if (manager->fdstate[fd] == CLOSE_PENDING) {
usr.bin/dig/lib/isc/unix/socket.c
1692
(void)unwatch_fd(manager, fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
1693
(void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
usr.bin/dig/lib/isc/unix/socket.c
1697
sock = manager->fds[fd];
usr.bin/dig/lib/isc/unix/socket.c
1725
(void)unwatch_fd(manager, fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
1727
(void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
usr.bin/dig/lib/isc/unix/socket.c
1968
select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
2099
select_poke(sock->manager, sock->fd,
usr.bin/dig/lib/isc/unix/socket.c
2186
setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on,
usr.bin/dig/lib/isc/unix/socket.c
2189
"setsockopt(%d) %s", sock->fd, "failed");
usr.bin/dig/lib/isc/unix/socket.c
2192
if (bind(sock->fd, (struct sockaddr *)sockaddr, sockaddr->ss_len) < 0) {
usr.bin/dig/lib/isc/unix/socket.c
2252
cc = connect(sock->fd, (struct sockaddr *)addr, addr->ss_len);
usr.bin/dig/lib/isc/unix/socket.c
2329
select_poke(manager, sock->fd, SELECT_POKE_CONNECT);
usr.bin/dig/lib/isc/unix/socket.c
2380
if (getsockopt(sock->fd, SOL_SOCKET, SO_ERROR,
usr.bin/dig/lib/isc/unix/socket.c
2393
select_poke(sock->manager, sock->fd,
usr.bin/dig/lib/isc/unix/socket.c
272
watch_fd(isc_socketmgr_t *manager, int fd, int msg) {
usr.bin/dig/lib/isc/unix/socket.c
276
FD_SET(fd, manager->read_fds);
usr.bin/dig/lib/isc/unix/socket.c
278
FD_SET(fd, manager->write_fds);
usr.bin/dig/lib/isc/unix/socket.c
284
unwatch_fd(isc_socketmgr_t *manager, int fd, int msg) {
usr.bin/dig/lib/isc/unix/socket.c
288
FD_CLR(fd, manager->read_fds);
usr.bin/dig/lib/isc/unix/socket.c
290
FD_CLR(fd, manager->write_fds);
usr.bin/dig/lib/isc/unix/socket.c
296
wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) {
usr.bin/dig/lib/isc/unix/socket.c
305
INSIST(fd >= 0 && fd < (int)manager->maxsocks);
usr.bin/dig/lib/isc/unix/socket.c
309
INSIST(manager->fdstate[fd] == CLOSE_PENDING);
usr.bin/dig/lib/isc/unix/socket.c
310
manager->fdstate[fd] = CLOSED;
usr.bin/dig/lib/isc/unix/socket.c
311
(void)unwatch_fd(manager, fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
312
(void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
usr.bin/dig/lib/isc/unix/socket.c
313
(void)close(fd);
usr.bin/dig/lib/isc/unix/socket.c
317
if (manager->fdstate[fd] == CLOSE_PENDING) {
usr.bin/dig/lib/isc/unix/socket.c
324
(void)unwatch_fd(manager, fd, SELECT_POKE_READ);
usr.bin/dig/lib/isc/unix/socket.c
325
(void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
usr.bin/dig/lib/isc/unix/socket.c
328
if (manager->fdstate[fd] != MANAGED) {
usr.bin/dig/lib/isc/unix/socket.c
335
result = watch_fd(manager, fd, msg);
usr.bin/dig/lib/isc/unix/socket.c
345
fd, isc_result_totext(result));
usr.bin/dig/lib/isc/unix/socket.c
353
select_poke(isc_socketmgr_t *manager, int fd, int msg) {
usr.bin/dig/lib/isc/unix/socket.c
356
else if (fd >= 0)
usr.bin/dig/lib/isc/unix/socket.c
357
wakeup_socket(manager, fd, msg);
usr.bin/dig/lib/isc/unix/socket.c
365
make_nonblock(int fd) {
usr.bin/dig/lib/isc/unix/socket.c
369
flags = fcntl(fd, F_GETFL, 0);
usr.bin/dig/lib/isc/unix/socket.c
371
ret = fcntl(fd, F_SETFL, flags);
usr.bin/dig/lib/isc/unix/socket.c
375
"fcntl(%d, F_SETFL, %d): %s", fd, flags,
usr.bin/dig/lib/isc/unix/socket.c
634
if (setsockopt(sock->fd, IPPROTO_IP, IP_TOS,
usr.bin/dig/lib/isc/unix/socket.c
640
sock->fd, dscp >> 2,
usr.bin/dig/lib/isc/unix/socket.c
658
if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_TCLASS,
usr.bin/dig/lib/isc/unix/socket.c
663
sock->fd, dscp >> 2,
usr.bin/dig/lib/isc/unix/socket.c
845
cc = recvmsg(sock->fd, &msghdr, 0);
usr.bin/dig/lib/isc/unix/socket.c
855
sock->fd, cc, recv_errno,
usr.bin/doas/doas.c
246
int i, fd = -1;
usr.bin/doas/doas.c
249
fd = open("/dev/tty", O_RDWR);
usr.bin/doas/doas.c
250
if (fd != -1) {
usr.bin/doas/doas.c
251
if (ioctl(fd, TIOCCHKVERAUTH) == 0)
usr.bin/doas/doas.c
260
if (fd != -1) {
usr.bin/doas/doas.c
262
ioctl(fd, TIOCSETVERAUTH, &secs);
usr.bin/doas/doas.c
263
close(fd);
usr.bin/file/file.c
122
int opt, pair[2], fd, idx;
usr.bin/file/file.c
223
fd = prepare_message(&msg, idx, argv[idx]);
usr.bin/file/file.c
224
send_message(&ibuf, &msg, sizeof msg, fd);
usr.bin/file/file.c
247
int fd, mode, error;
usr.bin/file/file.c
276
fd = open(path, O_RDONLY|O_NONBLOCK);
usr.bin/file/file.c
277
if (fd == -1 && (errno == ENFILE || errno == EMFILE))
usr.bin/file/file.c
280
fd = -1;
usr.bin/file/file.c
283
return (fd);
usr.bin/file/file.c
288
send_message(struct imsgbuf *ibuf, void *msg, size_t msglen, int fd)
usr.bin/file/file.c
290
if (imsg_compose(ibuf, -1, -1, 0, fd, msg, msglen) != 1)
usr.bin/file/file.c
363
child(int fd, pid_t parent, int argc, char **argv)
usr.bin/file/file.c
405
if (imsgbuf_init(&ibuf, fd) == -1)
usr.bin/file/file.c
423
inf.fd = imsg_get_fd(&imsg);
usr.bin/file/file.c
427
if (inf.fd != -1)
usr.bin/file/file.c
428
close(inf.fd);
usr.bin/file/file.c
438
fill_buffer(int fd, size_t size, size_t *used)
usr.bin/file/file.c
451
got = read(fd, next, left);
usr.bin/file/file.c
481
inf->base = mmap(NULL, inf->size, PROT_READ, MAP_PRIVATE, inf->fd, 0);
usr.bin/file/file.c
488
inf->base = fill_buffer(inf->fd, inf->size, &used);
usr.bin/file/file.c
583
if (inf->fd != -1)
usr.bin/file/file.c
65
int fd;
usr.bin/find/function.c
679
int status, fd;
usr.bin/find/function.c
684
if ((fd = open(".", O_RDONLY)) == -1) {
usr.bin/find/function.c
689
(void) close(fd);
usr.bin/find/function.c
718
if (fchdir(fd) == -1) {
usr.bin/find/function.c
720
(void) close(fd);
usr.bin/find/function.c
723
(void) close(fd);
usr.bin/finger/util.c
189
static int opened, fd;
usr.bin/finger/util.c
195
fd = open(_PATH_LASTLOG, O_RDONLY);
usr.bin/finger/util.c
198
if (fd == -1 ||
usr.bin/finger/util.c
199
pread(fd, &ll, sizeof(ll), (off_t)pn->uid * sizeof(ll)) !=
usr.bin/ftp/fetch.c
1005
ftp_close(&fin, &tls, &fd);
usr.bin/ftp/fetch.c
1128
ftp_close(&fin, &tls, &fd);
usr.bin/ftp/fetch.c
1674
ftp_close(FILE **fin, struct tls **tls, int *fd)
usr.bin/ftp/fetch.c
1689
if (*fd != -1) {
usr.bin/ftp/fetch.c
1690
close(*fd);
usr.bin/ftp/fetch.c
1691
*fd = -1;
usr.bin/ftp/fetch.c
184
int fd, out = -1, rval = -1, save_errno;
usr.bin/ftp/fetch.c
194
fd = open(path, O_RDONLY);
usr.bin/ftp/fetch.c
195
if (fd == -1) {
usr.bin/ftp/fetch.c
200
if (fstat(fd, &st) == -1)
usr.bin/ftp/fetch.c
254
while ((len = read(fd, buf, buflen)) > 0) {
usr.bin/ftp/fetch.c
296
close(fd);
usr.bin/ftp/fetch.c
318
int fd = -1, out = -1;
usr.bin/ftp/fetch.c
565
fd = -1;
usr.bin/ftp/fetch.c
573
fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
usr.bin/ftp/fetch.c
574
if (fd == -1) {
usr.bin/ftp/fetch.c
582
close(fd);
usr.bin/ftp/fetch.c
583
fd = -1;
usr.bin/ftp/fetch.c
588
if (bind(fd, ares->ai_addr, ares->ai_addrlen) == -1) {
usr.bin/ftp/fetch.c
590
close(fd);
usr.bin/ftp/fetch.c
592
fd = -1;
usr.bin/ftp/fetch.c
599
error = timed_connect(fd, res->ai_addr, res->ai_addrlen,
usr.bin/ftp/fetch.c
603
close(fd);
usr.bin/ftp/fetch.c
605
fd = -1;
usr.bin/ftp/fetch.c
619
proxy_connect(fd, sslhost, proxy_credentials);
usr.bin/ftp/fetch.c
628
if (fd < 0) {
usr.bin/ftp/fetch.c
654
if (tls_connect_socket(tls, fd, sslhost) != 0) {
usr.bin/ftp/fetch.c
668
fin = fdopen(fd, "r+");
usr.bin/ftp/fetch.c
669
fd = -1;
usr.bin/ftp/fetch.c
672
fin = fdopen(fd, "r+");
usr.bin/ftp/fetch.c
673
fd = -1;
usr.bin/ftp/fetch.c
960
ftp_close(&fin, &tls, &fd);
usr.bin/ftp/ftp.c
1921
pfd[0].fd = fileno(cin);
usr.bin/ftp/ftp.c
1948
pfd[0].fd = fileno(cin);
usr.bin/ftp/ftp.c
2052
pfd[0].fd = fileno(cin);
usr.bin/ftp/ftp.c
2056
pfd[1].fd = fileno(din);
usr.bin/ftp/util.c
1113
pfd.fd = s;
usr.bin/ftp/util.c
371
int oldverbose, oldhash, fd;
usr.bin/ftp/util.c
406
if ((fd = mkstemp(temp)) == -1) {
usr.bin/ftp/util.c
410
close(fd);
usr.bin/gencat/gencat.c
113
void MCParse(int fd);
usr.bin/gencat/gencat.c
114
void MCWriteCat(int fd);
usr.bin/gencat/gencat.c
223
get_line(int fd)
usr.bin/gencat/gencat.c
247
buflen = read(fd, buf, BUFSIZ);
usr.bin/gencat/gencat.c
290
getmsg(int fd, char *cptr, char quote)
usr.bin/gencat/gencat.c
326
cptr = get_line(fd);
usr.bin/gencat/gencat.c
404
MCParse(int fd)
usr.bin/gencat/gencat.c
413
while ((cptr = get_line(fd))) {
usr.bin/gencat/gencat.c
477
str = getmsg(fd, cptr, quote);
usr.bin/gencat/gencat.c
494
MCWriteCat(int fd)
usr.bin/gencat/gencat.c
591
write(fd, msgcat, msgcat_size);
usr.bin/gprof/elf.c
50
int fd;
usr.bin/gprof/elf.c
63
if ((fd = open(filename, O_RDONLY)) == -1)
usr.bin/gprof/elf.c
65
if (read(fd, &h, sizeof h) != sizeof h || !IS_ELF(h)) {
usr.bin/gprof/elf.c
66
close(fd);
usr.bin/gprof/elf.c
69
if (fstat(fd, &s) == -1)
usr.bin/gprof/elf.c
71
if ((mapbase = mmap(0, s.st_size, PROT_READ, MAP_SHARED, fd, 0)) ==
usr.bin/gprof/elf.c
74
close(fd);
usr.bin/grep/file.c
101
if (fd == STDIN_FILENO)
usr.bin/grep/file.c
104
snprintf(fname, sizeof fname, "(fd %d)", fd);
usr.bin/grep/file.c
106
if (fstat(fd, &sb) == -1)
usr.bin/grep/file.c
118
f->noseek = lseek(fd, 0L, SEEK_SET) == -1;
usr.bin/grep/file.c
119
if ((f->gzf = gzdopen(fd, "r")) != NULL)
usr.bin/grep/file.c
123
f->noseek = isatty(fd);
usr.bin/grep/file.c
126
if (!f->noseek && (f->mmf = mmopen(fd, &sb)) != NULL) {
usr.bin/grep/file.c
132
if ((f->f = fdopen(fd, "r")) != NULL)
usr.bin/grep/file.c
143
int fd;
usr.bin/grep/file.c
147
if ((fd = open(fname, O_RDONLY)) == -1)
usr.bin/grep/file.c
150
f = grep_fdopen(fd);
usr.bin/grep/file.c
152
close(fd);
usr.bin/grep/file.c
96
grep_fdopen(int fd)
usr.bin/grep/grep.h
106
int fd;
usr.bin/grep/grep.h
111
mmf_t *mmopen(int fd, struct stat *sb);
usr.bin/grep/grep.h
119
file_t *grep_fdopen(int fd);
usr.bin/grep/mmfile.c
44
mmopen(int fd, struct stat *st)
usr.bin/grep/mmfile.c
52
mmf->fd = fd;
usr.bin/grep/mmfile.c
53
mmf->base = mmap(NULL, mmf->len, PROT_READ, MAP_PRIVATE, mmf->fd, (off_t)0);
usr.bin/grep/mmfile.c
70
close(mmf->fd);
usr.bin/htpasswd/htpasswd.c
168
if ((fd = mkstemp(tmpl)) == -1)
usr.bin/htpasswd/htpasswd.c
171
if ((out = fdopen(fd, "w+")) == NULL)
usr.bin/htpasswd/htpasswd.c
53
int c, fd, loginlen, batch = 0;
usr.bin/kdump/kdump.c
1603
atfd(int fd)
usr.bin/kdump/kdump.c
1605
if (fd == AT_FDCWD)
usr.bin/kdump/kdump.c
1608
pdecint(fd);
usr.bin/kdump/ktrstruct.c
340
int fd;
usr.bin/kdump/ktrstruct.c
346
memcpy(&fd, &data[i * sizeof(fd)], sizeof(fd));
usr.bin/kdump/ktrstruct.c
347
printf("%d%s", fd, i < count - 1 ? ", " : "");
usr.bin/kdump/ktrstruct.c
491
printf(" { fd=%d, events=", pfd.fd);
usr.bin/kstat/kstat.c
160
int fd;
usr.bin/kstat/kstat.c
188
fd = open(DEV_KSTAT, O_RDONLY);
usr.bin/kstat/kstat.c
189
if (fd == -1)
usr.bin/kstat/kstat.c
192
if (ioctl(fd, KSTATIOC_VERSION, &version) == -1)
usr.bin/kstat/kstat.c
195
kstat_list(&kt, fd, version, &kfs);
usr.bin/kstat/kstat.c
196
kstat_read(&kt, fd);
usr.bin/kstat/kstat.c
218
kstat_read(&kt, fd);
usr.bin/kstat/kstat.c
525
kstat_list(struct kstat_tree *kt, int fd, unsigned int version,
usr.bin/kstat/kstat.c
542
if (ioctl(fd, KSTATIOC_NFIND_ID, ksreq) == -1) {
usr.bin/kstat/kstat.c
599
kstat_read(struct kstat_tree *kt, int fd)
usr.bin/kstat/kstat.c
607
if (ioctl(fd, KSTATIOC_FIND_ID, ksreq) == -1)
usr.bin/ktrace/ktrace.c
180
if ((fd = open(tracefile, O_CREAT | O_WRONLY, DEFFILEMODE)) == -1)
usr.bin/ktrace/ktrace.c
182
if (fstat(fd, &sb) != 0 || sb.st_uid != getuid())
usr.bin/ktrace/ktrace.c
188
if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY,
usr.bin/ktrace/ktrace.c
193
(void)close(fd);
usr.bin/ktrace/ktrace.c
64
int append, ch, fd, inherit, ops, pidset, trpoints;
usr.bin/ldap/aldap.c
112
if (tls_connect_socket(ldap->tls, ldap->fd, name) == -1) {
usr.bin/ldap/aldap.c
149
wrote = write(ldap->fd, data + done, len);
usr.bin/ldap/aldap.c
370
ret = read(ldap->fd, rbuf, sizeof(rbuf));
usr.bin/ldap/aldap.c
76
close(al->fd);
usr.bin/ldap/aldap.c
85
aldap_init(int fd)
usr.bin/ldap/aldap.c
92
a->fd = fd;
usr.bin/ldap/aldap.h
44
int fd;
usr.bin/ldap/ldapclient.c
492
int ret = -1, saved_errno, fd = -1, code;
usr.bin/ldap/ldapclient.c
506
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1 ||
usr.bin/ldap/ldapclient.c
507
connect(fd, (struct sockaddr *)&un, sizeof(un)) == -1)
usr.bin/ldap/ldapclient.c
522
for (res = res0; res; res = res->ai_next, fd = -1) {
usr.bin/ldap/ldapclient.c
523
if ((fd = socket(res->ai_family, res->ai_socktype,
usr.bin/ldap/ldapclient.c
527
if (connect(fd, res->ai_addr, res->ai_addrlen) >= 0)
usr.bin/ldap/ldapclient.c
531
close(fd);
usr.bin/ldap/ldapclient.c
535
if (fd == -1)
usr.bin/ldap/ldapclient.c
539
if ((ldap->ldap_al = aldap_init(fd)) == NULL) {
usr.bin/ldap/ldapclient.c
541
close(fd);
usr.bin/less/lesskey.c
548
fputbytes(FILE *fd, char *buf, int len)
usr.bin/less/lesskey.c
551
(void) fwrite(buf, sizeof (char), 1, fd);
usr.bin/less/lesskey.c
560
fputint(FILE *fd, unsigned int val)
usr.bin/less/lesskey.c
570
(void) fwrite(&c, sizeof (char), 1, fd);
usr.bin/less/lesskey.c
572
(void) fwrite(&c, sizeof (char), 1, fd);
usr.bin/less/os.c
35
iread(int fd, unsigned char *buf, unsigned int len)
usr.bin/less/os.c
41
n = read(fd, buf, len);
usr.bin/less/output.c
81
int fd;
usr.bin/less/output.c
88
fd = (any_display) ? STDOUT_FILENO : STDERR_FILENO;
usr.bin/less/output.c
89
nwritten = write(fd, obuf, n);
usr.bin/locate/locate/locate.c
199
int fd;
usr.bin/locate/locate/locate.c
205
if ((fd = open(path_fcodes, O_RDONLY)) == -1 ||
usr.bin/locate/locate/locate.c
206
fstat(fd, &sb) == -1)
usr.bin/locate/locate/locate.c
213
fd, (off_t)0)) == MAP_FAILED)
usr.bin/locate/locate/locate.c
234
(void)close(fd);
usr.bin/login/failedlogin.c
100
if (read(fd, (char *)&failedlogin, sizeof(failedlogin)) ==
usr.bin/login/failedlogin.c
129
(void)lseek(fd, (off_t)uid * sizeof(failedlogin),
usr.bin/login/failedlogin.c
131
(void)write(fd, (char *)&failedlogin,
usr.bin/login/failedlogin.c
134
(void)close(fd);
usr.bin/login/failedlogin.c
55
int fd;
usr.bin/login/failedlogin.c
58
if ((fd = open(_PATH_FAILEDLOGIN, O_RDWR)) >= 0) {
usr.bin/login/failedlogin.c
59
(void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET);
usr.bin/login/failedlogin.c
62
if (read(fd, (char *)&failedlogin, sizeof(failedlogin)) !=
usr.bin/login/failedlogin.c
66
(void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET);
usr.bin/login/failedlogin.c
79
(void)write(fd, (char *)&failedlogin, sizeof(failedlogin));
usr.bin/login/failedlogin.c
80
(void)close(fd);
usr.bin/login/failedlogin.c
94
int fd, was_bad = 0;
usr.bin/login/failedlogin.c
98
if ((fd = open(_PATH_FAILEDLOGIN, O_RDWR)) >= 0) {
usr.bin/login/failedlogin.c
99
(void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET);
usr.bin/login/login.c
798
int fd, nchars;
usr.bin/login/login.c
803
if ((fd = open(motd, O_RDONLY)) == -1)
usr.bin/login/login.c
813
while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0 &&
usr.bin/login/login.c
818
(void)close(fd);
usr.bin/login/login.c
842
int fd;
usr.bin/login/login.c
844
if ((fd = open(_PATH_LASTLOG, O_RDWR)) >= 0) {
usr.bin/login/login.c
847
if (pread(fd, &ll, sizeof(ll), pos) == sizeof(ll) &&
usr.bin/login/login.c
866
(void)pwrite(fd, &ll, sizeof(ll), pos);
usr.bin/login/login.c
867
(void)close(fd);
usr.bin/look/look.c
118
if ((fd = open(file, O_RDONLY)) == -1 || fstat(fd, &sb) == -1)
usr.bin/look/look.c
127
(size_t)sb.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t)0)) == MAP_FAILED)
usr.bin/look/look.c
77
int ch, fd, termchar;
usr.bin/m4/eval.c
394
int fd;
usr.bin/m4/eval.c
399
fd = mkstemp(temp);
usr.bin/m4/eval.c
400
if (fd == -1)
usr.bin/m4/eval.c
404
close(fd);
usr.bin/m4/eval.c
814
int fd;
usr.bin/m4/eval.c
829
if ((fd = mkstemp(fname)) == -1 ||
usr.bin/m4/eval.c
831
(outfile[n] = fdopen(fd, "w+")) == NULL)
usr.bin/mail/collect.c
460
int fd;
usr.bin/mail/collect.c
468
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
469
(nf = Fdopen(fd, "w+")) == NULL) {
usr.bin/mail/collect.c
60
int lc, cc, fd, c, t, lastlong, rc, sig;
usr.bin/mail/collect.c
78
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
79
(collf = Fdopen(fd, "w+")) == NULL) {
usr.bin/mail/fio.c
53
myread(int fd, char *buf, int len)
usr.bin/mail/fio.c
57
while ((nread = read(fd, buf, len)) == -1 && errno == EINTR)
usr.bin/mail/lex.c
127
if ((fd = mkostemp(tempname, O_CLOEXEC)) == -1 ||
usr.bin/mail/lex.c
128
(otf = fdopen(fd, "w")) == NULL)
usr.bin/mail/lex.c
58
int i, fd;
usr.bin/mail/names.c
235
int fd;
usr.bin/mail/names.c
240
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/names.c
241
(fout = Fdopen(fd, "a")) == NULL) {
usr.bin/mail/popen.c
78
Fdopen(int fd, char *mode)
usr.bin/mail/popen.c
82
if ((fp = fdopen(fd, mode)) != NULL) {
usr.bin/mail/quit.c
113
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
114
(rbuf = Fdopen(fd, "w")) == NULL)
usr.bin/mail/quit.c
195
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
196
(obuf = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/quit.c
412
int fd;
usr.bin/mail/quit.c
416
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
417
(obuf = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/quit.c
419
if (fd != -1)
usr.bin/mail/quit.c
420
close(fd);
usr.bin/mail/quit.c
69
int c, fd;
usr.bin/mail/send.c
468
int c, fd;
usr.bin/mail/send.c
473
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/send.c
474
(nfo = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/v7.local.c
74
int fd;
usr.bin/mail/v7.local.c
77
fd = open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600);
usr.bin/mail/v7.local.c
78
if (fd != -1)
usr.bin/mail/v7.local.c
79
close(fd);
usr.bin/make/engine.c
219
int fd;
usr.bin/make/engine.c
222
fd = open(name, O_RDWR | O_CREAT, 0666);
usr.bin/make/engine.c
223
if (fd < 0)
usr.bin/make/engine.c
229
if (read(fd, &c, 1) == 1) {
usr.bin/make/engine.c
230
(void)lseek(fd, 0, SEEK_SET);
usr.bin/make/engine.c
231
(void)write(fd, &c, 1);
usr.bin/make/engine.c
234
(void)close(fd);
usr.bin/make/stats.c
140
int fd;
usr.bin/make/stats.c
145
while ((fd = open(name, O_RDWR)) == -1) {
usr.bin/make/stats.c
161
if (fd) {
usr.bin/make/stats.c
163
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
usr.bin/mandoc/cgi.c
357
int fd;
usr.bin/mandoc/cgi.c
359
if ((fd = open(filename, O_RDONLY)) == -1)
usr.bin/mandoc/cgi.c
365
while ((sz = read(fd, buf, sizeof(buf))) > 0)
usr.bin/mandoc/cgi.c
367
close(fd);
usr.bin/mandoc/cgi.c
902
int fd;
usr.bin/mandoc/cgi.c
905
if (-1 == (fd = open(file, O_RDONLY))) {
usr.bin/mandoc/cgi.c
915
mparse_readfd(mp, fd, file);
usr.bin/mandoc/cgi.c
916
close(fd);
usr.bin/mandoc/main.c
1000
close(fd);
usr.bin/mandoc/main.c
1140
passthrough(int fd, int synopsis_only)
usr.bin/mandoc/main.c
1159
if ((stream = fdopen(fd, "r")) == NULL) {
usr.bin/mandoc/main.c
1160
close(fd);
usr.bin/mandoc/main.c
948
int fd;
usr.bin/mandoc/main.c
952
if ((fd = mparse_open(mp, resp->file)) == -1) {
usr.bin/mandoc/main.c
960
fd = STDIN_FILENO;
usr.bin/mandoc/main.c
969
parse(mp, fd, resp->file, outst, conf, startdir);
usr.bin/mandoc/main.c
971
passthrough(fd, conf->output.synopsisonly);
usr.bin/mandoc/main.c
989
parse(struct mparse *mp, int fd, const char *file,
usr.bin/mandoc/main.c
994
assert(fd >= 0);
usr.bin/mandoc/main.c
998
mparse_readfd(mp, fd, file);
usr.bin/mandoc/main.c
999
if (fd != STDIN_FILENO)
usr.bin/mandoc/mandocdb.c
1140
int fd;
usr.bin/mandoc/mandocdb.c
1153
if ((fd = mparse_open(mp, mlink->file)) == -1) {
usr.bin/mandoc/mandocdb.c
1163
mparse_readfd(mp, fd, mlink->file);
usr.bin/mandoc/mandocdb.c
1164
close(fd);
usr.bin/mandoc/mandocdb.c
1165
fd = -1;
usr.bin/mandoc/mandocdb.c
1238
parse_cat(mpage, fd);
usr.bin/mandoc/mandocdb.c
1269
parse_cat(struct mpage *mpage, int fd)
usr.bin/mandoc/mandocdb.c
1279
stream = fd == -1 ? fopen(mlink->file, "r") : fdopen(fd, "r");
usr.bin/mandoc/mandocdb.c
1281
if (fd != -1)
usr.bin/mandoc/mandocdb.c
1282
close(fd);
usr.bin/mandoc/read.c
159
int fd;
usr.bin/mandoc/read.c
386
if ((fd = mparse_open(curp, ln.buf + of)) != -1) {
usr.bin/mandoc/read.c
387
mparse_readfd(curp, fd, ln.buf + of);
usr.bin/mandoc/read.c
388
close(fd);
usr.bin/mandoc/read.c
438
read_whole_file(struct mparse *curp, int fd, struct buf *fb, int *with_mmap)
usr.bin/mandoc/read.c
446
if (fstat(fd, &st) == -1) {
usr.bin/mandoc/read.c
465
fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0);
usr.bin/mandoc/read.c
478
if ((fd = dup(fd)) == -1) {
usr.bin/mandoc/read.c
483
if ((gz = gzdopen(fd, "rb")) == NULL) {
usr.bin/mandoc/read.c
486
close(fd);
usr.bin/mandoc/read.c
512
read(fd, fb->buf + (int)off, fb->sz - off);
usr.bin/mandoc/read.c
557
mparse_readfd(struct mparse *curp, int fd, const char *filename)
usr.bin/mandoc/read.c
578
if (read_whole_file(curp, fd, &blk, &with_mmap) == -1)
usr.bin/mandoc/read.c
630
int fd, save_errno;
usr.bin/mandoc/read.c
637
if ((fd = open(file, O_RDONLY)) != -1)
usr.bin/mandoc/read.c
638
return fd;
usr.bin/mandoc/read.c
648
fd = open(cp, O_RDONLY);
usr.bin/mandoc/read.c
651
if (fd != -1) {
usr.bin/mandoc/read.c
653
return fd;
usr.bin/mg/fileio.c
101
int fd;
usr.bin/mg/fileio.c
107
fd = open(fn, O_RDWR | O_CREAT | O_TRUNC, fmode);
usr.bin/mg/fileio.c
108
if (fd == -1) {
usr.bin/mg/fileio.c
115
if ((*ffp = fdopen(fd, "w")) == NULL) {
usr.bin/mg/fileio.c
118
close(fd);
usr.bin/mg/fileio.c
130
fchmod(fd, bp->b_fi.fi_mode & 07777);
usr.bin/mg/fileio.c
131
fchown(fd, bp->b_fi.fi_uid, bp->b_fi.fi_gid);
usr.bin/mg/log.c
391
mglogfiles_create(FILE ** fd, char *mglogfile)
usr.bin/mg/log.c
404
if ((*fd = fopen(tmp2, "w")) == NULL)
usr.bin/mg/region.c
588
iomux(int fd, char* const text, int len)
usr.bin/mg/region.c
595
fcntl(fd, F_SETFL, O_NONBLOCK);
usr.bin/mg/region.c
596
pfd[0].fd = fd;
usr.bin/mg/region.c
603
shutdown(fd, SHUT_WR);
usr.bin/mg/region.c
611
pwriteout(fd, &textcopy, &len);
usr.bin/mg/region.c
613
if (preadin(fd) == FALSE)
usr.bin/mg/region.c
618
close(fd);
usr.bin/mg/region.c
637
pwriteout(int fd, char **text, int *len)
usr.bin/mg/region.c
641
if (((w = send(fd, *text, *len, MSG_NOSIGNAL)) == -1)) {
usr.bin/mg/region.c
654
shutdown(fd, SHUT_WR);
usr.bin/mg/region.c
661
preadin(int fd)
usr.bin/mg/region.c
666
if ((len = read(fd, buf, BUFSIZ)) <= 0)
usr.bin/mg/tags.c
263
FILE *fd;
usr.bin/mg/tags.c
265
if ((fd = fopen(fn, "r")) == NULL) {
usr.bin/mg/tags.c
270
if (fstat(fileno(fd), &sb) == -1) {
usr.bin/mg/tags.c
273
fclose(fd);
usr.bin/mg/tags.c
279
fclose(fd);
usr.bin/mg/tags.c
282
while ((l = fparseln(fd, NULL, NULL, "\\\\\0",
usr.bin/mg/tags.c
285
fclose(fd);
usr.bin/mg/tags.c
289
fclose(fd);
usr.bin/mg/ttyio.c
222
pfd[0].fd = 0;
usr.bin/mixerctl/mixerctl.c
164
rdfield(int fd, struct field *p, char *q, int quiet, char *sep)
usr.bin/mixerctl/mixerctl.c
225
if (ioctl(fd, AUDIO_MIXER_WRITE, p->valp) == -1) {
usr.bin/mixerctl/mixerctl.c
228
if (ioctl(fd, AUDIO_MIXER_READ, p->valp) == -1) {
usr.bin/mixerctl/mixerctl.c
244
int fd, i, j, ch, pos;
usr.bin/mixerctl/mixerctl.c
293
if ((fd = open(file, O_WRONLY)) == -1)
usr.bin/mixerctl/mixerctl.c
298
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) == -1)
usr.bin/mixerctl/mixerctl.c
313
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &infos[i]) == -1) {
usr.bin/mixerctl/mixerctl.c
331
if (ioctl(fd, AUDIO_MIXER_READ, &values[i]) == -1) {
usr.bin/mixerctl/mixerctl.c
333
if (ioctl(fd, AUDIO_MIXER_READ, &values[i]) == -1)
usr.bin/mixerctl/mixerctl.c
382
rdfield(fd, p, q, qflag, sep);
usr.bin/mktemp/mktemp.c
124
if ((fd = mkstemps(tempfile, suffixlen)) == -1)
usr.bin/mktemp/mktemp.c
126
(void)close(fd);
usr.bin/mktemp/mktemp.c
37
int ch, fd, uflag = 0, tflag = 0, makedir = 0;
usr.bin/nc/atomicio.c
39
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.bin/nc/atomicio.c
46
pfd.fd = fd;
usr.bin/nc/atomicio.c
49
res = (f) (fd, s + pos, n - pos);
usr.bin/nc/netcat.c
1013
pfd.fd = s;
usr.bin/nc/netcat.c
1120
pfd[POLL_STDIN].fd = stdin_fd;
usr.bin/nc/netcat.c
1124
pfd[POLL_NETOUT].fd = net_fd;
usr.bin/nc/netcat.c
1128
pfd[POLL_NETIN].fd = net_fd;
usr.bin/nc/netcat.c
1132
pfd[POLL_STDOUT].fd = stdout_fd;
usr.bin/nc/netcat.c
1137
if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 &&
usr.bin/nc/netcat.c
1141
if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1)
usr.bin/nc/netcat.c
1144
if (lflag && pfd[POLL_NETIN].fd == -1 &&
usr.bin/nc/netcat.c
1168
pfd[n].fd = -1;
usr.bin/nc/netcat.c
1175
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1180
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1183
if (pfd[POLL_NETOUT].fd != -1 && Nflag)
usr.bin/nc/netcat.c
1184
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
usr.bin/nc/netcat.c
1185
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1189
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1191
if (pfd[POLL_NETOUT].fd == -1)
usr.bin/nc/netcat.c
1192
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1194
if (pfd[POLL_STDOUT].fd == -1) {
usr.bin/nc/netcat.c
1195
if (pfd[POLL_NETIN].fd != -1)
usr.bin/nc/netcat.c
1196
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
usr.bin/nc/netcat.c
1197
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1202
ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf,
usr.bin/nc/netcat.c
1209
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1219
ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf,
usr.bin/nc/netcat.c
1226
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1236
ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf,
usr.bin/nc/netcat.c
1243
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1246
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
usr.bin/nc/netcat.c
1247
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1250
if (pfd[POLL_NETIN].fd != -1)
usr.bin/nc/netcat.c
1251
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
usr.bin/nc/netcat.c
1252
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1253
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1262
if (pfd[POLL_NETIN].fd != -1 && tflag)
usr.bin/nc/netcat.c
1263
atelnet(pfd[POLL_NETIN].fd, netinbuf,
usr.bin/nc/netcat.c
1268
ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf,
usr.bin/nc/netcat.c
1275
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1285
if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) {
usr.bin/nc/netcat.c
1286
if (pfd[POLL_NETOUT].fd != -1 && Nflag)
usr.bin/nc/netcat.c
1287
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
usr.bin/nc/netcat.c
1288
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1291
if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) {
usr.bin/nc/netcat.c
1292
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1298
drainbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls)
usr.bin/nc/netcat.c
1303
if (fd == -1)
usr.bin/nc/netcat.c
1311
n = write(fd, buf, *bufpos);
usr.bin/nc/netcat.c
1327
fillbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls)
usr.bin/nc/netcat.c
1332
if (fd == -1)
usr.bin/nc/netcat.c
1340
n = read(fd, buf + *bufpos, num);
usr.bin/nc/netcat.c
1391
pfd.fd = STDOUT_FILENO;
usr.bin/nc/netcat.c
791
pfd.fd = s;
usr.bin/nc/socks.c
91
proxy_read_line(int fd, char *buf, size_t bufsz)
usr.bin/nc/socks.c
98
if (atomicio(read, fd, buf + off, 1) != 1)
usr.bin/newsyslog/newsyslog.c
953
int fd;
usr.bin/newsyslog/newsyslog.c
971
if ((fd = mkstemp(file2)) == -1)
usr.bin/newsyslog/newsyslog.c
973
if (fchmod(fd, ent->permissions))
usr.bin/newsyslog/newsyslog.c
975
if (fchown(fd, ent->uid, ent->gid))
usr.bin/newsyslog/newsyslog.c
977
(void)close(fd);
usr.bin/nm/util.h
16
} else if (pread(fd, ptr, len, off) != len) { \
usr.bin/nm/util.h
8
#define MMAP(ptr, len, prot, flags, fd, off) do { \
usr.bin/nm/util.h
9
if ((ptr = mmap(NULL, len, prot, flags, fd, off)) == MAP_FAILED) { \
usr.bin/nohup/nohup.c
108
int fd;
usr.bin/nohup/nohup.c
113
if ((fd = open(p, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0)
usr.bin/nohup/nohup.c
120
if ((fd = open(p = path, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0)
usr.bin/nohup/nohup.c
126
(void)lseek(fd, (off_t)0, SEEK_END);
usr.bin/nohup/nohup.c
127
if (dup2(fd, STDOUT_FILENO) == -1)
usr.bin/nohup/nohup.c
129
if (fd > STDERR_FILENO)
usr.bin/nohup/nohup.c
130
(void)close(fd);
usr.bin/openssl/ocsp.c
1464
int fd;
usr.bin/openssl/ocsp.c
1481
if (BIO_get_fd(cbio, &fd) < 0) {
usr.bin/openssl/ocsp.c
1486
pfd[0].fd = fd;
usr.bin/openssl/ocsp.c
1524
pfd[0].fd = fd;
usr.bin/openssl/s_client.c
1384
pfd[0].fd = -1;
usr.bin/openssl/s_client.c
1385
pfd[1].fd = -1;
usr.bin/openssl/s_client.c
1389
pfd[0].fd = fileno(stdin);
usr.bin/openssl/s_client.c
1393
pfd[1].fd = fileno(stdout);
usr.bin/openssl/s_client.c
1398
pfd[2].fd = SSL_get_fd(con);
usr.bin/openssl/s_server.c
1570
pfd[0].fd = fileno(stdin);
usr.bin/openssl/s_server.c
1572
pfd[1].fd = s;
usr.bin/openssl/s_time.c
356
pfd[0].fd = SSL_get_fd(scon);
usr.bin/openssl/speed.c
2746
int fd[2];
usr.bin/openssl/speed.c
2757
if (pipe(fd) == -1) {
usr.bin/openssl/speed.c
2764
close(fd[1]);
usr.bin/openssl/speed.c
2765
fds[n] = fd[0];
usr.bin/openssl/speed.c
2767
close(fd[0]);
usr.bin/openssl/speed.c
2769
if (dup(fd[1]) == -1) {
usr.bin/openssl/speed.c
2773
close(fd[1]);
usr.bin/patch/inp.c
149
int fd;
usr.bin/patch/inp.c
162
if ((fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0666)) != -1)
usr.bin/patch/inp.c
163
close(fd);
usr.bin/patch/patch.c
149
int error = 0, hunk, failed, i, fd;
usr.bin/patch/patch.c
178
if ((fd = mkstemp(TMPOUTNAME)) == -1)
usr.bin/patch/patch.c
180
close(fd);
usr.bin/patch/patch.c
184
if ((fd = mkstemp(TMPINNAME)) == -1)
usr.bin/patch/patch.c
186
close(fd);
usr.bin/patch/patch.c
190
if ((fd = mkstemp(TMPREJNAME)) == -1)
usr.bin/patch/patch.c
192
close(fd);
usr.bin/patch/patch.c
196
if ((fd = mkstemp(TMPPATNAME)) == -1)
usr.bin/patch/patch.c
198
close(fd);
usr.bin/pctr/pctr.c
338
int fd, se;
usr.bin/pctr/pctr.c
340
fd = open(_PATH_PCTR, O_RDONLY);
usr.bin/pctr/pctr.c
341
if (fd == -1)
usr.bin/pctr/pctr.c
343
if (ioctl(fd, PCIOCRD, st) == -1) {
usr.bin/pctr/pctr.c
345
close(fd);
usr.bin/pctr/pctr.c
349
return (close(fd));
usr.bin/pctr/pctr.c
355
int fd, se;
usr.bin/pctr/pctr.c
357
fd = open(_PATH_PCTR, O_WRONLY);
usr.bin/pctr/pctr.c
358
if (fd == -1)
usr.bin/pctr/pctr.c
360
if (ioctl(fd, PCIOCS0 + ctr, &val) == -1) {
usr.bin/pctr/pctr.c
362
close(fd);
usr.bin/pctr/pctr.c
366
return (close(fd));
usr.bin/quota/quota.c
529
int fd, qcmd;
usr.bin/quota/quota.c
536
if ((fd = open(qfpathname, O_RDONLY)) < 0) {
usr.bin/quota/quota.c
540
(void)lseek(fd, (off_t)(id * sizeof(struct dqblk)), SEEK_SET);
usr.bin/quota/quota.c
541
switch (read(fd, &qup->dqblk, sizeof(struct dqblk))) {
usr.bin/quota/quota.c
553
close(fd);
usr.bin/quota/quota.c
556
close(fd);
usr.bin/radioctl/radioctl.c
242
do_ioctls(int fd, struct opt_t *o, int silent)
usr.bin/radioctl/radioctl.c
246
if (fd < 0 || o == NULL)
usr.bin/radioctl/radioctl.c
263
if (ioctl(fd, RIOCSSRCH, &o->value) == -1) {
usr.bin/radioctl/radioctl.c
271
if (ioctl(fd, RIOCSINFO, &ri) == -1) {
usr.bin/radioctl/radioctl.c
278
if (ioctl(fd, RIOCGINFO, &ri) == -1) {
usr.bin/rcs/buf.c
100
if (fstat(fd, &st) == -1)
usr.bin/rcs/buf.c
110
ret = read(fd, bp, len);
usr.bin/rcs/buf.c
126
if (fd != -1) {
usr.bin/rcs/buf.c
131
(void)close(fd);
usr.bin/rcs/buf.c
248
buf_write_fd(BUF *b, int fd)
usr.bin/rcs/buf.c
258
ret = write(fd, bp, len);
usr.bin/rcs/buf.c
279
int fd;
usr.bin/rcs/buf.c
281
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
usr.bin/rcs/buf.c
288
if (buf_write_fd(b, fd) == -1) {
usr.bin/rcs/buf.c
293
if (fchmod(fd, mode) == -1)
usr.bin/rcs/buf.c
296
(void)close(fd);
usr.bin/rcs/buf.c
309
int fd;
usr.bin/rcs/buf.c
311
if ((fd = mkstemp(template)) == -1)
usr.bin/rcs/buf.c
316
if (buf_write_fd(b, fd) == -1) {
usr.bin/rcs/buf.c
321
(void)close(fd);
usr.bin/rcs/buf.c
88
int fd;
usr.bin/rcs/buf.c
97
if ((fd = open(path, O_RDONLY)) == -1)
usr.bin/rcs/ci.c
113
int fd;
usr.bin/rcs/ci.c
254
fd = rcs_choosefile(pb.filename, pb.fpath, sizeof(pb.fpath));
usr.bin/rcs/ci.c
256
if (fd < 0) {
usr.bin/rcs/ci.c
270
(void)close(fd);
usr.bin/rcs/ci.c
277
pb.file = rcs_open(pb.fpath, fd, pb.openflags, pb.fmode);
usr.bin/rcs/co.c
157
fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
usr.bin/rcs/co.c
158
if (fd < 0) {
usr.bin/rcs/co.c
171
(void)close(fd);
usr.bin/rcs/co.c
175
if ((file = rcs_open(fpath, fd,
usr.bin/rcs/co.c
247
int fd, lcount;
usr.bin/rcs/co.c
472
if ((fd = open(dst, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1)
usr.bin/rcs/co.c
475
if (buf_write_fd(bp, fd) < 0) {
usr.bin/rcs/co.c
478
(void)close(fd);
usr.bin/rcs/co.c
482
if (fchmod(fd, mode) == -1)
usr.bin/rcs/co.c
49
int fd, i, ch, flags, kflag, ret;
usr.bin/rcs/co.c
490
if (futimes(fd, (const struct timeval *)&tv) == -1)
usr.bin/rcs/co.c
494
(void)close(fd);
usr.bin/rcs/diff.c
432
prepare(int i, FILE *fd, off_t filesize, int flags)
usr.bin/rcs/diff.c
438
rewind(fd);
usr.bin/rcs/diff.c
445
for (j = 0; (h = readhash(fd, flags));) {
usr.bin/rcs/diff.c
846
preadline(int fd, size_t rlen, off_t off)
usr.bin/rcs/diff.c
852
if ((nr = pread(fd, line, rlen, off)) == -1)
usr.bin/rcs/rcs.c
109
if (fd == -1)
usr.bin/rcs/rcs.c
111
else if ((rfp->rf_file = fdopen(fd, "r")) == NULL)
usr.bin/rcs/rcs.c
215
int fd;
usr.bin/rcs/rcs.c
228
if ((fd = mkstemp(fn)) == -1)
usr.bin/rcs/rcs.c
231
if ((fp = fdopen(fd, "w+")) == NULL) {
usr.bin/rcs/rcs.c
85
rcs_open(const char *path, int fd, int flags, ...)
usr.bin/rcs/rcsclean.c
136
int fd, match;
usr.bin/rcs/rcsclean.c
147
if ((fd = rcs_choosefile(fname, fpath, sizeof(fpath))) < 0)
usr.bin/rcs/rcsclean.c
150
if ((file = rcs_open(fpath, fd, RCS_RDWR)) == NULL)
usr.bin/rcs/rcsdiff.c
213
fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
usr.bin/rcs/rcsdiff.c
214
if (fd < 0) {
usr.bin/rcs/rcsdiff.c
219
if ((file = rcs_open(fpath, fd,
usr.bin/rcs/rcsdiff.c
274
int ret, fd;
usr.bin/rcs/rcsdiff.c
293
if ((fd = open(filename, O_RDONLY)) == -1) {
usr.bin/rcs/rcsdiff.c
319
if (fstat(fd, &st) == -1)
usr.bin/rcs/rcsdiff.c
349
if (fd != -1)
usr.bin/rcs/rcsdiff.c
350
(void)close(fd);
usr.bin/rcs/rcsdiff.c
51
int fd, i, ch, dflags, status;
usr.bin/rcs/rcsmerge.c
121
if ((fd = rcs_choosefile(argv[0], fpath, sizeof(fpath))) < 0)
usr.bin/rcs/rcsmerge.c
127
if ((file = rcs_open(fpath, fd, RCS_READ)) == NULL)
usr.bin/rcs/rcsmerge.c
40
int fd, ch, flags, kflag, status;
usr.bin/rcs/rcsprog.c
184
int fd;
usr.bin/rcs/rcsprog.c
315
fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
usr.bin/rcs/rcsprog.c
316
if (fd < 0 && !(flags & RCS_CREATE)) {
usr.bin/rcs/rcsprog.c
324
if ((file = rcs_open(fpath, fd, flags, fmode)) == NULL) {
usr.bin/rcs/rcsprog.c
325
close(fd);
usr.bin/rcs/rcsutil.c
154
int fd;
usr.bin/rcs/rcsutil.c
205
fd = open(rcspath, O_RDONLY);
usr.bin/rcs/rcsutil.c
206
return (fd);
usr.bin/rcs/rcsutil.c
221
if ((fd = open(rcspath, O_RDONLY)) == -1)
usr.bin/rcs/rcsutil.c
224
if (fstat(fd, &sb) == -1)
usr.bin/rcs/rcsutil.c
231
return (fd);
usr.bin/rcs/rcsutil.c
246
if ((fd = open(fpath, O_RDONLY)) == -1)
usr.bin/rcs/rcsutil.c
249
if (fstat(fd, &sb) == -1)
usr.bin/rcs/rcsutil.c
256
return (fd);
usr.bin/rcs/rcsutil.c
271
fd = open(rcspath, O_RDONLY);
usr.bin/rcs/rcsutil.c
273
return (fd);
usr.bin/rcs/rlog.c
166
fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
usr.bin/rcs/rlog.c
167
if (fd < 0) {
usr.bin/rcs/rlog.c
173
if ((file = rcs_open(fpath, fd,
usr.bin/rcs/rlog.c
80
int i, ch, fd, status;
usr.bin/rdist/child.c
432
setnonblocking(int fd)
usr.bin/rdist/child.c
436
if ((flags = fcntl(fd, F_GETFL)) == -1)
usr.bin/rdist/child.c
440
return (fcntl(fd, F_SETFL, flags | O_NONBLOCK));
usr.bin/rdist/common.c
315
remread(int fd, u_char *buf, size_t bufsiz)
usr.bin/rdist/common.c
317
return(read(fd, (char *)buf, bufsiz));
usr.bin/rdist/common.c
675
int fd[2], status;
usr.bin/rdist/common.c
677
if (pipe(fd) == -1) {
usr.bin/rdist/common.c
690
(void) dup(fd[PIPE_WRITE]);
usr.bin/rdist/common.c
691
(void) dup(fd[PIPE_WRITE]);
usr.bin/rdist/common.c
692
(void) close(fd[PIPE_READ]);
usr.bin/rdist/common.c
693
(void) close(fd[PIPE_WRITE]);
usr.bin/rdist/common.c
697
(void) close(fd[PIPE_WRITE]);
usr.bin/rdist/common.c
700
while ((nread = read(fd[PIPE_READ], buf, sizeof(buf))) > 0) {
usr.bin/rdist/common.c
738
(void) close(fd[PIPE_READ]);
usr.bin/rdist/common.c
88
xwrite(int fd, void *buf, size_t len)
usr.bin/rdist/common.c
95
if ((nwritten = write(fd, ptr, nleft)) <= 0) {
usr.bin/rdist/docmd.c
118
if ((fd = open(file, O_RDONLY)) == -1) {
usr.bin/rdist/docmd.c
122
if (fstat(fd, &stb) == -1) {
usr.bin/rdist/docmd.c
124
(void) close(fd);
usr.bin/rdist/docmd.c
128
(void) close(fd);
usr.bin/rdist/docmd.c
142
(void) close(fd);
usr.bin/rdist/docmd.c
179
while ((len = read(fd, buf, sizeof(buf))) > 0)
usr.bin/rdist/docmd.c
183
(void) close(fd);
usr.bin/rdist/docmd.c
94
int fd;
usr.bin/rdist/isexec.c
46
int fd, r;
usr.bin/rdist/isexec.c
55
if ((fd = open(file, O_RDONLY)) == -1)
usr.bin/rdist/isexec.c
58
r = read(fd, &hdr, sizeof(hdr)) == sizeof(hdr) &&
usr.bin/rdist/isexec.c
60
close(fd);
usr.bin/rdist/message.c
448
int fd;
usr.bin/rdist/message.c
461
if ((fd = mkstemp(msgfac->mf_filename)) == -1 ||
usr.bin/rdist/message.c
462
(msgfac->mf_fptr = fdopen(fd, "w")) == NULL)
usr.bin/rdistd/server.c
107
setownership(char *file, int fd, uid_t uid, gid_t gid, int islink)
usr.bin/rdistd/server.c
128
if (fd != -1 && !islink)
usr.bin/rdistd/server.c
129
status = fchown(fd, uid, gid);
usr.bin/rdistd/server.c
151
setfilemode(char *file, int fd, int mode, int islink)
usr.bin/rdistd/server.c
161
if (fd != -1 && !islink)
usr.bin/rdistd/server.c
162
status = fchmod(fd, mode);
usr.bin/rdistd/server.c
178
fchog(int fd, char *file, char *owner, char *group, int mode)
usr.bin/rdistd/server.c
260
if (setownership(file, fd, uid, gid, S_ISLNK(st.st_mode)) < 0) {
usr.bin/rdistd/server.c
272
(void) setfilemode(file, fd, mode, S_ISLNK(st.st_mode));
usr.bin/rsync/blocks.c
355
blk_recv(struct sess *sess, int fd, const char *path)
usr.bin/rsync/blocks.c
374
if (!io_read_size(sess, fd, &s->blksz)) {
usr.bin/rsync/blocks.c
377
} else if (!io_read_size(sess, fd, &s->len)) {
usr.bin/rsync/blocks.c
380
} else if (!io_read_size(sess, fd, &s->csum)) {
usr.bin/rsync/blocks.c
383
} else if (!io_read_size(sess, fd, &s->rem)) {
usr.bin/rsync/blocks.c
411
if (!io_read_int(sess, fd, &i)) {
usr.bin/rsync/blocks.c
419
fd, b->chksum_long, s->csum)) {
usr.bin/rsync/blocks.c
454
blk_send_ack(struct sess *sess, int fd, struct blkset *p)
usr.bin/rsync/blocks.c
467
if (!io_read_buf(sess, fd, buf, sz)) {
usr.bin/rsync/blocks.c
495
blk_send(struct sess *sess, int fd, size_t idx,
usr.bin/rsync/blocks.c
531
if (!io_write_buf(sess, fd, buf, sz)) {
usr.bin/rsync/client.c
37
rsync_client(const struct opts *opts, int fd, const struct fargs *f)
usr.bin/rsync/client.c
52
if (!io_write_int(&sess, fd, sess.lver)) {
usr.bin/rsync/client.c
55
} else if (!io_read_int(&sess, fd, &sess.rver)) {
usr.bin/rsync/client.c
58
} else if (!io_read_int(&sess, fd, &sess.seed)) {
usr.bin/rsync/client.c
83
if (!rsync_sender(&sess, fd, fd, f->sourcesz,
usr.bin/rsync/client.c
91
if (!rsync_receiver(&sess, fd, fd, f->sink)) {
usr.bin/rsync/client.c
99
if (io_read_check(&sess, fd))
usr.bin/rsync/downloader.c
126
p->fd = -1;
usr.bin/rsync/downloader.c
156
if (p->fd != -1) {
usr.bin/rsync/downloader.c
157
close(p->fd);
usr.bin/rsync/downloader.c
160
p->fd = -1;
usr.bin/rsync/downloader.c
259
if ((ssz = write(p->fd, p->obuf, p->obufsz)) < 0) {
usr.bin/rsync/downloader.c
275
if ((ssz = write(p->fd, buf, sz)) < 0) {
usr.bin/rsync/downloader.c
422
if ((p->fd = mkstempat(p->rootfd, p->fname)) == -1) {
usr.bin/rsync/downloader.c
452
assert(p->fd != -1);
usr.bin/rsync/downloader.c
556
if (!rsync_set_metadata(sess, 1, p->fd, f, p->fname)) {
usr.bin/rsync/downloader.c
59
int fd; /* open output file */
usr.bin/rsync/extern.h
212
int fd; /* descriptor girding the map */
usr.bin/rsync/flist.c
430
flist_recv_name(struct sess *sess, int fd, struct flist *f, uint8_t flags,
usr.bin/rsync/flist.c
446
if (!io_read_byte(sess, fd, &bval)) {
usr.bin/rsync/flist.c
456
if (!io_read_size(sess, fd, &pathlen)) {
usr.bin/rsync/flist.c
461
if (!io_read_byte(sess, fd, &bval)) {
usr.bin/rsync/flist.c
485
if (!io_read_buf(sess, fd, f->path + partial, pathlen)) {
usr.bin/rsync/flist.c
589
flist_recv(struct sess *sess, int fd, struct flist **flp, size_t *sz)
usr.bin/rsync/flist.c
605
if (!io_read_byte(sess, fd, &flag)) {
usr.bin/rsync/flist.c
621
if (!flist_recv_name(sess, fd, ff, flag, last)) {
usr.bin/rsync/flist.c
628
if (!io_read_long(sess, fd, &lval)) {
usr.bin/rsync/flist.c
637
if (!io_read_uint(sess, fd, &uival)) {
usr.bin/rsync/flist.c
650
if (!io_read_uint(sess, fd, &uival)) {
usr.bin/rsync/flist.c
664
if (!io_read_uint(sess, fd, &uival)) {
usr.bin/rsync/flist.c
679
if (!io_read_uint(sess, fd, &uival)) {
usr.bin/rsync/flist.c
697
if (!io_read_int(sess, fd, &ival)) {
usr.bin/rsync/flist.c
712
if (!io_read_size(sess, fd, &lsz)) {
usr.bin/rsync/flist.c
724
if (!io_read_buf(sess, fd, ff->link, lsz)) {
usr.bin/rsync/flist.c
743
if (!idents_recv(sess, fd, &uids, &uidsz)) {
usr.bin/rsync/flist.c
751
if (!idents_recv(sess, fd, &gids, &gidsz)) {
usr.bin/rsync/ids.c
231
int fd, const struct ident *ids, size_t idsz)
usr.bin/rsync/ids.c
240
if (!io_write_uint(sess, fd, ids[i].id)) {
usr.bin/rsync/ids.c
243
} else if (!io_write_byte(sess, fd, sz)) {
usr.bin/rsync/ids.c
246
} else if (!io_write_buf(sess, fd, ids[i].name, sz)) {
usr.bin/rsync/ids.c
252
if (!io_write_int(sess, fd, 0)) {
usr.bin/rsync/ids.c
268
int fd, struct ident **ids, size_t *idsz)
usr.bin/rsync/ids.c
275
if (!io_read_uint(sess, fd, &id)) {
usr.bin/rsync/ids.c
296
if (!io_read_byte(sess, fd, &sz)) {
usr.bin/rsync/ids.c
309
if (!io_read_buf(sess, fd, (*ids)[*idsz].name, sz)) {
usr.bin/rsync/io.c
106
io_write_blocking(int fd, const void *buf, size_t sz)
usr.bin/rsync/io.c
112
c = io_write_nonblocking(fd, buf, sz, &wsz);
usr.bin/rsync/io.c
133
io_write_buf(struct sess *sess, int fd, const void *buf, size_t sz)
usr.bin/rsync/io.c
140
c = io_write_blocking(fd, buf, sz);
usr.bin/rsync/io.c
149
if (!io_write_blocking(fd, &tagbuf, sizeof(tagbuf))) {
usr.bin/rsync/io.c
153
if (!io_write_blocking(fd, buf, wsz)) {
usr.bin/rsync/io.c
170
io_write_line(struct sess *sess, int fd, const char *line)
usr.bin/rsync/io.c
173
if (!io_write_buf(sess, fd, line, strlen(line)))
usr.bin/rsync/io.c
175
else if (!io_write_byte(sess, fd, '\n'))
usr.bin/rsync/io.c
188
io_read_nonblocking(int fd, void *buf, size_t bsz, size_t *sz)
usr.bin/rsync/io.c
199
pfd.fd = fd;
usr.bin/rsync/io.c
220
if ((rsz = read(fd, buf, bsz)) == -1) {
usr.bin/rsync/io.c
239
io_read_blocking(int fd, void *buf, size_t sz)
usr.bin/rsync/io.c
245
c = io_read_nonblocking(fd, buf, sz, &rsz);
usr.bin/rsync/io.c
272
io_read_flush(struct sess *sess, int fd)
usr.bin/rsync/io.c
287
if (!io_read_blocking(fd, &tagbuf, sizeof(tagbuf))) {
usr.bin/rsync/io.c
305
if (!io_read_blocking(fd, mpbuf, sess->mplex_read_remain)) {
usr.bin/rsync/io.c
339
io_read_buf(struct sess *sess, int fd, void *buf, size_t sz)
usr.bin/rsync/io.c
348
c = io_read_blocking(fd, buf, sz);
usr.bin/rsync/io.c
36
io_read_check(int fd)
usr.bin/rsync/io.c
364
if (!io_read_blocking(fd, buf, rsz)) {
usr.bin/rsync/io.c
376
if (!io_read_flush(sess, fd)) {
usr.bin/rsync/io.c
390
io_write_ulong(struct sess *sess, int fd, uint64_t val)
usr.bin/rsync/io.c
398
if (!io_write_int(sess, fd, (int32_t)val)) {
usr.bin/rsync/io.c
40
pfd.fd = fd;
usr.bin/rsync/io.c
409
if (!io_write_int(sess, fd, -1))
usr.bin/rsync/io.c
411
else if (!io_write_buf(sess, fd, &nv, sizeof(int64_t)))
usr.bin/rsync/io.c
420
io_write_long(struct sess *sess, int fd, int64_t val)
usr.bin/rsync/io.c
422
return io_write_ulong(sess, fd, (uint64_t)val);
usr.bin/rsync/io.c
430
io_write_uint(struct sess *sess, int fd, uint32_t val)
usr.bin/rsync/io.c
436
if (!io_write_buf(sess, fd, &nv, sizeof(uint32_t))) {
usr.bin/rsync/io.c
448
io_write_int(struct sess *sess, int fd, int32_t val)
usr.bin/rsync/io.c
450
return io_write_uint(sess, fd, (uint32_t)val);
usr.bin/rsync/io.c
557
io_read_long(struct sess *sess, int fd, int64_t *val)
usr.bin/rsync/io.c
56
io_write_nonblocking(int fd, const void *buf, size_t bsz,
usr.bin/rsync/io.c
561
if (!io_read_ulong(sess, fd, &uoval)) {
usr.bin/rsync/io.c
578
io_read_ulong(struct sess *sess, int fd, uint64_t *val)
usr.bin/rsync/io.c
585
if (!io_read_int(sess, fd, &sval)) {
usr.bin/rsync/io.c
596
if (!io_read_buf(sess, fd, &oval, sizeof(uint64_t))) {
usr.bin/rsync/io.c
613
io_read_size(struct sess *sess, int fd, size_t *val)
usr.bin/rsync/io.c
617
if (!io_read_int(sess, fd, &oval)) {
usr.bin/rsync/io.c
634
io_read_uint(struct sess *sess, int fd, uint32_t *val)
usr.bin/rsync/io.c
638
if (!io_read_buf(sess, fd, &oval, sizeof(uint32_t))) {
usr.bin/rsync/io.c
648
io_read_int(struct sess *sess, int fd, int32_t *val)
usr.bin/rsync/io.c
650
return io_read_uint(sess, fd, (uint32_t *)val);
usr.bin/rsync/io.c
68
pfd.fd = fd;
usr.bin/rsync/io.c
703
io_read_byte(struct sess *sess, int fd, uint8_t *val)
usr.bin/rsync/io.c
706
if (!io_read_buf(sess, fd, val, sizeof(uint8_t))) {
usr.bin/rsync/io.c
718
io_write_byte(struct sess *sess, int fd, uint8_t val)
usr.bin/rsync/io.c
721
if (!io_write_buf(sess, fd, &val, sizeof(uint8_t))) {
usr.bin/rsync/io.c
92
if ((wsz = write(fd, buf, bsz)) == -1) {
usr.bin/rsync/mktemp.c
129
fd = openat(pfd, path, flags, S_IRUSR|S_IWUSR);
usr.bin/rsync/mktemp.c
130
if (fd != -1 || errno != EEXIST)
usr.bin/rsync/mktemp.c
131
return(fd);
usr.bin/rsync/mktemp.c
183
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC |
usr.bin/rsync/mktemp.c
186
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) ==
usr.bin/rsync/mktemp.c
188
close(fd);
usr.bin/rsync/mktemp.c
192
close(fd);
usr.bin/rsync/mktemp.c
196
close(fd);
usr.bin/rsync/mktemp.c
212
mkstempat(int fd, char *path)
usr.bin/rsync/mktemp.c
214
return mktemp_internalat(fd, path, 0, MKTEMP_FILE, 0, NULL, 0, 0);
usr.bin/rsync/mktemp.c
224
mkstemplinkat(char *link, int fd, char *path)
usr.bin/rsync/mktemp.c
227
if (mktemp_internalat(fd, path, 0, MKTEMP_LINK, 0, link, 0, 0) == -1)
usr.bin/rsync/mktemp.c
239
mkstempfifoat(int fd, char *path)
usr.bin/rsync/mktemp.c
242
if (mktemp_internalat(fd, path, 0, MKTEMP_FIFO, 0, NULL, 0, 0) == -1)
usr.bin/rsync/mktemp.c
254
mkstempnodat(int fd, char *path, mode_t mode, dev_t dev)
usr.bin/rsync/mktemp.c
257
if (mktemp_internalat(fd, path, 0,
usr.bin/rsync/mktemp.c
84
int fd, saved_errno;
usr.bin/rsync/receiver.c
282
pfd[PFD_SENDER_IN].fd = fdin;
usr.bin/rsync/receiver.c
283
pfd[PFD_UPLOADER_IN].fd = -1;
usr.bin/rsync/receiver.c
284
pfd[PFD_DOWNLOADER_IN].fd = -1;
usr.bin/rsync/receiver.c
285
pfd[PFD_SENDER_OUT].fd = fdout;
usr.bin/rsync/receiver.c
354
&pfd[PFD_UPLOADER_IN].fd,
usr.bin/rsync/receiver.c
355
sess, &pfd[PFD_SENDER_OUT].fd);
usr.bin/rsync/receiver.c
374
&pfd[PFD_DOWNLOADER_IN].fd);
usr.bin/rsync/receiver.c
47
int fd, const struct flist *f, const char *path)
usr.bin/rsync/receiver.c
60
if (futimens(fd, ts) == -1) {
usr.bin/rsync/receiver.c
80
if (fchown(fd, uid, gid) == -1) {
usr.bin/rsync/receiver.c
96
if (fchmod(fd, mode) == -1) {
usr.bin/rsync/rules.c
341
send_rules(struct sess *sess, int fd)
usr.bin/rsync/rules.c
359
if (!io_write_int(sess, fd, cmdlen + len + postlen))
usr.bin/rsync/rules.c
361
if (!io_write_buf(sess, fd, cmd, cmdlen))
usr.bin/rsync/rules.c
363
if (!io_write_buf(sess, fd, r->pattern, len))
usr.bin/rsync/rules.c
367
if (!io_write_buf(sess, fd, postfix, postlen))
usr.bin/rsync/rules.c
371
if (!io_write_int(sess, fd, 0))
usr.bin/rsync/rules.c
376
recv_rules(struct sess *sess, int fd)
usr.bin/rsync/rules.c
382
if (!io_read_size(sess, fd, &len))
usr.bin/rsync/rules.c
389
if (!io_read_buf(sess, fd, line, len))
usr.bin/rsync/sender.c
203
assert(up->stat.fd != -1);
usr.bin/rsync/sender.c
247
assert(up->stat.fd != -1);
usr.bin/rsync/sender.c
284
int32_t idx, const struct flist *fl, size_t flsz, int fd)
usr.bin/rsync/sender.c
336
s->blks = blk_recv(sess, fd, fl[idx].path);
usr.bin/rsync/sender.c
380
up.stat.fd = -1;
usr.bin/rsync/sender.c
435
pfd[0].fd = -1; /* from receiver */
usr.bin/rsync/sender.c
437
pfd[1].fd = -1; /* to receiver */
usr.bin/rsync/sender.c
439
pfd[2].fd = -1; /* from local file */
usr.bin/rsync/sender.c
444
if (pfd[1].fd != -1 && wbufsz > 0)
usr.bin/rsync/sender.c
445
pfd[0].fd = -1;
usr.bin/rsync/sender.c
447
pfd[0].fd = fdin;
usr.bin/rsync/sender.c
522
assert(up.stat.fd != -1);
usr.bin/rsync/sender.c
527
if (fstat(up.stat.fd, &st) == -1) {
usr.bin/rsync/sender.c
542
MAP_SHARED, up.stat.fd, 0);
usr.bin/rsync/sender.c
549
pfd[2].fd = -1;
usr.bin/rsync/sender.c
550
pfd[1].fd = fdout;
usr.bin/rsync/sender.c
562
assert(pfd[2].fd == -1);
usr.bin/rsync/sender.c
585
assert(pfd[2].fd == -1);
usr.bin/rsync/sender.c
604
assert(pfd[2].fd == -1);
usr.bin/rsync/sender.c
605
assert(up.stat.fd == -1);
usr.bin/rsync/sender.c
609
pfd[1].fd = -1;
usr.bin/rsync/sender.c
633
pfd[1].fd = fdout;
usr.bin/rsync/sender.c
643
up.stat.fd = open(fl[up.cur->idx].path,
usr.bin/rsync/sender.c
645
if (up.stat.fd == -1) {
usr.bin/rsync/sender.c
649
pfd[2].fd = up.stat.fd;
usr.bin/rsync/sender.c
79
if (p->stat.fd != -1)
usr.bin/rsync/sender.c
80
close(p->stat.fd);
usr.bin/rsync/sender.c
82
p->stat.fd = -1;
usr.bin/rsync/server.c
30
fcntl_nonblock(int fd)
usr.bin/rsync/server.c
34
if ((fl = fcntl(fd, F_GETFL, 0)) == -1)
usr.bin/rsync/server.c
36
else if (fcntl(fd, F_SETFL, fl|O_NONBLOCK) == -1)
usr.bin/rsync/session.c
101
sess_stats_send(struct sess *sess, int fd)
usr.bin/rsync/session.c
113
if (!io_write_ulong(sess, fd, tr)) {
usr.bin/rsync/session.c
116
} else if (!io_write_ulong(sess, fd, tw)) {
usr.bin/rsync/session.c
119
} else if (!io_write_ulong(sess, fd, ts)) {
usr.bin/rsync/session.c
137
sess_stats_recv(struct sess *sess, int fd)
usr.bin/rsync/session.c
144
if (!io_read_ulong(sess, fd, &tw)) {
usr.bin/rsync/session.c
147
} else if (!io_read_ulong(sess, fd, &tr)) {
usr.bin/rsync/session.c
150
} else if (!io_read_ulong(sess, fd, &ts)) {
usr.bin/rsync/socket.c
107
pfd.fd = *sd;
usr.bin/rsync/symlinks.c
71
symlinkat_read(int fd, const char *path)
usr.bin/rsync/symlinks.c
86
if ((nsz = readlinkat(fd, path, buf, sz)) == -1) {
usr.bin/rusers/rusers.c
591
pfd[0].fd = sock[0];
usr.bin/rusers/rusers.c
593
pfd[1].fd = sock[1];
usr.bin/rwall/rwall.c
111
int fd;
usr.bin/rwall/rwall.c
115
if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+")))
usr.bin/rwall/rwall.c
145
if (fstat(fd, &sbuf))
usr.bin/rwall/rwall.c
152
(void)close(fd);
usr.bin/sdiff/edit.c
141
if ((fd = mkstemp(filename)) == -1)
usr.bin/sdiff/edit.c
148
if ((nwritten = write(fd, text, len)) == -1 ||
usr.bin/sdiff/edit.c
154
close(fd);
usr.bin/sdiff/edit.c
86
int fd;
usr.bin/sdiff/sdiff.c
161
int ch, fd[2], status;
usr.bin/sdiff/sdiff.c
312
if (pipe(fd))
usr.bin/sdiff/sdiff.c
319
close(fd[0]);
usr.bin/sdiff/sdiff.c
320
if (dup2(fd[1], STDOUT_FILENO) == -1)
usr.bin/sdiff/sdiff.c
323
close(fd[1]);
usr.bin/sdiff/sdiff.c
333
close(fd[1]);
usr.bin/sdiff/sdiff.c
336
if ((diffpipe = fdopen(fd[0], "r")) == NULL)
usr.bin/sed/compile.c
267
cmd->u.fd = -1;
usr.bin/sed/compile.c
270
else if ((cmd->u.fd = open(p,
usr.bin/sed/defs.h
85
int fd; /* File descriptor for w */
usr.bin/sed/main.c
346
int c, fd;
usr.bin/sed/main.c
405
if ((fd = mkstemp(tmpfname)) == -1)
usr.bin/sed/main.c
407
(void)fchown(fd, sb.st_uid, sb.st_gid);
usr.bin/sed/main.c
408
(void)fchmod(fd, sb.st_mode & ALLPERMS);
usr.bin/sed/main.c
409
if ((outfile = fdopen(fd, "w")) == NULL) {
usr.bin/sed/process.c
226
if (cp->u.fd == -1 && (cp->u.fd = open(cp->t,
usr.bin/sed/process.c
230
if ((size_t)write(cp->u.fd, ps, psl) != psl ||
usr.bin/sed/process.c
231
write(cp->u.fd, "\n", 1) != 1)
usr.bin/sed/process.c
626
if (cp->u.fd != -1 && close(cp->u.fd))
usr.bin/sed/process.c
628
cp->u.fd = -1;
usr.bin/sendbug/atomicio.c
39
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.bin/sendbug/atomicio.c
46
pfd.fd = fd;
usr.bin/sendbug/atomicio.c
49
res = (f) (fd, s + pos, n - pos);
usr.bin/sendbug/sendbug.c
121
if ((fd = mkstemp(tmppath)) == -1)
usr.bin/sendbug/sendbug.c
125
if ((fp = fdopen(fd, "w+")) == NULL)
usr.bin/sendbug/sendbug.c
154
if (fflush(fp) == EOF || fstat(fd, &sb) == -1 || fclose(fp) == EOF)
usr.bin/sendbug/sendbug.c
83
int ch, c, fd, ret = 1;
usr.bin/signify/signify.c
100
fd = dup(STDIN_FILENO);
usr.bin/signify/signify.c
101
if (fd == -1)
usr.bin/signify/signify.c
104
fd = open(fname, oflags, mode);
usr.bin/signify/signify.c
105
if (fd == -1)
usr.bin/signify/signify.c
109
if (fstat(fd, &sb) == -1 || S_ISDIR(sb.st_mode))
usr.bin/signify/signify.c
111
return fd;
usr.bin/signify/signify.c
157
int rv, fd;
usr.bin/signify/signify.c
159
fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);
usr.bin/signify/signify.c
160
if ((rv = read(fd, b64, sizeof(b64) - 1)) == -1)
usr.bin/signify/signify.c
165
close(fd);
usr.bin/signify/signify.c
175
int fd;
usr.bin/signify/signify.c
178
fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);
usr.bin/signify/signify.c
179
if (fstat(fd, &sb) == 0 && S_ISREG(sb.st_mode)) {
usr.bin/signify/signify.c
196
if ((x = read(fd, msg + msglen, space)) == -1)
usr.bin/signify/signify.c
205
close(fd);
usr.bin/signify/signify.c
212
writeall(int fd, const void *buf, size_t buflen, const char *filename)
usr.bin/signify/signify.c
217
if ((x = write(fd, buf, buflen)) == -1)
usr.bin/signify/signify.c
244
int fd;
usr.bin/signify/signify.c
246
fd = xopen(filename, O_CREAT|oflags|O_NOFOLLOW|O_WRONLY, mode);
usr.bin/signify/signify.c
248
writeall(fd, header, strlen(header), filename);
usr.bin/signify/signify.c
250
close(fd);
usr.bin/signify/signify.c
442
int fd;
usr.bin/signify/signify.c
449
fd = xopen(sigfile, O_CREAT|O_TRUNC|O_NOFOLLOW|O_WRONLY, 0666);
usr.bin/signify/signify.c
450
writeall(fd, sighdr, strlen(sighdr), sigfile);
usr.bin/signify/signify.c
453
writeall(fd, msg, msglen, sigfile);
usr.bin/signify/signify.c
454
close(fd);
usr.bin/signify/signify.c
578
int fd;
usr.bin/signify/signify.c
583
fd = xopen(msgfile, O_CREAT|O_TRUNC|O_NOFOLLOW|O_WRONLY, 0666);
usr.bin/signify/signify.c
584
writeall(fd, msg, msglen, msgfile);
usr.bin/signify/signify.c
586
close(fd);
usr.bin/signify/signify.c
94
int fd;
usr.bin/signify/signify.c
98
fd = dup(STDOUT_FILENO);
usr.bin/signify/zsig.c
56
readgz_header(struct gzheader *h, int fd)
usr.bin/signify/zsig.c
75
n = read(fd, buf+len, sz-len);
usr.bin/sndiod/fdpass.c
100
*(int *)CMSG_DATA(cmsg) = fd;
usr.bin/sndiod/fdpass.c
102
n = sendmsg(f->fd, &msg, 0);
usr.bin/sndiod/fdpass.c
115
f->file->name, cmd, num, mode, fd);
usr.bin/sndiod/fdpass.c
117
if (fd >= 0)
usr.bin/sndiod/fdpass.c
118
close(fd);
usr.bin/sndiod/fdpass.c
123
fdpass_recv(struct fdpass *f, int *cmd, int *num, int *mode, int *fd)
usr.bin/sndiod/fdpass.c
142
n = recvmsg(f->fd, &msg, MSG_WAITALL);
usr.bin/sndiod/fdpass.c
149
n = recvmsg(f->fd, &msg, MSG_WAITALL);
usr.bin/sndiod/fdpass.c
169
*fd = -1;
usr.bin/sndiod/fdpass.c
175
*fd = *(int *)CMSG_DATA(cmsg);
usr.bin/sndiod/fdpass.c
185
f->file->name, *cmd, *num, *mode, *fd);
usr.bin/sndiod/fdpass.c
208
int fd;
usr.bin/sndiod/fdpass.c
214
if (!fdpass_waitret(fdpass_peer, &fd))
usr.bin/sndiod/fdpass.c
216
if (fd < 0)
usr.bin/sndiod/fdpass.c
218
return sio_sun_fdopen(fd, mode, 1);
usr.bin/sndiod/fdpass.c
224
int fd;
usr.bin/sndiod/fdpass.c
230
if (!fdpass_waitret(fdpass_peer, &fd))
usr.bin/sndiod/fdpass.c
232
if (fd < 0)
usr.bin/sndiod/fdpass.c
234
return mio_rmidi_fdopen(fd, mode, 1);
usr.bin/sndiod/fdpass.c
240
int fd;
usr.bin/sndiod/fdpass.c
246
if (!fdpass_waitret(fdpass_peer, &fd))
usr.bin/sndiod/fdpass.c
248
if (fd < 0)
usr.bin/sndiod/fdpass.c
250
return sioctl_sun_fdopen(fd, mode, 1);
usr.bin/sndiod/fdpass.c
266
int cmd, num, mode, fd;
usr.bin/sndiod/fdpass.c
271
if (!fdpass_recv(f, &cmd, &num, &mode, &fd))
usr.bin/sndiod/fdpass.c
281
fd = sio_sun_getfd(d->path, mode, 1);
usr.bin/sndiod/fdpass.c
290
fd = mio_rmidi_getfd(p->path, mode, 1);
usr.bin/sndiod/fdpass.c
299
fd = sioctl_sun_getfd(d->path, mode, 1);
usr.bin/sndiod/fdpass.c
305
fdpass_send(f, FDPASS_RETURN, 0, 0, fd);
usr.bin/sndiod/fdpass.c
334
f->fd = sock;
usr.bin/sndiod/fdpass.c
344
close(f->fd);
usr.bin/sndiod/fdpass.c
353
pfd->fd = f->fd;
usr.bin/sndiod/fdpass.c
69
int fd;
usr.bin/sndiod/fdpass.c
73
fdpass_send(struct fdpass *f, int cmd, int num, int mode, int fd)
usr.bin/sndiod/fdpass.c
93
if (fd >= 0) {
usr.bin/sndiod/listen.c
152
f->fd = sock;
usr.bin/sndiod/listen.c
215
f->fd = s;
usr.bin/sndiod/listen.c
238
pfd->fd = f->fd;
usr.bin/sndiod/listen.c
262
while ((sock = accept(f->fd, &caddr, &caddrlen)) == -1) {
usr.bin/sndiod/listen.c
71
close(f->fd);
usr.bin/sndiod/listen.h
25
int fd;
usr.bin/sndiod/sock.c
1009
logx(3, "sock %d: GETPAR message", f->fd);
usr.bin/sndiod/sock.c
1013
logx(1, "sock %d: GETPAR, wrong state", f->fd);
usr.bin/sndiod/sock.c
1040
logx(3, "sock %d: SETVOL message", f->fd);
usr.bin/sndiod/sock.c
1044
logx(1, "sock %d: SETVOL, wrong state", f->fd);
usr.bin/sndiod/sock.c
1052
logx(1, "sock %d: SETVOL, volume out of range", f->fd);
usr.bin/sndiod/sock.c
1066
f->fd, m->u.ctlsub.desc, m->u.ctlsub.val);
usr.bin/sndiod/sock.c
1070
logx(1, "sock %d: CTLSUB, wrong state", f->fd);
usr.bin/sndiod/sock.c
1101
logx(3, "sock %d: CTLSET message", f->fd);
usr.bin/sndiod/sock.c
1105
logx(1, "sock %d: CTLSET, wrong state", f->fd);
usr.bin/sndiod/sock.c
1114
logx(1, "sock %d: CTLSET, wrong addr", f->fd);
usr.bin/sndiod/sock.c
1121
logx(1, "sock %d: CTLSET, bad value", f->fd);
usr.bin/sndiod/sock.c
1131
logx(3, "sock %d: AUTH message", f->fd);
usr.bin/sndiod/sock.c
1135
logx(1, "sock %d: AUTH, wrong state", f->fd);
usr.bin/sndiod/sock.c
1149
logx(3, "sock %d: HELLO message", f->fd);
usr.bin/sndiod/sock.c
1153
logx(1, "sock %d: HELLO, wrong state", f->fd);
usr.bin/sndiod/sock.c
1169
logx(3, "sock %d: BYE message", f->fd);
usr.bin/sndiod/sock.c
1173
logx(1, "sock %d: BYE, wrong state", f->fd);
usr.bin/sndiod/sock.c
1180
logx(1, "sock %d: 0x%x: unknown command in message", f->fd, cmd);
usr.bin/sndiod/sock.c
1204
logx(4, "sock %d: building MOVE message, delta = %d", f->fd, f->slot->delta);
usr.bin/sndiod/sock.c
1222
logx(4, "sock %d: building XRUN message", f->fd);
usr.bin/sndiod/sock.c
1242
"count = %d, rmax -> %d", f->fd, f->fillpending, f->rmax);
usr.bin/sndiod/sock.c
1255
logx(3, "sock %d: building SETVOL message, vol = %d", f->fd,
usr.bin/sndiod/sock.c
1293
logx(0, "sock %d: sock_buildmsg size == 0", f->fd);
usr.bin/sndiod/sock.c
1302
logx(4, "sock %d: building audio DATA message, size = %d", f->fd, size);
usr.bin/sndiod/sock.c
1314
logx(3, "sock %d: building STOP message", f->fd);
usr.bin/sndiod/sock.c
1388
logx(3, "sock %d: building control DATA message", f->fd);
usr.bin/sndiod/sock.c
1408
logx(3, "sock %d: building CTLSET message", f->fd);
usr.bin/sndiod/sock.c
1419
logx(3, "sock %d: building CTLSYNC message", f->fd);
usr.bin/sndiod/sock.c
1424
logx(4, "sock %d: no messages to build anymore, idling...", f->fd);
usr.bin/sndiod/sock.c
1437
logx(4, "sock %d: reading %u todo", f->fd, f->rtodo);
usr.bin/sndiod/sock.c
1457
logx(4, "sock %d: can't reply, write-end blocked", f->fd);
usr.bin/sndiod/sock.c
1467
logx(4, "sock %d: copied RRET message", f->fd);
usr.bin/sndiod/sock.c
1480
logx(4, "sock %d: writing", f->fd);
usr.bin/sndiod/sock.c
1510
logx(4, "sock %d: drained, moved to INIT state", f->fd);
usr.bin/sndiod/sock.c
1522
logx(4, "sock %d: copied RRET message", f->fd);
usr.bin/sndiod/sock.c
1531
logx(0, "sock %d: bad writing end state", f->fd);
usr.bin/sndiod/sock.c
1562
pfd->fd = f->fd;
usr.bin/sndiod/sock.c
163
logx(3, "sock %d: closing", f->fd);
usr.bin/sndiod/sock.c
194
close(f->fd);
usr.bin/sndiod/sock.c
312
sock_new(int fd)
usr.bin/sndiod/sock.c
338
f->fd = fd;
usr.bin/sndiod/sock.c
354
logx(3, "sock %d: exit", f->fd);
usr.bin/sndiod/sock.c
367
n = write(f->fd, data, count);
usr.bin/sndiod/sock.c
376
logx(1, "sock %d: write failed, errno = %d", f->fd, errno);
usr.bin/sndiod/sock.c
380
logx(4, "sock %d: write blocked", f->fd);
usr.bin/sndiod/sock.c
400
n = read(f->fd, data, count);
usr.bin/sndiod/sock.c
409
logx(1, "sock %d: read failed, errno = %d", f->fd, errno);
usr.bin/sndiod/sock.c
413
logx(4, "sock %d: read blocked", f->fd);
usr.bin/sndiod/sock.c
436
logx(0, "%s: sock %d: nothing to read", __func__, f->fd);
usr.bin/sndiod/sock.c
450
logx(4, "sock %d: read full message", f->fd);
usr.bin/sndiod/sock.c
466
logx(0, "%s: sock %d: already written", __func__, f->fd);
usr.bin/sndiod/sock.c
480
logx(4, "sock %d: wrote full message", f->fd);
usr.bin/sndiod/sock.c
497
logx(0, "%s: sock %d: data block already read", __func__, f->fd);
usr.bin/sndiod/sock.c
520
logx(4, "sock %d: read complete block", f->fd);
usr.bin/sndiod/sock.c
539
logx(0, "%s: sock %d: zero-sized data block", __func__, f->fd);
usr.bin/sndiod/sock.c
551
logx(4, "sock %d: zero-filled remaining block", f->fd);
usr.bin/sndiod/sock.c
584
logx(4, "sock %d: wrote complete block", f->fd);
usr.bin/sndiod/sock.c
607
logx(1, "sock %d: %d: bits out of bounds", f->fd, p->bits);
usr.bin/sndiod/sock.c
615
f->fd, p->bps);
usr.bin/sndiod/sock.c
659
logx(1, "sock %d: %u: bad xrun policy", f->fd, p->xrun);
usr.bin/sndiod/sock.c
694
if (getpeereid(f->fd, &euid, &egid) == 0 && euid == 0) {
usr.bin/sndiod/sock.c
729
f->fd, p->who, mode, p->version);
usr.bin/sndiod/sock.c
732
logx(1, "sock %d: %u: unsupported version", f->fd, p->version);
usr.bin/sndiod/sock.c
748
logx(1, "sock %d: %u: unsupported mode", f->fd, mode);
usr.bin/sndiod/sock.c
754
logx(1, "sock %d: malformed opt", f->fd);
usr.bin/sndiod/sock.c
760
logx(1, "sock %d: malformed program name", f->fd);
usr.bin/sndiod/sock.c
822
logx(2, "sock %d: unhandled device", f->fd);
usr.bin/sndiod/sock.c
827
logx(2, "sock %d: couldn't get ctlslot", f->fd);
usr.bin/sndiod/sock.c
859
logx(4, "sock %d: DATA message", f->fd);
usr.bin/sndiod/sock.c
863
logx(1, "sock %d: DATA, wrong state", f->fd);
usr.bin/sndiod/sock.c
871
logx(1, "sock %d: DATA, input-only mode", f->fd);
usr.bin/sndiod/sock.c
879
logx(1, "sock %d: zero size payload", f->fd);
usr.bin/sndiod/sock.c
886
logx(1, "sock %d: not aligned to frame", f->fd);
usr.bin/sndiod/sock.c
894
"not aligned to block", f->fd, size, f->ralign);
usr.bin/sndiod/sock.c
909
f->fd, size, f->rmax);
usr.bin/sndiod/sock.c
917
logx(1, "sock %d: zero-length data chunk", f->fd);
usr.bin/sndiod/sock.c
925
logx(3, "sock %d: START message", f->fd);
usr.bin/sndiod/sock.c
929
logx(1, "sock %d: START, wrong state", f->fd);
usr.bin/sndiod/sock.c
955
logx(3, "sock %d: STOP message", f->fd);
usr.bin/sndiod/sock.c
959
logx(1, "sock %d: STOP, wrong state", f->fd);
usr.bin/sndiod/sock.c
977
f->fd, size, f->ralign);
usr.bin/sndiod/sock.c
991
logx(3, "sock %d: SETPAR message", f->fd);
usr.bin/sndiod/sock.c
995
logx(1, "sock %d: SETPAR, wrong state", f->fd);
usr.bin/sndiod/sock.h
28
int fd;
usr.bin/sndiod/sock.h
75
struct sock *sock_new(int fd);
usr.bin/snmp/snmp.c
110
snmp_connect_v3(int fd, struct snmp_v3 *v3)
usr.bin/snmp/snmp.c
116
agent->fd = fd;
usr.bin/snmp/snmp.c
301
pfd.fd = agent->fd;
usr.bin/snmp/snmp.c
322
ret = send(agent->fd, message, len, MSG_DONTWAIT);
usr.bin/snmp/snmp.c
334
ret = recv(agent->fd, buf, sizeof(buf), MSG_DONTWAIT);
usr.bin/snmp/snmp.c
85
snmp_connect_v12(int fd, enum snmp_version version, const char *community)
usr.bin/snmp/snmp.c
95
agent->fd = fd;
usr.bin/snmp/snmp.h
146
int fd;
usr.bin/sort/file.c
166
int fd;
usr.bin/sort/file.c
169
if ((fd = mkstemp(ret)) == -1)
usr.bin/sort/file.c
171
close(fd);
usr.bin/sort/file.c
538
int fd;
usr.bin/sort/file.c
540
fd = open(fsrc, O_RDONLY);
usr.bin/sort/file.c
541
if (fd < 0)
usr.bin/sort/file.c
544
if (fstat(fd, &stat_buf) < 0)
usr.bin/sort/file.c
548
addr = mmap(NULL, sz, PROT_READ, 0, fd, 0);
usr.bin/sort/file.c
549
close(fd);
usr.bin/sort/sort.c
1018
int fd, i;
usr.bin/sort/sort.c
1029
if ((fd = mkstemp(outfile)) == -1)
usr.bin/sort/sort.c
1031
(void)fchown(fd, sb.st_uid, sb.st_gid);
usr.bin/sort/sort.c
1032
if (fchmod(fd, sb.st_mode & ACCESSPERMS) == -1)
usr.bin/sort/sort.c
1034
close(fd);
usr.bin/spell/spellprog.c
210
int fd;
usr.bin/spell/spellprog.c
284
wlists[i].fd = open(argv[i], O_RDONLY);
usr.bin/spell/spellprog.c
285
if (wlists[i].fd == -1 || fstat(wlists[i].fd, &sb) != 0)
usr.bin/spell/spellprog.c
290
MAP_PRIVATE, wlists[i].fd, (off_t)0);
usr.bin/spell/spellprog.c
295
wlists[i].fd = -1;
usr.bin/spell/spellprog.c
779
for (i = rval = 0; wlists[i].fd != -1; i++) {
usr.bin/ssh/atomicio.c
109
pfd.fd = fd;
usr.bin/ssh/atomicio.c
112
res = (f) (fd, iov, iovcnt);
usr.bin/ssh/atomicio.c
159
atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.bin/ssh/atomicio.c
162
return atomiciov6(f, fd, _iov, iovcnt, NULL, NULL);
usr.bin/ssh/atomicio.c
43
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
usr.bin/ssh/atomicio.c
51
pfd.fd = fd;
usr.bin/ssh/atomicio.c
54
res = (f) (fd, s + pos, n - pos);
usr.bin/ssh/atomicio.c
84
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.bin/ssh/atomicio.c
86
return atomicio6(f, fd, _s, n, NULL, NULL);
usr.bin/ssh/atomicio.c
93
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.bin/ssh/atomicio.h
38
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
usr.bin/ssh/atomicio.h
48
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.bin/ssh/auth-rhosts.c
60
int fd;
usr.bin/ssh/auth-rhosts.c
64
if ((fd = open(filename, O_RDONLY|O_NONBLOCK)) == -1)
usr.bin/ssh/auth-rhosts.c
66
if (fstat(fd, &st) == -1) {
usr.bin/ssh/auth-rhosts.c
67
close(fd);
usr.bin/ssh/auth-rhosts.c
73
close(fd);
usr.bin/ssh/auth-rhosts.c
76
unset_nonblock(fd);
usr.bin/ssh/auth-rhosts.c
77
if ((f = fdopen(fd, "r")) == NULL) {
usr.bin/ssh/auth-rhosts.c
78
close(fd);
usr.bin/ssh/auth2-pubkeyfile.c
459
int fd;
usr.bin/ssh/auth2-pubkeyfile.c
462
if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) {
usr.bin/ssh/auth2-pubkeyfile.c
473
if (fstat(fd, &st) == -1) {
usr.bin/ssh/auth2-pubkeyfile.c
474
close(fd);
usr.bin/ssh/auth2-pubkeyfile.c
480
close(fd);
usr.bin/ssh/auth2-pubkeyfile.c
483
unset_nonblock(fd);
usr.bin/ssh/auth2-pubkeyfile.c
484
if ((f = fdopen(fd, "r")) == NULL) {
usr.bin/ssh/auth2-pubkeyfile.c
485
close(fd);
usr.bin/ssh/auth2.c
108
int fd;
usr.bin/ssh/auth2.c
110
if ((fd = open(options.banner, O_RDONLY)) == -1)
usr.bin/ssh/auth2.c
112
if (fstat(fd, &st) == -1) {
usr.bin/ssh/auth2.c
113
close(fd);
usr.bin/ssh/auth2.c
117
close(fd);
usr.bin/ssh/auth2.c
123
n = atomicio(read, fd, banner, len);
usr.bin/ssh/auth2.c
124
close(fd);
usr.bin/ssh/authfile.c
109
int fd, r;
usr.bin/ssh/authfile.c
116
if ((fd = open(filename, O_RDONLY)) == -1)
usr.bin/ssh/authfile.c
119
r = sshkey_perm_ok(fd, filename);
usr.bin/ssh/authfile.c
123
r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp);
usr.bin/ssh/authfile.c
125
close(fd);
usr.bin/ssh/authfile.c
138
sshkey_load_private_type_fd(int fd, int type, const char *passphrase,
usr.bin/ssh/authfile.c
146
if ((r = sshbuf_load_fd(fd, &buffer)) != 0 ||
usr.bin/ssh/authfile.c
164
int r, fd;
usr.bin/ssh/authfile.c
169
if ((fd = open(filename, O_RDONLY)) == -1)
usr.bin/ssh/authfile.c
171
if ((r = sshbuf_load_fd(fd, &buffer)) != 0 ||
usr.bin/ssh/authfile.c
182
close(fd);
usr.bin/ssh/authfile.c
487
int fd, oerrno;
usr.bin/ssh/authfile.c
491
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
usr.bin/ssh/authfile.c
493
if ((f = fdopen(fd, "w")) == NULL) {
usr.bin/ssh/authfile.c
495
close(fd);
usr.bin/ssh/authfile.c
81
sshkey_perm_ok(int fd, const char *filename)
usr.bin/ssh/authfile.c
85
if (fstat(fd, &st) == -1)
usr.bin/ssh/authfile.h
45
int sshkey_load_private_type_fd(int fd, int type, const char *passphrase,
usr.bin/ssh/canohost.c
102
get_local_name(int fd)
usr.bin/ssh/canohost.c
107
if ((host = get_socket_address(fd, 0, NI_NAMEREQD)) != NULL)
usr.bin/ssh/channels.c
2735
pollfd_offset, pfd->fd, pfd->events, pfd->revents);
usr.bin/ssh/channels.c
2787
pfd[p].fd = c->rfd;
usr.bin/ssh/channels.c
2801
pfd[p].fd = c->wfd;
usr.bin/ssh/channels.c
2817
pfd[p].fd = c->efd;
usr.bin/ssh/channels.c
2833
pfd[p].fd = c->sock;
usr.bin/ssh/channels.c
2885
fd_ready(Channel *c, int p, struct pollfd *pfds, u_int npfd, int fd,
usr.bin/ssh/channels.c
2890
if (fd == -1)
usr.bin/ssh/channels.c
2895
if (pfd->fd != fd) {
usr.bin/ssh/channels.c
2897
"r%d w%d e%d s%d", c->self, what, fd, p, pfd->fd,
usr.bin/ssh/channels.c
2902
c->self, what, p, pfd->fd, c->rfd, c->wfd, c->efd, c->sock);
usr.bin/ssh/channels.c
2925
p, pfd[p].fd, pfd[p].revents);
usr.bin/ssh/channels.c
571
int ret, fd = *fdp;
usr.bin/ssh/channels.c
573
if (fd == -1)
usr.bin/ssh/channels.c
612
ret = close(fd);
usr.bin/ssh/clientloop.c
1872
int r, fd;
usr.bin/ssh/clientloop.c
1881
if ((fd = tun_open(local_tun, tun_mode, &ifname)) == -1) {
usr.bin/ssh/clientloop.c
1887
c = channel_new(ssh, "tun-connection", SSH_CHANNEL_OPENING, fd, fd, -1,
usr.bin/ssh/clientloop.c
707
(*pfdp)[0].fd = connection_in;
usr.bin/ssh/clientloop.c
709
(*pfdp)[1].fd = connection_out;
usr.bin/ssh/hostfile.c
619
int r, fd, oerrno = 0;
usr.bin/ssh/hostfile.c
650
if ((fd = mkstemp(temp)) == -1) {
usr.bin/ssh/hostfile.c
656
if ((ctx.out = fdopen(fd, "w")) == NULL) {
usr.bin/ssh/hostfile.c
658
close(fd);
usr.bin/ssh/log.c
277
int fd;
usr.bin/ssh/log.c
287
if ((fd = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0600)) == -1) {
usr.bin/ssh/log.c
292
log_stderr_fd = fd;
usr.bin/ssh/misc-agent.c
226
int fd, r;
usr.bin/ssh/misc-agent.c
238
if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.bin/ssh/misc-agent.c
242
set_nonblock(fd);
usr.bin/ssh/misc-agent.c
244
if (connect(fd, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) == -1) {
usr.bin/ssh/misc-agent.c
246
close(fd);
usr.bin/ssh/misc-agent.c
249
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &r, &l) == -1) {
usr.bin/ssh/misc-agent.c
251
close(fd);
usr.bin/ssh/misc-agent.c
256
close(fd);
usr.bin/ssh/misc-agent.c
259
close(fd);
usr.bin/ssh/misc.c
146
set_nonblock(int fd)
usr.bin/ssh/misc.c
1478
int fd = -1, sock;
usr.bin/ssh/misc.c
1490
fd = open(name, O_RDWR);
usr.bin/ssh/misc.c
1495
if ((fd = open(name, O_RDWR)) >= 0)
usr.bin/ssh/misc.c
150
val = fcntl(fd, F_GETFL);
usr.bin/ssh/misc.c
1503
if (fd == -1) {
usr.bin/ssh/misc.c
1508
debug_f("%s mode %d fd %d", name, mode, fd);
usr.bin/ssh/misc.c
152
error("fcntl(%d, F_GETFL): %s", fd, strerror(errno));
usr.bin/ssh/misc.c
1534
return fd;
usr.bin/ssh/misc.c
1537
if (fd >= 0)
usr.bin/ssh/misc.c
1538
close(fd);
usr.bin/ssh/misc.c
156
debug3("fd %d is O_NONBLOCK", fd);
usr.bin/ssh/misc.c
159
debug2("fd %d setting O_NONBLOCK", fd);
usr.bin/ssh/misc.c
161
if (fcntl(fd, F_SETFL, val) == -1) {
usr.bin/ssh/misc.c
162
debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd,
usr.bin/ssh/misc.c
170
unset_nonblock(int fd)
usr.bin/ssh/misc.c
174
val = fcntl(fd, F_GETFL);
usr.bin/ssh/misc.c
176
error("fcntl(%d, F_GETFL): %s", fd, strerror(errno));
usr.bin/ssh/misc.c
180
debug3("fd %d is not O_NONBLOCK", fd);
usr.bin/ssh/misc.c
183
debug("fd %d clearing O_NONBLOCK", fd);
usr.bin/ssh/misc.c
185
if (fcntl(fd, F_SETFL, val) == -1) {
usr.bin/ssh/misc.c
187
fd, strerror(errno));
usr.bin/ssh/misc.c
2024
int fd;
usr.bin/ssh/misc.c
2026
if ((fd = open(_PATH_TTY, O_RDONLY | O_NOCTTY)) >= 0) {
usr.bin/ssh/misc.c
2027
close(fd);
usr.bin/ssh/misc.c
203
set_nodelay(int fd)
usr.bin/ssh/misc.c
209
if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
usr.bin/ssh/misc.c
214
debug2("fd %d is TCP_NODELAY", fd);
usr.bin/ssh/misc.c
218
debug2("fd %d setting TCP_NODELAY", fd);
usr.bin/ssh/misc.c
219
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1)
usr.bin/ssh/misc.c
225
set_reuseaddr(int fd)
usr.bin/ssh/misc.c
229
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
usr.bin/ssh/misc.c
230
error("setsockopt SO_REUSEADDR fd %d: %s", fd, strerror(errno));
usr.bin/ssh/misc.c
2302
safe_path_fd(int fd, const char *file, struct passwd *pw,
usr.bin/ssh/misc.c
2308
if (fstat(fd, &st) == -1) {
usr.bin/ssh/misc.c
238
get_rdomain(int fd)
usr.bin/ssh/misc.c
244
if (getsockopt(fd, SOL_SOCKET, SO_RTABLE, &rtable, &len) == -1) {
usr.bin/ssh/misc.c
246
fd, strerror(errno));
usr.bin/ssh/misc.c
254
set_rdomain(int fd, const char *name)
usr.bin/ssh/misc.c
268
if (setsockopt(fd, SOL_SOCKET, SO_RTABLE,
usr.bin/ssh/misc.c
271
rtable, fd, strerror(errno));
usr.bin/ssh/misc.c
2737
int fd, devnull, p[2], i;
usr.bin/ssh/misc.c
278
get_sock_af(int fd)
usr.bin/ssh/misc.c
2833
fd = -1;
usr.bin/ssh/misc.c
2835
fd = p[1];
usr.bin/ssh/misc.c
2837
fd = devnull;
usr.bin/ssh/misc.c
2838
if (fd != -1 && dup2(fd, STDOUT_FILENO) == -1) {
usr.bin/ssh/misc.c
284
if (getsockname(fd, (struct sockaddr *)&to, &tolen) == -1)
usr.bin/ssh/misc.c
290
set_sock_tos(int fd, int tos)
usr.bin/ssh/misc.c
298
switch ((af = get_sock_af(fd))) {
usr.bin/ssh/misc.c
303
debug3_f("set socket %d IP_TOS 0x%02x", fd, tos);
usr.bin/ssh/misc.c
304
if (setsockopt(fd, IPPROTO_IP, IP_TOS,
usr.bin/ssh/misc.c
307
fd, tos, strerror(errno));
usr.bin/ssh/misc.c
311
debug3_f("set socket %d IPV6_TCLASS 0x%02x", fd, tos);
usr.bin/ssh/misc.c
312
if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS,
usr.bin/ssh/misc.c
315
fd, tos, strerror(errno));
usr.bin/ssh/misc.c
330
waitfd(int fd, int *timeoutp, short events, volatile sig_atomic_t *stop)
usr.bin/ssh/misc.c
339
pfd.fd = fd;
usr.bin/ssh/misc.c
381
waitrfd(int fd, int *timeoutp, volatile sig_atomic_t *stop) {
usr.bin/ssh/misc.c
382
return waitfd(fd, timeoutp, POLLIN, stop);
usr.bin/ssh/monitor.c
450
pfd[0].fd = pmonitor->m_sendfd;
usr.bin/ssh/monitor.c
452
pfd[1].fd = pmonitor->m_log_recvfd;
usr.bin/ssh/monitor.c
453
pfd[1].events = pfd[1].fd == -1 ? 0 : POLLIN;
usr.bin/ssh/monitor.c
454
if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, -1) == -1) {
usr.bin/ssh/monitor_fdpass.c
100
int fd;
usr.bin/ssh/monitor_fdpass.c
112
pfd.fd = sock;
usr.bin/ssh/monitor_fdpass.c
139
fd = (*(int *)CMSG_DATA(cmsg));
usr.bin/ssh/monitor_fdpass.c
140
return fd;
usr.bin/ssh/monitor_fdpass.c
41
mm_send_fd(int sock, int fd)
usr.bin/ssh/monitor_fdpass.c
62
*(int *)CMSG_DATA(cmsg) = fd;
usr.bin/ssh/monitor_fdpass.c
69
pfd.fd = sock;
usr.bin/ssh/monitor_fdpass.c
73
debug3_f("sendmsg(%d): %s", fd, strerror(errno));
usr.bin/ssh/monitor_fdpass.c
77
error_f("sendmsg(%d): %s", fd, strerror(errno));
usr.bin/ssh/msg.c
40
ssh_msg_send(int fd, u_char type, struct sshbuf *m)
usr.bin/ssh/msg.c
49
if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
usr.bin/ssh/msg.c
53
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) {
usr.bin/ssh/msg.c
62
ssh_msg_recv(int fd, struct sshbuf *m)
usr.bin/ssh/msg.c
70
if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) {
usr.bin/ssh/msg.c
85
if (atomicio(read, fd, p, msg_len) != msg_len) {
usr.bin/ssh/mux.c
1504
mux_client_read(int fd, struct sshbuf *b, size_t need, int timeout_ms)
usr.bin/ssh/mux.c
1518
len = read(fd, p + have, need - have);
usr.bin/ssh/mux.c
1522
if (waitrfd(fd, &timeout_ms,
usr.bin/ssh/mux.c
1543
mux_client_write_packet(int fd, struct sshbuf *m)
usr.bin/ssh/mux.c
1551
pfd.fd = fd;
usr.bin/ssh/mux.c
1567
len = write(fd, ptr + have, need - have);
usr.bin/ssh/mux.c
1594
mux_client_read_packet_timeout(int fd, struct sshbuf *m, int timeout_ms)
usr.bin/ssh/mux.c
1603
if (mux_client_read(fd, queue, 4, timeout_ms) != 0) {
usr.bin/ssh/mux.c
1612
if (mux_client_read(fd, queue, need, timeout_ms) != 0) {
usr.bin/ssh/mux.c
1627
mux_client_read_packet(int fd, struct sshbuf *m)
usr.bin/ssh/mux.c
1629
return mux_client_read_packet_timeout(fd, m, -1);
usr.bin/ssh/mux.c
1633
mux_client_hello_exchange(int fd, int timeout_ms)
usr.bin/ssh/mux.c
1646
if (mux_client_write_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
1654
if (mux_client_read_packet_timeout(fd, m, timeout_ms) != 0) {
usr.bin/ssh/mux.c
1699
mux_client_request_alive(int fd)
usr.bin/ssh/mux.c
1714
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
1720
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
1750
mux_client_request_info(int fd, const char *name)
usr.bin/ssh/mux.c
1766
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
1772
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
1801
mux_client_request_terminate(int fd)
usr.bin/ssh/mux.c
1816
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
1822
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
1856
mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd)
usr.bin/ssh/mux.c
1897
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
1903
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
1952
mux_client_forwards(int fd, int cancel_flag)
usr.bin/ssh/mux.c
1962
if (mux_client_forward(fd, cancel_flag,
usr.bin/ssh/mux.c
1969
if (mux_client_forward(fd, cancel_flag, MUX_FWD_REMOTE,
usr.bin/ssh/mux.c
1977
mux_client_request_session(int fd)
usr.bin/ssh/mux.c
1988
if ((muxserver_pid = mux_client_request_alive(fd)) == 0) {
usr.bin/ssh/mux.c
2034
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
2038
if (mm_send_fd(fd, STDIN_FILENO) == -1 ||
usr.bin/ssh/mux.c
2039
mm_send_fd(fd, STDOUT_FILENO) == -1 ||
usr.bin/ssh/mux.c
2040
mm_send_fd(fd, STDERR_FILENO) == -1)
usr.bin/ssh/mux.c
2047
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
2112
if (mux_client_read_packet(fd, m) != 0)
usr.bin/ssh/mux.c
2146
close(fd);
usr.bin/ssh/mux.c
2166
mux_client_proxy(int fd)
usr.bin/ssh/mux.c
2178
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
2184
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
2207
mux_client_request_stdio_fwd(int fd)
usr.bin/ssh/mux.c
2216
if ((muxserver_pid = mux_client_request_alive(fd)) == 0) {
usr.bin/ssh/mux.c
2235
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
2239
if (mm_send_fd(fd, STDIN_FILENO) == -1 ||
usr.bin/ssh/mux.c
2240
mm_send_fd(fd, STDOUT_FILENO) == -1)
usr.bin/ssh/mux.c
2251
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
2295
if (mux_client_read_packet(fd, m) != 0) {
usr.bin/ssh/mux.c
2307
mux_client_request_stop_listening(int fd)
usr.bin/ssh/mux.c
2322
if (mux_client_write_packet(fd, m) != 0)
usr.bin/ssh/mux.c
2328
if (mux_client_read_packet(fd, m) != 0)
usr.bin/ssh/packet.c
1504
pfd.fd = state->connection_in;
usr.bin/ssh/packet.c
1971
ssh_packet_process_read(struct ssh *ssh, int fd)
usr.bin/ssh/packet.c
1977
if ((r = sshbuf_read(fd, state->input, PACKET_MAX_SIZE, &rlen)) != 0)
usr.bin/ssh/packet.c
2196
pfd.fd = state->connection_out;
usr.bin/ssh/scp.c
1347
int fd = -1, haderr, indx;
usr.bin/ssh/scp.c
1357
if ((fd = open(name, O_RDONLY|O_NONBLOCK)) == -1)
usr.bin/ssh/scp.c
1363
if (fstat(fd, &stb) == -1) {
usr.bin/ssh/scp.c
1371
unset_nonblock(fd);
usr.bin/ssh/scp.c
1403
if ((bp = allocbuf(&buffer, fd, COPY_BUFLEN)) == NULL) {
usr.bin/ssh/scp.c
1404
next: if (fd != -1) {
usr.bin/ssh/scp.c
1405
(void) close(fd);
usr.bin/ssh/scp.c
1406
fd = -1;
usr.bin/ssh/scp.c
1418
if ((nr = atomicio(read, fd,
usr.bin/ssh/scp.c
1436
if (fd != -1) {
usr.bin/ssh/scp.c
1437
if (close(fd) == -1 && !haderr)
usr.bin/ssh/scp.c
1439
fd = -1;
usr.bin/ssh/scp.c
2178
allocbuf(BUF *bp, int fd, int blksize)
usr.bin/ssh/scp.c
2183
if (fstat(fd, &stb) == -1) {
usr.bin/ssh/scp.c
675
do_times(int fd, int verb, const struct stat *sb)
usr.bin/ssh/scp.c
688
(void) atomicio(vwrite, fd, buf, strlen(buf));
usr.bin/ssh/serverloop.c
209
(*pfdp)[0].fd = connection_in;
usr.bin/ssh/serverloop.c
211
(*pfdp)[1].fd = connection_out;
usr.bin/ssh/session.c
221
int fd = -1, success = 0;
usr.bin/ssh/session.c
228
if ((fd = mkstemp(auth_info_file)) == -1) {
usr.bin/ssh/session.c
232
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(info),
usr.bin/ssh/session.c
237
if (close(fd) != 0) {
usr.bin/ssh/session.c
244
if (fd != -1)
usr.bin/ssh/session.c
245
close(fd);
usr.bin/ssh/sftp-client.c
2385
pfd.fd = to->fd_in;
usr.bin/ssh/sftp-server.c
1027
int handle, fd, r;
usr.bin/ssh/sftp-server.c
1035
fd = handle_to_fd(handle);
usr.bin/ssh/sftp-server.c
1036
if (fd < 0)
usr.bin/ssh/sftp-server.c
1044
r = ftruncate(fd, a.size);
usr.bin/ssh/sftp-server.c
1050
r = fchmod(fd, a.perm & 07777);
usr.bin/ssh/sftp-server.c
1061
r = futimes(fd, attrib_to_tv(&a));
usr.bin/ssh/sftp-server.c
1068
r = fchown(fd, a.uid, a.gid);
usr.bin/ssh/sftp-server.c
1385
int r, handle, fd;
usr.bin/ssh/sftp-server.c
1392
if ((fd = handle_to_fd(handle)) < 0) {
usr.bin/ssh/sftp-server.c
1396
if (fstatvfs(fd, &st) != 0)
usr.bin/ssh/sftp-server.c
1424
int handle, fd, r, status = SSH2_FX_OP_UNSUPPORTED;
usr.bin/ssh/sftp-server.c
1430
if ((fd = handle_to_fd(handle)) < 0)
usr.bin/ssh/sftp-server.c
1433
r = fsync(fd);
usr.bin/ssh/sftp-server.c
2015
pfd[0].fd = pfd[1].fd = -1;
usr.bin/ssh/sftp-server.c
2025
pfd[0].fd = in;
usr.bin/ssh/sftp-server.c
2033
pfd[1].fd = out;
usr.bin/ssh/sftp-server.c
303
int fd;
usr.bin/ssh/sftp-server.c
328
handle_new(int use, const char *name, int fd, int flags, DIR *dirp)
usr.bin/ssh/sftp-server.c
345
handles[i].fd = fd;
usr.bin/ssh/sftp-server.c
405
return handles[handle].fd;
usr.bin/ssh/sftp-server.c
453
ret = close(handles[handle].fd);
usr.bin/ssh/sftp-server.c
737
int r, handle, fd, flags, mode, status = SSH2_FX_FAILURE;
usr.bin/ssh/sftp-server.c
755
fd = open(name, flags, mode);
usr.bin/ssh/sftp-server.c
756
if (fd == -1) {
usr.bin/ssh/sftp-server.c
759
handle = handle_new(HANDLE_FILE, name, fd, flags, NULL);
usr.bin/ssh/sftp-server.c
761
close(fd);
usr.bin/ssh/sftp-server.c
794
int r, handle, fd, ret, status = SSH2_FX_FAILURE;
usr.bin/ssh/sftp-server.c
804
if ((fd = handle_to_fd(handle)) == -1)
usr.bin/ssh/sftp-server.c
816
if (lseek(fd, off, SEEK_SET) == -1) {
usr.bin/ssh/sftp-server.c
825
} else if ((ret = read(fd, buf, len)) == -1) {
usr.bin/ssh/sftp-server.c
848
int r, handle, fd, ret, status;
usr.bin/ssh/sftp-server.c
858
fd = handle_to_fd(handle);
usr.bin/ssh/sftp-server.c
860
if (fd < 0)
usr.bin/ssh/sftp-server.c
864
lseek(fd, off, SEEK_SET) == -1) {
usr.bin/ssh/sftp-server.c
870
ret = write(fd, data, len);
usr.bin/ssh/sftp-server.c
931
int fd, r, handle, status = SSH2_FX_FAILURE;
usr.bin/ssh/sftp-server.c
937
fd = handle_to_fd(handle);
usr.bin/ssh/sftp-server.c
938
if (fd >= 0) {
usr.bin/ssh/sftp-server.c
939
r = fstat(fd, &st);
usr.bin/ssh/ssh-add.c
278
int cert_lifetime, r, fd, ret = -1;
usr.bin/ssh/ssh-add.c
282
fd = STDIN_FILENO;
usr.bin/ssh/ssh-add.c
284
} else if ((fd = open(filename, O_RDONLY)) == -1) {
usr.bin/ssh/ssh-add.c
293
if (fd != STDIN_FILENO) {
usr.bin/ssh/ssh-add.c
294
if (sshkey_perm_ok(fd, filename) != 0) {
usr.bin/ssh/ssh-add.c
295
close(fd);
usr.bin/ssh/ssh-add.c
299
if ((r = sshbuf_load_fd(fd, &keyblob)) != 0) {
usr.bin/ssh/ssh-add.c
303
close(fd);
usr.bin/ssh/ssh-add.c
306
close(fd);
usr.bin/ssh/ssh-agent.c
119
int fd;
usr.bin/ssh/ssh-agent.c
1843
socknum, e->fd, msg_len, AGENT_MAX_LEN);
usr.bin/ssh/ssh-agent.c
1861
debug_f("socket %u (fd=%d) type %d", socknum, e->fd, type);
usr.bin/ssh/ssh-agent.c
1926
new_socket(sock_type type, int fd)
usr.bin/ssh/ssh-agent.c
1932
set_nonblock(fd);
usr.bin/ssh/ssh-agent.c
1934
if (fd > max_fd)
usr.bin/ssh/ssh-agent.c
1935
max_fd = fd;
usr.bin/ssh/ssh-agent.c
1939
sockets[i].fd = fd;
usr.bin/ssh/ssh-agent.c
1954
sockets[old_alloc].fd = fd;
usr.bin/ssh/ssh-agent.c
1969
int fd;
usr.bin/ssh/ssh-agent.c
1972
fd = accept(sockets[socknum].fd, (struct sockaddr *)&sunaddr, &slen);
usr.bin/ssh/ssh-agent.c
1973
if (fd == -1) {
usr.bin/ssh/ssh-agent.c
1977
if (getpeereid(fd, &euid, &egid) == -1) {
usr.bin/ssh/ssh-agent.c
1978
error("getpeereid %d failed: %s", fd, strerror(errno));
usr.bin/ssh/ssh-agent.c
1979
close(fd);
usr.bin/ssh/ssh-agent.c
1985
close(fd);
usr.bin/ssh/ssh-agent.c
1988
new_socket(AUTH_CONNECTION, fd);
usr.bin/ssh/ssh-agent.c
1999
if ((len = read(sockets[socknum].fd, buf, sizeof(buf))) <= 0) {
usr.bin/ssh/ssh-agent.c
2004
socknum, sockets[socknum].fd, strerror(errno));
usr.bin/ssh/ssh-agent.c
201
close(e->fd);
usr.bin/ssh/ssh-agent.c
2028
if ((len = write(sockets[socknum].fd,
usr.bin/ssh/ssh-agent.c
2035
socknum, sockets[socknum].fd, strerror(errno));
usr.bin/ssh/ssh-agent.c
2058
if (pfd[i].fd == sockets[socknum].fd)
usr.bin/ssh/ssh-agent.c
2062
error_f("no socket for fd %d", pfd[i].fd);
usr.bin/ssh/ssh-agent.c
211
e->fd = -1;
usr.bin/ssh/ssh-agent.c
2134
pfd[j].fd = sockets[i].fd;
usr.bin/ssh/ssh-agent.c
2140
pfd[j].fd = sockets[i].fd;
usr.bin/ssh/ssh-agent.c
505
e->fd, i, hks->forwarded ? "FORWARD" : "AUTH",
usr.bin/ssh/ssh-keygen.c
1012
int i, type, fd, r;
usr.bin/ssh/ssh-keygen.c
1049
if ((fd = mkstemp(prv_tmp)) == -1) {
usr.bin/ssh/ssh-keygen.c
1054
(void)close(fd); /* just using mkstemp() to reserve a name */
usr.bin/ssh/ssh-keygen.c
1071
if ((fd = mkstemp(pub_tmp)) == -1) {
usr.bin/ssh/ssh-keygen.c
1076
(void)fchmod(fd, 0644);
usr.bin/ssh/ssh-keygen.c
1077
(void)close(fd);
usr.bin/ssh/ssh-keygen.c
1244
int r, fd, oerrno, inplace = 0;
usr.bin/ssh/ssh-keygen.c
1278
if ((fd = mkstemp(tmp)) == -1)
usr.bin/ssh/ssh-keygen.c
1280
if ((ctx.out = fdopen(fd, "w")) == NULL) {
usr.bin/ssh/ssh-keygen.c
1285
(void)fchmod(fd, sb.st_mode & 0644);
usr.bin/ssh/ssh-keygen.c
2517
sign_one(struct sshkey *signkey, const char *filename, int fd,
usr.bin/ssh/ssh-keygen.c
2527
if (fd == STDIN_FILENO)
usr.bin/ssh/ssh-keygen.c
2550
fd, sig_namespace, &sigbuf, signer, signer_ctx)) != 0) {
usr.bin/ssh/ssh-keygen.c
2564
if (fd == STDIN_FILENO) {
usr.bin/ssh/ssh-keygen.c
2657
int i, fd = -1, r, ret = -1;
usr.bin/ssh/ssh-keygen.c
2710
fd = STDIN_FILENO;
usr.bin/ssh/ssh-keygen.c
2711
else if ((fd = open(argv[i], O_RDONLY)) == -1) {
usr.bin/ssh/ssh-keygen.c
2716
if ((r = sign_one(signkey, argv[i], fd, sig_namespace,
usr.bin/ssh/ssh-keygen.c
2719
if (fd != STDIN_FILENO)
usr.bin/ssh/ssh-keygen.c
2720
close(fd);
usr.bin/ssh/ssh-keygen.c
2721
fd = -1;
usr.bin/ssh/ssh-keygen.c
2727
if (fd != -1 && fd != STDIN_FILENO)
usr.bin/ssh/ssh-keygen.c
2728
close(fd);
usr.bin/ssh/ssh-keyscan.c
398
read_wait[s].fd = s;
usr.bin/ssh/ssh-keyscan.c
420
read_wait[s].fd = -1;
usr.bin/ssh/ssh-keyscan.c
767
read_wait[j].fd = -1;
usr.bin/ssh/ssh-keysign.c
180
int r, key_fd[NUM_KEYTYPES], i, found, version = 2, fd;
usr.bin/ssh/ssh-keysign.c
186
if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
usr.bin/ssh/ssh-keysign.c
189
if (fd > 2)
usr.bin/ssh/ssh-keysign.c
190
close(fd);
usr.bin/ssh/ssh-keysign.c
261
if ((r = sshbuf_get_u32(b, (u_int *)&fd)) != 0)
usr.bin/ssh/ssh-keysign.c
263
if (fd <= STDERR_FILENO)
usr.bin/ssh/ssh-keysign.c
264
fatal("%s: bad fd = %d", __progname, fd);
usr.bin/ssh/ssh-keysign.c
265
if ((host = get_local_name(fd)) == NULL)
usr.bin/ssh/ssh-pkcs11-client.c
130
close(helper->fd);
usr.bin/ssh/ssh-pkcs11-client.c
132
helper->fd = -1;
usr.bin/ssh/ssh-pkcs11-client.c
156
send_msg(int fd, struct sshbuf *m)
usr.bin/ssh/ssh-pkcs11-client.c
162
if (fd == -1)
usr.bin/ssh/ssh-pkcs11-client.c
165
if (atomicio(vwrite, fd, buf, 4) != 4 ||
usr.bin/ssh/ssh-pkcs11-client.c
166
atomicio(vwrite, fd, sshbuf_mutable_ptr(m),
usr.bin/ssh/ssh-pkcs11-client.c
174
recv_msg(int fd, struct sshbuf *m)
usr.bin/ssh/ssh-pkcs11-client.c
181
if (fd == -1)
usr.bin/ssh/ssh-pkcs11-client.c
183
if ((len = atomicio(read, fd, buf, 4)) != 4) {
usr.bin/ssh/ssh-pkcs11-client.c
195
if (atomicio(read, fd, buf, l) != l) {
usr.bin/ssh/ssh-pkcs11-client.c
243
if ((helper = helper_by_key(key)) == NULL || helper->fd == -1)
usr.bin/ssh/ssh-pkcs11-client.c
254
send_msg(helper->fd, msg);
usr.bin/ssh/ssh-pkcs11-client.c
257
if ((status = recv_msg(helper->fd, msg)) != SSH2_AGENT_SIGN_RESPONSE) {
usr.bin/ssh/ssh-pkcs11-client.c
294
if ((helper = helper_by_key(priv)) == NULL || helper->fd == -1)
usr.bin/ssh/ssh-pkcs11-client.c
369
helper->fd = pair[0];
usr.bin/ssh/ssh-pkcs11-client.c
373
helper->path, helper->fd, (long)helper->pid);
usr.bin/ssh/ssh-pkcs11-client.c
403
send_msg(helper->fd, msg);
usr.bin/ssh/ssh-pkcs11-client.c
406
type = recv_msg(helper->fd, msg);
usr.bin/ssh/ssh-pkcs11-client.c
467
if ((helper = helper_by_key(key)) == NULL || helper->fd == -1)
usr.bin/ssh/ssh-pkcs11-client.c
50
int fd;
usr.bin/ssh/ssh-pkcs11-client.c
64
helpers[i]->fd == -1)
usr.bin/ssh/ssh-pkcs11-helper.c
250
pfd[0].fd = in;
usr.bin/ssh/ssh-pkcs11-helper.c
251
pfd[1].fd = out;
usr.bin/ssh/ssh-sk-client.c
158
int oerrno, fd, r2, ll, r = SSH_ERR_INTERNAL_ERROR;
usr.bin/ssh/ssh-sk-client.c
166
if ((r = start_helper(&fd, &pid, &osigchld)) != 0)
usr.bin/ssh/ssh-sk-client.c
182
if ((r = ssh_msg_send(fd, SSH_SK_HELPER_VERSION, req)) != 0) {
usr.bin/ssh/ssh-sk-client.c
186
if ((r = ssh_msg_recv(fd, resp)) != 0) {
usr.bin/ssh/ssh-sk-client.c
226
close(fd);
usr.bin/ssh/sshbuf-io.c
100
int fd, oerrno;
usr.bin/ssh/sshbuf-io.c
102
if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
usr.bin/ssh/sshbuf-io.c
104
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(buf),
usr.bin/ssh/sshbuf-io.c
105
sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) {
usr.bin/ssh/sshbuf-io.c
107
close(fd);
usr.bin/ssh/sshbuf-io.c
32
sshbuf_load_fd(int fd, struct sshbuf **blobp)
usr.bin/ssh/sshbuf-io.c
42
if (fstat(fd, &st) == -1)
usr.bin/ssh/sshbuf-io.c
49
if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) {
usr.bin/ssh/sshbuf-io.c
80
int r, fd, oerrno;
usr.bin/ssh/sshbuf-io.c
83
if ((fd = open(path, O_RDONLY)) == -1)
usr.bin/ssh/sshbuf-io.c
85
if ((r = sshbuf_load_fd(fd, bufp)) != 0)
usr.bin/ssh/sshbuf-io.c
91
close(fd);
usr.bin/ssh/sshbuf-misc.c
324
sshbuf_read(int fd, struct sshbuf *buf, size_t maxlen, size_t *rlen)
usr.bin/ssh/sshbuf-misc.c
335
rr = read(fd, d, maxlen);
usr.bin/ssh/sshd-session.c
609
recv_rexec_state(int fd, struct sshbuf *conf, uint64_t *timing_secretp)
usr.bin/ssh/sshd-session.c
617
debug3_f("entering fd = %d", fd);
usr.bin/ssh/sshd-session.c
623
if (ssh_msg_recv(fd, m) == -1)
usr.bin/ssh/sshd-session.c
650
if (ssh_msg_recv(fd, m) == -1)
usr.bin/ssh/sshd.c
761
send_rexec_state(int fd)
usr.bin/ssh/sshd.c
772
debug3_f("entering fd = %d config len %zu", fd,
usr.bin/ssh/sshd.c
776
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(config), mlen) != mlen)
usr.bin/ssh/sshd.c
781
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(keys), mlen) != mlen)
usr.bin/ssh/sshd.c
972
pfd[i].fd = listen_socks[i];
usr.bin/ssh/sshd.c
979
pfd[npfd].fd = children[i].pipefd;
usr.bin/ssh/sshlogin.c
100
if (read(fd, &ll, sizeof(ll)) != sizeof(ll)) {
usr.bin/ssh/sshlogin.c
101
close(fd);
usr.bin/ssh/sshlogin.c
104
close(fd);
usr.bin/ssh/sshlogin.c
151
int fd;
usr.bin/ssh/sshlogin.c
181
fd = open(lastlog, O_RDWR);
usr.bin/ssh/sshlogin.c
182
if (fd >= 0) {
usr.bin/ssh/sshlogin.c
183
lseek(fd, (off_t)uid * sizeof(ll), SEEK_SET);
usr.bin/ssh/sshlogin.c
184
if (write(fd, &ll, sizeof(ll)) != sizeof(ll))
usr.bin/ssh/sshlogin.c
186
close(fd);
usr.bin/ssh/sshlogin.c
78
int fd;
usr.bin/ssh/sshlogin.c
84
fd = open(lastlog, O_RDONLY);
usr.bin/ssh/sshlogin.c
85
if (fd == -1)
usr.bin/ssh/sshlogin.c
89
r = lseek(fd, pos, SEEK_SET);
usr.bin/ssh/sshlogin.c
92
close(fd);
usr.bin/ssh/sshlogin.c
97
close(fd);
usr.bin/ssh/sshpty.c
105
fd = open(tty, O_RDWR);
usr.bin/ssh/sshpty.c
106
if (fd == -1)
usr.bin/ssh/sshpty.c
109
close(fd);
usr.bin/ssh/sshpty.c
112
fd = open(_PATH_TTY, O_WRONLY);
usr.bin/ssh/sshpty.c
113
if (fd == -1)
usr.bin/ssh/sshpty.c
117
close(fd);
usr.bin/ssh/sshpty.c
191
int fd;
usr.bin/ssh/sshpty.c
193
if ((fd = open(_PATH_TTY, O_RDWR | O_NOCTTY)) >= 0) {
usr.bin/ssh/sshpty.c
194
(void) ioctl(fd, TIOCNOTTY, NULL);
usr.bin/ssh/sshpty.c
195
close(fd);
usr.bin/ssh/sshpty.c
77
int fd;
usr.bin/ssh/sshpty.c
81
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
usr.bin/ssh/sshpty.c
82
if (fd >= 0) {
usr.bin/ssh/sshpty.c
83
(void) ioctl(fd, TIOCNOTTY, NULL);
usr.bin/ssh/sshpty.c
84
close(fd);
usr.bin/ssh/sshpty.c
94
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
usr.bin/ssh/sshpty.c
95
if (fd >= 0) {
usr.bin/ssh/sshpty.c
97
close(fd);
usr.bin/ssh/sshsig.c
504
hash_file(int fd, const char *hashalg, struct sshbuf **bp)
usr.bin/ssh/sshsig.c
526
if ((n = read(fd, rbuf, sizeof(rbuf))) == -1) {
usr.bin/ssh/sshsig.c
576
int fd, const char *sig_namespace, struct sshbuf **out,
usr.bin/ssh/sshsig.c
586
if ((r = hash_file(fd, hashalg, &b)) != 0) {
usr.bin/ssh/sshsig.c
601
sshsig_verify_fd(struct sshbuf *signature, int fd,
usr.bin/ssh/sshsig.c
616
if ((r = hash_file(fd, hashalg, &b)) != 0) {
usr.bin/ssh/sshsig.h
60
int fd, const char *sig_namespace,
usr.bin/ssh/sshsig.h
68
int sshsig_verify_fd(struct sshbuf *signature, int fd,
usr.bin/ssh/ttymodes.c
250
ssh_tty_make_modes(struct ssh *ssh, int fd, struct termios *tiop)
usr.bin/ssh/ttymodes.c
260
if (fd == -1) {
usr.bin/ssh/ttymodes.c
264
if (tcgetattr(fd, &tio) == -1) {
usr.bin/ssh/ttymodes.c
313
ssh_tty_parse_modes(struct ssh *ssh, int fd)
usr.bin/ssh/ttymodes.c
337
if (tcgetattr(fd, &tio) == -1) {
usr.bin/ssh/ttymodes.c
418
if (tcsetattr(fd, TCSANOW, &tio) == -1)
usr.bin/talk/ctl_transact.c
58
pfd[0].fd = ctl_sockt;
usr.bin/talk/io.c
75
fds[0].fd = fileno(stdin);
usr.bin/talk/io.c
77
fds[1].fd = sockt;
usr.bin/tcpbench/tcpbench.c
1386
udp_sc->fd = -1;
usr.bin/tcpbench/tcpbench.c
447
tcp_process_slice(int fd, short event, void *bula)
usr.bin/tcpbench/tcpbench.c
467
if (getsockopt(sc->fd, IPPROTO_TCP, TCP_INFO,
usr.bin/tcpbench/tcpbench.c
511
udp_process_slice(int fd, short event, void *bula)
usr.bin/tcpbench/tcpbench.c
560
udp_server_handle_sc(int fd, short event, void *bula)
usr.bin/tcpbench/tcpbench.c
565
n = read(fd, ptb->dummybuf, ptb->dummybuf_len);
usr.bin/tcpbench/tcpbench.c
570
warn("fd %d read error", fd);
usr.bin/tcpbench/tcpbench.c
589
tcp_server_handle_sc(int fd, short event, void *v_sc)
usr.bin/tcpbench/tcpbench.c
597
n = read(sc->fd, sc->buf, sc->buflen);
usr.bin/tcpbench/tcpbench.c
602
warn("fd %d read error", sc->fd);
usr.bin/tcpbench/tcpbench.c
606
fprintf(stderr, "%8d closed by remote end\n", sc->fd);
usr.bin/tcpbench/tcpbench.c
611
close(sc->fd);
usr.bin/tcpbench/tcpbench.c
643
pfd.fd = s;
usr.bin/tcpbench/tcpbench.c
658
tcp_server_accept(int fd, short event, void *arg)
usr.bin/tcpbench/tcpbench.c
681
if ((sock = accept4(fd, (struct sockaddr *)&ss, &sslen, SOCK_NONBLOCK))
usr.bin/tcpbench/tcpbench.c
713
sc->fd = sock;
usr.bin/tcpbench/tcpbench.c
715
if (tls && tls_accept_socket(tls, &sc->tls, sc->fd) == -1)
usr.bin/tcpbench/tcpbench.c
718
event_set(&sc->ev, sc->fd, EV_READ | EV_PERSIST,
usr.bin/tcpbench/tcpbench.c
728
tmp, sc->fd);
usr.bin/tcpbench/tcpbench.c
74
int fd;
usr.bin/tcpbench/tcpbench.c
806
ts->fd = sock;
usr.bin/tcpbench/tcpbench.c
808
event_set(&ts->ev, ts->fd, EV_READ,
usr.bin/tcpbench/tcpbench.c
82
int fd;
usr.bin/tcpbench/tcpbench.c
823
client_handle_sc(int fd, short event, void *v_sc)
usr.bin/tcpbench/tcpbench.c
835
n = write(sc->fd, sc->buf, blen);
usr.bin/tcpbench/tcpbench.c
936
sc->fd = sock;
usr.bin/tcpbench/tcpbench.c
947
if (tls_connect_socket(sc->tls, sc->fd,
usr.bin/tcpbench/tcpbench.c
951
if (timeout_tls(sc->fd, sc->tls, tls_handshake) == -1) {
usr.bin/tcpbench/tcpbench.c
962
event_set(&sc->ev, sc->fd, EV_WRITE | EV_PERSIST,
usr.bin/tee/tee.c
102
if ((fd = open(*argv, O_WRONLY | O_CREAT |
usr.bin/tee/tee.c
107
add(fd, *argv);
usr.bin/tee/tee.c
120
wval = write(p->fd, buf + n, rval - n);
usr.bin/tee/tee.c
136
if (close(p->fd) == -1) {
usr.bin/tee/tee.c
50
int fd;
usr.bin/tee/tee.c
56
add(int fd, char *name)
usr.bin/tee/tee.c
62
p->fd = fd;
usr.bin/tee/tee.c
71
int fd;
usr.bin/telnet/network.c
68
pfd[0].fd = net;
usr.bin/telnet/sys_bsd.c
505
pfd[TELNET_FD_TOUT].fd = tout;
usr.bin/telnet/sys_bsd.c
508
pfd[TELNET_FD_TOUT].fd = -1;
usr.bin/telnet/sys_bsd.c
511
pfd[TELNET_FD_TIN].fd = tin;
usr.bin/telnet/sys_bsd.c
514
pfd[TELNET_FD_TIN].fd = -1;
usr.bin/telnet/sys_bsd.c
517
pfd[TELNET_FD_NET].fd = net;
usr.bin/telnet/sys_bsd.c
526
pfd[TELNET_FD_NET].fd = -1;
usr.bin/telnet/utilities.c
652
pfd[0].fd = tout;
usr.bin/tftp/main.c
325
int fd;
usr.bin/tftp/main.c
365
fd = open(cp, O_RDONLY);
usr.bin/tftp/main.c
366
if (fd < 0) {
usr.bin/tftp/main.c
373
sendfile(fd, targ, mode);
usr.bin/tftp/main.c
384
fd = open(argv[n], O_RDONLY);
usr.bin/tftp/main.c
385
if (fd < 0) {
usr.bin/tftp/main.c
393
sendfile(fd, cp, mode);
usr.bin/tftp/main.c
412
int fd;
usr.bin/tftp/main.c
456
fd = open(cp, O_CREAT | O_TRUNC | O_WRONLY, 0644);
usr.bin/tftp/main.c
457
if (fd < 0) {
usr.bin/tftp/main.c
464
recvfile(fd, src, mode);
usr.bin/tftp/main.c
468
fd = open(cp, O_CREAT | O_TRUNC | O_WRONLY, 0644);
usr.bin/tftp/main.c
469
if (fd < 0) {
usr.bin/tftp/main.c
476
recvfile(fd, src, mode);
usr.bin/tftp/main.c
777
pfd[0].fd = 0;
usr.bin/tftp/tftp.c
127
sendfile(int fd, char *name, char *mode)
usr.bin/tftp/tftp.c
143
file = fdopen(fd, "r");
usr.bin/tftp/tftp.c
184
pfd[0].fd = f;
usr.bin/tftp/tftp.c
273
recvfile(int fd, char *name, char *mode)
usr.bin/tftp/tftp.c
289
file = fdopen(fd, "w");
usr.bin/tftp/tftp.c
331
pfd[0].fd = f;
usr.bin/tic/reset_cmd.c
196
reset_tty_settings(int fd, TTY * tty_settings, int noset)
usr.bin/tic/reset_cmd.c
198
GET_TTY(fd, tty_settings);
usr.bin/tic/reset_cmd.c
336
SET_TTY(fd, tty_settings);
usr.bin/tic/reset_cmd.c
490
send_init_strings(int fd GCC_UNUSED, TTY * old_settings)
usr.bin/tic/reset_cmd.c
500
SET_TTY(fd, old_settings);
usr.bin/tic/reset_cmd.c
646
set_window_size(int fd, short *high, short *wide)
usr.bin/tic/reset_cmd.c
649
(void) ioctl(fd, IOCTL_GET_WINSIZE, &win);
usr.bin/tic/reset_cmd.c
655
(void) ioctl(fd, IOCTL_SET_WINSIZE, &win);
usr.bin/tic/tic.c
398
int fd = mkstemp(filename);
usr.bin/tic/tic.c
399
if (fd >= 0)
usr.bin/tic/tic.c
400
result = fdopen(fd, "w");
usr.bin/tic/tty_settings.c
58
get_tty_settings(int fd, TTY * tty_settings)
usr.bin/tic/tty_settings.c
61
my_fd = fd;
usr.bin/tic/tty_settings.c
62
if (fd < 0 || GET_TTY(my_fd, tty_settings) < 0) {
usr.bin/tic/tty_settings.c
79
int fd = open("/dev/tty", O_RDWR);
usr.bin/tic/tty_settings.c
80
if (!get_tty_settings(fd, tty_settings)) {
usr.bin/tmux/alerts.c
44
alerts_timer(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/alerts.c
53
alerts_callback(__unused int fd, __unused short events, __unused void *arg)
usr.bin/tmux/client.c
110
int fd, lockfd = -1, locked = 0;
usr.bin/tmux/client.c
123
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
usr.bin/tmux/client.c
127
if (connect(fd, (struct sockaddr *)&sa, sizeof sa) == -1) {
usr.bin/tmux/client.c
135
close(fd);
usr.bin/tmux/client.c
165
fd = server_start(client_proc, flags, base, lockfd, lockfile);
usr.bin/tmux/client.c
172
setblocking(fd, 0);
usr.bin/tmux/client.c
173
return (fd);
usr.bin/tmux/client.c
180
close(fd);
usr.bin/tmux/client.c
238
int fd, i;
usr.bin/tmux/client.c
284
fd = client_connect(base, socket_path, client_flags);
usr.bin/tmux/client.c
285
if (fd == -1) {
usr.bin/tmux/client.c
295
client_peer = proc_add_peer(client_proc, fd, client_dispatch, NULL);
usr.bin/tmux/client.c
441
int fd;
usr.bin/tmux/client.c
463
if ((fd = dup(STDIN_FILENO)) == -1)
usr.bin/tmux/client.c
465
proc_send(client_peer, MSG_IDENTIFY_STDIN, fd, NULL, 0);
usr.bin/tmux/client.c
466
if ((fd = dup(STDOUT_FILENO)) == -1)
usr.bin/tmux/client.c
468
proc_send(client_peer, MSG_IDENTIFY_STDOUT, fd, NULL, 0);
usr.bin/tmux/cmd-find.c
90
if (wp->fd != -1 && strcmp(wp->tty, c->ttyname) == 0)
usr.bin/tmux/cmd-new-session.c
193
c->fd != -1 &&
usr.bin/tmux/cmd-new-session.c
200
if (tcgetattr(c->fd, &tio) != 0)
usr.bin/tmux/cmd-run-shell.c
193
cmd_run_shell_timer(__unused int fd, __unused short events, void* arg)
usr.bin/tmux/control.c
580
control_wait_exit(int fd)
usr.bin/tmux/control.c
603
pfd.fd = fd;
usr.bin/tmux/control.c
611
n = evbuffer_read(evb, fd, -1);
usr.bin/tmux/control.c
706
if (wp == NULL || wp->fd == -1) {
usr.bin/tmux/control.c
831
setblocking(c->fd, 0);
usr.bin/tmux/control.c
840
cs->read_event = bufferevent_new(c->fd, control_read_callback,
usr.bin/tmux/file.c
159
file_fire_done_cb(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/file.c
226
msg.fd = STDOUT_FILENO;
usr.bin/tmux/file.c
253
msg.fd = STDOUT_FILENO;
usr.bin/tmux/file.c
283
msg.fd = STDERR_FILENO;
usr.bin/tmux/file.c
302
int fd = -1;
usr.bin/tmux/file.c
311
fd = STDOUT_FILENO;
usr.bin/tmux/file.c
353
msg->fd = fd;
usr.bin/tmux/file.c
375
int fd = -1;
usr.bin/tmux/file.c
385
fd = STDIN_FILENO;
usr.bin/tmux/file.c
432
msg->fd = fd;
usr.bin/tmux/file.c
467
file_push_cb(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/file.c
545
close(cf->fd);
usr.bin/tmux/file.c
546
cf->fd = -1;
usr.bin/tmux/file.c
565
close(cf->fd);
usr.bin/tmux/file.c
604
cf->fd = -1;
usr.bin/tmux/file.c
605
if (msg->fd == -1)
usr.bin/tmux/file.c
606
cf->fd = open(path, msg->flags|flags, 0644);
usr.bin/tmux/file.c
608
if (msg->fd != STDOUT_FILENO && msg->fd != STDERR_FILENO)
usr.bin/tmux/file.c
611
cf->fd = dup(msg->fd);
usr.bin/tmux/file.c
613
close(msg->fd); /* can only be used once */
usr.bin/tmux/file.c
617
if (cf->fd == -1) {
usr.bin/tmux/file.c
622
cf->event = bufferevent_new(cf->fd, NULL, file_write_callback,
usr.bin/tmux/file.c
673
if (cf->fd != -1)
usr.bin/tmux/file.c
674
close(cf->fd);
usr.bin/tmux/file.c
695
close(cf->fd);
usr.bin/tmux/file.c
765
cf->fd = -1;
usr.bin/tmux/file.c
766
if (msg->fd == -1)
usr.bin/tmux/file.c
767
cf->fd = open(path, flags);
usr.bin/tmux/file.c
769
if (msg->fd != STDIN_FILENO)
usr.bin/tmux/file.c
772
cf->fd = dup(msg->fd);
usr.bin/tmux/file.c
774
close(msg->fd); /* can only be used once */
usr.bin/tmux/file.c
778
if (cf->fd == -1) {
usr.bin/tmux/file.c
783
cf->event = bufferevent_new(cf->fd, file_read_callback, NULL,
usr.bin/tmux/format.c
2144
if (wp->fd == -1 && (wp->flags & PANE_STATUSREADY))
usr.bin/tmux/format.c
2451
if (ft->wp != NULL && ft->wp->fd != -1)
usr.bin/tmux/format.c
5793
format_cycle_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/format.c
933
cmd = get_proc_name(wp->fd, wp->tty);
usr.bin/tmux/format.c
957
cwd = get_proc_cwd(wp->fd);
usr.bin/tmux/input.c
3483
input_request_timer_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/input.c
816
input_ground_timer_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/job.c
222
job->fd = out[0];
usr.bin/tmux/job.c
224
job->fd = master;
usr.bin/tmux/job.c
225
setblocking(job->fd, 0);
usr.bin/tmux/job.c
227
job->event = bufferevent_new(job->fd, job_read_callback,
usr.bin/tmux/job.c
247
int fd = job->fd;
usr.bin/tmux/job.c
266
return (fd);
usr.bin/tmux/job.c
285
if (job->fd != -1)
usr.bin/tmux/job.c
286
close(job->fd);
usr.bin/tmux/job.c
297
if (job->fd == -1 || (~job->flags & JOB_PTY))
usr.bin/tmux/job.c
305
if (ioctl(job->fd, TIOCSWINSZ, &ws) == -1)
usr.bin/tmux/job.c
334
shutdown(job->fd, SHUT_WR);
usr.bin/tmux/job.c
449
n, job->cmd, job->fd, (long)job->pid, job->status);
usr.bin/tmux/job.c
58
int fd;
usr.bin/tmux/monitor.c
252
if (wp == NULL || wp->fd == -1)
usr.bin/tmux/monitor.c
495
monitor_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/names.c
34
name_time_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/proc.c
157
event_set(&peer->event, peer->ibuf.fd, events, proc_event_cb, peer);
usr.bin/tmux/proc.c
163
proc_send(struct tmuxpeer *peer, enum msgtype type, int fd, const void *buf,
usr.bin/tmux/proc.c
174
retval = imsg_compose(ibuf, type, PROTOCOL_VERSION, -1, fd, vp, len);
usr.bin/tmux/proc.c
297
proc_add_peer(struct tmuxproc *tp, int fd,
usr.bin/tmux/proc.c
308
if (imsgbuf_init(&peer->ibuf, fd) == -1)
usr.bin/tmux/proc.c
311
event_set(&peer->event, fd, EV_READ, proc_event_cb, peer);
usr.bin/tmux/proc.c
313
if (getpeereid(fd, &peer->uid, &peer->gid) != 0) {
usr.bin/tmux/proc.c
318
log_debug("add peer %p: %d (%p)", peer, fd, arg);
usr.bin/tmux/proc.c
334
close(peer->ibuf.fd);
usr.bin/tmux/proc.c
357
proc_fork_and_daemon(int *fd)
usr.bin/tmux/proc.c
369
*fd = pair[1];
usr.bin/tmux/proc.c
375
*fd = pair[0];
usr.bin/tmux/proc.c
74
proc_event_cb(__unused int fd, short events, void *arg)
usr.bin/tmux/proc.c
95
fd = imsg_get_fd(&imsg);
usr.bin/tmux/proc.c
96
if (fd != -1)
usr.bin/tmux/proc.c
97
close(fd);
usr.bin/tmux/procname.c
138
get_proc_cwd(int fd)
usr.bin/tmux/procname.c
144
if ((name[2] = tcgetpgrp(fd)) == -1)
usr.bin/tmux/procname.c
82
get_proc_name(int fd, char *tty)
usr.bin/tmux/procname.c
96
if ((mib[3] = tcgetpgrp(fd)) == -1)
usr.bin/tmux/screen-write.c
1016
screen_write_sync_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/screen-write.c
83
screen_write_offset_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/server-client.c
1871
if (wp->fd != -1) {
usr.bin/tmux/server-client.c
1910
server_client_resize_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/server-client.c
2257
server_client_repeat_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/server-client.c
2270
server_client_click_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/server-client.c
2345
server_client_redraw_timer(__unused int fd, __unused short events,
usr.bin/tmux/server-client.c
2635
if (c->fd == -1 || c->session == NULL) /* exited already */
usr.bin/tmux/server-client.c
279
server_client_create(int fd)
usr.bin/tmux/server-client.c
284
setblocking(fd, 0);
usr.bin/tmux/server-client.c
2862
c->fd = imsg_get_fd(imsg);
usr.bin/tmux/server-client.c
2863
log_debug("client %p IDENTIFY_STDIN %d", c, c->fd);
usr.bin/tmux/server-client.c
288
c->peer = proc_add_peer(server_proc, fd, server_client_dispatch, c);
usr.bin/tmux/server-client.c
2906
else if (c->fd != -1) {
usr.bin/tmux/server-client.c
2908
close(c->fd);
usr.bin/tmux/server-client.c
2909
c->fd = -1;
usr.bin/tmux/server-client.c
296
c->fd = -1;
usr.bin/tmux/server-client.c
551
if (c->fd != -1) {
usr.bin/tmux/server-client.c
552
close(c->fd);
usr.bin/tmux/server-client.c
553
c->fd = -1;
usr.bin/tmux/server-client.c
577
server_client_free(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/server-client.c
75
server_client_overlay_timer(__unused int fd, __unused short events, void *data)
usr.bin/tmux/server-fn.c
365
if (wp->fd != -1) {
usr.bin/tmux/server-fn.c
368
close(wp->fd);
usr.bin/tmux/server-fn.c
369
wp->fd = -1;
usr.bin/tmux/server.c
114
int fd, saved_errno;
usr.bin/tmux/server.c
125
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
usr.bin/tmux/server.c
132
if (bind(fd, (struct sockaddr *)&sa, sizeof sa) == -1) {
usr.bin/tmux/server.c
134
close(fd);
usr.bin/tmux/server.c
140
if (listen(fd, 128) == -1) {
usr.bin/tmux/server.c
142
close(fd);
usr.bin/tmux/server.c
146
setblocking(fd, 0);
usr.bin/tmux/server.c
148
return (fd);
usr.bin/tmux/server.c
160
server_tidy_event(__unused int fd, __unused short events, __unused void *data)
usr.bin/tmux/server.c
177
int fd;
usr.bin/tmux/server.c
187
if (proc_fork_and_daemon(&fd) != 0) {
usr.bin/tmux/server.c
189
return (fd);
usr.bin/tmux/server.c
224
c = server_client_create(fd);
usr.bin/tmux/server.c
365
server_accept(int fd, short events, __unused void *data)
usr.bin/tmux/server.c
376
newfd = accept(fd, (struct sockaddr *) &sa, &slen);
usr.bin/tmux/server.c
429
int fd;
usr.bin/tmux/server.c
443
fd = server_create_socket(server_client_flags, NULL);
usr.bin/tmux/server.c
444
if (fd != -1) {
usr.bin/tmux/server.c
446
server_fd = fd;
usr.bin/tmux/session.c
182
session_free(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/session.c
235
session_lock_timer(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/spawn.c
135
if (wp->fd != -1)
usr.bin/tmux/spawn.c
315
if (sc->wp0->fd != -1 && (~sc->flags & SPAWN_KILL)) {
usr.bin/tmux/spawn.c
326
if (sc->wp0->fd != -1) {
usr.bin/tmux/spawn.c
327
close(sc->wp0->fd);
usr.bin/tmux/spawn.c
328
sc->wp0->fd = -1;
usr.bin/tmux/spawn.c
464
new_wp->pid = fdforkpty(ptm_fd, &new_wp->fd, new_wp->tty, NULL, &ws);
usr.bin/tmux/spawn.c
467
new_wp->fd = -1;
usr.bin/tmux/spawn.c
683
int fd;
usr.bin/tmux/spawn.c
689
fd = mkstemp(path);
usr.bin/tmux/spawn.c
690
if (fd == -1)
usr.bin/tmux/spawn.c
692
f = fdopen(fd, "w");
usr.bin/tmux/spawn.c
694
close(fd);
usr.bin/tmux/status.c
38
status_timer_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/status.c
453
status_message_callback(__unused int fd, __unused short event, void *data)
usr.bin/tmux/tmux-protocol.h
102
int fd;
usr.bin/tmux/tmux-protocol.h
84
int fd;
usr.bin/tmux/tmux.c
262
setblocking(int fd, int state)
usr.bin/tmux/tmux.c
266
if ((mode = fcntl(fd, F_GETFL)) != -1) {
usr.bin/tmux/tmux.c
271
fcntl(fd, F_SETFL, mode);
usr.bin/tmux/tmux.h
1332
int fd;
usr.bin/tmux/tty-keys.c
1051
tty_keys_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty-term.c
682
tty_term_read_list(const char *name, int fd, char ***caps, u_int *ncaps,
usr.bin/tmux/tty-term.c
691
if (setupterm((char *)name, fd, &error) != OK) {
usr.bin/tmux/tty.c
102
if (!isatty(c->fd))
usr.bin/tmux/tty.c
113
if (tcgetattr(c->fd, &tty->tio) != 0)
usr.bin/tmux/tty.c
125
if (ioctl(c->fd, TIOCGWINSZ, &ws) != -1) {
usr.bin/tmux/tty.c
168
tty_read_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty.c
176
nread = evbuffer_read(tty->in, c->fd, -1);
usr.bin/tmux/tty.c
193
tty_timer_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty.c
243
tty_write_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty.c
250
nwrite = evbuffer_write(tty->out, c->fd);
usr.bin/tmux/tty.c
284
event_set(&tty->event_in, c->fd, EV_PERSIST|EV_READ,
usr.bin/tmux/tty.c
290
event_set(&tty->event_out, c->fd, EV_WRITE, tty_write_callback, tty);
usr.bin/tmux/tty.c
3055
tty_clipboard_query_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty.c
306
tty_start_timer_callback(__unused int fd, __unused short events, void *data)
usr.bin/tmux/tty.c
337
setblocking(c->fd, 0);
usr.bin/tmux/tty.c
348
if (tcsetattr(c->fd, TCSANOW, &tio) == 0)
usr.bin/tmux/tty.c
349
tcflush(c->fd, TCOFLUSH);
usr.bin/tmux/tty.c
458
if (ioctl(c->fd, TIOCGWINSZ, &ws) == -1)
usr.bin/tmux/tty.c
460
if (tcsetattr(c->fd, TCSANOW, &tty->tio) == -1)
usr.bin/tmux/tty.c
498
setblocking(c->fd, 1);
usr.bin/tmux/tty.c
564
n = write(c->fd, s, slen);
usr.bin/tmux/window-clock.c
148
window_clock_timer_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/window-copy.c
3040
window_copy_refresh_timer(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/window-copy.c
367
window_copy_scroll_timer(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/window-panes.c
877
window_panes_timer_callback(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/window-tree.c
946
cmd = get_proc_name(wp->fd, wp->tty);
usr.bin/tmux/window.c
1305
wp->fd = -1;
usr.bin/tmux/window.c
1379
window_pane_scrollbar_timer(__unused int fd, __unused short events, void *arg)
usr.bin/tmux/window.c
1432
if (wp->fd != -1) {
usr.bin/tmux/window.c
1435
close(wp->fd);
usr.bin/tmux/window.c
1436
wp->fd = -1;
usr.bin/tmux/window.c
1524
setblocking(wp->fd, 0);
usr.bin/tmux/window.c
1526
wp->event = bufferevent_new(wp->fd, window_pane_read_callback,
usr.bin/tmux/window.c
1874
loop->fd != -1 &&
usr.bin/tmux/window.c
1892
loop->fd != -1 &&
usr.bin/tmux/window.c
1906
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
usr.bin/tmux/window.c
1943
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
usr.bin/tmux/window.c
1967
return (wp->fd == -1 || (wp->flags & PANE_EXITED));
usr.bin/tmux/window.c
487
if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0)
usr.bin/tmux/window.c
588
if (wp->fd == -1)
usr.bin/tmux/window.c
598
if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
usr.bin/top/top.c
694
pfd[0].fd = STDIN_FILENO;
usr.bin/touch/touch.c
139
fd = open(*argv, O_WRONLY | O_CREAT, DEFFILEMODE);
usr.bin/touch/touch.c
140
if (fd == -1) {
usr.bin/touch/touch.c
145
if (futimens(fd, ts) == -1) {
usr.bin/touch/touch.c
149
if (close(fd) == -1) {
usr.bin/touch/touch.c
57
int aflag, cflag, mflag, ch, fd, len, rval, timeset;
usr.bin/tput/tput.c
157
tput_cmd(int fd, TTY * settings, int argc, char **argv, int *used)
usr.bin/tput/tput.c
177
reset_tty_settings(fd, settings, FALSE);
usr.bin/tput/tput.c
183
set_window_size(fd, &lines, &columns);
usr.bin/tput/tput.c
185
(void) fd;
usr.bin/tput/tput.c
190
if (send_init_strings(fd, &oldmode)) {
usr.bin/tput/tput.c
383
int fd;
usr.bin/tput/tput.c
447
fd = save_tty_settings(&tty_settings, need_tty);
usr.bin/tput/tput.c
450
if (setupterm(term, fd, &errret) != OK && errret <= 0)
usr.bin/tput/tput.c
459
code = tput_cmd(fd, &tty_settings, argc, argv, &used);
usr.bin/tput/tput.c
494
code = tput_cmd(fd, &tty_settings, argnum, argnow, &used);
usr.bin/tset/tset.c
100
char *ttyname(int fd);
usr.bin/tset/tset.c
545
get_termcap_entry(int fd, char *userarg)
usr.bin/tset/tset.c
559
(void) fd;
usr.bin/tset/tset.c
571
if ((ttypath = ttyname(fd)) != 0) {
usr.bin/tset/tset.c
647
while (setupterm((NCURSES_CONST char *) ttype, fd, &errret)
usr.bin/unifdef/unifdef.c
1587
int fd = mkstemp(tmp);
usr.bin/unifdef/unifdef.c
1588
if (fd == -1)
usr.bin/unifdef/unifdef.c
1590
fchmod(fd, mode & (S_IRWXU|S_IRWXG|S_IRWXO));
usr.bin/unifdef/unifdef.c
1591
return (fdopen(fd, "wb"));
usr.bin/usbhidaction/usbhidaction.c
135
fd = open(dev, O_RDWR | O_CLOEXEC);
usr.bin/usbhidaction/usbhidaction.c
136
if (fd == -1)
usr.bin/usbhidaction/usbhidaction.c
139
if (ioctl(fd, USB_GET_REPORT_ID, &reportid) == -1)
usr.bin/usbhidaction/usbhidaction.c
141
repd = hid_get_report_desc(fd);
usr.bin/usbhidaction/usbhidaction.c
173
n = read(fd, buf, sz);
usr.bin/usbhidaction/usbhidaction.c
85
int fd, ch, sz, n, val, i;
usr.bin/uudecode/uudecode.c
187
int flags, fd, mode;
usr.bin/uudecode/uudecode.c
298
if ((fd = open(outfile, flags, mode)) == -1 ||
usr.bin/uudecode/uudecode.c
299
(outfp = fdopen(fd, "w")) == NULL) {
usr.bin/vi/cl/cl_main.c
161
int fd;
usr.bin/vi/cl/cl_main.c
186
} else if ((fd = open(_PATH_TTY, O_RDONLY)) != -1) {
usr.bin/vi/cl/cl_main.c
187
if (tcgetattr(fd, &clp->orig) == -1)
usr.bin/vi/cl/cl_main.c
189
(void)close(fd);
usr.bin/vi/cl/cl_read.c
165
pfd[0].fd = STDIN_FILENO;
usr.bin/vi/common/exf.c
125
int fd, exists, open_err, readonly;
usr.bin/vi/common/exf.c
1386
file_lock(SCR *sp, char *name, int *fdp, int fd, int iswrite)
usr.bin/vi/common/exf.c
1392
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
usr.bin/vi/common/exf.c
1403
return (flock(fd, LOCK_EX | LOCK_NB) ?
usr.bin/vi/common/exf.c
192
fd = mkstemp(tname);
usr.bin/vi/common/exf.c
193
if (fd == -1 || fstat(fd, &sb) == -1 ||
usr.bin/vi/common/exf.c
194
fchmod(fd, S_IRUSR | S_IWUSR) == -1) {
usr.bin/vi/common/exf.c
197
if (fd != -1) {
usr.bin/vi/common/exf.c
198
close(fd);
usr.bin/vi/common/exf.c
203
(void)close(fd);
usr.bin/vi/common/exf.c
345
&ep->fcntl_fd, ep->db->fd(ep->db), 0)) {
usr.bin/vi/common/exf.c
742
int fd, nf, noname, oflags, rval;
usr.bin/vi/common/exf.c
828
if ((fd = open(name, oflags,
usr.bin/vi/common/exf.c
835
if (!noname && file_lock(sp, NULL, NULL, fd, 0) == LOCK_UNAVAIL)
usr.bin/vi/common/exf.c
846
if ((fp = fdopen(fd, LF_ISSET(FS_APPEND) ? "a" : "w")) == NULL) {
usr.bin/vi/common/exf.c
848
(void)close(fd);
usr.bin/vi/common/main.c
578
int fd;
usr.bin/vi/common/main.c
581
if ((fd = open(_PATH_TTY, O_RDONLY)) < 0) {
usr.bin/vi/common/main.c
591
if (read(fd, &ch, 1) != 1) {
usr.bin/vi/common/main.c
592
(void)close(fd);
usr.bin/vi/common/main.c
596
(void)close(fd);
usr.bin/vi/common/recover.c
128
int fd;
usr.bin/vi/common/recover.c
156
if ((fd = rcv_mktemp(sp, path, dp, S_IRWXU)) == -1)
usr.bin/vi/common/recover.c
158
(void)close(fd);
usr.bin/vi/common/recover.c
245
int fd, rval;
usr.bin/vi/common/recover.c
289
if ((fd = rcv_mktemp(sp, buf, dp, S_IRUSR | S_IWUSR)) == -1)
usr.bin/vi/common/recover.c
293
if (rcv_copy(sp, fd, ep->rcv_path) ||
usr.bin/vi/common/recover.c
294
close(fd) || rcv_mailfile(sp, 1, buf)) {
usr.bin/vi/common/recover.c
296
(void)close(fd);
usr.bin/vi/common/recover.c
324
int fd;
usr.bin/vi/common/recover.c
339
if ((fd = rcv_mktemp(sp, mpath, dp, S_IRUSR | S_IWUSR)) == -1)
usr.bin/vi/common/recover.c
350
if (file_lock(sp, NULL, NULL, fd, 1) != LOCK_SUCCESS)
usr.bin/vi/common/recover.c
354
ep->rcv_fd = fd;
usr.bin/vi/common/recover.c
388
if (write(fd, buf, len) != len)
usr.bin/vi/common/recover.c
434
if (write(fd, t1, t2 - t1) != t2 - t1)
usr.bin/vi/common/recover.c
439
rcv_email(sp, fd);
usr.bin/vi/common/recover.c
440
if (close(fd)) {
usr.bin/vi/common/recover.c
449
if (fd != -1)
usr.bin/vi/common/recover.c
450
(void)close(fd);
usr.bin/vi/common/recover.c
464
int fd, dummy;
usr.bin/vi/common/recover.c
470
fd = openat(dfd, name, O_RDONLY|O_NOFOLLOW|O_NONBLOCK);
usr.bin/vi/common/recover.c
471
if (fd == -1)
usr.bin/vi/common/recover.c
478
if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode) ||
usr.bin/vi/common/recover.c
484
switch ((*locked = file_lock(sp, NULL, NULL, fd, 0))) {
usr.bin/vi/common/recover.c
500
return fd;
usr.bin/vi/common/recover.c
502
if (fd != -1)
usr.bin/vi/common/recover.c
503
close(fd);
usr.bin/vi/common/recover.c
523
int fd;
usr.bin/vi/common/recover.c
542
if ((fd = rcv_openat(sp, dirfd(dirp), dp->d_name, NULL)) == -1)
usr.bin/vi/common/recover.c
546
if ((fp = fdopen(fd, "r")) == NULL) {
usr.bin/vi/common/recover.c
547
close(fd);
usr.bin/vi/common/recover.c
578
(void)fstat(fd, &sb);
usr.bin/vi/common/recover.c
606
int fd, found, lck, requested, sv_fd;
usr.bin/vi/common/recover.c
629
if ((fd = rcv_openat(sp, dirfd(dirp), dp->d_name, &lck)) == -1)
usr.bin/vi/common/recover.c
633
if (rcv_gets(file, sizeof(file), fd) == NULL ||
usr.bin/vi/common/recover.c
636
rcv_gets(path, sizeof(path), fd) == NULL ||
usr.bin/vi/common/recover.c
670
(void)fstat(fd, &sb);
usr.bin/vi/common/recover.c
694
sv_fd = fd;
usr.bin/vi/common/recover.c
696
next: (void)close(fd);
usr.bin/vi/common/recover.c
771
rcv_gets(char *buf, size_t len, int fd)
usr.bin/vi/common/recover.c
776
if ((nr = read(fd, buf, len - 1)) == -1)
usr.bin/vi/common/recover.c
781
(void)lseek(fd, (off_t)((p - buf) + 1), SEEK_SET);
usr.bin/vi/common/recover.c
792
int fd;
usr.bin/vi/common/recover.c
803
if ((fd = mkstemp(path)) == -1 || fchmod(fd, perms) == -1) {
usr.bin/vi/common/recover.c
805
if (fd != -1) {
usr.bin/vi/common/recover.c
806
close(fd);
usr.bin/vi/common/recover.c
808
fd = -1;
usr.bin/vi/common/recover.c
811
return (fd);
usr.bin/vi/common/recover.c
819
rcv_email(SCR *sp, int fd)
usr.bin/vi/common/recover.c
849
if (lseek(fd, 0, SEEK_SET) == -1) {
usr.bin/vi/common/recover.c
853
if (fd != STDIN_FILENO) {
usr.bin/vi/common/recover.c
854
if (dup2(fd, STDIN_FILENO) == -1) {
usr.bin/vi/common/recover.c
858
close(fd);
usr.bin/vi/ex/ex_filter.c
47
int input[2], output[2], fd, rval;
usr.bin/vi/ex/ex_filter.c
82
fd = mkstemp(tname);
usr.bin/vi/ex/ex_filter.c
83
if (fd == -1) {
usr.bin/vi/ex/ex_filter.c
86
if (fd != -1) {
usr.bin/vi/ex/ex_filter.c
87
(void)close(fd);
usr.bin/vi/ex/ex_filter.c
94
if ((ifp = fdopen(fd, "w")) == NULL) {
usr.bin/vi/ex/ex_filter.c
96
(void)close(fd);
usr.bin/vi/ex/ex_filter.c
99
if ((input[0] = dup(fd)) == -1) {
usr.bin/vi/ex/ex_init.c
134
int fd;
usr.bin/vi/ex/ex_init.c
160
switch (exrc_isok(sp, &hsb, &fd, _PATH_SYSEXRC, 1, 0)) {
usr.bin/vi/ex/ex_init.c
165
if (ex_run_file(sp, fd, _PATH_SYSEXRC))
usr.bin/vi/ex/ex_init.c
184
switch (exrc_isok(sp, &hsb, &fd, path, 0, 1)) {
usr.bin/vi/ex/ex_init.c
188
if (exrc_isok(sp, &hsb, &fd, path, 0, 1) == RCOK &&
usr.bin/vi/ex/ex_init.c
189
ex_run_file(sp, fd, path))
usr.bin/vi/ex/ex_init.c
195
if (ex_run_file(sp, fd, path))
usr.bin/vi/ex/ex_init.c
209
switch (exrc_isok(sp, &lsb, &fd, _PATH_NEXRC, 0, 0)) {
usr.bin/vi/ex/ex_init.c
211
if (exrc_isok(sp, &lsb, &fd, _PATH_EXRC, 0, 0)
usr.bin/vi/ex/ex_init.c
215
if (ex_run_file(sp, fd, _PATH_EXRC))
usr.bin/vi/ex/ex_init.c
218
close(fd);
usr.bin/vi/ex/ex_init.c
226
if (ex_run_file(sp, fd, _PATH_NEXRC))
usr.bin/vi/ex/ex_init.c
229
close(fd);
usr.bin/vi/ex/ex_init.c
247
ex_run_file(SCR *sp, int fd, char *name)
usr.bin/vi/ex/ex_init.c
254
return (ex_sourcefd(sp, &cmd, fd));
usr.bin/vi/ex/ex_mkexrc.c
42
int fd, sverrno;
usr.bin/vi/ex/ex_mkexrc.c
64
if ((fd = open(fname, O_CREAT | O_TRUNC | O_WRONLY,
usr.bin/vi/ex/ex_mkexrc.c
70
if ((fp = fdopen(fd, "w")) == NULL) {
usr.bin/vi/ex/ex_mkexrc.c
72
(void)close(fd);
usr.bin/vi/ex/ex_script.c
201
pfd[0].fd = sc->sh_master;
usr.bin/vi/ex/ex_script.c
369
pfd[0].fd = STDIN_FILENO;
usr.bin/vi/ex/ex_script.c
374
pfd[nfds].fd = sp->script->sh_master;
usr.bin/vi/ex/ex_script.c
443
pfd[nfds].fd = sp->script->sh_master;
usr.bin/vi/ex/ex_script.c
537
pfd[0].fd = sc->sh_master;
usr.bin/vi/ex/ex_source.c
36
ex_sourcefd(SCR *sp, EXCMD *cmdp, int fd)
usr.bin/vi/ex/ex_source.c
43
if (fstat(fd, &sb))
usr.bin/vi/ex/ex_source.c
63
(void)close(fd);
usr.bin/vi/ex/ex_source.c
69
len = read(fd, bp, (int)sb.st_size);
usr.bin/vi/ex/ex_source.c
70
(void)close(fd);
usr.bin/vi/ex/ex_source.c
93
int fd;
usr.bin/vi/ex/ex_source.c
96
if ((fd = open(name, O_RDONLY)) >= 0)
usr.bin/vi/ex/ex_source.c
97
return (ex_sourcefd(sp, cmdp, fd));
usr.bin/vi/ex/ex_tag.c
1007
if (fstat(fd, &sb) != 0 ||
usr.bin/vi/ex/ex_tag.c
1009
MAP_PRIVATE, fd, (off_t)0)) == MAP_FAILED) {
usr.bin/vi/ex/ex_tag.c
1011
(void)close(fd);
usr.bin/vi/ex/ex_tag.c
1105
if (close(fd))
usr.bin/vi/ex/ex_tag.c
991
int fd, i, nf1, nf2;
usr.bin/vi/ex/ex_tag.c
994
if ((fd = open(tfp->name, O_RDONLY)) < 0) {
usr.bin/wall/ttymsg.c
101
close(fd);
usr.bin/wall/ttymsg.c
110
wret = writev(fd, iov, iovcnt);
usr.bin/wall/ttymsg.c
138
(void) close(fd);
usr.bin/wall/ttymsg.c
145
(void) close(fd);
usr.bin/wall/ttymsg.c
149
(void) close(fd);
usr.bin/wall/ttymsg.c
163
(void) fcntl(fd, O_NONBLOCK, &off);
usr.bin/wall/ttymsg.c
172
(void) close(fd);
usr.bin/wall/ttymsg.c
180
(void) close(fd);
usr.bin/wall/ttymsg.c
61
int cnt, fd, left, wret;
usr.bin/wall/ttymsg.c
90
if ((fd = open(device, O_WRONLY|O_NONBLOCK)) == -1) {
usr.bin/wall/ttymsg.c
99
if (fstat(fd, &st) == -1 ||
usr.bin/wall/wall.c
183
int fd;
usr.bin/wall/wall.c
189
if ((fd = mkstemp(tmpname)) >= 0) {
usr.bin/wall/wall.c
191
fp = fdopen(fd, "r+");
usr.bin/wall/wall.c
193
if (fd == -1 || fp == NULL)
usr.bin/wall/wall.c
249
if (fstat(fd, &sbuf))
usr.bin/wall/wall.c
257
(void)close(fd);
usr.bin/watch/watch.c
480
child->fd = fds[0];
usr.bin/watch/watch.c
482
event_set(&child->evin, child->fd, EV_READ | EV_PERSIST, child_input, child);
usr.bin/watch/watch.c
505
close(child->fd);
usr.bin/watch/watch.c
553
n = read(child->fd, child->buf + child->pos, child->bufsiz - child->pos);
usr.bin/watch/watch.c
99
int fd;
usr.bin/wc/wc.c
131
int fd;
usr.bin/wc/wc.c
137
if ((fd = open(file, O_RDONLY)) == -1) {
usr.bin/wc/wc.c
144
fd = STDIN_FILENO;
usr.bin/wc/wc.c
159
while ((len = read(fd, buf, _MAXBSIZE)) > 0) {
usr.bin/wc/wc.c
183
while ((len = read(fd, buf, _MAXBSIZE)) > 0) {
usr.bin/wc/wc.c
202
if (fstat(fd, &sbuf)) {
usr.bin/wc/wc.c
209
while ((len = read(fd, buf, _MAXBSIZE)) > 0)
usr.bin/wc/wc.c
221
else if ((stream = fdopen(fd, "r")) == NULL) {
usr.bin/wc/wc.c
223
close(fd);
usr.bin/wc/wc.c
267
if ((stream == NULL ? close(fd) : fclose(stream)) != 0) {
usr.bin/write/write.c
230
int fd;
usr.bin/write/write.c
237
fd = open(path, O_WRONLY);
usr.bin/write/write.c
238
if (fd == -1)
usr.bin/write/write.c
241
if (dup2(fd, STDOUT_FILENO) == -1)
usr.bin/write/write.c
243
if (fd != STDOUT_FILENO)
usr.bin/write/write.c
244
close(fd);
usr.bin/xargs/xargs.c
500
int fd;
usr.bin/xargs/xargs.c
539
if ((fd = open(_PATH_TTY, O_RDONLY)) == -1) {
usr.bin/xargs/xargs.c
544
fd = open(_PATH_DEVNULL, O_RDONLY);
usr.bin/xargs/xargs.c
546
if (fd > STDIN_FILENO) {
usr.bin/xargs/xargs.c
547
if (dup2(fd, STDIN_FILENO) != 0) {
usr.bin/xargs/xargs.c
551
close(fd);
usr.bin/xinstall/xinstall.c
690
file_write(int fd, char *str, size_t cnt, int *rem, int *isempt, int sz)
usr.bin/xinstall/xinstall.c
736
if (lseek(fd, (off_t)wcnt, SEEK_CUR) == -1) {
usr.bin/xinstall/xinstall.c
752
if (write(fd, st, wcnt) != wcnt) {
usr.bin/xinstall/xinstall.c
768
file_flush(int fd, int isempt)
usr.bin/xinstall/xinstall.c
782
if (lseek(fd, (off_t)-1, SEEK_CUR) == -1) {
usr.bin/xinstall/xinstall.c
787
if (write(fd, blnk, 1) == -1)
usr.sbin/acme-client/acctproc.c
136
op_thumbprint(int fd, EVP_PKEY *pkey)
usr.sbin/acme-client/acctproc.c
175
if (writestr(fd, COMM_THUMB, dig64) < 0)
usr.sbin/acme-client/acctproc.c
250
op_sign(int fd, EVP_PKEY *pkey, enum acctop op)
usr.sbin/acme-client/acctproc.c
268
if ((pay = readstr(fd, COMM_PAY)) == NULL)
usr.sbin/acme-client/acctproc.c
270
else if ((nonce = readstr(fd, COMM_NONCE)) == NULL)
usr.sbin/acme-client/acctproc.c
272
else if ((url = readstr(fd, COMM_URL)) == NULL)
usr.sbin/acme-client/acctproc.c
276
if ((kid = readstr(fd, COMM_KID)) == NULL)
usr.sbin/acme-client/acctproc.c
426
} else if (writestr(fd, COMM_REQ, fin) < 0)
usr.sbin/acme-client/acctproc.c
450
op_eab(int fd, EVP_PKEY *pkey, const char *eab_kid,
usr.sbin/acme-client/acctproc.c
462
if ((url = readstr(fd, COMM_URL)) == NULL)
usr.sbin/acme-client/acctproc.c
518
} else if (writestr(fd, COMM_REQ, fin) < 0) {
usr.sbin/acme-client/chngproc.c
120
fd = open(fs[fsz - 1], O_WRONLY|O_CREAT|O_TRUNC, 0444);
usr.sbin/acme-client/chngproc.c
121
if (fd == -1) {
usr.sbin/acme-client/chngproc.c
125
if (write(fd, fmt, strlen(fmt)) == -1) {
usr.sbin/acme-client/chngproc.c
129
if (close(fd) == -1) {
usr.sbin/acme-client/chngproc.c
133
fd = -1;
usr.sbin/acme-client/chngproc.c
156
if (fd != -1)
usr.sbin/acme-client/chngproc.c
157
close(fd);
usr.sbin/acme-client/chngproc.c
35
int rc = 0, fd = -1, cc;
usr.sbin/acme-client/fileproc.c
34
int fd;
usr.sbin/acme-client/fileproc.c
59
if ((fd = mkstemp(tmp)) == -1) {
usr.sbin/acme-client/fileproc.c
63
if (fchmod(fd, 0444) == -1) {
usr.sbin/acme-client/fileproc.c
67
if ((ssize_t)vsz != write(fd, v, vsz)) {
usr.sbin/acme-client/fileproc.c
71
if (v2 != NULL && write(fd, v2, v2sz) != (ssize_t)v2sz) {
usr.sbin/acme-client/fileproc.c
75
if (close(fd) == -1)
usr.sbin/acme-client/fileproc.c
85
if (fd != -1)
usr.sbin/acme-client/fileproc.c
86
close(fd);
usr.sbin/acme-client/http.c
174
if (http->fd != -1) {
usr.sbin/acme-client/http.c
175
if (close(http->fd) == -1)
usr.sbin/acme-client/http.c
179
http->fd = -1;
usr.sbin/acme-client/http.c
201
int family, fd, c;
usr.sbin/acme-client/http.c
245
fd = socket(family, SOCK_STREAM, 0);
usr.sbin/acme-client/http.c
246
if (fd == -1) {
usr.sbin/acme-client/http.c
249
} else if (connect(fd, (struct sockaddr *)&ss, len) == -1) {
usr.sbin/acme-client/http.c
251
close(fd);
usr.sbin/acme-client/http.c
260
close(fd);
usr.sbin/acme-client/http.c
263
http->fd = fd;
usr.sbin/acme-client/http.c
283
if (tls_connect_socket(http->ctx, http->fd, http->host) != 0) {
usr.sbin/acme-client/http.c
57
int fd; /* connected socket */
usr.sbin/acme-client/netproc.c
135
urlresolve(int fd, const char *host, struct source *v)
usr.sbin/acme-client/netproc.c
141
if (writeop(fd, COMM_DNS, DNS_LOOKUP) <= 0)
usr.sbin/acme-client/netproc.c
143
else if (writestr(fd, COMM_DNSQ, host) <= 0)
usr.sbin/acme-client/netproc.c
145
else if ((lval = readop(fd, COMM_DNSLEN)) < 0)
usr.sbin/acme-client/netproc.c
153
if ((lval = readop(fd, COMM_DNSF)) < 0)
usr.sbin/acme-client/netproc.c
157
else if ((addr = readstr(fd, COMM_DNSA)) == NULL)
usr.sbin/acme-client/netproc.c
298
if (writeop(c->fd, COMM_ACCT, kid ? ACCT_KID_SIGN : ACCT_SIGN) <= 0) {
usr.sbin/acme-client/netproc.c
301
} else if (writestr(c->fd, COMM_PAY, req) <= 0) {
usr.sbin/acme-client/netproc.c
304
} else if (writestr(c->fd, COMM_NONCE, nonce) <= 0) {
usr.sbin/acme-client/netproc.c
307
} else if (writestr(c->fd, COMM_URL, addr) <= 0) {
usr.sbin/acme-client/netproc.c
313
if (kid && writestr(c->fd, COMM_KID, c->kid) <= 0)
usr.sbin/acme-client/netproc.c
317
if ((reqsn = readstr(c->fd, COMM_REQ)) == NULL)
usr.sbin/acme-client/netproc.c
422
if (writeop(c->fd, COMM_ACCT, ACCT_EAB) <= 0) {
usr.sbin/acme-client/netproc.c
424
} else if (writestr(c->fd, COMM_URL, p->newaccount) <= 0) {
usr.sbin/acme-client/netproc.c
429
if ((eab_json = readstr(c->fd, COMM_REQ)) == NULL) {
usr.sbin/acme-client/netproc.c
51
int fd; /* acctproc handle */
usr.sbin/acme-client/netproc.c
815
c.fd = afd;
usr.sbin/acme-client/revokeproc.c
130
(void)writeop(fd, COMM_REVOKE_RESP, REVOKE_OK);
usr.sbin/acme-client/revokeproc.c
133
if (writeop(fd, COMM_REVOKE_RESP, REVOKE_EXP) >= 0)
usr.sbin/acme-client/revokeproc.c
319
cc = writeop(fd, COMM_REVOKE_RESP, REVOKE_EXP);
usr.sbin/acme-client/revokeproc.c
337
} else if (writestr(fd, COMM_CSR, der64) >= 0)
usr.sbin/acme-client/revokeproc.c
384
if ((cc = writeop(fd, COMM_REVOKE_RESP, rop)) == 0)
usr.sbin/acme-client/revokeproc.c
390
if ((lval = readop(fd, COMM_REVOKE_OP)) == 0)
usr.sbin/acme-client/revokeproc.c
405
close(fd);
usr.sbin/acme-client/revokeproc.c
86
revokeproc(int fd, const char *certfile, int force,
usr.sbin/acme-client/util.c
100
return readbuf(fd, comm, &sz);
usr.sbin/acme-client/util.c
110
readbuf(int fd, enum comm comm, size_t *sz)
usr.sbin/acme-client/util.c
116
if ((ssz = read(fd, sz, sizeof(size_t))) == -1) {
usr.sbin/acme-client/util.c
135
if ((ssz = read(fd, p + rsz, lsz)) == -1) {
usr.sbin/acme-client/util.c
159
writeop(int fd, enum comm comm, long op)
usr.sbin/acme-client/util.c
164
if ((ssz = write(fd, &op, sizeof(long))) == -1) {
usr.sbin/acme-client/util.c
183
writebuf(int fd, enum comm comm, const void *v, size_t sz)
usr.sbin/acme-client/util.c
194
if ((ssz = write(fd, &sz, sizeof(size_t))) == -1) {
usr.sbin/acme-client/util.c
204
else if ((ssz = write(fd, v, sz)) == -1) {
usr.sbin/acme-client/util.c
218
writestr(int fd, enum comm comm, const char *v)
usr.sbin/acme-client/util.c
221
return writebuf(fd, comm, v, strlen(v));
usr.sbin/acme-client/util.c
77
readop(int fd, enum comm comm)
usr.sbin/acme-client/util.c
82
ssz = read(fd, &op, sizeof(long));
usr.sbin/acme-client/util.c
96
readstr(int fd, enum comm comm)
usr.sbin/acpidump/acpidump.c
365
int fd;
usr.sbin/acpidump/acpidump.c
375
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, mode);
usr.sbin/acpidump/acpidump.c
376
if (fd == -1)
usr.sbin/acpidump/acpidump.c
379
write(fd, hdr, SIZEOF_SDT_HDR);
usr.sbin/acpidump/acpidump.c
380
write(fd, hdr->body, hdr->len - SIZEOF_SDT_HDR);
usr.sbin/acpidump/acpidump.c
381
close(fd);
usr.sbin/apm/apm.c
123
ret = send_command(fd, &command, &reply);
usr.sbin/apm/apm.c
160
int ch, fd, rval;
usr.sbin/apm/apm.c
258
fd = open_socket(sockname);
usr.sbin/apm/apm.c
260
if (fd != -1) {
usr.sbin/apm/apm.c
266
if (fd < 0)
usr.sbin/apm/apm.c
269
return (do_zzz(fd, action));
usr.sbin/apm/apm.c
271
if (fd < 0)
usr.sbin/apm/apm.c
274
return (do_zzz(fd, HIBERNATE));
usr.sbin/apm/apm.c
294
if (fd == -1)
usr.sbin/apm/apm.c
303
if (fd == -1) {
usr.sbin/apm/apm.c
305
fd = open(_PATH_APM_NORMAL, O_RDONLY);
usr.sbin/apm/apm.c
306
if (ioctl(fd, APM_IOC_GETPOWER,
usr.sbin/apm/apm.c
325
if (fd != -1 && (rval = send_command(fd, &command, &reply)) != 0)
usr.sbin/apm/apm.c
77
send_command(int fd, struct apm_command *cmd, struct apm_reply *reply)
usr.sbin/apm/apm.c
82
if (send(fd, cmd, sizeof(*cmd), 0) == sizeof(*cmd)) {
usr.sbin/apm/apm.c
83
if (recv(fd, reply, sizeof(*reply), 0) != sizeof(*reply)) {
usr.sbin/apm/apm.c
95
do_zzz(int fd, enum apm_action action)
usr.sbin/apmd/apmd.c
130
set_driver_messages(int fd, int mode)
usr.sbin/apmd/apmd.c
132
if (ioctl(fd, APM_IOC_PRN_CTL, &mode) == -1)
usr.sbin/apmd/apmd.c
138
power_status(int fd, int force, struct apm_power_info *pinfo)
usr.sbin/apmd/apmd.c
144
if (fd == -1) {
usr.sbin/apmd/apmd.c
156
if (ioctl(fd, APM_IOC_GETPOWER, &bstate) == 0) {
usr.sbin/apmd/apmd.c
327
int fd;
usr.sbin/apmd/apmd.c
329
fd = open("/etc/random.seed", O_WRONLY);
usr.sbin/apmd/apmd.c
330
if (fd != -1) {
usr.sbin/apmd/apmd.c
332
write(fd, buf, sizeof buf);
usr.sbin/apmd/apmd.c
333
fchmod(fd, 0600);
usr.sbin/apmd/apmd.c
334
close(fd);
usr.sbin/apmd/apmd.c
65
int power_status(int fd, int force, struct apm_power_info *pinfo);
usr.sbin/apmd/apmd.c
77
void set_driver_messages(int fd, int mode);
usr.sbin/bgpctl/bgpctl.c
165
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
usr.sbin/bgpctl/bgpctl.c
173
if (connect(fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) == -1)
usr.sbin/bgpctl/bgpctl.c
181
if (imsgbuf_init(imsgbuf, fd) == -1 ||
usr.sbin/bgpctl/bgpctl.c
456
close(fd);
usr.sbin/bgpctl/bgpctl.c
85
int fd, n, done, numdone, ch, verbose = 0;
usr.sbin/bgpctl/mrtparser.c
100
mrt_parse(int fd, struct mrt_parser *p, int verbose)
usr.sbin/bgpctl/mrtparser.c
109
while ((msg = mrt_read_msg(fd, &h)) != NULL) {
usr.sbin/bgpctl/mrtparser.c
56
mrt_read_buf(int fd, void *buf, size_t len)
usr.sbin/bgpctl/mrtparser.c
62
if ((n = read(fd, b, len)) == -1) {
usr.sbin/bgpctl/mrtparser.c
77
mrt_read_msg(int fd, struct mrt_hdr *hdr)
usr.sbin/bgpctl/mrtparser.c
83
if (mrt_read_buf(fd, hdr, sizeof(*hdr)) != sizeof(*hdr))
usr.sbin/bgpctl/mrtparser.c
92
if (mrt_read_buf(fd, ibuf_reserve(buf, len), len) != len) {
usr.sbin/bgpd/bgpd.c
1199
int fd, restricted;
usr.sbin/bgpd/bgpd.c
1210
if ((fd = control_init(0, cname)) == -1)
usr.sbin/bgpd/bgpd.c
1212
if (control_listen(fd) == -1)
usr.sbin/bgpd/bgpd.c
1215
if (imsg_compose(ibuf_se, IMSG_RECONF_CTRL, 0, 0, fd,
usr.sbin/bgpd/bgpd.c
1231
if ((fd = control_init(1, rcname)) == -1)
usr.sbin/bgpd/bgpd.c
1233
if (control_listen(fd) == -1)
usr.sbin/bgpd/bgpd.c
1236
if (imsg_compose(ibuf_se, IMSG_RECONF_CTRL, 0, 0, fd,
usr.sbin/bgpd/bgpd.c
1246
if (i == NULL || i->fd == -1) {
usr.sbin/bgpd/bgpd.c
1247
pfd->fd = -1;
usr.sbin/bgpd/bgpd.c
1250
pfd->fd = i->fd;
usr.sbin/bgpd/bgpd.c
1267
close(i->fd);
usr.sbin/bgpd/bgpd.c
1268
i->fd = -1;
usr.sbin/bgpd/bgpd.c
1275
close(i->fd);
usr.sbin/bgpd/bgpd.c
1276
i->fd = -1;
usr.sbin/bgpd/bgpd.c
1281
close(i->fd);
usr.sbin/bgpd/bgpd.c
1282
i->fd = -1;
usr.sbin/bgpd/bgpd.c
1374
ce->fd = -1;
usr.sbin/bgpd/bgpd.c
1383
ce->fd = socket(aid2af(r->remote_addr.aid),
usr.sbin/bgpd/bgpd.c
1385
if (ce->fd == -1) {
usr.sbin/bgpd/bgpd.c
1392
if (setsockopt(ce->fd, IPPROTO_IP, IP_TOS, &pre, sizeof(pre)) ==
usr.sbin/bgpd/bgpd.c
1399
if (setsockopt(ce->fd, IPPROTO_IPV6, IPV6_TCLASS, &pre,
usr.sbin/bgpd/bgpd.c
1407
if (setsockopt(ce->fd, IPPROTO_TCP, TCP_NODELAY, &nodelay,
usr.sbin/bgpd/bgpd.c
1413
if (tcp_md5_set(ce->fd, &r->auth, &r->remote_addr) == -1) {
usr.sbin/bgpd/bgpd.c
1419
if (bind(ce->fd, sa, len) == -1) {
usr.sbin/bgpd/bgpd.c
1427
if (connect(ce->fd, sa, len) == -1) {
usr.sbin/bgpd/bgpd.c
1438
imsg_compose(ibuf_rtr, IMSG_SOCKET_SETUP, ce->id, 0, ce->fd, NULL, 0);
usr.sbin/bgpd/bgpd.c
1443
if (ce->fd != -1)
usr.sbin/bgpd/bgpd.c
1444
close(ce->fd);
usr.sbin/bgpd/bgpd.c
1450
bgpd_rtr_conn_setup_done(int fd, struct bgpd_config *conf)
usr.sbin/bgpd/bgpd.c
1458
if (ce->fd == fd)
usr.sbin/bgpd/bgpd.c
1477
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
usr.sbin/bgpd/bgpd.c
1489
imsg_compose(ibuf_rtr, IMSG_SOCKET_SETUP, ce->id, 0, ce->fd, NULL, 0);
usr.sbin/bgpd/bgpd.c
1494
close(fd);
usr.sbin/bgpd/bgpd.c
344
pfd[PFD_SOCK_ROUTE].fd = rfd;
usr.sbin/bgpd/bgpd.c
347
pfd[PFD_SOCK_PFKEY].fd = keyfd;
usr.sbin/bgpd/bgpd.c
356
pfd[npfd].fd = ce->fd;
usr.sbin/bgpd/bgpd.c
422
bgpd_rtr_conn_setup_done(pfd[i].fd, conf);
usr.sbin/bgpd/bgpd.c
462
close(ibuf_se->fd);
usr.sbin/bgpd/bgpd.c
468
close(ibuf_rde->fd);
usr.sbin/bgpd/bgpd.c
474
close(ibuf_rtr->fd);
usr.sbin/bgpd/bgpd.c
520
start_child(enum bgpd_process p, char *argv0, int fd, int debug, int verbose)
usr.sbin/bgpd/bgpd.c
532
close(fd);
usr.sbin/bgpd/bgpd.c
536
if (fd != 3) {
usr.sbin/bgpd/bgpd.c
537
if (dup2(fd, 3) == -1)
usr.sbin/bgpd/bgpd.c
539
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/bgpd/bgpd.c
621
if (imsg_compose(ibuf_se, IMSG_RECONF_LISTENER, 0, 0, la->fd,
usr.sbin/bgpd/bgpd.c
624
la->fd = -1;
usr.sbin/bgpd/bgpd.c
76
int fd;
usr.sbin/bgpd/bgpd.h
1571
int fd;
usr.sbin/bgpd/bgpd.h
247
int fd;
usr.sbin/bgpd/config.c
593
if ((la->fd = socket(la->sa.ss_family,
usr.sbin/bgpd/config.c
606
if (setsockopt(la->fd, SOL_SOCKET, SO_REUSEADDR,
usr.sbin/bgpd/config.c
610
if (bind(la->fd, (struct sockaddr *)&la->sa, la->sa_len) ==
usr.sbin/bgpd/config.c
631
close(la->fd);
usr.sbin/bgpd/control.c
105
if (bind(fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) == -1) {
usr.sbin/bgpd/control.c
107
close(fd);
usr.sbin/bgpd/control.c
116
close(fd);
usr.sbin/bgpd/control.c
121
return (fd);
usr.sbin/bgpd/control.c
125
control_listen(int fd)
usr.sbin/bgpd/control.c
127
if (fd != -1 && listen(fd, CONTROL_BACKLOG) == -1) {
usr.sbin/bgpd/control.c
136
control_shutdown(int fd)
usr.sbin/bgpd/control.c
138
close(fd);
usr.sbin/bgpd/control.c
148
pfd[i].fd = ctl_conn->imsgbuf.fd;
usr.sbin/bgpd/control.c
201
control_connbyfd(int fd)
usr.sbin/bgpd/control.c
206
if (c->imsgbuf.fd == fd)
usr.sbin/bgpd/control.c
235
close(c->imsgbuf.fd);
usr.sbin/bgpd/control.c
254
if ((c = control_connbyfd(pfd->fd)) == NULL) {
usr.sbin/bgpd/control.c
255
log_warn("control_dispatch_msg: fd %d: not found", pfd->fd);
usr.sbin/bgpd/control.c
46
int fd;
usr.sbin/bgpd/control.c
52
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) {
usr.sbin/bgpd/control.c
57
if (connect(fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) == 0) {
usr.sbin/bgpd/control.c
59
close(fd);
usr.sbin/bgpd/control.c
63
close(fd);
usr.sbin/bgpd/control.c
72
int fd;
usr.sbin/bgpd/control.c
75
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/bgpd/control.c
86
close(fd);
usr.sbin/bgpd/control.c
93
close(fd);
usr.sbin/bgpd/kroute.c
209
kr_init(int *fd, uint8_t fib_prio)
usr.sbin/bgpd/kroute.c
215
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/bgpd/kroute.c
222
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/bgpd/kroute.c
228
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/bgpd/kroute.c
234
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/bgpd/kroute.c
239
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_TABLEFILTER, &tid,
usr.sbin/bgpd/kroute.c
254
*fd = kr_state.fd;
usr.sbin/bgpd/kroute.c
2835
if (writev(kr_state.fd, iov, iovcnt) == -1) {
usr.sbin/bgpd/kroute.c
2996
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/bgpd/kroute.c
55
int fd;
usr.sbin/bgpd/mrt.c
1102
if (ibuf_write(mrt->fd, mrt->wbuf) == -1) {
usr.sbin/bgpd/mrt.c
1112
close(mrt->fd);
usr.sbin/bgpd/mrt.c
1131
int fd;
usr.sbin/bgpd/mrt.c
1140
fd = open(MRT2MC(mrt)->file,
usr.sbin/bgpd/mrt.c
1142
if (fd == -1) {
usr.sbin/bgpd/mrt.c
1152
if (imsg_compose(mrt_imsgbuf[TYPE2IDX(mrt->type)], type, 0, 0, fd,
usr.sbin/bgpd/parse.y
4036
check_file_secrecy(int fd, const char *fname)
usr.sbin/bgpd/parse.y
4040
if (fstat(fd, &st)) {
usr.sbin/bgpd/parse.y
4230
la->fd = -1;
usr.sbin/bgpd/parse.y
4242
la->fd = -1;
usr.sbin/bgpd/parse.y
792
la->fd = -1;
usr.sbin/bgpd/parse.y
806
la->fd = -1;
usr.sbin/bgpd/pfkey.c
54
#define pfkey_flow(fd, satype, cmd, dir, from, to, sport, dport) \
usr.sbin/bgpd/pfkey.c
55
pfkey_send(fd, satype, cmd, dir, from, to, \
usr.sbin/bgpd/pfkey.c
836
tcp_md5_check(int fd, struct auth_config *auth)
usr.sbin/bgpd/pfkey.c
847
if (getsockopt(fd, IPPROTO_TCP, TCP_MD5SIG,
usr.sbin/bgpd/pfkey.c
860
tcp_md5_set(int fd, struct auth_config *auth, struct bgpd_addr *remote_addr)
usr.sbin/bgpd/pfkey.c
869
if (setsockopt(fd, IPPROTO_TCP, TCP_MD5SIG,
usr.sbin/bgpd/pfkey.c
882
if (setsockopt(la->fd, IPPROTO_TCP, TCP_MD5SIG,
usr.sbin/bgpd/rde.c
1308
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/bgpd/rde.c
1315
fd);
usr.sbin/bgpd/rde.c
1317
close(fd);
usr.sbin/bgpd/rde.c
257
pfd[i].fd = mctx->mrt.fd;
usr.sbin/bgpd/rde.c
318
if (pfd[j].fd == mctx->mrt.fd &&
usr.sbin/bgpd/rde.c
3538
rde_dump_mrt_new(struct mrt *mrt, pid_t pid, int fd)
usr.sbin/bgpd/rde.c
3553
ctx->mrt.fd = fd;
usr.sbin/bgpd/rde.c
374
close(ibuf_se->fd);
usr.sbin/bgpd/rde.c
379
close(ibuf_se_ctl->fd);
usr.sbin/bgpd/rde.c
384
close(ibuf_rtr->fd);
usr.sbin/bgpd/rde.c
388
close(ibuf_main->fd);
usr.sbin/bgpd/rde.c
918
int n, fd;
usr.sbin/bgpd/rde.c
931
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/rde.c
938
if (imsgbuf_init(i, fd) == -1 ||
usr.sbin/bgpd/rtr.c
303
close(ibuf_rde->fd);
usr.sbin/bgpd/rtr.c
307
close(ibuf_main->fd);
usr.sbin/bgpd/rtr.c
323
int n, fd;
usr.sbin/bgpd/rtr.c
334
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/rtr.c
347
if (imsgbuf_init(ibuf_rde, fd) == -1 ||
usr.sbin/bgpd/rtr.c
353
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/rtr.c
361
close(fd);
usr.sbin/bgpd/rtr.c
364
rtr_open(rs, fd);
usr.sbin/bgpd/rtr_proto.c
1155
if (rs->fd != -1) {
usr.sbin/bgpd/rtr_proto.c
1158
close(rs->fd);
usr.sbin/bgpd/rtr_proto.c
1159
rs->fd = -1;
usr.sbin/bgpd/rtr_proto.c
1300
if (ibuf_write(rs->fd, rs->w) == -1) {
usr.sbin/bgpd/rtr_proto.c
1310
switch (ibuf_read(rs->fd, rs->w)) {
usr.sbin/bgpd/rtr_proto.c
1342
if (rs->fd == pfds[i].fd) {
usr.sbin/bgpd/rtr_proto.c
1406
pfd->fd = -1;
usr.sbin/bgpd/rtr_proto.c
1410
pfd->fd = rs->fd;
usr.sbin/bgpd/rtr_proto.c
1487
rtr_open(struct rtr_session *rs, int fd)
usr.sbin/bgpd/rtr_proto.c
1500
rs->fd = fd;
usr.sbin/bgpd/rtr_proto.c
201
int fd;
usr.sbin/bgpd/rtr_proto.c
429
rtr_reader_callback(struct ibuf *hdr, void *arg, int *fd)
usr.sbin/bgpd/session.c
1190
int n, fd, depend_ok, restricted;
usr.sbin/bgpd/session.c
1207
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/session.c
1214
if (imsgbuf_init(i, fd) == -1 ||
usr.sbin/bgpd/session.c
123
close(la->fd);
usr.sbin/bgpd/session.c
1285
if ((nla.fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/bgpd/session.c
1296
la->fd = nla.fd;
usr.sbin/bgpd/session.c
1314
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/session.c
1321
rcsock = fd;
usr.sbin/bgpd/session.c
1324
csock = fd;
usr.sbin/bgpd/session.c
134
if (la->fd == -1) {
usr.sbin/bgpd/session.c
1395
if ((xmrt.fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/bgpd/session.c
1413
close(mrt->fd);
usr.sbin/bgpd/session.c
1415
mrt->fd = xmrt.fd;
usr.sbin/bgpd/session.c
145
if (la->sa.ss_family == AF_INET && setsockopt(la->fd,
usr.sbin/bgpd/session.c
150
if (la->sa.ss_family == AF_INET6 && setsockopt(la->fd,
usr.sbin/bgpd/session.c
156
if (listen(la->fd, MAX_BACKLOG)) {
usr.sbin/bgpd/session.c
157
close(la->fd);
usr.sbin/bgpd/session.c
320
pfd[PFD_SOCK_CTL].fd = csock;
usr.sbin/bgpd/session.c
322
pfd[PFD_SOCK_RCTL].fd = rcsock;
usr.sbin/bgpd/session.c
325
pfd[PFD_SOCK_CTL].fd = -1;
usr.sbin/bgpd/session.c
326
pfd[PFD_SOCK_RCTL].fd = -1;
usr.sbin/bgpd/session.c
332
pfd[i].fd = la->fd;
usr.sbin/bgpd/session.c
335
pfd[i].fd = -1;
usr.sbin/bgpd/session.c
426
if (p->fd != -1 && events != 0) {
usr.sbin/bgpd/session.c
427
pfd[i].fd = p->fd;
usr.sbin/bgpd/session.c
438
pfd[i].fd = m->fd;
usr.sbin/bgpd/session.c
508
session_accept(pfd[j].fd);
usr.sbin/bgpd/session.c
548
close(ibuf_rde->fd);
usr.sbin/bgpd/session.c
553
close(ibuf_rde_ctl->fd);
usr.sbin/bgpd/session.c
558
close(ibuf_main->fd);
usr.sbin/bgpd/session.c
571
p->fd = -1;
usr.sbin/bgpd/session.c
621
if (getsockopt(pfd->fd, SOL_SOCKET, SO_ERROR,
usr.sbin/bgpd/session.c
658
if (ibuf_write(p->fd, p->wbuf) == -1) {
usr.sbin/bgpd/session.c
672
if (p->fd != -1 && pfd->revents & POLLIN) {
usr.sbin/bgpd/session.c
673
switch (ibuf_read(p->fd, p->wbuf)) {
usr.sbin/bgpd/session.c
715
if (p->fd != -1) {
usr.sbin/bgpd/session.c
737
p->fd = connfd;
usr.sbin/bgpd/session.c
768
if (peer->fd != -1)
usr.sbin/bgpd/session.c
771
if ((peer->fd = socket(aid2af(peer->conf.remote_addr.aid),
usr.sbin/bgpd/session.c
785
if (tcp_md5_set(peer->fd, &peer->auth_conf,
usr.sbin/bgpd/session.c
795
if (bind(peer->fd, sa, sa_len) == -1) {
usr.sbin/bgpd/session.c
808
if (connect(peer->fd, sa, sa_len) == -1) {
usr.sbin/bgpd/session.c
835
if (setsockopt(p->fd, IPPROTO_IP, IP_TOS, &pre, sizeof(pre)) ==
usr.sbin/bgpd/session.c
849
if (setsockopt(p->fd, IPPROTO_IP, IP_MINTTL,
usr.sbin/bgpd/session.c
859
if (setsockopt(p->fd, IPPROTO_IP, IP_TTL, &ttl,
usr.sbin/bgpd/session.c
868
if (setsockopt(p->fd, IPPROTO_IPV6, IPV6_TCLASS, &pre,
usr.sbin/bgpd/session.c
882
if (setsockopt(p->fd, IPPROTO_IPV6,
usr.sbin/bgpd/session.c
892
if (setsockopt(p->fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS,
usr.sbin/bgpd/session.c
903
if (setsockopt(p->fd, IPPROTO_TCP, TCP_NODELAY, &nodelay,
usr.sbin/bgpd/session.c
912
setsockopt(p->fd, SOL_SOCKET, SO_RCVBUF, &bsize, sizeof(bsize));
usr.sbin/bgpd/session.c
913
setsockopt(p->fd, SOL_SOCKET, SO_SNDBUF, &bsize, sizeof(bsize));
usr.sbin/bgpd/session.c
921
if (peer->fd != -1) {
usr.sbin/bgpd/session.c
922
close(peer->fd);
usr.sbin/bgpd/session.c
925
peer->fd = -1;
usr.sbin/bgpd/session.h
141
int fd;
usr.sbin/bgpd/session_bgp.c
1530
if (getsockname(peer->fd, (struct sockaddr *)&ss, &len) == -1)
usr.sbin/bgpd/session_bgp.c
1534
if (getpeername(peer->fd, (struct sockaddr *)&ss, &len) == -1)
usr.sbin/bgpd/session_bgp.c
1835
ibuf_write(peer->fd, peer->wbuf);
usr.sbin/bgpd/session_bgp.c
584
parse_header(struct ibuf *msg, void *arg, int *fd)
usr.sbin/bgplgd/slowcgi.c
1049
script_in(int fd, struct event *ev, struct request *c, uint8_t type)
usr.sbin/bgplgd/slowcgi.c
1066
n = read(fd, resp->data + sizeof(struct fcgi_record_header),
usr.sbin/bgplgd/slowcgi.c
1094
close(fd);
usr.sbin/bgplgd/slowcgi.c
1099
script_std_in(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
1102
script_in(fd, &c->script_ev, c, FCGI_STDOUT);
usr.sbin/bgplgd/slowcgi.c
1106
script_err_in(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
1109
script_in(fd, &c->script_err_ev, c, FCGI_STDERR);
usr.sbin/bgplgd/slowcgi.c
115
int fd;
usr.sbin/bgplgd/slowcgi.c
1198
close(c->fd);
usr.sbin/bgplgd/slowcgi.c
283
int c, fd;
usr.sbin/bgplgd/slowcgi.c
294
if ((fd = open("/dev/null", O_RDWR)) != -1) {
usr.sbin/bgplgd/slowcgi.c
295
if (dup2(fd, c) == -1)
usr.sbin/bgplgd/slowcgi.c
297
if (fd > c)
usr.sbin/bgplgd/slowcgi.c
298
close(fd);
usr.sbin/bgplgd/slowcgi.c
346
fd = slowcgi_listen(fcgi_socket, pw);
usr.sbin/bgplgd/slowcgi.c
370
event_set(&l->ev, fd, EV_READ | EV_PERSIST, slowcgi_accept, l);
usr.sbin/bgplgd/slowcgi.c
389
int fd;
usr.sbin/bgplgd/slowcgi.c
391
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC,
usr.sbin/bgplgd/slowcgi.c
407
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1)
usr.sbin/bgplgd/slowcgi.c
415
if (listen(fd, 5) == -1)
usr.sbin/bgplgd/slowcgi.c
419
return fd;
usr.sbin/bgplgd/slowcgi.c
423
slowcgi_paused(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
450
slowcgi_accept(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
465
if ((s = accept_reserve(fd, (struct sockaddr *)&ss,
usr.sbin/bgplgd/slowcgi.c
489
c->fd = s;
usr.sbin/bgplgd/slowcgi.c
505
slowcgi_timeout(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
612
slowcgi_response(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
626
n = write(fd, resp->data + resp->data_pos, resp->data_len);
usr.sbin/bgplgd/slowcgi.c
650
slowcgi_request(int fd, short events, void *arg)
usr.sbin/bgplgd/slowcgi.c
657
n = read(fd, c->buf + c->buf_pos + c->buf_len,
usr.sbin/bpflogd/bpflogd.c
267
int fd;
usr.sbin/bpflogd/bpflogd.c
270
fd = open(filter, O_RDONLY);
usr.sbin/bpflogd/bpflogd.c
271
if (fd == -1)
usr.sbin/bpflogd/bpflogd.c
280
rv = read(fd, expr, BPFLOG_FILTER_MAX);
usr.sbin/bpflogd/bpflogd.c
288
close(fd);
usr.sbin/bpflogd/bpflogd.c
430
int fd;
usr.sbin/bpflogd/bpflogd.c
432
fd = bpflog_open(bd);
usr.sbin/bpflogd/bpflogd.c
439
if (fd == -1)
usr.sbin/bpflogd/bpflogd.c
442
bd->bd_fd = fd;
usr.sbin/bpflogd/bpflogd.c
462
int fd;
usr.sbin/bpflogd/bpflogd.c
464
fd = open(bd->bd_fname, O_RDWR|O_APPEND);
usr.sbin/bpflogd/bpflogd.c
465
if (fd == -1) {
usr.sbin/bpflogd/bpflogd.c
470
if (fstat(fd, &st) == -1) {
usr.sbin/bpflogd/bpflogd.c
476
rv = write(fd, &pfh, sizeof(pfh));
usr.sbin/bpflogd/bpflogd.c
487
return (fd);
usr.sbin/bpflogd/bpflogd.c
490
rv = pread(fd, &epfh, sizeof(epfh), 0);
usr.sbin/bpflogd/bpflogd.c
524
return (fd);
usr.sbin/bpflogd/bpflogd.c
527
close(fd);
usr.sbin/bpflogd/bpflogd.c
558
bpfif_read(int fd, short events, void *arg)
usr.sbin/bpflogd/bpflogd.c
570
rv = read(fd, bd->bd_buf, bd->bd_buflen);
usr.sbin/btrace/btrace.c
143
int fd = -1, ch, error = 0;
usr.sbin/btrace/btrace.c
210
fd = open(__PATH_DEVDT, O_RDONLY);
usr.sbin/btrace/btrace.c
211
if (fd == -1)
usr.sbin/btrace/btrace.c
213
dtfd = fd;
usr.sbin/btrace/btrace.c
217
dtpi_cache(fd);
usr.sbin/btrace/btrace.c
218
dtpi_print_list(fd);
usr.sbin/btrace/btrace.c
222
rules_do(fd);
usr.sbin/btrace/btrace.c
224
if (fd != -1)
usr.sbin/btrace/btrace.c
225
close(fd);
usr.sbin/btrace/btrace.c
268
dtpi_cache(int fd)
usr.sbin/btrace/btrace.c
276
if (ioctl(fd, DTIOCGPLIST, &dtpr))
usr.sbin/btrace/btrace.c
285
if (ioctl(fd, DTIOCGPLIST, &dtpr))
usr.sbin/btrace/btrace.c
290
dtai_cache(int fd, struct dtioc_probe_info *dtpi)
usr.sbin/btrace/btrace.c
311
if (ioctl(fd, DTIOCGARGS, &dtar))
usr.sbin/btrace/btrace.c
316
dtpi_print_list(int fd)
usr.sbin/btrace/btrace.c
327
dtai_cache(fd, dtpi);
usr.sbin/btrace/btrace.c
454
rules_do(int fd)
usr.sbin/btrace/btrace.c
468
halt = rules_setup(fd);
usr.sbin/btrace/btrace.c
475
rlen = read(fd, devtbuf, sizeof(devtbuf));
usr.sbin/btrace/btrace.c
488
halt = rules_apply(fd, &devtbuf[i]);
usr.sbin/btrace/btrace.c
494
rules_teardown(fd);
usr.sbin/btrace/btrace.c
496
if (verbose && fd != -1) {
usr.sbin/btrace/btrace.c
500
if (ioctl(fd, DTIOCGSTATS, &dtst))
usr.sbin/btrace/btrace.c
547
rules_setup(int fd)
usr.sbin/btrace/btrace.c
590
dtpi_cache(fd);
usr.sbin/btrace/btrace.c
632
if (ioctl(fd, DTIOCPRBENABLE, dtrq)) {
usr.sbin/btrace/btrace.c
641
if (ioctl(fd, DTIOCRECORD, &on))
usr.sbin/btrace/btrace.c
652
rules_apply(int fd, struct dt_evt *dtev)
usr.sbin/btrace/btrace.c
663
dtai_cache(fd, &dt_dtpis[dtev->dtev_pbn - 1]);
usr.sbin/btrace/btrace.c
672
rules_teardown(int fd)
usr.sbin/btrace/btrace.c
680
if (ioctl(fd, DTIOCRECORD, &off))
usr.sbin/btrace/btrace.c
693
if (ioctl(fd, DTIOCPRBDISABLE, dtrq))
usr.sbin/btrace/ksyms.c
366
int fd;
usr.sbin/btrace/ksyms.c
368
fd = open(path, O_RDONLY);
usr.sbin/btrace/ksyms.c
369
if (fd == -1)
usr.sbin/btrace/ksyms.c
375
elf = elf_begin(fd, ELF_C_READ, NULL);
usr.sbin/btrace/ksyms.c
377
close(fd);
usr.sbin/btrace/ksyms.c
383
close(fd);
usr.sbin/config/exec_elf.c
100
if ((fd = open(file, O_RDONLY | O_EXLOCK)) == -1)
usr.sbin/config/exec_elf.c
103
if (read(fd, (char *)&elf_ex, sizeof(elf_ex)) != sizeof(elf_ex))
usr.sbin/config/exec_elf.c
109
elf_size = lseek(fd, (off_t)0, SEEK_END);
usr.sbin/config/exec_elf.c
110
(void)lseek(fd, (off_t)0, SEEK_SET);
usr.sbin/config/exec_elf.c
113
if (read(fd, elf_total, (size_t)elf_size) != elf_size)
usr.sbin/config/exec_elf.c
135
close(fd);
usr.sbin/config/exec_elf.c
141
int fd;
usr.sbin/config/exec_elf.c
143
if ((fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0700)) == -1)
usr.sbin/config/exec_elf.c
146
if (write(fd, elf_total, (size_t)elf_size) != elf_size)
usr.sbin/config/exec_elf.c
149
close(fd);
usr.sbin/config/exec_elf.c
98
int fd;
usr.sbin/cron/atrun.c
336
int fd, always_mail;
usr.sbin/cron/atrun.c
341
if ((fd = openat(dfd, atfile, O_RDONLY|O_NONBLOCK|O_NOFOLLOW)) == -1) {
usr.sbin/cron/atrun.c
358
close(fd);
usr.sbin/cron/atrun.c
387
if (fstat(fd, &sb) == -1) {
usr.sbin/cron/atrun.c
416
if ((fp = fdopen(dup(fd), "r")) == NULL) {
usr.sbin/cron/atrun.c
458
if (lseek(fd, 0, SEEK_SET) == -1) {
usr.sbin/cron/atrun.c
462
if (fd != STDIN_FILENO) {
usr.sbin/cron/atrun.c
463
dup2(fd, STDIN_FILENO);
usr.sbin/cron/atrun.c
464
close(fd);
usr.sbin/cron/atrun.c
545
close(fd);
usr.sbin/cron/cron.c
351
int fd, nfds;
usr.sbin/cron/cron.c
365
pfd[0].fd = cronSock;
usr.sbin/cron/cron.c
391
fd = accept4(cronSock, (struct sockaddr *)&s_un,
usr.sbin/cron/cron.c
393
if (fd >= 0) {
usr.sbin/cron/cron.c
394
(void) read(fd, &poke, 1);
usr.sbin/cron/cron.c
395
close(fd);
usr.sbin/cron/crontab.c
389
int fd = -1;
usr.sbin/cron/crontab.c
398
fd = mkstemp(template);
usr.sbin/cron/crontab.c
405
if (fd == -1 || !(fp = fdopen(fd, "w+"))) {
usr.sbin/cron/crontab.c
412
if (fd != -1) {
usr.sbin/cron/crontab.c
413
close(fd);
usr.sbin/cron/database.c
176
int fd;
usr.sbin/cron/database.c
186
fd = openat(dfd, fname, O_RDONLY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC);
usr.sbin/cron/database.c
187
if (fd == -1) {
usr.sbin/cron/database.c
193
if (!(crontab_fp = fdopen(fd, "r"))) {
usr.sbin/cron/database.c
195
close(fd);
usr.sbin/crunchgen/crunchgen.c
661
int fd, dotfd, rc;
usr.sbin/crunchgen/crunchgen.c
667
if ((fd = mkstemp(tempfname)) == -1 || (f = fdopen(fd, "w")) == NULL) {
usr.sbin/crunchgen/crunchgen.c
668
if (fd != -1)
usr.sbin/crunchgen/crunchgen.c
669
close(fd);
usr.sbin/dhcpd/dhcpd.h
289
int fd;
usr.sbin/dhcpd/dispatch.c
363
fds[i].fd = l->fd;
usr.sbin/dhcpd/dispatch.c
422
close(l->fd);
usr.sbin/dhcpd/dispatch.c
594
add_protocol(char *name, int fd, void (*handler)(struct protocol *),
usr.sbin/dhcpd/dispatch.c
602
p->fd = fd;
usr.sbin/dhcpd/icmp.c
140
status = recvfrom(protocol->fd, icbuf, sizeof(icbuf), 0,
usr.sbin/dhcpd/pfutils.c
107
pf_change_table(fd, 0, cmd.ip, abandoned_tab);
usr.sbin/dhcpd/pfutils.c
108
pf_change_table(fd, 0, cmd.ip, changedmac_tab);
usr.sbin/dhcpd/pfutils.c
117
pf_change_table(fd, 0, cmd.ip, abandoned_tab);
usr.sbin/dhcpd/pfutils.c
118
pf_change_table(fd, 1, cmd.ip, leased_tab);
usr.sbin/dhcpd/pfutils.c
127
pf_change_table(fd, 0, cmd.ip, leased_tab);
usr.sbin/dhcpd/pfutils.c
140
pf_change_table(int fd, int op, struct in_addr ip, char *table)
usr.sbin/dhcpd/pfutils.c
160
if (ioctl(fd, op ? DIOCRADDADDRS : DIOCRDELADDRS, &io) == -1 &&
usr.sbin/dhcpd/pfutils.c
168
pf_kill_state(int fd, struct in_addr ip)
usr.sbin/dhcpd/pfutils.c
184
if (ioctl(fd, DIOCKILLSTATES, &psk) == -1) {
usr.sbin/dhcpd/pfutils.c
194
if (ioctl(fd, DIOCKILLSTATES, &psk) == -1) {
usr.sbin/dhcpd/pfutils.c
201
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.sbin/dhcpd/pfutils.c
208
res = (f) (fd, s + pos, n - pos);
usr.sbin/dhcpd/pfutils.c
53
int l, r, fd, nfds;
usr.sbin/dhcpd/pfutils.c
55
if ((fd = open(_PATH_DEV_PF, O_RDWR|O_NOFOLLOW)) == -1)
usr.sbin/dhcpd/pfutils.c
73
pfd[0].fd = pfpipe[0];
usr.sbin/dhcpd/pfutils.c
96
pf_change_table(fd, 1, cmd.ip, abandoned_tab);
usr.sbin/dhcpd/pfutils.c
97
pf_change_table(fd, 0, cmd.ip, leased_tab);
usr.sbin/dhcpd/pfutils.c
98
pf_kill_state(fd, cmd.ip);
usr.sbin/dhcrelay/dhcpd.h
127
int fd;
usr.sbin/dhcrelay/dhcpd.h
136
int fd;
usr.sbin/dhcrelay/dhcrelay.c
244
sp->fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/dhcrelay/dhcrelay.c
245
if (sp->fd == -1)
usr.sbin/dhcrelay/dhcrelay.c
248
if (setsockopt(sp->fd, SOL_SOCKET, SO_REUSEPORT,
usr.sbin/dhcrelay/dhcrelay.c
251
if (setsockopt(sp->fd, SOL_SOCKET, SO_RTABLE, &rdomain,
usr.sbin/dhcrelay/dhcrelay.c
254
if (bind(sp->fd, (struct sockaddr *)&laddr, sizeof laddr) ==
usr.sbin/dhcrelay/dhcrelay.c
257
if (connect(sp->fd, (struct sockaddr *)&sp->to,
usr.sbin/dhcrelay/dhcrelay.c
260
add_protocol("server", sp->fd, got_response, sp);
usr.sbin/dhcrelay/dhcrelay.c
416
if (send(sp->fd, packet, length, 0) != -1) {
usr.sbin/dhcrelay/dhcrelay.c
479
if ((result = recv(l->fd, u.packbuf, sizeof(u), 0)) == -1 &&
usr.sbin/dhcrelay/dispatch.c
302
fds[i].fd = l->fd;
usr.sbin/dhcrelay/dispatch.c
374
close(l->fd);
usr.sbin/dhcrelay/dispatch.c
447
add_protocol(char *name, int fd, void (*handler)(struct protocol *),
usr.sbin/dhcrelay/dispatch.c
456
p->fd = fd;
usr.sbin/dhcrelay6/dhcpd.h
124
int fd;
usr.sbin/dhcrelay6/dhcpd.h
132
int fd;
usr.sbin/dhcrelay6/dispatch.c
325
fds[i].fd = l->fd;
usr.sbin/dhcrelay6/dispatch.c
390
close(l->fd);
usr.sbin/dhcrelay6/dispatch.c
463
add_protocol(char *name, int fd, void (*handler)(struct protocol *),
usr.sbin/dhcrelay6/dispatch.c
472
p->fd = fd;
usr.sbin/dvmrpd/control.c
103
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/dvmrpd/control.c
164
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/dvmrpd/control.c
172
control_connbyfd(int fd)
usr.sbin/dvmrpd/control.c
177
if (c->iev.ibuf.fd == fd)
usr.sbin/dvmrpd/control.c
198
control_close(int fd)
usr.sbin/dvmrpd/control.c
202
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/dvmrpd/control.c
203
log_warn("control_close: fd %d: not found", fd);
usr.sbin/dvmrpd/control.c
211
close(c->iev.ibuf.fd);
usr.sbin/dvmrpd/control.c
223
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/dvmrpd/control.c
231
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/dvmrpd/control.c
232
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/dvmrpd/control.c
238
control_close(fd);
usr.sbin/dvmrpd/control.c
244
control_close(fd);
usr.sbin/dvmrpd/control.c
251
control_close(fd);
usr.sbin/dvmrpd/control.c
47
int fd;
usr.sbin/dvmrpd/control.c
54
int fd;
usr.sbin/dvmrpd/control.c
57
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/dvmrpd/control.c
70
close(fd);
usr.sbin/dvmrpd/control.c
75
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/dvmrpd/control.c
77
close(fd);
usr.sbin/dvmrpd/control.c
85
close(fd);
usr.sbin/dvmrpd/control.c
90
control_state.fd = fd;
usr.sbin/dvmrpd/control.c
98
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/dvmrpd/dvmrpd.c
245
event_set(&iev_dvmrpe->ev, iev_dvmrpe->ibuf.fd, iev_dvmrpe->events,
usr.sbin/dvmrpd/dvmrpd.c
250
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/dvmrpd/dvmrpd.c
279
close(iev_dvmrpe->ibuf.fd);
usr.sbin/dvmrpd/dvmrpd.c
281
close(iev_rde->ibuf.fd);
usr.sbin/dvmrpd/dvmrpd.c
312
main_dispatch_dvmrpe(int fd, short event, void *bula)
usr.sbin/dvmrpd/dvmrpd.c
374
main_dispatch_rde(int fd, short event, void *bula)
usr.sbin/dvmrpd/dvmrpd.c
457
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/dvmrpd/dvmrpd.c
463
u_int32_t peerid, pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/dvmrpd/dvmrpd.c
468
pid, fd, data, datalen)) != -1)
usr.sbin/dvmrpd/dvmrpd.h
213
int fd;
usr.sbin/dvmrpd/dvmrpe.c
156
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/dvmrpd/dvmrpe.c
161
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/dvmrpd/dvmrpe.c
198
close(iev_rde->ibuf.fd);
usr.sbin/dvmrpd/dvmrpe.c
201
close(iev_main->ibuf.fd);
usr.sbin/dvmrpd/dvmrpe.c
235
dvmrpe_dispatch_main(int fd, short event, void *bula)
usr.sbin/dvmrpd/dvmrpe.c
309
dvmrpe_dispatch_rde(int fd, short event, void *bula)
usr.sbin/dvmrpd/group.c
232
dead_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/group.c
287
v1_host_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/group.c
320
retrans_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/interface.c
240
iface->fd = xconf->dvmrp_socket;
usr.sbin/dvmrpd/interface.c
267
if_probe_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/interface.c
298
if_query_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/interface.c
335
if_querier_present_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/interface.c
513
if_set_mcast_ttl(int fd, u_int8_t ttl)
usr.sbin/dvmrpd/interface.c
515
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
usr.sbin/dvmrpd/interface.c
526
if_set_tos(int fd, int tos)
usr.sbin/dvmrpd/interface.c
528
if (setsockopt(fd, IPPROTO_IP, IP_TOS,
usr.sbin/dvmrpd/interface.c
538
if_set_recvbuf(int fd)
usr.sbin/dvmrpd/interface.c
543
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/dvmrpd/interface.c
559
if (setsockopt(iface->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
usr.sbin/dvmrpd/interface.c
584
if (setsockopt(iface->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
usr.sbin/dvmrpd/interface.c
604
if (setsockopt(iface->fd, IPPROTO_IP, IP_MULTICAST_IF,
usr.sbin/dvmrpd/interface.c
620
if_set_mcast_loop(int fd)
usr.sbin/dvmrpd/interface.c
624
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
usr.sbin/dvmrpd/kmroute.c
151
mrt_init(int fd)
usr.sbin/dvmrpd/kmroute.c
155
if (setsockopt(fd, IPPROTO_IP, MRT_INIT, &flag,
usr.sbin/dvmrpd/kmroute.c
165
mrt_done(int fd)
usr.sbin/dvmrpd/kmroute.c
169
if (setsockopt(fd, IPPROTO_IP, MRT_DONE, &flag,
usr.sbin/dvmrpd/kmroute.c
179
mrt_add_vif(int fd, struct iface *iface)
usr.sbin/dvmrpd/kmroute.c
190
if (setsockopt(fd, IPPROTO_IP, MRT_ADD_VIF, &vc,
usr.sbin/dvmrpd/kmroute.c
200
mrt_del_vif(int fd, struct iface *iface)
usr.sbin/dvmrpd/kmroute.c
206
if (setsockopt(fd, IPPROTO_IP, MRT_DEL_VIF, &vifi,
usr.sbin/dvmrpd/kmroute.c
212
mrt_add_mfc(int fd, struct mfc *mfc)
usr.sbin/dvmrpd/kmroute.c
228
if (setsockopt(fd, IPPROTO_IP, MRT_ADD_MFC, &mc, sizeof(mc))
usr.sbin/dvmrpd/kmroute.c
239
mrt_del_mfc(int fd, struct mfc *mfc)
usr.sbin/dvmrpd/kmroute.c
248
if (setsockopt(fd, IPPROTO_IP, MRT_DEL_MFC, &mc, sizeof(mc))
usr.sbin/dvmrpd/kmroute.c
42
kmr_init(int fd)
usr.sbin/dvmrpd/kmroute.c
84
kmr_recv_msg(int fd, short event, void *bula)
usr.sbin/dvmrpd/kmroute.c
97
if ((r = recvfrom(fd, buf, IBUF_READ_SIZE, 0, NULL, NULL)) == -1) {
usr.sbin/dvmrpd/kroute.c
100
event_set(&kr_state.ev, fd, EV_READ | EV_PERSIST,
usr.sbin/dvmrpd/kroute.c
373
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/dvmrpd/kroute.c
381
if ((n = read(fd, &buf, sizeof(buf))) == -1) {
usr.sbin/dvmrpd/kroute.c
85
int opt = 0, fd;
usr.sbin/dvmrpd/kroute.c
87
if ((fd = socket(AF_ROUTE, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/dvmrpd/kroute.c
94
if (setsockopt(fd, SOL_SOCKET, SO_USELOOPBACK, &opt, sizeof(opt)) == -1)
usr.sbin/dvmrpd/neighbor.c
266
nbr_itimer(int fd, short event, void *arg)
usr.sbin/dvmrpd/packet.c
102
recv_packet(int fd, short event, void *bula)
usr.sbin/dvmrpd/packet.c
123
if ((r = recvfrom(fd, buf, READ_BUF_SIZE, 0, NULL, NULL)) == -1) {
usr.sbin/dvmrpd/packet.c
287
if (iface->fd > 0 &&
usr.sbin/dvmrpd/packet.c
293
if (iface->fd > 0 && (iface->addr.s_addr &
usr.sbin/dvmrpd/packet.c
91
if (sendto(iface->fd, ibuf_data(pkt), ibuf_size(pkt), 0,
usr.sbin/dvmrpd/parse.y
667
check_file_secrecy(int fd, const char *fname)
usr.sbin/dvmrpd/parse.y
671
if (fstat(fd, &st)) {
usr.sbin/dvmrpd/rde.c
136
event_set(&iev_dvmrpe->ev, iev_dvmrpe->ibuf.fd, iev_dvmrpe->events,
usr.sbin/dvmrpd/rde.c
141
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/dvmrpd/rde.c
162
close(iev_dvmrpe->ibuf.fd);
usr.sbin/dvmrpd/rde.c
164
close(iev_main->ibuf.fd);
usr.sbin/dvmrpd/rde.c
197
rde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/dvmrpd/rde_mfc.c
105
mfc_prune_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/rde_mfc.c
506
prune_expire_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/rde_mfc.c
66
mfc_expire_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/rde_srt.c
104
rt_holddown_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/rde_srt.c
70
rt_expire_timer(int fd, short event, void *arg)
usr.sbin/dvmrpd/report.c
153
report_timer(int fd, short event, void *arg)
usr.sbin/edquota/edquota.c
236
int qcmd, qupsize, fd;
usr.sbin/edquota/edquota.c
269
if ((fd = open(qfpathname, O_RDONLY)) == -1) {
usr.sbin/edquota/edquota.c
270
fd = open(qfpathname, O_RDWR|O_CREAT, 0640);
usr.sbin/edquota/edquota.c
271
if (fd == -1 && errno != ENOENT) {
usr.sbin/edquota/edquota.c
279
(void)fchown(fd, getuid(), mid);
usr.sbin/edquota/edquota.c
280
(void)fchmod(fd, 0640);
usr.sbin/edquota/edquota.c
282
lseek(fd, (off_t)(id * sizeof(struct dqblk)), SEEK_SET);
usr.sbin/edquota/edquota.c
283
switch (read(fd, &qup->dqblk, sizeof(struct dqblk))) {
usr.sbin/edquota/edquota.c
298
close(fd);
usr.sbin/edquota/edquota.c
302
close(fd);
usr.sbin/edquota/edquota.c
324
int qcmd, fd;
usr.sbin/edquota/edquota.c
330
if ((fd = open(qup->qfname, O_WRONLY)) == -1) {
usr.sbin/edquota/edquota.c
333
lseek(fd, (off_t)(id * sizeof (struct dqblk)), SEEK_SET);
usr.sbin/edquota/edquota.c
334
if (write(fd, &qup->dqblk, sizeof (struct dqblk)) !=
usr.sbin/edquota/edquota.c
337
close(fd);
usr.sbin/eeprom/ophandlers.c
105
if (ioctl(fd, OPIOCGET, (char *)&opio) == -1)
usr.sbin/eeprom/ophandlers.c
126
if (ioctl(fd, OPIOCSET, (char *)&opio) == -1)
usr.sbin/eeprom/ophandlers.c
139
if (ioctl(fd, OPIOCGET, (char *)&opio) == -1)
usr.sbin/eeprom/ophandlers.c
157
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
178
int fd, optnode;
usr.sbin/eeprom/ophandlers.c
180
if ((fd = open(path_openprom, O_RDONLY)) == -1)
usr.sbin/eeprom/ophandlers.c
183
if (ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode) == -1)
usr.sbin/eeprom/ophandlers.c
215
if (ioctl(fd, OPIOCNEXTPROP, (char *)&opio1) == -1)
usr.sbin/eeprom/ophandlers.c
228
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
235
if (ioctl(fd, OPIOCGET, (char *)&opio2) == -1)
usr.sbin/eeprom/ophandlers.c
80
int fd, optnode;
usr.sbin/eeprom/ophandlers.c
82
if ((fd = open(path_openprom, arg ? O_RDWR : O_RDONLY)) == -1)
usr.sbin/eeprom/ophandlers.c
90
if (ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode) == -1)
usr.sbin/eeprom/optree.c
111
op_nodes(int fd, int node, int depth)
usr.sbin/eeprom/optree.c
123
if (ioctl(fd, OPIOCGETNEXT, &opio) == -1)
usr.sbin/eeprom/optree.c
136
if (ioctl(fd, OPIOCNEXTPROP, &opio) == -1)
usr.sbin/eeprom/optree.c
151
if (ioctl(fd, OPIOCGET, &opio) == -1) {
usr.sbin/eeprom/optree.c
162
if (ioctl(fd, OPIOCGETCHILD, &opio) == -1)
usr.sbin/eeprom/optree.c
165
op_nodes(fd, opio.op_nodeid, depth + 1);
usr.sbin/eeprom/optree.c
169
if (ioctl(fd, OPIOCGETNEXT, &opio) == -1)
usr.sbin/eeprom/optree.c
172
op_nodes(fd, opio.op_nodeid, depth);
usr.sbin/eeprom/optree.c
178
int fd;
usr.sbin/eeprom/optree.c
180
if ((fd = open(path_openprom, O_RDONLY)) == -1)
usr.sbin/eeprom/optree.c
182
op_nodes(fd, 0, 0);
usr.sbin/eeprom/optree.c
183
(void)close(fd);
usr.sbin/eigrpd/control.c
103
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/eigrpd/control.c
155
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/eigrpd/control.c
163
control_connbyfd(int fd)
usr.sbin/eigrpd/control.c
168
if (c->iev.ibuf.fd == fd)
usr.sbin/eigrpd/control.c
189
control_close(int fd)
usr.sbin/eigrpd/control.c
193
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/eigrpd/control.c
194
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/eigrpd/control.c
202
close(c->iev.ibuf.fd);
usr.sbin/eigrpd/control.c
214
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/eigrpd/control.c
222
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/eigrpd/control.c
223
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/eigrpd/control.c
229
control_close(fd);
usr.sbin/eigrpd/control.c
235
control_close(fd);
usr.sbin/eigrpd/control.c
242
control_close(fd);
usr.sbin/eigrpd/control.c
46
int fd;
usr.sbin/eigrpd/control.c
54
int fd;
usr.sbin/eigrpd/control.c
57
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/eigrpd/control.c
70
close(fd);
usr.sbin/eigrpd/control.c
75
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/eigrpd/control.c
77
close(fd);
usr.sbin/eigrpd/control.c
85
close(fd);
usr.sbin/eigrpd/control.c
90
control_state.fd = fd;
usr.sbin/eigrpd/control.c
98
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/eigrpd/eigrpd.c
254
event_set(&iev_eigrpe->ev, iev_eigrpe->ibuf.fd, iev_eigrpe->events,
usr.sbin/eigrpd/eigrpd.c
259
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/eigrpd/eigrpd.c
292
close(iev_eigrpe->ibuf.fd);
usr.sbin/eigrpd/eigrpd.c
294
close(iev_rde->ibuf.fd);
usr.sbin/eigrpd/eigrpd.c
319
start_child(enum eigrpd_process p, char *argv0, int fd, int debug, int verbose,
usr.sbin/eigrpd/eigrpd.c
332
close(fd);
usr.sbin/eigrpd/eigrpd.c
336
if (fd != 3) {
usr.sbin/eigrpd/eigrpd.c
337
if (dup2(fd, 3) == -1)
usr.sbin/eigrpd/eigrpd.c
339
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/eigrpd/eigrpd.c
369
main_dispatch_eigrpe(int fd, short event, void *bula)
usr.sbin/eigrpd/eigrpd.c
448
main_dispatch_rde(int fd, short event, void *bula)
usr.sbin/eigrpd/eigrpd.c
535
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/eigrpd/eigrpd.c
541
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/eigrpd/eigrpd.c
546
pid, fd, data, datalen)) != -1)
usr.sbin/eigrpd/eigrpe.c
154
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/eigrpd/eigrpe.c
180
close(iev_rde->ibuf.fd);
usr.sbin/eigrpd/eigrpe.c
183
close(iev_main->ibuf.fd);
usr.sbin/eigrpd/eigrpe.c
216
eigrpe_dispatch_main(int fd, short event, void *bula)
usr.sbin/eigrpd/eigrpe.c
296
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/eigrpd/eigrpe.c
305
if (imsgbuf_init(&iev_rde->ibuf, fd) == -1)
usr.sbin/eigrpd/eigrpe.c
309
event_set(&iev_rde->ev, iev_rde->ibuf.fd,
usr.sbin/eigrpd/eigrpe.c
393
eigrpe_dispatch_rde(int fd, short event, void *bula)
usr.sbin/eigrpd/interface.c
439
eigrp_if_hello_timer(int fd, short event, void *arg)
usr.sbin/eigrpd/interface.c
527
if_set_sockbuf(int fd)
usr.sbin/eigrpd/interface.c
532
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/eigrpd/interface.c
540
while (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bsize,
usr.sbin/eigrpd/interface.c
599
if_set_ipv4_mcast_ttl(int fd, uint8_t ttl)
usr.sbin/eigrpd/interface.c
601
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
usr.sbin/eigrpd/interface.c
629
if_set_ipv4_mcast_loop(int fd)
usr.sbin/eigrpd/interface.c
633
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
usr.sbin/eigrpd/interface.c
643
if_set_ipv4_recvif(int fd, int enable)
usr.sbin/eigrpd/interface.c
645
if (setsockopt(fd, IPPROTO_IP, IP_RECVIF, &enable,
usr.sbin/eigrpd/interface.c
654
if_set_ipv4_hdrincl(int fd)
usr.sbin/eigrpd/interface.c
658
if (setsockopt(fd, IPPROTO_IP, IP_HDRINCL, &hincl, sizeof(hincl)) == -1) {
usr.sbin/eigrpd/interface.c
730
if_set_ipv6_mcast_loop(int fd)
usr.sbin/eigrpd/interface.c
734
if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
usr.sbin/eigrpd/interface.c
744
if_set_ipv6_pktinfo(int fd, int enable)
usr.sbin/eigrpd/interface.c
746
if (setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &enable,
usr.sbin/eigrpd/interface.c
756
if_set_ipv6_dscp(int fd, int dscp)
usr.sbin/eigrpd/interface.c
758
if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &dscp,
usr.sbin/eigrpd/kroute.c
1038
send_rtmsg_v4(int fd, int action, struct kroute *kr)
usr.sbin/eigrpd/kroute.c
1105
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/eigrpd/kroute.c
1126
send_rtmsg_v6(int fd, int action, struct kroute *kr)
usr.sbin/eigrpd/kroute.c
1197
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/eigrpd/kroute.c
1218
send_rtmsg(int fd, int action, struct kroute *kr)
usr.sbin/eigrpd/kroute.c
1222
return (send_rtmsg_v4(fd, action, kr));
usr.sbin/eigrpd/kroute.c
1224
return (send_rtmsg_v6(fd, action, kr));
usr.sbin/eigrpd/kroute.c
1309
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/eigrpd/kroute.c
149
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/eigrpd/kroute.c
1539
return (send_rtmsg(kr_state.fd, RTM_DELETE, &kr));
usr.sbin/eigrpd/kroute.c
156
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/eigrpd/kroute.c
162
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/eigrpd/kroute.c
168
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/eigrpd/kroute.c
181
event_set(&kr_state.ev, kr_state.fd, EV_READ | EV_PERSIST,
usr.sbin/eigrpd/kroute.c
229
if (send_rtmsg(kr_state.fd, action, kr) == -1)
usr.sbin/eigrpd/kroute.c
257
if (send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r) == -1)
usr.sbin/eigrpd/kroute.c
291
send_rtmsg(kr_state.fd, RTM_ADD, &kn->r);
usr.sbin/eigrpd/kroute.c
313
send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r);
usr.sbin/eigrpd/kroute.c
322
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/eigrpd/kroute.c
42
int fd;
usr.sbin/eigrpd/neighbor.c
236
nbr_timeout(int fd, short event, void *arg)
usr.sbin/eigrpd/packet.c
482
recv_packet(int fd, short event, void *bula)
usr.sbin/eigrpd/packet.c
517
if ((r = recvmsg(fd, &msg, 0)) == -1) {
usr.sbin/eigrpd/parse.y
916
check_file_secrecy(int fd, const char *fname)
usr.sbin/eigrpd/parse.y
920
if (fstat(fd, &st)) {
usr.sbin/eigrpd/rde.c
120
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/eigrpd/rde.c
137
close(iev_eigrpe->ibuf.fd);
usr.sbin/eigrpd/rde.c
139
close(iev_main->ibuf.fd);
usr.sbin/eigrpd/rde.c
166
rde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/eigrpd/rde.c
303
rde_dispatch_parent(int fd, short event, void *bula)
usr.sbin/eigrpd/rde.c
365
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/eigrpd/rde.c
374
if (imsgbuf_init(&iev_eigrpe->ibuf, fd) == -1)
usr.sbin/eigrpd/rde.c
378
event_set(&iev_eigrpe->ev, iev_eigrpe->ibuf.fd,
usr.sbin/eigrpd/rde_dual.c
487
reply_active_timer(int fd, short event, void *arg)
usr.sbin/eigrpd/rde_dual.c
519
reply_sia_timer(int fd, short event, void *arg)
usr.sbin/eigrpd/rtp.c
252
rtp_retrans_timer(int fd, short event, void *arg)
usr.sbin/eigrpd/rtp.c
289
rtp_ack_timer(int fd, short event, void *arg)
usr.sbin/fdformat/fdformat.c
102
if (ioctl(fd, FD_GOPTS, &fdopts) == -1)
usr.sbin/fdformat/fdformat.c
107
(void)ioctl(fd, FD_SOPTS, &fdopts);
usr.sbin/fdformat/fdformat.c
121
if (lseek (fd, (off_t) track*tracksize, SEEK_SET) == -1)
usr.sbin/fdformat/fdformat.c
124
else if (read (fd, buf, tracksize) != tracksize
usr.sbin/fdformat/fdformat.c
125
&& read (fd, buf, tracksize) != tracksize)
usr.sbin/fdformat/fdformat.c
128
(void)ioctl(fd, FD_SOPTS, &ofdopts);
usr.sbin/fdformat/fdformat.c
167
int fd, c, track, error, tracks_per_dot, bytes_per_track, errs;
usr.sbin/fdformat/fdformat.c
246
if ((fd = opendev(argv[optind], O_RDWR, OPENDEV_PART, &devname)) == -1)
usr.sbin/fdformat/fdformat.c
249
if (ioctl(fd, FD_GTYPE, &fdt) == -1)
usr.sbin/fdformat/fdformat.c
323
format_track(fd, track / fdt.heads, fdt.sectrac,
usr.sbin/fdformat/fdformat.c
333
if (verify_track(fd, track, bytes_per_track) < 0)
usr.sbin/fdformat/fdformat.c
348
close(fd);
usr.sbin/fdformat/fdformat.c
61
format_track(int fd, int cyl, int secs, int head, int rate, int gaplen,
usr.sbin/fdformat/fdformat.c
91
if (ioctl(fd, FD_FORM, (caddr_t)&f) == -1)
usr.sbin/fdformat/fdformat.c
96
verify_track(int fd, int track, int tracksize)
usr.sbin/hostapd/apme.c
161
hostapd_apme_hopper(int fd, short sig, void *arg)
usr.sbin/hostapd/apme.c
222
hostapd_apme_input(int fd, short sig, void *arg)
usr.sbin/hostapd/apme.c
235
if ((len = read(fd, buf, sizeof(buf))) <
usr.sbin/hostapd/hostapd.c
144
hostapd_check_file_secrecy(int fd, const char *fname)
usr.sbin/hostapd/hostapd.c
148
if (fstat(fd, &st)) {
usr.sbin/hostapd/hostapd.c
172
int fd = -1;
usr.sbin/hostapd/hostapd.c
175
if ((fd = open("/dev/bpf", flags)) == -1) {
usr.sbin/hostapd/hostapd.c
184
if (ioctl(fd, BIOCVERSION, &bpv) == -1)
usr.sbin/hostapd/hostapd.c
192
return (fd);
usr.sbin/hostapd/iapp.c
190
hostapd_iapp_input(int fd, short sig, void *arg)
usr.sbin/hostapd/iapp.c
219
if ((len = recvfrom(fd, buf, sizeof(buf), 0,
usr.sbin/hostapd/parse.y
1707
check_file_secrecy(int fd, const char *fname)
usr.sbin/hostapd/parse.y
1711
if (fstat(fd, &st)) {
usr.sbin/hostapd/privsep.c
187
hostapd_priv_getapme(int fd, struct hostapd_config *cfg)
usr.sbin/hostapd/privsep.c
193
hostapd_must_read(fd, name, IFNAMSIZ);
usr.sbin/hostapd/privsep.c
197
hostapd_must_write(fd, &n, sizeof(int));
usr.sbin/hostapd/privsep.c
204
hostapd_priv(int fd, short sig, void *arg)
usr.sbin/hostapd/privsep.c
223
if (hostapd_may_read(fd, &cmd, sizeof(int)))
usr.sbin/hostapd/privsep.c
231
if ((apme = hostapd_priv_getapme(fd, cfg)) == NULL)
usr.sbin/hostapd/privsep.c
240
hostapd_must_write(fd, &ret, sizeof(int));
usr.sbin/hostapd/privsep.c
242
hostapd_must_write(fd, &bssid.i_bssid,
usr.sbin/hostapd/privsep.c
250
hostapd_must_read(fd, &node, sizeof(struct hostapd_node));
usr.sbin/hostapd/privsep.c
253
if ((apme = hostapd_priv_getapme(fd, cfg)) == NULL)
usr.sbin/hostapd/privsep.c
262
hostapd_must_write(fd, &ret, sizeof(int));
usr.sbin/hostapd/privsep.c
269
hostapd_must_write(fd, &node,
usr.sbin/hostapd/privsep.c
279
hostapd_must_read(fd, &node, sizeof(struct hostapd_node));
usr.sbin/hostapd/privsep.c
282
if ((apme = hostapd_priv_getapme(fd, cfg)) == NULL)
usr.sbin/hostapd/privsep.c
293
hostapd_must_write(fd, &ret, sizeof(int));
usr.sbin/hostapd/privsep.c
300
hostapd_must_read(fd, &node, sizeof(struct hostapd_node));
usr.sbin/hostapd/privsep.c
304
hostapd_must_write(fd, &ret, sizeof(int));
usr.sbin/hostapd/privsep.c
312
hostapd_must_read(fd, &node, sizeof(struct hostapd_node));
usr.sbin/hostapd/privsep.c
314
if ((apme = hostapd_priv_getapme(fd, cfg)) == NULL)
usr.sbin/hostapd/privsep.c
317
hostapd_must_write(fd, &ret, sizeof(int));
usr.sbin/hostapd/privsep.c
488
hostapd_may_read(int fd, void *buf, size_t n)
usr.sbin/hostapd/privsep.c
494
res = read(fd, s + pos, n - pos);
usr.sbin/hostapd/privsep.c
514
hostapd_must_read(int fd, void *buf, size_t n)
usr.sbin/hostapd/privsep.c
520
res = read(fd, s + pos, n - pos);
usr.sbin/hostapd/privsep.c
540
hostapd_must_write(int fd, void *buf, size_t n)
usr.sbin/hostapd/privsep.c
546
res = write(fd, s + pos, n - pos);
usr.sbin/hostctl/hostctl.c
129
if ((fd = open(path_pvbus, O_RDONLY)) == -1)
usr.sbin/hostctl/hostctl.c
146
if (ioctl(fd, PVBUSIOC_TYPE, &pvr, sizeof(pvr)) == -1)
usr.sbin/hostctl/hostctl.c
182
close(fd);
usr.sbin/hostctl/hostctl.c
183
if ((fd = open(path_pvbus, O_RDWR)) == -1)
usr.sbin/hostctl/hostctl.c
185
if ((ret = ioctl(fd, cmd, &pvr, sizeof(pvr))) == -1)
usr.sbin/hostctl/hostctl.c
189
if ((ret = ioctl(fd, cmd, &pvr, sizeof(pvr))) == 0)
usr.sbin/hostctl/hostctl.c
221
close(fd);
usr.sbin/hostctl/hostctl.c
99
int fd, ret;
usr.sbin/httpd/config.c
212
int fd, n, m;
usr.sbin/httpd/config.c
253
fd = -1;
usr.sbin/httpd/config.c
254
else if ((fd = dup(srv->srv_s)) == -1)
usr.sbin/httpd/config.c
257
IMSG_CFG_SERVER, -1, fd, iov, c) != 0) {
usr.sbin/httpd/config.c
805
int fd;
usr.sbin/httpd/config.c
814
fd = imsg_get_fd(imsg);
usr.sbin/httpd/config.c
825
if (fd != -1) {
usr.sbin/httpd/config.c
827
srv->srv_s = fd;
usr.sbin/httpd/config.c
829
close(fd);
usr.sbin/httpd/config.c
842
srv->srv_s = fd;
usr.sbin/httpd/config.c
873
if (fd != -1)
usr.sbin/httpd/config.c
874
close(fd);
usr.sbin/httpd/httpd.c
403
parent_dispatch_server(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/httpd.c
420
parent_dispatch_logger(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/httpd.c
473
parent_tls_ticket_rekey(int fd, short events, void *arg)
usr.sbin/httpd/httpd.c
496
event_again(struct event *ev, int fd, short event,
usr.sbin/httpd/httpd.c
512
event_set(ev, fd, event, fn, arg);
usr.sbin/httpd/logger.c
165
int fd;
usr.sbin/httpd/logger.c
186
if ((fd = open(path, O_WRONLY|O_APPEND|O_CREAT, 0644)) == -1) {
usr.sbin/httpd/logger.c
192
IMSG_LOG_OPEN, -1, fd, &id, sizeof(id));
usr.sbin/httpd/logger.c
194
DPRINTF("%s: opened log file %s, fd %d", __func__, path, fd);
usr.sbin/httpd/logger.c
282
logger_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/logger.c
308
logger_dispatch_server(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/parse.y
1952
check_file_secrecy(int fd, const char *fname)
usr.sbin/httpd/parse.y
1956
if (fstat(fd, &st)) {
usr.sbin/httpd/proc.c
113
fd = ps->ps_pipes[p->p_id][i].pp_pipes[PROC_PARENT][0];
usr.sbin/httpd/proc.c
122
if (fd != PROC_PARENT_SOCK_FILENO) {
usr.sbin/httpd/proc.c
123
if (dup2(fd, PROC_PARENT_SOCK_FILENO) ==
usr.sbin/httpd/proc.c
126
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/httpd/proc.c
134
close(fd);
usr.sbin/httpd/proc.c
163
event_set(&iev->ev, iev->ibuf.fd, iev->events,
usr.sbin/httpd/proc.c
246
proc_accept(struct privsep *ps, int fd, enum privsep_procid dst,
usr.sbin/httpd/proc.c
252
if (fd == -1 || dst < 0 || dst >= PROC_MAX ||
usr.sbin/httpd/proc.c
264
close(fd);
usr.sbin/httpd/proc.c
270
pp->pp_pipes[dst][n] = fd;
usr.sbin/httpd/proc.c
273
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/httpd/proc.c
276
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/httpd/proc.c
576
proc_dispatch(int fd, short event, void *arg)
usr.sbin/httpd/proc.c
631
if ((p->p_cb)(fd, p, &imsg) == 0) {
usr.sbin/httpd/proc.c
673
proc_dispatch_null(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/proc.c
695
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/httpd/proc.c
701
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/httpd/proc.c
706
pid, fd, data, datalen)) == -1)
usr.sbin/httpd/proc.c
714
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/httpd/proc.c
719
pid, fd, iov, iovcnt)) == -1)
usr.sbin/httpd/proc.c
740
uint16_t type, uint32_t peerid, int fd, void *data, uint16_t datalen)
usr.sbin/httpd/proc.c
747
type, peerid, ps->ps_instance + 1, fd, data, datalen) == -1)
usr.sbin/httpd/proc.c
763
uint16_t type, uint32_t peerid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/httpd/proc.c
770
type, peerid, ps->ps_instance + 1, fd, iov, iovcnt) == -1)
usr.sbin/httpd/proc.c
78
int fd;
usr.sbin/httpd/server.c
1060
server_accept(int fd, short event, void *arg)
usr.sbin/httpd/server.c
1073
if ((s = accept_reserve(fd, (struct sockaddr *)&ss,
usr.sbin/httpd/server.c
1171
server_tls_handshake(int fd, short event, void *arg)
usr.sbin/httpd/server.c
1359
server_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/server.c
1423
server_dispatch_logger(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/httpd/server.c
658
struct server_config *srv_conf, int fd, int reuseport)
usr.sbin/httpd/server.c
666
s = fd == -1 ? socket(ss->ss_family, SOCK_STREAM | SOCK_NONBLOCK,
usr.sbin/httpd/server.c
667
IPPROTO_TCP) : fd;
usr.sbin/httpd/server.c
801
server_tls_readcb(int fd, short event, void *arg)
usr.sbin/httpd/server.c
863
server_tls_writecb(int fd, short event, void *arg)
usr.sbin/httpd/server_fcgi.c
101
int fd = -1, ret;
usr.sbin/httpd/server_fcgi.c
105
if ((fd = socket(srv_conf->fastcgi_ss.ss_family,
usr.sbin/httpd/server_fcgi.c
108
if ((connect(fd, (struct sockaddr *)&srv_conf->fastcgi_ss,
usr.sbin/httpd/server_fcgi.c
131
clt->clt_fd = fd;
usr.sbin/httpd/server_fcgi.c
137
clt->clt_srvbev = bufferevent_new(fd, server_fcgi_read,
usr.sbin/httpd/server_fcgi.c
409
if (fd != -1 && clt->clt_fd != fd)
usr.sbin/httpd/server_fcgi.c
410
close(fd);
usr.sbin/httpd/server_file.c
102
close(fd);
usr.sbin/httpd/server_file.c
121
close(fd);
usr.sbin/httpd/server_file.c
127
close(fd);
usr.sbin/httpd/server_file.c
133
close(fd);
usr.sbin/httpd/server_file.c
146
close(fd);
usr.sbin/httpd/server_file.c
150
return (server_file_index(env, clt, fd, &st));
usr.sbin/httpd/server_file.c
152
close(fd);
usr.sbin/httpd/server_file.c
156
close(fd);
usr.sbin/httpd/server_file.c
168
fd, &st, r->kv_value));
usr.sbin/httpd/server_file.c
187
close(fd);
usr.sbin/httpd/server_file.c
202
close(fd);
usr.sbin/httpd/server_file.c
203
fd = gzfd;
usr.sbin/httpd/server_file.c
211
return (server_file_request(env, clt, media, fd, &st));
usr.sbin/httpd/server_file.c
272
struct media_type *media, int fd, const struct stat *st)
usr.sbin/httpd/server_file.c
290
close(fd);
usr.sbin/httpd/server_file.c
301
close(fd);
usr.sbin/httpd/server_file.c
307
clt->clt_fd = fd;
usr.sbin/httpd/server_file.c
337
if (fd != -1)
usr.sbin/httpd/server_file.c
338
close(fd);
usr.sbin/httpd/server_file.c
347
struct media_type *media, int fd, const struct stat *st, char *range_str)
usr.sbin/httpd/server_file.c
436
close(fd);
usr.sbin/httpd/server_file.c
442
clt->clt_fd = fd;
usr.sbin/httpd/server_file.c
472
if (fd != -1)
usr.sbin/httpd/server_file.c
473
close(fd);
usr.sbin/httpd/server_file.c
492
server_file_index(struct httpd *env, struct client *clt, int fd,
usr.sbin/httpd/server_file.c
552
if ((namesize = scandirat(fd, ".", &namelist, select_visible,
usr.sbin/httpd/server_file.c
565
fstatat(fd, dp->d_name, &subst, 0) == -1) {
usr.sbin/httpd/server_file.c
620
close(fd);
usr.sbin/httpd/server_file.c
621
fd = -1;
usr.sbin/httpd/server_file.c
657
if (fd != -1)
usr.sbin/httpd/server_file.c
658
close(fd);
usr.sbin/httpd/server_file.c
69
int ret, fd;
usr.sbin/httpd/server_file.c
71
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/httpd/server_file.c
82
if (fstat(fd, &st) == -1) {
usr.sbin/httpd/server_file.c
83
close(fd);
usr.sbin/httpd/server_file.c
90
close(fd);
usr.sbin/httpd/server_file.c
96
close(fd);
usr.sbin/httpd/server_http.c
1933
int fd;
usr.sbin/httpd/server_http.c
1938
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/httpd/server_http.c
1945
if (fstat(fd, &sb) < 0) {
usr.sbin/httpd/server_http.c
1947
close(fd);
usr.sbin/httpd/server_http.c
1954
close(fd);
usr.sbin/httpd/server_http.c
1957
if (read(fd, ret, sb.st_size) != sb.st_size) {
usr.sbin/httpd/server_http.c
1959
close(fd);
usr.sbin/httpd/server_http.c
1963
close(fd);
usr.sbin/identd/identd.c
1004
identd_response(int fd, short events, void *arg)
usr.sbin/identd/identd.c
1011
n = read(fd, buf, sizeof(buf));
usr.sbin/identd/identd.c
1041
n = write(fd, c->buf + c->bufoff, c->buflen - c->bufoff);
usr.sbin/identd/identd.c
378
parent_rd(int fd, short events, void *arg)
usr.sbin/identd/identd.c
385
n = read(fd, &uid, sizeof(uid));
usr.sbin/identd/identd.c
484
parent_wr(int fd, short events, void *arg)
usr.sbin/identd/identd.c
501
n = writev(fd, iov, iovcnt);
usr.sbin/identd/identd.c
528
child_rd(int fd, short events, void *arg)
usr.sbin/identd/identd.c
537
n = read(fd, &reply, sizeof(reply));
usr.sbin/identd/identd.c
596
fd = EVENT_FD(&c->ev);
usr.sbin/identd/identd.c
598
event_set(&c->ev, fd, EV_READ | EV_WRITE | EV_PERSIST,
usr.sbin/identd/identd.c
608
child_wr(int fd, short events, void *arg)
usr.sbin/identd/identd.c
614
n = write(fd, &c->uid, sizeof(c->uid));
usr.sbin/identd/identd.c
703
identd_paused(int fd, short events, void *arg)
usr.sbin/identd/identd.c
710
identd_accept(int fd, short events, void *arg)
usr.sbin/identd/identd.c
720
s = accept4(fd, sa(&ss), &len, SOCK_NONBLOCK);
usr.sbin/identd/identd.c
740
close(fd);
usr.sbin/identd/identd.c
761
identd_timeout(int fd, short events, void *arg)
usr.sbin/identd/identd.c
766
close(fd);
usr.sbin/identd/identd.c
776
identd_request(int fd, short events, void *arg)
usr.sbin/identd/identd.c
783
n = read(fd, buf, sizeof(buf));
usr.sbin/identd/identd.c
827
event_set(&c->ev, fd, EV_READ | EV_PERSIST, identd_resolving, c);
usr.sbin/identd/identd.c
846
int fd = EVENT_FD(&c->ev);
usr.sbin/identd/identd.c
857
event_set(&c->ev, fd, EV_READ | EV_WRITE | EV_PERSIST,
usr.sbin/identd/identd.c
867
int fd = EVENT_FD(&c->ev);
usr.sbin/identd/identd.c
871
close(fd);
usr.sbin/identd/identd.c
877
identd_resolving(int fd, short events, void *arg)
usr.sbin/identd/identd.c
888
n = read(fd, buf, sizeof(buf));
usr.sbin/identd/identd.c
915
close(fd);
usr.sbin/ifstated/ifstated.c
184
startup_handler(int fd, short event, void *arg)
usr.sbin/ifstated/ifstated.c
203
sighup_handler(int fd, short event, void *arg)
usr.sbin/ifstated/ifstated.c
237
rt_msg_handler(int fd, short event, void *arg)
usr.sbin/ifstated/ifstated.c
247
if ((len = read(fd, msg, sizeof(msg))) == -1) {
usr.sbin/ifstated/ifstated.c
290
sigchld_handler(int fd, short event, void *arg)
usr.sbin/ifstated/ifstated.c
298
external_handler(int fd, short event, void *arg)
usr.sbin/ifstated/parse.y
661
check_file_secrecy(int fd, const char *fname)
usr.sbin/ifstated/parse.y
665
if (fstat(fd, &st)) {
usr.sbin/ikectl/ikeca.c
731
int fd;
usr.sbin/ikectl/ikeca.c
814
if ((fd = open(dst, O_WRONLY|O_CREAT, 0644)) == -1)
usr.sbin/ikectl/ikeca.c
816
if (write(fd, myname, strlen(myname)) == -1)
usr.sbin/ikectl/ikeca.c
818
close(fd);
usr.sbin/ikectl/ikeca.c
954
int fd;
usr.sbin/ikectl/ikeca.c
963
if ((fd = open(ca->index, O_WRONLY | O_CREAT, 0644))
usr.sbin/ikectl/ikeca.c
966
close(fd);
usr.sbin/ikectl/ikeca.c
977
if ((fd = open(ca->serial, O_WRONLY | O_CREAT, 0644))
usr.sbin/ikectl/ikeca.c
981
if (write(fd, "01\n", 3) != 3)
usr.sbin/ikectl/ikeca.c
983
close(fd);
usr.sbin/inetd/inetd.c
1339
nextline(FILE *fd)
usr.sbin/inetd/inetd.c
1341
if (fgets(line, sizeof (line), fd) == NULL)
usr.sbin/inetd/inetd.c
390
gettcp(int fd, short events, void *xsep)
usr.sbin/inetd/inetd.c
822
#define turnon(fd, opt) \
usr.sbin/inetd/inetd.c
823
setsockopt(fd, SOL_SOCKET, opt, &on, sizeof (on))
usr.sbin/installboot/bootstrap.c
44
int fd, i;
usr.sbin/installboot/bootstrap.c
62
fd = open(bootfile, O_RDONLY);
usr.sbin/installboot/bootstrap.c
63
if (fd == -1)
usr.sbin/installboot/bootstrap.c
65
if (fstat(fd, &sb) == -1)
usr.sbin/installboot/bootstrap.c
76
if (read(fd, boot, bootsize) != (ssize_t)sb.st_size)
usr.sbin/installboot/bootstrap.c
78
close(fd);
usr.sbin/installboot/efi_bootmgr.c
164
int fd;
usr.sbin/installboot/efi_bootmgr.c
167
fd = open("/dev/efi", O_RDWR);
usr.sbin/installboot/efi_bootmgr.c
168
if (fd == -1) {
usr.sbin/installboot/efi_bootmgr.c
183
error = ioctl(fd, EFIIOC_VAR_NEXT, &var);
usr.sbin/installboot/efi_bootmgr.c
205
error = ioctl(fd, EFIIOC_VAR_GET, &var);
usr.sbin/installboot/efi_bootmgr.c
244
error = ioctl(fd, EFIIOC_VAR_GET, &var);
usr.sbin/installboot/efi_bootmgr.c
268
error = ioctl(fd, EFIIOC_VAR_SET, &var);
usr.sbin/installboot/efi_bootmgr.c
286
error = ioctl(fd, EFIIOC_VAR_GET, &var);
usr.sbin/installboot/efi_bootmgr.c
318
error = ioctl(fd, EFIIOC_VAR_SET, &var);
usr.sbin/installboot/i386_installboot.c
1073
sbread(int fd, daddr_t poffset, struct fs **fs, char *sblock)
usr.sbin/installboot/i386_installboot.c
1080
devread(fd, sblock, poffset + sboff, SBSIZE, "superblock");
usr.sbin/installboot/i386_installboot.c
717
int fd;
usr.sbin/installboot/i386_installboot.c
724
if ((fd = open(fname, O_RDONLY)) == -1)
usr.sbin/installboot/i386_installboot.c
727
if (read(fd, &eh, sizeof(eh)) != sizeof(eh))
usr.sbin/installboot/i386_installboot.c
751
if (pread(fd, ph, phsize, eh.e_phoff) != phsize)
usr.sbin/installboot/i386_installboot.c
765
if (pread(fd, bp, tdsize, ph->p_offset) != (ssize_t)tdsize)
usr.sbin/installboot/i386_installboot.c
770
close(fd);
usr.sbin/installboot/i386_installboot.c
775
devread(int fd, void *buf, daddr_t blk, size_t size, char *msg)
usr.sbin/installboot/i386_installboot.c
777
if (pread(fd, buf, size, dbtob((off_t)blk)) != (ssize_t)size)
usr.sbin/installboot/i386_installboot.c
788
int fd;
usr.sbin/installboot/i386_installboot.c
812
if ((fd = open(boot, O_RDONLY)) == -1)
usr.sbin/installboot/i386_installboot.c
815
if (fstatfs(fd, &fssb) == -1)
usr.sbin/installboot/i386_installboot.c
823
if (read(fd, &eh, sizeof(eh)) != sizeof(eh))
usr.sbin/installboot/i386_installboot.c
834
if (fsync(fd) != 0)
usr.sbin/installboot/i386_installboot.c
837
if (fstat(fd, &fsb) != 0)
usr.sbin/installboot/i386_installboot.c
854
close(fd);
usr.sbin/installboot/i386_nlist.c
111
if (pread(fd, &ehdr, sizeof(Elf_Ehdr), (off_t)0) != sizeof(Elf_Ehdr) ||
usr.sbin/installboot/i386_nlist.c
112
!__elf_is_okay__(&ehdr) || fstat(fd, &st) == -1)
usr.sbin/installboot/i386_nlist.c
127
MAP_SHARED|MAP_FILE, fd, (off_t) ehdr.e_shoff);
usr.sbin/installboot/i386_nlist.c
133
if (pread(fd, shdr, shdr_size, (off_t)ehdr.e_shoff) !=
usr.sbin/installboot/i386_nlist.c
204
if (pread(fd, strtab, symstrsize, (off_t)symstroff) !=
usr.sbin/installboot/i386_nlist.c
211
MAP_SHARED|MAP_FILE, fd, (off_t) symstroff);
usr.sbin/installboot/i386_nlist.c
218
if (pread(fd, sbuf, cc, (off_t)symoff) != cc)
usr.sbin/installboot/i386_nlist.c
301
int fd, n;
usr.sbin/installboot/i386_nlist.c
303
fd = open(name, O_RDONLY);
usr.sbin/installboot/i386_nlist.c
304
if (fd == -1)
usr.sbin/installboot/i386_nlist.c
306
n = __elf_fdnlist(fd, list);
usr.sbin/installboot/i386_nlist.c
307
close(fd);
usr.sbin/installboot/i386_nlist.c
94
__elf_fdnlist(int fd, struct nlist *list)
usr.sbin/installboot/i386_softraid.c
104
int fd, i;
usr.sbin/installboot/i386_softraid.c
123
fd = open(stage2, O_RDONLY);
usr.sbin/installboot/i386_softraid.c
124
if (fd == -1)
usr.sbin/installboot/i386_softraid.c
127
if (fstat(fd, &sb) == -1)
usr.sbin/installboot/i386_softraid.c
141
ino_p->di_size = read(fd, p, sb.st_blocks * S_BLKSIZE);
usr.sbin/installboot/i386_softraid.c
181
close(fd);
usr.sbin/installboot/landisk_installboot.c
109
fd = open(bootfile, O_RDONLY);
usr.sbin/installboot/landisk_installboot.c
110
if (fd == -1)
usr.sbin/installboot/landisk_installboot.c
112
if (fstat(fd, &sb) == -1)
usr.sbin/installboot/landisk_installboot.c
123
if (read(fd, boot, bootsize) != (ssize_t)sb.st_size)
usr.sbin/installboot/landisk_installboot.c
125
close(fd);
usr.sbin/installboot/landisk_installboot.c
91
int fd, i;
usr.sbin/installboot/sparc64_installboot.c
55
int fd;
usr.sbin/installboot/sparc64_installboot.c
58
if ((fd = open(stage1, O_RDONLY)) == -1)
usr.sbin/installboot/sparc64_installboot.c
60
if (fstat(fd, &sb) == -1)
usr.sbin/installboot/sparc64_installboot.c
74
if (read(fd, blkstore, sb.st_size) != (ssize_t)sb.st_size)
usr.sbin/installboot/sparc64_installboot.c
76
close(fd);
usr.sbin/installboot/sparc64_installboot.c
79
if ((fd = open(stage2, O_RDONLY)) == -1)
usr.sbin/installboot/sparc64_installboot.c
81
if (fstat(fd, &sb) == -1)
usr.sbin/installboot/sparc64_installboot.c
87
if (read(fd, ldrstore, ldrsize) != (ssize_t)sb.st_size)
usr.sbin/installboot/sparc64_installboot.c
89
close(fd);
usr.sbin/installboot/util.c
145
int fd, ret;
usr.sbin/installboot/util.c
148
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC,
usr.sbin/installboot/util.c
150
if (fd == -1) {
usr.sbin/installboot/util.c
154
if (fchown(fd, 0, 0) == -1) {
usr.sbin/installboot/util.c
160
if (fchmod(fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) == -1) {
usr.sbin/installboot/util.c
166
ret = vdprintf(fd, fmt, ap);
usr.sbin/installboot/util.c
177
close(fd);
usr.sbin/iscsictl/iscsictl.c
105
if ((control.fd = socket(AF_UNIX, SOCK_SEQPACKET, 0)) == -1)
usr.sbin/iscsictl/iscsictl.c
112
if (connect(control.fd, (struct sockaddr *)&sun, sizeof(sun)) == -1)
usr.sbin/iscsictl/iscsictl.c
193
close(control.fd);
usr.sbin/iscsictl/iscsictl.c
221
if (ctl_sendpdu(control.fd, pdu) == -1)
usr.sbin/iscsictl/iscsictl.c
224
if ((n = recv(control.fd, cbuf, sizeof(cbuf), 0)) == -1 &&
usr.sbin/iscsictl/iscsictl.c
313
ctl_sendpdu(int fd, struct pdu *pdu)
usr.sbin/iscsictl/iscsictl.c
326
if (sendmsg(fd, &msg, 0) == -1)
usr.sbin/iscsictl/iscsictl.c
52
int fd;
usr.sbin/iscsid/connection.c
103
if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, &nodelay,
usr.sbin/iscsid/connection.c
107
event_set(&c->ev, c->fd, EV_READ|EV_PERSIST, conn_dispatch, c);
usr.sbin/iscsid/connection.c
108
event_set(&c->wev, c->fd, EV_WRITE, conn_write_dispatch, c);
usr.sbin/iscsid/connection.c
124
if (c->fd != -1)
usr.sbin/iscsid/connection.c
125
close(c->fd);
usr.sbin/iscsid/connection.c
134
conn_dispatch(int fd, short event, void *arg)
usr.sbin/iscsid/connection.c
160
conn_write_dispatch(int fd, short event, void *arg)
usr.sbin/iscsid/connection.c
175
if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR,
usr.sbin/iscsid/connection.c
520
if (c->fd == -1) {
usr.sbin/iscsid/connection.c
527
if (bind(c->fd, (struct sockaddr *)&c->config.LocalAddr,
usr.sbin/iscsid/connection.c
535
if (connect(c->fd, (struct sockaddr *)&c->config.TargetAddr,
usr.sbin/iscsid/connection.c
606
close(c->fd);
usr.sbin/iscsid/connection.c
607
c->fd = -1; /* make sure this fd is not closed again */
usr.sbin/iscsid/connection.c
63
c->fd = -1;
usr.sbin/iscsid/connection.c
90
c->fd = socket(c->config.TargetAddr.ss_family, SOCK_STREAM, 0);
usr.sbin/iscsid/connection.c
91
if (c->fd == -1) {
usr.sbin/iscsid/connection.c
96
if (socket_setblockmode(c->fd, 1)) {
usr.sbin/iscsid/control.c
104
if (listen(fd, CONTROL_BACKLOG) == -1) {
usr.sbin/iscsid/control.c
106
close(fd);
usr.sbin/iscsid/control.c
111
socket_setblockmode(fd, 1);
usr.sbin/iscsid/control.c
112
control_state->fd = fd;
usr.sbin/iscsid/control.c
125
close(control_state->fd);
usr.sbin/iscsid/control.c
132
event_set(&control_state->ev, control_state->fd, EV_READ,
usr.sbin/iscsid/control.c
175
c->fd = connfd;
usr.sbin/iscsid/control.c
184
close(c->fd);
usr.sbin/iscsid/control.c
199
control_dispatch(int fd, short event, void *bula)
usr.sbin/iscsid/control.c
210
log_debug("control connection (fd %d) timed out.", fd);
usr.sbin/iscsid/control.c
215
if ((n = recv(fd, cbuf, sizeof(cbuf), 0)) == -1 &&
usr.sbin/iscsid/control.c
226
log_debug("control connection (fd %d) bad msg.", fd);
usr.sbin/iscsid/control.c
241
if (sendmsg(fd, &msg, 0) == -1) {
usr.sbin/iscsid/control.c
255
event_set(&c->ev, fd, flags, control_dispatch, c);
usr.sbin/iscsid/control.c
315
event_set(&c->ev, c->fd, EV_READ|EV_WRITE, control_dispatch, c);
usr.sbin/iscsid/control.c
39
int fd;
usr.sbin/iscsid/control.c
45
int fd;
usr.sbin/iscsid/control.c
59
int fd;
usr.sbin/iscsid/control.c
67
if ((fd = socket(AF_UNIX, SOCK_SEQPACKET, 0)) == -1) {
usr.sbin/iscsid/control.c
77
close(fd);
usr.sbin/iscsid/control.c
84
close(fd);
usr.sbin/iscsid/control.c
89
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/iscsid/control.c
91
close(fd);
usr.sbin/iscsid/control.c
99
close(fd);
usr.sbin/iscsid/iscsid.c
162
shutdown_cb(int fd, short event, void *arg)
usr.sbin/iscsid/iscsid.h
283
int fd;
usr.sbin/iscsid/pdu.c
275
if ((n = readv(c->fd, iov, niov)) == -1)
usr.sbin/iscsid/pdu.c
314
if ((n = writev(c->fd, iov, niov)) == -1) {
usr.sbin/iscsid/session.c
204
session_fsm_callback(int fd, short event, void *arg)
usr.sbin/iscsid/util.c
108
socket_setblockmode(int fd, int nonblocking)
usr.sbin/iscsid/util.c
112
if ((flags = fcntl(fd, F_GETFL)) == -1)
usr.sbin/iscsid/util.c
120
if ((flags = fcntl(fd, F_SETFL, flags)) == -1)
usr.sbin/iscsid/vscsi.c
164
if (ioctl(v.fd, req, &data) == -1)
usr.sbin/iscsid/vscsi.c
186
if (ioctl(v.fd, VSCSI_T2I, &t2i) == -1)
usr.sbin/iscsid/vscsi.c
203
if (ioctl(v.fd, req, &devev) == -1)
usr.sbin/iscsid/vscsi.c
38
int fd;
usr.sbin/iscsid/vscsi.c
58
if ((v.fd = open(dev, O_RDWR)) == -1)
usr.sbin/iscsid/vscsi.c
61
event_set(&v.ev, v.fd, EV_READ|EV_PERSIST, vscsi_dispatch, NULL);
usr.sbin/iscsid/vscsi.c
66
vscsi_dispatch(int fd, short event, void *arg)
usr.sbin/iscsid/vscsi.c
79
if (ioctl(v.fd, VSCSI_I2T, &i2t) == -1)
usr.sbin/kvm_mkdb/kvm_mkdb.c
136
if ((fd = open(nlistpath, O_RDONLY)) == -1)
usr.sbin/kvm_mkdb/kvm_mkdb.c
138
rval = kvm_mkdb(fd, dbdir, nlistpath, nlistname, kvm_gid,
usr.sbin/kvm_mkdb/kvm_mkdb.c
142
if ((fd = open((nlistpath = _PATH_KSYMS), O_RDONLY)) == -1 ||
usr.sbin/kvm_mkdb/kvm_mkdb.c
143
(rval = kvm_mkdb(fd, dbdir, nlistpath, nlistname, kvm_gid,
usr.sbin/kvm_mkdb/kvm_mkdb.c
145
if (fd == -1)
usr.sbin/kvm_mkdb/kvm_mkdb.c
149
if ((fd = open((nlistpath = _PATH_UNIX), O_RDONLY)) == -1)
usr.sbin/kvm_mkdb/kvm_mkdb.c
151
rval = kvm_mkdb(fd, dbdir, nlistpath, nlistname,
usr.sbin/kvm_mkdb/kvm_mkdb.c
159
kvm_mkdb(int fd, const char *dbdir, char *nlistpath, char *nlistname, gid_t gid,
usr.sbin/kvm_mkdb/kvm_mkdb.c
195
if (gid != -1 && fchown(db->fd(db), -1, gid) == -1) {
usr.sbin/kvm_mkdb/kvm_mkdb.c
201
if (create_knlist(nlistpath, fd, db) != 0) {
usr.sbin/kvm_mkdb/kvm_mkdb.c
69
int fd, rval, ch, verbose = 0;
usr.sbin/kvm_mkdb/nlist.c
303
create_knlist(char *name, int fd, DB *db)
usr.sbin/kvm_mkdb/nlist.c
316
error = __elf_knlist(fd, db, ksyms);
usr.sbin/kvm_mkdb/nlist.c
58
int __elf_knlist(int fd, DB *db, int ksyms);
usr.sbin/kvm_mkdb/nlist.c
61
__elf_knlist(int fd, DB *db, int ksyms)
usr.sbin/kvm_mkdb/nlist.c
78
if ((fp = fdopen(fd, "r")) == NULL)
usr.sbin/ldapd/auth.c
190
auth_req.fd = req->conn->fd;
usr.sbin/ldapd/btree.c
1010
if ((size = lseek(bt->fd, 0, SEEK_END)) == -1)
usr.sbin/ldapd/btree.c
1083
btree_open_fd(int fd, unsigned int flags)
usr.sbin/ldapd/btree.c
1088
fl = fcntl(fd, F_GETFL);
usr.sbin/ldapd/btree.c
1089
if (fcntl(fd, F_SETFL, fl | O_APPEND) == -1)
usr.sbin/ldapd/btree.c
1094
bt->fd = fd;
usr.sbin/ldapd/btree.c
1113
btree_write_header(bt, bt->fd);
usr.sbin/ldapd/btree.c
1143
int fd, oflags;
usr.sbin/ldapd/btree.c
1151
if ((fd = open(path, oflags, mode)) == -1)
usr.sbin/ldapd/btree.c
1154
if ((bt = btree_open_fd(fd, flags)) == NULL)
usr.sbin/ldapd/btree.c
1155
close(fd);
usr.sbin/ldapd/btree.c
1179
close(bt->fd);
usr.sbin/ldapd/btree.c
202
int fd;
usr.sbin/ldapd/btree.c
243
static int btree_write_header(struct btree *bt, int fd);
usr.sbin/ldapd/btree.c
3049
rc = write(btc->fd, p, bt->head.psize);
usr.sbin/ldapd/btree.c
3063
int fd;
usr.sbin/ldapd/btree.c
3082
fd = mkstemp(compact_path);
usr.sbin/ldapd/btree.c
3083
if (fd == -1) {
usr.sbin/ldapd/btree.c
3089
if ((btc = btree_open_fd(fd, 0)) == NULL)
usr.sbin/ldapd/btree.c
3105
fsync(fd);
usr.sbin/ldapd/btree.c
3143
return ftruncate(bt->fd, bt->head.psize * bt->meta.root);
usr.sbin/ldapd/btree.c
611
if ((rc = pread(bt->fd, page, bt->head.psize, (off_t)pgno*bt->head.psize)) == 0) {
usr.sbin/ldapd/btree.c
637
return fsync(bt->fd);
usr.sbin/ldapd/btree.c
668
if (flock(bt->fd, LOCK_EX | LOCK_NB) != 0) {
usr.sbin/ldapd/btree.c
717
if (flock(txn->bt->fd, LOCK_UN) != 0) {
usr.sbin/ldapd/btree.c
719
txn->bt->fd, strerror(errno));
usr.sbin/ldapd/btree.c
768
size = lseek(bt->fd, 0, SEEK_END);
usr.sbin/ldapd/btree.c
771
if (ftruncate(bt->fd, size) != 0) {
usr.sbin/ldapd/btree.c
801
rc = writev(bt->fd, iov, n);
usr.sbin/ldapd/btree.c
837
btree_write_header(struct btree *bt, int fd)
usr.sbin/ldapd/btree.c
851
if (fstat(fd, &sb) == 0)
usr.sbin/ldapd/btree.c
866
rc = write(fd, p, bt->head.psize);
usr.sbin/ldapd/btree.c
890
if ((rc = pread(bt->fd, page, PAGESIZE, 0)) == 0) {
usr.sbin/ldapd/btree.c
952
rc = write(bt->fd, mp->page, bt->head.psize);
usr.sbin/ldapd/btree.c
961
if ((bt->size = lseek(bt->fd, 0, SEEK_END)) == -1) {
usr.sbin/ldapd/btree.h
76
struct btree *btree_open_fd(int fd, unsigned int flags);
usr.sbin/ldapd/conn.c
177
"received invalid request on fd %d", conn->fd);
usr.sbin/ldapd/conn.c
184
"received request on fd %d", conn->fd);
usr.sbin/ldapd/conn.c
241
log_debug("end-of-file on connection %d", conn->fd);
usr.sbin/ldapd/conn.c
243
log_debug("timeout on connection %d", conn->fd);
usr.sbin/ldapd/conn.c
246
why & EVBUFFER_WRITE ? "write" : "read", conn->fd);
usr.sbin/ldapd/conn.c
252
conn_accept(int fd, short event, void *data)
usr.sbin/ldapd/conn.c
266
afd = accept_reserve(fd, (struct sockaddr *)&remote_addr, &addrlen,
usr.sbin/ldapd/conn.c
301
conn->fd = afd;
usr.sbin/ldapd/conn.c
337
conn_by_fd(int fd)
usr.sbin/ldapd/conn.c
342
if (conn->fd == fd)
usr.sbin/ldapd/conn.c
381
if (tls_accept_socket(l->tls, &conn->tls, conn->fd) < 0) {
usr.sbin/ldapd/conn.c
387
buffertls_set(&conn->buftls, conn->bev, conn->tls, conn->fd);
usr.sbin/ldapd/conn.c
388
buffertls_accept(&conn->buftls, conn->fd);
usr.sbin/ldapd/conn.c
55
log_debug("closing connection %d", conn->fd);
usr.sbin/ldapd/conn.c
72
close(conn->fd);
usr.sbin/ldapd/control.c
162
control_connbyfd(int fd)
usr.sbin/ldapd/control.c
167
if (c->iev.ibuf.fd == fd)
usr.sbin/ldapd/control.c
175
control_close(int fd, struct control_sock *cs)
usr.sbin/ldapd/control.c
179
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ldapd/control.c
180
log_warnx("control_close: fd %d: not found", fd);
usr.sbin/ldapd/control.c
184
log_debug("close control fd %d", c->iev.ibuf.fd);
usr.sbin/ldapd/control.c
232
int fd, verbose;
usr.sbin/ldapd/control.c
235
fd = iev->ibuf.fd;
usr.sbin/ldapd/control.c
237
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ldapd/control.c
238
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/ldapd/control.c
243
control_close(fd, cs);
usr.sbin/ldapd/control.c
247
log_debug("%s: got imsg %d on fd %d", __func__, imsg->hdr.type, fd);
usr.sbin/ldapd/control.c
252
control_close(fd, cs);
usr.sbin/ldapd/control.c
285
control_close(c->iev.ibuf.fd, cs);
usr.sbin/ldapd/control.c
53
int fd;
usr.sbin/ldapd/control.c
59
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1)
usr.sbin/ldapd/control.c
68
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0)
usr.sbin/ldapd/control.c
82
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/ldapd/control.c
93
cs->cs_fd = fd;
usr.sbin/ldapd/evbuffer_tls.c
106
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_readcb,
usr.sbin/ldapd/evbuffer_tls.c
121
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
149
buffertls_writecb(int fd, short event, void *arg)
usr.sbin/ldapd/evbuffer_tls.c
163
res = evtls_write(bufev->output, fd, ctx);
usr.sbin/ldapd/evbuffer_tls.c
167
event_set(&bufev->ev_read, fd, EV_READ,
usr.sbin/ldapd/evbuffer_tls.c
186
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
207
buffertls_handshakecb(int fd, short event, void *arg)
usr.sbin/ldapd/evbuffer_tls.c
238
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
239
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
253
struct tls *ctx, int fd)
usr.sbin/ldapd/evbuffer_tls.c
255
bufferevent_setfd(bufev, fd);
usr.sbin/ldapd/evbuffer_tls.c
256
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
257
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
263
buffertls_accept(struct buffertls *buftls, int fd)
usr.sbin/ldapd/evbuffer_tls.c
269
event_set(&bufev->ev_read, fd, EV_READ, buffertls_handshakecb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
270
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_handshakecb,
usr.sbin/ldapd/evbuffer_tls.c
276
buffertls_connect(struct buffertls *buftls, int fd)
usr.sbin/ldapd/evbuffer_tls.c
282
event_set(&bufev->ev_read, fd, EV_READ, buffertls_handshakecb, buftls);
usr.sbin/ldapd/evbuffer_tls.c
283
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_handshakecb,
usr.sbin/ldapd/evbuffer_tls.c
295
evtls_read(struct evbuffer *buf, int fd, int howmuch, struct tls *ctx)
usr.sbin/ldapd/evbuffer_tls.c
325
evtls_write(struct evbuffer *buffer, int fd, struct tls *ctx)
usr.sbin/ldapd/evbuffer_tls.c
68
buffertls_readcb(int fd, short event, void *arg)
usr.sbin/ldapd/evbuffer_tls.c
99
res = evtls_read(bufev->input, fd, howmuch, ctx);
usr.sbin/ldapd/imsgev.c
100
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ldapd/imsgev.c
105
imsgev_dispatch(int fd, short ev, void *humppa)
usr.sbin/ldapd/imsgev.c
37
imsgev_init(struct imsgev *iev, int fd, void *data,
usr.sbin/ldapd/imsgev.c
41
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/ldapd/imsgev.c
52
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ldapd/imsgev.c
58
uint32_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ldapd/imsgev.c
62
r = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data, datalen);
usr.sbin/ldapd/imsgev.c
81
close(iev->ibuf.fd);
usr.sbin/ldapd/ldapd.c
270
__func__, imsg->hdr.type, iev->ibuf.fd);
usr.sbin/ldapd/ldapd.c
358
ares.fd = areq->fd;
usr.sbin/ldapd/ldapd.c
381
int oflags, fd;
usr.sbin/ldapd/ldapd.c
400
fd = open(oreq->path, oflags | O_NOFOLLOW, 0600);
usr.sbin/ldapd/ldapd.c
401
if (fd == -1)
usr.sbin/ldapd/ldapd.c
404
imsgev_compose(iev, IMSG_LDAPD_OPEN_RESULT, 0, 0, fd, oreq,
usr.sbin/ldapd/ldapd.c
409
start_child(enum ldapd_process p, char *argv0, int fd, int debug,
usr.sbin/ldapd/ldapd.c
422
close(fd);
usr.sbin/ldapd/ldapd.c
426
if (fd != PROC_PARENT_SOCK_FILENO) {
usr.sbin/ldapd/ldapd.c
427
if (dup2(fd, PROC_PARENT_SOCK_FILENO) == -1)
usr.sbin/ldapd/ldapd.c
429
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/ldapd/ldapd.c
46
void ldapd_sig_handler(int fd, short why, void *data);
usr.sbin/ldapd/ldapd.h
203
int fd;
usr.sbin/ldapd/ldapd.h
217
int fd;
usr.sbin/ldapd/ldapd.h
272
int fd;
usr.sbin/ldapd/ldapd.h
281
int fd;
usr.sbin/ldapd/ldapd.h
341
struct conn *conn_by_fd(int fd);
usr.sbin/ldapd/ldapd.h
345
void conn_accept(int fd, short why, void *data);
usr.sbin/ldapd/ldapd.h
371
int namespace_set_data_fd(struct namespace *ns, int fd);
usr.sbin/ldapd/ldapd.h
372
int namespace_set_indx_fd(struct namespace *ns, int fd);
usr.sbin/ldapd/ldape.c
36
void ldape_sig_handler(int fd, short why, void *data);
usr.sbin/ldapd/ldape.c
386
l->fd = socket(l->ss.ss_family, SOCK_STREAM | SOCK_NONBLOCK,
usr.sbin/ldapd/ldape.c
388
if (l->fd == -1)
usr.sbin/ldapd/ldape.c
391
setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
usr.sbin/ldapd/ldape.c
407
if (bind(l->fd, (struct sockaddr *)&l->ss, l->ss.ss_len) != 0)
usr.sbin/ldapd/ldape.c
420
if (listen(l->fd, 20) != 0)
usr.sbin/ldapd/ldape.c
423
event_set(&l->ev, l->fd, EV_READ, conn_accept, l);
usr.sbin/ldapd/ldape.c
488
__func__, imsg->hdr.type, iev->ibuf.fd);
usr.sbin/ldapd/ldape.c
536
log_debug("authentication on conn %d/%lld = %d", ares->fd, ares->msgid,
usr.sbin/ldapd/ldape.c
538
conn = conn_by_fd(ares->fd);
usr.sbin/ldapd/ldape.c
550
int fd;
usr.sbin/ldapd/ldape.c
558
fd = imsg_get_fd(imsg);
usr.sbin/ldapd/ldape.c
559
log_debug("open(%s) returned fd %d", oreq->path, fd);
usr.sbin/ldapd/ldape.c
565
namespace_set_data_fd(ns, fd);
usr.sbin/ldapd/ldape.c
569
namespace_set_indx_fd(ns, fd);
usr.sbin/ldapd/ldape.c
576
close(fd);
usr.sbin/ldapd/ldape.c
93
ldap_debug_elements(root, type, "sending response on fd %d", conn->fd);
usr.sbin/ldapd/namespace.c
184
namespace_set_fd(struct namespace *ns, struct btree **bt, int fd,
usr.sbin/ldapd/namespace.c
191
*bt = btree_open_fd(fd, flags);
usr.sbin/ldapd/namespace.c
198
namespace_set_data_fd(struct namespace *ns, int fd)
usr.sbin/ldapd/namespace.c
200
return namespace_set_fd(ns, &ns->data_db, fd, BT_REVERSEKEY);
usr.sbin/ldapd/namespace.c
204
namespace_set_indx_fd(struct namespace *ns, int fd)
usr.sbin/ldapd/namespace.c
206
return namespace_set_fd(ns, &ns->indx_db, fd, 0);
usr.sbin/ldapd/namespace.c
40
static void namespace_queue_replay(int fd, short event, void *arg);
usr.sbin/ldapd/namespace.c
42
struct btree **bt, int fd, unsigned int flags);
usr.sbin/ldapd/namespace.c
490
namespace_queue_replay(int fd, short event, void *data)
usr.sbin/ldapd/parse.y
1132
h->fd = -1;
usr.sbin/ldapd/parse.y
1153
h->fd = -1;
usr.sbin/ldapd/parse.y
754
check_file_secrecy(int fd, const char *fname)
usr.sbin/ldapd/parse.y
758
if (fstat(fd, &st)) {
usr.sbin/ldapd/search.c
149
"sending search entry on fd %d", conn->fd);
usr.sbin/ldapd/search.c
457
search->conn->fd, search->req->msgid,
usr.sbin/ldapd/search.c
469
search->conn->fd, search->req->msgid,
usr.sbin/ldomctl/ldomctl.c
348
int ch, fd, save_errno;
usr.sbin/ldomctl/ldomctl.c
371
if ((fd = open(imgfile_path, O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
usr.sbin/ldomctl/ldomctl.c
376
if (ftruncate(fd, (off_t)imgsize) == -1) {
usr.sbin/ldomctl/ldomctl.c
378
close(fd);
usr.sbin/ldomctl/ldomctl.c
384
close(fd);
usr.sbin/ldomd/ds.c
676
dc->fd = open(path, O_RDWR);
usr.sbin/ldomd/ds.c
677
if (dc->fd == -1)
usr.sbin/ldomd/ds.c
681
dc->lc.lc_fd = dc->fd;
usr.sbin/ldomd/ds.c
708
nbytes = read(dc->fd, &lp, sizeof(lp));
usr.sbin/ldomd/ds.c
738
pfd[dc->id].fd = dc->fd;
usr.sbin/ldomd/ds.h
223
int fd;
usr.sbin/ldpd/accept.c
123
accept_cb(int fd, short event, void *arg)
usr.sbin/ldpd/accept.c
127
av->accept_cb(fd, event, av->arg);
usr.sbin/ldpd/accept.c
131
accept_timeout(int fd, short event, void *bula)
usr.sbin/ldpd/accept.c
31
int fd;
usr.sbin/ldpd/accept.c
52
accept_add(int fd, void (*cb)(int, short, void *), void *arg)
usr.sbin/ldpd/accept.c
58
av->fd = fd;
usr.sbin/ldpd/accept.c
63
event_set(&av->ev, av->fd, EV_READ, accept_cb, av);
usr.sbin/ldpd/accept.c
66
log_debug("%s: accepting on fd %d", __func__, fd);
usr.sbin/ldpd/accept.c
72
accept_del(int fd)
usr.sbin/ldpd/accept.c
77
if (av->fd == fd) {
usr.sbin/ldpd/accept.c
78
log_debug("%s: %d removed from queue", __func__, fd);
usr.sbin/ldpd/adjacency.c
160
adj_itimer(int fd, short event, void *arg)
usr.sbin/ldpd/adjacency.c
299
tnbr_hello_timer(int fd, short event, void *arg)
usr.sbin/ldpd/control.c
145
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/ldpd/control.c
153
control_connbyfd(int fd)
usr.sbin/ldpd/control.c
158
if (c->iev.ibuf.fd == fd)
usr.sbin/ldpd/control.c
179
control_close(int fd)
usr.sbin/ldpd/control.c
183
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ldpd/control.c
184
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/ldpd/control.c
192
close(c->iev.ibuf.fd);
usr.sbin/ldpd/control.c
198
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ldpd/control.c
206
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ldpd/control.c
207
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/ldpd/control.c
213
control_close(fd);
usr.sbin/ldpd/control.c
219
control_close(fd);
usr.sbin/ldpd/control.c
226
control_close(fd);
usr.sbin/ldpd/control.c
48
int fd;
usr.sbin/ldpd/control.c
51
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/ldpd/control.c
64
close(fd);
usr.sbin/ldpd/control.c
69
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/ldpd/control.c
71
close(fd);
usr.sbin/ldpd/control.c
79
close(fd);
usr.sbin/ldpd/control.c
84
control_fd = fd;
usr.sbin/ldpd/hello.c
142
send_packet(fd, af, &dst, ia, ibuf_data(buf), ibuf_size(buf));
usr.sbin/ldpd/hello.c
42
int fd = 0;
usr.sbin/ldpd/hello.c
51
fd = (ldp_af_global_get(&global, af))->ldp_disc_socket;
usr.sbin/ldpd/hello.c
73
fd = (ldp_af_global_get(&global, af))->ldp_edisc_socket;
usr.sbin/ldpd/interface.c
378
if_hello_timer(int fd, short event, void *arg)
usr.sbin/ldpd/kroute.c
1163
send_rtmsg(int fd, int action, struct kroute *kr, int family)
usr.sbin/ldpd/kroute.c
1167
return (send_rtmsg_v4(fd, action, kr, family));
usr.sbin/ldpd/kroute.c
1169
return (send_rtmsg_v6(fd, action, kr, family));
usr.sbin/ldpd/kroute.c
1176
send_rtmsg_v4(int fd, int action, struct kroute *kr, int family)
usr.sbin/ldpd/kroute.c
121
static int send_rtmsg_v4(int fd, int, struct kroute *, int);
usr.sbin/ldpd/kroute.c
122
static int send_rtmsg_v6(int fd, int, struct kroute *, int);
usr.sbin/ldpd/kroute.c
1290
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/ldpd/kroute.c
1311
send_rtmsg_v6(int fd, int action, struct kroute *kr, int family)
usr.sbin/ldpd/kroute.c
1436
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/ldpd/kroute.c
1533
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/ldpd/kroute.c
163
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/ldpd/kroute.c
170
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/ldpd/kroute.c
180
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_MSGFILTER,
usr.sbin/ldpd/kroute.c
186
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ldpd/kroute.c
192
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ldpd/kroute.c
203
event_set(&kr_state.ev, kr_state.fd, EV_READ | EV_PERSIST,
usr.sbin/ldpd/kroute.c
257
if (send_rtmsg(kr_state.fd, action, &kn->r, AF_MPLS) == -1)
usr.sbin/ldpd/kroute.c
262
if (send_rtmsg(kr_state.fd, RTM_CHANGE, &kn->r, kn->r.af) == -1)
usr.sbin/ldpd/kroute.c
300
if (send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r, AF_MPLS) == -1)
usr.sbin/ldpd/kroute.c
308
send_rtmsg(kr_state.fd, RTM_CHANGE, &kn->r, kn->r.af) == -1)
usr.sbin/ldpd/kroute.c
344
send_rtmsg(kr_state.fd, RTM_ADD, &kn->r, AF_MPLS);
usr.sbin/ldpd/kroute.c
348
send_rtmsg(kr_state.fd, RTM_CHANGE,
usr.sbin/ldpd/kroute.c
382
send_rtmsg(kr_state.fd, RTM_DELETE,
usr.sbin/ldpd/kroute.c
389
send_rtmsg(kr_state.fd, RTM_CHANGE,
usr.sbin/ldpd/kroute.c
44
int fd;
usr.sbin/ldpd/kroute.c
441
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/ldpd/kroute.c
710
if (send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r, AF_MPLS) == -1)
usr.sbin/ldpd/lde.c
136
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ldpd/lde.c
157
close(iev_ldpe->ibuf.fd);
usr.sbin/ldpd/lde.c
159
close(iev_main->ibuf.fd);
usr.sbin/ldpd/lde.c
190
lde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ldpd/lde.c
382
lde_dispatch_parent(int fd, short event, void *bula)
usr.sbin/ldpd/lde.c
461
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/ldpd/lde.c
469
if (imsgbuf_init(&iev_ldpe->ibuf, fd) == -1)
usr.sbin/ldpd/lde.c
473
event_set(&iev_ldpe->ev, iev_ldpe->ibuf.fd,
usr.sbin/ldpd/lde_lib.c
889
lde_gc_timer(int fd, short event, void *arg)
usr.sbin/ldpd/ldpd.c
256
event_set(&iev_ldpe->ev, iev_ldpe->ibuf.fd, iev_ldpe->events,
usr.sbin/ldpd/ldpd.c
261
event_set(&iev_lde->ev, iev_lde->ibuf.fd, iev_lde->events,
usr.sbin/ldpd/ldpd.c
299
close(iev_ldpe->ibuf.fd);
usr.sbin/ldpd/ldpd.c
301
close(iev_lde->ibuf.fd);
usr.sbin/ldpd/ldpd.c
326
start_child(enum ldpd_process p, char *argv0, int fd, int debug, int verbose,
usr.sbin/ldpd/ldpd.c
339
close(fd);
usr.sbin/ldpd/ldpd.c
343
if (fd != 3) {
usr.sbin/ldpd/ldpd.c
344
if (dup2(fd, 3) == -1)
usr.sbin/ldpd/ldpd.c
346
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/ldpd/ldpd.c
376
main_dispatch_ldpe(int fd, short event, void *bula)
usr.sbin/ldpd/ldpd.c
457
main_dispatch_lde(int fd, short event, void *bula)
usr.sbin/ldpd/ldpd.c
565
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ldpd/ldpd.c
571
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/ldpd/ldpd.c
576
pid, fd, data, datalen)) != -1)
usr.sbin/ldpd/ldpd.c
596
evbuf_init(struct evbuf *eb, int fd, void (*handler)(int, short, void *),
usr.sbin/ldpd/ldpd.c
603
event_set(&eb->ev, fd, EV_WRITE, handler, arg);
usr.sbin/ldpd/ldpd.c
645
int fd;
usr.sbin/ldpd/ldpd.c
647
fd = ldp_create_socket(af, type);
usr.sbin/ldpd/ldpd.c
648
if (fd == -1) {
usr.sbin/ldpd/ldpd.c
654
imsg_compose_event(iev_ldpe, IMSG_SOCKET_NET, af, 0, fd, &type,
usr.sbin/ldpd/ldpd.h
617
int sock_set_ipv4_ucast_ttl(int fd, int);
usr.sbin/ldpd/ldpe.c
131
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ldpd/ldpe.c
166
close(iev_lde->ibuf.fd);
usr.sbin/ldpd/ldpe.c
169
close(iev_main->ibuf.fd);
usr.sbin/ldpd/ldpe.c
213
ldpe_dispatch_main(int fd, short event, void *bula)
usr.sbin/ldpd/ldpe.c
303
if ((fd = imsg_get_fd(&imsg)) == -1) {
usr.sbin/ldpd/ldpe.c
311
if (imsgbuf_init(&iev_lde->ibuf, fd) == -1)
usr.sbin/ldpd/ldpe.c
315
event_set(&iev_lde->ev, iev_lde->ibuf.fd,
usr.sbin/ldpd/ldpe.c
492
ldpe_dispatch_lde(int fd, short event, void *bula)
usr.sbin/ldpd/ldpe.c
627
ldpe_dispatch_pfkey(int fd, short event, void *bula)
usr.sbin/ldpd/ldpe.c
630
if (pfkey_read(fd, NULL) == -1) {
usr.sbin/ldpd/ldpe.h
123
int fd;
usr.sbin/ldpd/ldpe.h
64
int fd;
usr.sbin/ldpd/ldpe.h
96
int fd;
usr.sbin/ldpd/neighbor.c
194
nbr->tcp = tcp_new(nbr->fd, nbr);
usr.sbin/ldpd/neighbor.c
279
session_accept_nbr(nbr, pconn->fd);
usr.sbin/ldpd/neighbor.c
384
nbr_ktimer(int fd, short event, void *arg)
usr.sbin/ldpd/neighbor.c
415
nbr_ktimeout(int fd, short event, void *arg)
usr.sbin/ldpd/neighbor.c
447
nbr_itimeout(int fd, short event, void *arg)
usr.sbin/ldpd/neighbor.c
478
nbr_idtimer(int fd, short event, void *arg)
usr.sbin/ldpd/neighbor.c
543
nbr_connect_cb(int fd, short event, void *arg)
usr.sbin/ldpd/neighbor.c
550
if (getsockopt(nbr->fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
usr.sbin/ldpd/neighbor.c
556
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
575
nbr->fd = socket(nbr->af,
usr.sbin/ldpd/neighbor.c
577
if (nbr->fd == -1) {
usr.sbin/ldpd/neighbor.c
585
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
588
if (setsockopt(nbr->fd, IPPROTO_TCP, TCP_MD5SIG,
usr.sbin/ldpd/neighbor.c
591
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
602
if (bind(nbr->fd, (struct sockaddr *)&local_sa,
usr.sbin/ldpd/neighbor.c
606
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
611
if (nbr_gtsm_check(nbr->fd, nbr, nbrp)) {
usr.sbin/ldpd/neighbor.c
612
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
624
if (connect(nbr->fd, (struct sockaddr *)&remote_sa,
usr.sbin/ldpd/neighbor.c
627
event_set(&nbr->ev_connect, nbr->fd, EV_WRITE,
usr.sbin/ldpd/neighbor.c
634
close(nbr->fd);
usr.sbin/ldpd/neighbor.c
667
nbr_gtsm_setup(int fd, int af, struct nbr_params *nbrp)
usr.sbin/ldpd/neighbor.c
676
if (sock_set_ipv4_minttl(fd, ttl) == -1)
usr.sbin/ldpd/neighbor.c
679
if (sock_set_ipv4_ucast_ttl(fd, ttl) == -1)
usr.sbin/ldpd/neighbor.c
683
if (sock_set_ipv6_minhopcount(fd, ttl) == -1)
usr.sbin/ldpd/neighbor.c
686
if (sock_set_ipv6_ucast_hops(fd, ttl) == -1)
usr.sbin/ldpd/neighbor.c
697
nbr_gtsm_check(int fd, struct nbr *nbr, struct nbr_params *nbrp)
usr.sbin/ldpd/neighbor.c
702
sock_set_ipv4_ucast_ttl(fd, -1);
usr.sbin/ldpd/neighbor.c
709
sock_set_ipv6_ucast_hops(fd, 255);
usr.sbin/ldpd/neighbor.c
718
if (nbr_gtsm_setup(fd, nbr->af, nbrp) == -1) {
usr.sbin/ldpd/packet.c
109
if (sendto(fd, pkt, len, 0, sa, sa->sa_len) == -1) {
usr.sbin/ldpd/packet.c
121
disc_recv_packet(int fd, short event, void *bula)
usr.sbin/ldpd/packet.c
163
if ((r = recvmsg(fd, &m, 0)) == -1) {
usr.sbin/ldpd/packet.c
316
session_accept(int fd, short event, void *bula)
usr.sbin/ldpd/packet.c
329
newfd = accept4(fd, (struct sockaddr *)&src, &len,
usr.sbin/ldpd/packet.c
388
session_accept_nbr(struct nbr *nbr, int fd)
usr.sbin/ldpd/packet.c
395
if (nbr_gtsm_check(fd, nbr, nbrp)) {
usr.sbin/ldpd/packet.c
396
close(fd);
usr.sbin/ldpd/packet.c
403
close(fd);
usr.sbin/ldpd/packet.c
408
if (getsockopt(fd, IPPROTO_TCP, TCP_MD5SIG, &opt, &len) == -1)
usr.sbin/ldpd/packet.c
412
close(fd);
usr.sbin/ldpd/packet.c
417
nbr->tcp = tcp_new(fd, nbr);
usr.sbin/ldpd/packet.c
422
session_read(int fd, short event, void *arg)
usr.sbin/ldpd/packet.c
436
if ((n = read(fd, tcp->rbuf->buf + tcp->rbuf->wpos,
usr.sbin/ldpd/packet.c
593
session_write(int fd, short event, void *arg)
usr.sbin/ldpd/packet.c
601
if (ibuf_write(fd, tcp->wbuf.wbuf) == -1)
usr.sbin/ldpd/packet.c
683
tcp_new(int fd, struct nbr *nbr)
usr.sbin/ldpd/packet.c
690
tcp->fd = fd;
usr.sbin/ldpd/packet.c
691
evbuf_init(&tcp->wbuf, tcp->fd, session_write, tcp);
usr.sbin/ldpd/packet.c
697
event_set(&tcp->rev, tcp->fd, EV_READ | EV_PERSIST,
usr.sbin/ldpd/packet.c
710
ibuf_write(tcp->fd, tcp->wbuf.wbuf);
usr.sbin/ldpd/packet.c
719
close(tcp->fd);
usr.sbin/ldpd/packet.c
725
pending_conn_new(int fd, int af, union ldpd_addr *addr)
usr.sbin/ldpd/packet.c
733
pconn->fd = fd;
usr.sbin/ldpd/packet.c
772
pending_conn_timeout(int fd, short event, void *arg)
usr.sbin/ldpd/packet.c
78
send_packet(int fd, int af, union ldpd_addr *dst, struct iface_af *ia,
usr.sbin/ldpd/packet.c
784
tcp = tcp_new(pconn->fd, NULL);
usr.sbin/ldpd/packet.c
786
ibuf_write(fd, tcp->wbuf.wbuf);
usr.sbin/ldpd/parse.y
1230
check_file_secrecy(int fd, const char *fname)
usr.sbin/ldpd/parse.y
1234
if (fstat(fd, &st)) {
usr.sbin/ldpd/pfkey.c
345
if (pfkey_send(fd, SADB_X_SATYPE_TCPSIGNATURE, SADB_GETSPI, 0,
usr.sbin/ldpd/pfkey.c
348
if (pfkey_reply(fd, spi) < 0)
usr.sbin/ldpd/pfkey.c
350
if (pfkey_send(fd, SADB_X_SATYPE_TCPSIGNATURE, SADB_UPDATE, 0,
usr.sbin/ldpd/pfkey.c
353
if (pfkey_reply(fd, NULL) < 0)
usr.sbin/ldpd/pfkey.c
362
if (pfkey_send(fd, SADB_X_SATYPE_TCPSIGNATURE, SADB_DELETE, 0,
usr.sbin/ldpd/pfkey.c
365
if (pfkey_reply(fd, NULL) < 0)
usr.sbin/ldpd/pfkey.c
452
if ((fd = socket(PF_KEY, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/ldpd/pfkey.c
461
return (fd);
usr.sbin/ldpd/pfkey.c
48
static int fd;
usr.sbin/ldpd/socket.c
101
close(fd);
usr.sbin/ldpd/socket.c
104
if (sock_set_ipv4_mcast_loop(fd) == -1) {
usr.sbin/ldpd/socket.c
105
close(fd);
usr.sbin/ldpd/socket.c
110
if (sock_set_ipv4_recvif(fd, 1) == -1) {
usr.sbin/ldpd/socket.c
111
close(fd);
usr.sbin/ldpd/socket.c
116
if (sock_set_ipv4_ucast_ttl(fd, 255) == -1) {
usr.sbin/ldpd/socket.c
117
close(fd);
usr.sbin/ldpd/socket.c
123
if (sock_set_ipv6_dscp(fd, IPTOS_PREC_INTERNETCONTROL) == -1) {
usr.sbin/ldpd/socket.c
124
close(fd);
usr.sbin/ldpd/socket.c
128
if (sock_set_ipv6_mcast_loop(fd) == -1) {
usr.sbin/ldpd/socket.c
129
close(fd);
usr.sbin/ldpd/socket.c
132
if (sock_set_ipv6_mcast_hops(fd, 255) == -1) {
usr.sbin/ldpd/socket.c
133
close(fd);
usr.sbin/ldpd/socket.c
137
if (sock_set_ipv6_minhopcount(fd, 255) == -1) {
usr.sbin/ldpd/socket.c
138
close(fd);
usr.sbin/ldpd/socket.c
144
if (sock_set_ipv6_pktinfo(fd, 1) == -1) {
usr.sbin/ldpd/socket.c
145
close(fd);
usr.sbin/ldpd/socket.c
150
if (sock_set_ipv6_ucast_hops(fd, 255) == -1) {
usr.sbin/ldpd/socket.c
151
close(fd);
usr.sbin/ldpd/socket.c
160
sock_set_recvbuf(fd);
usr.sbin/ldpd/socket.c
163
if (listen(fd, LDP_BACKLOG) == -1)
usr.sbin/ldpd/socket.c
167
if (setsockopt(fd, IPPROTO_TCP, TCP_MD5SIG, &opt,
usr.sbin/ldpd/socket.c
173
close(fd);
usr.sbin/ldpd/socket.c
180
return (fd);
usr.sbin/ldpd/socket.c
184
sock_set_recvbuf(int fd)
usr.sbin/ldpd/socket.c
189
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/ldpd/socket.c
195
sock_set_reuse(int fd, int enable)
usr.sbin/ldpd/socket.c
197
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable,
usr.sbin/ldpd/socket.c
207
sock_set_bindany(int fd, int enable)
usr.sbin/ldpd/socket.c
209
if (setsockopt(fd, SOL_SOCKET, SO_BINDANY, &enable,
usr.sbin/ldpd/socket.c
219
sock_set_ipv4_tos(int fd, int tos)
usr.sbin/ldpd/socket.c
221
if (setsockopt(fd, IPPROTO_IP, IP_TOS, (int *)&tos, sizeof(tos)) == -1) {
usr.sbin/ldpd/socket.c
230
sock_set_ipv4_recvif(int fd, int enable)
usr.sbin/ldpd/socket.c
232
if (setsockopt(fd, IPPROTO_IP, IP_RECVIF, &enable,
usr.sbin/ldpd/socket.c
241
sock_set_ipv4_minttl(int fd, int ttl)
usr.sbin/ldpd/socket.c
243
if (setsockopt(fd, IPPROTO_IP, IP_MINTTL, &ttl, sizeof(ttl)) == -1) {
usr.sbin/ldpd/socket.c
252
sock_set_ipv4_ucast_ttl(int fd, int ttl)
usr.sbin/ldpd/socket.c
254
if (setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) == -1) {
usr.sbin/ldpd/socket.c
263
sock_set_ipv4_mcast_ttl(int fd, uint8_t ttl)
usr.sbin/ldpd/socket.c
265
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
usr.sbin/ldpd/socket.c
293
sock_set_ipv4_mcast_loop(int fd)
usr.sbin/ldpd/socket.c
297
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
usr.sbin/ldpd/socket.c
307
sock_set_ipv6_dscp(int fd, int dscp)
usr.sbin/ldpd/socket.c
309
if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &dscp,
usr.sbin/ldpd/socket.c
319
sock_set_ipv6_pktinfo(int fd, int enable)
usr.sbin/ldpd/socket.c
321
if (setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &enable,
usr.sbin/ldpd/socket.c
331
sock_set_ipv6_minhopcount(int fd, int hoplimit)
usr.sbin/ldpd/socket.c
333
if (setsockopt(fd, IPPROTO_IPV6, IPV6_MINHOPCOUNT,
usr.sbin/ldpd/socket.c
343
sock_set_ipv6_ucast_hops(int fd, int hoplimit)
usr.sbin/ldpd/socket.c
345
if (setsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS,
usr.sbin/ldpd/socket.c
355
sock_set_ipv6_mcast_hops(int fd, int hoplimit)
usr.sbin/ldpd/socket.c
357
if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
usr.sbin/ldpd/socket.c
37
int fd, domain, proto;
usr.sbin/ldpd/socket.c
380
sock_set_ipv6_mcast_loop(int fd)
usr.sbin/ldpd/socket.c
384
if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
usr.sbin/ldpd/socket.c
56
fd = socket(af, domain | SOCK_NONBLOCK | SOCK_CLOEXEC, proto);
usr.sbin/ldpd/socket.c
57
if (fd == -1) {
usr.sbin/ldpd/socket.c
75
if (sock_set_bindany(fd, 1) == -1) {
usr.sbin/ldpd/socket.c
76
close(fd);
usr.sbin/ldpd/socket.c
81
if (sock_set_reuse(fd, 1) == -1) {
usr.sbin/ldpd/socket.c
82
close(fd);
usr.sbin/ldpd/socket.c
85
if (bind(fd, (struct sockaddr *)&local_sa, local_sa.ss_len) == -1) {
usr.sbin/ldpd/socket.c
87
close(fd);
usr.sbin/ldpd/socket.c
94
if (sock_set_ipv4_tos(fd, IPTOS_PREC_INTERNETCONTROL) == -1) {
usr.sbin/ldpd/socket.c
95
close(fd);
usr.sbin/ldpd/socket.c
99
if (sock_set_ipv4_mcast_ttl(fd,
usr.sbin/lldp/lldp.c
289
lldpctl_req_msaps(int fd, const char *ifname)
usr.sbin/lldp/lldp.c
312
rv = sendmsg(fd, &msg, 0);
usr.sbin/lldpd/lldpd.c
1020
ctl_send(int fd, short events, void *arg)
usr.sbin/lldpd/lldpd.c
1025
ctl->ctl_handler(lldpd, ctl, fd);
usr.sbin/lldpd/lldpd.c
1066
ctl_msap(struct lldpd *lldpd, struct lldpd_ctl *ctl, int fd)
usr.sbin/lldpd/lldpd.c
1101
rv = sendmsg(fd, &msg, 0);
usr.sbin/lldpd/lldpd.c
1159
ctl_msap_req_end(struct lldpd *lldpd, struct lldpd_ctl *ctl, int fd)
usr.sbin/lldpd/lldpd.c
1166
rv = send(fd, &msgtype, sizeof(msgtype), 0);
usr.sbin/lldpd/lldpd.c
1192
int fd;
usr.sbin/lldpd/lldpd.c
1194
fd = accept4(s, NULL, NULL, SOCK_NONBLOCK);
usr.sbin/lldpd/lldpd.c
1195
if (fd == -1) {
usr.sbin/lldpd/lldpd.c
1203
close(fd);
usr.sbin/lldpd/lldpd.c
1210
if (getpeereid(fd, &ctl->ctl_peer_uid, &ctl->ctl_peer_gid) == -1)
usr.sbin/lldpd/lldpd.c
1213
event_set(&ctl->ctl_rd_ev, fd, EV_READ|EV_PERSIST,
usr.sbin/lldpd/lldpd.c
1215
event_set(&ctl->ctl_wr_ev, fd, EV_WRITE,
usr.sbin/lldpd/lldpd.c
159
void (*ctl_handler)(struct lldpd *, struct lldpd_ctl *, int fd);
usr.sbin/lldpd/lldpd.c
871
int fd = EVENT_FD(&ctl->ctl_rd_ev);
usr.sbin/lldpd/lldpd.c
876
close(fd);
usr.sbin/lldpd/lldpd.c
885
ctl_recv(int fd, short events, void *arg)
usr.sbin/lldpd/lldpd.c
902
rv = recvmsg(fd, &msg, 0);
usr.sbin/lldpd/lldpd.c
945
(*ctl->ctl_handler)(lldpd, ctl, fd);
usr.sbin/lldpd/lldpd.c
956
ctl_pong(struct lldpd *lldpd, struct lldpd_ctl *ctl, int fd)
usr.sbin/lldpd/lldpd.c
970
rv = sendmsg(fd, &msg, 0);
usr.sbin/lpd/control.c
109
int fd;
usr.sbin/lpd/control.c
111
fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0);
usr.sbin/lpd/control.c
112
if (fd == -1)
usr.sbin/lpd/control.c
123
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1)
usr.sbin/lpd/control.c
130
ctl.fd = fd;
usr.sbin/lpd/control.c
136
if (listen(ctl.fd, CONTROL_BACKLOG) == -1)
usr.sbin/lpd/control.c
165
event_set(&ctl.evt, ctl.fd, EV_READ | EV_PERSIST, control_accept, NULL);
usr.sbin/lpd/control.c
170
control_accept(int fd, short event, void *arg)
usr.sbin/lpd/control.c
181
sock = accept4(ctl.fd, NULL, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);
usr.sbin/lpd/control.c
54
int fd;
usr.sbin/lpd/engine.c
111
if ((fd = imsg_get_fd(imsg)) == -1)
usr.sbin/lpd/engine.c
114
p_frontend = proc_attach(PROC_FRONTEND, fd);
usr.sbin/lpd/engine.c
96
int fd;
usr.sbin/lpd/engine_lpr.c
369
int fd;
usr.sbin/lpd/engine_lpr.c
376
if ((fd = mkstemp(path)) == -1) {
usr.sbin/lpd/engine_lpr.c
381
return fd;
usr.sbin/lpd/engine_lpr.c
390
int fd, i;
usr.sbin/lpd/engine_lpr.c
397
fd = lpr_mkstemp();
usr.sbin/lpd/engine_lpr.c
398
if (fd != -1) {
usr.sbin/lpd/engine_lpr.c
400
lp_displayq(fd, &lp, lng, jf);
usr.sbin/lpd/engine_lpr.c
401
if (lseek(fd, 0, SEEK_SET) == -1)
usr.sbin/lpd/engine_lpr.c
416
lpr_displayq_res(connid, fd, lp.lp_host, cmd);
usr.sbin/lpd/engine_lpr.c
419
lpr_displayq_res(connid, fd, NULL, NULL);
usr.sbin/lpd/engine_lpr.c
425
lpr_displayq_res(uint32_t connid, int fd, const char *host, const char *cmd)
usr.sbin/lpd/engine_lpr.c
427
m_create(p_frontend, IMSG_LPR_DISPLAYQ, connid, 0, fd);
usr.sbin/lpd/engine_lpr.c
439
int fd, i, restart = 0;
usr.sbin/lpd/engine_lpr.c
446
fd = lpr_mkstemp();
usr.sbin/lpd/engine_lpr.c
447
if (fd != -1) {
usr.sbin/lpd/engine_lpr.c
449
restart = lp_rmjob(fd, &lp, agent, jf);
usr.sbin/lpd/engine_lpr.c
450
if (lseek(fd, 0, SEEK_SET) == -1)
usr.sbin/lpd/engine_lpr.c
465
lpr_rmjob_res(connid, fd, lp.lp_host, cmd);
usr.sbin/lpd/engine_lpr.c
468
lpr_rmjob_res(connid, fd, NULL, NULL);
usr.sbin/lpd/engine_lpr.c
478
lpr_rmjob_res(uint32_t connid, int fd, const char *host, const char *cmd)
usr.sbin/lpd/engine_lpr.c
480
m_create(p_frontend, IMSG_LPR_RMJOB, connid, 0, fd);
usr.sbin/lpd/engine_lpr.c
541
int fd;
usr.sbin/lpd/engine_lpr.c
543
fd = -1;
usr.sbin/lpd/engine_lpr.c
574
fd = lp_create(&j->lp, 1, size, j->cfname);
usr.sbin/lpd/engine_lpr.c
575
if (fd == -1) {
usr.sbin/lpd/engine_lpr.c
585
m_create(p_frontend, IMSG_LPR_RECVJOB_CF, connid, 0, fd);
usr.sbin/lpd/engine_lpr.c
586
m_add_int(p_frontend, (fd == -1) ? LPR_NACK : LPR_ACK);
usr.sbin/lpd/engine_lpr.c
596
int fd;
usr.sbin/lpd/engine_lpr.c
598
fd = -1;
usr.sbin/lpd/engine_lpr.c
623
fd = lp_create(&j->lp, 0, size, f->dfname);
usr.sbin/lpd/engine_lpr.c
624
if (fd == -1) {
usr.sbin/lpd/engine_lpr.c
639
m_create(p_frontend, IMSG_LPR_RECVJOB_DF, connid, 0, fd);
usr.sbin/lpd/engine_lpr.c
640
m_add_int(p_frontend, (fd == -1) ? LPR_NACK : LPR_ACK);
usr.sbin/lpd/frontend.c
251
int fd;
usr.sbin/lpd/frontend.c
264
if ((fd = imsg_get_fd(imsg)) == -1)
usr.sbin/lpd/frontend.c
267
p_engine = proc_attach(PROC_ENGINE, fd);
usr.sbin/lpd/frontend.c
280
if ((fd = imsg_get_fd(imsg)) == -1)
usr.sbin/lpd/frontend.c
287
l->sock = fd;
usr.sbin/lpd/frontend_lpr.c
214
lpr_on_recvjob_file(struct lpr_conn *conn, int ack, size_t sz, int cf, int fd)
usr.sbin/lpd/frontend_lpr.c
221
if (fd == -1) {
usr.sbin/lpd/frontend_lpr.c
227
conn->ofp = fdopen(fd, "w");
usr.sbin/lpd/frontend_lpr.c
230
close(fd);
usr.sbin/lpd/frontend_lpr.c
244
lpr_on_request(struct lpr_conn *conn, int fd, const char *hostname,
usr.sbin/lpd/frontend_lpr.c
249
if (fd == -1) {
usr.sbin/lpd/frontend_lpr.c
256
conn->ifd = fd;
usr.sbin/lpd/io.c
1017
io_dispatch_read_tls(int fd, short event, void *arg)
usr.sbin/lpd/io.c
1065
io_dispatch_write_tls(int fd, short event, void *arg)
usr.sbin/lpd/io.c
758
io_dispatch(int fd, short ev, void *arg)
usr.sbin/lpd/io.c
815
io_dispatch_connect(int fd, short ev, void *arg)
usr.sbin/lpd/io.c
827
r = getsockopt(fd, SOL_SOCKET, SO_ERROR, &e, &sl);
usr.sbin/lpd/io.c
851
(void)close(fd);
usr.sbin/lpd/io.c
943
io_dispatch_accept_tls(int fd, short event, void *arg)
usr.sbin/lpd/io.c
980
io_dispatch_connect_tls(int fd, short event, void *arg)
usr.sbin/lpd/iobuf.c
206
iobuf_read(struct iobuf *io, int fd)
usr.sbin/lpd/iobuf.c
210
n = read(fd, io->buf + io->wpos, iobuf_left(io));
usr.sbin/lpd/iobuf.c
349
iobuf_write(struct iobuf *io, int fd)
usr.sbin/lpd/iobuf.c
365
n = writev(fd, iov, i);
usr.sbin/lpd/iobuf.c
380
iobuf_flush(struct iobuf *io, int fd)
usr.sbin/lpd/iobuf.c
385
if ((s = iobuf_write(io, fd)) < 0)
usr.sbin/lpd/lp.c
464
int fd, saved_errno;
usr.sbin/lpd/lp.c
476
fd = open(path, O_WRONLY|O_CREAT|O_NOFOLLOW|O_NONBLOCK|O_EXLOCK|O_TRUNC,
usr.sbin/lpd/lp.c
478
if (fd == -1) {
usr.sbin/lpd/lp.c
484
if (fstat(fd, &st) == -1) {
usr.sbin/lpd/lp.c
487
(void)close(fd);
usr.sbin/lpd/lp.c
495
(void)close(fd);
usr.sbin/lpd/lp.c
499
if ((lp->lp_lock = fdopen(fd, "w")) == NULL) {
usr.sbin/lpd/lp.c
502
(void)close(fd);
usr.sbin/lpd/lp.c
723
int fd = -1, r, saved_errno;
usr.sbin/lpd/lp.c
740
fd = open(path, O_WRONLY|O_CREAT|O_NOFOLLOW|O_EXLOCK|O_TRUNC, 0660);
usr.sbin/lpd/lp.c
741
if (fd == -1) {
usr.sbin/lpd/lp.c
747
fp = fdopen(fd, "w");
usr.sbin/lpd/lp.c
751
(void)close(fd);
usr.sbin/lpd/lp.c
812
int fd;
usr.sbin/lpd/lp.c
838
fd = open(path, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0660);
usr.sbin/lpd/lp.c
839
if (fd == -1)
usr.sbin/lpd/lp.c
842
return fd;
usr.sbin/lpd/lp_stty.c
197
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpd/lp_stty.c
200
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpd/lp_stty.c
488
lp_stty(struct lp_printer *lp, int fd)
usr.sbin/lpd/lp_stty.c
495
i.fd = fd;
usr.sbin/lpd/lp_stty.c
497
if (ioctl(i.fd, TIOCEXCL, (char *)0) == -1)
usr.sbin/lpd/lp_stty.c
500
if (tcgetattr(i.fd, &i.t) == -1)
usr.sbin/lpd/lp_stty.c
508
if (ioctl(i.fd, TIOCGETD, &i.ldisc) == -1)
usr.sbin/lpd/lp_stty.c
511
if (ioctl(i.fd, TIOCGWINSZ, &i.win) == -1)
usr.sbin/lpd/lp_stty.c
538
if (i.set && tcsetattr(i.fd, TCSANOW, &i.t) == -1)
usr.sbin/lpd/lp_stty.c
541
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) == -1)
usr.sbin/lpd/lp_stty.c
66
int fd; /* file descriptor */
usr.sbin/lpd/parse.y
528
check_file_secrecy(int fd, const char *fname)
usr.sbin/lpd/parse.y
532
if (fstat(fd, &st)) {
usr.sbin/lpd/printer.c
1122
int fd, e, mode;
usr.sbin/lpd/printer.c
1127
if ((fd = open(LP_LP(lp), mode)) == -1) {
usr.sbin/lpd/printer.c
1132
if (isatty(fd)) {
usr.sbin/lpd/printer.c
1133
lp_stty(lp, fd);
usr.sbin/lpd/printer.c
1137
return fd;
usr.sbin/lpd/printer.c
1151
fd = -1;
usr.sbin/lpd/printer.c
1152
for (res = res0; res && fd == -1; res = res->ai_next) {
usr.sbin/lpd/printer.c
1153
fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
usr.sbin/lpd/printer.c
1154
if (fd == -1)
usr.sbin/lpd/printer.c
1156
else if (connect(fd, res->ai_addr, res->ai_addrlen) == -1) {
usr.sbin/lpd/printer.c
1159
(void)close(fd);
usr.sbin/lpd/printer.c
1161
fd = -1;
usr.sbin/lpd/printer.c
1165
if (fd == -1)
usr.sbin/lpd/printer.c
117
int fd, jobidx, qstate, r, reload, retry;
usr.sbin/lpd/printer.c
1171
return fd;
usr.sbin/lpd/printer.c
1316
int fd;
usr.sbin/lpd/printer.c
1318
fd = prn->ofilter ? prn->ofd : prn->pfd;
usr.sbin/lpd/printer.c
1320
log_debug("prn_write(fd=%d len=%zu, of=%d pfd=%d ofd=%d)", fd, len,
usr.sbin/lpd/printer.c
1323
if (fd == -1) {
usr.sbin/lpd/printer.c
1330
if ((n = write(fd, buf, len)) == -1) {
usr.sbin/lpd/printer.c
147
fd = open(LP_LF(lp), O_WRONLY|O_APPEND);
usr.sbin/lpd/printer.c
148
if (fd == -1)
usr.sbin/lpd/printer.c
150
if (fd != STDERR_FILENO) {
usr.sbin/lpd/printer.c
151
if (dup2(fd, STDERR_FILENO) == -1)
usr.sbin/lpd/printer.c
153
(void)close(fd);
usr.sbin/lpd/proc.c
150
proc_attach(int type, int fd)
usr.sbin/lpd/proc.c
158
proc_setsock(p, fd);
usr.sbin/lpd/proc.c
205
close(p->imsgbuf.fd);
usr.sbin/lpd/proc.c
238
p->imsgbuf.fd = sock;
usr.sbin/lpd/proc.c
255
event_set(&p->ev, p->imsgbuf.fd, events, proc_dispatch, p);
usr.sbin/lpd/proc.c
276
proc_dispatch(int fd, short event, void *arg)
usr.sbin/lpd/proc.c
326
m_compose(struct imsgproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd,
usr.sbin/lpd/proc.c
329
if (imsg_compose(&p->imsgbuf, type, peerid, pid, fd, data, len) == -1)
usr.sbin/lpd/proc.c
336
m_create(struct imsgproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd)
usr.sbin/lpd/proc.c
342
p->m_out.fd = fd;
usr.sbin/lpd/proc.c
349
p->m_out.pid, p->m_out.fd, p->m_out.buf, p->m_out.pos) == -1)
usr.sbin/lpd/proc.c
56
int fd;
usr.sbin/lpr/common_source/common.c
430
int fd, serrno;
usr.sbin/lpr/common_source/common.c
433
if ((fd = open(path, flags|O_NONBLOCK, mode)) < 0 ||
usr.sbin/lpr/common_source/common.c
434
fstat(fd, &stbuf) < 0) {
usr.sbin/lpr/common_source/common.c
435
if (fd >= 0) {
usr.sbin/lpr/common_source/common.c
437
close(fd);
usr.sbin/lpr/common_source/common.c
443
close(fd);
usr.sbin/lpr/common_source/common.c
448
(void)fchmod(fd, mode);
usr.sbin/lpr/common_source/common.c
449
return (fd);
usr.sbin/lpr/common_source/displayq.c
156
fd = safe_open(ST, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/displayq.c
158
if (fd >= 0 && flock(fd, LOCK_SH) == 0) {
usr.sbin/lpr/common_source/displayq.c
159
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
161
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
174
fd = safe_open(LO, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/displayq.c
176
if (fd < 0 || (fp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/common_source/displayq.c
177
if (fd >= 0)
usr.sbin/lpr/common_source/displayq.c
178
close(fd);
usr.sbin/lpr/common_source/displayq.c
214
fd = safe_open(ST, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/displayq.c
216
if (fd >= 0 && flock(fd, LOCK_SH) == 0) {
usr.sbin/lpr/common_source/displayq.c
217
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
219
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
276
fd = getport(RM, 0);
usr.sbin/lpr/common_source/displayq.c
277
if (fd < 0) {
usr.sbin/lpr/common_source/displayq.c
288
if (write(fd, line, i) != i)
usr.sbin/lpr/common_source/displayq.c
298
while ((i = read(fd, line, sizeof(line))) > 0) {
usr.sbin/lpr/common_source/displayq.c
309
(void)close(fd);
usr.sbin/lpr/common_source/displayq.c
346
int fd, j;
usr.sbin/lpr/common_source/displayq.c
354
fd = safe_open(cf, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/displayq.c
356
if (fd < 0 || (cfp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/common_source/displayq.c
357
if (fd >= 0)
usr.sbin/lpr/common_source/displayq.c
358
close(fd);
usr.sbin/lpr/common_source/displayq.c
96
int i, rank, nitems, fd, ret, len;
usr.sbin/lpr/common_source/rmjob.c
164
int fd, i, n;
usr.sbin/lpr/common_source/rmjob.c
168
fd = safe_open(s, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/rmjob.c
170
if (fd < 0 || (fp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/common_source/rmjob.c
171
if (fd >= 0)
usr.sbin/lpr/common_source/rmjob.c
172
close(fd);
usr.sbin/lpr/common_source/rmjob.c
206
int fd;
usr.sbin/lpr/common_source/rmjob.c
211
fd = safe_open(file, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/rmjob.c
213
if (fd < 0 || (cfp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/common_source/rmjob.c
214
if (fd >= 0)
usr.sbin/lpr/common_source/rmjob.c
215
close(fd);
usr.sbin/lpr/common_source/rmjob.c
249
int *r, n, fd;
usr.sbin/lpr/common_source/rmjob.c
266
fd = safe_open(file, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/common_source/rmjob.c
268
if (fd < 0 || (cfp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/common_source/rmjob.c
269
if (fd >= 0)
usr.sbin/lpr/common_source/rmjob.c
270
close(fd);
usr.sbin/lpr/lpc/cmds.c
1049
int jobnum, fd, n;
usr.sbin/lpr/lpc/cmds.c
1095
fd = safe_open((*qq)->q_name, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpc/cmds.c
1097
if (fd < 0 || (fp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/lpc/cmds.c
1098
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
1099
close(fd);
usr.sbin/lpr/lpc/cmds.c
118
int pid, fd;
usr.sbin/lpr/lpc/cmds.c
141
if ((fd = safe_open(line, O_WRONLY|O_CREAT|O_NOFOLLOW,
usr.sbin/lpr/lpc/cmds.c
145
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
146
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
160
fd = safe_open(line, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpc/cmds.c
161
if (fd < 0 || (fp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/lpc/cmds.c
162
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
163
close(fd);
usr.sbin/lpr/lpc/cmds.c
190
int fd;
usr.sbin/lpr/lpc/cmds.c
196
fd = safe_open(statfile, O_WRONLY|O_CREAT|O_NOFOLLOW, 0660);
usr.sbin/lpr/lpc/cmds.c
197
if (fd < 0 || flock(fd, LOCK_EX) < 0) {
usr.sbin/lpr/lpc/cmds.c
199
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
200
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
203
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
204
(void)ftruncate(fd, 0);
usr.sbin/lpr/lpc/cmds.c
206
(void)write(fd, "\n", 1);
usr.sbin/lpr/lpc/cmds.c
208
(void)write(fd, msg, strlen(msg));
usr.sbin/lpr/lpc/cmds.c
209
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
478
int fd;
usr.sbin/lpr/lpc/cmds.c
498
if ((fd = safe_open(line, O_WRONLY|O_CREAT|O_NOFOLLOW, 0670)) < 0)
usr.sbin/lpr/lpc/cmds.c
501
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
502
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
554
int fd;
usr.sbin/lpr/lpc/cmds.c
579
if ((fd = safe_open(line, O_WRONLY|O_CREAT|O_NOFOLLOW, 0770)) < 0)
usr.sbin/lpr/lpc/cmds.c
582
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
583
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
594
fd = safe_open(line, O_WRONLY|O_CREAT|O_NOFOLLOW, 0660);
usr.sbin/lpr/lpc/cmds.c
595
if (fd < 0 || flock(fd, LOCK_EX) < 0) {
usr.sbin/lpr/lpc/cmds.c
597
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
598
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
603
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
604
(void)ftruncate(fd, 0);
usr.sbin/lpr/lpc/cmds.c
606
(void)write(fd, "\n", 1);
usr.sbin/lpr/lpc/cmds.c
607
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
619
(void)write(fd, buf, strlen(buf));
usr.sbin/lpr/lpc/cmds.c
620
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
797
int fd, i;
usr.sbin/lpr/lpc/cmds.c
841
fd = safe_open(line, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpc/cmds.c
843
if (fd < 0 || flock(fd, LOCK_SH|LOCK_NB) == 0) {
usr.sbin/lpr/lpc/cmds.c
845
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
846
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
849
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
852
fd = safe_open(line, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpc/cmds.c
854
if (fd >= 0) {
usr.sbin/lpr/lpc/cmds.c
855
(void)flock(fd, LOCK_SH);
usr.sbin/lpr/lpc/cmds.c
856
if (fstat(fd, &stbuf) == 0 && stbuf.st_size > 0) {
usr.sbin/lpr/lpc/cmds.c
858
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/lpc/cmds.c
861
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
911
int fd;
usr.sbin/lpr/lpc/cmds.c
934
if ((fd = safe_open(line, O_WRONLY|O_CREAT|O_NOFOLLOW, 0760)) < 0)
usr.sbin/lpr/lpc/cmds.c
937
(void)fchown(fd, DEFUID, -1);
usr.sbin/lpr/lpc/cmds.c
938
(void)close(fd);
usr.sbin/lpr/lpd/extern.h
43
int fd; /* file descriptor */
usr.sbin/lpr/lpd/key.c
167
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpr/lpd/key.c
170
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpr/lpd/printjob.c
134
int i, fd, nitems;
usr.sbin/lpr/lpd/printjob.c
141
fd = open(LF, O_WRONLY|O_APPEND); /* set up log file */
usr.sbin/lpr/lpd/printjob.c
143
if (fd < 0) {
usr.sbin/lpr/lpd/printjob.c
145
if ((fd = open(_PATH_DEVNULL, O_WRONLY)) < 0)
usr.sbin/lpr/lpd/printjob.c
148
if (fd != STDERR_FILENO) {
usr.sbin/lpr/lpd/printjob.c
149
if (dup2(fd, STDERR_FILENO) < 0) {
usr.sbin/lpr/lpd/printjob.c
1525
i.fd = pfd;
usr.sbin/lpr/lpd/printjob.c
1527
if (ioctl(i.fd, TIOCEXCL, (char *)0) < 0) {
usr.sbin/lpr/lpd/printjob.c
153
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
1531
if (tcgetattr(i.fd, &i.t) < 0) {
usr.sbin/lpr/lpd/printjob.c
1540
if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0) {
usr.sbin/lpr/lpd/printjob.c
1544
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
usr.sbin/lpr/lpd/printjob.c
1579
if (i.set && tcsetattr(i.fd, TCSANOW, &i.t) < 0) {
usr.sbin/lpr/lpd/printjob.c
1583
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
usr.sbin/lpr/lpd/printjob.c
1591
int fd, len;
usr.sbin/lpr/lpd/printjob.c
1597
fd = open(ST, O_WRONLY|O_CREAT|O_NOFOLLOW|O_EXLOCK, 0660);
usr.sbin/lpr/lpd/printjob.c
1598
if (fd < 0) {
usr.sbin/lpr/lpd/printjob.c
1602
ftruncate(fd, 0);
usr.sbin/lpr/lpd/printjob.c
1606
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
1612
(void)write(fd, buf, len);
usr.sbin/lpr/lpd/printjob.c
1613
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
336
int i, fd;
usr.sbin/lpr/lpd/printjob.c
343
fd = safe_open(file, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpd/printjob.c
344
if (fd < 0 || (cfp = fdopen(fd, "r")) == NULL) {
usr.sbin/lpr/lpd/printjob.c
346
if (fd >= 0)
usr.sbin/lpr/lpd/printjob.c
347
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
541
int fd, status, serrno;
usr.sbin/lpr/lpd/printjob.c
767
fd = safe_open(tempfile, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpd/printjob.c
768
if (fd >= 0) {
usr.sbin/lpr/lpd/printjob.c
769
while ((nread = read(fd, buf, sizeof(buf))) > 0)
usr.sbin/lpr/lpd/printjob.c
771
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
802
int fd, i, err = OK;
usr.sbin/lpr/lpd/printjob.c
806
fd = safe_open(file, O_RDONLY|O_NOFOLLOW, 0);
usr.sbin/lpr/lpd/printjob.c
807
if (fd < 0 || (cfp = fdopen(fd, "r")) == NULL)
usr.sbin/lpr/lpd/recvjob.c
230
int fd, err;
usr.sbin/lpr/lpd/recvjob.c
232
if ((fd = open(file, O_CREAT|O_EXCL|O_WRONLY, FILMOD)) < 0)
usr.sbin/lpr/lpd/recvjob.c
251
if (write(fd, buf, amt) != amt) {
usr.sbin/lpr/lpd/recvjob.c
256
(void)close(fd);
usr.sbin/lpr/lpr/lpr.c
400
int fd, i, nr, nc;
usr.sbin/lpr/lpr/lpr.c
409
fd = nfile(dfname);
usr.sbin/lpr/lpr/lpr.c
412
if (write(fd, buf, i) != i) {
usr.sbin/lpr/lpr/lpr.c
426
(void)close(fd);
usr.sbin/lpr/lpr/lpr.c
565
int fd;
usr.sbin/lpr/lpr/lpr.c
568
if ((fd = open(file, O_RDONLY|O_NONBLOCK)) < 0) {
usr.sbin/lpr/lpr/lpr.c
572
if (fstat(fd, &statb) < 0) {
usr.sbin/lpr/lpr/lpr.c
588
(void)close(fd);
usr.sbin/lpr/lpr/lpr.c
595
fd = access("/", 2);
usr.sbin/lpr/lpr/lpr.c
598
fd = access(file, 2);
usr.sbin/lpr/lpr/lpr.c
601
if (fd == 0)
usr.sbin/lpr/lpr/lpr.c
661
int len, fd, n;
usr.sbin/lpr/lpr/lpr.c
669
if ((fd = safe_open(buf, O_RDWR|O_CREAT|O_NOFOLLOW, 0661)) < 0)
usr.sbin/lpr/lpr/lpr.c
671
if (flock(fd, LOCK_EX))
usr.sbin/lpr/lpr/lpr.c
675
if ((len = read(fd, buf, sizeof(buf))) > 0) {
usr.sbin/lpr/lpr/lpr.c
690
(void)lseek(fd, (off_t)0, SEEK_SET);
usr.sbin/lpr/lpr/lpr.c
692
(void)write(fd, buf, strlen(buf));
usr.sbin/lpr/lpr/lpr.c
693
(void)close(fd); /* unlocks as well */
usr.sbin/makefs/cd9660/cd9660_debug.c
186
debug_dump_to_xml_path_table(FILE *fd, off_t sector, int size, int mode)
usr.sbin/makefs/cd9660/cd9660_debug.c
192
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
197
fread(&pttemp, 1, 8, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
200
fread(((unsigned char*)&pttemp) + 8, 1, pttemp.length[0], fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
215
debug_dump_to_xml(FILE *fd)
usr.sbin/makefs/cd9660/cd9660_debug.c
229
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
231
fread(buf, 1, CD9660_SECTOR_SIZE, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
250
debug_dump_to_xml_path_table(fd, t, t2, 721);
usr.sbin/makefs/cd9660/cd9660_debug.c
254
debug_dump_to_xml_path_table(fd, t, t2, 722);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
482
cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
488
if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
492
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
495
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
496
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
497
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
500
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
503
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
504
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
505
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
509
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
511
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
517
cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
527
if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
532
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
534
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
538
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
541
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
543
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
545
fwrite(part_name, strlen(part_name) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
546
fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
547
fwrite(part_type, strlen(part_type) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
548
fseek(fd, 32 - strlen(part_type) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
552
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
555
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
558
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
564
cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
572
if (fseeko(fd, (off_t)diskStructure->boot_catalog_sector *
usr.sbin/makefs/cd9660/cd9660_eltorito.c
581
fwrite(&(e->entry_data.VE), 1, 32, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
586
cd9660_copy_file(diskStructure, fd, t->sector, t->filename);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
598
fseek(fd, 0x1fe, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
600
fwrite(&sig, sizeof(sig), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
608
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
621
fseek(fd, 0, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
623
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
626
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
630
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
633
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
634
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
640
cd9660_write_apm_partition_entry(fd, 0, total_parts, 1,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
649
cd9660_write_apm_partition_entry(fd,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
657
cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
usr.sbin/makefs/cd9660/cd9660_write.c
102
cd9660_write_boot(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
107
cd9660_write_filedata(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
110
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
114
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
120
cd9660_write_volume_descriptors(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
124
cd9660_write_filedata(diskStructure, fd, vd_temp->sector,
usr.sbin/makefs/cd9660/cd9660_write.c
140
cd9660_write_path_table(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
189
return cd9660_write_filedata(diskStructure, fd, sector, buffer_head,
usr.sbin/makefs/cd9660/cd9660_write.c
209
cd9660_write_path_tables(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
211
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
215
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
235
cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode)
usr.sbin/makefs/cd9660/cd9660_write.c
259
if (cd9660_copy_file(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
276
if (fseeko(fd, working_sector * diskStructure->sectorSize,
usr.sbin/makefs/cd9660/cd9660_write.c
301
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
307
temp->isoDirRecord->length[0], fd);
usr.sbin/makefs/cd9660/cd9660_write.c
309
cd9660_write_rr(diskStructure, fd, temp,
usr.sbin/makefs/cd9660/cd9660_write.c
312
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
319
temp->su_tail_size, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
320
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
332
if (cd9660_write_file(diskStructure, fd, temp) == 0)
usr.sbin/makefs/cd9660/cd9660_write.c
353
cd9660_write_filedata(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
359
curpos = ftello(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
361
if (fseeko(fd, sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
364
success = fwrite(buf, diskStructure->sectorSize * numsecs, 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
366
if (fseeko(fd, curpos, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
376
cd9660_write_buffered(FILE *fd, off_t offset, int buff_len,
usr.sbin/makefs/cd9660/cd9660_write.c
387
cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd, off_t start_sector,
usr.sbin/makefs/cd9660/cd9660_write.c
403
if (fseeko(fd, start_sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
415
fwrite(buf,1,bytes_read,fd);
usr.sbin/makefs/cd9660/cd9660_write.c
416
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
431
cd9660_write_rr(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode,
usr.sbin/makefs/cd9660/cd9660_write.c
438
if (fseeko(fd, sector * diskStructure->sectorSize + offset, SEEK_SET) ==
usr.sbin/makefs/cd9660/cd9660_write.c
443
fwrite(&(myattr->attr), CD9660_SUSP_ENTRY_SIZE(myattr), 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
452
if (fseeko(fd, ((off_t)diskStructure->
usr.sbin/makefs/cd9660/cd9660_write.c
468
if (fseeko(fd, sector * diskStructure->sectorSize + offset,
usr.sbin/makefs/cd9660/cd9660_write.c
59
FILE *fd;
usr.sbin/makefs/cd9660/cd9660_write.c
63
if ((fd = fopen(image, "w+")) == NULL)
usr.sbin/makefs/cd9660/cd9660_write.c
67
status = cd9660_copy_file(diskStructure, fd, 0,
usr.sbin/makefs/cd9660/cd9660_write.c
77
status = cd9660_write_volume_descriptors(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
88
status = cd9660_write_path_tables(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
95
status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode);
usr.sbin/makefs/ffs.c
327
n = pwrite(fsopts->fd, lp, dl16sz,
usr.sbin/makefs/ffs.c
335
if (close(fsopts->fd) == -1)
usr.sbin/makefs/ffs.c
337
fsopts->fd = -1;
usr.sbin/makefs/ffs.c
489
if ((fsopts->fd = open(image, oflags, 0666)) == -1) {
usr.sbin/makefs/ffs.c
499
if (lseek(fsopts->fd, fsopts->offset, SEEK_SET) == -1) {
usr.sbin/makefs/ffs.c
507
i = write(fsopts->fd, buf, MINIMUM(bufsize, bufrem));
usr.sbin/makefs/ffs.c
536
return (fsopts->fd);
usr.sbin/makefs/ffs/buf.c
120
if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/buf.c
122
rv = write(bp->b_fs->fd, bp->b_data, bytes);
usr.sbin/makefs/ffs/buf.c
65
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/buf.c
68
rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
usr.sbin/makefs/ffs/mkfs.c
755
if (lseek(fsopts->fd, offset, SEEK_SET) < 0)
usr.sbin/makefs/ffs/mkfs.c
758
n = read(fsopts->fd, bf, size);
usr.sbin/makefs/ffs/mkfs.c
778
if (lseek(fsopts->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/mkfs.c
781
n = write(fsopts->fd, bf, size);
usr.sbin/makefs/makefs.c
95
fsoptions.fd = -1;
usr.sbin/makefs/makefs.h
140
int fd; /* file descriptor of image */
usr.sbin/makefs/msdos.c
146
fsopts->fd = open(image, O_RDWR);
usr.sbin/makefs/msdos/mkfs_msdos.c
243
int ch, fd, fd1;
usr.sbin/makefs/msdos/mkfs_msdos.c
258
fd = open(fname, oflags, 0644);
usr.sbin/makefs/msdos/mkfs_msdos.c
259
if (fd == -1) {
usr.sbin/makefs/msdos/mkfs_msdos.c
263
(void)lseek(fd, o.create_size - 1, SEEK_SET);
usr.sbin/makefs/msdos/mkfs_msdos.c
264
if (write(fd, "\0", 1) != 1) {
usr.sbin/makefs/msdos/mkfs_msdos.c
268
(void)lseek(fd, 0, SEEK_SET);
usr.sbin/makefs/msdos/mkfs_msdos.c
269
} else if ((fd = open(fname, O_RDWR)) == -1 ||
usr.sbin/makefs/msdos/mkfs_msdos.c
270
fstat(fd, &sb)) {
usr.sbin/makefs/msdos/mkfs_msdos.c
278
if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) {
usr.sbin/makefs/msdos/mkfs_msdos.c
303
if (getbpbinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb,
usr.sbin/makefs/msdos/mkfs_msdos.c
710
if ((n = write(fd, img, bpb.bps)) == -1) {
usr.sbin/makefs/msdos/mkfs_msdos.c
745
getbpbinfo(int fd, const char *fname, const char *dtype, int iflag,
usr.sbin/makefs/msdos/mkfs_msdos.c
771
if (fstat(fd, &st) == -1) {
usr.sbin/makefs/msdos/msdosfs_vnops.c
405
int error, fd;
usr.sbin/makefs/msdos/msdosfs_vnops.c
439
if ((fd = open(path, O_RDONLY)) == -1)
usr.sbin/makefs/msdos/msdosfs_vnops.c
442
if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
usr.sbin/makefs/msdos/msdosfs_vnops.c
446
close(fd);
usr.sbin/makefs/msdos/msdosfs_vnops.c
449
close(fd);
usr.sbin/map-mbone/mapper.c
902
pfd[0].fd = igmp_socket;
usr.sbin/mopd/common/common.h
51
int fd; /* File Descriptor */
usr.sbin/mopd/common/device.c
105
p->fd = tmp.fd;
usr.sbin/mopd/common/device.c
80
tmp.fd = mopOpenRC(&tmp, trans);
usr.sbin/mopd/common/device.c
84
tmp.fd = mopOpenDL(&tmp, trans);
usr.sbin/mopd/common/device.c
90
if (tmp.fd != -1) {
usr.sbin/mopd/common/dl.c
101
fprintf(fd,
usr.sbin/mopd/common/dl.c
105
fprintf(fd,
usr.sbin/mopd/common/dl.c
109
fprintf(fd, "%02x ", mopGetChar(pkt, &idx));
usr.sbin/mopd/common/dl.c
111
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
115
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
123
fprintf(fd, "Mem Address : %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
125
fprintf(fd, "Count : %04x (%d)\n", tmps, tmps);
usr.sbin/mopd/common/dl.c
129
fprintf(fd, "Device Type : %02x ", tmpc);
usr.sbin/mopd/common/dl.c
130
mopPrintDevice(fd, tmpc);
usr.sbin/mopd/common/dl.c
131
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
134
fprintf(fd, "Format : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
137
fprintf(fd, "Program Type : %02x ", tmpc);
usr.sbin/mopd/common/dl.c
138
mopPrintPGTY(fd, tmpc);
usr.sbin/mopd/common/dl.c
139
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
148
fprintf(fd, "Software : %02x '%s'\n", tmpc, program);
usr.sbin/mopd/common/dl.c
151
fprintf(fd, "Processor : %02x ", tmpc);
usr.sbin/mopd/common/dl.c
152
mopPrintBPTY(fd, tmpc);
usr.sbin/mopd/common/dl.c
153
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
155
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/dl.c
161
fprintf(fd, "Load Number : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
164
fprintf(fd, "Error : %02x (", tmpc);
usr.sbin/mopd/common/dl.c
166
fprintf(fd, "no error)\n");
usr.sbin/mopd/common/dl.c
168
fprintf(fd, "error)\n");
usr.sbin/mopd/common/dl.c
174
fprintf(fd, "Device Type : %02x ", tmpc);
usr.sbin/mopd/common/dl.c
175
mopPrintDevice(fd, tmpc);
usr.sbin/mopd/common/dl.c
176
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
179
fprintf(fd, "Format : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
182
fprintf(fd, "Memory Size : %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
185
fprintf(fd, "Bits : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
187
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/dl.c
193
fprintf(fd, "Mem Address : %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
199
fprintf(fd,
usr.sbin/mopd/common/dl.c
203
fprintf(fd,
usr.sbin/mopd/common/dl.c
206
fprintf(fd, "%02x ", mopGetChar(pkt, &idx));
usr.sbin/mopd/common/dl.c
208
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
211
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
218
fprintf(fd, "Load Number : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
225
fprintf(fd, "Target Name : %02x '", c);
usr.sbin/mopd/common/dl.c
227
fprintf(fd, "%c",
usr.sbin/mopd/common/dl.c
229
fprintf(fd, "'\n");
usr.sbin/mopd/common/dl.c
232
fprintf(fd, "Target Addr : %02x ", c);
usr.sbin/mopd/common/dl.c
234
fprintf(fd, "%02x ",
usr.sbin/mopd/common/dl.c
236
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
239
fprintf(fd, "Host Name : %02x '", c);
usr.sbin/mopd/common/dl.c
241
fprintf(fd, "%c",
usr.sbin/mopd/common/dl.c
243
fprintf(fd, "'\n");
usr.sbin/mopd/common/dl.c
246
fprintf(fd, "Host Addr : %02x ", c);
usr.sbin/mopd/common/dl.c
248
fprintf(fd, "%02x ",
usr.sbin/mopd/common/dl.c
250
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
254
fprintf(fd, "Host Time : ");
usr.sbin/mopd/common/dl.c
255
mopPrintTime(fd, ucp);
usr.sbin/mopd/common/dl.c
256
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
265
fprintf(fd, "Transfer Addr: %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
33
mopDumpDL(FILE *fd, u_char *pkt, int trans)
usr.sbin/mopd/common/dl.c
56
fprintf(fd, "Load Number : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
60
fprintf(fd, "Load Address : %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
67
fprintf(fd,
usr.sbin/mopd/common/dl.c
71
fprintf(fd,
usr.sbin/mopd/common/dl.c
75
fprintf(fd, "%02x ", mopGetChar(pkt, &idx));
usr.sbin/mopd/common/dl.c
77
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
81
fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
85
fprintf(fd, "Xfer Address : %08lx\n", tmpl);
usr.sbin/mopd/common/dl.c
92
fprintf(fd, "Load Number : %02x\n", tmpc);
usr.sbin/mopd/common/dl.c
95
fprintf(fd, "Load Address : %08lx\n", tmpl);
usr.sbin/mopd/common/file.c
195
CheckMopFile(int fd)
usr.sbin/mopd/common/file.c
200
if (read(fd, header, 512) != 512)
usr.sbin/mopd/common/file.c
203
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
468
CheckElfFile(int fd)
usr.sbin/mopd/common/file.c
475
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
477
if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
usr.sbin/mopd/common/file.c
882
CheckAOutFile(int fd)
usr.sbin/mopd/common/file.c
890
if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex))
usr.sbin/mopd/common/file.c
893
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
895
if (read(fd, (char *)&ex_swap, sizeof(ex_swap)) != sizeof(ex_swap))
usr.sbin/mopd/common/file.c
898
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/loop-bsd.c
113
if (ii->fd != -1) {
usr.sbin/mopd/common/loop-bsd.c
114
FD_SET(ii->fd, &fds);
usr.sbin/mopd/common/loop-bsd.c
115
if (ii->fd > maxfd)
usr.sbin/mopd/common/loop-bsd.c
116
maxfd = ii->fd;
usr.sbin/mopd/common/loop-bsd.c
126
if (ii->fd != -1) {
usr.sbin/mopd/common/loop-bsd.c
127
if (!FD_ISSET(ii->fd, &listeners))
usr.sbin/mopd/common/loop-bsd.c
130
cc = read(ii->fd, buf, bufsize);
usr.sbin/mopd/common/loop-bsd.c
138
if (errno == EINVAL && (lseek(ii->fd, 0,
usr.sbin/mopd/common/loop-bsd.c
140
lseek(ii->fd, 0, SEEK_SET);
usr.sbin/mopd/common/loop-bsd.c
96
if (iflist->fd != -1)
usr.sbin/mopd/common/loop-bsd.c
97
if (ioctl(iflist->fd, BIOCGBLEN, (caddr_t)&bufsize) < 0) {
usr.sbin/mopd/common/pf.c
105
if (ioctl(fd, BIOCIMMEDIATE, &immediate) < 0) {
usr.sbin/mopd/common/pf.c
110
if (ioctl(fd, BIOCSETIF, &ifr) < 0) {
usr.sbin/mopd/common/pf.c
116
if (ioctl(fd, BIOCGDLT, &dlt) < 0) {
usr.sbin/mopd/common/pf.c
126
if (ioctl(fd, BIOCPROMISC, 0) < 0) {
usr.sbin/mopd/common/pf.c
135
if (ioctl(fd, BIOCSETF, &filter) < 0) {
usr.sbin/mopd/common/pf.c
141
if (ioctl(fd, BIOCSETWF, &filter) < 0) {
usr.sbin/mopd/common/pf.c
147
if (ioctl(fd, BIOCLOCK) < 0) {
usr.sbin/mopd/common/pf.c
152
return (fd);
usr.sbin/mopd/common/pf.c
162
int fd;
usr.sbin/mopd/common/pf.c
173
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/common/pf.c
177
if (ioctl(fd, SIOCADDMULTI, &ifr) < 0) {
usr.sbin/mopd/common/pf.c
179
close(fd);
usr.sbin/mopd/common/pf.c
182
close(fd);
usr.sbin/mopd/common/pf.c
194
int fd;
usr.sbin/mopd/common/pf.c
206
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/common/pf.c
210
if (ioctl(fd, SIOCDELMULTI, &ifr) < 0) {
usr.sbin/mopd/common/pf.c
212
close(fd);
usr.sbin/mopd/common/pf.c
215
close(fd);
usr.sbin/mopd/common/pf.c
224
pfRead(int fd, u_char *buf, int len)
usr.sbin/mopd/common/pf.c
226
return (read(fd, buf, len));
usr.sbin/mopd/common/pf.c
233
pfWrite(int fd, u_char *buf, int len, int trans)
usr.sbin/mopd/common/pf.c
253
if (writev(fd, iov, 2) == len)
usr.sbin/mopd/common/pf.c
78
int fd;
usr.sbin/mopd/common/pf.c
98
if ((fd = open("/dev/bpf", mode)) == -1) {
usr.sbin/mopd/common/print.c
104
fprintf(fd, "MOP DL ");
usr.sbin/mopd/common/print.c
107
fprintf(fd, "MOP RC ");
usr.sbin/mopd/common/print.c
110
fprintf(fd, "MOP LP ");
usr.sbin/mopd/common/print.c
115
fprintf(fd, "MOP DL ");
usr.sbin/mopd/common/print.c
119
fprintf(fd, "MOP RC ");
usr.sbin/mopd/common/print.c
123
fprintf(fd, "MOP LP ");
usr.sbin/mopd/common/print.c
127
fprintf(fd, "MOP ?? ");
usr.sbin/mopd/common/print.c
133
fprintf(fd, "802.3 ");
usr.sbin/mopd/common/print.c
135
mopPrintHWA(fd, src); fprintf(fd, " > ");
usr.sbin/mopd/common/print.c
136
mopPrintHWA(fd, dst);
usr.sbin/mopd/common/print.c
138
fprintf(fd, " len %4d code %02x ", len, code);
usr.sbin/mopd/common/print.c
140
fprintf(fd, " len %4d code %02x ",
usr.sbin/mopd/common/print.c
147
fprintf(fd, "MLT ");
usr.sbin/mopd/common/print.c
150
fprintf(fd, "DCM ");
usr.sbin/mopd/common/print.c
153
fprintf(fd, "MLD ");
usr.sbin/mopd/common/print.c
156
fprintf(fd, "ASV ");
usr.sbin/mopd/common/print.c
159
fprintf(fd, "RMD ");
usr.sbin/mopd/common/print.c
162
fprintf(fd, "RPR ");
usr.sbin/mopd/common/print.c
165
fprintf(fd, "RML ");
usr.sbin/mopd/common/print.c
168
fprintf(fd, "RDS ");
usr.sbin/mopd/common/print.c
171
fprintf(fd, "MDD ");
usr.sbin/mopd/common/print.c
174
fprintf(fd, "PLT ");
usr.sbin/mopd/common/print.c
177
fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
184
fprintf(fd, "RID ");
usr.sbin/mopd/common/print.c
187
fprintf(fd, "BOT ");
usr.sbin/mopd/common/print.c
190
fprintf(fd, "SID ");
usr.sbin/mopd/common/print.c
193
fprintf(fd, "RQC ");
usr.sbin/mopd/common/print.c
196
fprintf(fd, "CNT ");
usr.sbin/mopd/common/print.c
199
fprintf(fd, "RVC ");
usr.sbin/mopd/common/print.c
202
fprintf(fd, "RLC ");
usr.sbin/mopd/common/print.c
205
fprintf(fd, "CCP ");
usr.sbin/mopd/common/print.c
208
fprintf(fd, "CRA ");
usr.sbin/mopd/common/print.c
211
fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
218
fprintf(fd, "ALD ");
usr.sbin/mopd/common/print.c
221
fprintf(fd, "PLD ");
usr.sbin/mopd/common/print.c
224
fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
229
fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
232
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
236
mopPrintHeader(FILE *fd, u_char *pkt, int trans)
usr.sbin/mopd/common/print.c
245
fprintf(fd, "\nDst : ");
usr.sbin/mopd/common/print.c
246
mopPrintHWA(fd, dst);
usr.sbin/mopd/common/print.c
248
fprintf(fd, " MOP Dump/Load Multicast");
usr.sbin/mopd/common/print.c
250
fprintf(fd, " MOP Remote Console Multicast");
usr.sbin/mopd/common/print.c
251
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
253
fprintf(fd, "Src : ");
usr.sbin/mopd/common/print.c
254
mopPrintHWA(fd, src);
usr.sbin/mopd/common/print.c
255
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
256
fprintf(fd, "Proto : %04x ", proto);
usr.sbin/mopd/common/print.c
262
fprintf(fd, "MOP Dump/Load (802.3)\n");
usr.sbin/mopd/common/print.c
265
fprintf(fd, "MOP Dump/Load\n");
usr.sbin/mopd/common/print.c
271
fprintf(fd, "MOP Remote Console (802.3)\n");
usr.sbin/mopd/common/print.c
274
fprintf(fd, "MOP Remote Console\n");
usr.sbin/mopd/common/print.c
280
fprintf(fd, "MOP Loopback (802.3)\n");
usr.sbin/mopd/common/print.c
283
fprintf(fd, "MOP Loopback\n");
usr.sbin/mopd/common/print.c
287
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
291
fprintf(fd, "Length : %04x (%d)\n", len, len);
usr.sbin/mopd/common/print.c
295
mopPrintMopHeader(FILE *fd, u_char *pkt, int trans)
usr.sbin/mopd/common/print.c
307
fprintf(fd, "Code : %02x ", code);
usr.sbin/mopd/common/print.c
313
fprintf(fd, "Memory Load with transfer address\n");
usr.sbin/mopd/common/print.c
316
fprintf(fd, "Dump Complete\n");
usr.sbin/mopd/common/print.c
319
fprintf(fd, "Memory Load\n");
usr.sbin/mopd/common/print.c
322
fprintf(fd, "Assistance volunteer\n");
usr.sbin/mopd/common/print.c
325
fprintf(fd, "Request memory dump\n");
usr.sbin/mopd/common/print.c
328
fprintf(fd, "Request program\n");
usr.sbin/mopd/common/print.c
331
fprintf(fd, "Request memory load\n");
usr.sbin/mopd/common/print.c
334
fprintf(fd, "Request Dump Service\n");
usr.sbin/mopd/common/print.c
337
fprintf(fd, "Memory dump data\n");
usr.sbin/mopd/common/print.c
340
fprintf(fd, "Parameter load with transfer address\n");
usr.sbin/mopd/common/print.c
343
fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
350
fprintf(fd, "Request ID\n");
usr.sbin/mopd/common/print.c
353
fprintf(fd, "Boot\n");
usr.sbin/mopd/common/print.c
356
fprintf(fd, "System ID\n");
usr.sbin/mopd/common/print.c
359
fprintf(fd, "Request Counters\n");
usr.sbin/mopd/common/print.c
362
fprintf(fd, "Counters\n");
usr.sbin/mopd/common/print.c
365
fprintf(fd, "Reserve Console\n");
usr.sbin/mopd/common/print.c
368
fprintf(fd, "Release Console\n");
usr.sbin/mopd/common/print.c
371
fprintf(fd, "Console Command and Poll\n");
usr.sbin/mopd/common/print.c
374
fprintf(fd, "Console Response and Acknnowledge\n");
usr.sbin/mopd/common/print.c
377
fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
384
fprintf(fd, "Active loop data\n");
usr.sbin/mopd/common/print.c
387
fprintf(fd, "Passive looped data\n");
usr.sbin/mopd/common/print.c
390
fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
395
fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
40
mopPrintHWA(FILE *fd, u_char *ap)
usr.sbin/mopd/common/print.c
401
mopPrintDevice(FILE *fd, u_char device)
usr.sbin/mopd/common/print.c
408
fprintf(fd, "%s '%s'", sname, name);
usr.sbin/mopd/common/print.c
412
mopPrintTime(FILE *fd, u_char *ap)
usr.sbin/mopd/common/print.c
414
fprintf(fd, "%04d-%02d-%02d %02d:%02d:%02d.%02d %d:%02d",
usr.sbin/mopd/common/print.c
42
fprintf(fd, "%x:%x:%x:%x:%x:%x", ap[0], ap[1], ap[2], ap[3], ap[4],
usr.sbin/mopd/common/print.c
420
mopPrintInfo(FILE *fd, u_char *pkt, int *idx, u_short moplen, u_char mopcode,
usr.sbin/mopd/common/print.c
44
if (ap[0] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
45
if (ap[1] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
452
fprintf(fd, "Maint Version: %d.%d.%d\n", uc1, uc2, uc3);
usr.sbin/mopd/common/print.c
456
fprintf(fd, "Maint Function: %04x ( ", tmps);
usr.sbin/mopd/common/print.c
457
if (tmps & 1) fprintf(fd, "Loop ");
usr.sbin/mopd/common/print.c
458
if (tmps & 2) fprintf(fd, "Dump ");
usr.sbin/mopd/common/print.c
459
if (tmps & 4) fprintf(fd, "Pldr ");
usr.sbin/mopd/common/print.c
46
if (ap[2] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
460
if (tmps & 8) fprintf(fd, "MLdr ");
usr.sbin/mopd/common/print.c
461
if (tmps & 16) fprintf(fd, "Boot ");
usr.sbin/mopd/common/print.c
462
if (tmps & 32) fprintf(fd, "CC ");
usr.sbin/mopd/common/print.c
463
if (tmps & 64) fprintf(fd, "DLC ");
usr.sbin/mopd/common/print.c
464
if (tmps & 128) fprintf(fd, "CCR ");
usr.sbin/mopd/common/print.c
465
fprintf(fd, ")\n");
usr.sbin/mopd/common/print.c
47
if (ap[3] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
470
fprintf(fd, "Console User : ");
usr.sbin/mopd/common/print.c
471
mopPrintHWA(fd, ucp);
usr.sbin/mopd/common/print.c
472
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
476
fprintf(fd, "Reserv Timer : %04x (%d)\n", tmps, tmps);
usr.sbin/mopd/common/print.c
48
if (ap[4] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
480
fprintf(fd, "Cons Cmd Size: %04x (%d)\n", tmps, tmps);
usr.sbin/mopd/common/print.c
484
fprintf(fd, "Cons Res Size: %04x (%d)\n", tmps, tmps);
usr.sbin/mopd/common/print.c
489
fprintf(fd, "Hardware Addr: ");
usr.sbin/mopd/common/print.c
49
if (ap[5] < 16) fprintf(fd, " ");
usr.sbin/mopd/common/print.c
490
mopPrintHWA(fd, ucp);
usr.sbin/mopd/common/print.c
491
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
496
fprintf(fd, "System Time: ");
usr.sbin/mopd/common/print.c
497
mopPrintTime(fd, ucp);
usr.sbin/mopd/common/print.c
498
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
502
fprintf(fd, "Comm Device : %02x ", device);
usr.sbin/mopd/common/print.c
503
mopPrintDevice(fd, device);
usr.sbin/mopd/common/print.c
504
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
508
fprintf(fd, "Software ID : %02x ", tmpc);
usr.sbin/mopd/common/print.c
510
fprintf(fd, "No software id");
usr.sbin/mopd/common/print.c
512
fprintf(fd, "Maintenance system");
usr.sbin/mopd/common/print.c
516
fprintf(fd, "Standard operating system");
usr.sbin/mopd/common/print.c
520
fprintf(fd, "'");
usr.sbin/mopd/common/print.c
522
fprintf(fd, "%c",
usr.sbin/mopd/common/print.c
524
fprintf(fd, "'");
usr.sbin/mopd/common/print.c
526
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
53
mopPrintBPTY(FILE *fd, u_char bpty)
usr.sbin/mopd/common/print.c
530
fprintf(fd, "System Proc : %02x ", tmpc);
usr.sbin/mopd/common/print.c
533
fprintf(fd, "PDP-11\n");
usr.sbin/mopd/common/print.c
536
fprintf(fd, "Communication Server\n");
usr.sbin/mopd/common/print.c
539
fprintf(fd, "Professional\n");
usr.sbin/mopd/common/print.c
542
fprintf(fd, "Scorpio\n");
usr.sbin/mopd/common/print.c
545
fprintf(fd, "Amber\n");
usr.sbin/mopd/common/print.c
548
fprintf(fd, "XLII Bridge\n");
usr.sbin/mopd/common/print.c
551
fprintf(fd, "Unknown\n");
usr.sbin/mopd/common/print.c
557
fprintf(fd, "DLnk Type : %02x ", tmpc);
usr.sbin/mopd/common/print.c
560
fprintf(fd, "Ethernet\n");
usr.sbin/mopd/common/print.c
563
fprintf(fd, "DDCMP\n");
usr.sbin/mopd/common/print.c
566
fprintf(fd, "LAPB (X.25)\n");
usr.sbin/mopd/common/print.c
569
fprintf(fd, "Unknown\n");
usr.sbin/mopd/common/print.c
57
fprintf(fd, "System Processor");
usr.sbin/mopd/common/print.c
575
fprintf(fd, "DLnk Buf Size: %04x (%d)\n", tmps, tmps);
usr.sbin/mopd/common/print.c
588
fprintf(fd, "ROM SW Ver : %02x '",
usr.sbin/mopd/common/print.c
591
fprintf(fd, "%c", ucp[i]);
usr.sbin/mopd/common/print.c
592
fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
597
fprintf(fd, "Loaded SW Ver: %02x '",
usr.sbin/mopd/common/print.c
60
fprintf(fd, "Communication Processor");
usr.sbin/mopd/common/print.c
600
fprintf(fd, "%c", ucp[i]);
usr.sbin/mopd/common/print.c
601
fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
605
fprintf(fd,
usr.sbin/mopd/common/print.c
612
fprintf(fd, "Node Name : %02x '",
usr.sbin/mopd/common/print.c
615
fprintf(fd, "%c", ucp[i]);
usr.sbin/mopd/common/print.c
616
fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
621
fprintf(fd, "Node Ident : %02x '",
usr.sbin/mopd/common/print.c
624
fprintf(fd, "%c", ucp[i]);
usr.sbin/mopd/common/print.c
625
fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
63
fprintf(fd, "Unknown");
usr.sbin/mopd/common/print.c
631
fprintf(fd, "Info Type : %04x (%d)\n",
usr.sbin/mopd/common/print.c
633
fprintf(fd, "Info Data : %02x ", ilen);
usr.sbin/mopd/common/print.c
637
fprintf(fd,
usr.sbin/mopd/common/print.c
639
fprintf(fd, "%02x ", ucp[i]);
usr.sbin/mopd/common/print.c
641
fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
69
mopPrintPGTY(FILE *fd, u_char pgty)
usr.sbin/mopd/common/print.c
73
fprintf(fd, "Secondary Loader");
usr.sbin/mopd/common/print.c
76
fprintf(fd, "Tertiary Loader");
usr.sbin/mopd/common/print.c
79
fprintf(fd, "Operating System");
usr.sbin/mopd/common/print.c
82
fprintf(fd, "Management File");
usr.sbin/mopd/common/print.c
85
fprintf(fd, "Unknown");
usr.sbin/mopd/common/print.c
91
mopPrintOneline(FILE *fd, u_char *pkt, int trans)
usr.sbin/mopd/common/rc.c
101
fprintf(fd, "No software id");
usr.sbin/mopd/common/rc.c
103
fprintf(fd, "Maintenance system");
usr.sbin/mopd/common/rc.c
107
fprintf(fd, "Standard operating system");
usr.sbin/mopd/common/rc.c
111
fprintf(fd, "'");
usr.sbin/mopd/common/rc.c
113
fprintf(fd, "%c",
usr.sbin/mopd/common/rc.c
115
fprintf(fd, "'");
usr.sbin/mopd/common/rc.c
117
fprintf(fd, "'\n");
usr.sbin/mopd/common/rc.c
124
fprintf(fd, "Reserved : %02x\n", tmpc);
usr.sbin/mopd/common/rc.c
127
fprintf(fd, "Receipt Nbr : %04x\n", tmpc);
usr.sbin/mopd/common/rc.c
129
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/rc.c
135
fprintf(fd, "Receipt Nbr : %04x\n", tmps);
usr.sbin/mopd/common/rc.c
141
fprintf(fd, "Receipt Nbr : %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
144
fprintf(fd, "Last Zeroed : %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
147
fprintf(fd, "Bytes rec : %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
150
fprintf(fd, "Bytes snd : %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
153
fprintf(fd, "Frames rec : %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
156
fprintf(fd, "Frames snd : %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
159
fprintf(fd, "Mcst Bytes re: %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
162
fprintf(fd, "Mcst Frame re: %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
165
fprintf(fd, "Frame snd, def: %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
168
fprintf(fd, "Frame snd, col: %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
171
fprintf(fd, "Frame snd, mcl: %08lx %ld\n", tmpl, tmpl);
usr.sbin/mopd/common/rc.c
174
fprintf(fd, "Snd failure : %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
177
fprintf(fd, "Snd fail reas: %04x ", tmps);
usr.sbin/mopd/common/rc.c
179
fprintf(fd, "Excess col ");
usr.sbin/mopd/common/rc.c
181
fprintf(fd, "Carrier chk fail ");
usr.sbin/mopd/common/rc.c
183
fprintf(fd, "Short circ ");
usr.sbin/mopd/common/rc.c
185
fprintf(fd, "Open circ ");
usr.sbin/mopd/common/rc.c
187
fprintf(fd, "Frm to long ");
usr.sbin/mopd/common/rc.c
189
fprintf(fd, "Rem fail to defer ");
usr.sbin/mopd/common/rc.c
190
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
193
fprintf(fd, "Rec failure : %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
196
fprintf(fd, "Rec fail reas: %04x ", tmps);
usr.sbin/mopd/common/rc.c
198
fprintf(fd, "Block chk err ");
usr.sbin/mopd/common/rc.c
200
fprintf(fd, "Framing err ");
usr.sbin/mopd/common/rc.c
202
fprintf(fd, "Frm to long ");
usr.sbin/mopd/common/rc.c
203
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
206
fprintf(fd, "Unrec frm dst: %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
209
fprintf(fd, "Data overrun : %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
212
fprintf(fd, "Sys Buf Unava: %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
215
fprintf(fd, "Usr Buf Unava: %04x %d\n", tmps, tmps);
usr.sbin/mopd/common/rc.c
221
fprintf(fd, "Verification : %08lx\n", tmpl);
usr.sbin/mopd/common/rc.c
231
fprintf(fd, "Control Flags: %02x Message %d ", tmpc, tmpc & 1);
usr.sbin/mopd/common/rc.c
233
fprintf(fd, "Break");
usr.sbin/mopd/common/rc.c
234
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
240
fprintf(fd,
usr.sbin/mopd/common/rc.c
244
fprintf(fd,
usr.sbin/mopd/common/rc.c
247
fprintf(fd, "%02x ", mopGetChar(pkt, &idx));
usr.sbin/mopd/common/rc.c
249
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
252
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
259
fprintf(fd, "Control Flags: %02x Message %d ", tmpc, tmpc & 1);
usr.sbin/mopd/common/rc.c
261
fprintf(fd, "Cmd Data Lost ");
usr.sbin/mopd/common/rc.c
263
fprintf(fd, "Resp Data Lost ");
usr.sbin/mopd/common/rc.c
264
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
270
fprintf(fd,
usr.sbin/mopd/common/rc.c
274
fprintf(fd,
usr.sbin/mopd/common/rc.c
277
fprintf(fd, "%02x ", mopGetChar(pkt, &idx));
usr.sbin/mopd/common/rc.c
279
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
282
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
33
mopDumpRC(FILE *fd, u_char *pkt, int trans)
usr.sbin/mopd/common/rc.c
57
fprintf(fd, "Reserved : %02x\n", tmpc);
usr.sbin/mopd/common/rc.c
60
fprintf(fd, "Receipt Nbr : %04x\n", tmps);
usr.sbin/mopd/common/rc.c
67
fprintf(fd, "Verification : %04x\n", tmps);
usr.sbin/mopd/common/rc.c
71
fprintf(fd, "Verification : %08lx\n", tmpl);
usr.sbin/mopd/common/rc.c
74
fprintf(fd, "Processor : %02x ", tmpc);
usr.sbin/mopd/common/rc.c
75
mopPrintBPTY(fd, tmpc); fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
78
fprintf(fd, "Control : %02x ", control);
usr.sbin/mopd/common/rc.c
80
fprintf(fd, "Bootserver Requesting system ");
usr.sbin/mopd/common/rc.c
82
fprintf(fd, "Bootserver System default ");
usr.sbin/mopd/common/rc.c
84
fprintf(fd, "Bootdevice Specified device");
usr.sbin/mopd/common/rc.c
86
fprintf(fd, "Bootdevice System default");
usr.sbin/mopd/common/rc.c
87
fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
91
fprintf(fd, "Device ID : %02x '", tmpc);
usr.sbin/mopd/common/rc.c
93
fprintf(fd, "%c",
usr.sbin/mopd/common/rc.c
95
fprintf(fd, "'\n");
usr.sbin/mopd/common/rc.c
99
fprintf(fd, "Software ID : %02x ", tmpc);
usr.sbin/mopd/mopd/process.c
150
if (pfWrite(ii->fd, pkt, idx, trans) != idx)
usr.sbin/mopd/mopd/process.c
227
if (pfWrite(dllist[slot].ii->fd, pkt, idx, trans) != idx)
usr.sbin/mopd/mopd/process.c
332
if (pfWrite(dllist[slot].ii->fd, pkt, idx, trans) != idx)
usr.sbin/mopd/mopd/process.c
338
mopProcessDL(FILE *fd, struct if_info *ii, u_char *pkt, int *idx, u_char *dst,
usr.sbin/mopd/mopd/process.c
465
mopProcessRC(FILE *fd, struct if_info *ii, u_char *pkt, int *idx, u_char dst,
usr.sbin/mopd/otherOS/loop-linux2.c
123
if (ii->fd != -1) {
usr.sbin/mopd/otherOS/loop-linux2.c
124
FD_SET(ii->fd, &fds);
usr.sbin/mopd/otherOS/loop-linux2.c
125
if (ii->fd > maxfd)
usr.sbin/mopd/otherOS/loop-linux2.c
126
maxfd = ii->fd;
usr.sbin/mopd/otherOS/loop-linux2.c
137
if (ii->fd != -1) {
usr.sbin/mopd/otherOS/loop-linux2.c
138
if (!FD_ISSET(ii->fd, &listeners))
usr.sbin/mopd/otherOS/loop-linux2.c
142
cc = read(ii->fd, (char *) buf, bufsize);
usr.sbin/mopd/otherOS/loop.c
106
mopReadDL(p, fd)
usr.sbin/mopd/otherOS/loop.c
108
int fd;
usr.sbin/mopd/otherOS/loop.c
112
if ((cc = pfRead(fd, buf+HDRSIZ, BUFSIZE-HDRSIZ)) < 0) {
usr.sbin/mopd/otherOS/loop.c
146
if (ii->fd != -1) {
usr.sbin/mopd/otherOS/loop.c
147
FD_SET(ii->fd, &fds);
usr.sbin/mopd/otherOS/loop.c
148
if (ii->fd > maxfd)
usr.sbin/mopd/otherOS/loop.c
149
maxfd = ii->fd;
usr.sbin/mopd/otherOS/loop.c
160
if (ii->fd != -1) {
usr.sbin/mopd/otherOS/loop.c
161
if (FD_ISSET(ii->fd, &listeners))
usr.sbin/mopd/otherOS/loop.c
162
(*(ii->read))(ii,ii->fd);
usr.sbin/mopd/otherOS/loop.c
46
int fd;
usr.sbin/mopd/otherOS/loop.c
48
fd = (*(p->iopen))(p->if_name,
usr.sbin/mopd/otherOS/loop.c
52
if (fd >= 0) {
usr.sbin/mopd/otherOS/loop.c
53
pfAddMulti(fd, p->if_name, rc_mcst);
usr.sbin/mopd/otherOS/loop.c
54
pfEthAddr(fd, p->eaddr);
usr.sbin/mopd/otherOS/loop.c
57
return fd;
usr.sbin/mopd/otherOS/loop.c
69
int fd;
usr.sbin/mopd/otherOS/loop.c
71
fd = (*(p->iopen))(p->if_name,
usr.sbin/mopd/otherOS/loop.c
75
if (fd >= 0) {
usr.sbin/mopd/otherOS/loop.c
76
pfAddMulti(fd, p->if_name, dl_mcst);
usr.sbin/mopd/otherOS/loop.c
77
pfEthAddr(fd, p->eaddr);
usr.sbin/mopd/otherOS/loop.c
80
return fd;
usr.sbin/mopd/otherOS/loop.c
87
mopReadRC(p, fd)
usr.sbin/mopd/otherOS/loop.c
89
int fd;
usr.sbin/mopd/otherOS/loop.c
93
if ((cc = pfRead(fd, buf+HDRSIZ, BUFSIZE-HDRSIZ)) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
102
if (setup_pf(fd, protocol, trans) < 0)
usr.sbin/mopd/otherOS/pf-snit.c
116
if (ioctl(fd, I_STR, (caddr_t)&si) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
127
if (ioctl(fd, I_STR, (caddr_t)&si) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
134
if (ioctl(fd, I_SRDOPT, (char *)RMSGD) < 0) { /* want messages */
usr.sbin/mopd/otherOS/pf-snit.c
140
if (ioctl(fd, I_FLUSH, (char *)FLUSHR) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
145
return(fd);
usr.sbin/mopd/otherOS/pf-snit.c
204
pfEthAddr(fd, addr)
usr.sbin/mopd/otherOS/pf-snit.c
205
int fd;
usr.sbin/mopd/otherOS/pf-snit.c
211
if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
231
int fd;
usr.sbin/mopd/otherOS/pf-snit.c
243
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
247
if (ioctl(fd, SIOCADDMULTI, (caddr_t)&ifr) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
249
close(fd);
usr.sbin/mopd/otherOS/pf-snit.c
252
close(fd);
usr.sbin/mopd/otherOS/pf-snit.c
267
int fd;
usr.sbin/mopd/otherOS/pf-snit.c
279
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
284
if (ioctl(fd, SIOCDELMULTI, (caddr_t)&ifr) < 0) {
usr.sbin/mopd/otherOS/pf-snit.c
286
close(fd);
usr.sbin/mopd/otherOS/pf-snit.c
289
close(fd);
usr.sbin/mopd/otherOS/pf-snit.c
299
pfRead(fd, buf, len)
usr.sbin/mopd/otherOS/pf-snit.c
300
int fd, len;
usr.sbin/mopd/otherOS/pf-snit.c
303
return(read(fd, buf, len));
usr.sbin/mopd/otherOS/pf-snit.c
311
pfWrite(fd, buf, len, trans)
usr.sbin/mopd/otherOS/pf-snit.c
312
int fd, len, trans;
usr.sbin/mopd/otherOS/pf-snit.c
331
if (putmsg(fd, &pbuf, &dbuf, 0) == 0)
usr.sbin/mopd/otherOS/pf-snit.c
84
int fd;
usr.sbin/mopd/otherOS/pf-snit.c
93
if ((fd = open(DEV_NIT, mode)) < 0) {
usr.sbin/mrinfo/mrinfo.c
408
pfd[0].fd = igmp_socket;
usr.sbin/mrouted/defs.h
133
extern int register_input_handler(int fd, ihfunc_t func);
usr.sbin/mrouted/main.c
228
pfd[0].fd = igmp_socket;
usr.sbin/mrouted/main.c
231
pfd[i + 1].fd = ihandlers[i].fd;
usr.sbin/mrouted/main.c
276
(*ihandlers[i].func)(ihandlers[i].fd);
usr.sbin/mrouted/main.c
44
int fd; /* File descriptor */
usr.sbin/mrouted/main.c
63
register_input_handler(int fd, ihfunc_t func)
usr.sbin/mrouted/main.c
68
ihandlers[nhandlers].fd = fd;
usr.sbin/mtrace/mtrace.c
436
pfd[0].fd = igmp_socket;
usr.sbin/mtree/compare.c
222
if ((fd = open(p->fts_accpath, MTREE_O_FLAGS)) == -1) {
usr.sbin/mtree/compare.c
227
} else if (crc(fd, &val, &len)) {
usr.sbin/mtree/compare.c
228
(void)close(fd);
usr.sbin/mtree/compare.c
234
(void)close(fd);
usr.sbin/mtree/compare.c
78
int fd, label;
usr.sbin/mtree/crc.c
105
crc(int fd, u_int32_t *cval, u_int32_t *clen)
usr.sbin/mtree/crc.c
116
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.sbin/mtree/create.c
131
int fd, offset;
usr.sbin/mtree/create.c
195
if ((fd = open(p->fts_accpath, MTREE_O_FLAGS)) == -1 ||
usr.sbin/mtree/create.c
196
crc(fd, &val, &len))
usr.sbin/mtree/create.c
198
(void)close(fd);
usr.sbin/npppd/l2tp/l2tp_ctrl.c
365
l2tp_ctrl_timeout(int fd, short evtype, void *ctx)
usr.sbin/npppd/l2tp/l2tpd.c
481
l2tpd_stop_timeout(int fd, short evtype, void *ctx)
usr.sbin/npppd/l2tp/l2tpd.c
593
l2tpd_io_event(int fd, short evtype, void *ctx)
usr.sbin/npppd/npppd/accept.c
125
accept_cb(int fd, short event, void *arg)
usr.sbin/npppd/npppd/accept.c
129
av->accept_cb(fd, event, av->arg);
usr.sbin/npppd/npppd/accept.c
133
accept_timeout(int fd, short event, void *bula)
usr.sbin/npppd/npppd/accept.c
33
int fd;
usr.sbin/npppd/npppd/accept.c
54
accept_add(int fd, void (*cb)(int, short, void *), void *arg)
usr.sbin/npppd/npppd/accept.c
60
av->fd = fd;
usr.sbin/npppd/npppd/accept.c
65
event_set(&av->ev, av->fd, EV_READ, accept_cb, av);
usr.sbin/npppd/npppd/accept.c
68
log_debug("accept_add: accepting on fd %d", fd);
usr.sbin/npppd/npppd/accept.c
74
accept_del(int fd)
usr.sbin/npppd/npppd/accept.c
79
if (av->fd == fd) {
usr.sbin/npppd/npppd/accept.c
80
log_debug("accept_del: %i removed from queue", fd);
usr.sbin/npppd/npppd/control.c
101
close(fd);
usr.sbin/npppd/npppd/control.c
107
cs->cs_fd = fd;
usr.sbin/npppd/npppd/control.c
140
control_close(c->iev.ibuf.fd, cs);
usr.sbin/npppd/npppd/control.c
201
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/npppd/npppd/control.c
209
control_connbyfd(int fd)
usr.sbin/npppd/npppd/control.c
214
if (c->iev.ibuf.fd == fd)
usr.sbin/npppd/npppd/control.c
222
control_close(int fd, struct control_sock *cs)
usr.sbin/npppd/npppd/control.c
226
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/npppd/npppd/control.c
227
log_warn("control_close: fd %d: not found", fd);
usr.sbin/npppd/npppd/control.c
235
close(c->iev.ibuf.fd);
usr.sbin/npppd/npppd/control.c
248
control_dispatch_imsg(int fd, short event, void *arg)
usr.sbin/npppd/npppd/control.c
255
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/npppd/npppd/control.c
256
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/npppd/npppd/control.c
263
control_close(fd, cs);
usr.sbin/npppd/npppd/control.c
274
control_close(fd, cs);
usr.sbin/npppd/npppd/control.c
281
control_close(fd, cs);
usr.sbin/npppd/npppd/control.c
294
control_close(fd, cs);
usr.sbin/npppd/npppd/control.c
57
int fd;
usr.sbin/npppd/npppd/control.c
63
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) {
usr.sbin/npppd/npppd/control.c
72
close(fd);
usr.sbin/npppd/npppd/control.c
79
close(fd);
usr.sbin/npppd/npppd/control.c
91
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/npppd/npppd/control.c
93
close(fd);
usr.sbin/npppd/npppd/fsm.c
84
fsm_evtimer_timeout(int fd, short evtype, void *ctx)
usr.sbin/npppd/npppd/npppd.c
1928
npppd_on_sighup(int fd, short ev_type, void *ctx)
usr.sbin/npppd/npppd/npppd.c
1942
npppd_on_sigterm(int fd, short ev_type, void *ctx)
usr.sbin/npppd/npppd/npppd.c
1951
npppd_on_sigint(int fd, short ev_type, void *ctx)
usr.sbin/npppd/npppd/npppd.c
1960
npppd_on_sigchld(int fd, short ev_type, void *ctx)
usr.sbin/npppd/npppd/npppd.c
2418
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/npppd/npppd/npppd.c
548
npppd_timer(int fd, short evtype, void *ctx)
usr.sbin/npppd/npppd/npppd_iface.c
363
npppd_iface_io_event_handler(int fd, short evtype, void *data)
usr.sbin/npppd/npppd/npppd_radius.c
692
npppd_radius_dae_on_event(int fd, short ev, void *ctx)
usr.sbin/npppd/npppd/ppp.c
621
ppp_idle_timeout(int fd, short evtype, void *context)
usr.sbin/npppd/npppd/privsep.c
654
int fd;
usr.sbin/npppd/npppd/privsep.c
657
(fd = imsg_get_fd(&imsg)) < 0)
usr.sbin/npppd/npppd/privsep.c
662
if ((r.retval = bind(fd,
usr.sbin/npppd/npppd/privsep.c
666
close(fd);
usr.sbin/npppd/npppd/privsep.c
753
int fd;
usr.sbin/npppd/npppd/privsep.c
760
else if ((fd = imsg_get_fd(&imsg)) < 0)
usr.sbin/npppd/npppd/privsep.c
766
r.retval = sendto(fd, a->msg,
usr.sbin/npppd/npppd/privsep.c
771
r.retval = send(fd, a->msg, a->len,
usr.sbin/npppd/npppd/privsep.c
775
close(fd);
usr.sbin/npppd/npppd/radius_req.c
410
radius_request_io_event(int fd, short evmask, void *context)
usr.sbin/npppd/pppoe/pppoe_session.c
141
pppoe_session_dispose_event(int fd, short ev, void *ctx)
usr.sbin/npppd/pppoe/pppoed.c
577
pppoed_io_event(int fd, short evmask, void *ctx)
usr.sbin/npppd/pptp/pptp_ctrl.c
203
pptp_ctrl_timeout(int fd, short event, void *ctx)
usr.sbin/npppd/pptp/pptp_ctrl.c
390
pptp_ctrl_io_event(int fd, short evmask, void *ctx)
usr.sbin/npppd/pptp/pptpd.c
510
pptpd_stop_timeout(int fd, short event, void *ctx)
usr.sbin/npppd/pptp/pptpd.c
603
pptpd_io_event(int fd, short evmask, void *ctx)
usr.sbin/npppd/pptp/pptpd.c
648
pptpd_gre_io_event(int fd, short evmask, void *ctx)
usr.sbin/nsd/dnstap/dnstap.c
140
int fd;
usr.sbin/nsd/dnstap/dnstap.c
159
dtw->fd = -1;
usr.sbin/nsd/dnstap/dnstap.c
267
if(dtw->fd != -1) {
usr.sbin/nsd/dnstap/dnstap.c
268
close(dtw->fd);
usr.sbin/nsd/dnstap/dnstap.c
269
dtw->fd = -1;
usr.sbin/nsd/dnstap/dnstap.c
349
dtw->fd = socket(addrfamily, SOCK_STREAM, 0);
usr.sbin/nsd/dnstap/dnstap.c
350
if(dtw->fd == -1) {
usr.sbin/nsd/dnstap/dnstap.c
354
if(connect(dtw->fd, (struct sockaddr*)&addr, addrlen) < 0) {
usr.sbin/nsd/dnstap/dnstap.c
368
if(!SSL_set_fd(dtw->ssl, dtw->fd)) {
usr.sbin/nsd/dnstap/dnstap.c
432
if(dtw->fd != -1) {
usr.sbin/nsd/dnstap/dnstap.c
433
close(dtw->fd);
usr.sbin/nsd/dnstap/dnstap.c
434
dtw->fd = -1;
usr.sbin/nsd/dnstap/dnstap_collector.c
160
dt_handle_cmd_from_nsd(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/dnstap/dnstap_collector.c
169
static int recv_into_buffer(int fd, struct buffer* buf)
usr.sbin/nsd/dnstap/dnstap_collector.c
175
r = recv(fd, buffer_current(buf), buffer_capacity(buf), MSG_DONTWAIT);
usr.sbin/nsd/dnstap/dnstap_collector.c
258
dt_handle_input(int fd, short event, void* arg)
usr.sbin/nsd/dnstap/dnstap_collector.c
263
int r = recv_into_buffer(fd, dt_input->buffer);
usr.sbin/nsd/ipc.c
118
if ((len = read(handler->fd, &mode, sizeof(mode))) == -1) {
usr.sbin/nsd/ipc.c
127
close(handler->fd);
usr.sbin/nsd/ipc.c
128
handler->fd = -1;
usr.sbin/nsd/ipc.c
156
send_stat_to_child(struct main_ipc_handler_data* data, int fd)
usr.sbin/nsd/ipc.c
159
if(write(fd, &cmd, sizeof(cmd)) == -1) {
usr.sbin/nsd/ipc.c
170
send_quit_to_child(struct main_ipc_handler_data* data, int fd)
usr.sbin/nsd/ipc.c
173
if(write(fd, &cmd, sizeof(cmd)) == -1) {
usr.sbin/nsd/ipc.c
187
child_is_done(struct nsd* nsd, int fd)
usr.sbin/nsd/ipc.c
190
if(fd != -1) close(fd);
usr.sbin/nsd/ipc.c
192
if(nsd->children[i].child_fd == fd) {
usr.sbin/nsd/ipc.c
194
nsd->children[i].handler->fd = -1;
usr.sbin/nsd/ipc.c
26
static void send_stat_to_child(struct main_ipc_handler_data* data, int fd);
usr.sbin/nsd/ipc.c
296
send_stat_to_child(data, handler->fd);
usr.sbin/nsd/ipc.c
298
send_quit_to_child(data, handler->fd);
usr.sbin/nsd/ipc.c
311
if ((len = read(handler->fd, &mode, sizeof(mode))) == -1) {
usr.sbin/nsd/ipc.c
318
child_is_done(data->nsd, handler->fd);
usr.sbin/nsd/ipc.c
366
if ((len = read(handler->fd, &mode, sizeof(mode))) == -1) {
usr.sbin/nsd/ipc.c
373
assert(handler->fd != -1); /* or read() would have failed */
usr.sbin/nsd/ipc.c
374
close(handler->fd);
usr.sbin/nsd/ipc.c
375
handler->fd = -1;
usr.sbin/nsd/ipc.c
439
int fd = xfrd->ipc_handler.ev_fd;
usr.sbin/nsd/ipc.c
443
event_set(&xfrd->ipc_handler, fd, mode, xfrd_handle_ipc, xfrd);
usr.sbin/nsd/ipc.c
493
xfrd_handle_ipc(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/ipc.c
58
child_handle_parent_command(int fd, short event, void* arg)
usr.sbin/nsd/ipc.c
605
xfrd_handle_notify(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/ipc.c
68
if ((len = read(fd, &mode, sizeof(mode))) == -1) {
usr.sbin/nsd/ipc.c
92
if(write(fd, &mode, sizeof(mode)) == -1) {
usr.sbin/nsd/ipc.h
69
void child_handle_parent_command(int fd, short event, void* arg);
usr.sbin/nsd/ipc.h
75
void xfrd_handle_ipc(int fd, short event, void* arg);
usr.sbin/nsd/ipc.h
78
void xfrd_handle_notify(int fd, short event, void* arg);
usr.sbin/nsd/metrics.c
181
int fd, r;
usr.sbin/nsd/metrics.c
190
fd = create_local_accept_sock(ip, &noproto);
usr.sbin/nsd/metrics.c
196
if(fd != -1) {
usr.sbin/nsd/metrics.c
230
fd = create_tcp_accept_sock(res, &noproto);
usr.sbin/nsd/metrics.c
234
if(fd == -1 && noproto) {
usr.sbin/nsd/metrics.c
241
if(fd == -1) {
usr.sbin/nsd/metrics.c
252
close(fd);
usr.sbin/nsd/metrics.c
259
hl->accept_fd = fd;
usr.sbin/nsd/metrics.c
290
int fd;
usr.sbin/nsd/metrics.c
301
fd = p->accept_fd;
usr.sbin/nsd/metrics.c
302
if (evhttp_accept_socket(metrics->http_server, fd)) {
usr.sbin/nsd/mini_event.c
323
event_set(struct event* ev, int fd, short bits,
usr.sbin/nsd/mini_event.c
327
ev->ev_fd = fd;
usr.sbin/nsd/netio.c
146
if (handler->fd != -1 && numfd < MAX_NETIO_FDS) {
usr.sbin/nsd/netio.c
147
fds[numfd].fd = handler->fd;
usr.sbin/nsd/netio.c
235
if (handler->fd != -1 && handler->pfd != -1) {
usr.sbin/nsd/netio.h
104
int fd;
usr.sbin/nsd/nsd-control.c
246
int fd;
usr.sbin/nsd/nsd-control.c
316
fd = socket(addrfamily, SOCK_STREAM, 0);
usr.sbin/nsd/nsd-control.c
317
if(fd == -1) {
usr.sbin/nsd/nsd-control.c
321
if(fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
usr.sbin/nsd/nsd-control.c
325
if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) {
usr.sbin/nsd/nsd-control.c
334
FD_SET(fd, &rset);
usr.sbin/nsd/nsd-control.c
336
FD_SET(fd, &wset);
usr.sbin/nsd/nsd-control.c
338
FD_SET(fd, &eset);
usr.sbin/nsd/nsd-control.c
341
if(select(fd+1, &rset, &wset, &eset, &tv) == -1) {
usr.sbin/nsd/nsd-control.c
345
if(!FD_ISSET(fd, &rset) && !FD_ISSET(fd, &wset) &&
usr.sbin/nsd/nsd-control.c
346
!FD_ISSET(fd, &eset)) {
usr.sbin/nsd/nsd-control.c
353
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
usr.sbin/nsd/nsd-control.c
365
if(fcntl(fd, F_SETFL, 0) == -1) {
usr.sbin/nsd/nsd-control.c
369
return fd;
usr.sbin/nsd/nsd-control.c
375
setup_ssl(SSL_CTX* ctx, int fd)
usr.sbin/nsd/nsd-control.c
387
if(!SSL_set_fd(ssl, fd))
usr.sbin/nsd/nsd-control.c
416
remote_read(SSL* ssl, int fd, char* buf, size_t len)
usr.sbin/nsd/nsd-control.c
432
ssize_t rr = read(fd, buf, len-1);
usr.sbin/nsd/nsd-control.c
449
remote_write(SSL* ssl, int fd, const char* buf, size_t len)
usr.sbin/nsd/nsd-control.c
457
if(write(fd, buf, len) < (ssize_t)len) {
usr.sbin/nsd/nsd-control.c
467
send_file(SSL* ssl, int fd, FILE* in, char* buf, size_t sz)
usr.sbin/nsd/nsd-control.c
471
remote_write(ssl, fd, buf, strlen(buf));
usr.sbin/nsd/nsd-control.c
474
remote_write(ssl, fd, e, sizeof(e));
usr.sbin/nsd/nsd-control.c
479
go_cmd(SSL* ssl, int fd, int argc, char* argv[])
usr.sbin/nsd/nsd-control.c
488
remote_write(ssl, fd, pre, strlen(pre));
usr.sbin/nsd/nsd-control.c
490
remote_write(ssl, fd, space, strlen(space));
usr.sbin/nsd/nsd-control.c
491
remote_write(ssl, fd, argv[i], strlen(argv[i]));
usr.sbin/nsd/nsd-control.c
493
remote_write(ssl, fd, newline, strlen(newline));
usr.sbin/nsd/nsd-control.c
498
send_file(ssl, fd, stdin, buf, sizeof(buf));
usr.sbin/nsd/nsd-control.c
502
if(remote_read(ssl, fd, buf, sizeof(buf)) == 0) {
usr.sbin/nsd/nsd-control.c
518
int fd, ret;
usr.sbin/nsd/nsd-control.c
547
fd = contact_server(svr, opt, argc>0&&strcmp(argv[0],"status")==0);
usr.sbin/nsd/nsd-control.c
549
ssl = setup_ssl(ctx, fd);
usr.sbin/nsd/nsd-control.c
553
ret = go_cmd(ssl, fd, argc, argv);
usr.sbin/nsd/nsd-control.c
558
close(fd);
usr.sbin/nsd/nsd.c
1534
int fd;
usr.sbin/nsd/nsd.c
1556
if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
usr.sbin/nsd/nsd.c
1557
(void)dup2(fd, STDIN_FILENO);
usr.sbin/nsd/nsd.c
1558
(void)dup2(fd, STDOUT_FILENO);
usr.sbin/nsd/nsd.c
1559
(void)dup2(fd, STDERR_FILENO);
usr.sbin/nsd/nsd.c
1560
if (fd > 2)
usr.sbin/nsd/nsd.c
1561
(void)close(fd);
usr.sbin/nsd/nsd.c
597
int fd;
usr.sbin/nsd/nsd.c
603
if ((fd = open(file, O_RDONLY)) == -1) {
usr.sbin/nsd/nsd.c
607
if (((l = read(fd, pidbuf, sizeof(pidbuf)))) == -1) {
usr.sbin/nsd/nsd.c
609
close(fd);
usr.sbin/nsd/nsd.c
614
close(fd);
usr.sbin/nsd/nsd.c
637
int fd;
usr.sbin/nsd/nsd.c
645
if((fd = open(nsd->pidfile, O_WRONLY | O_CREAT | O_TRUNC
usr.sbin/nsd/nsd.c
656
ssize_t r = write(fd, pidbuf+count, strlen(pidbuf)-count);
usr.sbin/nsd/nsd.c
662
close(fd);
usr.sbin/nsd/nsd.c
668
close(fd);
usr.sbin/nsd/nsd.c
673
close(fd);
usr.sbin/nsd/nsd.c
681
int fd = -1;
usr.sbin/nsd/nsd.c
685
fd = open(file, O_WRONLY | O_TRUNC
usr.sbin/nsd/nsd.c
690
if (fd == -1) {
usr.sbin/nsd/nsd.c
702
close(fd);
usr.sbin/nsd/remote.c
139
int fd;
usr.sbin/nsd/remote.c
190
int fd;
usr.sbin/nsd/remote.c
223
remote_accept_callback(int fd, short event, void* arg);
usr.sbin/nsd/remote.c
227
remote_control_callback(int fd, short event, void* arg);
usr.sbin/nsd/remote.c
2837
ssize_t rr = read(res->fd, magic, sizeof(magic)-1);
usr.sbin/nsd/remote.c
2888
remote_handshake_later(struct daemon_remote* rc, struct rc_state* s, int fd,
usr.sbin/nsd/remote.c
2900
event_set(&s->c, fd, EV_PERSIST|EV_TIMEOUT|EV_READ,
usr.sbin/nsd/remote.c
2917
event_set(&s->c, fd, EV_PERSIST|EV_TIMEOUT|EV_WRITE,
usr.sbin/nsd/remote.c
2935
remote_control_callback(int fd, short event, void* arg)
usr.sbin/nsd/remote.c
2953
remote_handshake_later(rc, s, fd, r, r2);
usr.sbin/nsd/remote.c
2990
res.fd = fd;
usr.sbin/nsd/remote.c
445
int fd, r;
usr.sbin/nsd/remote.c
454
fd = create_local_accept_sock(ip, &noproto);
usr.sbin/nsd/remote.c
460
if(fd != -1) {
usr.sbin/nsd/remote.c
494
fd = create_tcp_accept_sock(res, &noproto);
usr.sbin/nsd/remote.c
498
if(fd == -1 && noproto) {
usr.sbin/nsd/remote.c
505
if(fd == -1) {
usr.sbin/nsd/remote.c
516
close(fd);
usr.sbin/nsd/remote.c
523
hl->c.ev_fd = fd;
usr.sbin/nsd/remote.c
555
int fd;
usr.sbin/nsd/remote.c
561
fd = p->c.ev_fd;
usr.sbin/nsd/remote.c
563
event_set(&p->c, fd, EV_PERSIST|EV_READ, remote_accept_callback,
usr.sbin/nsd/remote.c
574
remote_accept_callback(int fd, short event, void* arg)
usr.sbin/nsd/remote.c
594
newfd = accept(fd, (struct sockaddr*)&addr, &addrlen);
usr.sbin/nsd/remote.c
596
newfd = accept4(fd, (struct sockaddr*)&addr, &addrlen, SOCK_NONBLOCK);
usr.sbin/nsd/remote.c
638
n->fd = newfd;
usr.sbin/nsd/remote.c
751
if(write_socket(res->fd, text, strlen(text)) <= 0) {
usr.sbin/nsd/remote.c
807
ssize_t rr = read(res->fd, buf+len, 1);
usr.sbin/nsd/server.c
1715
nsd->xfrd_listener->fd = -1;
usr.sbin/nsd/server.c
1749
if(nsd->xfrd_listener->fd != -1)
usr.sbin/nsd/server.c
1750
close(nsd->xfrd_listener->fd);
usr.sbin/nsd/server.c
1813
nsd->xfrd_listener->fd = sockets[0];
usr.sbin/nsd/server.c
1865
int xfrd_sock = nsd->xfrd_listener->fd;
usr.sbin/nsd/server.c
1916
if(!write_socket(nsd->xfrd_listener->fd, &mypid, sizeof(mypid))) {
usr.sbin/nsd/server.c
2327
struct pollfd fd;
usr.sbin/nsd/server.c
2328
memset(&fd, 0, sizeof(fd));
usr.sbin/nsd/server.c
2329
fd.fd = s;
usr.sbin/nsd/server.c
2330
fd.events = POLLIN;
usr.sbin/nsd/server.c
2334
ret = poll(&fd, 1, (timeout==-1)?-1:timeout*1000);
usr.sbin/nsd/server.c
2654
xfrd_listener->fd) != 0) {
usr.sbin/nsd/server.c
2729
if(!write_socket(nsd->xfrd_listener->fd, &cmd, sizeof(cmd))) {
usr.sbin/nsd/server.c
2734
if(!write_socket(nsd->xfrd_listener->fd, &mypid, sizeof(mypid))) {
usr.sbin/nsd/server.c
2823
&nsd->xfrd_listener->fd) != 0) {
usr.sbin/nsd/server.c
2827
reload_listener.fd = -1;
usr.sbin/nsd/server.c
2853
&nsd->xfrd_listener->fd);
usr.sbin/nsd/server.c
2867
if(reload_listener.fd != -1) close(reload_listener.fd);
usr.sbin/nsd/server.c
2869
reload_listener.fd = -1;
usr.sbin/nsd/server.c
2873
if(!write_socket(nsd->xfrd_listener->fd,
usr.sbin/nsd/server.c
2880
if(!write_socket(nsd->xfrd_listener->fd, &mypid, sizeof(mypid))) {
usr.sbin/nsd/server.c
2954
&nsd->xfrd_listener->fd);
usr.sbin/nsd/server.c
2971
if(reload_listener.fd != -1) close(reload_listener.fd);
usr.sbin/nsd/server.c
2973
reload_listener.fd = -1;
usr.sbin/nsd/server.c
2977
if(!write_socket(nsd->xfrd_listener->fd,
usr.sbin/nsd/server.c
2984
if(!write_socket(nsd->xfrd_listener->fd, &mypid, sizeof(mypid))) {
usr.sbin/nsd/server.c
2996
if(!write_socket(nsd->xfrd_listener->fd,
usr.sbin/nsd/server.c
3068
reload_listener.fd = -1;
usr.sbin/nsd/server.c
3085
reload_listener.fd = reload_sockets[0];
usr.sbin/nsd/server.c
3108
if(!nsd->quit_sync_done && reload_listener.fd != -1) {
usr.sbin/nsd/server.c
3113
if(!write_socket(nsd->xfrd_listener->fd,
usr.sbin/nsd/server.c
3126
if(reload_listener.fd != -1) {
usr.sbin/nsd/server.c
3130
if(!write_socket(reload_listener.fd, &cmd, sizeof(cmd))) {
usr.sbin/nsd/server.c
3134
close(reload_listener.fd);
usr.sbin/nsd/server.c
3188
if(reload_listener.fd != -1) {
usr.sbin/nsd/server.c
3192
if(!write_socket(reload_listener.fd, &cmd, sizeof(cmd))) {
usr.sbin/nsd/server.c
3196
fsync(reload_listener.fd);
usr.sbin/nsd/server.c
3197
close(reload_listener.fd);
usr.sbin/nsd/server.c
3209
if(nsd->xfrd_listener->fd != -1) {
usr.sbin/nsd/server.c
3214
if(!write_socket(nsd->xfrd_listener->fd, &cmd, sizeof(cmd))) {
usr.sbin/nsd/server.c
3218
fsync(nsd->xfrd_listener->fd);
usr.sbin/nsd/server.c
3219
close(nsd->xfrd_listener->fd);
usr.sbin/nsd/server.c
326
static void handle_udp(int fd, short event, void* arg);
usr.sbin/nsd/server.c
337
static void handle_tcp_accept(int fd, short event, void* arg);
usr.sbin/nsd/server.c
344
static void handle_tcp_reading(int fd, short event, void* arg);
usr.sbin/nsd/server.c
3474
nsd->verifiers[i].output_stream.fd = -1;
usr.sbin/nsd/server.c
3476
nsd->verifiers[i].error_stream.fd = -1;
usr.sbin/nsd/server.c
351
static void handle_tcp_writing(int fd, short event, void* arg);
usr.sbin/nsd/server.c
355
static SSL* incoming_ssl_fd(SSL_CTX* ctx, int fd);
usr.sbin/nsd/server.c
359
static int tls_handshake(struct tcp_handler_data* data, int fd, int writing);
usr.sbin/nsd/server.c
366
static void handle_tls_reading(int fd, short event, void* arg);
usr.sbin/nsd/server.c
373
static void handle_tls_writing(int fd, short event, void* arg);
usr.sbin/nsd/server.c
377
static void handle_xdp(int fd, short event, void* arg);
usr.sbin/nsd/server.c
3837
static void remaining_tcp_timeout(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/server.c
3871
int fd = p->event.ev_fd;
usr.sbin/nsd/server.c
3904
event_set(&p->event, fd, EV_PERSIST | event | EV_TIMEOUT,
usr.sbin/nsd/server.c
4154
handle_udp(int fd, short event, void* arg)
usr.sbin/nsd/server.c
4164
recvcount = nsd_recvmmsg(fd, msgs, NUM_RECV_PER_SELECT, 0, NULL);
usr.sbin/nsd/server.c
4301
sent = nsd_sendmmsg(fd, &msgs[i], recvcount-i, 0);
usr.sbin/nsd/server.c
4310
if((flag = fcntl(fd, F_GETFL)) == -1) {
usr.sbin/nsd/server.c
4315
if(fcntl(fd, F_SETFL, flag) == -1)
usr.sbin/nsd/server.c
4317
sent = nsd_sendmmsg(fd, &msgs[i], recvcount-i, 0);
usr.sbin/nsd/server.c
4320
if(fcntl(fd, F_SETFL, flag) == -1)
usr.sbin/nsd/server.c
4373
int fd, short event)
usr.sbin/nsd/server.c
4384
event_set(&data->event, fd, event, fn, data);
usr.sbin/nsd/server.c
4438
more_read_buf_tcp(int fd, struct tcp_handler_data* data, void* bufpos,
usr.sbin/nsd/server.c
4441
*received = read(fd, bufpos, add_amount);
usr.sbin/nsd/server.c
446
nsd->children[i].handler->fd = -1;
usr.sbin/nsd/server.c
4472
handle_tcp_reading(int fd, short event, void* arg)
usr.sbin/nsd/server.c
4517
if(!more_read_buf_tcp(fd, data,
usr.sbin/nsd/server.c
4553
if(!more_read_buf_tcp(fd, data,
usr.sbin/nsd/server.c
4589
if(!more_read_buf_tcp(fd, data,
usr.sbin/nsd/server.c
4631
if(!more_read_buf_tcp(fd, data, buffer_current(data->query->packet),
usr.sbin/nsd/server.c
4740
event_set(&data->event, fd, EV_PERSIST | EV_WRITE | EV_TIMEOUT,
usr.sbin/nsd/server.c
4747
handle_tcp_writing(fd, EV_WRITE, data);
usr.sbin/nsd/server.c
4751
handle_tcp_writing(int fd, short event, void* arg)
usr.sbin/nsd/server.c
4778
sent = writev(fd, iov, 2);
usr.sbin/nsd/server.c
4780
sent = write(fd,
usr.sbin/nsd/server.c
4828
sent = write(fd,
usr.sbin/nsd/server.c
4894
event_set(&data->event, fd, EV_PERSIST | EV_WRITE | EV_TIMEOUT,
usr.sbin/nsd/server.c
4917
(void) shutdown(fd, SHUT_WR);
usr.sbin/nsd/server.c
4928
event_set(&data->event, fd, EV_PERSIST | EV_READ | EV_TIMEOUT,
usr.sbin/nsd/server.c
493
nsd->children[i].handler->fd = nsd->children[i].child_fd;
usr.sbin/nsd/server.c
4939
incoming_ssl_fd(SSL_CTX* ctx, int fd)
usr.sbin/nsd/server.c
4948
if(!SSL_set_fd(ssl, fd)) {
usr.sbin/nsd/server.c
4958
tls_handshake(struct tcp_handler_data* data, int fd, int writing)
usr.sbin/nsd/server.c
4963
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST|EV_TIMEOUT|EV_WRITE);
usr.sbin/nsd/server.c
4969
tcp_handler_setup_event(data, handle_tls_reading, fd, EV_PERSIST|EV_TIMEOUT|EV_READ);
usr.sbin/nsd/server.c
4994
tcp_handler_setup_event(data, handle_tls_reading, fd, EV_PERSIST|EV_TIMEOUT|EV_READ);
usr.sbin/nsd/server.c
5003
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST|EV_TIMEOUT|EV_WRITE);
usr.sbin/nsd/server.c
501
nsd->children[i].handler->fd = nsd->children[i].child_fd;
usr.sbin/nsd/server.c
5033
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST|EV_TIMEOUT|EV_WRITE);
usr.sbin/nsd/server.c
5035
tcp_handler_setup_event(data, handle_tls_reading, fd, EV_PERSIST|EV_TIMEOUT|EV_READ);
usr.sbin/nsd/server.c
5045
more_read_buf_tls(int fd, struct tcp_handler_data* data, void* bufpos,
usr.sbin/nsd/server.c
5070
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST | EV_WRITE | EV_TIMEOUT);
usr.sbin/nsd/server.c
5082
handle_tls_reading(int fd, short event, void* arg)
usr.sbin/nsd/server.c
5111
if(!tls_handshake(data, fd, 0))
usr.sbin/nsd/server.c
5132
if(!more_read_buf_tls(fd, data,
usr.sbin/nsd/server.c
5168
if(!more_read_buf_tls(fd, data,
usr.sbin/nsd/server.c
5201
if(!more_read_buf_tls(fd, data,
usr.sbin/nsd/server.c
5244
if(!more_read_buf_tls(fd, data, buffer_current(data->query->packet),
usr.sbin/nsd/server.c
5345
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST | EV_WRITE | EV_TIMEOUT);
usr.sbin/nsd/server.c
5348
handle_tls_writing(fd, EV_WRITE, data);
usr.sbin/nsd/server.c
5353
handle_tls_writing(int fd, short event, void* arg)
usr.sbin/nsd/server.c
5374
if(!tls_handshake(data, fd, 1))
usr.sbin/nsd/server.c
5426
tcp_handler_setup_event(data, handle_tls_reading, fd, EV_PERSIST | EV_READ | EV_TIMEOUT);
usr.sbin/nsd/server.c
5478
tcp_handler_setup_event(data, handle_tls_writing, fd, EV_PERSIST | EV_WRITE | EV_TIMEOUT);
usr.sbin/nsd/server.c
5496
(void) shutdown(fd, SHUT_WR);
usr.sbin/nsd/server.c
5502
tcp_handler_setup_event(data, handle_tls_reading, fd, EV_PERSIST | EV_READ | EV_TIMEOUT);
usr.sbin/nsd/server.c
5507
handle_slowaccept_timeout(int ATTR_UNUSED(fd), short ATTR_UNUSED(event),
usr.sbin/nsd/server.c
5516
static int perform_accept(int fd, struct sockaddr *addr, socklen_t *addrlen)
usr.sbin/nsd/server.c
5519
int s = accept(fd, addr, addrlen);
usr.sbin/nsd/server.c
5532
return accept4(fd, addr, addrlen, SOCK_NONBLOCK);
usr.sbin/nsd/server.c
5542
handle_tcp_accept(int fd, short event, void* arg)
usr.sbin/nsd/server.c
5571
s = perform_accept(fd, (struct sockaddr *) &addr, &addrlen);
usr.sbin/nsd/server.c
5733
static void handle_xdp(int fd, short event, void* arg) {
usr.sbin/nsd/server.c
5738
(void)fd;
usr.sbin/nsd/server.c
5807
int fd = handler->ev_fd;
usr.sbin/nsd/server.c
5812
event_set(handler, fd, event_types,
usr.sbin/nsd/udb.c
101
close(fd);
usr.sbin/nsd/udb.c
106
if((r=read(fd, &m, sizeof(m))) == -1) {
usr.sbin/nsd/udb.c
119
if((r=read(fd, &g, sizeof(g))) == -1) {
usr.sbin/nsd/udb.c
153
fsz = (uint64_t)lseek(fd, (off_t)0, SEEK_END);
usr.sbin/nsd/udb.c
154
(void)lseek(fd, (off_t)0, SEEK_SET);
usr.sbin/nsd/udb.c
178
(int)udb->fd, (off_t)0);
usr.sbin/nsd/udb.c
187
close(fd);
usr.sbin/nsd/udb.c
220
int fd = open(fname, O_RDWR);
usr.sbin/nsd/udb.c
221
if(fd == -1) {
usr.sbin/nsd/udb.c
225
return udb_base_create_fd(fname, fd, walkfunc, arg);
usr.sbin/nsd/udb.c
238
write_fdata(const char* fname, int fd, void* data, size_t len)
usr.sbin/nsd/udb.c
241
if((w=write(fd, data, len)) == -1) {
usr.sbin/nsd/udb.c
243
close(fd);
usr.sbin/nsd/udb.c
247
close(fd);
usr.sbin/nsd/udb.c
261
int fd = open(fname, O_CREAT|O_RDWR, 0600);
usr.sbin/nsd/udb.c
262
if(fd == -1) {
usr.sbin/nsd/udb.c
272
if(!write_fdata(fname, fd, &m, sizeof(m)))
usr.sbin/nsd/udb.c
274
if(!write_fdata(fname, fd, &g, sizeof(g)))
usr.sbin/nsd/udb.c
276
if(!write_fdata(fname, fd, &a, sizeof(a)))
usr.sbin/nsd/udb.c
278
if(!write_fdata(fname, fd, &endsize, sizeof(endsize)))
usr.sbin/nsd/udb.c
280
if(!write_fdata(fname, fd, &endexp, sizeof(endexp)))
usr.sbin/nsd/udb.c
283
if(lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
usr.sbin/nsd/udb.c
285
close(fd);
usr.sbin/nsd/udb.c
289
if(ftruncate(fd, (off_t)g.fsize) < 0) {
usr.sbin/nsd/udb.c
292
close(fd);
usr.sbin/nsd/udb.c
295
return udb_base_create_fd(fname, fd, walkfunc, arg);
usr.sbin/nsd/udb.c
309
if(ftruncate(udb->fd, (off_t)nsize) != 0) {
usr.sbin/nsd/udb.c
320
if(udb->fd != -1 && udb->base && udb->alloc) {
usr.sbin/nsd/udb.c
325
if(udb->fd != -1) {
usr.sbin/nsd/udb.c
327
close(udb->fd);
usr.sbin/nsd/udb.c
328
udb->fd = -1;
usr.sbin/nsd/udb.c
354
if(udb->fd != -1) {
usr.sbin/nsd/udb.c
355
close(udb->fd);
usr.sbin/nsd/udb.c
356
udb->fd = -1;
usr.sbin/nsd/udb.c
539
(int)MAP_SHARED, (int)udb->fd, (off_t)0);
usr.sbin/nsd/udb.c
545
(int)MAP_SHARED, (int)udb->fd, (off_t)0);
usr.sbin/nsd/udb.c
591
if((w=pwrite(udb->fd, &z, sizeof(z), (off_t)(nsize-1))) == -1) {
usr.sbin/nsd/udb.c
593
if(lseek(udb->fd, (off_t)(nsize-1), SEEK_SET) == -1) {
usr.sbin/nsd/udb.c
597
if((w=write(udb->fd, &z, sizeof(z))) == -1) {
usr.sbin/nsd/udb.c
674
realsize = lseek(udb->fd, (off_t)0, SEEK_END);
usr.sbin/nsd/udb.c
71
udb_base_create_fd(const char* fname, int fd, udb_walk_relptr_func walkfunc,
usr.sbin/nsd/udb.c
80
close(fd);
usr.sbin/nsd/udb.c
87
close(fd);
usr.sbin/nsd/udb.c
92
udb->fd = fd;
usr.sbin/nsd/udb.h
188
int fd;
usr.sbin/nsd/udb.h
370
udb_base* udb_base_create_fd(const char* fname, int fd,
usr.sbin/nsd/verify.c
133
static void verify_handle_stream(int fd, short event, void *arg)
usr.sbin/nsd/verify.c
144
if (fd == verifier->output_stream.fd) {
usr.sbin/nsd/verify.c
147
assert(fd == verifier->error_stream.fd);
usr.sbin/nsd/verify.c
152
assert(stream->fd != -1);
usr.sbin/nsd/verify.c
162
close(stream->fd);
usr.sbin/nsd/verify.c
163
stream->fd = -1;
usr.sbin/nsd/verify.c
183
if (stream->fd == -1)
usr.sbin/nsd/verify.c
185
verify_handle_stream(stream->fd, EV_READ, verifier);
usr.sbin/nsd/verify.c
186
if (stream->fd == -1)
usr.sbin/nsd/verify.c
189
close(stream->fd);
usr.sbin/nsd/verify.c
190
stream->fd = -1;
usr.sbin/nsd/verify.c
220
static void verify_handle_feed(int fd, short event, void *arg)
usr.sbin/nsd/verify.c
225
(void)fd;
usr.sbin/nsd/verify.c
249
void verify_handle_timeout(int fd, short event, void *arg)
usr.sbin/nsd/verify.c
253
(void)fd;
usr.sbin/nsd/verify.c
290
void verify_handle_exit(int fd, short event, void *arg)
usr.sbin/nsd/verify.c
302
if(read(fd, buf, sizeof(buf)) == -1) {
usr.sbin/nsd/verify.c
367
verify_handle_command(int fd, short event, void *arg)
usr.sbin/nsd/verify.c
382
if((len = read(fd, &mode, sizeof(mode))) == -1) {
usr.sbin/nsd/verify.c
508
verifier->error_stream.fd = fderr;
usr.sbin/nsd/verify.c
513
verifier->error_stream.fd,
usr.sbin/nsd/verify.c
524
verifier->output_stream.fd = fdout;
usr.sbin/nsd/verify.c
529
verifier->output_stream.fd,
usr.sbin/nsd/verify.c
602
verifier->output_stream.fd = -1;
usr.sbin/nsd/verify.c
605
verifier->error_stream.fd = -1;
usr.sbin/nsd/verify.c
65
assert(stream->fd != -1);
usr.sbin/nsd/verify.c
79
cnt = read(stream->fd, stream->buf + stream->cnt, LOGBUFSIZE - stream->cnt);
usr.sbin/nsd/verify.h
49
int fd;
usr.sbin/nsd/verify.h
76
void verify_handle_exit(int fd, short event, void *arg);
usr.sbin/nsd/verify.h
78
void verify_handle_command(int fd, short event, void *arg);
usr.sbin/nsd/xdp-server.c
300
int fd;
usr.sbin/nsd/xdp-server.c
304
fd = bpf_obj_get(map_path);
usr.sbin/nsd/xdp-server.c
305
if (fd < 0) {
usr.sbin/nsd/xdp-server.c
307
return fd;
usr.sbin/nsd/xdp-server.c
311
if ((ret = bpf_map__reuse_fd(map, fd))) {
usr.sbin/nsd/xdp-server.c
316
xdp->xsk_map_fd = fd;
usr.sbin/nsd/xdp-util.c
31
int fd, rc;
usr.sbin/nsd/xdp-util.c
34
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/nsd/xdp-util.c
35
if (fd < 0) {
usr.sbin/nsd/xdp-util.c
42
rc = ioctl(fd, SIOCETHTOOL, &ifr);
usr.sbin/nsd/xdp-util.c
45
close(fd);
usr.sbin/nsd/xdp-util.c
68
close(fd);
usr.sbin/nsd/xfrd-notify.c
29
static void xfrd_handle_notify_send(int fd, short event, void* arg);
usr.sbin/nsd/xfrd-notify.c
302
int fd = xfrd_send_udp(zone->pkts[index].dest, packet,
usr.sbin/nsd/xfrd-notify.c
304
if(fd == -1) {
usr.sbin/nsd/xfrd-notify.c
311
zone->notify_send6_handler.ev_fd = fd;
usr.sbin/nsd/xfrd-notify.c
312
else zone->notify_send_handler.ev_fd = fd;
usr.sbin/nsd/xfrd-notify.c
320
int fd;
usr.sbin/nsd/xfrd-notify.c
325
fd = zone->notify_send6_handler.ev_fd;
usr.sbin/nsd/xfrd-notify.c
327
fd = zone->notify_send_handler.ev_fd;
usr.sbin/nsd/xfrd-notify.c
334
if(sendto(fd,
usr.sbin/nsd/xfrd-notify.c
390
int fd = zone->notify_send_handler.ev_fd;
usr.sbin/nsd/xfrd-notify.c
397
event_set(&zone->notify_send_handler, fd, EV_READ | EV_TIMEOUT,
usr.sbin/nsd/xfrd-notify.c
406
int fd = zone->notify_send6_handler.ev_fd;
usr.sbin/nsd/xfrd-notify.c
413
event_set(&zone->notify_send6_handler, fd, EV_READ | EV_TIMEOUT,
usr.sbin/nsd/xfrd-notify.c
424
xfrd_handle_notify_send(int fd, short event, void* arg)
usr.sbin/nsd/xfrd-notify.c
438
assert(fd != -1);
usr.sbin/nsd/xfrd-notify.c
439
if(xfrd_udp_read_packet(packet, fd, (struct sockaddr*)&src,
usr.sbin/nsd/xfrd-tcp.c
1034
close(fd);
usr.sbin/nsd/xfrd-tcp.c
1060
close(fd);
usr.sbin/nsd/xfrd-tcp.c
1068
close(fd);
usr.sbin/nsd/xfrd-tcp.c
1078
event_set(&tp->handler, fd, EV_PERSIST|EV_TIMEOUT|EV_READ|
usr.sbin/nsd/xfrd-tcp.c
1238
sent = writev(tcp->fd, iov, 2);
usr.sbin/nsd/xfrd-tcp.c
1240
sent = write(tcp->fd,
usr.sbin/nsd/xfrd-tcp.c
1272
sent = write(tcp->fd,
usr.sbin/nsd/xfrd-tcp.c
1309
if(getsockopt(tcp->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0){
usr.sbin/nsd/xfrd-tcp.c
1505
received = read(tcp->fd,
usr.sbin/nsd/xfrd-tcp.c
1545
received = read(tcp->fd, buffer_current(tcp->packet),
usr.sbin/nsd/xfrd-tcp.c
1752
if(tp->tcp_r->fd != -1)
usr.sbin/nsd/xfrd-tcp.c
1753
close(tp->tcp_r->fd);
usr.sbin/nsd/xfrd-tcp.c
1754
tp->tcp_r->fd = -1;
usr.sbin/nsd/xfrd-tcp.c
1755
tp->tcp_w->fd = -1;
usr.sbin/nsd/xfrd-tcp.c
188
if(!SSL_set_fd(tp->ssl, tp->tcp_w->fd)) {
usr.sbin/nsd/xfrd-tcp.c
623
tcp_state->fd = -1;
usr.sbin/nsd/xfrd-tcp.c
744
int fd = tp->handler.ev_fd;
usr.sbin/nsd/xfrd-tcp.c
751
event_set(&tp->handler, fd, EV_PERSIST|EV_TIMEOUT|EV_READ|
usr.sbin/nsd/xfrd-tcp.c
770
xfrd_handle_tcp_pipe(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/xfrd-tcp.c
841
if(set->tcp_state[i]->tcp_r->fd == -1) {
usr.sbin/nsd/xfrd-tcp.c
910
int fd, family, conn;
usr.sbin/nsd/xfrd-tcp.c
942
fd = socket(family, SOCK_STREAM, IPPROTO_TCP);
usr.sbin/nsd/xfrd-tcp.c
943
if(fd == -1) {
usr.sbin/nsd/xfrd-tcp.c
952
if(fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
usr.sbin/nsd/xfrd-tcp.c
954
close(fd);
usr.sbin/nsd/xfrd-tcp.c
961
if(setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG,
usr.sbin/nsd/xfrd-tcp.c
975
if (!xfrd_bind_local_interface(fd, zone->zone_options->pattern->
usr.sbin/nsd/xfrd-tcp.c
977
close(fd);
usr.sbin/nsd/xfrd-tcp.c
982
conn = connect(fd, (struct sockaddr*)&tp->key.ip, tp->key.ip_len);
usr.sbin/nsd/xfrd-tcp.c
986
close(fd);
usr.sbin/nsd/xfrd-tcp.c
990
tp->tcp_r->fd = fd;
usr.sbin/nsd/xfrd-tcp.c
991
tp->tcp_w->fd = fd;
usr.sbin/nsd/xfrd-tcp.h
204
void xfrd_handle_tcp_pipe(int fd, short event, void* arg);
usr.sbin/nsd/xfrd-tcp.h
72
int fd;
usr.sbin/nsd/xfrd.c
1151
xfrd_handle_zone(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/nsd/xfrd.c
1335
int fd;
usr.sbin/nsd/xfrd.c
1337
fd = xfrd_send_ixfr_request_udp(zone);
usr.sbin/nsd/xfrd.c
1338
if(fd == -1)
usr.sbin/nsd/xfrd.c
1345
event_set(&zone->zone_handler, fd,
usr.sbin/nsd/xfrd.c
1462
int fd = zone->zone_handler.ev_fd;
usr.sbin/nsd/xfrd.c
1463
int fl = ((fd == -1)?EV_TIMEOUT:zone->zone_handler_flags);
usr.sbin/nsd/xfrd.c
1477
else fd = -1;
usr.sbin/nsd/xfrd.c
1481
event_set(&zone->zone_handler, fd, fl, xfrd_handle_zone, zone);
usr.sbin/nsd/xfrd.c
1619
xfrd_udp_read_packet(buffer_type* packet, int fd, struct sockaddr* src,
usr.sbin/nsd/xfrd.c
1626
received = recvfrom(fd, buffer_begin(packet), buffer_remaining(packet),
usr.sbin/nsd/xfrd.c
1667
int fd = xfrd_send_ixfr_request_udp(wz);
usr.sbin/nsd/xfrd.c
1668
if(fd != -1) {
usr.sbin/nsd/xfrd.c
1673
event_set(&wz->zone_handler, fd,
usr.sbin/nsd/xfrd.c
1783
int fd, family;
usr.sbin/nsd/xfrd.c
1799
fd = socket(family, SOCK_DGRAM, IPPROTO_UDP);
usr.sbin/nsd/xfrd.c
1800
if(fd == -1) {
usr.sbin/nsd/xfrd.c
1807
if (!xfrd_bind_local_interface(fd, ifc, acl, 0)) {
usr.sbin/nsd/xfrd.c
1811
close(fd);
usr.sbin/nsd/xfrd.c
1816
if(sendto(fd,
usr.sbin/nsd/xfrd.c
1823
close(fd);
usr.sbin/nsd/xfrd.c
1826
return fd;
usr.sbin/nsd/xfrd.c
1934
int fd, apex_compress = 0;
usr.sbin/nsd/xfrd.c
1961
if((fd = xfrd_send_udp(zone->master, xfrd->packet,
usr.sbin/nsd/xfrd.c
1969
return fd;
usr.sbin/nsd/xfrd.c
199
int fd = nsd->serve2xfrd_fd_recv[i];
usr.sbin/nsd/xfrd.c
200
xfrd->notify_pipes[i].fd = fd;
usr.sbin/nsd/xfrd.c
202
event_set(&xfrd->notify_events[i], fd,
usr.sbin/nsd/xfrd.c
2753
xfrd_handle_reload(int ATTR_UNUSED(fd), short event, void* ATTR_UNUSED(arg))
usr.sbin/nsd/xfrd.c
3086
xfrd_handle_write_timer(int ATTR_UNUSED(fd), short event, void* ATTR_UNUSED(arg))
usr.sbin/nsd/xfrd.c
3123
static void xfrd_handle_child_timer(int ATTR_UNUSED(fd), short event,
usr.sbin/nsd/xfrd.c
92
static void xfrd_handle_reload(int fd, short event, void* arg);
usr.sbin/nsd/xfrd.c
94
static void xfrd_handle_child_timer(int fd, short event, void* arg);
usr.sbin/nsd/xfrd.h
414
int xfrd_udp_read_packet(buffer_type* packet, int fd, struct sockaddr* src,
usr.sbin/nsd/xfrd.h
483
void xfrd_handle_zone(int fd, short event, void* arg);
usr.sbin/ntpd/client.c
102
if (p->query.fd != -1) {
usr.sbin/ntpd/client.c
103
close(p->query.fd);
usr.sbin/ntpd/client.c
104
p->query.fd = -1;
usr.sbin/ntpd/client.c
150
if (p->query.fd == -1) {
usr.sbin/ntpd/client.c
155
if ((p->query.fd = socket(p->addr->ss.ss_family, SOCK_DGRAM,
usr.sbin/ntpd/client.c
160
if (bind(p->query.fd, qa4, SA_LEN(qa4)) == -1)
usr.sbin/ntpd/client.c
164
if (bind(p->query.fd, qa6, SA_LEN(qa6)) == -1)
usr.sbin/ntpd/client.c
169
if (connect(p->query.fd, sa, SA_LEN(sa)) == -1) {
usr.sbin/ntpd/client.c
185
if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query.fd,
usr.sbin/ntpd/client.c
189
if (setsockopt(p->query.fd, SOL_SOCKET, SO_TIMESTAMP,
usr.sbin/ntpd/client.c
212
if (ntp_sendmsg(p->query.fd, NULL, &p->query.msg) == -1) {
usr.sbin/ntpd/client.c
298
if ((size = recvmsg(p->query.fd, &somsg, 0)) == -1) {
usr.sbin/ntpd/client.c
54
p->query.fd = -1;
usr.sbin/ntpd/client.c
93
p->query.fd = -1;
usr.sbin/ntpd/config.c
182
p->fd = -1;
usr.sbin/ntpd/constraint.c
272
cstr->fd = pipes[0];
usr.sbin/ntpd/constraint.c
273
if (imsgbuf_init(&cstr->ibuf, cstr->fd) == -1)
usr.sbin/ntpd/constraint.c
403
cstr.fd = CONSTRAINT_PASSFD;
usr.sbin/ntpd/constraint.c
404
if (imsgbuf_init(&cstr.ibuf, cstr.fd) == -1)
usr.sbin/ntpd/constraint.c
496
priv_constraint_close(cstr->fd, fail);
usr.sbin/ntpd/constraint.c
527
constraint_byfd(int fd)
usr.sbin/ntpd/constraint.c
532
if (cstr->fd == fd)
usr.sbin/ntpd/constraint.c
579
priv_constraint_close(int fd, int fail)
usr.sbin/ntpd/constraint.c
584
if ((cstr = constraint_byfd(fd)) == NULL) {
usr.sbin/ntpd/constraint.c
585
log_warn("%s: fd %d: not found", __func__, fd);
usr.sbin/ntpd/constraint.c
609
if (cstr->fd != -1)
usr.sbin/ntpd/constraint.c
610
close(cstr->fd);
usr.sbin/ntpd/constraint.c
634
if ((cstr = constraint_byfd(pfd->fd)) == NULL)
usr.sbin/ntpd/constraint.c
643
priv_constraint_close(pfd->fd, cstr->state !=
usr.sbin/ntpd/constraint.c
650
priv_constraint_close(pfd->fd, 1);
usr.sbin/ntpd/constraint.c
98
cstr->fd = -1;
usr.sbin/ntpd/control.c
101
close(fd);
usr.sbin/ntpd/control.c
106
session_socket_nonblockmode(fd);
usr.sbin/ntpd/control.c
108
return (fd);
usr.sbin/ntpd/control.c
112
control_listen(int fd)
usr.sbin/ntpd/control.c
114
if (fd != -1 && listen(fd, CONTROL_BACKLOG) == -1) {
usr.sbin/ntpd/control.c
123
control_shutdown(int fd)
usr.sbin/ntpd/control.c
125
close(fd);
usr.sbin/ntpd/control.c
165
control_connbyfd(int fd)
usr.sbin/ntpd/control.c
170
if (c->ibuf.fd == fd)
usr.sbin/ntpd/control.c
178
control_close(int fd)
usr.sbin/ntpd/control.c
182
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ntpd/control.c
183
log_warn("control_close: fd %d: not found", fd);
usr.sbin/ntpd/control.c
190
close(c->ibuf.fd);
usr.sbin/ntpd/control.c
209
if ((c = control_connbyfd(pfd->fd)) == NULL) {
usr.sbin/ntpd/control.c
210
log_warn("control_dispatch_msg: fd %d: not found", pfd->fd);
usr.sbin/ntpd/control.c
216
*ctl_cnt -= control_close(pfd->fd);
usr.sbin/ntpd/control.c
224
*ctl_cnt -= control_close(pfd->fd);
usr.sbin/ntpd/control.c
230
*ctl_cnt -= control_close(pfd->fd);
usr.sbin/ntpd/control.c
301
session_socket_nonblockmode(int fd)
usr.sbin/ntpd/control.c
305
if ((flags = fcntl(fd, F_GETFL)) == -1)
usr.sbin/ntpd/control.c
310
if ((flags = fcntl(fd, F_SETFL, flags)) == -1)
usr.sbin/ntpd/control.c
43
int fd;
usr.sbin/ntpd/control.c
49
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/ntpd/control.c
54
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == 0) {
usr.sbin/ntpd/control.c
56
close(fd);
usr.sbin/ntpd/control.c
60
close(fd);
usr.sbin/ntpd/control.c
69
int fd;
usr.sbin/ntpd/control.c
72
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) {
usr.sbin/ntpd/control.c
86
close(fd);
usr.sbin/ntpd/control.c
91
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/ntpd/control.c
93
close(fd);
usr.sbin/ntpd/ntp.c
236
pfd[PFD_PIPE_MAIN].fd = ibuf_main->fd;
usr.sbin/ntpd/ntp.c
238
pfd[PFD_PIPE_DNS].fd = ibuf_dns->fd;
usr.sbin/ntpd/ntp.c
240
pfd[PFD_SOCK_CTL].fd = fd_ctl;
usr.sbin/ntpd/ntp.c
245
pfd[i].fd = la->fd;
usr.sbin/ntpd/ntp.c
295
p->query.fd != -1) {
usr.sbin/ntpd/ntp.c
296
pfd[i].fd = p->query.fd;
usr.sbin/ntpd/ntp.c
343
pfd[i].fd = cc->ibuf.fd;
usr.sbin/ntpd/ntp.c
405
if (server_dispatch(pfd[j].fd, conf) == -1) {
usr.sbin/ntpd/ntp.h
113
int fd;
usr.sbin/ntpd/ntp_dns.c
110
pfd[0].fd = ibuf_dns->fd;
usr.sbin/ntpd/ntp_msg.c
43
ntp_sendmsg(int fd, struct sockaddr *sa, struct ntp_msg *msg)
usr.sbin/ntpd/ntp_msg.c
53
n = sendto(fd, msg, sizeof(*msg), 0, sa, sa_len);
usr.sbin/ntpd/ntpd.c
306
pfd[PFD_PIPE].fd = ibuf->fd;
usr.sbin/ntpd/ntpd.c
313
pfd[i].fd = cstr->fd;
usr.sbin/ntpd/ntpd.c
361
close(ibuf->fd);
usr.sbin/ntpd/ntpd.c
562
int fd;
usr.sbin/ntpd/ntpd.c
565
fd = open(DRIFTFILE, O_RDWR);
usr.sbin/ntpd/ntpd.c
566
if (fd == -1) {
usr.sbin/ntpd/ntpd.c
575
freqfp = fdopen(fd, "r+");
usr.sbin/ntpd/ntpd.c
618
int fd, n, done, ch, action;
usr.sbin/ntpd/ntpd.c
664
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
usr.sbin/ntpd/ntpd.c
672
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1)
usr.sbin/ntpd/ntpd.c
680
if (imsgbuf_init(ibuf_ctl, fd) == -1)
usr.sbin/ntpd/ntpd.c
767
close(fd);
usr.sbin/ntpd/ntpd.h
112
int fd;
usr.sbin/ntpd/ntpd.h
203
int fd;
usr.sbin/ntpd/parse.y
126
la->fd = -1;
usr.sbin/ntpd/server.c
119
if ((la->fd = socket(la->sa.ss_family, SOCK_DGRAM, 0)) == -1)
usr.sbin/ntpd/server.c
122
if (la->sa.ss_family == AF_INET && setsockopt(la->fd,
usr.sbin/ntpd/server.c
127
setsockopt(la->fd, SOL_SOCKET, SO_RTABLE, &la->rtable,
usr.sbin/ntpd/server.c
131
if (bind(la->fd, (struct sockaddr *)&la->sa,
usr.sbin/ntpd/server.c
135
close(la->fd);
usr.sbin/ntpd/server.c
152
server_dispatch(int fd, struct ntpd_conf *lconf)
usr.sbin/ntpd/server.c
162
if ((size = recvfrom(fd, &buf, sizeof(buf), 0,
usr.sbin/ntpd/server.c
201
ntp_sendmsg(fd, (struct sockaddr *)&fsa, &reply);
usr.sbin/ocspcheck/http.c
197
if (http->fd != -1) {
usr.sbin/ocspcheck/http.c
198
if (close(http->fd) == -1)
usr.sbin/ocspcheck/http.c
202
http->fd = -1;
usr.sbin/ocspcheck/http.c
224
int family, fd, c;
usr.sbin/ocspcheck/http.c
268
fd = socket(family, SOCK_STREAM, 0);
usr.sbin/ocspcheck/http.c
269
if (fd == -1) {
usr.sbin/ocspcheck/http.c
272
} else if (connect(fd, (struct sockaddr *)&ss, len) == -1) {
usr.sbin/ocspcheck/http.c
274
close(fd);
usr.sbin/ocspcheck/http.c
283
close(fd);
usr.sbin/ocspcheck/http.c
286
http->fd = fd;
usr.sbin/ocspcheck/http.c
317
if (tls_connect_socket(http->ctx, http->fd, http->host) != 0) {
usr.sbin/ocspcheck/http.c
56
int fd; /* connected socket */
usr.sbin/ocspcheck/http.c
73
rc = read(http->fd, buf, sz);
usr.sbin/ocspcheck/http.c
84
rc = write(http->fd, buf, sz);
usr.sbin/ospf6d/control.c
100
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/ospf6d/control.c
102
close(fd);
usr.sbin/ospf6d/control.c
110
close(fd);
usr.sbin/ospf6d/control.c
115
return (fd);
usr.sbin/ospf6d/control.c
119
control_listen(int fd)
usr.sbin/ospf6d/control.c
121
control_state.fd = fd;
usr.sbin/ospf6d/control.c
123
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/ospf6d/control.c
128
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/ospf6d/control.c
187
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/ospf6d/control.c
195
control_connbyfd(int fd)
usr.sbin/ospf6d/control.c
200
if (c->iev.ibuf.fd == fd)
usr.sbin/ospf6d/control.c
221
control_close(int fd)
usr.sbin/ospf6d/control.c
225
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ospf6d/control.c
226
log_warn("control_close: fd %d: not found", fd);
usr.sbin/ospf6d/control.c
234
close(c->iev.ibuf.fd);
usr.sbin/ospf6d/control.c
246
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ospf6d/control.c
254
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ospf6d/control.c
255
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/ospf6d/control.c
261
control_close(fd);
usr.sbin/ospf6d/control.c
267
control_close(fd);
usr.sbin/ospf6d/control.c
274
control_close(fd);
usr.sbin/ospf6d/control.c
46
int fd;
usr.sbin/ospf6d/control.c
53
int fd;
usr.sbin/ospf6d/control.c
59
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/ospf6d/control.c
64
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) {
usr.sbin/ospf6d/control.c
66
close(fd);
usr.sbin/ospf6d/control.c
70
close(fd);
usr.sbin/ospf6d/control.c
79
int fd;
usr.sbin/ospf6d/control.c
82
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/ospf6d/control.c
95
close(fd);
usr.sbin/ospf6d/database.c
373
db_tx_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/interface.c
299
iface->fd = xconf->ospf_socket;
usr.sbin/ospf6d/interface.c
309
if_hello_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/interface.c
341
if_wait_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/interface.c
711
if_set_sockbuf(int fd)
usr.sbin/ospf6d/interface.c
716
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/ospf6d/interface.c
724
while (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bsize,
usr.sbin/ospf6d/interface.c
745
if (setsockopt(iface->fd, IPPROTO_IPV6, IPV6_JOIN_GROUP,
usr.sbin/ospf6d/interface.c
779
if (setsockopt(iface->fd, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
usr.sbin/ospf6d/interface.c
805
if (setsockopt(iface->fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
usr.sbin/ospf6d/interface.c
826
if_set_mcast_loop(int fd)
usr.sbin/ospf6d/interface.c
830
if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
usr.sbin/ospf6d/interface.c
841
if_set_ipv6_pktinfo(int fd, int enable)
usr.sbin/ospf6d/interface.c
843
if (setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &enable,
usr.sbin/ospf6d/interface.c
853
if_set_ipv6_checksum(int fd)
usr.sbin/ospf6d/interface.c
858
if (setsockopt(fd, IPPROTO_IPV6, IPV6_CHECKSUM, &offset,
usr.sbin/ospf6d/kroute.c
1110
send_rtmsg(int fd, int action, struct kroute *kroute)
usr.sbin/ospf6d/kroute.c
120
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/ospf6d/kroute.c
1229
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/ospf6d/kroute.c
127
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/ospf6d/kroute.c
1325
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/ospf6d/kroute.c
137
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_PRIOFILTER, &filter_prio,
usr.sbin/ospf6d/kroute.c
143
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_FLAGFILTER, &filter_flags,
usr.sbin/ospf6d/kroute.c
151
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ospf6d/kroute.c
1525
rv = send_rtmsg(kr_state.fd,
usr.sbin/ospf6d/kroute.c
157
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ospf6d/kroute.c
173
event_set(&kr_state.ev, kr_state.fd, EV_READ | EV_PERSIST,
usr.sbin/ospf6d/kroute.c
243
if (send_rtmsg(kr_state.fd, action, &kroute[i]) == -1)
usr.sbin/ospf6d/kroute.c
315
if (send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r) == -1)
usr.sbin/ospf6d/kroute.c
364
send_rtmsg(kr_state.fd, RTM_ADD, &kn->r);
usr.sbin/ospf6d/kroute.c
381
send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r);
usr.sbin/ospf6d/kroute.c
389
kr_fib_reload_timer(int fd, short event, void *bula)
usr.sbin/ospf6d/kroute.c
435
if (send_rtmsg(kr_state.fd,
usr.sbin/ospf6d/kroute.c
462
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/ospf6d/kroute.c
50
int fd;
usr.sbin/ospf6d/kroute.c
643
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_PRIOFILTER, &filter_prio,
usr.sbin/ospf6d/lsack.c
235
ls_ack_tx_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/lsreq.c
191
ls_req_tx_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/lsupdate.c
441
ls_retrans_timer(int fd, short event, void *bula)
usr.sbin/ospf6d/neighbor.c
391
nbr_itimer(int fd, short event, void *arg)
usr.sbin/ospf6d/neighbor.c
433
nbr_adj_timer(int fd, short event, void *arg)
usr.sbin/ospf6d/ospf6d.c
267
event_set(&iev_ospfe->ev, iev_ospfe->ibuf.fd, iev_ospfe->events,
usr.sbin/ospf6d/ospf6d.c
272
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ospf6d/ospf6d.c
306
close(iev_ospfe->ibuf.fd);
usr.sbin/ospf6d/ospf6d.c
308
close(iev_rde->ibuf.fd);
usr.sbin/ospf6d/ospf6d.c
336
main_dispatch_ospfe(int fd, short event, void *bula)
usr.sbin/ospf6d/ospf6d.c
414
main_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ospf6d/ospf6d.c
481
main_imsg_compose_ospfe_fd(int type, pid_t pid, int fd)
usr.sbin/ospf6d/ospf6d.c
485
imsg_compose_event(iev_ospfe, type, 0, pid, fd, NULL, 0);
usr.sbin/ospf6d/ospf6d.c
504
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ospf6d/ospf6d.c
510
pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ospf6d/ospf6d.c
515
pid, fd, data, datalen)) != -1)
usr.sbin/ospf6d/ospf6d.h
317
int fd;
usr.sbin/ospf6d/ospfe.c
168
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ospf6d/ospfe.c
173
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ospf6d/ospfe.c
221
close(iev_rde->ibuf.fd);
usr.sbin/ospf6d/ospfe.c
224
close(iev_main->ibuf.fd);
usr.sbin/ospf6d/ospfe.c
251
ospfe_dispatch_main(int fd, short event, void *bula)
usr.sbin/ospf6d/ospfe.c
414
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/ospf6d/ospfe.c
418
control_listen(fd);
usr.sbin/ospf6d/ospfe.c
439
ospfe_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ospf6d/packet.c
105
if (sendto(iface->fd, ibuf_data(buf), ibuf_size(buf), 0,
usr.sbin/ospf6d/packet.c
116
recv_packet(int fd, short event, void *bula)
usr.sbin/ospf6d/packet.c
155
if ((r = recvmsg(fd, &msg, 0)) == -1) {
usr.sbin/ospf6d/parse.y
946
check_file_secrecy(int fd, const char *fname)
usr.sbin/ospf6d/parse.y
950
if (fstat(fd, &st)) {
usr.sbin/ospf6d/rde.c
191
event_set(&iev_ospfe->ev, iev_ospfe->ibuf.fd, iev_ospfe->events,
usr.sbin/ospf6d/rde.c
196
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ospf6d/rde.c
226
close(iev_ospfe->ibuf.fd);
usr.sbin/ospf6d/rde.c
228
close(iev_main->ibuf.fd);
usr.sbin/ospf6d/rde.c
261
rde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ospf6d/rde.c
642
rde_dispatch_parent(int fd, short event, void *bula)
usr.sbin/ospf6d/rde_lsdb.c
807
lsa_timeout(int fd, short event, void *bula)
usr.sbin/ospf6d/rde_spf.c
633
spf_timer(int fd, short event, void *arg)
usr.sbin/ospfd/control.c
100
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/ospfd/control.c
102
close(fd);
usr.sbin/ospfd/control.c
110
close(fd);
usr.sbin/ospfd/control.c
115
return (fd);
usr.sbin/ospfd/control.c
119
control_listen(int fd)
usr.sbin/ospfd/control.c
121
control_state.fd = fd;
usr.sbin/ospfd/control.c
123
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/ospfd/control.c
128
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/ospfd/control.c
187
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/ospfd/control.c
195
control_connbyfd(int fd)
usr.sbin/ospfd/control.c
200
if (c->iev.ibuf.fd == fd)
usr.sbin/ospfd/control.c
221
control_close(int fd)
usr.sbin/ospfd/control.c
225
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ospfd/control.c
226
log_warn("control_close: fd %d: not found", fd);
usr.sbin/ospfd/control.c
234
close(c->iev.ibuf.fd);
usr.sbin/ospfd/control.c
246
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ospfd/control.c
254
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ospfd/control.c
255
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/ospfd/control.c
261
control_close(fd);
usr.sbin/ospfd/control.c
267
control_close(fd);
usr.sbin/ospfd/control.c
274
control_close(fd);
usr.sbin/ospfd/control.c
46
int fd;
usr.sbin/ospfd/control.c
53
int fd;
usr.sbin/ospfd/control.c
59
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/ospfd/control.c
64
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) {
usr.sbin/ospfd/control.c
66
close(fd);
usr.sbin/ospfd/control.c
70
close(fd);
usr.sbin/ospfd/control.c
79
int fd;
usr.sbin/ospfd/control.c
82
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/ospfd/control.c
95
close(fd);
usr.sbin/ospfd/database.c
386
db_tx_timer(int fd, short event, void *arg)
usr.sbin/ospfd/interface.c
253
iface->fd = xconf->ospf_socket;
usr.sbin/ospfd/interface.c
260
if_hello_timer(int fd, short event, void *arg)
usr.sbin/ospfd/interface.c
295
if_wait_timer(int fd, short event, void *arg)
usr.sbin/ospfd/interface.c
664
if_set_recvif(int fd, int enable)
usr.sbin/ospfd/interface.c
666
if (setsockopt(fd, IPPROTO_IP, IP_RECVIF, &enable,
usr.sbin/ospfd/interface.c
675
if_set_sockbuf(int fd)
usr.sbin/ospfd/interface.c
680
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/ospfd/interface.c
688
while (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bsize,
usr.sbin/ospfd/interface.c
738
if (setsockopt(iface->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
usr.sbin/ospfd/interface.c
787
if (setsockopt(iface->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
usr.sbin/ospfd/interface.c
818
if (setsockopt(iface->fd, IPPROTO_IP, IP_MULTICAST_IF,
usr.sbin/ospfd/interface.c
839
if_set_mcast_loop(int fd)
usr.sbin/ospfd/interface.c
843
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
usr.sbin/ospfd/interface.c
853
if_set_ip_hdrincl(int fd)
usr.sbin/ospfd/interface.c
857
if (setsockopt(fd, IPPROTO_IP, IP_HDRINCL, &hincl, sizeof(hincl)) == -1) {
usr.sbin/ospfd/kroute.c
1181
send_rtmsg(int fd, int action, struct kroute *kroute)
usr.sbin/ospfd/kroute.c
1265
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/ospfd/kroute.c
1362
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/ospfd/kroute.c
142
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/ospfd/kroute.c
149
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/ospfd/kroute.c
1558
rv = send_rtmsg(kr_state.fd,
usr.sbin/ospfd/kroute.c
159
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_PRIOFILTER, &filter_prio,
usr.sbin/ospfd/kroute.c
164
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_FLAGFILTER, &filter_flags,
usr.sbin/ospfd/kroute.c
172
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ospfd/kroute.c
178
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ospfd/kroute.c
192
event_set(&kr_state.ev, kr_state.fd, EV_READ | EV_PERSIST,
usr.sbin/ospfd/kroute.c
261
if (send_rtmsg(kr_state.fd, action, &kroute[i]) == -1)
usr.sbin/ospfd/kroute.c
313
if (send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r) == -1)
usr.sbin/ospfd/kroute.c
362
send_rtmsg(kr_state.fd, RTM_ADD, &kn->r);
usr.sbin/ospfd/kroute.c
379
send_rtmsg(kr_state.fd, RTM_DELETE, &kn->r);
usr.sbin/ospfd/kroute.c
387
kr_fib_reload_timer(int fd, short event, void *bula)
usr.sbin/ospfd/kroute.c
432
if (send_rtmsg(kr_state.fd,
usr.sbin/ospfd/kroute.c
459
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/ospfd/kroute.c
49
int fd;
usr.sbin/ospfd/kroute.c
652
if (setsockopt(kr_state.fd, AF_ROUTE, ROUTE_PRIOFILTER, &filter_prio,
usr.sbin/ospfd/lsack.c
237
ls_ack_tx_timer(int fd, short event, void *arg)
usr.sbin/ospfd/lsreq.c
193
ls_req_tx_timer(int fd, short event, void *arg)
usr.sbin/ospfd/lsupdate.c
434
ls_retrans_timer(int fd, short event, void *bula)
usr.sbin/ospfd/neighbor.c
387
nbr_itimer(int fd, short event, void *arg)
usr.sbin/ospfd/neighbor.c
429
nbr_adj_timer(int fd, short event, void *arg)
usr.sbin/ospfd/ospfd.c
276
event_set(&iev_ospfe->ev, iev_ospfe->ibuf.fd, iev_ospfe->events,
usr.sbin/ospfd/ospfd.c
281
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ospfd/ospfd.c
321
close(iev_ospfe->ibuf.fd);
usr.sbin/ospfd/ospfd.c
323
close(iev_rde->ibuf.fd);
usr.sbin/ospfd/ospfd.c
355
main_dispatch_ospfe(int fd, short event, void *bula)
usr.sbin/ospfd/ospfd.c
443
main_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ospfd/ospfd.c
511
main_imsg_compose_ospfe_fd(int type, pid_t pid, int fd)
usr.sbin/ospfd/ospfd.c
514
imsg_compose_event(iev_ospfe, type, 0, pid, fd, NULL, 0);
usr.sbin/ospfd/ospfd.c
532
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ospfd/ospfd.c
538
pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ospfd/ospfd.c
543
pid, fd, data, datalen)) != -1)
usr.sbin/ospfd/ospfd.c
707
tx_iface.fd = iface->fd;
usr.sbin/ospfd/ospfd.h
351
int fd;
usr.sbin/ospfd/ospfe.c
168
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ospfd/ospfe.c
173
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ospfd/ospfe.c
233
close(iev_rde->ibuf.fd);
usr.sbin/ospfd/ospfe.c
236
close(iev_main->ibuf.fd);
usr.sbin/ospfd/ospfe.c
263
ospfe_dispatch_main(int fd, short event, void *bula)
usr.sbin/ospfd/ospfe.c
465
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/ospfd/ospfe.c
469
control_listen(fd);
usr.sbin/ospfd/ospfe.c
490
ospfe_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ospfd/packet.c
100
if (sendmsg(iface->fd, &msg, 0) == -1) {
usr.sbin/ospfd/packet.c
110
recv_packet(int fd, short event, void *bula)
usr.sbin/ospfd/packet.c
147
if ((r = recvmsg(fd, &msg, 0)) == -1) {
usr.sbin/ospfd/parse.y
1135
check_file_secrecy(int fd, const char *fname)
usr.sbin/ospfd/parse.y
1139
if (fstat(fd, &st)) {
usr.sbin/ospfd/rde.c
173
event_set(&iev_ospfe->ev, iev_ospfe->ibuf.fd, iev_ospfe->events,
usr.sbin/ospfd/rde.c
178
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ospfd/rde.c
212
close(iev_ospfe->ibuf.fd);
usr.sbin/ospfd/rde.c
214
close(iev_main->ibuf.fd);
usr.sbin/ospfd/rde.c
248
rde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ospfd/rde.c
642
rde_dispatch_parent(int fd, short event, void *bula)
usr.sbin/ospfd/rde_lsdb.c
658
lsa_timeout(int fd, short event, void *bula)
usr.sbin/ospfd/rde_spf.c
513
spf_timer(int fd, short event, void *arg)
usr.sbin/pcidump/pcidump.c
1166
int fd;
usr.sbin/pcidump/pcidump.c
1168
fd = open(_PATH_MEM, O_RDONLY);
usr.sbin/pcidump/pcidump.c
1169
if (fd == -1)
usr.sbin/pcidump/pcidump.c
1176
if (pread(fd, bios, VGA_BIOS_LEN, VGA_BIOS_ADDR) == -1)
usr.sbin/pppd/auth.c
737
int fd;
usr.sbin/pppd/auth.c
739
if ((fd = open(_PATH_LASTLOG, O_RDWR)) >= 0) {
usr.sbin/pppd/auth.c
743
(void)pwrite(fd, &ll, sizeof(ll), (off_t)pw->pw_uid *
usr.sbin/pppd/auth.c
745
(void)close(fd);
usr.sbin/pppd/options.c
260
static int readable(int fd);
usr.sbin/pppd/options.c
690
readable(int fd)
usr.sbin/pppd/options.c
700
if (fstat(fd, &sbuf) != 0)
usr.sbin/pppd/sys-bsd.c
1414
int fd, n;
usr.sbin/pppd/sys-bsd.c
1423
while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) == -1) {
usr.sbin/pppd/sys-bsd.c
1425
&& (fd = open(lock_file, O_RDONLY)) >= 0) {
usr.sbin/pppd/sys-bsd.c
1427
n = read(fd, hdb_lock_buffer, 11);
usr.sbin/pppd/sys-bsd.c
1430
close(fd);
usr.sbin/pppd/sys-bsd.c
1440
close(fd);
usr.sbin/pppd/sys-bsd.c
1451
close(fd);
usr.sbin/pppd/sys-bsd.c
1460
write(fd, hdb_lock_buffer, 11);
usr.sbin/pppd/sys-bsd.c
1462
close(fd);
usr.sbin/pppd/sys-bsd.c
234
establish_ppp(int fd)
usr.sbin/pppd/sys-bsd.c
252
if (ioctl(fd, TIOCGETD, &initdisc) == -1) {
usr.sbin/pppd/sys-bsd.c
256
if (ioctl(fd, TIOCSETD, &pppdisc) == -1) {
usr.sbin/pppd/sys-bsd.c
265
if (ioctl(fd, PPPIOCGUNIT, &ifunit) == -1) {
usr.sbin/pppd/sys-bsd.c
273
if (ioctl(fd, PPPIOCGUNIT, &x) == -1) {
usr.sbin/pppd/sys-bsd.c
286
ppp_fd = fd;
usr.sbin/pppd/sys-bsd.c
292
if (ioctl(fd, PPPIOCGFLAGS, (caddr_t) &x) == -1) {
usr.sbin/pppd/sys-bsd.c
296
if (ioctl(fd, PPPIOCSFLAGS, (caddr_t) &x) == -1)
usr.sbin/pppd/sys-bsd.c
304
if ((initfdflags = fcntl(fd, F_GETFL)) == -1
usr.sbin/pppd/sys-bsd.c
305
|| fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) {
usr.sbin/pppd/sys-bsd.c
351
disestablish_ppp(int fd)
usr.sbin/pppd/sys-bsd.c
354
if (initfdflags != -1 && fcntl(fd, F_SETFL, initfdflags) == -1)
usr.sbin/pppd/sys-bsd.c
359
if (initdisc >= 0 && ioctl(fd, TIOCSETD, &initdisc) == -1)
usr.sbin/pppd/sys-bsd.c
363
if (fd == ppp_fd)
usr.sbin/pppd/sys-bsd.c
407
set_up_tty(int fd, int local)
usr.sbin/pppd/sys-bsd.c
411
if (tcgetattr(fd, &tios) == -1) {
usr.sbin/pppd/sys-bsd.c
418
ioctl(fd, TIOCGWINSZ, &wsinfo);
usr.sbin/pppd/sys-bsd.c
459
if (tcsetattr(fd, TCSAFLUSH, &tios) == -1) {
usr.sbin/pppd/sys-bsd.c
471
restore_tty(int fd)
usr.sbin/pppd/sys-bsd.c
483
if (tcsetattr(fd, TCSAFLUSH, &inittermios) == -1)
usr.sbin/pppd/sys-bsd.c
486
ioctl(fd, TIOCSWINSZ, &wsinfo);
usr.sbin/pppd/sys-bsd.c
496
setdtr(int fd, int on)
usr.sbin/pppd/sys-bsd.c
500
ioctl(fd, (on? TIOCMBIS: TIOCMBIC), &modembits);
usr.sbin/pwd_mkdb/pwd_mkdb.c
230
if (fchown(edp->fd(edp), -1, shadow) != 0)
usr.sbin/pwd_mkdb/pwd_mkdb.c
233
else if (fchmod(edp->fd(edp), PERM_SECURE|S_IRGRP) != 0)
usr.sbin/quot/quot.c
103
if (pread(fd, cgp, super->fs_cgsize,
usr.sbin/quot/quot.c
106
if (read(fd, cgp, super->fs_cgsize) !=
usr.sbin/quot/quot.c
115
if (lseek(fd, (off_t)ino_to_fsba(super, last)
usr.sbin/quot/quot.c
117
read(fd, ipbuf, INOSZ(super)) != INOSZ(super)) {
usr.sbin/quot/quot.c
313
dofsizes(int fd, struct fs *super, char *name)
usr.sbin/quot/quot.c
324
if ((dp = get_inode(fd, super, inode))
usr.sbin/quot/quot.c
366
douser(int fd, struct fs *super, char *name)
usr.sbin/quot/quot.c
378
if ((dp = get_inode(fd,super,inode))
usr.sbin/quot/quot.c
407
donames(int fd, struct fs *super, char *name)
usr.sbin/quot/quot.c
428
if ((dp = get_inode(fd, super, inode)) && !isfree(super, dp)) {
usr.sbin/quot/quot.c
494
int i, fd;
usr.sbin/quot/quot.c
504
if ((fd = open(name, O_RDONLY)) < 0) {
usr.sbin/quot/quot.c
509
if (lseek(fd, sblock_try[i], 0) != sblock_try[i]) {
usr.sbin/quot/quot.c
510
close(fd);
usr.sbin/quot/quot.c
513
if (read(fd, superblock, SBLOCKSIZE) != SBLOCKSIZE) {
usr.sbin/quot/quot.c
514
close(fd);
usr.sbin/quot/quot.c
527
close(fd);
usr.sbin/quot/quot.c
535
(*func)(fd, fs, name);
usr.sbin/quot/quot.c
536
close(fd);
usr.sbin/quot/quot.c
77
get_inode(int fd, struct fs *super, ino_t ino)
usr.sbin/quot/quot.c
85
if (fd < 0) { /* flush cache */
usr.sbin/rad/control.c
103
control_listen(int fd)
usr.sbin/rad/control.c
105
if (control_state.fd != -1)
usr.sbin/rad/control.c
108
control_state.fd = fd;
usr.sbin/rad/control.c
109
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/rad/control.c
114
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/rad/control.c
166
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/rad/control.c
174
control_connbyfd(int fd)
usr.sbin/rad/control.c
179
if (c->iev.ibuf.fd == fd)
usr.sbin/rad/control.c
200
control_close(int fd)
usr.sbin/rad/control.c
204
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/rad/control.c
205
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/rad/control.c
213
close(c->iev.ibuf.fd);
usr.sbin/rad/control.c
225
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/rad/control.c
232
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/rad/control.c
233
log_warnx("%s: fd %d: not found", __func__, fd);
usr.sbin/rad/control.c
239
control_close(fd);
usr.sbin/rad/control.c
245
control_close(fd);
usr.sbin/rad/control.c
252
control_close(fd);
usr.sbin/rad/control.c
45
int fd;
usr.sbin/rad/control.c
46
} control_state = {.fd = -1};
usr.sbin/rad/control.c
63
int fd;
usr.sbin/rad/control.c
66
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/rad/control.c
79
close(fd);
usr.sbin/rad/control.c
84
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/rad/control.c
86
close(fd);
usr.sbin/rad/control.c
94
close(fd);
usr.sbin/rad/control.c
99
return (fd);
usr.sbin/rad/control.h
20
int control_listen(int fd);
usr.sbin/rad/engine.c
144
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/rad/engine.c
165
close(iev_frontend->ibuf.fd);
usr.sbin/rad/engine.c
167
close(iev_main->ibuf.fd);
usr.sbin/rad/engine.c
186
engine_dispatch_frontend(int fd, short event, void *bula)
usr.sbin/rad/engine.c
265
engine_dispatch_main(int fd, short event, void *bula)
usr.sbin/rad/engine.c
313
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/rad/engine.c
321
if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1)
usr.sbin/rad/engine.c
326
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
usr.sbin/rad/engine.c
655
iface_timeout(int fd, short events, void *arg)
usr.sbin/rad/frontend.c
1484
route_receive(int fd, short events, void *arg)
usr.sbin/rad/frontend.c
1498
if ((n = read(fd, buf, ROUTE_SOCKET_BUF_SIZE)) == -1) {
usr.sbin/rad/frontend.c
249
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/rad/frontend.c
281
close(iev_engine->ibuf.fd);
usr.sbin/rad/frontend.c
284
close(iev_main->ibuf.fd);
usr.sbin/rad/frontend.c
310
frontend_dispatch_main(int fd, short event, void *bula)
usr.sbin/rad/frontend.c
354
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/rad/frontend.c
363
if (imsgbuf_init(&iev_engine->ibuf, fd) == -1)
usr.sbin/rad/frontend.c
368
event_set(&iev_engine->ev, iev_engine->ibuf.fd,
usr.sbin/rad/frontend.c
514
if ((fd = imsg_get_fd(&imsg)) == -1)
usr.sbin/rad/frontend.c
519
control_listen(fd);
usr.sbin/rad/frontend.c
538
frontend_dispatch_engine(int fd, short event, void *bula)
usr.sbin/rad/frontend.c
618
icmp6_receive(int fd, short events, void *arg)
usr.sbin/rad/frontend.c
630
if ((len = recvmsg(fd, &icmp6ev->rcvmhdr, 0)) == -1) {
usr.sbin/rad/parse.y
825
check_file_secrecy(int fd, const char *fname)
usr.sbin/rad/parse.y
829
if (fstat(fd, &st)) {
usr.sbin/rad/rad.c
254
event_set(&iev_frontend->ev, iev_frontend->ibuf.fd,
usr.sbin/rad/rad.c
259
event_set(&iev_engine->ev, iev_engine->ibuf.fd, iev_engine->events,
usr.sbin/rad/rad.c
306
close(iev_frontend->ibuf.fd);
usr.sbin/rad/rad.c
308
close(iev_engine->ibuf.fd);
usr.sbin/rad/rad.c
332
start_child(enum rad_process p, char *argv0, int fd, int debug, int verbose)
usr.sbin/rad/rad.c
344
close(fd);
usr.sbin/rad/rad.c
348
if (fd != 3) {
usr.sbin/rad/rad.c
349
if (dup2(fd, 3) == -1)
usr.sbin/rad/rad.c
351
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/rad/rad.c
376
main_dispatch_frontend(int fd, short event, void *bula)
usr.sbin/rad/rad.c
447
main_dispatch_engine(int fd, short event, void *bula)
usr.sbin/rad/rad.c
496
main_imsg_compose_frontend(int type, int fd, void *data, uint16_t datalen)
usr.sbin/rad/rad.c
499
return (imsg_compose_event(iev_frontend, type, 0, 0, fd, data,
usr.sbin/rad/rad.c
521
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/rad/rad.c
527
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/rad/rad.c
531
if ((ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data,
usr.sbin/radiusd/control.c
105
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/radiusd/control.c
110
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/radiusd/control.c
179
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, c->iev.handler, c);
usr.sbin/radiusd/control.c
186
control_connbyfd(int fd)
usr.sbin/radiusd/control.c
191
if (c->iev.ibuf.fd == fd)
usr.sbin/radiusd/control.c
212
control_close(int fd)
usr.sbin/radiusd/control.c
216
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/radiusd/control.c
217
log_warn("control_close: fd %d: not found", fd);
usr.sbin/radiusd/control.c
234
close(c->iev.ibuf.fd);
usr.sbin/radiusd/control.c
247
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/radiusd/control.c
254
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/radiusd/control.c
255
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/radiusd/control.c
261
control_close(fd);
usr.sbin/radiusd/control.c
267
control_close(fd);
usr.sbin/radiusd/control.c
274
control_close(fd);
usr.sbin/radiusd/control.c
53
int fd;
usr.sbin/radiusd/control.c
60
int fd;
usr.sbin/radiusd/control.c
63
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/radiusd/control.c
76
close(fd);
usr.sbin/radiusd/control.c
81
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/radiusd/control.c
83
close(fd);
usr.sbin/radiusd/control.c
91
close(fd);
usr.sbin/radiusd/control.c
96
control_state.fd = fd;
usr.sbin/radiusd/imsg_subr.c
41
fds[0].fd = ibuf->fd;
usr.sbin/radiusd/imsg_subr.c
67
fds[0].fd = ibuf->fd;
usr.sbin/radiusd/radiusd.c
1124
uint32_t type, uint32_t id, pid_t pid, int fd, void *data, size_t datalen)
usr.sbin/radiusd/radiusd.c
1134
module->fd < 0)
usr.sbin/radiusd/radiusd.c
1137
if (imsg_compose(&module->ibuf, type, id, pid, fd, data,
usr.sbin/radiusd/radiusd.c
1189
module->fd = pairsock[0];
usr.sbin/radiusd/radiusd.c
1190
if ((ival = fcntl(module->fd, F_GETFL)) == -1) {
usr.sbin/radiusd/radiusd.c
1195
if (fcntl(module->fd, F_SETFL, ival | O_NONBLOCK) == -1) {
usr.sbin/radiusd/radiusd.c
1203
if (imsgbuf_init(&module->ibuf, module->fd) == -1) {
usr.sbin/radiusd/radiusd.c
1247
RADIUSD_ASSERT(module->fd >= 0);
usr.sbin/radiusd/radiusd.c
1274
event_set(&module->ev, module->fd, EV_READ, radiusd_module_on_imsg_io,
usr.sbin/radiusd/radiusd.c
1295
if (module->fd >= 0) {
usr.sbin/radiusd/radiusd.c
1305
if (module->fd >= 0) {
usr.sbin/radiusd/radiusd.c
1308
close(module->fd);
usr.sbin/radiusd/radiusd.c
1309
module->fd = -1;
usr.sbin/radiusd/radiusd.c
1322
radiusd_module_on_imsg_io(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd.c
1354
RADIUSD_ASSERT(module->fd >= 0);
usr.sbin/radiusd/radiusd.c
1372
event_set(&module->ev, module->fd, evmask, radiusd_module_on_imsg_io,
usr.sbin/radiusd/radiusd.c
1805
if (module->fd < 0) {
usr.sbin/radiusd/radiusd.c
1827
if (module->fd < 0) {
usr.sbin/radiusd/radiusd.c
1911
int fd;
usr.sbin/radiusd/radiusd.c
1913
if ((fd = open(_PATH_DEVNULL, O_RDWR)) != -1) {
usr.sbin/radiusd/radiusd.c
1914
dup2(fd, STDIN_FILENO);
usr.sbin/radiusd/radiusd.c
1915
dup2(fd, STDOUT_FILENO);
usr.sbin/radiusd/radiusd.c
1916
dup2(fd, STDERR_FILENO);
usr.sbin/radiusd/radiusd.c
1917
if (fd > STDERR_FILENO)
usr.sbin/radiusd/radiusd.c
1918
close(fd);
usr.sbin/radiusd/radiusd.c
1935
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/radiusd/radiusd.c
1941
pid_t pid, int fd, void *data, size_t datalen)
usr.sbin/radiusd/radiusd.c
1946
pid, fd, data, datalen)) != -1)
usr.sbin/radiusd/radiusd.c
1953
pid_t pid, int fd, struct iovec *iov, int niov)
usr.sbin/radiusd/radiusd.c
1958
pid, fd, iov, niov)) != -1)
usr.sbin/radiusd/radiusd.c
406
radiusd_listen_on_event(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd.c
902
radiusd_on_sigterm(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd.c
909
radiusd_on_sigint(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd.c
916
radiusd_on_sighup(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd.c
922
radiusd_on_sigchld(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd_bsdauth.c
407
start_child(char *argv0, int fd)
usr.sbin/radiusd/radiusd_bsdauth.c
419
close(fd);
usr.sbin/radiusd/radiusd_bsdauth.c
423
if (fd != 3) {
usr.sbin/radiusd/radiusd_bsdauth.c
424
if (dup2(fd, 3) == -1)
usr.sbin/radiusd/radiusd_bsdauth.c
426
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/radiusd/radiusd_eap2mschap.c
218
eap2mschap_on_eapt(int fd, short ev, void *ctx)
usr.sbin/radiusd/radiusd_file.c
262
start_child(char *argv0, int fd)
usr.sbin/radiusd/radiusd_file.c
274
close(fd);
usr.sbin/radiusd/radiusd_file.c
278
if (fd != 3) {
usr.sbin/radiusd/radiusd_file.c
279
if (dup2(fd, 3) == -1)
usr.sbin/radiusd/radiusd_file.c
281
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/radiusd/radiusd_ipcp.c
1448
fchown(db->fd(db), pw->pw_uid, pw->pw_gid);
usr.sbin/radiusd/radiusd_ipcp.c
1614
ipcp_on_timer(int fd, short ev, void *ctx)
usr.sbin/radiusd/radiusd_ipcp.c
1721
ipcp_dae_request_on_timeout(int fd, short ev, void *ctx)
usr.sbin/radiusd/radiusd_ipcp.c
1740
ipcp_dae_on_event(int fd, short ev, void *ctx)
usr.sbin/radiusd/radiusd_ipcp.c
1859
ipcp_dae_send_pending_requests(int fd, short ev, void *ctx)
usr.sbin/radiusd/radiusd_local.h
177
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
180
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
183
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
186
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
189
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
192
((_m)->fd >= 0 && \
usr.sbin/radiusd/radiusd_local.h
76
int fd;
usr.sbin/radiusd/radiusd_module.c
124
if ((ival = fcntl(base->ibuf.fd, F_GETFL)) == -1)
usr.sbin/radiusd/radiusd_module.c
126
if (fcntl(base->ibuf.fd, F_SETFL, ival | O_NONBLOCK) == -1)
usr.sbin/radiusd/radiusd_module.c
128
event_set(&base->ev, base->ibuf.fd, EV_READ, module_on_event, base);
usr.sbin/radiusd/radiusd_module.c
626
close(base->ibuf.fd);
usr.sbin/radiusd/radiusd_module.c
631
module_on_event(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd_module.c
677
event_set(&base->ev, base->ibuf.fd, evmask, module_on_event, base);
usr.sbin/radiusd/radiusd_module.c
685
pid_t pid, int fd, const void *data, size_t datalen)
usr.sbin/radiusd/radiusd_module.c
689
if ((ret = imsg_compose(&base->ibuf, type, id, pid, fd, data, datalen))
usr.sbin/radiusd/radiusd_module.c
698
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/radiusd/radiusd_module.c
702
if ((ret = imsg_composev(&base->ibuf, type, id, pid, fd, iov, iovcnt))
usr.sbin/radiusd/radiusd_radius.c
401
radius_server_on_event(int fd, short evmask, void *ctx)
usr.sbin/radiusd/radiusd_radius.c
552
module_radius_req_on_timeout(int fd, short evmask, void *ctx)
usr.sbin/rarpd/rarpd.c
164
int fd;
usr.sbin/rarpd/rarpd.c
171
fd = rarp_open(ifname);
usr.sbin/rarpd/rarpd.c
172
if (fd < 0)
usr.sbin/rarpd/rarpd.c
182
p->ii_fd = fd;
usr.sbin/rarpd/rarpd.c
246
int fd, immediate;
usr.sbin/rarpd/rarpd.c
250
if ((fd = open("/dev/bpf", O_RDWR)) == -1)
usr.sbin/rarpd/rarpd.c
255
if (ioctl(fd, BIOCIMMEDIATE, &immediate) == -1) {
usr.sbin/rarpd/rarpd.c
260
if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) == -1) {
usr.sbin/rarpd/rarpd.c
262
close(fd);
usr.sbin/rarpd/rarpd.c
272
if (ioctl(fd, BIOCGDLT, (caddr_t) &dlt) == -1)
usr.sbin/rarpd/rarpd.c
276
close(fd);
usr.sbin/rarpd/rarpd.c
282
if (ioctl(fd, BIOCSETF, (caddr_t)&filter) == -1)
usr.sbin/rarpd/rarpd.c
284
return fd;
usr.sbin/rarpd/rarpd.c
329
int cc, fd, numfd = 0, i;
usr.sbin/rarpd/rarpd.c
362
pfd[i].fd = ii->ii_fd;
usr.sbin/rarpd/rarpd.c
375
fd = ii->ii_fd;
usr.sbin/rarpd/rarpd.c
377
cc = read(fd, (char *)buf, bufsize);
usr.sbin/rbootd/rbootd.c
149
fd = BpfOpen();
usr.sbin/rbootd/rbootd.c
195
pfd[0].fd = fd;
usr.sbin/rbootd/rbootd.c
83
int c, fd;
usr.sbin/rdate/ntp.c
185
sync_ntp(int fd, const struct sockaddr *peer, double *offset, double *error)
usr.sbin/rdate/ntp.c
198
if (connect(fd, peer, SA_LEN(peer)) == -1) {
usr.sbin/rdate/ntp.c
211
if (write_packet(fd, &data) < 0)
usr.sbin/rdate/ntp.c
214
ret = read_packet(fd, &data, &x, &y);
usr.sbin/rdate/ntp.c
268
write_packet(int fd, struct ntp_data *data)
usr.sbin/rdate/ntp.c
299
length = write(fd, packet, sizeof(packet));
usr.sbin/rdate/ntp.c
316
read_packet(int fd, struct ntp_data *data, double *off, double *error)
usr.sbin/rdate/ntp.c
323
pfd[0].fd = fd;
usr.sbin/rdate/ntp.c
340
length = read(fd, receive, NTP_PACKET_MAX);
usr.sbin/relayd/agentx_control.c
466
int fd;
usr.sbin/relayd/agentx_control.c
468
fd = imsg_get_fd(imsg);
usr.sbin/relayd/agentx_control.c
469
if (fd == -1)
usr.sbin/relayd/agentx_control.c
473
event_set(&(env->sc_agentxev), fd, EV_READ | EV_PERSIST,
usr.sbin/relayd/agentx_control.c
477
agentx_connect(sa, fd);
usr.sbin/relayd/agentx_control.c
485
agentx_sock(int fd, short event, void *arg)
usr.sbin/relayd/agentx_control.c
493
event_set(&(env->sc_agentxev), fd, EV_READ | EV_PERSIST,
usr.sbin/relayd/ca.c
194
ca_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/ca.c
224
ca_dispatch_relay(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/ca.c
432
pfd[0].fd = imsgbuf->fd;
usr.sbin/relayd/ca.c
621
pfd[0].fd = imsgbuf->fd;
usr.sbin/relayd/check_tls.c
144
check_tls_handshake(int fd, short event, void *arg)
usr.sbin/relayd/config.c
833
int fd;
usr.sbin/relayd/config.c
839
if ((fd = dup(ofd)) == -1)
usr.sbin/relayd/config.c
841
if (proc_compose_imsg(ps, id, n, IMSG_CFG_RELAY_FD, -1, fd,
usr.sbin/relayd/config.c
857
int fd, n, m;
usr.sbin/relayd/config.c
893
if ((fd = dup(rlay->rl_s)) == -1)
usr.sbin/relayd/config.c
896
IMSG_CFG_RELAY, -1, fd, iov, c) != 0) {
usr.sbin/relayd/control.c
178
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/relayd/control.c
186
control_connbyfd(int fd)
usr.sbin/relayd/control.c
191
if (c->iev.ibuf.fd == fd)
usr.sbin/relayd/control.c
199
control_close(int fd, struct control_sock *cs)
usr.sbin/relayd/control.c
203
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/relayd/control.c
204
log_warn("%s: fd %d not found", __func__, fd);
usr.sbin/relayd/control.c
212
close(c->iev.ibuf.fd);
usr.sbin/relayd/control.c
224
control_dispatch_imsg(int fd, short event, void *arg)
usr.sbin/relayd/control.c
235
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/relayd/control.c
236
log_warn("%s: fd %d not found", __func__, fd);
usr.sbin/relayd/control.c
246
control_close(fd, cs);
usr.sbin/relayd/control.c
253
control_close(fd, cs);
usr.sbin/relayd/control.c
260
control_close(fd, cs);
usr.sbin/relayd/control.c
271
control_close(fd, cs);
usr.sbin/relayd/control.c
48
int fd;
usr.sbin/relayd/control.c
54
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) {
usr.sbin/relayd/control.c
63
close(fd);
usr.sbin/relayd/control.c
70
close(fd);
usr.sbin/relayd/control.c
82
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/relayd/control.c
84
close(fd);
usr.sbin/relayd/control.c
92
close(fd);
usr.sbin/relayd/control.c
97
cs->cs_fd = fd;
usr.sbin/relayd/hce.c
130
hce_launch_checks(int fd, short event, void *arg)
usr.sbin/relayd/hce.c
286
hce_dispatch_pfe(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/hce.c
345
hce_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/hce.c
382
hce_dispatch_relay(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/parse.y
2910
check_file_secrecy(int fd, const char *fname)
usr.sbin/relayd/parse.y
2914
if (fstat(fd, &st)) {
usr.sbin/relayd/pfe.c
121
pfe_dispatch_hce(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/pfe.c
200
pfe_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/pfe.c
264
pfe_dispatch_relay(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/pfe.c
453
cid = c->iev.ibuf.fd;
usr.sbin/relayd/pfe.c
817
pfe_statistics(int fd, short events, void *arg)
usr.sbin/relayd/proc.c
113
fd = ps->ps_pipes[p->p_id][i].pp_pipes[PROC_PARENT][0];
usr.sbin/relayd/proc.c
122
if (fd != PROC_PARENT_SOCK_FILENO) {
usr.sbin/relayd/proc.c
123
if (dup2(fd, PROC_PARENT_SOCK_FILENO) ==
usr.sbin/relayd/proc.c
126
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/relayd/proc.c
134
close(fd);
usr.sbin/relayd/proc.c
163
event_set(&iev->ev, iev->ibuf.fd, iev->events,
usr.sbin/relayd/proc.c
246
proc_accept(struct privsep *ps, int fd, enum privsep_procid dst,
usr.sbin/relayd/proc.c
252
if (fd == -1 || dst < 0 || dst >= PROC_MAX ||
usr.sbin/relayd/proc.c
264
close(fd);
usr.sbin/relayd/proc.c
270
pp->pp_pipes[dst][n] = fd;
usr.sbin/relayd/proc.c
273
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/relayd/proc.c
276
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/relayd/proc.c
589
proc_dispatch(int fd, short event, void *arg)
usr.sbin/relayd/proc.c
644
if ((p->p_cb)(fd, p, &imsg) == 0) {
usr.sbin/relayd/proc.c
686
proc_dispatch_null(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/proc.c
708
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/relayd/proc.c
714
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/relayd/proc.c
719
pid, fd, data, datalen)) == -1)
usr.sbin/relayd/proc.c
727
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/relayd/proc.c
732
pid, fd, iov, iovcnt)) == -1)
usr.sbin/relayd/proc.c
753
uint16_t type, uint32_t peerid, int fd, void *data, uint16_t datalen)
usr.sbin/relayd/proc.c
760
type, peerid, ps->ps_instance + 1, fd, data, datalen) == -1)
usr.sbin/relayd/proc.c
776
uint16_t type, uint32_t peerid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/relayd/proc.c
78
int fd;
usr.sbin/relayd/proc.c
783
type, peerid, ps->ps_instance + 1, fd, iov, iovcnt) == -1)
usr.sbin/relayd/relay.c
1108
relay_accept(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
1124
if ((s = accept_reserve(fd, (struct sockaddr *)&ss,
usr.sbin/relayd/relay.c
1415
relay_natlook(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
1505
relay_bindany(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
1529
relay_connect_retry(int fd, short sig, void *arg)
usr.sbin/relayd/relay.c
1859
relay_dispatch_pfe(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relay.c
1983
relay_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relay.c
2000
relay_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relay.c
2084
relay_dispatch_hce(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relay.c
2432
relay_tls_handshake(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
2484
relay_connected(fd, EV_WRITE, con);
usr.sbin/relayd/relay.c
2503
event_again(&con->se_ev, fd, EV_TIMEOUT|retry_flag, relay_tls_handshake,
usr.sbin/relayd/relay.c
2524
relay_tls_readcb(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
2586
relay_tls_writecb(int fd, short event, void *arg)
usr.sbin/relayd/relay.c
373
relay_statistics(int fd, short events, void *arg)
usr.sbin/relayd/relay.c
541
struct protocol *proto, int fd, int reuseport)
usr.sbin/relayd/relay.c
549
s = fd == -1 ? socket(ss->ss_family,
usr.sbin/relayd/relay.c
550
SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_TCP) : fd;
usr.sbin/relayd/relay.c
643
struct protocol *proto, int fd)
usr.sbin/relayd/relay.c
647
if ((s = relay_socket(ss, port, proto, fd, 0)) == -1)
usr.sbin/relayd/relay.c
684
relay_connected(int fd, short sig, void *arg)
usr.sbin/relayd/relay.c
704
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
usr.sbin/relayd/relay.c
765
bev = bufferevent_new(fd, outrd, outwr, relay_error, &con->se_out);
usr.sbin/relayd/relay_udp.c
178
relay_udp_response(int fd, short sig, void *arg)
usr.sbin/relayd/relay_udp.c
190
relay_udp_timeout(fd, sig, arg);
usr.sbin/relayd/relay_udp.c
198
if ((len = recvfrom(fd, buf, sizeof(buf), 0,
usr.sbin/relayd/relay_udp.c
212
relay_udp_server(int fd, short sig, void *arg)
usr.sbin/relayd/relay_udp.c
232
if ((len = recvfrom(fd, buf, sizeof(buf), 0,
usr.sbin/relayd/relay_udp.c
333
relay_udp_timeout(int fd, short sig, void *arg)
usr.sbin/relayd/relayd.c
1310
relay_load_fd(int fd, off_t *len)
usr.sbin/relayd/relayd.c
1317
if (fstat(fd, &st) != 0)
usr.sbin/relayd/relayd.c
1322
if (pread(fd, buf, size, 0) != size)
usr.sbin/relayd/relayd.c
1325
close(fd);
usr.sbin/relayd/relayd.c
1333
close(fd);
usr.sbin/relayd/relayd.c
1492
event_again(struct event *ev, int fd, short event,
usr.sbin/relayd/relayd.c
1508
event_set(ev, fd, event, fn, arg);
usr.sbin/relayd/relayd.c
1922
parent_tls_ticket_rekey(int fd, short events, void *arg)
usr.sbin/relayd/relayd.c
399
parent_dispatch_pfe(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relayd.c
466
parent_dispatch_hce(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relayd.c
494
parent_dispatch_relay(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/relayd/relayd.c
535
parent_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/ripd/control.c
102
event_set(&control_state.ev, control_state.fd, EV_READ,
usr.sbin/ripd/control.c
154
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/ripd/control.c
162
control_connbyfd(int fd)
usr.sbin/ripd/control.c
167
if (c->iev.ibuf.fd == fd)
usr.sbin/ripd/control.c
188
control_close(int fd)
usr.sbin/ripd/control.c
192
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ripd/control.c
193
log_warn("control_close: fd %d: not found", fd);
usr.sbin/ripd/control.c
201
close(c->iev.ibuf.fd);
usr.sbin/ripd/control.c
213
control_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ripd/control.c
221
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/ripd/control.c
222
log_warn("control_dispatch_imsg: fd %d: not found", fd);
usr.sbin/ripd/control.c
228
control_close(fd);
usr.sbin/ripd/control.c
234
control_close(fd);
usr.sbin/ripd/control.c
241
control_close(fd);
usr.sbin/ripd/control.c
46
int fd;
usr.sbin/ripd/control.c
53
int fd;
usr.sbin/ripd/control.c
56
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,
usr.sbin/ripd/control.c
69
close(fd);
usr.sbin/ripd/control.c
74
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/ripd/control.c
76
close(fd);
usr.sbin/ripd/control.c
84
close(fd);
usr.sbin/ripd/control.c
89
control_state.fd = fd;
usr.sbin/ripd/control.c
97
if (listen(control_state.fd, CONTROL_BACKLOG) == -1) {
usr.sbin/ripd/interface.c
257
if_set_mcast_ttl(int fd, u_int8_t ttl)
usr.sbin/ripd/interface.c
259
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
usr.sbin/ripd/interface.c
270
if_set_opt(int fd)
usr.sbin/ripd/interface.c
274
if (setsockopt(fd, IPPROTO_IP, IP_RECVIF, &yes,
usr.sbin/ripd/interface.c
284
if_set_tos(int fd, int tos)
usr.sbin/ripd/interface.c
286
if (setsockopt(fd, IPPROTO_IP, IP_TOS,
usr.sbin/ripd/interface.c
301
if (setsockopt(iface->fd, IPPROTO_IP, IP_MULTICAST_IF,
usr.sbin/ripd/interface.c
316
if_set_mcast_loop(int fd)
usr.sbin/ripd/interface.c
320
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
usr.sbin/ripd/interface.c
330
if_set_recvbuf(int fd)
usr.sbin/ripd/interface.c
335
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
usr.sbin/ripd/interface.c
351
if (setsockopt(iface->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
usr.sbin/ripd/interface.c
373
if (setsockopt(iface->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
usr.sbin/ripd/interface.c
79
iface->fd = xconf->rip_socket;
usr.sbin/ripd/interface.c
82
if (ioctl(iface->fd, SIOCGIFRDOMAIN, (caddr_t)&ifr) == -1)
usr.sbin/ripd/interface.c
86
if (setsockopt(iface->fd, SOL_SOCKET, SO_RTABLE, &rdomain,
usr.sbin/ripd/kroute.c
1037
if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) {
usr.sbin/ripd/kroute.c
117
if ((kr_state.fd = socket(AF_ROUTE,
usr.sbin/ripd/kroute.c
124
if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK,
usr.sbin/ripd/kroute.c
130
if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ripd/kroute.c
136
setsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF,
usr.sbin/ripd/kroute.c
156
event_set(&kr_state.ev, kr_state.fd, EV_READ | EV_PERSIST,
usr.sbin/ripd/kroute.c
171
if (send_rtmsg(kr_state.fd, action, kroute) == -1)
usr.sbin/ripd/kroute.c
223
if (send_rtmsg(kr_state.fd, RTM_DELETE, kroute) == -1)
usr.sbin/ripd/kroute.c
253
send_rtmsg(kr_state.fd, RTM_ADD, &kr->r);
usr.sbin/ripd/kroute.c
268
send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r);
usr.sbin/ripd/kroute.c
276
kr_dispatch_msg(int fd, short event, void *bula)
usr.sbin/ripd/kroute.c
48
int fd;
usr.sbin/ripd/kroute.c
721
send_rtmsg(int fd, int action, struct kroute *kroute)
usr.sbin/ripd/kroute.c
785
if (writev(fd, iov, iovcnt) == -1) {
usr.sbin/ripd/kroute.c
929
send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r);
usr.sbin/ripd/message.c
40
report_timer(int fd, short event, void *arg)
usr.sbin/ripd/neighbor.c
324
nbr_timeout_timer(int fd, short event, void *arg)
usr.sbin/ripd/neighbor.c
335
nbr_failed_timeout(int fd, short event, void *arg)
usr.sbin/ripd/packet.c
120
if ((r = recvmsg(fd, &msg, 0)) == -1) {
usr.sbin/ripd/packet.c
70
if (sendto(iface->fd, pkt, len, 0,
usr.sbin/ripd/packet.c
81
recv_packet(int fd, short event, void *bula)
usr.sbin/ripd/parse.y
702
check_file_secrecy(int fd, const char *fname)
usr.sbin/ripd/parse.y
706
if (fstat(fd, &st)) {
usr.sbin/ripd/rde.c
141
event_set(&iev_ripe->ev, iev_ripe->ibuf.fd, iev_ripe->events,
usr.sbin/ripd/rde.c
146
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ripd/rde.c
170
close(iev_ripe->ibuf.fd);
usr.sbin/ripd/rde.c
172
close(iev_main->ibuf.fd);
usr.sbin/ripd/rde.c
192
rde_dispatch_imsg(int fd, short event, void *bula)
usr.sbin/ripd/rde.c
294
rde_dispatch_parent(int fd, short event, void *bula)
usr.sbin/ripd/rde_rib.c
76
route_action_timeout(int fd, short event, void *arg)
usr.sbin/ripd/rde_rib.c
92
route_action_garbage(int fd, short event, void *arg)
usr.sbin/ripd/ripd.c
247
event_set(&iev_ripe->ev, iev_ripe->ibuf.fd, iev_ripe->events,
usr.sbin/ripd/ripd.c
252
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ripd/ripd.c
276
close(iev_ripe->ibuf.fd);
usr.sbin/ripd/ripd.c
278
close(iev_rde->ibuf.fd);
usr.sbin/ripd/ripd.c
309
main_dispatch_ripe(int fd, short event, void *bula)
usr.sbin/ripd/ripd.c
389
main_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ripd/ripd.c
538
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev);
usr.sbin/ripd/ripd.c
544
u_int32_t peerid, pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ripd/ripd.c
549
pid, fd, data, datalen)) != -1)
usr.sbin/ripd/ripd.h
177
int fd; /* XXX */
usr.sbin/ripd/ripe.c
165
event_set(&iev_rde->ev, iev_rde->ibuf.fd, iev_rde->events,
usr.sbin/ripd/ripe.c
170
event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events,
usr.sbin/ripd/ripe.c
225
ripe_dispatch_main(int fd, short event, void *bula)
usr.sbin/ripd/ripe.c
305
ripe_dispatch_rde(int fd, short event, void *bula)
usr.sbin/ripd/ripe.c
463
close(iev_rde->ibuf.fd);
usr.sbin/ripd/ripe.c
466
close(iev_main->ibuf.fd);
usr.sbin/route6d/route6d.c
585
pfd[0].fd = ripsock;
usr.sbin/route6d/route6d.c
593
pfd[1].fd = rtsock;
usr.sbin/route6d/route6d.c
596
pfd[1].fd = -1;
usr.sbin/rpc.lockd/handles.c
52
int fd; /* The file descriptor itself */
usr.sbin/rpc.lockd/lockd_lock.c
105
int fd; /* file descriptor for this lock */
usr.sbin/rpc.lockd/lockd_lock.c
508
fl->fd = fhopen((fhandle_t *)fl->filehandle.fhdata, O_RDWR);
usr.sbin/rpc.lockd/lockd_lock.c
509
if (fl->fd == -1) {
usr.sbin/rpc.lockd/lockd_lock.c
527
if (fstat(fl->fd, &st) == -1) {
usr.sbin/rpc.lockd/lockd_lock.c
541
error = flock(fl->fd, lflags);
usr.sbin/rpc.lockd/lockd_lock.c
547
close(fl->fd);
usr.sbin/rpc.lockd/lockd_lock.c
558
if(flock(fl->fd, lflags) != 0) {
usr.sbin/rpc.lockd/lockd_lock.c
597
close(fl->fd);
usr.sbin/rpc.lockd/lockd_lock.c
689
if (close(rfl->fd) == -1) {
usr.sbin/rpki-client/constraints.c
117
if (tal_constraints[talid].fd != -1)
usr.sbin/rpki-client/constraints.c
118
close(tal_constraints[talid].fd);
usr.sbin/rpki-client/constraints.c
121
tal_constraints[talid].fd = -1;
usr.sbin/rpki-client/constraints.c
344
int fd, have_allow_as = 0, have_allow_ips = 0,
usr.sbin/rpki-client/constraints.c
347
fd = tal_constraints[talid].fd;
usr.sbin/rpki-client/constraints.c
349
tal_constraints[talid].fd = -1;
usr.sbin/rpki-client/constraints.c
352
if (fd == -1) {
usr.sbin/rpki-client/constraints.c
357
if ((f = fdopen(fd, "r")) == NULL)
usr.sbin/rpki-client/constraints.c
40
int fd; /* constraints file descriptor or -1. */
usr.sbin/rpki-client/constraints.c
65
int fd;
usr.sbin/rpki-client/constraints.c
69
tal_constraints[talid].fd = -1;
usr.sbin/rpki-client/constraints.c
87
fd = open(constraints, O_RDONLY);
usr.sbin/rpki-client/constraints.c
88
if (fd == -1 && errno != ENOENT)
usr.sbin/rpki-client/constraints.c
92
tal_constraints[talid].fd = fd;
usr.sbin/rpki-client/encoding.c
43
int fd, saved_errno;
usr.sbin/rpki-client/encoding.c
47
if ((fd = open(name, O_RDONLY)) == -1)
usr.sbin/rpki-client/encoding.c
49
if (fstat(fd, &st) != 0)
usr.sbin/rpki-client/encoding.c
58
n = read(fd, buf, size);
usr.sbin/rpki-client/encoding.c
65
close(fd);
usr.sbin/rpki-client/encoding.c
71
close(fd);
usr.sbin/rpki-client/filemode.c
791
proc_filemode(int fd)
usr.sbin/rpki-client/filemode.c
815
pfd.fd = fd;
usr.sbin/rpki-client/filemode.c
836
switch (ibuf_read(fd, msgq)) {
usr.sbin/rpki-client/filemode.c
853
if (msgbuf_write(fd, msgq) == -1) {
usr.sbin/rpki-client/http.c
1030
assert(conn->fd == -1);
usr.sbin/rpki-client/http.c
1039
int fd, save_errno;
usr.sbin/rpki-client/http.c
1042
fd = socket(res->ai_family,
usr.sbin/rpki-client/http.c
1044
if (fd == -1) {
usr.sbin/rpki-client/http.c
1048
conn->fd = fd;
usr.sbin/rpki-client/http.c
1051
if (bind(conn->fd, (struct sockaddr *)&http_bindaddr,
usr.sbin/rpki-client/http.c
1054
close(conn->fd);
usr.sbin/rpki-client/http.c
1055
conn->fd = -1;
usr.sbin/rpki-client/http.c
1062
if (connect(conn->fd, res->ai_addr, res->ai_addrlen) == -1) {
usr.sbin/rpki-client/http.c
1068
close(conn->fd);
usr.sbin/rpki-client/http.c
1069
conn->fd = -1;
usr.sbin/rpki-client/http.c
1079
if (conn->fd == -1) {
usr.sbin/rpki-client/http.c
1100
if (getsockopt(conn->fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) {
usr.sbin/rpki-client/http.c
1131
if (tls_connect_socket(conn->tls, conn->fd, conn->host) == -1) {
usr.sbin/rpki-client/http.c
138
int fd;
usr.sbin/rpki-client/http.c
1815
s = read(conn->fd, conn->buf + conn->bufpos,
usr.sbin/rpki-client/http.c
1877
s = write(conn->fd, conn->buf + conn->bufpos,
usr.sbin/rpki-client/http.c
2111
proc_http(char *bind_addr, int fd)
usr.sbin/rpki-client/http.c
2148
pfds[0].fd = fd;
usr.sbin/rpki-client/http.c
2176
pfds[i].fd = conn->req->outfd;
usr.sbin/rpki-client/http.c
2178
pfds[i].fd = conn->fd;
usr.sbin/rpki-client/http.c
2196
pfds[i].fd = conn->fd;
usr.sbin/rpki-client/http.c
2211
if (msgbuf_write(fd, msgq) == -1) {
usr.sbin/rpki-client/http.c
2219
switch (msgbuf_read(fd, msgq)) {
usr.sbin/rpki-client/http.c
845
conn->fd = -1;
usr.sbin/rpki-client/http.c
901
if (conn->fd != -1)
usr.sbin/rpki-client/http.c
902
close(conn->fd);
usr.sbin/rpki-client/http.c
982
close(conn->fd);
usr.sbin/rpki-client/http.c
983
conn->fd = -1;
usr.sbin/rpki-client/io.c
192
io_parse_hdr(struct ibuf *buf, void *arg, int *fd)
usr.sbin/rpki-client/io.c
212
ibuf_fd_set(b, *fd);
usr.sbin/rpki-client/io.c
213
*fd = -1;
usr.sbin/rpki-client/main.c
1002
*fd = pair[1];
usr.sbin/rpki-client/main.c
1319
pfd[0].fd = procfd;
usr.sbin/rpki-client/main.c
1321
pfd[1].fd = rsyncfd;
usr.sbin/rpki-client/main.c
1323
pfd[2].fd = httpfd;
usr.sbin/rpki-client/main.c
1325
pfd[3].fd = rrdpfd;
usr.sbin/rpki-client/main.c
1390
if (msgbuf_write(pfd[i].fd, queues[i]) == -1) {
usr.sbin/rpki-client/main.c
1411
switch (ibuf_read(pfd[1].fd, queues[1])) {
usr.sbin/rpki-client/main.c
1429
switch (ibuf_read(pfd[2].fd, queues[2])) {
usr.sbin/rpki-client/main.c
1453
switch (ibuf_read(pfd[3].fd, queues[3])) {
usr.sbin/rpki-client/main.c
1472
switch (ibuf_read(pfd[0].fd, queues[0])) {
usr.sbin/rpki-client/main.c
384
http_fetch(unsigned int id, const char *uri, const char *last_mod, int fd)
usr.sbin/rpki-client/main.c
393
ibuf_fd_set(b, fd);
usr.sbin/rpki-client/main.c
954
check_fs_size(int fd, const char *cachedir)
usr.sbin/rpki-client/main.c
960
if (fstatvfs(fd, &fs) == -1)
usr.sbin/rpki-client/main.c
980
process_start(const char *title, int *fd)
usr.sbin/rpki-client/main.c
999
*fd = pair[0];
usr.sbin/rpki-client/mkdir.c
47
mkpathat(int fd, const char *dir)
usr.sbin/rpki-client/mkdir.c
64
if (mkdirat(fd, path, 0755) == -1 && errno != EEXIST) {
usr.sbin/rpki-client/nca.c
467
int fd;
usr.sbin/rpki-client/nca.c
477
if ((fd = mkostemp(temp, O_CLOEXEC)) == -1)
usr.sbin/rpki-client/nca.c
479
(void)fchmod(fd, 0644);
usr.sbin/rpki-client/nca.c
481
if ((f = fdopen(fd, "w")) == NULL)
usr.sbin/rpki-client/output.c
174
int fd, r;
usr.sbin/rpki-client/output.c
183
fd = mkostemp(output_tmpname, O_CLOEXEC);
usr.sbin/rpki-client/output.c
184
if (fd == -1)
usr.sbin/rpki-client/output.c
186
(void) fchmod(fd, 0644);
usr.sbin/rpki-client/output.c
187
f = fdopen(fd, "w");
usr.sbin/rpki-client/parser.c
1130
pfd.fd = *(int *)arg;
usr.sbin/rpki-client/parser.c
1172
if (msgbuf_write(pfd.fd, myq) == -1) {
usr.sbin/rpki-client/parser.c
1195
proc_parser(int fd, int nthreads)
usr.sbin/rpki-client/parser.c
1222
if ((error = pthread_create(&writer, NULL, &parse_writer, &fd)) != 0)
usr.sbin/rpki-client/parser.c
1230
pfd.fd = fd;
usr.sbin/rpki-client/parser.c
1248
switch (ibuf_read(fd, inbufq)) {
usr.sbin/rpki-client/parser.c
299
int try, fd = -1, noent = 0, valid = 0;
usr.sbin/rpki-client/parser.c
305
fd = open(path, O_RDONLY);
usr.sbin/rpki-client/parser.c
306
if (fd == -1 && errno == ENOENT)
usr.sbin/rpki-client/parser.c
312
valid = valid_filehash(fd, m->hash, sizeof(m->hash));
usr.sbin/rpki-client/repo.c
1024
fd = open(fn, flags, 0644);
usr.sbin/rpki-client/repo.c
1025
if (fd == -1) {
usr.sbin/rpki-client/repo.c
1036
if ((s = write(fd, data, dlen)) == -1) {
usr.sbin/rpki-client/repo.c
1040
close(fd);
usr.sbin/rpki-client/repo.c
1050
if (fd != -1)
usr.sbin/rpki-client/repo.c
1051
close(fd);
usr.sbin/rpki-client/repo.c
275
repo_mkpath(int fd, char *file)
usr.sbin/rpki-client/repo.c
283
if (mkpathat(fd, file) == -1) {
usr.sbin/rpki-client/repo.c
401
int fd;
usr.sbin/rpki-client/repo.c
404
fd = open(temp,
usr.sbin/rpki-client/repo.c
407
if (fd == -1) {
usr.sbin/rpki-client/repo.c
415
http_fetch(tr->id, tr->uri[tr->uriidx], NULL, fd);
usr.sbin/rpki-client/repo.c
679
int fd, ln = 0, deltacnt = 0;
usr.sbin/rpki-client/repo.c
693
if ((fd = open(file, O_RDONLY)) == -1) {
usr.sbin/rpki-client/repo.c
700
if (fstat(fd, &st) != 0)
usr.sbin/rpki-client/repo.c
704
f = fdopen(fd, "r");
usr.sbin/rpki-client/repo.c
796
int fd, i;
usr.sbin/rpki-client/repo.c
805
if ((fd = mkostemp(temp, O_CLOEXEC)) == -1)
usr.sbin/rpki-client/repo.c
807
(void)fchmod(fd, 0644);
usr.sbin/rpki-client/repo.c
808
f = fdopen(fd, "w");
usr.sbin/rpki-client/repo.c
973
int fd = -1, try = 0, deleted = 0;
usr.sbin/rpki-client/repo.c
993
fd = open(fn, O_RDONLY);
usr.sbin/rpki-client/repo.c
994
} while (fd == -1 && try < 2);
usr.sbin/rpki-client/repo.c
996
if (!valid_filehash(fd, hash, hlen)) {
usr.sbin/rpki-client/rrdp.c
536
proc_rrdp(int fd)
usr.sbin/rpki-client/rrdp.c
579
s->pfd->fd = s->infd;
usr.sbin/rpki-client/rrdp.c
587
pfds[0].fd = fd;
usr.sbin/rpki-client/rrdp.c
601
if (msgbuf_write(fd, msgq) == -1) {
usr.sbin/rpki-client/rrdp.c
609
switch (msgbuf_read(fd, msgq)) {
usr.sbin/rpki-client/rsync.c
253
proc_rsync(char *prog, char *bind_addr, int fd)
usr.sbin/rpki-client/rsync.c
268
pfd.fd = fd;
usr.sbin/rpki-client/rsync.c
379
if (msgbuf_write(fd, msgq) == -1) {
usr.sbin/rpki-client/rsync.c
394
switch (ibuf_read(fd, msgq)) {
usr.sbin/rpki-client/validate.c
173
valid_filehash(int fd, const char *hash, size_t hlen)
usr.sbin/rpki-client/validate.c
183
if (fd == -1)
usr.sbin/rpki-client/validate.c
187
while ((nr = read(fd, buffer, sizeof(buffer))) > 0)
usr.sbin/rpki-client/validate.c
189
close(fd);
usr.sbin/sa/main.c
199
int fd;
usr.sbin/sa/main.c
205
fd = acct_load(argv[0], sflag);
usr.sbin/sa/main.c
206
if (fd < 0)
usr.sbin/sa/main.c
237
if (ftruncate(fd, 0) == -1) {
usr.sbin/sa/main.c
264
if (close(fd) == -1) {
usr.sbin/sa/main.c
295
int fd, i;
usr.sbin/sa/main.c
300
fd = open(pn, wr ? O_RDWR : O_RDONLY);
usr.sbin/sa/main.c
301
if (fd == -1) {
usr.sbin/sa/main.c
312
rv = read(fd, &ac, sizeof(struct acct));
usr.sbin/sa/main.c
357
return (fd);
usr.sbin/sasyncd/conf.y
351
int fd, r;
usr.sbin/sasyncd/conf.y
372
fd = open(cfgfile, O_RDONLY);
usr.sbin/sasyncd/conf.y
373
if (fd == -1)
usr.sbin/sasyncd/conf.y
380
close(fd);
usr.sbin/sasyncd/conf.y
384
if (read(fd, buf, conflen) != conflen) {
usr.sbin/sasyncd/conf.y
387
close(fd);
usr.sbin/sasyncd/conf.y
390
close(fd);
usr.sbin/sasyncd/monitor.c
441
int fd = -1, ret = -1;
usr.sbin/sasyncd/monitor.c
443
if ((fd = open(ISAKMPD_FIFO, O_WRONLY)) == -1) {
usr.sbin/sasyncd/monitor.c
447
if (fstat(fd, &sb) == -1) {
usr.sbin/sasyncd/monitor.c
456
if (write(fd, cmd, strlen(cmd)) == -1) {
usr.sbin/sasyncd/monitor.c
463
if (fd != -1)
usr.sbin/sasyncd/monitor.c
464
close(fd);
usr.sbin/sasyncd/monitor.c
473
int fd = -1, ret = -1;
usr.sbin/sasyncd/monitor.c
476
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/sasyncd/monitor.c
485
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/sasyncd/monitor.c
490
if (imsgbuf_init(&ibuf, fd) == -1) {
usr.sbin/sasyncd/monitor.c
507
if (fd != -1)
usr.sbin/sasyncd/monitor.c
508
close(fd);
usr.sbin/sasyncd/pfkey.c
320
int fd = cfgstate.pfkey_socket;
usr.sbin/sasyncd/pfkey.c
322
if (recv(fd, &hdr, sizeof hdr, MSG_PEEK) != sizeof hdr) {
usr.sbin/sasyncd/pfkey.c
334
if (read(fd, data, datalen) != datalen) {
usr.sbin/sasyncd/pfkey.c
346
int fd;
usr.sbin/sasyncd/pfkey.c
348
fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2);
usr.sbin/sasyncd/pfkey.c
349
if (fd == -1) {
usr.sbin/sasyncd/pfkey.c
353
cfgstate.pfkey_socket = fd;
usr.sbin/sasyncd/pfkey.c
359
return (fd > -1 ? 0 : -1);
usr.sbin/slowcgi/slowcgi.c
1028
script_in(int fd, struct event *ev, struct request *c, uint8_t type)
usr.sbin/slowcgi/slowcgi.c
1045
n = read(fd, resp->data + sizeof(struct fcgi_record_header),
usr.sbin/slowcgi/slowcgi.c
1074
close(fd);
usr.sbin/slowcgi/slowcgi.c
1083
script_std_in(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
1086
script_in(fd, &c->script_ev, c, FCGI_STDOUT);
usr.sbin/slowcgi/slowcgi.c
1090
script_err_in(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
1093
script_in(fd, &c->script_err_ev, c, FCGI_STDERR);
usr.sbin/slowcgi/slowcgi.c
1097
script_out(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
1107
close(fd);
usr.sbin/slowcgi/slowcgi.c
1111
n = write(fd, node->data + node->data_pos, node->data_len);
usr.sbin/slowcgi/slowcgi.c
1155
close(c->fd);
usr.sbin/slowcgi/slowcgi.c
121
int fd;
usr.sbin/slowcgi/slowcgi.c
275
int c, fd;
usr.sbin/slowcgi/slowcgi.c
288
if ((fd = open("/dev/null", O_RDWR)) != -1) {
usr.sbin/slowcgi/slowcgi.c
289
if (dup2(fd, c) == -1)
usr.sbin/slowcgi/slowcgi.c
291
if (fd > c)
usr.sbin/slowcgi/slowcgi.c
292
close(fd);
usr.sbin/slowcgi/slowcgi.c
346
fd = slowcgi_listen(fcgi_socket, pw);
usr.sbin/slowcgi/slowcgi.c
379
event_set(&l->ev, fd, EV_READ | EV_PERSIST, slowcgi_accept, l);
usr.sbin/slowcgi/slowcgi.c
398
int fd;
usr.sbin/slowcgi/slowcgi.c
400
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC,
usr.sbin/slowcgi/slowcgi.c
416
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1)
usr.sbin/slowcgi/slowcgi.c
424
if (listen(fd, 5) == -1)
usr.sbin/slowcgi/slowcgi.c
428
return fd;
usr.sbin/slowcgi/slowcgi.c
432
slowcgi_paused(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
459
slowcgi_accept(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
474
if ((s = accept_reserve(fd, (struct sockaddr *)&ss,
usr.sbin/slowcgi/slowcgi.c
498
c->fd = s;
usr.sbin/slowcgi/slowcgi.c
516
slowcgi_timeout(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
585
slowcgi_response(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
599
n = write(fd, resp->data + resp->data_pos, resp->data_len);
usr.sbin/slowcgi/slowcgi.c
624
slowcgi_request(int fd, short events, void *arg)
usr.sbin/slowcgi/slowcgi.c
631
n = read(fd, c->buf + c->buf_pos + c->buf_len,
usr.sbin/smtpd/bounce.c
199
bounce_fd(int fd)
usr.sbin/smtpd/bounce.c
204
log_debug("debug: bounce: got enqueue socket %d", fd);
usr.sbin/smtpd/bounce.c
206
if (fd == -1 || TAILQ_EMPTY(&pending)) {
usr.sbin/smtpd/bounce.c
208
if (fd != -1)
usr.sbin/smtpd/bounce.c
209
close(fd);
usr.sbin/smtpd/bounce.c
222
io_set_fd(s->io, fd);
usr.sbin/smtpd/bounce.c
232
bounce_timeout(int fd, short ev, void *arg)
usr.sbin/smtpd/bounce.c
362
int fd;
usr.sbin/smtpd/bounce.c
382
if ((fd = queue_message_fd_r(msg->msgid)) == -1) {
usr.sbin/smtpd/bounce.c
388
if ((s->msgfp = fdopen(fd, "r")) == NULL) {
usr.sbin/smtpd/bounce.c
391
close(fd);
usr.sbin/smtpd/control.c
161
int fd;
usr.sbin/smtpd/control.c
164
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
usr.sbin/smtpd/control.c
173
if (connect(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == 0)
usr.sbin/smtpd/control.c
181
if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) {
usr.sbin/smtpd/control.c
193
io_set_nonblocking(fd);
usr.sbin/smtpd/control.c
194
control_state.fd = fd;
usr.sbin/smtpd/control.c
196
return fd;
usr.sbin/smtpd/control.c
266
if (listen(control_state.fd, CONTROL_BACKLOG) == -1)
usr.sbin/smtpd/control.c
269
event_set(&control_state.ev, control_state.fd, EV_READ|EV_PERSIST,
usr.sbin/smtpd/control.c
48
int fd;
usr.sbin/smtpd/enqueue.c
317
if ((msg.fd = open_connection()) == -1)
usr.sbin/smtpd/enqueue.c
323
fout = fdopen(msg.fd, "a+");
usr.sbin/smtpd/enqueue.c
802
int fd;
usr.sbin/smtpd/enqueue.c
830
fd = imsg_get_fd(&imsg);
usr.sbin/smtpd/enqueue.c
836
return fd;
usr.sbin/smtpd/enqueue.c
97
int fd;
usr.sbin/smtpd/forward.c
32
forwards_get(int fd, struct expand *expand)
usr.sbin/smtpd/forward.c
43
if (fstat(fd, &sb) == -1)
usr.sbin/smtpd/forward.c
59
if ((fp = fdopen(fd, "r")) == NULL) {
usr.sbin/smtpd/forward.c
85
close(fd);
usr.sbin/smtpd/iobuf.c
200
iobuf_read(struct iobuf *io, int fd)
usr.sbin/smtpd/iobuf.c
204
n = read(fd, io->buf + io->wpos, iobuf_left(io));
usr.sbin/smtpd/iobuf.c
343
iobuf_write(struct iobuf *io, int fd)
usr.sbin/smtpd/iobuf.c
359
n = writev(fd, iov, i);
usr.sbin/smtpd/iobuf.c
374
iobuf_flush(struct iobuf *io, int fd)
usr.sbin/smtpd/iobuf.c
379
if ((s = iobuf_write(io, fd)) < 0)
usr.sbin/smtpd/ioev.c
145
io_set_nonblocking(int fd)
usr.sbin/smtpd/ioev.c
149
if ((flags = fcntl(fd, F_GETFL)) == -1)
usr.sbin/smtpd/ioev.c
154
if (fcntl(fd, F_SETFL, flags) == -1)
usr.sbin/smtpd/ioev.c
159
io_set_nolinger(int fd)
usr.sbin/smtpd/ioev.c
164
if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) == -1)
usr.sbin/smtpd/ioev.c
308
io_set_fd(struct io *io, int fd)
usr.sbin/smtpd/ioev.c
310
io->sock = fd;
usr.sbin/smtpd/ioev.c
311
if (fd != -1)
usr.sbin/smtpd/ioev.c
675
io_dispatch(int fd, short ev, void *humppa)
usr.sbin/smtpd/ioev.c
769
io_dispatch_connect(int fd, short ev, void *humppa)
usr.sbin/smtpd/ioev.c
778
close(fd);
usr.sbin/smtpd/ioev.c
783
r = getsockopt(fd, SOL_SOCKET, SO_ERROR, &e, &sl);
usr.sbin/smtpd/ioev.c
789
close(fd);
usr.sbin/smtpd/ioev.c
852
io_dispatch_handshake_tls(int fd, short event, void *humppa)
usr.sbin/smtpd/ioev.c
884
io_dispatch_read_tls(int fd, short event, void *humppa)
usr.sbin/smtpd/ioev.c
924
io_dispatch_write_tls(int fd, short event, void *humppa)
usr.sbin/smtpd/lka.c
367
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/lka.c
368
lka_proc_errfd(procname, fd);
usr.sbin/smtpd/lka.c
369
shutdown(fd, SHUT_WR);
usr.sbin/smtpd/lka.c
43
static void proc_timeout(int fd, short event, void *p);
usr.sbin/smtpd/lka.c
51
int ret, fd;
usr.sbin/smtpd/lka.c
705
proc_timeout(int fd, short event, void *p)
usr.sbin/smtpd/lka_filter.c
209
lka_proc_forked(const char *name, const char *tag, uint32_t subsystems, int fd)
usr.sbin/smtpd/lka_filter.c
227
io_set_nonblocking(fd);
usr.sbin/smtpd/lka_filter.c
229
io_set_fd(processor->io, fd);
usr.sbin/smtpd/lka_filter.c
235
lka_proc_errfd(const char *name, int fd)
usr.sbin/smtpd/lka_filter.c
241
io_set_nonblocking(fd);
usr.sbin/smtpd/lka_filter.c
244
io_set_fd(processor->errfd, fd);
usr.sbin/smtpd/lka_filter.c
562
int fd = -1;
usr.sbin/smtpd/lka_filter.c
570
fd = sp[0];
usr.sbin/smtpd/lka_filter.c
576
m_create(p_dispatcher, IMSG_FILTER_SMTP_DATA_BEGIN, 0, 0, fd);
usr.sbin/smtpd/lka_filter.c
578
m_add_int(p_dispatcher, fd != -1 ? 1 : 0);
usr.sbin/smtpd/lka_filter.c
580
log_trace(TRACE_FILTERS, "%016"PRIx64" filters data-begin fd=%d", reqid, fd);
usr.sbin/smtpd/lka_session.c
109
if (fd == -1) {
usr.sbin/smtpd/lka_session.c
135
ret = forwards_get(fd, &lks->expand);
usr.sbin/smtpd/lka_session.c
87
lka_session_forward_reply(struct forward_req *fwreq, int fd)
usr.sbin/smtpd/mail.maildir.c
126
int fd;
usr.sbin/smtpd/mail.maildir.c
180
fd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0600);
usr.sbin/smtpd/mail.maildir.c
181
if (fd == -1)
usr.sbin/smtpd/mail.maildir.c
183
if ((fp = fdopen(fd, "w")) == NULL)
usr.sbin/smtpd/mail.maildir.c
202
fsync(fd) == -1 ||
usr.sbin/smtpd/mail.mboxfile.c
63
int fd;
usr.sbin/smtpd/mail.mboxfile.c
71
fd = open(filename, O_CREAT | O_APPEND | O_WRONLY | O_EXLOCK, 0600);
usr.sbin/smtpd/mail.mboxfile.c
72
if (fd == -1)
usr.sbin/smtpd/mail.mboxfile.c
75
if ((fp = fdopen(fd, "w")) == NULL)
usr.sbin/smtpd/mail.mboxfile.c
93
(fsync(fd) == -1 && errno != EINVAL) ||
usr.sbin/smtpd/makemap.c
191
if ((fd = mkstemp(dbname)) == -1)
usr.sbin/smtpd/makemap.c
201
if (fchmod(db->fd(db), sb.st_mode) == -1 ||
usr.sbin/smtpd/makemap.c
202
fchown(db->fd(db), sb.st_uid, sb.st_gid) == -1) {
usr.sbin/smtpd/makemap.c
217
if (fsync(fd) == -1) {
usr.sbin/smtpd/makemap.c
221
if (close(fd) == -1) {
usr.sbin/smtpd/makemap.c
222
fd = -1;
usr.sbin/smtpd/makemap.c
226
fd = -1;
usr.sbin/smtpd/makemap.c
240
if (fd != -1)
usr.sbin/smtpd/makemap.c
241
close(fd);
usr.sbin/smtpd/makemap.c
78
int fd = -1;
usr.sbin/smtpd/mda.c
116
int n, fd;
usr.sbin/smtpd/mda.c
199
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/mda.c
200
if (fd == -1) {
usr.sbin/smtpd/mda.c
212
fd, s->id, e->id);
usr.sbin/smtpd/mda.c
214
if ((s->datafp = fdopen(fd, "r")) == NULL) {
usr.sbin/smtpd/mda.c
216
close(fd);
usr.sbin/smtpd/mda.c
287
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/mda.c
288
if (fd == -1) {
usr.sbin/smtpd/mda.c
299
fd, s->id, s->evp->id);
usr.sbin/smtpd/mda.c
301
io_set_nonblocking(fd);
usr.sbin/smtpd/mda.c
302
io_set_fd(s->io, fd);
usr.sbin/smtpd/mda.c
320
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/mda.c
321
if (fd != -1)
usr.sbin/smtpd/mda.c
322
mda_getlastline(fd, out, sizeof(out));
usr.sbin/smtpd/mda.c
507
mda_getlastline(int fd, char *dst, size_t dstsz)
usr.sbin/smtpd/mda.c
515
if (lseek(fd, 0, SEEK_SET) == -1) {
usr.sbin/smtpd/mda.c
517
close(fd);
usr.sbin/smtpd/mda.c
520
fp = fdopen(fd, "r");
usr.sbin/smtpd/mda.c
523
close(fd);
usr.sbin/smtpd/mda_mbox.c
61
int fd;
usr.sbin/smtpd/mda_mbox.c
74
if ((fd = open(buffer, O_CREAT|O_EXCL, 0)) == -1) {
usr.sbin/smtpd/mda_mbox.c
80
if (fchown(fd, deliver->userinfo.uid, deliver->userinfo.gid) == -1)
usr.sbin/smtpd/mda_mbox.c
83
if (fchmod(fd, S_IRUSR|S_IWUSR) == -1)
usr.sbin/smtpd/mproc.c
127
event_set(&p->ev, p->imsgbuf.fd, events, mproc_dispatch, p);
usr.sbin/smtpd/mproc.c
133
mproc_dispatch(int fd, short event, void *arg)
usr.sbin/smtpd/mproc.c
224
m_compose(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd,
usr.sbin/smtpd/mproc.c
227
imsg_compose(&p->imsgbuf, type, peerid, pid, fd, data, len);
usr.sbin/smtpd/mproc.c
242
int fd, const struct iovec *iov, int n)
usr.sbin/smtpd/mproc.c
247
imsg_composev(&p->imsgbuf, type, peerid, pid, fd, iov, n);
usr.sbin/smtpd/mproc.c
265
m_create(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd)
usr.sbin/smtpd/mproc.c
271
p->m_fd = fd;
usr.sbin/smtpd/mproc.c
66
mproc_init(struct mproc *p, int fd)
usr.sbin/smtpd/mproc.c
68
if (imsgbuf_init(&p->imsgbuf, fd) == -1)
usr.sbin/smtpd/mproc.c
77
log_debug("debug: clearing p=%s, fd=%d, pid=%d", p->name, p->imsgbuf.fd, p->pid);
usr.sbin/smtpd/mproc.c
81
close(p->imsgbuf.fd);
usr.sbin/smtpd/mta.c
830
mta_delivery_flush_event(int fd, short event, void *arg)
usr.sbin/smtpd/mta_session.c
126
static void mta_start(int fd, short ev, void *arg);
usr.sbin/smtpd/mta_session.c
272
int status, fd;
usr.sbin/smtpd/mta_session.c
282
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/mta_session.c
285
if (fd != -1)
usr.sbin/smtpd/mta_session.c
286
close(fd);
usr.sbin/smtpd/mta_session.c
290
if (fd == -1) {
usr.sbin/smtpd/mta_session.c
299
if (fstat(fd, &sb) == -1) {
usr.sbin/smtpd/mta_session.c
304
close(fd);
usr.sbin/smtpd/mta_session.c
312
close(fd);
usr.sbin/smtpd/mta_session.c
317
s->datafp = fdopen(fd, "r");
usr.sbin/smtpd/mta_session.c
441
mta_start(int fd, short ev, void *arg)
usr.sbin/smtpd/parse.y
3064
check_file_secrecy(int fd, const char *fname)
usr.sbin/smtpd/parse.y
3068
if (fstat(fd, &st)) {
usr.sbin/smtpd/parse.y
3333
h->fd = -1;
usr.sbin/smtpd/proxy.c
135
s->fd = sock;
usr.sbin/smtpd/proxy.c
235
s->cb_accepted(s->l, s->fd, &s->ss, s->io);
usr.sbin/smtpd/proxy.c
268
s->cb_dropped(s->l, s->fd, &s->ss);
usr.sbin/smtpd/proxy.c
86
int fd;
usr.sbin/smtpd/queue.c
120
fd = queue_message_fd_rw(msgid);
usr.sbin/smtpd/queue.c
122
m_create(p, IMSG_SMTP_MESSAGE_OPEN, 0, 0, fd);
usr.sbin/smtpd/queue.c
124
m_add_int(p, (fd == -1) ? 0 : 1);
usr.sbin/smtpd/queue.c
315
fd = queue_message_fd_r(msgid);
usr.sbin/smtpd/queue.c
316
m_create(p, imsg->hdr.type, 0, 0, fd);
usr.sbin/smtpd/queue.c
521
queue_msgid_walk(int fd, short event, void *arg)
usr.sbin/smtpd/queue.c
54
int fd, mta_ext, ret, v, flags, code;
usr.sbin/smtpd/queue.c
675
queue_timeout(int fd, short event, void *p)
usr.sbin/smtpd/queue_backend.c
286
int fdin = -1, fdout = -1, fd = -1;
usr.sbin/smtpd/queue_backend.c
303
if ((fd = dup(fdout)) == -1)
usr.sbin/smtpd/queue_backend.c
307
fdin = fd;
usr.sbin/smtpd/queue_backend.c
308
fd = -1;
usr.sbin/smtpd/queue_backend.c
326
if ((fd = dup(fdout)) == -1)
usr.sbin/smtpd/queue_backend.c
330
fdin = fd;
usr.sbin/smtpd/queue_backend.c
331
fd = -1;
usr.sbin/smtpd/queue_backend.c
349
if (fd != -1)
usr.sbin/smtpd/queue_backend.c
350
close(fd);
usr.sbin/smtpd/queue_fs.c
164
int fd;
usr.sbin/smtpd/queue_fs.c
172
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/smtpd/queue_fs.c
177
return fd;
usr.sbin/smtpd/queue_fs.c
478
int fd;
usr.sbin/smtpd/queue_fs.c
481
if ((fd = open(path, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
usr.sbin/smtpd/queue_fs.c
486
if ((fp = fdopen(fd, "w")) == NULL) {
usr.sbin/smtpd/queue_fs.c
510
fd = -1;
usr.sbin/smtpd/queue_fs.c
521
else if (fd != -1)
usr.sbin/smtpd/queue_fs.c
522
close(fd);
usr.sbin/smtpd/queue_proc.c
131
int r, fd;
usr.sbin/smtpd/queue_proc.c
133
fd = open(path, O_RDONLY);
usr.sbin/smtpd/queue_proc.c
134
if (fd == -1) {
usr.sbin/smtpd/queue_proc.c
139
imsg_compose(&ibuf, PROC_QUEUE_MESSAGE_COMMIT, 0, 0, fd, &msgid,
usr.sbin/smtpd/queue_proc.c
288
int fd;
usr.sbin/smtpd/queue_proc.c
290
fd = fork_proc_backend("queue", conf, "queue-proc", 0);
usr.sbin/smtpd/queue_proc.c
291
if (fd == -1)
usr.sbin/smtpd/queue_proc.c
294
if (imsgbuf_init(&ibuf, fd) == -1)
usr.sbin/smtpd/queue_ram.c
150
int fd, fd2;
usr.sbin/smtpd/queue_ram.c
157
fd = mktmpfile();
usr.sbin/smtpd/queue_ram.c
158
if (fd == -1) {
usr.sbin/smtpd/queue_ram.c
163
fd2 = dup(fd);
usr.sbin/smtpd/queue_ram.c
166
close(fd);
usr.sbin/smtpd/queue_ram.c
172
close(fd);
usr.sbin/smtpd/queue_ram.c
179
close(fd);
usr.sbin/smtpd/queue_ram.c
184
lseek(fd, 0, SEEK_SET);
usr.sbin/smtpd/queue_ram.c
185
return (fd);
usr.sbin/smtpd/runq.c
61
runq_timeout(int fd, short ev, void *arg)
usr.sbin/smtpd/scheduler.c
466
scheduler_timeout(int fd, short event, void *p)
usr.sbin/smtpd/scheduler_proc.c
100
int fd, r;
usr.sbin/smtpd/scheduler_proc.c
103
fd = fork_proc_backend("scheduler", conf, "scheduler-proc", 0);
usr.sbin/smtpd/scheduler_proc.c
104
if (fd == -1)
usr.sbin/smtpd/scheduler_proc.c
107
if (imsgbuf_init(&ibuf, fd) == -1)
usr.sbin/smtpd/smtp.c
131
if ((l->fd = socket(l->ss.ss_family, SOCK_STREAM, 0)) == -1) {
usr.sbin/smtpd/smtp.c
143
if (setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR, &opt,
usr.sbin/smtpd/smtp.c
146
if (bind(l->fd, (struct sockaddr *)&l->ss, l->ss.ss_len) == -1)
usr.sbin/smtpd/smtp.c
238
io_set_nonblocking(l->fd);
usr.sbin/smtpd/smtp.c
239
if (listen(l->fd, SMTPD_BACKLOG) == -1)
usr.sbin/smtpd/smtp.c
241
event_set(&l->ev, l->fd, EV_READ|EV_PERSIST, smtp_accept, l);
usr.sbin/smtpd/smtp.c
281
int fd[2];
usr.sbin/smtpd/smtp.c
291
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fd))
usr.sbin/smtpd/smtp.c
294
if ((smtp_session(listener, fd[0], &listener->ss, env->sc_hostname, NULL)) == -1) {
usr.sbin/smtpd/smtp.c
295
close(fd[0]);
usr.sbin/smtpd/smtp.c
296
close(fd[1]);
usr.sbin/smtpd/smtp.c
304
return (fd[1]);
usr.sbin/smtpd/smtp.c
308
smtp_accept(int fd, short event, void *p)
usr.sbin/smtpd/smtp.c
325
if ((sock = accept(fd, (struct sockaddr *)&ss, &len)) == -1) {
usr.sbin/smtpd/smtp_session.c
2277
smtp_auth_failure_resume(int fd, short event, void *p)
usr.sbin/smtpd/smtp_session.c
2690
smtp_message_fd(struct smtp_tx *tx, int fd)
usr.sbin/smtpd/smtp_session.c
2696
log_debug("smtp: %p: message fd %d", s, fd);
usr.sbin/smtpd/smtp_session.c
2698
if ((tx->ofile = fdopen(fd, "w")) == NULL) {
usr.sbin/smtpd/smtp_session.c
2699
close(fd);
usr.sbin/smtpd/smtp_session.c
2736
smtp_filter_fd(struct smtp_tx *tx, int fd)
usr.sbin/smtpd/smtp_session.c
2742
log_debug("smtp: %p: filter fd %d", s, fd);
usr.sbin/smtpd/smtp_session.c
2745
io_set_fd(tx->filter, fd);
usr.sbin/smtpd/smtp_session.c
702
int status, success, fd;
usr.sbin/smtpd/smtp_session.c
802
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/smtp_session.c
804
if (!success || fd == -1) {
usr.sbin/smtpd/smtp_session.c
805
if (fd != -1)
usr.sbin/smtpd/smtp_session.c
806
close(fd);
usr.sbin/smtpd/smtp_session.c
813
log_debug("smtp: %p: fd %d from queue", s, fd);
usr.sbin/smtpd/smtp_session.c
815
if (smtp_message_fd(s->tx, fd)) {
usr.sbin/smtpd/smtp_session.c
829
fd = imsg_get_fd(imsg);
usr.sbin/smtpd/smtp_session.c
831
if (!success || fd == -1) {
usr.sbin/smtpd/smtp_session.c
832
if (fd != -1)
usr.sbin/smtpd/smtp_session.c
833
close(fd);
usr.sbin/smtpd/smtp_session.c
840
log_debug("smtp: %p: fd %d from lka", s, fd);
usr.sbin/smtpd/smtp_session.c
842
smtp_filter_fd(s->tx, fd);
usr.sbin/smtpd/smtpctl.c
138
int fd;
usr.sbin/smtpd/smtpctl.c
145
if ((fd = mkstemp(path)) == -1 || (fp = fdopen(fd, "w+")) == NULL) {
usr.sbin/smtpd/smtpctl.c
146
if (fd != -1)
usr.sbin/smtpd/smtpctl.c
151
if (fchmod(fd, 0600) == -1) {
usr.sbin/smtpd/smtpd.c
1013
pfd[0].fd = ibuf->fd;
usr.sbin/smtpd/smtpd.c
156
int fd, n, v, ret;
usr.sbin/smtpd/smtpd.c
1562
offline_scan(int fd, short ev, void *arg)
usr.sbin/smtpd/smtpd.c
1651
int fd;
usr.sbin/smtpd/smtpd.c
1662
if ((fd = open(path, O_RDONLY|O_NOFOLLOW|O_NONBLOCK)) == -1) {
usr.sbin/smtpd/smtpd.c
1667
if (fstat(fd, &sb) == -1) {
usr.sbin/smtpd/smtpd.c
167
fd = parent_forward_open(fwreq->user, fwreq->directory,
usr.sbin/smtpd/smtpd.c
170
if (fd == -1 && errno != ENOENT) {
usr.sbin/smtpd/smtpd.c
1707
if ((fp = fdopen(fd, "r")) == NULL)
usr.sbin/smtpd/smtpd.c
176
m_compose(p, IMSG_LKA_OPEN_FORWARD, 0, 0, fd,
usr.sbin/smtpd/smtpd.c
1791
int fd;
usr.sbin/smtpd/smtpd.c
1812
fd = open(pathname, O_RDONLY|O_NOFOLLOW|O_NONBLOCK);
usr.sbin/smtpd/smtpd.c
1813
} while (fd == -1 && errno == EINTR);
usr.sbin/smtpd/smtpd.c
1814
if (fd == -1) {
usr.sbin/smtpd/smtpd.c
1829
if (!secure_file(fd, pathname, directory, uid, 1)) {
usr.sbin/smtpd/smtpd.c
1831
close(fd);
usr.sbin/smtpd/smtpd.c
1835
return fd;
usr.sbin/smtpd/smtpd.c
306
parent_send_config(int fd, short event, void *p)
usr.sbin/smtpd/smtpd.h
523
int fd;
usr.sbin/smtpd/ssl.c
39
int fd, saved_errno;
usr.sbin/smtpd/ssl.c
42
if ((fd = open(name, O_RDONLY)) == -1)
usr.sbin/smtpd/ssl.c
44
if (fstat(fd, &st) != 0)
usr.sbin/smtpd/ssl.c
61
if (read(fd, buf, size) != size)
usr.sbin/smtpd/ssl.c
63
close(fd);
usr.sbin/smtpd/ssl.c
71
close(fd);
usr.sbin/smtpd/table_proc.c
129
int fd, fdd;
usr.sbin/smtpd/table_proc.c
133
fd = fork_proc_backend("table", table->t_config, table->t_name, 1);
usr.sbin/smtpd/table_proc.c
134
if (fd == -1)
usr.sbin/smtpd/table_proc.c
136
if ((fdd = dup(fd)) == -1) {
usr.sbin/smtpd/table_proc.c
140
if ((priv->in = fdopen(fd, "r")) == NULL)
usr.sbin/smtpd/util.c
319
int fd;
usr.sbin/smtpd/util.c
327
if ((fd = mkstemp(path)) == -1) {
usr.sbin/smtpd/util.c
332
return (fd);
usr.sbin/smtpd/util.c
556
secure_file(int fd, char *path, char *userdir, uid_t uid, int mayread)
usr.sbin/smtpd/util.c
570
if (fstat(fd, &st) == -1 ||
usr.sbin/smtpd/util.c
695
session_socket_error(int fd)
usr.sbin/smtpd/util.c
701
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1)
usr.sbin/snmpd/application.c
1190
appl_request_downstream_timeout(__unused int fd, __unused short event,
usr.sbin/snmpd/application_agentx.c
191
int fd;
usr.sbin/snmpd/application_agentx.c
197
if ((fd = accept(masterfd, (struct sockaddr *)&sun, &sunlen)) == -1) {
usr.sbin/snmpd/application_agentx.c
209
if ((conn->conn_ax = ax_new(fd)) == NULL) {
usr.sbin/snmpd/application_agentx.c
219
event_set(&(conn->conn_rev), fd, EV_READ | EV_PERSIST,
usr.sbin/snmpd/application_agentx.c
222
event_set(&(conn->conn_wev), fd, EV_WRITE, appl_agentx_send, conn);
usr.sbin/snmpd/application_agentx.c
227
close(fd);
usr.sbin/snmpd/application_agentx.c
232
appl_agentx_backend(int fd)
usr.sbin/snmpd/application_agentx.c
241
if ((conn->conn_ax = ax_new(fd)) == NULL)
usr.sbin/snmpd/application_agentx.c
249
event_set(&(conn->conn_rev), fd, EV_READ | EV_PERSIST,
usr.sbin/snmpd/application_agentx.c
252
event_set(&(conn->conn_wev), fd, EV_WRITE, appl_agentx_send, conn);
usr.sbin/snmpd/application_agentx.c
283
appl_agentx_recv(int fd, short event, void *cookie)
usr.sbin/snmpd/application_agentx.c
921
appl_agentx_send(int fd, short event, void *cookie)
usr.sbin/snmpd/ax.c
59
ax_new(int fd)
usr.sbin/snmpd/ax.c
63
if (fd == -1) {
usr.sbin/snmpd/ax.c
70
ax->ax_fd = fd;
usr.sbin/snmpd/parse.y
1620
check_file_secrecy(int fd, const char *fname)
usr.sbin/snmpd/parse.y
1624
if (fstat(fd, &st)) {
usr.sbin/snmpd/proc.c
115
fd = ps->ps_pipes[p->p_id][i].pp_pipes[PROC_PARENT][0];
usr.sbin/snmpd/proc.c
124
if (fd != PROC_PARENT_SOCK_FILENO) {
usr.sbin/snmpd/proc.c
125
if (dup2(fd, PROC_PARENT_SOCK_FILENO) ==
usr.sbin/snmpd/proc.c
128
} else if (fcntl(fd, F_SETFD, 0) == -1)
usr.sbin/snmpd/proc.c
136
close(fd);
usr.sbin/snmpd/proc.c
169
event_set(&iev->ev, iev->ibuf.fd, iev->events,
usr.sbin/snmpd/proc.c
271
proc_accept(struct privsep *ps, int fd, enum privsep_procid dst,
usr.sbin/snmpd/proc.c
277
if (fd == -1 || dst < 0 || dst >= PROC_MAX ||
usr.sbin/snmpd/proc.c
289
close(fd);
usr.sbin/snmpd/proc.c
295
pp->pp_pipes[dst][n] = fd;
usr.sbin/snmpd/proc.c
298
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/snmpd/proc.c
301
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/snmpd/proc.c
597
proc_dispatch(int fd, short event, void *arg)
usr.sbin/snmpd/proc.c
652
if ((p->p_cb)(fd, p, &imsg) == 0) {
usr.sbin/snmpd/proc.c
724
proc_dispatch_null(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/snmpd/proc.c
746
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/snmpd/proc.c
752
pid_t pid, int fd, void *data, uint16_t datalen)
usr.sbin/snmpd/proc.c
757
pid, fd, data, datalen)) == -1)
usr.sbin/snmpd/proc.c
765
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/snmpd/proc.c
770
pid, fd, iov, iovcnt)) == -1)
usr.sbin/snmpd/proc.c
791
uint16_t type, uint32_t peerid, int fd, void *data, uint16_t datalen)
usr.sbin/snmpd/proc.c
798
type, peerid, ps->ps_instance + 1, fd, data, datalen) == -1)
usr.sbin/snmpd/proc.c
80
int fd;
usr.sbin/snmpd/proc.c
814
uint16_t type, uint32_t peerid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/snmpd/proc.c
821
type, peerid, ps->ps_instance + 1, fd, iov, iovcnt) == -1)
usr.sbin/snmpd/snmpd.c
287
snmpd_dispatch_snmpe(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/snmpd/snmpd.c
302
int fd, serrno;
usr.sbin/snmpd/snmpd.c
305
fd = socket(ss->ss_family, (type == SOCK_STREAM ?
usr.sbin/snmpd/snmpd.c
307
if (fd == -1)
usr.sbin/snmpd/snmpd.c
310
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable,
usr.sbin/snmpd/snmpd.c
313
close(fd);
usr.sbin/snmpd/snmpd.c
317
return fd;
usr.sbin/snmpd/snmpd.h
311
int fd;
usr.sbin/snmpd/snmpe.c
101
event_set(&h->ev, h->fd, EV_READ, snmpe_acceptcb, h);
usr.sbin/snmpd/snmpe.c
104
event_set(&h->ev, h->fd, EV_READ|EV_PERSIST,
usr.sbin/snmpd/snmpe.c
130
close(h->fd);
usr.sbin/snmpd/snmpe.c
136
snmpe_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/snmpd/snmpe.c
492
snmpe_acceptcb(int fd, short type, void *arg)
usr.sbin/snmpd/snmpe.c
504
if ((afd = accept4(fd, (struct sockaddr *)&ss, &len,
usr.sbin/snmpd/snmpe.c
52
void snmpe_recvmsg(int fd, short, void *);
usr.sbin/snmpd/snmpe.c
53
void snmpe_readcb(int fd, short, void *);
usr.sbin/snmpd/snmpe.c
532
snmpe_prepare_read(struct snmp_message *msg, int fd)
usr.sbin/snmpd/snmpe.c
534
msg->sm_sock = fd;
usr.sbin/snmpd/snmpe.c
537
event_set(&msg->sm_sockev, fd, EV_READ,
usr.sbin/snmpd/snmpe.c
54
void snmpe_writecb(int fd, short, void *);
usr.sbin/snmpd/snmpe.c
543
snmpe_tryparse(int fd, struct snmp_message *msg)
usr.sbin/snmpd/snmpe.c
55
void snmpe_acceptcb(int fd, short, void *);
usr.sbin/snmpd/snmpe.c
553
snmpe_prepare_read(msg, fd);
usr.sbin/snmpd/snmpe.c
572
close(fd);
usr.sbin/snmpd/snmpe.c
576
snmpe_readcb(int fd, short type, void *arg)
usr.sbin/snmpd/snmpe.c
584
len = read(fd, msg->sm_data + msg->sm_datalen,
usr.sbin/snmpd/snmpe.c
589
snmpe_prepare_read(msg, fd);
usr.sbin/snmpd/snmpe.c
594
snmpe_tryparse(fd, msg);
usr.sbin/snmpd/snmpe.c
599
close(fd);
usr.sbin/snmpd/snmpe.c
603
snmpe_writecb(int fd, short type, void *arg)
usr.sbin/snmpd/snmpe.c
617
log_debug("%s: write fd %d len %zd", __func__, fd, len);
usr.sbin/snmpd/snmpe.c
619
len = write(fd, ber->br_wptr, len);
usr.sbin/snmpd/snmpe.c
656
snmpe_tryparse(fd, nmsg);
usr.sbin/snmpd/snmpe.c
659
snmpe_prepare_read(nmsg, fd);
usr.sbin/snmpd/snmpe.c
664
close(fd);
usr.sbin/snmpd/snmpe.c
669
snmpe_recvmsg(int fd, short sig, void *arg)
usr.sbin/snmpd/snmpe.c
680
msg->sm_sock = fd;
usr.sbin/snmpd/snmpe.c
683
if ((len = recvfromto(fd, msg->sm_data, sizeof(msg->sm_data), 0,
usr.sbin/snmpd/snmpe.c
81
if ((h->fd = snmpe_bind(h)) == -1)
usr.sbin/snmpd/snmpe.c
99
if (listen(h->fd, 5) < 0)
usr.sbin/syslogd/evbuffer_tls.c
106
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_readcb,
usr.sbin/syslogd/evbuffer_tls.c
122
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
150
buffertls_writecb(int fd, short event, void *arg)
usr.sbin/syslogd/evbuffer_tls.c
164
res = evtls_write(bufev->output, fd, ctx);
usr.sbin/syslogd/evbuffer_tls.c
168
event_set(&bufev->ev_read, fd, EV_READ,
usr.sbin/syslogd/evbuffer_tls.c
187
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
208
buffertls_handshakecb(int fd, short event, void *arg)
usr.sbin/syslogd/evbuffer_tls.c
239
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
240
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
254
struct tls *ctx, int fd)
usr.sbin/syslogd/evbuffer_tls.c
256
bufferevent_setfd(bufev, fd);
usr.sbin/syslogd/evbuffer_tls.c
257
event_set(&bufev->ev_read, fd, EV_READ, buffertls_readcb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
258
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_writecb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
264
buffertls_accept(struct buffertls *buftls, int fd)
usr.sbin/syslogd/evbuffer_tls.c
270
event_set(&bufev->ev_read, fd, EV_READ, buffertls_handshakecb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
271
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_handshakecb,
usr.sbin/syslogd/evbuffer_tls.c
277
buffertls_connect(struct buffertls *buftls, int fd)
usr.sbin/syslogd/evbuffer_tls.c
283
event_set(&bufev->ev_read, fd, EV_READ, buffertls_handshakecb, buftls);
usr.sbin/syslogd/evbuffer_tls.c
284
event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_handshakecb,
usr.sbin/syslogd/evbuffer_tls.c
296
evtls_read(struct evbuffer *buf, int fd, int howmuch, struct tls *ctx)
usr.sbin/syslogd/evbuffer_tls.c
326
evtls_write(struct evbuffer *buffer, int fd, struct tls *ctx)
usr.sbin/syslogd/evbuffer_tls.c
68
buffertls_readcb(int fd, short event, void *arg)
usr.sbin/syslogd/evbuffer_tls.c
99
res = evtls_read(bufev->input, fd, howmuch, ctx);
usr.sbin/syslogd/privsep.c
168
int i, fd, sock, cmd, addr_len, result, restart;
usr.sbin/syslogd/privsep.c
260
fd = open(path, O_WRONLY|O_NONBLOCK);
usr.sbin/syslogd/privsep.c
261
send_fd(sock, fd);
usr.sbin/syslogd/privsep.c
262
if (fd == -1)
usr.sbin/syslogd/privsep.c
265
close(fd);
usr.sbin/syslogd/privsep.c
281
fd = open_file(path);
usr.sbin/syslogd/privsep.c
283
fd = open_pipe(path);
usr.sbin/syslogd/privsep.c
287
send_fd(sock, fd);
usr.sbin/syslogd/privsep.c
288
if (fd == -1)
usr.sbin/syslogd/privsep.c
291
close(fd);
usr.sbin/syslogd/privsep.c
296
fd = open(_PATH_UTMP, O_RDONLY|O_NONBLOCK);
usr.sbin/syslogd/privsep.c
297
send_fd(sock, fd);
usr.sbin/syslogd/privsep.c
298
if (fd == -1)
usr.sbin/syslogd/privsep.c
301
close(fd);
usr.sbin/syslogd/privsep.c
307
fd = open(conf, O_RDONLY|O_NONBLOCK);
usr.sbin/syslogd/privsep.c
308
send_fd(sock, fd);
usr.sbin/syslogd/privsep.c
309
if (fd == -1)
usr.sbin/syslogd/privsep.c
312
close(fd);
usr.sbin/syslogd/privsep.c
463
int fd[2];
usr.sbin/syslogd/privsep.c
477
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fd) == -1) {
usr.sbin/syslogd/privsep.c
483
if ((flags = fcntl(fd[1], F_GETFL)) == -1) {
usr.sbin/syslogd/privsep.c
488
if ((flags = fcntl(fd[1], F_SETFL, flags)) == -1) {
usr.sbin/syslogd/privsep.c
500
close(fd[0]);
usr.sbin/syslogd/privsep.c
501
return (fd[1]);
usr.sbin/syslogd/privsep.c
504
close(fd[1]);
usr.sbin/syslogd/privsep.c
508
while (bsize > 0 && setsockopt(fd[0], SOL_SOCKET, SO_RCVBUF,
usr.sbin/syslogd/privsep.c
517
if (dup2(fd[0], STDIN_FILENO) == -1)
usr.sbin/syslogd/privsep.c
612
int cmd, fd;
usr.sbin/syslogd/privsep.c
626
fd = receive_fd(priv_fd);
usr.sbin/syslogd/privsep.c
627
return fd;
usr.sbin/syslogd/privsep.c
635
int cmd, fd;
usr.sbin/syslogd/privsep.c
652
fd = receive_fd(priv_fd);
usr.sbin/syslogd/privsep.c
653
return fd;
usr.sbin/syslogd/privsep.c
660
int cmd, fd;
usr.sbin/syslogd/privsep.c
668
fd = receive_fd(priv_fd);
usr.sbin/syslogd/privsep.c
669
if (fd < 0)
usr.sbin/syslogd/privsep.c
672
fp = fdopen(fd, "r");
usr.sbin/syslogd/privsep.c
675
close(fd);
usr.sbin/syslogd/privsep.c
686
int cmd, fd;
usr.sbin/syslogd/privsep.c
694
fd = receive_fd(priv_fd);
usr.sbin/syslogd/privsep.c
695
if (fd < 0)
usr.sbin/syslogd/privsep.c
698
fp = fdopen(fd, "r");
usr.sbin/syslogd/privsep.c
701
close(fd);
usr.sbin/syslogd/privsep.c
849
may_read(int fd, void *buf, size_t n)
usr.sbin/syslogd/privsep.c
856
res = read(fd, s + pos, n - pos);
usr.sbin/syslogd/privsep.c
873
must_read(int fd, void *buf, size_t n)
usr.sbin/syslogd/privsep.c
880
res = read(fd, s + pos, n - pos);
usr.sbin/syslogd/privsep.c
896
must_write(int fd, void *buf, size_t n)
usr.sbin/syslogd/privsep.c
903
res = write(fd, s + pos, n - pos);
usr.sbin/syslogd/privsep_fdpass.c
124
fd = (*(int *)CMSG_DATA(cmsg));
usr.sbin/syslogd/privsep_fdpass.c
125
return fd;
usr.sbin/syslogd/privsep_fdpass.c
45
send_fd(int sock, int fd)
usr.sbin/syslogd/privsep_fdpass.c
59
if (fd >= 0) {
usr.sbin/syslogd/privsep_fdpass.c
66
*(int *)CMSG_DATA(cmsg) = fd;
usr.sbin/syslogd/privsep_fdpass.c
95
int fd;
usr.sbin/syslogd/syslogd.c
1026
if (*fd == -1 && *fd6 == -1)
usr.sbin/syslogd/syslogd.c
1032
klog_readcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
1037
n = read(fd, linebuf, linesize - 1);
usr.sbin/syslogd/syslogd.c
1048
udp_readcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
1055
n = recvfrom(fd, linebuf, LOG_MAXLINE, 0, (struct sockaddr *)&sa,
usr.sbin/syslogd/syslogd.c
1069
unix_readcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
1076
n = recvfrom(fd, linebuf, LOG_MAXLINE, 0, (struct sockaddr *)&sa,
usr.sbin/syslogd/syslogd.c
1144
int fd, error;
usr.sbin/syslogd/syslogd.c
1147
if ((fd = reserve_accept4(lfd, event, ev, tcp_acceptcb,
usr.sbin/syslogd/syslogd.c
1174
close(fd);
usr.sbin/syslogd/syslogd.c
1177
p->p_fd = fd;
usr.sbin/syslogd/syslogd.c
1180
if ((p->p_bufev = bufferevent_new(fd,
usr.sbin/syslogd/syslogd.c
1187
close(fd);
usr.sbin/syslogd/syslogd.c
1191
if (tls_accept_socket(server_ctx, &p->p_ctx, fd) == -1) {
usr.sbin/syslogd/syslogd.c
1198
close(fd);
usr.sbin/syslogd/syslogd.c
1201
buffertls_set(&p->p_buftls, p->p_bufev, p->p_ctx, fd);
usr.sbin/syslogd/syslogd.c
1202
buffertls_accept(&p->p_buftls, fd);
usr.sbin/syslogd/syslogd.c
1507
tcp_connectcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
1625
udp_resolvecb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
3136
int fd, optval;
usr.sbin/syslogd/syslogd.c
3147
if ((fd = socket(AF_UNIX, type, 0)) == -1) {
usr.sbin/syslogd/syslogd.c
3153
if (connect(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == 0 ||
usr.sbin/syslogd/syslogd.c
3155
close(fd);
usr.sbin/syslogd/syslogd.c
3165
if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) {
usr.sbin/syslogd/syslogd.c
3168
close(fd);
usr.sbin/syslogd/syslogd.c
3176
close(fd);
usr.sbin/syslogd/syslogd.c
3182
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &optval, sizeof(optval))
usr.sbin/syslogd/syslogd.c
3186
return (fd);
usr.sbin/syslogd/syslogd.c
3194
double_sockbuf(int fd, int optname, int bigsize)
usr.sbin/syslogd/syslogd.c
3200
if (getsockopt(fd, SOL_SOCKET, optname, &oldsize, &len) == -1)
usr.sbin/syslogd/syslogd.c
3208
if (setsockopt(fd, SOL_SOCKET, optname, &newsize, len) == -1)
usr.sbin/syslogd/syslogd.c
3214
if (setsockopt(fd, SOL_SOCKET, optname, &bigsize, len) == -1)
usr.sbin/syslogd/syslogd.c
3220
set_sockbuf(int fd)
usr.sbin/syslogd/syslogd.c
3224
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)) == -1)
usr.sbin/syslogd/syslogd.c
3226
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) == -1)
usr.sbin/syslogd/syslogd.c
3231
set_keepalive(int fd)
usr.sbin/syslogd/syslogd.c
3235
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1)
usr.sbin/syslogd/syslogd.c
3259
ctlsock_acceptcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
3263
if ((fd = reserve_accept4(fd, event, ev, ctlsock_acceptcb,
usr.sbin/syslogd/syslogd.c
3279
fd_ctlconn = fd;
usr.sbin/syslogd/syslogd.c
3304
ctlconn_readcb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
3319
n = read(fd, (char*)&ctl_cmd + ctl_cmd_bytes,
usr.sbin/syslogd/syslogd.c
3436
ctlconn_writecb(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
3450
n = write(fd, ctl_reply + ctl_reply_offset,
usr.sbin/syslogd/syslogd.c
386
int lockpipe[2] = { -1, -1}, pair[2], nullfd, fd;
usr.sbin/syslogd/syslogd.c
504
for (fd = nullfd + 1; fd <= STDERR_FILENO; fd++) {
usr.sbin/syslogd/syslogd.c
505
if (fcntl(fd, F_GETFL) == -1 && errno == EBADF)
usr.sbin/syslogd/syslogd.c
506
if (dup2(nullfd, fd) == -1)
usr.sbin/syslogd/syslogd.c
926
int shutread, int *fd, int *fd6)
usr.sbin/syslogd/syslogd.c
932
*fd = *fd6 = -1;
usr.sbin/syslogd/syslogd.c
958
fdp = fd;
usr.sbin/syslogd/ttymsg.c
107
if ((fd = priv_open_tty(device)) == -1) {
usr.sbin/syslogd/ttymsg.c
118
wret = writev(fd, iov, iovcnt);
usr.sbin/syslogd/ttymsg.c
173
event_set(&td->td_event, fd, EV_WRITE, ttycb, td);
usr.sbin/syslogd/ttymsg.c
188
(void) close(fd);
usr.sbin/syslogd/ttymsg.c
193
ttycb(int fd, short event, void *arg)
usr.sbin/syslogd/ttymsg.c
202
wret = write(fd, td->td_line, td->td_length);
usr.sbin/syslogd/ttymsg.c
218
close(fd);
usr.sbin/syslogd/ttymsg.c
84
int cnt, fd;
usr.sbin/tcpdump/pfctl_osfp.c
100
fd = priv_open_pfosfp();
usr.sbin/tcpdump/pfctl_osfp.c
101
if (fd < 0)
usr.sbin/tcpdump/pfctl_osfp.c
104
if ((in = fdopen(fd, "r")) == NULL) {
usr.sbin/tcpdump/pfctl_osfp.c
91
int i, fd, lineno = 0;
usr.sbin/tcpdump/privsep.c
118
static void impl_localtime(int fd);
usr.sbin/tcpdump/privsep.c
366
impl_open_bpf(int fd, int *bpfd)
usr.sbin/tcpdump/privsep.c
375
must_read(fd, &snaplen, sizeof(int));
usr.sbin/tcpdump/privsep.c
376
must_read(fd, &promisc, sizeof(int));
usr.sbin/tcpdump/privsep.c
377
must_read(fd, &dlt, sizeof(u_int));
usr.sbin/tcpdump/privsep.c
378
must_read(fd, &dirfilt, sizeof(u_int));
usr.sbin/tcpdump/privsep.c
379
must_read(fd, &fildrop, sizeof(fildrop));
usr.sbin/tcpdump/privsep.c
380
iflen = read_string(fd, device, sizeof(device), __func__);
usr.sbin/tcpdump/privsep.c
389
send_fd(fd, *bpfd);
usr.sbin/tcpdump/privsep.c
390
must_write(fd, &err, sizeof(int));
usr.sbin/tcpdump/privsep.c
404
impl_open_dump(int fd, const char *RFileName)
usr.sbin/tcpdump/privsep.c
420
send_fd(fd, file);
usr.sbin/tcpdump/privsep.c
421
must_write(fd, &err, sizeof(int));
usr.sbin/tcpdump/privsep.c
427
impl_open_pfosfp(int fd)
usr.sbin/tcpdump/privsep.c
438
send_fd(fd, file);
usr.sbin/tcpdump/privsep.c
439
must_write(fd, &err, sizeof(int));
usr.sbin/tcpdump/privsep.c
445
impl_open_output(int fd, const char *WFileName)
usr.sbin/tcpdump/privsep.c
453
send_fd(fd, file);
usr.sbin/tcpdump/privsep.c
454
must_write(fd, &err, sizeof(int));
usr.sbin/tcpdump/privsep.c
463
impl_setfilter(int fd, char *cmdbuf, int *bpfd)
usr.sbin/tcpdump/privsep.c
467
if (setfilter(*bpfd, fd, cmdbuf))
usr.sbin/tcpdump/privsep.c
472
impl_init_done(int fd, int *bpfd)
usr.sbin/tcpdump/privsep.c
483
must_write(fd, &ret, sizeof(ret));
usr.sbin/tcpdump/privsep.c
487
impl_gethostbyaddr(int fd)
usr.sbin/tcpdump/privsep.c
497
hostname_len = read_block(fd, hostname, sizeof(hostname), __func__);
usr.sbin/tcpdump/privsep.c
500
must_read(fd, &addr_af, sizeof(int));
usr.sbin/tcpdump/privsep.c
503
write_zero(fd);
usr.sbin/tcpdump/privsep.c
505
write_string(fd, hp->h_name);
usr.sbin/tcpdump/privsep.c
509
impl_ether_ntohost(int fd)
usr.sbin/tcpdump/privsep.c
517
must_read(fd, &ether, sizeof(ether));
usr.sbin/tcpdump/privsep.c
519
write_zero(fd);
usr.sbin/tcpdump/privsep.c
521
write_string(fd, hostname);
usr.sbin/tcpdump/privsep.c
525
impl_getrpcbynumber(int fd)
usr.sbin/tcpdump/privsep.c
532
must_read(fd, &rpc, sizeof(int));
usr.sbin/tcpdump/privsep.c
535
write_zero(fd);
usr.sbin/tcpdump/privsep.c
537
write_string(fd, rpce->r_name);
usr.sbin/tcpdump/privsep.c
541
impl_getserventries(int fd)
usr.sbin/tcpdump/privsep.c
550
write_zero(fd);
usr.sbin/tcpdump/privsep.c
553
write_string(fd, sp->s_name);
usr.sbin/tcpdump/privsep.c
554
must_write(fd, &sp->s_port, sizeof(int));
usr.sbin/tcpdump/privsep.c
555
write_string(fd, sp->s_proto);
usr.sbin/tcpdump/privsep.c
562
impl_getprotoentries(int fd)
usr.sbin/tcpdump/privsep.c
571
write_zero(fd);
usr.sbin/tcpdump/privsep.c
574
write_string(fd, pe->p_name);
usr.sbin/tcpdump/privsep.c
575
must_write(fd, &pe->p_proto, sizeof(int));
usr.sbin/tcpdump/privsep.c
584
impl_localtime(int fd)
usr.sbin/tcpdump/privsep.c
592
must_read(fd, &t, sizeof(time_t));
usr.sbin/tcpdump/privsep.c
600
must_write(fd, lt, sizeof(*lt));
usr.sbin/tcpdump/privsep.c
605
must_write(fd, gt, sizeof(*gt));
usr.sbin/tcpdump/privsep.c
608
write_zero(fd);
usr.sbin/tcpdump/privsep.c
610
write_string(fd, zone);
usr.sbin/tcpdump/privsep.c
614
impl_pcap_stats(int fd, int *bpfd)
usr.sbin/tcpdump/privsep.c
621
write_zero(fd);
usr.sbin/tcpdump/privsep.c
623
must_write(fd, &stats, sizeof(stats));
usr.sbin/tcpdump/privsep.c
787
int fd, err = 0;
usr.sbin/tcpdump/privsep.c
790
fd = receive_fd(priv_fd);
usr.sbin/tcpdump/privsep.c
792
if (fd < 0) {
usr.sbin/tcpdump/privsep.c
797
return (fd);
usr.sbin/tcpdump/privsep.c
802
may_read(int fd, void *buf, size_t n)
usr.sbin/tcpdump/privsep.c
808
res = read(fd, s + pos, n - pos);
usr.sbin/tcpdump/privsep.c
826
must_read(int fd, void *buf, size_t n)
usr.sbin/tcpdump/privsep.c
832
res = read(fd, s + pos, n - pos);
usr.sbin/tcpdump/privsep.c
849
must_write(int fd, const void *buf, size_t n)
usr.sbin/tcpdump/privsep.c
855
res = write(fd, s + pos, n - pos);
usr.sbin/tcpdump/privsep.c
907
write_command(int fd, int cmd)
usr.sbin/tcpdump/privsep.c
909
must_write(fd, &cmd, sizeof(cmd));
usr.sbin/tcpdump/privsep.c
914
write_zero(int fd)
usr.sbin/tcpdump/privsep.c
917
must_write(fd, &len, sizeof(size_t));
usr.sbin/tcpdump/privsep.c
922
write_string(int fd, const char *str)
usr.sbin/tcpdump/privsep.c
927
must_write(fd, &len, sizeof(size_t));
usr.sbin/tcpdump/privsep.c
928
must_write(fd, str, len);
usr.sbin/tcpdump/privsep.c
933
write_block(int fd, size_t size, const char *str)
usr.sbin/tcpdump/privsep.c
935
must_write(fd, &size, sizeof(size_t));
usr.sbin/tcpdump/privsep.c
936
must_write(fd, str, size);
usr.sbin/tcpdump/privsep.c
942
read_string(int fd, char *buf, size_t size, const char *func)
usr.sbin/tcpdump/privsep.c
946
len = read_block(fd, buf, size, func);
usr.sbin/tcpdump/privsep.c
959
read_block(int fd, char *buf, size_t size, const char *func)
usr.sbin/tcpdump/privsep.c
963
must_read(fd, &len, sizeof(size_t));
usr.sbin/tcpdump/privsep.c
974
must_read(fd, buf, len);
usr.sbin/tcpdump/privsep_fdpass.c
108
fd = (*(int *)CMSG_DATA(cmsg));
usr.sbin/tcpdump/privsep_fdpass.c
109
return (fd);
usr.sbin/tcpdump/privsep_fdpass.c
33
send_fd(int sock, int fd)
usr.sbin/tcpdump/privsep_fdpass.c
47
if (fd >= 0) {
usr.sbin/tcpdump/privsep_fdpass.c
54
*(int *)CMSG_DATA(cmsg) = fd;
usr.sbin/tcpdump/privsep_fdpass.c
82
int fd;
usr.sbin/tcpdump/privsep_pcap.c
178
int fd;
usr.sbin/tcpdump/privsep_pcap.c
185
if ((fd = open("/dev/bpf", O_RDONLY)) == -1)
usr.sbin/tcpdump/privsep_pcap.c
189
ioctl(fd, BIOCSBLEN, &v);
usr.sbin/tcpdump/privsep_pcap.c
192
if (ioctl(fd, BIOCSETIF, &ifr) == -1)
usr.sbin/tcpdump/privsep_pcap.c
195
if (dlt != (u_int) -1 && ioctl(fd, BIOCSDLT, &dlt) == -1)
usr.sbin/tcpdump/privsep_pcap.c
200
ioctl(fd, BIOCPROMISC, NULL);
usr.sbin/tcpdump/privsep_pcap.c
201
if (ioctl(fd, BIOCSDIRFILT, &dirfilt) == -1)
usr.sbin/tcpdump/privsep_pcap.c
204
if (ioctl(fd, BIOCSFILDROP, &fildrop) == -1)
usr.sbin/tcpdump/privsep_pcap.c
206
return (fd);
usr.sbin/tcpdump/privsep_pcap.c
209
close(fd);
usr.sbin/tcpdump/privsep_pcap.c
222
int fd, err;
usr.sbin/tcpdump/privsep_pcap.c
252
fd = receive_fd(priv_fd);
usr.sbin/tcpdump/privsep_pcap.c
254
if (fd < 0) {
usr.sbin/tcpdump/privsep_pcap.c
262
if (ioctl(fd, BIOCVERSION, &bv) == -1) {
usr.sbin/tcpdump/privsep_pcap.c
275
p->fd = fd;
usr.sbin/tcpdump/privsep_pcap.c
279
if (ioctl(fd, BIOCGDLT, &v) == -1) {
usr.sbin/tcpdump/privsep_pcap.c
295
if (ioctl(p->fd, BIOCSRTIMEOUT, &to) == -1) {
usr.sbin/tcpdump/privsep_pcap.c
302
if (ioctl(fd, BIOCGBLEN, &v) == -1) {
usr.sbin/tcpdump/privsep_pcap.c
317
if (fd >= 0)
usr.sbin/tcpdump/privsep_pcap.c
318
close(fd);
usr.sbin/tcpdump/privsep_pcap.c
361
p->fd = -1;
usr.sbin/tcpdump/privsep_pcap.c
365
p->fd = receive_fd(priv_fd);
usr.sbin/tcpdump/privsep_pcap.c
367
if (p->fd < 0) {
usr.sbin/tcpdump/privsep_pcap.c
374
fp = fdopen(p->fd, "r");
usr.sbin/tcpdump/privsep_pcap.c
378
close(p->fd);
usr.sbin/tcpdump/privsep_pcap.c
379
p->fd = -1;
usr.sbin/tcpdump/privsep_pcap.c
445
if (fp != NULL && p->fd != -1)
usr.sbin/tcpdump/privsep_pcap.c
476
int fd, err;
usr.sbin/tcpdump/privsep_pcap.c
486
fd = receive_fd(priv_fd);
usr.sbin/tcpdump/privsep_pcap.c
488
if (fd < 0) {
usr.sbin/tcpdump/privsep_pcap.c
494
f = fdopen(fd, "w");
usr.sbin/tcpdump/privsep_pcap.c
498
close(fd);
usr.sbin/tcpdump/tcpdump.c
181
int fd = p->fd;
usr.sbin/tcpdump/tcpdump.c
189
if (fd < 0)
usr.sbin/tcpdump/tcpdump.c
192
if (ioctl(fd, BIOCGDLTLIST, &dl) == -1)
usr.sbin/tcpdump/util.c
263
int fd;
usr.sbin/tcpdump/util.c
268
fd = open(fname, O_RDONLY);
usr.sbin/tcpdump/util.c
269
if (fd == -1)
usr.sbin/tcpdump/util.c
272
if (fstat(fd, &buf) == -1)
usr.sbin/tcpdump/util.c
282
cc = read(fd, cp, bs);
usr.sbin/tcpdump/util.c
289
close(fd);
usr.sbin/tftp-proxy/tftp-proxy.c
409
privproc_pop(int fd, short events, void *arg)
usr.sbin/tftp-proxy/tftp-proxy.c
417
switch (evbuffer_read(p->buf, fd, sizeof(req))) {
usr.sbin/tftp-proxy/tftp-proxy.c
443
rep->fd = socket(req.src.ss_family, SOCK_DGRAM | SOCK_NONBLOCK,
usr.sbin/tftp-proxy/tftp-proxy.c
445
if (rep->fd == -1)
usr.sbin/tftp-proxy/tftp-proxy.c
448
if (setsockopt(rep->fd, SOL_SOCKET, SO_BINDANY,
usr.sbin/tftp-proxy/tftp-proxy.c
452
if (setsockopt(rep->fd, SOL_SOCKET, SO_REUSEADDR,
usr.sbin/tftp-proxy/tftp-proxy.c
456
if (setsockopt(rep->fd, SOL_SOCKET, SO_REUSEPORT,
usr.sbin/tftp-proxy/tftp-proxy.c
464
if (bind(rep->fd, (struct sockaddr *)&req.src,
usr.sbin/tftp-proxy/tftp-proxy.c
468
if (bind(rep->fd, (struct sockaddr*)&saddr->addr,
usr.sbin/tftp-proxy/tftp-proxy.c
484
privproc_push(int fd, short events, void *arg)
usr.sbin/tftp-proxy/tftp-proxy.c
507
*(int *)CMSG_DATA(cmsg) = rep->fd;
usr.sbin/tftp-proxy/tftp-proxy.c
514
switch (sendmsg(fd, &msg, 0)) {
usr.sbin/tftp-proxy/tftp-proxy.c
530
close(rep->fd);
usr.sbin/tftp-proxy/tftp-proxy.c
677
proxy_recv(int fd, short events, void *arg)
usr.sbin/tftp-proxy/tftp-proxy.c
696
recv(fd, safety, sizeof(safety), 0);
usr.sbin/tftp-proxy/tftp-proxy.c
711
n = recvmsg(fd, &msg, 0);
usr.sbin/tftp-proxy/tftp-proxy.c
769
unprivproc_push(int fd, short events, void *arg)
usr.sbin/tftp-proxy/tftp-proxy.c
771
if (evbuffer_write(child->buf, fd) == -1)
usr.sbin/tftp-proxy/tftp-proxy.c
779
unprivproc_pop(int fd, short events, void *arg)
usr.sbin/tftp-proxy/tftp-proxy.c
807
switch (recvmsg(fd, &msg, 0)) {
usr.sbin/tftp-proxy/tftp-proxy.c
81
int fd;
usr.sbin/tftp-proxy/tftp-proxy.c
901
unprivproc_timeout(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
1058
fd = open(filename, mode == RRQ ? O_RDONLY : (O_WRONLY|wmode), 0666);
usr.sbin/tftpd/tftpd.c
1059
if (fd == -1)
usr.sbin/tftpd/tftpd.c
1064
if ((wmode & O_CREAT) && fchmod(fd, 0666) == -1) {
usr.sbin/tftpd/tftpd.c
1067
close(fd);
usr.sbin/tftpd/tftpd.c
1072
client->file = fdopen(fd, mode == RRQ ? "r" : "w");
usr.sbin/tftpd/tftpd.c
1074
close(fd);
usr.sbin/tftpd/tftpd.c
1193
tftp_rrq_ack(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
1209
n = recv(fd, rbuf, sizeof(rbuf), 0);
usr.sbin/tftpd/tftpd.c
1320
tftp_wrq(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
1337
n = recv(fd, wbuf, client->packet_size, 0);
usr.sbin/tftpd/tftpd.c
1406
tftp_wrq_end(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
1418
n = recv(fd, wbuf, client->packet_size, 0);
usr.sbin/tftpd/tftpd.c
1578
oack_done(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
498
rewrite_req(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
500
if (evbuffer_write(rwmap->wrbuf, fd) == -1) {
usr.sbin/tftpd/tftpd.c
516
rewrite_res(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
522
switch (evbuffer_read(rwmap->rdbuf, fd, PATH_MAX)) {
usr.sbin/tftpd/tftpd.c
668
tftpd_recv(int fd, short events, void *arg)
usr.sbin/tftpd/tftpd.c
691
recv(fd, buf, SEGSIZE_MAX + 4, 0);
usr.sbin/tftpd/tftpd.c
706
n = recvmsg(fd, &msg, 0);
usr.sbin/tftpd/tftpd.c
975
int fd, wmode;
usr.sbin/traceroute/traceroute.c
914
sock_read(int fd, short events, void *arg)
usr.sbin/traceroute/traceroute.c
992
send_timer(int fd, short events, void *arg)
usr.sbin/unbound/daemon/remote.c
280
int fd, r;
usr.sbin/unbound/daemon/remote.c
289
fd = create_local_accept_sock(ip, &noproto, cfg->use_systemd);
usr.sbin/unbound/daemon/remote.c
295
if(fd != -1) {
usr.sbin/unbound/daemon/remote.c
351
fd = create_tcp_accept_sock(res, 1, &noproto, 0,
usr.sbin/unbound/daemon/remote.c
357
if(fd == -1 && noproto) {
usr.sbin/unbound/daemon/remote.c
364
if(fd == -1) {
usr.sbin/unbound/daemon/remote.c
372
sock_close(fd);
usr.sbin/unbound/daemon/remote.c
378
n->fd = fd;
usr.sbin/unbound/daemon/remote.c
419
accept_open(struct daemon_remote* rc, int fd)
usr.sbin/unbound/daemon/remote.c
4223
WSAEventSelect(s->c->fd, NULL, 0);
usr.sbin/unbound/daemon/remote.c
4225
fd_set_block(s->c->fd);
usr.sbin/unbound/daemon/remote.c
4239
ssize_t rr = recv(res->fd, magic, sizeof(magic)-1, 0);
usr.sbin/unbound/daemon/remote.c
429
n->com = comm_point_create_raw(rc->worker->base, fd, 0,
usr.sbin/unbound/daemon/remote.c
4357
res.fd = c->fd;
usr.sbin/unbound/daemon/remote.c
4377
sock_poll_timeout(int fd, int timeout, int pollin, int pollout, int* event)
usr.sbin/unbound/daemon/remote.c
4391
if(fd == -1) {
usr.sbin/unbound/daemon/remote.c
4398
p.fd = fd;
usr.sbin/unbound/daemon/remote.c
444
if(!accept_open(rc, p->fd)) {
usr.sbin/unbound/daemon/remote.c
498
n->fd = newfd;
usr.sbin/unbound/daemon/remote.c
599
ssize_t r = send(res->fd, text+at, strlen(text)-at, 0);
usr.sbin/unbound/daemon/remote.c
654
ssize_t rr = recv(res->fd, buf+len, 1, 0);
usr.sbin/unbound/daemon/remote.c
8145
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits),
usr.sbin/unbound/daemon/remote.c
8215
r = (int)send(printq->remote.fd,
usr.sbin/unbound/daemon/remote.c
8536
fd_set_nonblock(s->c->fd);
usr.sbin/unbound/daemon/remote.h
119
int fd;
usr.sbin/unbound/daemon/remote.h
369
void fast_reload_service_cb(int fd, short bits, void* arg);
usr.sbin/unbound/daemon/remote.h
79
int fd;
usr.sbin/unbound/daemon/unbound.c
329
int fd;
usr.sbin/unbound/daemon/unbound.c
335
if ((fd = open(file, O_RDONLY)) == -1) {
usr.sbin/unbound/daemon/unbound.c
342
if (((l = read(fd, pidbuf, sizeof(pidbuf)))) == -1) {
usr.sbin/unbound/daemon/unbound.c
346
close(fd);
usr.sbin/unbound/daemon/unbound.c
350
close(fd);
usr.sbin/unbound/daemon/unbound.c
373
int fd;
usr.sbin/unbound/daemon/unbound.c
378
if((fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC
usr.sbin/unbound/daemon/unbound.c
388
ssize_t r = write(fd, pidbuf+count, strlen(pidbuf)-count);
usr.sbin/unbound/daemon/unbound.c
394
close(fd);
usr.sbin/unbound/daemon/unbound.c
399
close(fd);
usr.sbin/unbound/daemon/unbound.c
404
close(fd);
usr.sbin/unbound/daemon/unbound.c
439
int fd;
usr.sbin/unbound/daemon/unbound.c
455
if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
usr.sbin/unbound/daemon/unbound.c
456
(void)dup2(fd, STDIN_FILENO);
usr.sbin/unbound/daemon/unbound.c
457
(void)dup2(fd, STDOUT_FILENO);
usr.sbin/unbound/daemon/unbound.c
458
(void)dup2(fd, STDERR_FILENO);
usr.sbin/unbound/daemon/unbound.c
459
if (fd > 2)
usr.sbin/unbound/daemon/unbound.c
460
(void)close(fd);
usr.sbin/unbound/daemon/unbound.c
734
int fd;
usr.sbin/unbound/daemon/unbound.c
736
fd = open(daemon->pidfile, O_WRONLY | O_TRUNC
usr.sbin/unbound/daemon/unbound.c
741
if(fd != -1)
usr.sbin/unbound/daemon/unbound.c
742
close(fd);
usr.sbin/unbound/daemon/worker.c
2664
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/daemon/worker.c
2672
void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/daemon/worker.c
2680
void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/daemon/worker.c
2688
void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/dns64/dns64.c
727
const struct packed_rrset_data* fd,
usr.sbin/unbound/dns64/dns64.c
739
if(fd->count > RR_COUNT_MAX) {
usr.sbin/unbound/dns64/dns64.c
745
+ fd->count * (sizeof(size_t) + sizeof(time_t) +
usr.sbin/unbound/dns64/dns64.c
752
dd->ttl = fd->ttl;
usr.sbin/unbound/dns64/dns64.c
753
dd->count = fd->count;
usr.sbin/unbound/dns64/dns64.c
755
dd->trust = fd->trust;
usr.sbin/unbound/dns64/dns64.c
756
dd->security = fd->security;
usr.sbin/unbound/dns64/dns64.c
765
for(i = 0; i < fd->count; ++i) {
usr.sbin/unbound/dns64/dns64.c
766
if (fd->rr_len[i] != 6 || fd->rr_data[i][0] != 0
usr.sbin/unbound/dns64/dns64.c
767
|| fd->rr_data[i][1] != 4) {
usr.sbin/unbound/dns64/dns64.c
779
dns64_env->prefix_net, &fd->rr_data[i][2],
usr.sbin/unbound/dns64/dns64.c
780
fd->rr_len[i]-2, &dd->rr_data[i][2],
usr.sbin/unbound/dns64/dns64.c
782
dd->rr_ttl[i] = fd->rr_ttl[i];
usr.sbin/unbound/dns64/dns64.c
826
struct packed_rrset_data* fd, *dd;
usr.sbin/unbound/dns64/dns64.c
867
fd = (struct packed_rrset_data*)fk->entry.data;
usr.sbin/unbound/dns64/dns64.c
873
dns64_synth_aaaa_data(fk, fd, dk, &dd, super->region, dns64_env);
usr.sbin/unbound/dns64/dns64.c
895
s = packed_rrset_sizeof(fd);
usr.sbin/unbound/dns64/dns64.c
897
super->region, fd, s);
usr.sbin/unbound/dnscrypt/dnscrypt.c
546
int fd;
usr.sbin/unbound/dnscrypt/dnscrypt.c
547
fd = open(fname, O_RDONLY);
usr.sbin/unbound/dnscrypt/dnscrypt.c
548
if (fd == -1) {
usr.sbin/unbound/dnscrypt/dnscrypt.c
551
if (read(fd, buf, count) != (ssize_t)count) {
usr.sbin/unbound/dnscrypt/dnscrypt.c
552
close(fd);
usr.sbin/unbound/dnscrypt/dnscrypt.c
555
close(fd);
usr.sbin/unbound/dnstap/dtstream.c
1063
if(dtio->fd == -1) return 0;
usr.sbin/unbound/dnstap/dtstream.c
1488
void dtio_output_cb(int ATTR_UNUSED(fd), short bits, void* arg)
usr.sbin/unbound/dnstap/dtstream.c
1582
void dtio_cmd_cb(int fd, short ATTR_UNUSED(bits), void* arg)
usr.sbin/unbound/dnstap/dtstream.c
1589
r = read(fd, &cmd, sizeof(cmd));
usr.sbin/unbound/dnstap/dtstream.c
1726
void dtio_stop_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits),
usr.sbin/unbound/dnstap/dtstream.c
1737
void dtio_stop_ev_cb(int ATTR_UNUSED(fd), short bits, void* arg)
usr.sbin/unbound/dnstap/dtstream.c
1769
if(dtio->fd == -1) {
usr.sbin/unbound/dnstap/dtstream.c
1781
if(dtio->fd == -1) {
usr.sbin/unbound/dnstap/dtstream.c
1815
if(dtio->fd == -1 || dtio->check_nb_connect) {
usr.sbin/unbound/dnstap/dtstream.c
1849
stopev = ub_event_new(info.base, dtio->fd, UB_EV_READ |
usr.sbin/unbound/dnstap/dtstream.c
1960
dtio->fd = socket(AF_LOCAL, SOCK_STREAM, 0);
usr.sbin/unbound/dnstap/dtstream.c
1961
if(dtio->fd == -1) {
usr.sbin/unbound/dnstap/dtstream.c
1974
fd_set_nonblock(dtio->fd);
usr.sbin/unbound/dnstap/dtstream.c
1975
if(connect(dtio->fd, (struct sockaddr*)&s, (socklen_t)sizeof(s))
usr.sbin/unbound/dnstap/dtstream.c
2007
dtio->fd = socket(addr.ss_family, SOCK_STREAM, 0);
usr.sbin/unbound/dnstap/dtstream.c
2008
if(dtio->fd == -1) {
usr.sbin/unbound/dnstap/dtstream.c
2012
fd_set_nonblock(dtio->fd);
usr.sbin/unbound/dnstap/dtstream.c
2013
if(connect(dtio->fd, (struct sockaddr*)&addr, addrlen) == -1) {
usr.sbin/unbound/dnstap/dtstream.c
2046
dtio->ssl = outgoing_ssl_fd(dtio->ssl_ctx, dtio->fd);
usr.sbin/unbound/dnstap/dtstream.c
2084
ev = ub_event_new(dtio->event_base, dtio->fd,
usr.sbin/unbound/dnstap/dtstream.c
566
void dtio_reconnect_timeout_cb(int ATTR_UNUSED(fd),
usr.sbin/unbound/dnstap/dtstream.c
679
sock_close(dtio->fd);
usr.sbin/unbound/dnstap/dtstream.c
680
dtio->fd = -1;
usr.sbin/unbound/dnstap/dtstream.c
721
if(getsockopt(dtio->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
usr.sbin/unbound/dnstap/dtstream.c
814
if(dtio->fd == -1)
usr.sbin/unbound/dnstap/dtstream.c
820
ret = send(dtio->fd, (void*)buf, len, 0);
usr.sbin/unbound/dnstap/dtstream.c
854
r = writev(dtio->fd, iov, 2);
usr.sbin/unbound/dnstap/dtstream.c
966
r = recv(dtio->fd, (void*)buf, len, MSG_DONTWAIT);
usr.sbin/unbound/dnstap/dtstream.h
148
int fd;
usr.sbin/unbound/dnstap/dtstream.h
340
void dtio_reconnect_timeout_cb(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
343
void dtio_output_cb(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
346
void dtio_cmd_cb(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
349
void dtio_stop_timer_cb(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
352
void dtio_stop_ev_cb(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
355
void dtio_tap_callback(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/dtstream.h
358
void dtio_mainfdcallback(int fd, short bits, void* arg);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1047
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(bits), void* arg)
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1146
void dtio_mainfdcallback(int fd, short ATTR_UNUSED(bits), void* arg)
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1157
s = accept(fd, (struct sockaddr*)&addr, &addrlen);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
117
int fd;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1193
if(getsockname(fd, (struct sockaddr*)usock, &ulen) != -1) {
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1217
data->fd = s;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1220
data->ssl = incoming_ssl_fd(tap_sock->sslctx, data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
157
int fd;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1670
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1805
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1820
void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
1828
void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
214
sock_close(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
269
if(s->fd == -1) return;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
270
sock_close(s->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
271
s->fd = -1;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
303
s->fd = -1;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
324
s->fd = -1;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
346
s->fd = -1;
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
413
s->fd = create_local_accept_sock(s->socketpath, NULL, 0);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
414
if(s->fd == -1) {
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
420
s->fd = make_tcp_accept(s->ip);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
421
if(s->fd == -1) {
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
426
s->ev = ub_event_new(base, s->fd, UB_EV_READ | UB_EV_PERSIST,
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
715
static ssize_t receive_bytes(struct tap_data* data, int fd, void* buf,
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
718
ssize_t ret = recv(fd, buf, len, MSG_DONTWAIT);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
824
return receive_bytes(data, data->fd, buf, len);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
841
fd_set_block(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
851
fd_set_nonblock(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
857
if(send(data->fd, acceptframe, len, 0) == -1) {
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
859
fd_set_nonblock(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
867
fd_set_nonblock(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
889
fd_set_block(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
899
fd_set_nonblock(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
905
if(send(data->fd, finishframe, len, 0) == -1) {
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
907
fd_set_nonblock(data->fd);
usr.sbin/unbound/dnstap/unbound-dnstap-socket.c
914
fd_set_nonblock(data->fd);
usr.sbin/unbound/libunbound/libworker.c
1046
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
usr.sbin/unbound/libunbound/libworker.c
1059
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/libunbound/libworker.c
1067
void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/libunbound/libworker.c
1074
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/libunbound/libworker.c
1089
void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/libunbound/libworker.c
1097
void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/libunbound/unbound-event.h
101
struct ub_event* (*new_signal)(struct ub_event_base*, int fd,
usr.sbin/unbound/libunbound/unbound-event.h
98
int fd, short bits, void (*cb)(int, short, void*), void* arg);
usr.sbin/unbound/services/listen_dnsport.c
1173
item->fd = s;
usr.sbin/unbound/services/listen_dnsport.c
1563
cp = comm_point_create_udp(base, ports->fd,
usr.sbin/unbound/services/listen_dnsport.c
1572
cp = comm_point_create_doq(base, ports->fd,
usr.sbin/unbound/services/listen_dnsport.c
1577
cp = comm_point_create_tcp(base, ports->fd,
usr.sbin/unbound/services/listen_dnsport.c
1585
cp = comm_point_create_tcp(base, ports->fd,
usr.sbin/unbound/services/listen_dnsport.c
1617
cp = comm_point_create_udp_ancil(base, ports->fd,
usr.sbin/unbound/services/listen_dnsport.c
2077
if(list->fd != -1) {
usr.sbin/unbound/services/listen_dnsport.c
2078
sock_close(list->fd);
usr.sbin/unbound/services/listen_dnsport.c
2302
verbose(VERB_ALGO, "tcp channel read side closed %d", req->cp->fd);
usr.sbin/unbound/services/listen_dnsport.h
143
int fd;
usr.sbin/unbound/services/listen_dnsport.h
889
void doq_client_event_cb(int fd, short event, void* arg);
usr.sbin/unbound/services/listen_dnsport.h
892
void doq_client_timer_cb(int fd, short event, void* arg);
usr.sbin/unbound/services/outside_network.c
1039
reuse->pending->c->fd, reuse->pending,
usr.sbin/unbound/services/outside_network.c
1387
outnet_tcp_take_query_setup(pend->c->fd, pend,
usr.sbin/unbound/services/outside_network.c
2065
int fd, noproto;
usr.sbin/unbound/services/outside_network.c
2076
fd = create_udp_sock(AF_INET6, SOCK_DGRAM,
usr.sbin/unbound/services/outside_network.c
2082
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
usr.sbin/unbound/services/outside_network.c
2086
return fd;
usr.sbin/unbound/services/outside_network.c
2162
int my_if, fd, portno, inuse, tries=0;
usr.sbin/unbound/services/outside_network.c
2200
fd = udp_sockport(&pif->addr, pif->addrlen, pif->pfxlen,
usr.sbin/unbound/services/outside_network.c
2202
if(fd == -1 && !inuse) {
usr.sbin/unbound/services/outside_network.c
2210
if(fd != -1) {
usr.sbin/unbound/services/outside_network.c
2215
if(connect(fd, (struct sockaddr*)&pend->addr,
usr.sbin/unbound/services/outside_network.c
2223
sock_close(fd);
usr.sbin/unbound/services/outside_network.c
2242
comm_point_start_listening(pend->pc->cp, fd, -1);
usr.sbin/unbound/services/outside_network.c
2580
outnet_tcp_take_query_setup(pend->c->fd, pend,
usr.sbin/unbound/services/outside_network.c
2783
if(pend_tcp->c->fd == -1) {
usr.sbin/unbound/services/outside_network.c
2797
if(pend_tcp->c->fd != -1 && sq->outnet->tcp_reuse.count <
usr.sbin/unbound/services/outside_network.c
3657
int fd = -1;
usr.sbin/unbound/services/outside_network.c
3698
fd = create_udp_sock(AF_INET6, SOCK_DGRAM,
usr.sbin/unbound/services/outside_network.c
3704
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
usr.sbin/unbound/services/outside_network.c
3716
if(fd != -1) {
usr.sbin/unbound/services/outside_network.c
3717
return fd;
usr.sbin/unbound/services/outside_network.c
3734
int fd = fd_for_dest(outnet, to_addr, to_addrlen);
usr.sbin/unbound/services/outside_network.c
3735
if(fd == -1) {
usr.sbin/unbound/services/outside_network.c
3738
cp = comm_point_create_udp(outnet->base, fd, outnet->udp_buff, 0,
usr.sbin/unbound/services/outside_network.c
3742
close(fd);
usr.sbin/unbound/services/outside_network.c
3751
int fd, char* host)
usr.sbin/unbound/services/outside_network.c
3753
cp->ssl = outgoing_ssl_fd(outnet->sslctx, fd);
usr.sbin/unbound/services/outside_network.c
3811
int fd = outnet_get_tcp_fd(to_addr, to_addrlen, outnet->tcp_mss,
usr.sbin/unbound/services/outside_network.c
3813
if(fd == -1) {
usr.sbin/unbound/services/outside_network.c
3816
fd_set_nonblock(fd);
usr.sbin/unbound/services/outside_network.c
3817
if(!outnet_tcp_connect(fd, to_addr, to_addrlen)) {
usr.sbin/unbound/services/outside_network.c
3824
close(fd);
usr.sbin/unbound/services/outside_network.c
3832
if(!setup_comm_ssl(cp, outnet, fd, host)) {
usr.sbin/unbound/services/outside_network.c
3840
comm_point_start_listening(cp, fd, timeout);
usr.sbin/unbound/services/outside_network.c
3887
int fd = outnet_get_tcp_fd(to_addr, to_addrlen, outnet->tcp_mss,
usr.sbin/unbound/services/outside_network.c
3889
if(fd == -1) {
usr.sbin/unbound/services/outside_network.c
3892
fd_set_nonblock(fd);
usr.sbin/unbound/services/outside_network.c
3893
if(!outnet_tcp_connect(fd, to_addr, to_addrlen)) {
usr.sbin/unbound/services/outside_network.c
3901
close(fd);
usr.sbin/unbound/services/outside_network.c
3909
if(!setup_comm_ssl(cp, outnet, fd, host)) {
usr.sbin/unbound/services/outside_network.c
3917
comm_point_start_listening(cp, fd, timeout);
usr.sbin/unbound/services/outside_network.c
395
reuse->pending->c->fd);
usr.sbin/unbound/services/outside_network.c
756
pend->c->fd = s;
usr.sbin/unbound/services/outside_network.c
772
pend->c->fd = s;
usr.sbin/unbound/services/outside_network.c
783
pend->c->fd = s;
usr.sbin/unbound/smallapp/unbound-anchor.c
1149
int fd;
usr.sbin/unbound/smallapp/unbound-anchor.c
1156
fd = connect_to_ip(ip, src);
usr.sbin/unbound/smallapp/unbound-anchor.c
1157
if(fd == -1) {
usr.sbin/unbound/smallapp/unbound-anchor.c
1161
ssl = TLS_initiate(sslctx, fd, urlname, use_sni);
usr.sbin/unbound/smallapp/unbound-anchor.c
1164
fd_close(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
1171
fd_close(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
1175
TLS_shutdown(fd, ssl, sslctx);
usr.sbin/unbound/smallapp/unbound-anchor.c
1864
tempfile_close(FILE* fd, const char* tempf, const char* fname)
usr.sbin/unbound/smallapp/unbound-anchor.c
1866
fflush(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
1868
fsync(fileno(fd));
usr.sbin/unbound/smallapp/unbound-anchor.c
1870
FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(fd)));
usr.sbin/unbound/smallapp/unbound-anchor.c
1872
if(fclose(fd) != 0) {
usr.sbin/unbound/smallapp/unbound-anchor.c
730
fd_close(int fd)
usr.sbin/unbound/smallapp/unbound-anchor.c
733
close(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
735
closesocket(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
754
int fd;
usr.sbin/unbound/smallapp/unbound-anchor.c
756
fd = socket(ip->len==(socklen_t)sizeof(struct sockaddr_in)?
usr.sbin/unbound/smallapp/unbound-anchor.c
758
if(fd == -1) {
usr.sbin/unbound/smallapp/unbound-anchor.c
762
if(src && bind(fd, (struct sockaddr*)&src->addr, src->len) < 0) {
usr.sbin/unbound/smallapp/unbound-anchor.c
764
fd_close(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
767
if(connect(fd, (struct sockaddr*)&ip->addr, ip->len) < 0) {
usr.sbin/unbound/smallapp/unbound-anchor.c
769
fd_close(fd);
usr.sbin/unbound/smallapp/unbound-anchor.c
772
return fd;
usr.sbin/unbound/smallapp/unbound-anchor.c
789
TLS_initiate(SSL_CTX* sslctx, int fd, const char* urlname, int use_sni)
usr.sbin/unbound/smallapp/unbound-anchor.c
800
if(!SSL_set_fd(ssl, fd)) {
usr.sbin/unbound/smallapp/unbound-anchor.c
837
TLS_shutdown(int fd, SSL* ssl, SSL_CTX* sslctx)
usr.sbin/unbound/smallapp/unbound-anchor.c
845
fd_close(fd);
usr.sbin/unbound/smallapp/unbound-control.c
627
int fd, useport = 1;
usr.sbin/unbound/smallapp/unbound-control.c
686
fd = socket(addrfamily, SOCK_STREAM, proto);
usr.sbin/unbound/smallapp/unbound-control.c
687
if(fd == -1) {
usr.sbin/unbound/smallapp/unbound-control.c
690
fd_set_nonblock(fd);
usr.sbin/unbound/smallapp/unbound-control.c
691
if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) {
usr.sbin/unbound/smallapp/unbound-control.c
711
FD_SET(FD_SET_T fd, &rset);
usr.sbin/unbound/smallapp/unbound-control.c
713
FD_SET(FD_SET_T fd, &wset);
usr.sbin/unbound/smallapp/unbound-control.c
715
FD_SET(FD_SET_T fd, &eset);
usr.sbin/unbound/smallapp/unbound-control.c
718
if(select(fd+1, &rset, &wset, &eset, &tv) == -1) {
usr.sbin/unbound/smallapp/unbound-control.c
721
if(!FD_ISSET(fd, &rset) && !FD_ISSET(fd, &wset) &&
usr.sbin/unbound/smallapp/unbound-control.c
722
!FD_ISSET(fd, &eset)) {
usr.sbin/unbound/smallapp/unbound-control.c
728
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
usr.sbin/unbound/smallapp/unbound-control.c
758
fd_set_block(fd);
usr.sbin/unbound/smallapp/unbound-control.c
760
return fd;
usr.sbin/unbound/smallapp/unbound-control.c
765
setup_ssl(SSL_CTX* ctx, int fd)
usr.sbin/unbound/smallapp/unbound-control.c
777
if(!SSL_set_fd(ssl, fd))
usr.sbin/unbound/smallapp/unbound-control.c
806
remote_read(SSL* ssl, int fd, char* buf, size_t len)
usr.sbin/unbound/smallapp/unbound-control.c
820
ssize_t rr = recv(fd, buf, len-1, 0);
usr.sbin/unbound/smallapp/unbound-control.c
835
remote_write(SSL* ssl, int fd, const char* buf, size_t len)
usr.sbin/unbound/smallapp/unbound-control.c
841
if(send(fd, buf, len, 0) < (ssize_t)len) {
usr.sbin/unbound/smallapp/unbound-control.c
871
send_file(SSL* ssl, int fd, FILE* in, char* buf, size_t sz)
usr.sbin/unbound/smallapp/unbound-control.c
874
remote_write(ssl, fd, buf, strlen(buf));
usr.sbin/unbound/smallapp/unbound-control.c
880
send_eof(SSL* ssl, int fd)
usr.sbin/unbound/smallapp/unbound-control.c
883
remote_write(ssl, fd, e, sizeof(e));
usr.sbin/unbound/smallapp/unbound-control.c
888
go_cmd(SSL* ssl, int fd, int quiet, int argc, char* argv[])
usr.sbin/unbound/smallapp/unbound-control.c
897
remote_write(ssl, fd, pre, strlen(pre));
usr.sbin/unbound/smallapp/unbound-control.c
899
remote_write(ssl, fd, space, strlen(space));
usr.sbin/unbound/smallapp/unbound-control.c
900
remote_write(ssl, fd, argv[i], strlen(argv[i]));
usr.sbin/unbound/smallapp/unbound-control.c
902
remote_write(ssl, fd, newline, strlen(newline));
usr.sbin/unbound/smallapp/unbound-control.c
905
send_file(ssl, fd, stdin, buf, sizeof(buf));
usr.sbin/unbound/smallapp/unbound-control.c
913
send_file(ssl, fd, stdin, buf, sizeof(buf));
usr.sbin/unbound/smallapp/unbound-control.c
914
send_eof(ssl, fd);
usr.sbin/unbound/smallapp/unbound-control.c
918
if(remote_read(ssl, fd, buf, sizeof(buf)) == 0) {
usr.sbin/unbound/smallapp/unbound-control.c
938
int fd, ret;
usr.sbin/unbound/smallapp/unbound-control.c
955
fd = contact_server(svr, cfg, argc>0&&strcmp(argv[0],"status")==0);
usr.sbin/unbound/smallapp/unbound-control.c
956
ssl = setup_ssl(ctx, fd);
usr.sbin/unbound/smallapp/unbound-control.c
959
ret = go_cmd(ssl, fd, quiet, argc, argv);
usr.sbin/unbound/smallapp/unbound-control.c
962
sock_close(fd);
usr.sbin/unbound/smallapp/worker_cb.c
113
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
usr.sbin/unbound/smallapp/worker_cb.c
250
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/smallapp/worker_cb.c
258
void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/smallapp/worker_cb.c
265
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/smallapp/worker_cb.c
280
void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/smallapp/worker_cb.c
288
void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/testcode/dohclient.c
104
int fd = -1;
usr.sbin/unbound/testcode/dohclient.c
111
fd = socket(addr_is_ip6(&addr, addrlen)?PF_INET6:PF_INET,
usr.sbin/unbound/testcode/dohclient.c
113
if(fd == -1) {
usr.sbin/unbound/testcode/dohclient.c
117
r = connect(fd, (struct sockaddr*)&addr, addrlen);
usr.sbin/unbound/testcode/dohclient.c
122
return fd;
usr.sbin/unbound/testcode/dohclient.c
276
FD_SET(h2_session->fd, &rfd);
usr.sbin/unbound/testcode/dohclient.c
277
r = select(h2_session->fd+1, &rfd, NULL, NULL, waittv);
usr.sbin/unbound/testcode/dohclient.c
295
ret = read(h2_session->fd, buf, len);
usr.sbin/unbound/testcode/dohclient.c
326
ret = write(h2_session->fd, buf, len);
usr.sbin/unbound/testcode/dohclient.c
503
int fd;
usr.sbin/unbound/testcode/dohclient.c
506
fd = open_svr(h2_session->authority, port);
usr.sbin/unbound/testcode/dohclient.c
507
h2_session->fd = fd;
usr.sbin/unbound/testcode/dohclient.c
515
ssl = outgoing_ssl_fd(ctx, fd);
usr.sbin/unbound/testcode/dohclient.c
561
sock_close(fd);
usr.sbin/unbound/testcode/dohclient.c
63
int fd;
usr.sbin/unbound/testcode/doqclient.c
1407
if(!SSL_set_fd(ssl, data->fd)) {
usr.sbin/unbound/testcode/doqclient.c
1457
set_ecn(int fd, int family, uint32_t ecn)
usr.sbin/unbound/testcode/doqclient.c
1461
if(setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val,
usr.sbin/unbound/testcode/doqclient.c
1468
if(setsockopt(fd, IPPROTO_IP, IP_TOS, &val,
usr.sbin/unbound/testcode/doqclient.c
1490
set_ecn(data->fd, data->dest_addr.ss_family, ecn);
usr.sbin/unbound/testcode/doqclient.c
1493
ret = sendmsg(data->fd, &msg, MSG_DONTWAIT);
usr.sbin/unbound/testcode/doqclient.c
1617
void doq_client_timer_cb(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/doqclient.c
1707
rcv = recvmsg(data->fd, &msg, MSG_DONTWAIT);
usr.sbin/unbound/testcode/doqclient.c
2051
doq_client_event_cb(int ATTR_UNUSED(fd), short bits, void* arg)
usr.sbin/unbound/testcode/doqclient.c
2275
data->fd = open_svr_udp(data);
usr.sbin/unbound/testcode/doqclient.c
2305
data->ev = ub_event_new(base, data->fd, UB_EV_READ | UB_EV_WRITE |
usr.sbin/unbound/testcode/doqclient.c
2357
if(data->fd != -1)
usr.sbin/unbound/testcode/doqclient.c
2358
sock_close(data->fd);
usr.sbin/unbound/testcode/doqclient.c
2606
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
usr.sbin/unbound/testcode/doqclient.c
2742
void dtio_tap_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/testcode/doqclient.c
2750
void dtio_mainfdcallback(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/testcode/doqclient.c
2757
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/testcode/doqclient.c
291
int fd = -1;
usr.sbin/unbound/testcode/doqclient.c
293
fd = socket(addr_is_ip6(&data->dest_addr, data->dest_addr_len)?
usr.sbin/unbound/testcode/doqclient.c
295
if(fd == -1) {
usr.sbin/unbound/testcode/doqclient.c
299
r = connect(fd, (struct sockaddr*)&data->dest_addr,
usr.sbin/unbound/testcode/doqclient.c
305
fd_set_nonblock(fd);
usr.sbin/unbound/testcode/doqclient.c
306
return fd;
usr.sbin/unbound/testcode/doqclient.c
315
if(getsockname(data->fd, (struct sockaddr*)&data->local_addr,
usr.sbin/unbound/testcode/doqclient.c
82
int fd;
usr.sbin/unbound/testcode/fake_event.c
1447
int ATTR_UNUSED(fd), size_t ATTR_UNUSED(bufsize),
usr.sbin/unbound/testcode/fake_event.c
1459
int ATTR_UNUSED(fd), int ATTR_UNUSED(writing),
usr.sbin/unbound/testcode/fake_event.c
1557
void comm_point_udp_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(event),
usr.sbin/unbound/testcode/fake_event.c
1563
void comm_point_udp_ancil_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1569
void comm_point_tcp_accept_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1575
void comm_point_tcp_handle_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1581
void comm_timer_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1587
void comm_signal_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1593
void comm_point_http_handle_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1599
void comm_point_local_handle_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1605
void comm_point_raw_handle_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1611
void comm_base_handle_slow_accept(int ATTR_UNUSED(fd),
usr.sbin/unbound/testcode/fake_event.c
1767
int ATTR_UNUSED(fd), sldns_buffer* ATTR_UNUSED(buffer),
usr.sbin/unbound/testcode/fake_event.c
2048
void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(event),
usr.sbin/unbound/testcode/fake_event.c
382
c.fd = -1;
usr.sbin/unbound/testcode/fake_event.c
469
repinfo.c->fd = -1;
usr.sbin/unbound/testcode/perf.c
135
int fd;
usr.sbin/unbound/testcode/perf.c
232
info->io[i].fd = socket(
usr.sbin/unbound/testcode/perf.c
235
if(info->io[i].fd == -1) {
usr.sbin/unbound/testcode/perf.c
238
if(info->io[i].fd > info->maxfd)
usr.sbin/unbound/testcode/perf.c
239
info->maxfd = info->io[i].fd;
usr.sbin/unbound/testcode/perf.c
241
FD_SET(FD_SET_T info->io[i].fd, &info->rset);
usr.sbin/unbound/testcode/perf.c
258
sock_close(info->io[i].fd);
usr.sbin/unbound/testcode/perf.c
273
r = sendto(info->io[n].fd, (void*)info->qlist_data[info->qlist_idx],
usr.sbin/unbound/testcode/perf.c
296
r = recv(info->io[n].fd, (void*)sldns_buffer_begin(info->buf),
usr.sbin/unbound/testcode/perf.c
388
if(FD_ISSET(info->io[i].fd, &rset)) {
usr.sbin/unbound/testcode/petal.c
133
fd_close(int fd)
usr.sbin/unbound/testcode/petal.c
136
close(fd);
usr.sbin/unbound/testcode/petal.c
138
closesocket(fd);
usr.sbin/unbound/testcode/petal.c
300
int fd;
usr.sbin/unbound/testcode/petal.c
303
fd = socket(fam, SOCK_STREAM, 0);
usr.sbin/unbound/testcode/petal.c
304
if(fd == -1) {
usr.sbin/unbound/testcode/petal.c
308
if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
usr.sbin/unbound/testcode/petal.c
312
if(bind(fd, (struct sockaddr*)&ad, len) == -1) {
usr.sbin/unbound/testcode/petal.c
314
fd_close(fd);
usr.sbin/unbound/testcode/petal.c
317
if(listen(fd, 5) == -1) {
usr.sbin/unbound/testcode/petal.c
319
fd_close(fd);
usr.sbin/unbound/testcode/petal.c
322
return fd;
usr.sbin/unbound/testcode/petal.c
601
int fd = setup_fd(addr, port);
usr.sbin/unbound/testcode/petal.c
602
if(fd == -1) print_exit("could not setup sockets");
usr.sbin/unbound/testcode/petal.c
609
s = accept(fd, (struct sockaddr*)&from, &flen);
usr.sbin/unbound/testcode/petal.c
626
fd_close(fd);
usr.sbin/unbound/testcode/streamtcp.c
101
if(fd == -1) {
usr.sbin/unbound/testcode/streamtcp.c
109
if(connect(fd, (struct sockaddr*)addr, *addrlen) < 0) {
usr.sbin/unbound/testcode/streamtcp.c
117
return fd;
usr.sbin/unbound/testcode/streamtcp.c
145
write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id,
usr.sbin/unbound/testcode/streamtcp.c
250
if(send(fd, (void*)&len, sizeof(len), 0) <
usr.sbin/unbound/testcode/streamtcp.c
269
if(send(fd, (void*)sldns_buffer_begin(buf),
usr.sbin/unbound/testcode/streamtcp.c
289
recv_one(int fd, int udp, SSL* ssl, sldns_buffer* buf)
usr.sbin/unbound/testcode/streamtcp.c
306
ssize_t r = recv(fd, (void*)&len, sizeof(len), 0);
usr.sbin/unbound/testcode/streamtcp.c
334
if(recv(fd, (void*)sldns_buffer_begin(buf), len, 0) <
usr.sbin/unbound/testcode/streamtcp.c
348
if((l=recv(fd, (void*)sldns_buffer_begin(buf),
usr.sbin/unbound/testcode/streamtcp.c
377
print_any_answers(int fd, int udp, SSL* ssl, sldns_buffer* buf,
usr.sbin/unbound/testcode/streamtcp.c
388
FD_SET(fd, &rfd);
usr.sbin/unbound/testcode/streamtcp.c
391
ret = select(fd+1, &rfd, NULL, NULL, waittv);
usr.sbin/unbound/testcode/streamtcp.c
402
recv_one(fd, udp, ssl, buf);
usr.sbin/unbound/testcode/streamtcp.c
444
int fd = open_svr(svr, udp, &svr_addr, &svr_addrlen);
usr.sbin/unbound/testcode/streamtcp.c
459
ssl = outgoing_ssl_fd(ctx, fd);
usr.sbin/unbound/testcode/streamtcp.c
495
if(send(fd, (void*)sldns_buffer_begin(proxy_buf),
usr.sbin/unbound/testcode/streamtcp.c
517
write_q(fd, udp, ssl, buf, (uint16_t)get_random(), proxy_buf,
usr.sbin/unbound/testcode/streamtcp.c
523
print_any_answers(fd, udp, ssl, buf, &wait_results, 0);
usr.sbin/unbound/testcode/streamtcp.c
525
recv_one(fd, udp, ssl, buf);
usr.sbin/unbound/testcode/streamtcp.c
529
print_any_answers(fd, udp, ssl, buf, &wait_results, 1);
usr.sbin/unbound/testcode/streamtcp.c
536
sock_close(fd);
usr.sbin/unbound/testcode/streamtcp.c
92
int fd = -1;
usr.sbin/unbound/testcode/streamtcp.c
99
fd = socket(addr_is_ip6(addr, *addrlen)?PF_INET6:PF_INET,
usr.sbin/unbound/testcode/testbound.c
529
int fd;
usr.sbin/unbound/testcode/testbound.c
535
fd = mkstemp(pathname);
usr.sbin/unbound/testcode/testbound.c
536
if (fd == -1) {
usr.sbin/unbound/testcode/testbound.c
543
int nbytes = write(fd, &buf[pos], size - pos);
usr.sbin/unbound/testcode/testbound.c
553
if (close(fd) == -1) {
usr.sbin/unbound/testcode/testbound.c
691
void worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
usr.sbin/unbound/testcode/testbound.c
742
void comm_point_doq_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(event),
usr.sbin/unbound/util/data/msgreply.c
793
struct packed_rrset_data* fd, *dd;
usr.sbin/unbound/util/data/msgreply.c
798
fd = (struct packed_rrset_data*)fk->entry.data;
usr.sbin/unbound/util/data/msgreply.c
810
s = packed_rrset_sizeof(fd);
usr.sbin/unbound/util/data/msgreply.c
813
region, fd, s);
usr.sbin/unbound/util/data/msgreply.c
814
else dd = (struct packed_rrset_data*)memdup(fd, s);
usr.sbin/unbound/util/data/packed_rrset.c
387
struct packed_rrset_data* fd, *dd;
usr.sbin/unbound/util/data/packed_rrset.c
390
fd = (struct packed_rrset_data*)key->entry.data;
usr.sbin/unbound/util/data/packed_rrset.c
398
dd = (struct packed_rrset_data*)memdup(fd, packed_rrset_sizeof(fd));
usr.sbin/unbound/util/mini_event.c
271
void event_set(struct event* ev, int fd, short bits,
usr.sbin/unbound/util/mini_event.c
275
ev->ev_fd = fd;
usr.sbin/unbound/util/net_help.c
1647
void* incoming_ssl_fd(void* sslctx, int fd)
usr.sbin/unbound/util/net_help.c
1657
if(!SSL_set_fd(ssl, fd)) {
usr.sbin/unbound/util/net_help.c
1664
(void)sslctx; (void)fd;
usr.sbin/unbound/util/net_help.c
1669
void* outgoing_ssl_fd(void* sslctx, int fd)
usr.sbin/unbound/util/net_help.c
1679
if(!SSL_set_fd(ssl, fd)) {
usr.sbin/unbound/util/net_help.c
1686
(void)sslctx; (void)fd;
usr.sbin/unbound/util/net_help.h
528
void* incoming_ssl_fd(void* sslctx, int fd);
usr.sbin/unbound/util/net_help.h
536
void* outgoing_ssl_fd(void* sslctx, int fd);
usr.sbin/unbound/util/netevent.c
1018
log_assert(rep.c && rep.c->buffer && rep.c->fd == fd);
usr.sbin/unbound/util/netevent.c
1024
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
1037
rcv = recvmsg(fd, &msg, MSG_DONTWAIT);
usr.sbin/unbound/util/netevent.c
1123
if(!rep.c || rep.c->fd == -1) /* commpoint closed */
usr.sbin/unbound/util/netevent.c
1130
comm_point_udp_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
1142
log_assert(rep.c && rep.c->buffer && rep.c->fd == fd);
usr.sbin/unbound/util/netevent.c
1147
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
1149
rcv = recvfrom(fd, (void*)sldns_buffer_begin(rep.c->buffer),
usr.sbin/unbound/util/netevent.c
1157
fd, strerror(errno));
usr.sbin/unbound/util/netevent.c
1196
if(!rep.c || rep.c->fd != fd) /* commpoint closed to -1 or reused for
usr.sbin/unbound/util/netevent.c
1213
doq_set_ecn(int fd, int family, uint32_t ecn)
usr.sbin/unbound/util/netevent.c
1217
if(setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val,
usr.sbin/unbound/util/netevent.c
1224
if(setsockopt(fd, IPPROTO_IP, IP_TOS, &val,
usr.sbin/unbound/util/netevent.c
1374
doq_set_ecn(c->fd, paddr->addr.sockaddr.in.sin_family, ecn);
usr.sbin/unbound/util/netevent.c
1377
ret = sendmsg(c->fd, &msg, MSG_DONTWAIT);
usr.sbin/unbound/util/netevent.c
1588
rcv = recvmsg(c->fd, &msg, MSG_DONTWAIT);
usr.sbin/unbound/util/netevent.c
2512
comm_point_doq_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
2524
log_assert(c && c->doq_socket->pkt_buf && c->fd == fd);
usr.sbin/unbound/util/netevent.c
2613
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
2922
setup_tcp_handler(struct comm_point* c, int fd, int cur, int max)
usr.sbin/unbound/util/netevent.c
2926
log_assert(c->fd == -1);
usr.sbin/unbound/util/netevent.c
2954
comm_point_start_listening(c, fd, adjusted_tcp_timeout(c));
usr.sbin/unbound/util/netevent.c
2957
void comm_base_handle_slow_accept(int ATTR_UNUSED(fd),
usr.sbin/unbound/util/netevent.c
2976
new_fd = accept(c->fd, (struct sockaddr*)addr, addrlen);
usr.sbin/unbound/util/netevent.c
2979
new_fd = accept4(c->fd, (struct sockaddr*)addr, addrlen, SOCK_NONBLOCK);
usr.sbin/unbound/util/netevent.c
3198
comm_point_tcp_accept_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
3262
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
3263
(void)fd;
usr.sbin/unbound/util/netevent.c
3282
c_hdl->fd = new_fd;
usr.sbin/unbound/util/netevent.c
400
log_assert(c->fd != -1);
usr.sbin/unbound/util/netevent.c
4006
comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok)
usr.sbin/unbound/util/netevent.c
4016
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
4035
r = recv(fd, (void*)sldns_buffer_at(c->buffer,
usr.sbin/unbound/util/netevent.c
407
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
usr.sbin/unbound/util/netevent.c
4080
r = recv(fd, (void*)sldns_buffer_at(c->buffer,
usr.sbin/unbound/util/netevent.c
411
sent = send(c->fd, (void*)sldns_buffer_begin(packet),
usr.sbin/unbound/util/netevent.c
4120
r = recv(fd,(void*)sldns_buffer_at(c->buffer,c->tcp_byte_count),
usr.sbin/unbound/util/netevent.c
4153
r = recv(fd, (void*)sldns_buffer_current(c->buffer),
usr.sbin/unbound/util/netevent.c
4252
comm_point_tcp_handle_write(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
4264
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
4270
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
usr.sbin/unbound/util/netevent.c
4338
r = sendmsg(fd, &msg, MSG_FASTOPEN);
usr.sbin/unbound/util/netevent.c
4369
if(connect(fd, (struct sockaddr *)&c->repinfo.remote_addr,
usr.sbin/unbound/util/netevent.c
4427
r = writev(fd, iov, 2);
usr.sbin/unbound/util/netevent.c
4430
r = send(fd, (void*)(((uint8_t*)&len)+c->tcp_write_byte_count),
usr.sbin/unbound/util/netevent.c
4433
r = send(fd, (void*)(((uint8_t*)&len)+c->tcp_byte_count),
usr.sbin/unbound/util/netevent.c
4496
r = send(fd, (void*)(c->tcp_write_pkt + c->tcp_write_byte_count - 2),
usr.sbin/unbound/util/netevent.c
4499
r = send(fd, (void*)sldns_buffer_current(buffer),
usr.sbin/unbound/util/netevent.c
4541
tcp_req_info_read_again(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
4547
r = comm_point_tcp_handle_read(fd, c, 0);
usr.sbin/unbound/util/netevent.c
4548
else r = comm_point_tcp_handle_write(fd, c);
usr.sbin/unbound/util/netevent.c
4565
tcp_more_read_again(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
4574
if(!comm_point_tcp_handle_read(fd, c, 0)) {
usr.sbin/unbound/util/netevent.c
458
p.fd = c->fd;
usr.sbin/unbound/util/netevent.c
4589
tcp_more_write_again(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
4598
if(!comm_point_tcp_handle_write(fd, c)) {
usr.sbin/unbound/util/netevent.c
4612
comm_point_tcp_handle_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
4618
if(c->fd == -1 || c->fd != fd)
usr.sbin/unbound/util/netevent.c
4659
if(!comm_point_tcp_handle_read(fd, c, 0)) {
usr.sbin/unbound/util/netevent.c
4670
if(!tcp_req_info_read_again(fd, c))
usr.sbin/unbound/util/netevent.c
4674
tcp_more_read_again(fd, c);
usr.sbin/unbound/util/netevent.c
4680
if(!comm_point_tcp_handle_write(fd, c)) {
usr.sbin/unbound/util/netevent.c
4691
if(!tcp_req_info_read_again(fd, c))
usr.sbin/unbound/util/netevent.c
4695
tcp_more_write_again(fd, c);
usr.sbin/unbound/util/netevent.c
4774
http_read_more(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
4778
r = recv(fd, (void*)sldns_buffer_current(c->buffer),
usr.sbin/unbound/util/netevent.c
5215
ret = recv(h2_session->c->fd, (void*)buf, len, MSG_DONTWAIT);
usr.sbin/unbound/util/netevent.c
5252
comm_point_http2_handle_read(int ATTR_UNUSED(fd), struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5291
comm_point_http_handle_read(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5294
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
5310
return comm_point_http2_handle_read(fd, c);
usr.sbin/unbound/util/netevent.c
5325
if(!http_read_more(fd, c))
usr.sbin/unbound/util/netevent.c
5389
http_check_connect(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5395
if(getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&error,
usr.sbin/unbound/util/netevent.c
542
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
usr.sbin/unbound/util/netevent.c
546
sent = send(c->fd, (void*)sldns_buffer_begin(packet),
usr.sbin/unbound/util/netevent.c
5476
http_write_more(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5480
r = send(fd, (void*)sldns_buffer_current(c->buffer),
usr.sbin/unbound/util/netevent.c
5543
ret = send(h2_session->c->fd, (void*)buf, len, 0);
usr.sbin/unbound/util/netevent.c
5586
comm_point_http2_handle_write(int ATTR_UNUSED(fd), struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5619
comm_point_http_handle_write(int fd, struct comm_point* c)
usr.sbin/unbound/util/netevent.c
5622
log_assert(fd != -1);
usr.sbin/unbound/util/netevent.c
5627
int r = http_check_connect(fd, c);
usr.sbin/unbound/util/netevent.c
5645
return comm_point_http2_handle_write(fd, c);
usr.sbin/unbound/util/netevent.c
5660
if(!http_write_more(fd, c))
usr.sbin/unbound/util/netevent.c
5680
comm_point_http_handle_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
5697
if(!comm_point_http_handle_read(fd, c)) {
usr.sbin/unbound/util/netevent.c
5709
if(!comm_point_http_handle_write(fd, c)) {
usr.sbin/unbound/util/netevent.c
5723
void comm_point_local_handle_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.c
5730
if(!comm_point_tcp_handle_read(fd, c, 1)) {
usr.sbin/unbound/util/netevent.c
5740
void comm_point_raw_handle_callback(int ATTR_UNUSED(fd),
usr.sbin/unbound/util/netevent.c
5755
comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer,
usr.sbin/unbound/util/netevent.c
5771
c->fd = fd;
usr.sbin/unbound/util/netevent.c
5802
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
5809
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
usr.sbin/unbound/util/netevent.c
5820
comm_point_create_udp_ancil(struct comm_base *base, int fd,
usr.sbin/unbound/util/netevent.c
5836
c->fd = fd;
usr.sbin/unbound/util/netevent.c
5867
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
5874
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
usr.sbin/unbound/util/netevent.c
5885
comm_point_create_doq(struct comm_base *base, int fd, sldns_buffer* buffer,
usr.sbin/unbound/util/netevent.c
5905
c->fd = fd;
usr.sbin/unbound/util/netevent.c
5943
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
5950
if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) {
usr.sbin/unbound/util/netevent.c
5968
sock_close(fd);
usr.sbin/unbound/util/netevent.c
5991
c->fd = -1;
usr.sbin/unbound/util/netevent.c
6057
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6092
c->fd = -1;
usr.sbin/unbound/util/netevent.c
6179
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6196
comm_point_create_tcp(struct comm_base *base, int fd, int num,
usr.sbin/unbound/util/netevent.c
6218
c->fd = fd;
usr.sbin/unbound/util/netevent.c
6258
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6314
c->fd = -1;
usr.sbin/unbound/util/netevent.c
6352
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6383
c->fd = -1;
usr.sbin/unbound/util/netevent.c
640
log_assert(c->fd != -1);
usr.sbin/unbound/util/netevent.c
6421
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6439
comm_point_create_local(struct comm_base *base, int fd, size_t bufsize,
usr.sbin/unbound/util/netevent.c
6454
c->fd = fd;
usr.sbin/unbound/util/netevent.c
6488
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6508
comm_point_create_raw(struct comm_base* base, int fd, int writing,
usr.sbin/unbound/util/netevent.c
6523
c->fd = fd;
usr.sbin/unbound/util/netevent.c
6554
c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits,
usr.sbin/unbound/util/netevent.c
6578
if(c->fd != -1) {
usr.sbin/unbound/util/netevent.c
6579
verbose(5, "comm_point_close of %d: event_del", c->fd);
usr.sbin/unbound/util/netevent.c
6599
if(c->fd != -1 && !c->do_not_close) {
usr.sbin/unbound/util/netevent.c
6607
verbose(VERB_ALGO, "close fd %d", c->fd);
usr.sbin/unbound/util/netevent.c
6608
sock_close(c->fd);
usr.sbin/unbound/util/netevent.c
6610
c->fd = -1;
usr.sbin/unbound/util/netevent.c
6794
verbose(VERB_ALGO, "comm point stop listening %d", c->fd);
usr.sbin/unbound/util/netevent.c
6807
c->fd==-1?newfd:c->fd, msec);
usr.sbin/unbound/util/netevent.c
6840
verbose(5, "startlistening %d mode rw", (newfd==-1?c->fd:newfd));
usr.sbin/unbound/util/netevent.c
6843
verbose(5, "startlistening %d mode r", (newfd==-1?c->fd:newfd));
usr.sbin/unbound/util/netevent.c
6846
verbose(5, "startlistening %d mode w", (newfd==-1?c->fd:newfd));
usr.sbin/unbound/util/netevent.c
6851
if(c->fd != -1 && c->fd != newfd) {
usr.sbin/unbound/util/netevent.c
6852
verbose(5, "cpsl close of fd %d for %d", c->fd, newfd);
usr.sbin/unbound/util/netevent.c
6853
sock_close(c->fd);
usr.sbin/unbound/util/netevent.c
6855
c->fd = newfd;
usr.sbin/unbound/util/netevent.c
6856
ub_event_set_fd(c->ev->ev, c->fd);
usr.sbin/unbound/util/netevent.c
6867
verbose(VERB_ALGO, "comm point listen_for_rw %d %d", c->fd, wr);
usr.sbin/unbound/util/netevent.c
6970
comm_timer_callback(int ATTR_UNUSED(fd), short event, void* arg)
usr.sbin/unbound/util/netevent.c
730
sent = sendmsg(c->fd, &msg, 0);
usr.sbin/unbound/util/netevent.c
773
p.fd = c->fd;
usr.sbin/unbound/util/netevent.c
856
sent = sendmsg(c->fd, &msg, 0);
usr.sbin/unbound/util/netevent.c
995
comm_point_udp_ancil_callback(int fd, short event, void* arg)
usr.sbin/unbound/util/netevent.h
1142
void comm_timer_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
1152
void comm_signal_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
1162
void comm_point_local_handle_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
1172
void comm_point_raw_handle_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
1182
void comm_base_handle_slow_accept(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
214
int fd;
usr.sbin/unbound/util/netevent.h
576
int fd, struct sldns_buffer* buffer, int pp2_enabled,
usr.sbin/unbound/util/netevent.h
594
int fd, struct sldns_buffer* buffer, int pp2_enabled,
usr.sbin/unbound/util/netevent.h
614
int fd, struct sldns_buffer* buffer,
usr.sbin/unbound/util/netevent.h
649
int fd, int num, int idle_timeout, int harden_large_queries,
usr.sbin/unbound/util/netevent.h
691
int fd, size_t bufsize,
usr.sbin/unbound/util/netevent.h
704
int fd, int writing,
usr.sbin/unbound/util/netevent.h
877
void comm_point_udp_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
887
void comm_point_udp_ancil_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
897
void comm_point_doq_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
907
void comm_point_tcp_accept_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
917
void comm_point_tcp_handle_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/netevent.h
927
void comm_point_http_handle_callback(int fd, short event, void* arg);
usr.sbin/unbound/util/tube.c
162
r = read(c->fd, ((uint8_t*)&tube->cmd_len) + tube->cmd_read,
usr.sbin/unbound/util/tube.c
192
r = read(c->fd, tube->cmd_msg+tube->cmd_read-sizeof(tube->cmd_len),
usr.sbin/unbound/util/tube.c
242
r = write(c->fd, ((uint8_t*)&item->len) + tube->res_write,
usr.sbin/unbound/util/tube.c
259
r = write(c->fd, item->buf + tube->res_write - sizeof(item->len),
usr.sbin/unbound/util/tube.c
292
int fd = tube->sw;
usr.sbin/unbound/util/tube.c
296
r = write(fd, &len, sizeof(len));
usr.sbin/unbound/util/tube.c
304
if(!fd_set_block(fd))
usr.sbin/unbound/util/tube.c
309
if((r=write(fd, ((char*)&len)+d, sizeof(len)-d)) == -1) {
usr.sbin/unbound/util/tube.c
313
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
320
if((r=write(fd, buf+d, len-d)) == -1) {
usr.sbin/unbound/util/tube.c
324
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
329
if(!fd_set_nonblock(fd))
usr.sbin/unbound/util/tube.c
338
int fd = tube->sr;
usr.sbin/unbound/util/tube.c
343
r = read(fd, len, sizeof(*len));
usr.sbin/unbound/util/tube.c
353
if(!fd_set_block(fd))
usr.sbin/unbound/util/tube.c
358
if((r=read(fd, ((char*)len)+d, sizeof(*len)-d)) == -1) {
usr.sbin/unbound/util/tube.c
360
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
364
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
371
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
377
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
382
if((r=read(fd, (*buf)+d, (size_t)((ssize_t)*len)-d)) == -1) {
usr.sbin/unbound/util/tube.c
384
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
389
(void)fd_set_nonblock(fd);
usr.sbin/unbound/util/tube.c
395
if(!fd_set_nonblock(fd)) {
usr.sbin/unbound/util/tube.c
404
pollit(int fd, struct timeval* t)
usr.sbin/unbound/util/tube.c
410
fds.fd = fd;
usr.sbin/unbound/util/tube.c
446
fds.fd = tube->sr;
usr.sbin/unbound/util/tube.c
520
void tube_handle_signal(int ATTR_UNUSED(fd), short ATTR_UNUSED(events),
usr.sbin/unbound/util/tube.c
781
void tube_handle_signal(int ATTR_UNUSED(fd), short ATTR_UNUSED(events),
usr.sbin/unbound/util/tube.h
278
void tube_handle_signal(int fd, short events, void* arg);
usr.sbin/unbound/util/ub_event.c
349
ub_event_new(struct ub_event_base* base, int fd, short bits,
usr.sbin/unbound/util/ub_event.c
358
event_set(ev, fd, NATIVE_BITS(bits), NATIVE_BITS_CB(cb), arg);
usr.sbin/unbound/util/ub_event.c
364
if (event_assign(ev, AS_EVENT_BASE(base), fd, bits, cb, arg) != 0) {
usr.sbin/unbound/util/ub_event.c
373
ub_signal_new(struct ub_event_base* base, int fd,
usr.sbin/unbound/util/ub_event.c
382
signal_set(ev, fd, NATIVE_BITS_CB(cb), arg);
usr.sbin/unbound/util/ub_event.c
388
if (evsignal_assign(ev, AS_EVENT_BASE(base), fd, cb, arg) != 0) {
usr.sbin/unbound/util/ub_event.c
433
ub_event_set_fd(struct ub_event* ev, int fd)
usr.sbin/unbound/util/ub_event.c
435
AS_EVENT(ev)->ev_fd = fd;
usr.sbin/unbound/util/ub_event.c
94
# define UB_EV_BITS_CB(C) void my_ ## C (int fd, short bits, void *arg) \
usr.sbin/unbound/util/ub_event.c
95
{ (C)(fd, UB_EV_BITS(bits), arg); }
usr.sbin/unbound/util/ub_event.h
102
void ub_event_set_fd(struct ub_event*, int fd);
usr.sbin/unbound/util/ub_event.h
89
int fd, short bits, void (*cb)(int, short, void*), void* arg);
usr.sbin/unbound/util/ub_event.h
91
struct ub_event* ub_signal_new(struct ub_event_base*, int fd,
usr.sbin/unbound/util/ub_event_pluggable.c
168
my_event_set_fd(struct ub_event* ev, int fd)
usr.sbin/unbound/util/ub_event_pluggable.c
170
AS_MY_EVENT(ev)->ev.ev_fd = fd;
usr.sbin/unbound/util/ub_event_pluggable.c
276
my_event_new(struct ub_event_base* base, int fd, short bits,
usr.sbin/unbound/util/ub_event_pluggable.c
285
event_set(&my_ev->ev, fd, NATIVE_BITS(bits), NATIVE_BITS_CB(cb), arg);
usr.sbin/unbound/util/ub_event_pluggable.c
296
my_signal_new(struct ub_event_base* base, int fd,
usr.sbin/unbound/util/ub_event_pluggable.c
305
signal_set(&my_ev->ev, fd, NATIVE_BITS_CB(cb), arg);
usr.sbin/unbound/util/ub_event_pluggable.c
508
ub_event_new(struct ub_event_base* base, int fd, short bits,
usr.sbin/unbound/util/ub_event_pluggable.c
514
return (*base->vmt->new_event)(base, fd, bits, cb, arg);
usr.sbin/unbound/util/ub_event_pluggable.c
520
ub_signal_new(struct ub_event_base* base, int fd,
usr.sbin/unbound/util/ub_event_pluggable.c
526
return (*base->vmt->new_signal)(base, fd, cb, arg);
usr.sbin/unbound/util/ub_event_pluggable.c
565
ub_event_set_fd(struct ub_event* ev, int fd)
usr.sbin/unbound/util/ub_event_pluggable.c
570
(*ev->vmt->set_fd)(ev, fd);
usr.sbin/unbound/util/ub_event_pluggable.c
89
# define UB_EV_BITS_CB(C) void my_ ## C (int fd, short bits, void *arg) \
usr.sbin/unbound/util/ub_event_pluggable.c
90
{ (C)(fd, UB_EV_BITS(bits), arg); }
usr.sbin/unbound/util/winsock_event.c
469
void event_set(struct event *ev, int fd, short bits,
usr.sbin/unbound/util/winsock_event.c
473
ev->ev_fd = fd;
usr.sbin/unbound/util/winsock_event.c
93
find_fd(struct event_base* base, int fd)
usr.sbin/unbound/util/winsock_event.c
97
if(base->items[i]->ev_fd == fd)
usr.sbin/unbound/validator/autotrust.c
1004
if (!(fd = fopen(nm, "r"))) {
usr.sbin/unbound/validator/autotrust.c
1010
while ( (r=read_multiline(line, sizeof(line), fd, &line_nr)) != 0) {
usr.sbin/unbound/validator/autotrust.c
1014
fclose(fd);
usr.sbin/unbound/validator/autotrust.c
1022
fclose(fd);
usr.sbin/unbound/validator/autotrust.c
1043
fclose(fd);
usr.sbin/unbound/validator/autotrust.c
1050
fclose(fd);
usr.sbin/unbound/validator/autotrust.c
992
FILE* fd;
usr.sbin/unbound/validator/val_sigcrypt.c
1198
struct packed_rrset_data fd;
usr.sbin/unbound/validator/val_sigcrypt.c
1218
memset(&fd, 0, sizeof(fd));
usr.sbin/unbound/validator/val_sigcrypt.c
1219
fk.entry.data = &fd;
usr.sbin/unbound/validator/val_sigcrypt.c
1220
fd.count = 2;
usr.sbin/unbound/validator/val_sigcrypt.c
1221
fd.rr_len = flen;
usr.sbin/unbound/validator/val_sigcrypt.c
1222
fd.rr_data = fdata;
usr.sbin/usbdevs/usbdevs.c
219
dump_controller(char *name, int fd, uint8_t addr)
usr.sbin/usbdevs/usbdevs.c
224
dump_device(fd, addr);
usr.sbin/usbdevs/usbdevs.c
231
dump_device(fd, addr);
usr.sbin/usbdevs/usbdevs.c
237
int ch, fd;
usr.sbin/usbdevs/usbdevs.c
278
if ((fd = open(path, O_RDONLY)) < 0) {
usr.sbin/usbdevs/usbdevs.c
284
dump_controller(path, fd, addr);
usr.sbin/usbdevs/usbdevs.c
285
close(fd);
usr.sbin/usbdevs/usbdevs.c
292
if ((fd = open(controller, O_RDONLY)) < 0)
usr.sbin/usbdevs/usbdevs.c
295
dump_controller(controller, fd, addr);
usr.sbin/usbdevs/usbdevs.c
296
close(fd);
usr.sbin/usbdevs/usbdevs.c
72
dump_device(int fd, uint8_t addr)
usr.sbin/usbdevs/usbdevs.c
80
if (ioctl(fd, USB_DEVICEINFO, &di) == -1) {
usr.sbin/user/user.c
1322
int fd;
usr.sbin/user/user.c
1336
if ((fd = mkstemp(f)) == -1) {
usr.sbin/user/user.c
1341
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
1345
close(fd);
usr.sbin/user/user.c
405
int fd, ret;
usr.sbin/user/user.c
423
if ((fd = mkstemp(f)) == -1) {
usr.sbin/user/user.c
428
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
431
close(fd);
usr.sbin/user/user.c
482
int fd;
usr.sbin/user/user.c
495
if ((fd = mkstemp(f)) == -1) {
usr.sbin/user/user.c
500
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
503
close(fd);
usr.sbin/user/user.c
585
int fd;
usr.sbin/user/user.c
620
if ((fd = mkstemp(f)) == -1) {
usr.sbin/user/user.c
625
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
628
close(fd);
usr.sbin/user/user.c
798
int fd;
usr.sbin/user/user.c
802
if ((fd = mkstemp(template)) == -1) {
usr.sbin/user/user.c
806
if ((fp = fdopen(fd, "w")) == NULL) {
usr.sbin/vmctl/main.c
174
close(ibuf->fd);
usr.sbin/vmctl/main.c
426
int fd;
usr.sbin/vmctl/main.c
442
if ((fd = open(s, O_RDONLY)) != -1) {
usr.sbin/vmctl/main.c
443
len = read(fd, buf, sizeof(buf));
usr.sbin/vmctl/main.c
444
close(fd);
usr.sbin/vmctl/main.c
610
int fd;
usr.sbin/vmctl/main.c
630
if ((src.fd = open_imagefile(src.type, src.disk, O_RDONLY,
usr.sbin/vmctl/main.c
652
if ((dst.fd = open_imagefile(dst.type, dst.disk, O_RDWR,
usr.sbin/vmctl/vmctl.c
824
int fd, ret, basefd[VM_MAX_BASE_PER_DISK], nfd, i;
usr.sbin/vmctl/vmctl.c
828
if ((fd = open(imgfile_path, flags)) == -1)
usr.sbin/vmctl/vmctl.c
831
basefd[0] = fd;
usr.sbin/vmctl/vmctl.c
857
ret = virtio_raw_init(file, sz, &fd, 1);
usr.sbin/vmctl/vmctl.c
867
return (fd);
usr.sbin/vmd/atomicio.c
107
pfd.fd = fd;
usr.sbin/vmd/atomicio.c
110
res = (f) (fd, iov, iovcnt);
usr.sbin/vmd/atomicio.c
152
atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.sbin/vmd/atomicio.c
155
return atomiciov6(f, fd, _iov, iovcnt, NULL, NULL);
usr.sbin/vmd/atomicio.c
164
pfd.fd = imsgbuf->fd;
usr.sbin/vmd/atomicio.c
46
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
usr.sbin/vmd/atomicio.c
54
pfd.fd = fd;
usr.sbin/vmd/atomicio.c
57
res = (f) (fd, s + pos, n - pos);
usr.sbin/vmd/atomicio.c
82
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.sbin/vmd/atomicio.c
84
return atomicio6(f, fd, _s, n, NULL, NULL);
usr.sbin/vmd/atomicio.c
91
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.sbin/vmd/atomicio.h
38
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
usr.sbin/vmd/atomicio.h
48
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
usr.sbin/vmd/config.c
196
int fd = -1, cdromfd = -1, kernfd = -1;
usr.sbin/vmd/config.c
478
if ((fd = dup(vm->vm_tty)) == -1) {
usr.sbin/vmd/config.c
517
vm->vm_vmid, fd, NULL, 0);
usr.sbin/vmd/config.c
565
int fd;
usr.sbin/vmd/config.c
569
fd = imsg_get_fd(imsg);
usr.sbin/vmd/config.c
572
vmc.vmc_kernel = fd;
usr.sbin/vmd/config.c
580
vm->vm_kernel = fd;
usr.sbin/vmd/config.c
584
if (fd != -1)
usr.sbin/vmd/config.c
585
close(fd);
usr.sbin/vmd/config.c
599
int fd;
usr.sbin/vmd/config.c
610
fd = imsg_get_fd(imsg);
usr.sbin/vmd/config.c
612
if (n >= vm->vm_params.vmc_ndisks || fd == -1) {
usr.sbin/vmd/config.c
623
vm->vm_disks[n][idx] = fd;
usr.sbin/vmd/config.c
632
int fd;
usr.sbin/vmd/config.c
643
fd = imsg_get_fd(imsg);
usr.sbin/vmd/config.c
646
vm->vm_ifs[n].vif_fd != -1 || fd == -1) {
usr.sbin/vmd/config.c
650
vm->vm_ifs[n].vif_fd = fd;
usr.sbin/vmd/config.c
653
if (fd != -1)
usr.sbin/vmd/config.c
654
close(fd);
usr.sbin/vmd/config.c
663
int fd;
usr.sbin/vmd/config.c
673
fd = imsg_get_fd(imsg);
usr.sbin/vmd/config.c
674
if (fd == -1) {
usr.sbin/vmd/config.c
679
vm->vm_cdrom = fd;
usr.sbin/vmd/control.c
181
int fd;
usr.sbin/vmd/control.c
187
if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) {
usr.sbin/vmd/control.c
196
close(fd);
usr.sbin/vmd/control.c
203
close(fd);
usr.sbin/vmd/control.c
215
if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
usr.sbin/vmd/control.c
217
close(fd);
usr.sbin/vmd/control.c
225
close(fd);
usr.sbin/vmd/control.c
230
cs->cs_fd = fd;
usr.sbin/vmd/control.c
319
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,
usr.sbin/vmd/control.c
327
control_connbyfd(int fd)
usr.sbin/vmd/control.c
332
if (c->iev.ibuf.fd == fd)
usr.sbin/vmd/control.c
340
control_close(int fd, struct control_sock *cs)
usr.sbin/vmd/control.c
345
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/vmd/control.c
346
log_warn("%s: fd %d: not found", __func__, fd);
usr.sbin/vmd/control.c
354
if (notify->ctl_fd == fd) {
usr.sbin/vmd/control.c
362
close(c->iev.ibuf.fd);
usr.sbin/vmd/control.c
374
control_dispatch_imsg(int fd, short event, void *arg)
usr.sbin/vmd/control.c
384
uint32_t peer_id = fd, type;
usr.sbin/vmd/control.c
386
if ((c = control_connbyfd(fd)) == NULL) {
usr.sbin/vmd/control.c
387
log_warn("%s: fd %d: not found", __func__, fd);
usr.sbin/vmd/control.c
393
control_close(fd, cs);
usr.sbin/vmd/control.c
399
control_close(fd, cs);
usr.sbin/vmd/control.c
406
control_close(fd, cs);
usr.sbin/vmd/control.c
466
control_close(fd, cs);
usr.sbin/vmd/control.c
483
notify->ctl_fd = fd;
usr.sbin/vmd/control.c
486
__func__, fd);
usr.sbin/vmd/control.c
493
control_close(fd, cs);
usr.sbin/vmd/control.c
500
control_close(fd, cs);
usr.sbin/vmd/control.c
517
control_close(fd, cs);
usr.sbin/vmd/control.c
533
control_close(fd, cs);
usr.sbin/vmd/control.c
83
control_dispatch_vmd(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/i8253.c
368
i8253_fire(int fd, short type, void *arg)
usr.sbin/vmd/i8253.c
50
i8253_pipe_dispatch(int fd, short event, void *arg)
usr.sbin/vmd/mc146818.c
120
rtc_fire1(int fd, short type, void *arg)
usr.sbin/vmd/mc146818.c
146
rtc_fireper(int fd, short type, void *arg)
usr.sbin/vmd/mc146818.c
73
mc146818_pipe_dispatch(int fd, short event, void *arg)
usr.sbin/vmd/ns8250.c
120
event_set(&com1_dev.event, com1_dev.fd, EV_READ | EV_PERSIST,
usr.sbin/vmd/ns8250.c
128
event_set(&com1_dev.wake, com1_dev.fd, EV_WRITE,
usr.sbin/vmd/ns8250.c
142
com_rcv_event(int fd, short kind, void *arg)
usr.sbin/vmd/ns8250.c
205
sz = read(com->fd, buf, sizeof(buf));
usr.sbin/vmd/ns8250.c
264
write(com1_dev.fd, &vei->vei.vei_data, 1);
usr.sbin/vmd/ns8250.c
48
ns8250_pipe_dispatch(int fd, short event, void *arg)
usr.sbin/vmd/ns8250.c
74
ratelimit(int fd, short type, void *arg)
usr.sbin/vmd/ns8250.c
86
ns8250_init(int fd, uint32_t vmid)
usr.sbin/vmd/ns8250.c
97
com1_dev.fd = fd;
usr.sbin/vmd/ns8250.h
70
int fd;
usr.sbin/vmd/priv.c
75
priv_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/proc.c
151
event_set(&iev->ev, iev->ibuf.fd, iev->events,
usr.sbin/vmd/proc.c
198
proc_accept(struct privsep *ps, int fd, enum privsep_procid dst)
usr.sbin/vmd/proc.c
208
close(fd);
usr.sbin/vmd/proc.c
214
close(fd);
usr.sbin/vmd/proc.c
217
ps->ps_pipes[dst] = fd;
usr.sbin/vmd/proc.c
220
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/vmd/proc.c
223
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/vmd/proc.c
432
proc_dispatch(int fd, short event, void *arg)
usr.sbin/vmd/proc.c
480
if ((p->p_cb)(fd, p, &imsg) == 0) {
usr.sbin/vmd/proc.c
509
proc_dispatch_null(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/proc.c
536
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/vmd/proc.c
544
pid_t pid, int fd, void *data, size_t datalen)
usr.sbin/vmd/proc.c
546
return imsg_compose_event2(iev, type, peerid, pid, fd, data, datalen,
usr.sbin/vmd/proc.c
552
pid_t pid, int fd, void *data, uint16_t datalen, struct event_base *ev_base)
usr.sbin/vmd/proc.c
556
ret = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data, datalen);
usr.sbin/vmd/proc.c
565
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/vmd/proc.c
569
ret = imsg_composev(&iev->ibuf, type, peerid, pid, fd, iov, iovcnt);
usr.sbin/vmd/proc.c
586
uint32_t type, uint32_t peerid, int fd, void *data, size_t datalen)
usr.sbin/vmd/proc.c
593
if (imsg_compose_event(&ps->ps_ievs[id], type, peerid, pid, fd, data,
usr.sbin/vmd/proc.c
609
uint32_t peerid, int fd, const struct iovec *iov, int iovcnt)
usr.sbin/vmd/proc.c
612
if (imsg_composev_event(&ps->ps_ievs[id], type, peerid, pid, fd, iov,
usr.sbin/vmd/proc.c
630
int fd, ret;
usr.sbin/vmd/proc.c
635
fd = imsg_get_fd(imsg);
usr.sbin/vmd/proc.c
652
ret = proc_compose_imsg(ps, id, type, peerid, fd, data, sz);
usr.sbin/vmd/vioblk.c
396
dev_dispatch_vm(int fd, short event, void *arg)
usr.sbin/vmd/vioblk.c
463
handle_sync_io(int fd, short event, void *arg)
usr.sbin/vmd/vioblk.c
64
vioblk_main(int fd, int fd_vmm)
usr.sbin/vmd/vioblk.c
87
sz = atomicio(read, fd, &dev, sizeof(dev));
usr.sbin/vmd/vioblk.c
98
dev.sync_fd = fd;
usr.sbin/vmd/vionet.c
108
vionet_main(int fd, int fd_vmm)
usr.sbin/vmd/vionet.c
129
sz = atomicio(read, fd, &dev, sizeof(dev));
usr.sbin/vmd/vionet.c
140
dev.sync_fd = fd;
usr.sbin/vmd/vionet.c
1417
read_pipe_rx(int fd, short event, void *arg)
usr.sbin/vmd/vionet.c
1450
read_pipe_tx(int fd, short event, void *arg)
usr.sbin/vmd/vionet.c
1511
read_pipe_main(int fd, short event, void *arg)
usr.sbin/vmd/vionet.c
311
vionet_rx(struct virtio_dev *dev, int fd)
usr.sbin/vmd/vionet.c
426
if (vionet->lockedmac || fd != vionet->data_fd)
usr.sbin/vmd/vionet.c
427
sz = vionet_rx_copy(vionet, fd, iov_rx, iov_cnt,
usr.sbin/vmd/vionet.c
430
sz = vionet_rx_zerocopy(vionet, fd, iov_rx, iov_cnt);
usr.sbin/vmd/vionet.c
474
vionet_rx_copy(struct vionet_dev *dev, int fd, const struct iovec *iov,
usr.sbin/vmd/vionet.c
485
if (fd == dev->data_fd)
usr.sbin/vmd/vionet.c
487
else if (fd == pipe_inject[READ])
usr.sbin/vmd/vionet.c
490
log_warnx("%s: invalid fd: %d", __func__, fd);
usr.sbin/vmd/vionet.c
499
sz = read(fd, buf, nbytes);
usr.sbin/vmd/vionet.c
506
} else if (fd == dev->data_fd && sz < VIONET_MIN_TXLEN) {
usr.sbin/vmd/vionet.c
510
} else if (fd == pipe_inject[READ] && sz != sizeof(struct packet)) {
usr.sbin/vmd/vionet.c
517
if (fd == pipe_inject[READ]) {
usr.sbin/vmd/vionet.c
573
vionet_rx_zerocopy(struct vionet_dev *dev, int fd, const struct iovec *iov,
usr.sbin/vmd/vionet.c
584
sz = readv(fd, iov, iov_cnt);
usr.sbin/vmd/vionet.c
597
vionet_rx_event(int fd, short event, void *arg)
usr.sbin/vmd/vionet.c
609
ret = vionet_rx(dev, fd);
usr.sbin/vmd/vionet.c
837
dev_dispatch_vm(int fd, short event, void *arg)
usr.sbin/vmd/vionet.c
913
handle_sync_io(int fd, short event, void *arg)
usr.sbin/vmd/vioqcow2.c
115
virtio_qcow2_init(struct virtio_backing *file, off_t *szp, int *fd, size_t nfd)
usr.sbin/vmd/vioqcow2.c
122
if (qc2_open(diskp, fd, nfd) == -1) {
usr.sbin/vmd/vioqcow2.c
141
virtio_qcow2_get_base(int fd, char *path, size_t npath, const char *dpath)
usr.sbin/vmd/vioqcow2.c
150
if (pread(fd, &header, sizeof(header), 0) != sizeof(header)) {
usr.sbin/vmd/vioqcow2.c
167
if (pread(fd, path, backingsz, backingoff) != backingsz) {
usr.sbin/vmd/vioqcow2.c
215
int version, fd;
usr.sbin/vmd/vioqcow2.c
217
fd = fds[0];
usr.sbin/vmd/vioqcow2.c
218
disk->fd = fd;
usr.sbin/vmd/vioqcow2.c
222
if (pread(fd, &header, sizeof(header), 0) != sizeof(header))
usr.sbin/vmd/vioqcow2.c
258
if (fstat(fd, &st) == -1)
usr.sbin/vmd/vioqcow2.c
269
if (pread(disk->fd, disk->l1, (size_t)l1bytes, disk->l1off)
usr.sbin/vmd/vioqcow2.c
284
if (pread(fd, basepath, backingsz, backingoff) != backingsz) {
usr.sbin/vmd/vioqcow2.c
376
else if (pread(d->fd, buf, sz, phys_off) != sz)
usr.sbin/vmd/vioqcow2.c
444
if (pwrite(disk->fd, buf, sz, phys_off) != sz)
usr.sbin/vmd/vioqcow2.c
462
close(disk->fd);
usr.sbin/vmd/vioqcow2.c
502
if (pread(disk->fd, &buf, sizeof(buf), l2tab + l2off * 8) !=
usr.sbin/vmd/vioqcow2.c
553
if (ftruncate(disk->fd, disk->end) == -1)
usr.sbin/vmd/vioqcow2.c
569
if (ftruncate(disk->fd, disk->end + disk->clustersz) < 0)
usr.sbin/vmd/vioqcow2.c
576
if (pwrite(disk->fd, &buf, sizeof(buf), l2tab + l2off * 8) != 8)
usr.sbin/vmd/vioqcow2.c
581
if (pwrite(disk->fd, &buf, sizeof(buf), disk->l1off + 8 * l1off) != 8)
usr.sbin/vmd/vioqcow2.c
603
n = pread(base->fd, scratch, disk->clustersz, src);
usr.sbin/vmd/vioqcow2.c
608
n = pwrite(disk->fd, scratch, disk->clustersz, dst);
usr.sbin/vmd/vioqcow2.c
629
if (pread(disk->fd, &buf, sizeof(buf), l1off) != 8)
usr.sbin/vmd/vioqcow2.c
636
if (ftruncate(disk->fd, disk->end) < 0)
usr.sbin/vmd/vioqcow2.c
639
if (pwrite(disk->fd, &buf, sizeof(buf), l1off) != 8)
usr.sbin/vmd/vioqcow2.c
646
if (pread(disk->fd, &refs, sizeof(refs),
usr.sbin/vmd/vioqcow2.c
652
if (pwrite(disk->fd, &refs, sizeof(refs), l2cluster + 2 * l2idx) != 2)
usr.sbin/vmd/vioqcow2.c
675
int fd, ret;
usr.sbin/vmd/vioqcow2.c
682
fd = open(base_path, O_RDONLY);
usr.sbin/vmd/vioqcow2.c
683
if (read(fd, &basehdr, sizeof(basehdr)) != sizeof(basehdr))
usr.sbin/vmd/vioqcow2.c
685
close(fd);
usr.sbin/vmd/vioqcow2.c
730
fd = open(imgfile_path, O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
usr.sbin/vmd/vioqcow2.c
732
if (fd == -1)
usr.sbin/vmd/vioqcow2.c
736
if (write(fd, &hdr, sizeof(hdr)) != sizeof(hdr))
usr.sbin/vmd/vioqcow2.c
74
int fd;
usr.sbin/vmd/vioqcow2.c
740
if (base_path && write(fd, base_path, base_len) != base_len)
usr.sbin/vmd/vioqcow2.c
744
if (ftruncate(fd, (off_t)initsz + clustersz) == -1)
usr.sbin/vmd/vioqcow2.c
758
if (pwrite(fd, &v, 8, refoff) != 8)
usr.sbin/vmd/vioqcow2.c
762
if (pwrite(fd, &refs, 2, initsz + 2*i) != 2)
usr.sbin/vmd/vioqcow2.c
766
ret = close(fd);
usr.sbin/vmd/vioqcow2.c
770
close(fd);
usr.sbin/vmd/vioraw.c
108
int fd, ret;
usr.sbin/vmd/vioraw.c
111
fd = open(imgfile_path, O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
usr.sbin/vmd/vioraw.c
113
if (fd == -1)
usr.sbin/vmd/vioraw.c
117
if (ftruncate(fd, (off_t)imgsize) == -1) {
usr.sbin/vmd/vioraw.c
119
close(fd);
usr.sbin/vmd/vioraw.c
124
ret = close(fd);
usr.sbin/vmd/vioraw.c
65
virtio_raw_init(struct virtio_backing *file, off_t *szp, int *fd, size_t nfd)
usr.sbin/vmd/vioraw.c
73
sz = lseek(fd[0], 0, SEEK_END);
usr.sbin/vmd/vioraw.c
80
*fdp = fd[0];
usr.sbin/vmd/vioscsi.c
423
dev_dispatch_vm(int fd, short event, void *arg)
usr.sbin/vmd/vioscsi.c
489
handle_sync_io(int fd, short event, void *arg)
usr.sbin/vmd/vioscsi.c
60
vioscsi_main(int fd, int fd_vmm)
usr.sbin/vmd/vioscsi.c
78
sz = atomicio(read, fd, &dev, sizeof(dev));
usr.sbin/vmd/vioscsi.c
89
dev.sync_fd = fd;
usr.sbin/vmd/virtio.c
1007
vmmci_pipe_dispatch(int fd, short event, void *arg)
usr.sbin/vmd/virtio.c
1746
int fd = dev->async_fd;
usr.sbin/vmd/virtio.c
1749
dev->dev_type, fd);
usr.sbin/vmd/virtio.c
1751
if (imsgbuf_init(&iev->ibuf, fd) == -1)
usr.sbin/vmd/virtio.c
1763
virtio_dispatch_dev(int fd, short event, void *arg)
usr.sbin/vmd/virtio.c
885
vmmci_timeout(int fd, short type, void *arg)
usr.sbin/vmd/virtio.c
993
virtio_get_disktype(int fd)
usr.sbin/vmd/virtio.c
998
len = pread(fd, buf, sizeof(buf), 0);
usr.sbin/vmd/vm.c
113
sz = atomicio(read, fd, &vm, sizeof(vm));
usr.sbin/vmd/vm.c
124
sz = atomicio(read, fd, &env->vmd_cfg.cfg_localprefix,
usr.sbin/vmd/vm.c
145
ret = start_vm(&vm, fd);
usr.sbin/vmd/vm.c
172
start_vm(struct vmd_vm *vm, int fd)
usr.sbin/vmd/vm.c
200
atomicio(vwrite, fd, &vm->vm_vmmid, sizeof(vm->vm_vmmid));
usr.sbin/vmd/vm.c
225
if (atomicio(vwrite, fd, &vm->vm_vmmid, sizeof(vm->vm_vmmid)) !=
usr.sbin/vmd/vm.c
266
if (vmm_pipe(vm, fd, vm_dispatch_vmm) == -1)
usr.sbin/vmd/vm.c
305
vm_dispatch_vmm(int fd, short event, void *arg)
usr.sbin/vmd/vm.c
329
fatal("%s: imsgbuf_write fd %d", __func__, ibuf->fd);
usr.sbin/vmd/vm.c
83
vm_main(int fd, int fd_vmm)
usr.sbin/vmd/vm.c
962
fd_hasdata(int fd)
usr.sbin/vmd/vm.c
967
pfd[0].fd = fd;
usr.sbin/vmd/vm_agentx.c
131
vm_agentx_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vm_agentx.c
385
vm_agentx_tryconnect(int fd, short event, void *cookie)
usr.sbin/vmd/vm_agentx.c
394
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/vmd/vm_agentx.c
397
} else if (connect(fd, (struct sockaddr *)&sun, sun.sun_len) == -1) {
usr.sbin/vmd/vm_agentx.c
399
close(fd);
usr.sbin/vmd/vm_agentx.c
402
agentx_connect(conn->agentx, fd);
usr.sbin/vmd/vm_agentx.c
404
event_set(&conn->ev, fd, EV_READ|EV_PERSIST, vm_agentx_read, conn);
usr.sbin/vmd/vm_agentx.c
414
vm_agentx_read(int fd, short event, void *cookie)
usr.sbin/vmd/vmd.c
1044
if (vm->vm_iev.ibuf.fd != -1) {
usr.sbin/vmd/vmd.c
1046
close(vm->vm_iev.ibuf.fd);
usr.sbin/vmd/vmd.c
1259
vm->vm_iev.ibuf.fd = -1;
usr.sbin/vmd/vmd.c
1563
vm_checkaccess(int fd, unsigned int uflag, uid_t uid, int amode)
usr.sbin/vmd/vmd.c
1571
if (fd == -1)
usr.sbin/vmd/vmd.c
1577
if (fstat(fd, &st) == -1 || !S_ISREG(st.st_mode))
usr.sbin/vmd/vmd.c
1801
close_fd(int fd)
usr.sbin/vmd/vmd.c
1805
if (fd == -1)
usr.sbin/vmd/vmd.c
1809
do { ret = close(fd); } while (ret == -1 && errno == EINTR);
usr.sbin/vmd/vmd.c
1811
ret = close(fd);
usr.sbin/vmd/vmd.c
1815
log_warn("%s(%d)", __func__, fd);
usr.sbin/vmd/vmd.c
289
vmd_dispatch_vmm(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vmd.c
472
vmd_dispatch_agentx(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vmd.c
489
vmd_dispatch_priv(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vmd.c
753
start_vm_batch(int fd, short type, void *args)
usr.sbin/vmd/vmd.c
90
vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vmm.c
106
vmm_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg)
usr.sbin/vmd/vmm.c
419
vmm_pipe(struct vmd_vm *vm, int fd, void (*cb)(int, short, void *))
usr.sbin/vmd/vmm.c
429
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
usr.sbin/vmd/vmm.c
434
if (imsgbuf_init(&iev->ibuf, fd) == -1) {
usr.sbin/vmd/vmm.c
452
vmm_dispatch_vm(int fd, short event, void *arg)
usr.sbin/vmd/vmm.c
479
fatal("%s: imsgbuf_write fd %d", __func__, ibuf->fd);
usr.sbin/vmd/vmm.c
553
int err = 0, i, fd;
usr.sbin/vmd/vmm.c
560
fd = open(path, O_RDWR | O_NONBLOCK);
usr.sbin/vmd/vmm.c
561
if (fd != -1)
usr.sbin/vmd/vmm.c
581
return (fd);
usr.sbin/wsmoused/mouse_protocols.c
241
FlushInput(int fd)
usr.sbin/wsmoused/mouse_protocols.c
246
if (tcflush(fd, TCIFLUSH) == 0)
usr.sbin/wsmoused/mouse_protocols.c
249
pfd[0].fd = fd;
usr.sbin/wsmoused/mouse_protocols.c
253
read(fd, &c, sizeof(c));
usr.sbin/wsmoused/mouse_protocols.c
280
pfd[0].fd = mouse_fd;
usr.sbin/wsmoused/mouse_protocols.c
566
pfd[0].fd = mouse.mfd;
usr.sbin/wsmoused/wsmoused.c
402
pfd[0].fd = mouse.mfd;
usr.sbin/ypbind/ypbind.c
1014
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) {
usr.sbin/ypbind/ypbind.c
1016
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC,
usr.sbin/ypbind/ypbind.c
1025
ypdb->dom_lockfd = fd;
usr.sbin/ypbind/ypbind.c
511
pfd[0].fd = rpcsock;
usr.sbin/ypbind/ypbind.c
513
pfd[1].fd = pingsock;
usr.sbin/ypbind/ypbind.c
938
int fd;
usr.sbin/ypldap/aldap.c
112
if (tls_connect_socket(ldap->tls, ldap->fd, name) == -1) {
usr.sbin/ypldap/aldap.c
149
wrote = write(ldap->fd, data + done, len);
usr.sbin/ypldap/aldap.c
406
ret = read(ldap->fd, rbuf, sizeof(rbuf));
usr.sbin/ypldap/aldap.c
76
close(al->fd);
usr.sbin/ypldap/aldap.c
85
aldap_init(int fd)
usr.sbin/ypldap/aldap.c
92
a->fd = fd;
usr.sbin/ypldap/aldap.h
47
int fd;
usr.sbin/ypldap/ldapclient.c
126
client_dispatch_dns(int fd, short events, void *p)
usr.sbin/ypldap/ldapclient.c
231
client_dispatch_parent(int fd, short events, void *p)
usr.sbin/ypldap/ldapclient.c
399
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ldapclient.c
408
event_set(&env.sc_iev_dns->ev, env.sc_iev_dns->ibuf.fd,
usr.sbin/ypldap/ldapclient.c
565
int fd = -1;
usr.sbin/ypldap/ldapclient.c
576
if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1)
usr.sbin/ypldap/ldapclient.c
579
if (connect(fd, sa, SA_LEN(sa)) != 0) {
usr.sbin/ypldap/ldapclient.c
581
close(fd);
usr.sbin/ypldap/ldapclient.c
585
al = aldap_init(fd);
usr.sbin/ypldap/ldapclient.c
587
close(fd);
usr.sbin/ypldap/ldapclient.c
703
client_periodic_update(int fd, short event, void *p)
usr.sbin/ypldap/parse.y
843
check_file_secrecy(int fd, const char *fname)
usr.sbin/ypldap/parse.y
847
if (fstat(fd, &st)) {
usr.sbin/ypldap/yp.c
105
yp_fd_event(int fd, short event, void *p)
usr.sbin/ypldap/yp.c
107
svc_getreq_common(fd);
usr.sbin/ypldap/yp.c
197
int fd;
usr.sbin/ypldap/yp.c
201
fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644);
usr.sbin/ypldap/yp.c
202
if (fd == -1) {
usr.sbin/ypldap/yp.c
204
fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC,
usr.sbin/ypldap/yp.c
206
if (fd == -1)
usr.sbin/ypldap/yp.c
210
if (fchmod(fd, 0644) == -1)
usr.sbin/ypldap/yp.c
234
if (writev(fd, iov, sizeof(iov)/sizeof(iov[0])) !=
usr.sbin/ypldap/yp.c
236
close(fd);
usr.sbin/ypldap/ypldap.c
350
main_dispatch_client(int fd, short events, void *p)
usr.sbin/ypldap/ypldap.c
483
main_init_timer(int fd, short event, void *p)
usr.sbin/ypldap/ypldap.c
602
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ypldap.c
647
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/ypldap/ypldap.c
653
pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ypldap/ypldap.c
658
pid, fd, data, datalen)) != -1)
usr.sbin/ypldap/ypldap_dns.c
121
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ypldap_dns.c
132
dns_dispatch_imsg(int fd, short events, void *p)
usr.sbin/ypserv/mkalias/mkalias.c
143
int status, ch, fd;
usr.sbin/ypserv/mkalias/mkalias.c
222
fd = mkstemps(db_tempname, 3);
usr.sbin/ypserv/mkalias/mkalias.c
223
if (fd == -1)
usr.sbin/ypserv/mkalias/mkalias.c
225
close(fd);
usr.sbin/ypserv/mkalias/mkalias.c
233
if (fd != -1)
usr.sbin/ypserv/ypserv/ypserv.c
95
if (svc_pollfd[i].fd != -1)
usr.sbin/ypserv/ypxfr/ypxfr.c
458
int fd;
usr.sbin/ypserv/ypxfr/ypxfr.c
463
fd = mkstemp(tmpmapname);
usr.sbin/ypserv/ypxfr/ypxfr.c
464
if (fd == -1)
usr.sbin/ypserv/ypxfr/ypxfr.c
467
close(fd);