Symbol: fd
bin/cat/cat.c
237
int fd;
bin/cat/cat.c
239
fd = fileno(stdin);
bin/cat/cat.c
244
fd = fileno(stdin);
bin/cat/cat.c
245
if (fd < 0)
bin/cat/cat.c
249
fd = open(*argv, O_RDONLY|O_NONBLOCK, 0);
bin/cat/cat.c
250
if (fd < 0)
bin/cat/cat.c
253
if (fstat(fd, &st) == -1) {
bin/cat/cat.c
254
close(fd);
bin/cat/cat.c
258
close(fd);
bin/cat/cat.c
263
else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
bin/cat/cat.c
272
} else if (fd < 0) {
bin/cat/cat.c
275
raw_cat(fd);
bin/cat/cat.c
276
if (fd != fileno(stdin))
bin/cat/cat.c
277
(void)close(fd);
bin/cp/utils.c
364
setfile(struct stat *fs, int fd)
bin/cp/utils.c
378
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
bin/cp/utils.c
386
if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) {
bin/cp/utils.c
402
if ((fd ? fchflags(fd, fflags) :
bin/cp/utils.c
410
if (fd == 0 && set_utimes(to.p_path, fs))
bin/csh/exec.c
273
int fd;
bin/csh/exec.c
291
if ((fd = open(f, O_RDONLY)) != -1) {
bin/csh/exec.c
292
if (read(fd, (char *)&c, 1) == 1) {
bin/csh/exec.c
294
(void)close(fd);
bin/csh/exec.c
305
(void)close(fd);
bin/csh/exec.c
318
if (fd != -1 && c != '#')
bin/csh/sem.c
527
int fd, flags;
bin/csh/sem.c
545
if ((fd = open(tmp, O_RDONLY)) < 0) {
bin/csh/sem.c
549
(void)dmove(fd, 0);
bin/csh/sem.c
580
(fd = open(tmp, O_WRONLY | O_APPEND)) >= 0);
bin/csh/sem.c
582
(fd = open(tmp, O_WRONLY)) >= 0)
bin/csh/sem.c
593
if ((fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
bin/csh/sem.c
598
(void)dmove(fd, 1);
bin/date/netdate.c
141
ready.fd = s;
bin/dd/dd.c
179
in.fd = STDIN_FILENO;
bin/dd/dd.c
183
in.fd = ddop_open(in, in.name, iflag, 0);
bin/dd/dd.c
184
if (in.fd < 0)
bin/dd/dd.c
201
out.fd = STDOUT_FILENO;
bin/dd/dd.c
221
out.fd = ddop_open(out, out.name, O_RDWR | OFLAGS, DEFFILEMODE);
bin/dd/dd.c
227
if (out.fd < 0) {
bin/dd/dd.c
228
out.fd = ddop_open(out, out.name, O_WRONLY | OFLAGS,
bin/dd/dd.c
232
if (out.fd < 0) {
bin/dd/dd.c
276
(void)ddop_ftruncate(out, out.fd, (off_t)out.offset * out.dbsz);
bin/dd/dd.c
322
if (io->ops->op_fstat(io->fd, &sb)) {
bin/dd/dd.c
327
io->flags |= io->ops->op_ioctl(io->fd, MTIOCGET, &mt)
bin/dd/dd.c
329
else if (io->ops->op_lseek(io->fd, (off_t)0, SEEK_CUR) == -1
bin/dd/dd.c
343
int fd = io->fd;
bin/dd/dd.c
346
if (fd != STDIN_FILENO && fd != STDOUT_FILENO &&
bin/dd/dd.c
347
fd != STDERR_FILENO)
bin/dd/dd.c
355
newfd = io->ops->op_fcntl(fd, F_DUPFD, 3);
bin/dd/dd.c
361
io->ops->op_close(fd);
bin/dd/dd.c
362
io->fd = newfd;
bin/dd/dd.c
389
n = ddop_read(in, in.fd, in.dbp, in.dbsz);
bin/dd/dd.c
416
ddop_lseek(in, in.fd, (off_t)in.dbsz, SEEK_CUR))
bin/dd/dd.c
504
if (out.fd == STDOUT_FILENO && ddop_fsync(out, out.fd) == -1
bin/dd/dd.c
509
if (ddop_close(out, out.fd) == -1) {
bin/dd/dd.c
559
out.fd, pending, SEEK_CUR) == -1)
bin/dd/dd.c
626
rv = io->ops->op_write(io->fd, buf, len);
bin/dd/dd.h
84
int fd; /* file descriptor */
bin/dd/position.c
140
if (ddop_lseek(out, out.fd,
bin/dd/position.c
152
if (ddop_ioctl(out, out.fd, MTIOCTOP, &t_op) < 0)
bin/dd/position.c
160
if ((n = ddop_read(out, out.fd, out.db, out.dbsz)) > 0)
bin/dd/position.c
174
if (ddop_ioctl(out, out.fd, MTIOCTOP, &t_op) == -1)
bin/dd/position.c
73
if (ddop_lseek(in, in.fd,
bin/dd/position.c
88
if ((nr = ddop_read(in, in.fd, in.db, bcnt)) > 0) {
bin/ed/buf.c
208
int u, fd;
bin/ed/buf.c
213
fd = -1;
bin/ed/buf.c
231
if ((fd = mkstemp(sfn)) == -1 || (sfp = fdopen(fd, "w+")) == NULL) {
bin/ed/buf.c
232
if (fd != -1)
bin/ed/buf.c
233
close(fd);
bin/ksh/c_ksh.c
228
int fd = 1;
bin/ksh/c_ksh.c
284
if ((fd = coproc_getfd(W_OK, &emsg)) < 0) {
bin/ksh/c_ksh.c
298
fd = 0;
bin/ksh/c_ksh.c
299
else if ((fd = check_fd(s, W_OK, &emsg)) < 0) {
bin/ksh/c_ksh.c
383
if (coproc.write >= 0 && coproc.write == fd) {
bin/ksh/c_ksh.c
389
n = write(fd, s, len);
bin/ksh/c_sh.c
253
int fd = 0;
bin/ksh/c_sh.c
266
if ((fd = coproc_getfd(R_OK, &emsg)) < 0) {
bin/ksh/c_sh.c
280
fd = 0;
bin/ksh/c_sh.c
281
else if ((fd = check_fd(cp, R_OK, &emsg)) < 0) {
bin/ksh/c_sh.c
297
shf = shf_reopen(fd, SHF_RD | SHF_INTERRUPT | can_seek(fd), shl_spare);
bin/ksh/c_sh.c
301
if (isatty(fd)) {
bin/ksh/c_sh.c
363
if (Flag(FTALKING_I) && isatty(fd)) {
bin/ksh/c_sh.c
422
coproc_read_close(fd);
bin/ksh/exec.c
1260
volatile int fd = -1;
bin/ksh/exec.c
1276
if (!(shf = h->shf) || (fd = open(h->name, O_RDONLY, 0)) < 0) {
bin/ksh/exec.c
1292
close(fd);
bin/ksh/exec.c
1310
close(fd);
bin/ksh/exec.c
1316
return fd;
bin/ksh/exec.c
58
fd_clexec(fd)
bin/ksh/exec.c
59
int fd;
bin/ksh/exec.c
62
if (fd >= 0 && fd < sizeof(clexec_tab)) {
bin/ksh/exec.c
63
clexec_tab[fd] = 1;
bin/ksh/exec.c
68
return fcntl(fd, F_SETFD, 1);
bin/ksh/history.c
1174
sprinkle(fd)
bin/ksh/history.c
1175
int fd;
bin/ksh/history.c
1179
return(write(fd, mag, 2) != 2);
bin/ksh/history.c
739
int fd;
bin/ksh/history.c
756
if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0600)) != -1) {
bin/ksh/history.c
758
ftruncate(fd, 0);
bin/ksh/history.c
759
if ((fh = fdopen(fd, "w")) != NULL) {
bin/ksh/history.c
838
int fd;
bin/ksh/history.c
854
if ((fd = open(hname, O_RDWR|O_CREAT|O_APPEND, 0600)) < 0)
bin/ksh/history.c
857
histfd = savefd(fd, 0);
bin/ksh/history.c
950
int fd;
bin/ksh/history.c
966
if ((fd = creat(nfile, 0600)) < 0)
bin/ksh/history.c
969
if (sprinkle(fd)) {
bin/ksh/history.c
970
close(fd);
bin/ksh/history.c
974
if (write(fd, nbase, nbytes) != nbytes) {
bin/ksh/history.c
975
close(fd);
bin/ksh/history.c
983
fchown(fd, statb.st_uid, statb.st_gid);
bin/ksh/history.c
984
close(fd);
bin/ksh/io.c
208
can_seek(fd)
bin/ksh/io.c
209
int fd;
bin/ksh/io.c
213
return fstat(fd, &statb) == 0 && !S_ISREG(statb.st_mode) ?
bin/ksh/io.c
249
savefd(fd, noclose)
bin/ksh/io.c
250
int fd;
bin/ksh/io.c
255
if (fd < FDBASE) {
bin/ksh/io.c
256
nfd = ksh_dupbase(fd, FDBASE);
bin/ksh/io.c
264
close(fd);
bin/ksh/io.c
266
nfd = fd;
bin/ksh/io.c
272
restfd(fd, ofd)
bin/ksh/io.c
273
int fd, ofd;
bin/ksh/io.c
275
if (fd == 2)
bin/ksh/io.c
276
shf_flush(&shf_iob[fd]);
bin/ksh/io.c
278
close(fd);
bin/ksh/io.c
279
else if (fd != ofd) {
bin/ksh/io.c
280
ksh_dup2(ofd, fd, true); /* XXX: what to do if this fails? */
bin/ksh/io.c
312
int fd, fl;
bin/ksh/io.c
315
fd = name[0] - '0';
bin/ksh/io.c
316
if ((fl = fcntl(fd = name[0] - '0', F_GETFL, 0)) < 0) {
bin/ksh/io.c
337
return fd;
bin/ksh/io.c
360
coproc_read_close(fd)
bin/ksh/io.c
361
int fd;
bin/ksh/io.c
363
if (coproc.read >= 0 && fd == coproc.read) {
bin/ksh/io.c
364
coproc_readw_close(fd);
bin/ksh/io.c
374
coproc_readw_close(fd)
bin/ksh/io.c
375
int fd;
bin/ksh/io.c
377
if (coproc.readw >= 0 && coproc.read >= 0 && fd == coproc.read) {
bin/ksh/io.c
387
coproc_write_close(fd)
bin/ksh/io.c
388
int fd;
bin/ksh/io.c
390
if (coproc.write >= 0 && fd == coproc.write) {
bin/ksh/io.c
404
int fd = (mode & R_OK) ? coproc.read : coproc.write;
bin/ksh/io.c
406
if (fd >= 0)
bin/ksh/io.c
407
return fd;
bin/ksh/io.c
454
int fd;
bin/ksh/io.c
467
fd = mkstemp(pathx);
bin/ksh/io.c
468
if (fd >= 0)
bin/ksh/io.c
469
tp->shf = shf_fdopen(fd, SHF_WR, (struct shf *) 0);
bin/ksh/io.c
478
fd = open(pathx, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600);
bin/ksh/io.c
479
if (fd >= 0) {
bin/ksh/io.c
480
tp->shf = shf_fdopen(fd, SHF_WR, (struct shf *) 0);
bin/ksh/jobs.c
1395
int fd = 2;
bin/ksh/jobs.c
1399
fd = ep->savefd[2];
bin/ksh/jobs.c
1400
shf_reopen(fd, SHF_WR, shl_j);
bin/ksh/jobs.c
60
int tcsetpgrp ARGS((int fd, pid_t grp));
bin/ksh/jobs.c
61
int tcgetpgrp ARGS((int fd));
bin/ksh/jobs.c
617
int fd = open("/dev/null", 0);
bin/ksh/jobs.c
618
if (fd != 0) {
bin/ksh/jobs.c
619
(void) ksh_dup2(fd, 0, true);
bin/ksh/jobs.c
620
close(fd);
bin/ksh/jobs.c
64
tcsetpgrp(fd, grp)
bin/ksh/jobs.c
65
int fd;
bin/ksh/jobs.c
68
return ioctl(fd, TIOCSPGRP, &grp);
bin/ksh/jobs.c
72
tcgetpgrp(fd)
bin/ksh/jobs.c
73
int fd;
bin/ksh/jobs.c
77
if ((r = ioctl(fd, TIOCGPGRP, &grp)) < 0)
bin/ksh/main.c
673
int fd;
bin/ksh/main.c
678
for (fd = 0; fd < NUFILE; fd++)
bin/ksh/main.c
680
if (ep->savefd[fd])
bin/ksh/main.c
681
restfd(fd, ep->savefd[fd]);
bin/ksh/main.c
722
int fd;
bin/ksh/main.c
732
for (fd = 0; fd < NUFILE; fd++)
bin/ksh/main.c
733
if (ep->savefd[fd] > 0)
bin/ksh/main.c
734
close(ep->savefd[fd]);
bin/ksh/misc.c
1217
blocking_read(fd, buf, nbytes)
bin/ksh/misc.c
1218
int fd;
bin/ksh/misc.c
1225
while ((ret = read(fd, buf, nbytes)) < 0) {
bin/ksh/misc.c
1233
if (reset_nonblock(fd) > 0) {
bin/ksh/misc.c
1249
reset_nonblock(fd)
bin/ksh/misc.c
1250
int fd;
bin/ksh/misc.c
1255
if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
bin/ksh/misc.c
1272
if (fcntl(fd, F_SETFL, flags) < 0)
bin/ksh/sh.h
94
#define ksh_dupbase(fd, base) fcntl(fd, F_DUPFD, base)
bin/ksh/shf.c
117
shf->fd = fd;
bin/ksh/shf.c
127
fd_clexec(fd);
bin/ksh/shf.c
133
shf_reopen(fd, sflags, shf)
bin/ksh/shf.c
134
int fd;
bin/ksh/shf.c
142
int flags = fcntl(fd, F_GETFL, 0);
bin/ksh/shf.c
161
shf->fd = fd;
bin/ksh/shf.c
170
fd_clexec(fd);
bin/ksh/shf.c
205
shf->fd = -1;
bin/ksh/shf.c
225
if (shf->fd >= 0) {
bin/ksh/shf.c
227
if (close(shf->fd) < 0)
bin/ksh/shf.c
245
if (shf->fd >= 0) {
bin/ksh/shf.c
247
if (close(shf->fd) < 0)
bin/ksh/shf.c
252
shf->fd = -1;
bin/ksh/shf.c
285
if (shf->fd >= 0)
bin/ksh/shf.c
305
if (shf->fd < 0)
bin/ksh/shf.c
316
lseek(shf->fd, (off_t) -shf->rnleft, 1);
bin/ksh/shf.c
337
if (!(shf->flags & SHF_STRING) && shf->fd < 0)
bin/ksh/shf.c
376
n = write(shf->fd, buf, ntowrite);
bin/ksh/shf.c
419
if (shf->fd < 0)
bin/ksh/shf.c
435
shf->rnleft = blocking_read(shf->fd, (char *) shf->buf,
bin/ksh/shf.c
44
int fd;
bin/ksh/shf.c
465
if (shf->fd < 0) {
bin/ksh/shf.c
493
if (lseek(shf->fd, where, from) < 0) {
bin/ksh/shf.c
54
fd = open(name, oflags, mode);
bin/ksh/shf.c
55
if (fd < 0) {
bin/ksh/shf.c
59
if ((sflags & SHF_MAPHI) && fd < FDBASE) {
bin/ksh/shf.c
62
nfd = ksh_dupbase(fd, FDBASE);
bin/ksh/shf.c
63
close(fd);
bin/ksh/shf.c
655
if (shf->fd < 0)
bin/ksh/shf.c
661
while ((n = write(shf->fd, &cc, 1)) != 1)
bin/ksh/shf.c
68
fd = nfd;
bin/ksh/shf.c
734
n = write(shf->fd, buf, ncopy);
bin/ksh/shf.c
75
return shf_reopen(fd, sflags, shf);
bin/ksh/shf.c
80
shf_fdopen(fd, sflags, shf)
bin/ksh/shf.c
81
int fd;
bin/ksh/shf.c
89
int flags = fcntl(fd, F_GETFL, 0);
bin/ksh/shf.h
13
#define shf_fileno(shf) ((shf)->fd)
bin/ksh/shf.h
14
#define shf_setfileno(shf,nfd) ((shf)->fd = (nfd))
bin/ksh/shf.h
55
int fd; /* file descriptor */
bin/ksh/shf.h
65
struct shf *shf_fdopen ARGS((int fd, int sflags, struct shf *shf));
bin/ksh/shf.h
66
struct shf *shf_reopen ARGS((int fd, int sflags, struct shf *shf));
bin/ksh/tty.c
17
get_tty(fd, ts)
bin/ksh/tty.c
18
int fd;
bin/ksh/tty.c
24
ret = tcgetattr(fd, ts);
bin/ksh/tty.c
27
ret = ioctl(fd, TCGETA, ts);
bin/ksh/tty.c
29
ret = ioctl(fd, TIOCGETP, &ts->sgttyb);
bin/ksh/tty.c
31
if (ioctl(fd, TIOCGATC, &ts->lchars) < 0)
bin/ksh/tty.c
34
if (ioctl(fd, TIOCGETC, &ts->tchars) < 0)
bin/ksh/tty.c
37
if (ioctl(fd, TIOCGLTC, &ts->ltchars) < 0)
bin/ksh/tty.c
47
set_tty(fd, ts, flags)
bin/ksh/tty.c
48
int fd;
bin/ksh/tty.c
55
ret = tcsetattr(fd, TCSADRAIN, ts);
bin/ksh/tty.c
77
ret = ioctl(fd, TIOCSETN, &ts->sgttyb);
bin/ksh/tty.c
79
if (ioctl(fd, TIOCSATC, &ts->lchars) < 0)
bin/ksh/tty.c
82
if (ioctl(fd, TIOCSETC, &ts->tchars) < 0)
bin/ksh/tty.c
85
if (ioctl(fd, TIOCSLTC, &ts->ltchars) < 0)
bin/ksh/tty.h
100
extern int get_tty ARGS((int fd, TTY_state *ts));
bin/ksh/tty.h
101
extern int set_tty ARGS((int fd, TTY_state *ts, int flags));
bin/pax/ar_io.c
1578
ar_start_gzip(int fd, const char *gzp, int wr)
bin/pax/ar_io.c
1592
dup2(fds[1], fd);
bin/pax/ar_io.c
1594
dup2(fds[0], fd);
bin/pax/ar_io.c
1600
dup2(fd, STDOUT_FILENO);
bin/pax/ar_io.c
1604
dup2(fd, STDIN_FILENO);
bin/pax/ar_io.c
584
read_with_restart(int fd, void *buf, int bsz)
bin/pax/ar_io.c
588
while (((r = read(fd, buf, bsz)) < 0) && errno == EINTR)
bin/pax/ar_io.c
602
rmtread_with_restart(int fd, void *buf, int bsz)
bin/pax/ar_io.c
606
while (((r = rmtread(fd, buf, bsz)) < 0) && errno == EINTR)
bin/pax/ar_io.c
622
xread(int fd, void *buf, int bsz)
bin/pax/ar_io.c
630
if ((r = rmtread_with_restart(fd, b, bsz)) <= 0)
bin/pax/ar_io.c
633
if ((r = read_with_restart(fd, b, bsz)) <= 0)
bin/pax/ar_io.c
654
write_with_restart(int fd, void *buf, int bsz)
bin/pax/ar_io.c
658
while (((r = write(fd, buf, bsz)) < 0) && errno == EINTR)
bin/pax/ar_io.c
673
rmtwrite_with_restart(int fd, void *buf, int bsz)
bin/pax/ar_io.c
677
while (((r = rmtwrite(fd, buf, bsz)) < 0) && errno == EINTR)
bin/pax/ar_io.c
693
xwrite(int fd, void *buf, int bsz)
bin/pax/ar_io.c
701
if ((r = rmtwrite_with_restart(fd, b, bsz)) <= 0)
bin/pax/ar_io.c
704
if ((r = write_with_restart(fd, b, bsz)) <= 0)
bin/pax/ar_subs.c
300
int fd;
bin/pax/ar_subs.c
480
fd = STDOUT_FILENO;
bin/pax/ar_subs.c
487
if ((fd = file_creat(arcn, write_to_hard_link)) < 0) {
bin/pax/ar_subs.c
498
res = (*frmt->rd_data)(arcn, fd, &cnt);
bin/pax/ar_subs.c
500
file_close(arcn, fd);
bin/pax/ar_subs.c
543
int fd = -1;
bin/pax/ar_subs.c
593
fd = -1;
bin/pax/ar_subs.c
621
if ((fd = open(arcn->org_name, O_RDONLY, 0)) < 0) {
bin/pax/ar_subs.c
637
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
646
if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) {
bin/pax/ar_subs.c
651
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
671
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
684
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
696
res = (*frmt->wr_data)(arcn, fd, &cnt);
bin/pax/ar_subs.c
697
rdfile_close(arcn, &fd);
bin/pax/dumptar.c
104
int fd;
bin/pax/dumptar.c
113
if ((fd = open(argv[1], O_RDONLY)) == -1)
bin/pax/dumptar.c
116
if (fstat(fd, &st) == -1)
bin/pax/dumptar.c
120
MAP_FILE|MAP_PRIVATE, fd, (off_t)0)) == MAP_FAILED)
bin/pax/dumptar.c
122
(void)close(fd);
bin/pax/file_subs.c
1018
if (fd > -1 &&
bin/pax/file_subs.c
1019
lseek(fd, (off_t)wcnt, SEEK_CUR) < 0) {
bin/pax/file_subs.c
1036
switch (fd) {
bin/pax/file_subs.c
1060
} else if (xwrite(fd, st, wcnt) != wcnt) {
bin/pax/file_subs.c
1079
file_flush(int fd, char *fname, int isempt)
bin/pax/file_subs.c
1093
if (lseek(fd, (off_t)-1, SEEK_CUR) < 0) {
bin/pax/file_subs.c
1098
if (write_with_restart(fd, blnk, 1) < 0) {
bin/pax/file_subs.c
1112
rdfile_close(ARCHD *arcn, int *fd)
bin/pax/file_subs.c
1117
if (*fd < 0)
bin/pax/file_subs.c
112
int fd = -1;
bin/pax/file_subs.c
1120
(void)close(*fd);
bin/pax/file_subs.c
1121
*fd = -1;
bin/pax/file_subs.c
1142
set_crc(ARCHD *arcn, int fd)
bin/pax/file_subs.c
1152
if (fd < 0) {
bin/pax/file_subs.c
1168
if ((res = read(fd, tbuf, size)) <= 0)
bin/pax/file_subs.c
1181
else if (fstat(fd, &sb) < 0)
bin/pax/file_subs.c
1185
else if (lseek(fd, (off_t)0L, SEEK_SET) < 0)
bin/pax/file_subs.c
165
fd = mkstemp(arcn->tmp_name);
bin/pax/file_subs.c
166
if (fd >= 0)
bin/pax/file_subs.c
178
return fd;
bin/pax/file_subs.c
188
file_cleanup(ARCHD *arcn, int fd)
bin/pax/file_subs.c
192
if (fd < 0)
bin/pax/file_subs.c
197
if (close(fd) < 0)
bin/pax/file_subs.c
222
file_close(ARCHD *arcn, int fd)
bin/pax/file_subs.c
227
if (fd < 0)
bin/pax/file_subs.c
232
if (close(fd) < 0)
bin/pax/file_subs.c
969
file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
bin/rcp/rcp.c
340
int fd, haderr, indx;
bin/rcp/rcp.c
345
if ((fd = open(name, O_RDONLY, 0)) < 0)
bin/rcp/rcp.c
347
if (fstat(fd, &stb)) {
bin/rcp/rcp.c
388
if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) {
bin/rcp/rcp.c
389
next: (void)close(fd);
bin/rcp/rcp.c
403
result = read(fd, cp, resid);
bin/rcp/rcp.c
419
if (close(fd) && !haderr)
bin/rcp/util.c
149
allocbuf(BUF *bp, int fd, int blksize)
bin/rcp/util.c
155
if (fstat(fd, &stb) < 0) {
bin/rm/rm.c
393
int fd, randint;
bin/rm/rm.c
396
fd = -1;
bin/rm/rm.c
406
if ((fd = open(file, O_RDWR|O_SYNC|O_RSYNC|O_NOFOLLOW, 0)) == -1)
bin/rm/rm.c
409
if (fstat(fd, &sb2)) {
bin/rm/rm.c
427
if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET)) \
bin/rm/rm.c
439
if ((size_t)write(fd, buf, wlen) != wlen) \
bin/rm/rm.c
451
if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET)) \
bin/rm/rm.c
457
if((size_t)read(fd, buf, rlen) != rlen) \
bin/rm/rm.c
506
if (close(fd) == -1) {
bin/rm/rm.c
507
fd = -1;
bin/rm/rm.c
515
if (fd != -1)
bin/rm/rm.c
516
close(fd);
bin/sh/bltin/bltin.h
76
#define fileno(f) ((f)->fd)
bin/sh/eval.c
1542
backcmd->fd = pip[0];
bin/sh/eval.c
771
result->fd = -1;
bin/sh/eval.c
806
result->fd = pip[0];
bin/sh/eval.c
813
result->fd, result->buf, result->nleft, result->jp));
bin/sh/eval.h
61
int fd; /* file descriptor to read from */
bin/sh/expand.c
696
if (in.fd < 0)
bin/sh/expand.c
699
while ((i = read(in.fd, buf, sizeof buf)) < 0 &&
bin/sh/expand.c
733
if (in.fd >= 0)
bin/sh/expand.c
734
close(in.fd);
bin/sh/histedit.c
436
int fd;
bin/sh/histedit.c
439
fd = open(name, mode, S_IWUSR|S_IRUSR);
bin/sh/histedit.c
442
name, mode, fd));
bin/sh/histedit.c
444
if (fd == -1)
bin/sh/histedit.c
447
if (fstat(fd, &statb) == -1) {
bin/sh/histedit.c
449
fd, errno));
bin/sh/histedit.c
450
close(fd);
bin/sh/histedit.c
458
close(fd);
bin/sh/histedit.c
462
return fd;
bin/sh/histedit.c
468
FILE *fd;
bin/sh/histedit.c
489
if ((fd =
bin/sh/histedit.c
500
setlinebuf(fd);
bin/sh/histedit.c
502
VTRACE(DBG_HISTORY, (" fd:%p\n", fd));
bin/sh/histedit.c
506
return fd;
bin/sh/histedit.c
514
int fd;
bin/sh/histedit.c
540
fd = open_history_file(file, O_WRONLY|O_CREAT|O_TRUNC);
bin/sh/histedit.c
541
if (fd != -1) {
bin/sh/histedit.c
542
fp = fdopen(fd, "w");
bin/sh/histedit.c
547
close(fd);
bin/sh/histedit.c
804
int fd;
bin/sh/histedit.c
809
if ((fd = mkstemp(editfile)) < 0)
bin/sh/histedit.c
811
if ((efp = fdopen(fd, "w")) == NULL) {
bin/sh/histedit.c
812
close(fd);
bin/sh/histedit.c
816
" fd=%d\n", editfile, fd));
bin/sh/input.c
194
if (parsefile->fd == 0 && el) {
bin/sh/input.c
216
nr = read(parsefile->fd, buf, BUFSIZ - 8);
bin/sh/input.c
223
if (parsefile->fd == 0 && errno == EWOULDBLOCK) {
bin/sh/input.c
343
if (parsefile->fd == 0 && hist && (something || whichprompt == 2)) {
bin/sh/input.c
490
int fd;
bin/sh/input.c
497
if ((fd = open(fname, O_RDONLY)) < 0)
bin/sh/input.c
505
if (fstat(fd, &sb) == 0 && S_ISREG(sb.st_mode) &&
bin/sh/input.c
506
lseek(fd, 0, SEEK_SET) == 0) {
bin/sh/input.c
507
if (read(fd, magic, 4) == 4) {
bin/sh/input.c
509
(void)close(fd);
bin/sh/input.c
513
if (lseek(fd, 0, SEEK_SET) != 0) {
bin/sh/input.c
514
(void)close(fd);
bin/sh/input.c
519
fd2 = to_upper_fd(fd); /* closes fd, returns higher equiv */
bin/sh/input.c
520
if (fd2 == fd) {
bin/sh/input.c
521
(void) close(fd);
bin/sh/input.c
542
if (pf->fd == from)
bin/sh/input.c
543
pf->fd = to;
bin/sh/input.c
554
setinputfd(int fd, int push)
bin/sh/input.c
556
VTRACE(DBG_INPUT, ("setinputfd(%d, %spush)\n", fd, push?"":"no"));
bin/sh/input.c
559
register_sh_fd(fd, input_fd_swap);
bin/sh/input.c
560
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
bin/sh/input.c
563
if (parsefile->fd > 0)
bin/sh/input.c
564
sh_close(parsefile->fd);
bin/sh/input.c
565
parsefile->fd = fd;
bin/sh/input.c
572
CTRACE(DBG_INPUT, ("setinputfd(%d, %spush) done; plinno=1\n", fd,
bin/sh/input.c
612
parsefile->fd, parsefile->buf, parsenleft, parselleft,
bin/sh/input.c
621
pf->fd = -1;
bin/sh/input.c
635
if (pf->fd >= 0)
bin/sh/input.c
636
sh_close(pf->fd);
bin/sh/input.c
649
parsefile->fd, parsefile->buf, parsenleft, parselleft,
bin/sh/input.c
716
if (parsefile->fd > 0) {
bin/sh/input.c
717
sh_close(parsefile->fd);
bin/sh/input.c
718
parsefile->fd = 0;
bin/sh/input.c
90
int fd; /* file descriptor (or -1 if string) */
bin/sh/jobs.c
127
static pid_t tcgetpgrp(int fd);
bin/sh/jobs.c
128
static int tcsetpgrp(int fd, pid_t pgrp);
bin/sh/jobs.c
131
tcgetpgrp(int fd)
bin/sh/jobs.c
134
if (ioctl(fd, TIOCGPGRP, (char *)&pgrp) == -1)
bin/sh/jobs.c
141
tcsetpgrp(int fd, pid_tpgrp)
bin/sh/jobs.c
143
return ioctl(fd, TIOCSPGRP, (char *)&pgrp);
bin/sh/jobs.c
2062
if (n->nfile.fd != i)
bin/sh/jobs.c
2063
cmdputi(n->nfile.fd);
bin/sh/main.c
380
int fd;
bin/sh/main.c
388
if ((fd = open(name, O_RDONLY)) >= 0)
bin/sh/main.c
389
setinputfd(fd, 1);
bin/sh/main.c
391
if (fd < 0)
bin/sh/main.c
421
int fd;
bin/sh/main.c
424
if ((fd = open(name, O_RDONLY)) >= 0)
bin/sh/main.c
425
setinputfd(fd, 1);
bin/sh/miscbltin.c
102
if (tcgetattr(fd, t) != 0)
bin/sh/miscbltin.c
113
if (tcsetattr(fd, TCSADRAIN | TCSASOFT, &n) == 0)
bin/sh/miscbltin.c
116
(void)tcsetattr(fd, TCSADRAIN | TCSASOFT, t);
bin/sh/miscbltin.c
121
is_a_pipe(int fd)
bin/sh/miscbltin.c
123
if (lseek(fd, 0, SEEK_CUR) == -1 && errno == ESPIPE) {
bin/sh/miscbltin.c
133
next_read_char(int fd, size_t max)
bin/sh/miscbltin.c
150
(void)lseek(fd, (off_t)(pos - len), SEEK_CUR);
bin/sh/miscbltin.c
158
while ((len = read(fd, &c, 1)) != 1) {
bin/sh/miscbltin.c
170
while ((len = read(fd, buffer, max)) < 0)
bin/sh/miscbltin.c
193
next_read_char(int fd, size_t max)
bin/sh/miscbltin.c
201
while ((len = read(fd, &c, 1)) != 1) {
bin/sh/miscbltin.c
97
setrawmode(int fd, int on, int end, struct termios *t)
bin/sh/output.c
125
file->fd = BLOCK_OUT;
bin/sh/output.c
268
if (dest->fd == BLOCK_OUT) {
bin/sh/output.c
279
dest->nleft, dest->buf, dest->fd));
bin/sh/output.c
280
} else if (dest->fd == MEM_OUT) {
bin/sh/output.c
307
if (dest->buf == NULL || dest->nextc == dest->buf || dest->fd < 0)
bin/sh/output.c
309
VTRACE(DBG_OUTPUT, ("flushout fd=%d %zd to write\n", dest->fd,
bin/sh/output.c
311
if (xwrite(dest->fd, dest->buf, dest->nextc - dest->buf) < 0)
bin/sh/output.c
374
strout.fd = BLOCK_OUT;
bin/sh/output.c
604
xwrite(int fd, char *buf, int nbytes)
bin/sh/output.c
613
i = write(fd, buf, n);
bin/sh/output.c
636
if (o->fd == from)
bin/sh/output.c
637
o->fd = to;
bin/sh/output.c
669
sh_close(outx->fd);
bin/sh/output.c
681
outx->fd = to_upper_fd(dup(out2->fd));
bin/sh/output.c
682
register_sh_fd(outx->fd, xtrace_fd_swap);
bin/sh/output.c
686
outx->fd, out2->fd));
bin/sh/output.c
697
outx->fd, outx->buf, outx->nleft, outx->flags));
bin/sh/output.c
708
o->fd = outx->fd;
bin/sh/output.c
718
CTRACE(DBG_OUTPUT, ("-> fd=%d flags=%x[CLONE]\n", outx->fd, o->flags));
bin/sh/output.c
727
outx->fd, outx->buf, outx->nleft, outx->flags));
bin/sh/output.c
745
if (o->fd >= 0 && !(o->flags & OUTPUT_CLONE))
bin/sh/output.c
746
sh_close(o->fd);
bin/sh/output.c
753
outx->fd, outx->buf, outx->nleft, outx->flags));
bin/sh/output.h
46
short fd;
bin/sh/parser.c
1591
int fd;
bin/sh/parser.c
1595
fd = (*out == '\0') ? -1 : number(out); /* number(out) >= 0 */
bin/sh/parser.c
1596
np->nfile.fd = fd; /* do this again later with updated fd */
bin/sh/parser.c
1597
if (fd != np->nfile.fd)
bin/sh/parser.c
1599
fd, user_fd_limit - 1);
bin/sh/parser.c
1600
if (fd < user_fd_limit && fd > max_user_fd)
bin/sh/parser.c
1601
max_user_fd = fd;
bin/sh/parser.c
1605
if (fd < 0)
bin/sh/parser.c
1606
fd = 1;
bin/sh/parser.c
1621
if (fd < 0)
bin/sh/parser.c
1622
fd = 0;
bin/sh/parser.c
1631
np->nhere.fd = 0;
bin/sh/parser.c
1661
np->nfile.fd = fd;
bin/sh/parser.c
1663
VTRACE(DBG_LEXER, (" ->%"PRIdsNT" fd=%d\n", NODETYPENAME(np->type),fd));
bin/sh/redir.c
1007
printone(int fd, int p, int verbose, int pfd)
bin/sh/redir.c
1009
int f = getflags(fd, p, verbose > 1);
bin/sh/redir.c
1016
outfmt(out1, "%d: ", fd);
bin/sh/redir.c
1069
setone(int fd, int pos, int neg, int verbose)
bin/sh/redir.c
1071
int f = getflags(fd, 1, 0);
bin/sh/redir.c
1084
if ((cloexec > 0 && fd <= 2 && (errno = EINVAL)) ||
bin/sh/redir.c
1085
(cloexec != -1 && fcntl(fd, F_SETFD, (fcntl_int) cloexec) == -1))
bin/sh/redir.c
1086
error("Can't set status for fd=%d (%s)", fd, strerror(errno));
bin/sh/redir.c
1094
if (n != f && fcntl(fd, F_SETFL, (fcntl_int)n) == -1)
bin/sh/redir.c
1095
error("Can't set flags for fd=%d (%s)", fd, strerror(errno));
bin/sh/redir.c
1097
printone(fd, 1, verbose, 1);
bin/sh/redir.c
1152
int fd = number(num);
bin/sh/redir.c
1157
(fd >= user_fd_limit && fd > max_user_fd))
bin/sh/redir.c
1161
setone(fd, pos, neg, verbose);
bin/sh/redir.c
1163
printone(fd, 1, verbose, argc > 1);
bin/sh/redir.c
1213
if ((redir_sym[n->type - MIN_REDIR][0] == '<' && n->nfile.fd != 0) ||
bin/sh/redir.c
1214
(redir_sym[n->type - MIN_REDIR][0] == '>' && n->nfile.fd != 1))
bin/sh/redir.c
1215
outfmt(out, "%d", n->nfile.fd);
bin/sh/redir.c
143
int fd;
bin/sh/redir.c
153
is_renamed(const struct renamelist *rl, int fd)
bin/sh/redir.c
156
if (rl->orig == fd)
bin/sh/redir.c
164
saved_redirected_fd(int fd)
bin/sh/redir.c
171
if (rl->into == fd)
bin/sh/redir.c
261
int fd;
bin/sh/redir.c
282
fd = n->nfile.fd;
bin/sh/redir.c
284
fd, max_user_fd, user_fd_limit));
bin/sh/redir.c
285
if (fd < user_fd_limit && fd > max_user_fd)
bin/sh/redir.c
286
max_user_fd = fd;
bin/sh/redir.c
288
n->ndup.dupfd == fd) {
bin/sh/redir.c
290
if (sh_fd(fd) != NULL ||
bin/sh/redir.c
291
saved_redirected_fd(fd) != NULL)
bin/sh/redir.c
292
error("fd %d: %s", fd, strerror(EBADF));
bin/sh/redir.c
295
if (fcntl(fd, F_SETFD, (fcntl_int)0) < 0)
bin/sh/redir.c
296
error("fd %d: %s", fd, strerror(errno));
bin/sh/redir.c
299
if ((renamed = saved_redirected_fd(fd)) != NULL) {
bin/sh/redir.c
300
int to = pick_new_fd(fd);
bin/sh/redir.c
303
("redirect: moved holding fd %d to %d\n", fd, to));
bin/sh/redir.c
305
if (to != fd) /* always... */
bin/sh/redir.c
306
(void)close(fd);
bin/sh/redir.c
308
renumber_sh_fd(sh_fd(fd));
bin/sh/redir.c
310
if ((flags & REDIR_PUSH) && !is_renamed(sv->renamed, fd)) {
bin/sh/redir.c
314
cloexec = fcntl(fd, F_GETFD);
bin/sh/redir.c
325
if ((i = fcntl(fd, F_DUPFD,
bin/sh/redir.c
334
i = fcntl(fd, F_DUPFD,
bin/sh/redir.c
339
i = fcntl(fd, F_DUPFD,
bin/sh/redir.c
345
error("%d: %s", fd, strerror(errno));
bin/sh/redir.c
353
fd_rename(sv, fd, i, cloexec);
bin/sh/redir.c
354
VTRACE(DBG_REDIR, ("fd %d saved as %d%s ", fd, i,
bin/sh/redir.c
358
VTRACE(DBG_REDIR, ("%s\n", fd == 0 ? "STDIN" : ""));
bin/sh/redir.c
359
if (fd == 0)
bin/sh/redir.c
374
int fd = redir->nfile.fd;
bin/sh/redir.c
385
if (fd < 10)
bin/sh/redir.c
386
memory[fd] = 0;
bin/sh/redir.c
448
redir->ndup.dupfd, fd, strerror(EBADF));
bin/sh/redir.c
449
if (fd < 10 && redir->ndup.dupfd < 10 &&
bin/sh/redir.c
451
memory[fd] = 1;
bin/sh/redir.c
452
else if (copyfd(redir->ndup.dupfd, fd,
bin/sh/redir.c
455
redir->ndup.dupfd, fd, strerror(errno));
bin/sh/redir.c
456
VTRACE(DBG_REDIR, ("openredirect: %d%c&%d\n", fd,
bin/sh/redir.c
459
(void) close(fd);
bin/sh/redir.c
460
VTRACE(DBG_REDIR, ("openredirect: %d%c&-\n", fd,
bin/sh/redir.c
467
VTRACE(DBG_REDIR, ("openredirect: %d<<...", fd));
bin/sh/redir.c
477
cloexec = fd > 2 && (flags & REDIR_KEEP) == 0 && !posix;
bin/sh/redir.c
478
if (f != fd) {
bin/sh/redir.c
479
VTRACE(DBG_REDIR, (" -> %d", fd));
bin/sh/redir.c
480
if (copyfd(f, fd, cloexec, 1) < 0) {
bin/sh/redir.c
484
error("redirect reassignment (fd %d) failed: %s", fd,
bin/sh/redir.c
706
int i, fd;
bin/sh/redir.c
713
if ((fd = fcntl(0, F_DUPFD, (fcntl_int)(i - 1))) >= 0) {
bin/sh/redir.c
714
if (fd > biggest_sh_fd)
bin/sh/redir.c
715
biggest_sh_fd = fd;
bin/sh/redir.c
716
close(fd);
bin/sh/redir.c
721
fd = (i / 5) * 4;
bin/sh/redir.c
722
if (fd < 10)
bin/sh/redir.c
723
fd = 10;
bin/sh/redir.c
725
big_sh_fd = fd;
bin/sh/redir.c
736
to_upper_fd(int fd)
bin/sh/redir.c
740
VTRACE(DBG_REDIR|DBG_OUTPUT, ("to_upper_fd(%d)", fd));
bin/sh/redir.c
744
i = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) big_sh_fd);
bin/sh/redir.c
748
if (fd != i)
bin/sh/redir.c
749
close(fd);
bin/sh/redir.c
763
(void)fcntl(fd, F_SETFD, (fcntl_int) FD_CLOEXEC);
bin/sh/redir.c
764
VTRACE(DBG_REDIR|DBG_OUTPUT, (" fails ->%d\n", fd));
bin/sh/redir.c
765
return fd;
bin/sh/redir.c
769
register_sh_fd(int fd, void (*cb)(int, int))
bin/sh/redir.c
778
fp->fd = fd;
bin/sh/redir.c
784
sh_close(int fd)
bin/sh/redir.c
790
if (fp->fd == fd) {
bin/sh/redir.c
797
(void)close(fd);
bin/sh/redir.c
801
sh_fd(int fd)
bin/sh/redir.c
806
if (fp->fd == fd)
bin/sh/redir.c
812
pick_new_fd(int fd)
bin/sh/redir.c
816
to = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) big_sh_fd);
bin/sh/redir.c
818
to = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) (big_sh_fd / 2));
bin/sh/redir.c
820
to = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) (fd + 1));
bin/sh/redir.c
822
to = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) 10);
bin/sh/redir.c
824
to = fcntl(fd, F_DUPFD_CLOEXEC, (fcntl_int) 3);
bin/sh/redir.c
847
if (fp->fd >= big_sh_fd)
bin/sh/redir.c
850
to = pick_new_fd(fp->fd);
bin/sh/redir.c
852
if (fp->fd == to) /* impossible? */
bin/sh/redir.c
856
fp->fd, to));
bin/sh/redir.c
858
(*fp->cb)(fp->fd, to);
bin/sh/redir.c
859
(void)close(fp->fd);
bin/sh/redir.c
860
fp->fd = to;
bin/sh/redir.c
87
#define CLOEXEC(fd) (fcntl((fd), F_SETFD, \
bin/sh/redir.c
88
(fcntl_int)(fcntl((fd), F_GETFD) | FD_CLOEXEC)))
bin/sh/redir.c
90
#define CLOEXEC(fd) __nothing
bin/sh/redir.c
980
getflags(int fd, int p, int all)
bin/sh/redir.c
984
if (!all && (sh_fd(fd) != NULL || saved_redirected_fd(fd) != NULL)) {
bin/sh/redir.c
987
error("Can't get status for fd=%d (%s)", fd, strerror(EBADF));
bin/sh/redir.c
990
if ((c = fcntl(fd, F_GETFD)) == -1) {
bin/sh/redir.c
993
error("Can't get status for fd=%d (%s)", fd, strerror(errno));
bin/sh/redir.c
995
if ((f = fcntl(fd, F_GETFL)) == -1) {
bin/sh/redir.c
998
error("Can't get flags for fd=%d (%s)", fd, strerror(errno));
bin/sh/show.c
127
int fd;
bin/sh/show.c
148
fd = open(s, O_WRONLY|O_APPEND|O_CREAT, 0666);
bin/sh/show.c
149
if (fd == -1) {
bin/sh/show.c
153
fd = to_upper_fd(fd);
bin/sh/show.c
154
if (fd <= 2) {
bin/sh/show.c
155
(void) close(fd);
bin/sh/show.c
157
error("Attempt to use fd %d as tracefile thwarted\n", fd);
bin/sh/show.c
159
register_sh_fd(fd, trace_fd_swap);
bin/sh/show.c
166
tracefile = fdopen(fd, "ae"); /* don't care if it is NULL */
bin/sh/show.c
173
if (tracedata.tfd > 0 && tracedata.tfd != fd)
bin/sh/show.c
176
tracedata.tfd = fd;
bin/sh/show.c
593
if (np->nfile.fd != dftfd) {
bin/sh/show.c
594
sprintf(buf, "%d", np->nfile.fd);
bin/sh/var.c
1731
int fd;
bin/sh/var.c
1738
fd = open("/dev/urandom", 0);
bin/sh/var.c
1739
if (fd == -1) {
bin/sh/var.c
1746
n = read(fd,&random_val,sizeof random_val);
bin/sh/var.c
1748
close(fd);
bin/stty/key.c
198
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/key.c
201
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/stty.c
100
if (tcgetattr(i.fd, &i.t) < 0)
bin/stty/stty.c
102
if (ioctl(i.fd, TIOCGLINED, i.ldisc) < 0)
bin/stty/stty.c
104
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
bin/stty/stty.c
106
if (ioctl(i.fd, TIOCGQSIZE, &i.queue) < 0)
bin/stty/stty.c
153
if (i.set && tcsetattr(i.fd, 0, &i.t) < 0)
bin/stty/stty.c
155
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
bin/stty/stty.c
72
i.fd = STDIN_FILENO;
bin/stty/stty.c
86
if ((i.fd = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
bin/stty/stty.h
41
int fd; /* file descriptor */
common/dist/zlib/examples/gzappend.c
171
int fd; /* file descriptor */
common/dist/zlib/examples/gzappend.c
184
len = read(in->fd, in->buf, 1 << in->size);
common/dist/zlib/examples/gzappend.c
210
if (lseek(in->fd, (off_t)bypass, SEEK_CUR) == -1)
common/dist/zlib/examples/gzappend.c
270
gz.fd = open(name, O_RDWR, 0);
common/dist/zlib/examples/gzappend.c
271
if (gz.fd == -1) bye("cannot open ", name);
common/dist/zlib/examples/gzappend.c
291
lastoff = lseek(gz.fd, 0L, SEEK_CUR) - gz.left;
common/dist/zlib/examples/gzappend.c
331
lastoff = lseek(gz.fd, 0L, SEEK_CUR) - strm->avail_in;
common/dist/zlib/examples/gzappend.c
340
end = lseek(gz.fd, 0L, SEEK_CUR) - gz.left;
common/dist/zlib/examples/gzappend.c
355
lseek(gz.fd, lastoff - (lastbit != 0), SEEK_SET);
common/dist/zlib/examples/gzappend.c
356
if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name);
common/dist/zlib/examples/gzappend.c
358
lseek(gz.fd, -1L, SEEK_CUR);
common/dist/zlib/examples/gzappend.c
359
if (write(gz.fd, gz.buf, 1) != 1) bye("writing after seek to ", name);
common/dist/zlib/examples/gzappend.c
374
lseek(gz.fd, --end, SEEK_SET);
common/dist/zlib/examples/gzappend.c
375
if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name);
common/dist/zlib/examples/gzappend.c
378
lseek(gz.fd, end, SEEK_SET);
common/dist/zlib/examples/gzappend.c
383
return gz.fd;
common/dist/zlib/examples/gzappend.c
390
int fd, len, ret;
common/dist/zlib/examples/gzappend.c
395
fd = 0;
common/dist/zlib/examples/gzappend.c
397
fd = open(name, O_RDONLY, 0);
common/dist/zlib/examples/gzappend.c
398
if (fd == -1)
common/dist/zlib/examples/gzappend.c
411
len = read(fd, in, CHUNK);
common/dist/zlib/examples/gzappend.c
459
if (fd > 0) close(fd);
common/dist/zlib/examples/gzjoin.c
108
in->fd = open(name, O_RDONLY, 0);
common/dist/zlib/examples/gzjoin.c
109
if (in->buf == NULL || in->fd == -1) {
common/dist/zlib/examples/gzjoin.c
131
len = (long)read(in->fd, in->buf + in->left, CHUNK - in->left);
common/dist/zlib/examples/gzjoin.c
182
lseek(in->fd, skip - 1, SEEK_CUR);
common/dist/zlib/examples/gzjoin.c
183
if (read(in->fd, in->buf, 1) != 1)
common/dist/zlib/examples/gzjoin.c
189
lseek(in->fd, skip - left, SEEK_CUR);
common/dist/zlib/examples/gzjoin.c
80
int fd; /* file descriptor */
common/dist/zlib/examples/gzjoin.c
90
if (in->fd != -1)
common/dist/zlib/examples/gzjoin.c
91
close(in->fd);
common/dist/zlib/examples/gzlog.c
1016
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/examples/gzlog.c
1017
if (fd < 0)
common/dist/zlib/examples/gzlog.c
1019
ret = (size_t)write(fd, data, len) != len;
common/dist/zlib/examples/gzlog.c
1020
if (ret | close(fd))
common/dist/zlib/examples/gzlog.c
291
int fd; /* file descriptor for .gz file, opened read/write */
common/dist/zlib/examples/gzlog.c
350
int fd;
common/dist/zlib/examples/gzlog.c
354
while ((fd = open(log->path, O_CREAT | O_EXCL, 0644)) < 0) {
common/dist/zlib/examples/gzlog.c
363
close(fd);
common/dist/zlib/examples/gzlog.c
415
if (lseek(log->fd, 0, SEEK_SET) < 0 ||
common/dist/zlib/examples/gzlog.c
416
read(log->fd, buf, HEAD + EXTRA) != HEAD + EXTRA ||
common/dist/zlib/examples/gzlog.c
450
fsync(log->fd);
common/dist/zlib/examples/gzlog.c
451
ret = lseek(log->fd, HEAD, SEEK_SET) < 0 ||
common/dist/zlib/examples/gzlog.c
452
write(log->fd, ext, EXTRA) != EXTRA ? -1 : 0;
common/dist/zlib/examples/gzlog.c
453
fsync(log->fd);
common/dist/zlib/examples/gzlog.c
476
if (back != 8 && (lseek(log->fd, log->last - len, SEEK_SET) < 0 ||
common/dist/zlib/examples/gzlog.c
477
read(log->fd, buf, 1) != 1))
common/dist/zlib/examples/gzlog.c
491
return lseek(log->fd, log->last - len, SEEK_SET) < 0 ||
common/dist/zlib/examples/gzlog.c
492
write(log->fd, buf + 2 - len, len + 4) != len + 4 ||
common/dist/zlib/examples/gzlog.c
493
lseek(log->fd, log->stored, SEEK_CUR) < 0 ? -1 : 0;
common/dist/zlib/examples/gzlog.c
521
if (write(log->fd, data, put) != put)
common/dist/zlib/examples/gzlog.c
552
if (write(log->fd, buf, 8) != 8 ||
common/dist/zlib/examples/gzlog.c
553
(end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end))
common/dist/zlib/examples/gzlog.c
610
int fd;
common/dist/zlib/examples/gzlog.c
629
fd = open(log->path, O_RDONLY, 0);
common/dist/zlib/examples/gzlog.c
630
if (fd >= 0) {
common/dist/zlib/examples/gzlog.c
631
dict = read(fd, buf, DICT);
common/dist/zlib/examples/gzlog.c
632
close(fd);
common/dist/zlib/examples/gzlog.c
644
if (lseek(log->fd, log->first - (log->back > 8 ? 2 : 1),
common/dist/zlib/examples/gzlog.c
646
read(log->fd, buf, 1) != 1 || lseek(log->fd, -1, SEEK_CUR) < 0) {
common/dist/zlib/examples/gzlog.c
663
if (got && write(log->fd, buf, got) != got) {
common/dist/zlib/examples/gzlog.c
677
if ((log->first = lseek(log->fd, -1, SEEK_CUR)) < 0 ||
common/dist/zlib/examples/gzlog.c
678
read(log->fd, buf, 1) != 1)
common/dist/zlib/examples/gzlog.c
704
if (log_last(log, 1) || write(log->fd, buf, 8) != 8 ||
common/dist/zlib/examples/gzlog.c
705
(end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end))
common/dist/zlib/examples/gzlog.c
740
int fd, ret = 0;
common/dist/zlib/examples/gzlog.c
758
if ((fd = open(log->path, O_RDONLY, 0)) < 0) {
common/dist/zlib/examples/gzlog.c
763
ret = (size_t)read(fd, data, len) != len;
common/dist/zlib/examples/gzlog.c
764
close(fd);
common/dist/zlib/examples/gzlog.c
800
if (log->fd >= 0)
common/dist/zlib/examples/gzlog.c
801
close(log->fd);
common/dist/zlib/examples/gzlog.c
802
log->fd = -1;
common/dist/zlib/examples/gzlog.c
821
if (log->fd >= 0)
common/dist/zlib/examples/gzlog.c
822
close(log->fd);
common/dist/zlib/examples/gzlog.c
823
log->fd = -1;
common/dist/zlib/examples/gzlog.c
831
log->fd = open(log->path, O_RDWR | O_CREAT, 0644);
common/dist/zlib/examples/gzlog.c
832
if (log->fd < 0) {
common/dist/zlib/examples/gzlog.c
838
if (lseek(log->fd, 0, SEEK_END) == 0) {
common/dist/zlib/examples/gzlog.c
839
if (write(log->fd, log_gzhead, HEAD) != HEAD ||
common/dist/zlib/examples/gzlog.c
840
write(log->fd, log_gzext, EXTRA) != EXTRA ||
common/dist/zlib/examples/gzlog.c
841
write(log->fd, log_gzbody, BODY) != BODY) {
common/dist/zlib/examples/gzlog.c
881
log->fd = -1;
common/dist/zlib/examples/gzlog.c
912
int fd, ret;
common/dist/zlib/examples/gzlog.c
937
if (lseek(log->fd, log->first - 1, SEEK_SET) < 0)
common/dist/zlib/examples/gzlog.c
941
if (read(log->fd, buf, 5) != 5)
common/dist/zlib/examples/gzlog.c
945
read(log->fd, (char *)data + next, block) != block)
common/dist/zlib/examples/gzlog.c
949
if (lseek(log->fd, 0, SEEK_CUR) != log->last + 4 + log->stored)
common/dist/zlib/examples/gzlog.c
955
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/examples/gzlog.c
956
if (fd < 0)
common/dist/zlib/examples/gzlog.c
958
ret = (size_t)write(fd, data, len) != len;
common/dist/zlib/examples/gzlog.c
959
if (ret | close(fd))
common/dist/zlib/examples/gzlog.c
965
fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
common/dist/zlib/examples/gzlog.c
966
if (fd < 0)
common/dist/zlib/examples/gzlog.c
969
ret = (size_t)write(fd, (char *)data + len - next, next) != next;
common/dist/zlib/examples/gzlog.c
970
if (ret | close(fd))
common/dist/zlib/examples/gzlog.c
999
int fd, ret;
common/dist/zlib/gzguts.h
179
int fd; /* file descriptor */
common/dist/zlib/gzlib.c
201
if (fd == -2)
common/dist/zlib/gzlib.c
212
if (fd == -2) {
common/dist/zlib/gzlib.c
247
if (fd == -1)
common/dist/zlib/gzlib.c
248
state->fd = open((const char *)path, oflag, 0666);
common/dist/zlib/gzlib.c
250
else if (fd == -2)
common/dist/zlib/gzlib.c
251
state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
common/dist/zlib/gzlib.c
256
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
common/dist/zlib/gzlib.c
260
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
common/dist/zlib/gzlib.c
262
state->fd = fd;
common/dist/zlib/gzlib.c
264
if (state->fd == -1) {
common/dist/zlib/gzlib.c
270
LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
common/dist/zlib/gzlib.c
276
state->start = LSEEK(state->fd, 0, SEEK_CUR);
common/dist/zlib/gzlib.c
298
gzFile ZEXPORT gzdopen(int fd, const char *mode) {
common/dist/zlib/gzlib.c
302
if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
common/dist/zlib/gzlib.c
305
(void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
common/dist/zlib/gzlib.c
307
sprintf(path, "<fd:%d>", fd); /* for debugging */
common/dist/zlib/gzlib.c
309
gz = gz_open(path, fd, mode);
common/dist/zlib/gzlib.c
360
if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
common/dist/zlib/gzlib.c
398
ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
common/dist/zlib/gzlib.c
481
offset = LSEEK(state->fd, 0, SEEK_CUR);
common/dist/zlib/gzlib.c
87
local gzFile gz_open(const void *path, int fd, const char *mode) {
common/dist/zlib/gzread.c
30
ret = (int)read(state->fd, buf + *have, get);
common/dist/zlib/gzread.c
665
ret = close(state->fd);
common/dist/zlib/gzwrite.c
117
writ = (int)write(state->fd, state->x.next, put);
common/dist/zlib/gzwrite.c
698
if (close(state->fd) == -1)
common/dist/zlib/gzwrite.c
82
writ = (int)write(state->fd, strm->next_in, put);
common/dist/zlib/test/minigzip.c
198
static gzFile gz_open(const char *path, int fd, const char *mode) {
common/dist/zlib/test/minigzip.c
220
gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
common/dist/zlib/test/minigzip.c
236
static gzFile gzdopen(int fd, const char *mode) {
common/dist/zlib/test/minigzip.c
237
return gz_open(NULL, fd, mode);
common/dist/zlib/zlib.h
1406
ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
common/lib/libc/cdb/cdbr.c
126
int fd;
common/lib/libc/cdb/cdbr.c
130
if ((fd = open(path, O_RDONLY)) == -1)
common/lib/libc/cdb/cdbr.c
132
if (fstat(fd, &sb) == -1) {
common/lib/libc/cdb/cdbr.c
133
close(fd);
common/lib/libc/cdb/cdbr.c
138
close(fd);
common/lib/libc/cdb/cdbr.c
145
base = mmap(NULL, size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0);
common/lib/libc/cdb/cdbr.c
146
close(fd);
common/lib/libprop/prop_extern.c
577
int fd = -1;
common/lib/libprop/prop_extern.c
598
if ((fd = mkstemp(tname_store)) == -1) {
common/lib/libprop/prop_extern.c
603
if (write(fd, data, len) != (ssize_t)len) {
common/lib/libprop/prop_extern.c
607
if (fsync(fd) == -1) {
common/lib/libprop/prop_extern.c
613
if (fchmod(fd, 0666 & ~myumask) == -1) {
common/lib/libprop/prop_extern.c
626
if (fd != -1) {
common/lib/libprop/prop_extern.c
627
(void) close(fd);
common/lib/libprop/prop_intern.c
1003
fd = open(fname, O_RDONLY, 0400);
common/lib/libprop/prop_intern.c
1004
if (fd == -1) {
common/lib/libprop/prop_intern.c
1009
if (fstat(fd, &sb) == -1) {
common/lib/libprop/prop_intern.c
1010
(void) close(fd);
common/lib/libprop/prop_intern.c
1016
(void) close(fd);
common/lib/libprop/prop_intern.c
1030
PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0);
common/lib/libprop/prop_intern.c
1031
(void) close(fd);
common/lib/libprop/prop_intern.c
996
int fd;
common/lib/libprop/prop_kern.c
111
_prop_object_send_ioctl(prop_object_t obj, int fd, unsigned long cmd)
common/lib/libprop/prop_kern.c
121
if (ioctl(fd, cmd, &pref) == -1)
common/lib/libprop/prop_kern.c
132
prop_object_send_ioctl(prop_object_t obj, int fd, unsigned long cmd)
common/lib/libprop/prop_kern.c
136
rv = _prop_object_send_ioctl(obj, fd, cmd);
common/lib/libprop/prop_kern.c
254
_prop_object_recv_ioctl(int fd, unsigned long cmd, prop_object_t *objp,
common/lib/libprop/prop_kern.c
260
rv = ioctl(fd, cmd, &pref);
common/lib/libprop/prop_kern.c
273
prop_object_recv_ioctl(int fd, unsigned long cmd, prop_object_t *objp)
common/lib/libprop/prop_kern.c
275
return _prop_object_recv_ioctl(fd, cmd, objp, PROP_TYPE_UNKNOWN);
common/lib/libprop/prop_kern.c
279
prop_array_recv_ioctl(int fd, unsigned long cmd, prop_array_t *arrayp)
common/lib/libprop/prop_kern.c
281
return _prop_object_recv_ioctl(fd, cmd,
common/lib/libprop/prop_kern.c
286
prop_dictionary_recv_ioctl(int fd, unsigned long cmd, prop_dictionary_t *dictp)
common/lib/libprop/prop_kern.c
288
return _prop_object_recv_ioctl(fd, cmd,
common/lib/libprop/prop_kern.c
298
_prop_object_sendrecv_ioctl(prop_object_t obj, int fd,
common/lib/libprop/prop_kern.c
312
if (ioctl(fd, cmd, &pref) == -1)
common/lib/libprop/prop_kern.c
331
prop_object_sendrecv_ioctl(prop_object_t obj, int fd,
common/lib/libprop/prop_kern.c
334
return _prop_object_sendrecv_ioctl(obj, fd, cmd, objp,
common/lib/libprop/prop_kern.c
339
prop_dictionary_sendrecv_ioctl(prop_dictionary_t dict, int fd,
common/lib/libprop/prop_kern.c
342
return _prop_object_sendrecv_ioctl(dict, fd, cmd,
crypto/dist/ipsec-tools/src/racoon/admin.c
101
admin_handler(void *ctx __unused, int fd __unused)
crypto/dist/ipsec-tools/src/racoon/dump.c
111
if (write(fd, &hdr, sizeof(hdr)) != sizeof(hdr))
crypto/dist/ipsec-tools/src/racoon/dump.c
120
close(fd);
crypto/dist/ipsec-tools/src/racoon/dump.c
121
fd = -1;
crypto/dist/ipsec-tools/src/racoon/dump.c
178
if (write(fd, &sf_hdr, sizeof(sf_hdr)) < sizeof(sf_hdr))
crypto/dist/ipsec-tools/src/racoon/dump.c
180
if (write(fd, &af, sizeof(af)) < sizeof(af))
crypto/dist/ipsec-tools/src/racoon/dump.c
195
if (write(fd, &ip, sizeof(ip)) < sizeof(ip))
crypto/dist/ipsec-tools/src/racoon/dump.c
207
if (write(fd, &ip6, sizeof(ip6)) < sizeof(ip6))
crypto/dist/ipsec-tools/src/racoon/dump.c
217
if (write(fd, &uh, sizeof(uh)) < sizeof(uh))
crypto/dist/ipsec-tools/src/racoon/dump.c
221
if (write(fd, msg->v, msg->l) != msg->l)
crypto/dist/ipsec-tools/src/racoon/dump.c
84
static int fd = -1;
crypto/dist/ipsec-tools/src/racoon/dump.c
94
if (fd >= 0)
crypto/dist/ipsec-tools/src/racoon/dump.c
97
fd = open(path, O_WRONLY|O_CREAT|O_APPEND, 0600);
crypto/dist/ipsec-tools/src/racoon/dump.c
98
if (fd < 0)
crypto/dist/ipsec-tools/src/racoon/eaytest.c
422
int fd;
crypto/dist/ipsec-tools/src/racoon/eaytest.c
560
fd = open(buf, O_RDONLY);
crypto/dist/ipsec-tools/src/racoon/eaytest.c
561
if (fd == -1)
crypto/dist/ipsec-tools/src/racoon/eaytest.c
563
len = read(fd, certs[n], sb.st_size);
crypto/dist/ipsec-tools/src/racoon/eaytest.c
569
close(fd);
crypto/dist/ipsec-tools/src/racoon/evt.c
247
"[%d] admin connection released\n", l->fd);
crypto/dist/ipsec-tools/src/racoon/evt.c
250
unmonitor_fd(l->fd);
crypto/dist/ipsec-tools/src/racoon/evt.c
251
close(l->fd);
crypto/dist/ipsec-tools/src/racoon/evt.c
257
evt_unsubscribe_cb(void *ctx, int fd __unused)
crypto/dist/ipsec-tools/src/racoon/evt.c
271
if (send(l->fd, e, e->adm.ac_len, MSG_DONTWAIT) < 0) {
crypto/dist/ipsec-tools/src/racoon/evt.c
340
evt_subscribe(struct evt_listener_list *list, int fd)
crypto/dist/ipsec-tools/src/racoon/evt.c
355
l->fd = fd;
crypto/dist/ipsec-tools/src/racoon/evt.c
356
monitor_fd(l->fd, evt_unsubscribe_cb, l, 0);
crypto/dist/ipsec-tools/src/racoon/evt.c
359
"[%d] admin connection is polling events\n", fd);
crypto/dist/ipsec-tools/src/racoon/evt.h
116
int fd;
crypto/dist/ipsec-tools/src/racoon/evt.h
126
int evt_subscribe(struct evt_listener_list *list, int fd);
crypto/dist/ipsec-tools/src/racoon/evt.h
138
#define evt_subscribe(eventlist, fd) ;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
124
my->fd = isakmp_open(addr, udp_encap);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
125
if (my->fd < 0) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
225
my->fd = -1;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
256
return my->fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
357
netlink_enumerate(fd, family, type)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
358
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
380
return sendto(fd, (void *) &req, sizeof(req), 0,
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
551
kernel_receive(ctx, fd)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
553
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
570
status = recvmsg(fd, &msg, MSG_DONTWAIT);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
594
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
596
fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
597
if (fd < 0) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
603
close_on_exec(fd);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
604
if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
608
return fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
615
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
623
fd = netlink_open_socket();
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
624
if (fd < 0)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
625
return fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
647
if (bind(fd, (struct sockaddr*) &nl, sizeof(nl)) < 0) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
651
close(fd);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
654
return fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
660
int fd = lcconf->rtsock;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
663
if (!netlink_enumerate(fd, PF_UNSPEC, RTM_GETROUTE)) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
668
while (kernel_receive(NULL, fd) == TRUE);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
671
if (!netlink_enumerate(fd, PF_INET6, RTM_GETADDR)) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
676
while (kernel_receive(NULL, fd) == TRUE);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
70
static int kernel_receive(void *ctx, int fd);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
77
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
784
kernel_receive(void *ctx __unused, int fd)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
790
len = read(fd, &buf, sizeof(buf));
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
812
int fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
817
fd = socket(PF_ROUTE, SOCK_RAW, 0);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
818
if (fd < 0) {
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
825
if (setsockopt(fd, PF_ROUTE, RO_MSGFILTER,
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
831
close_on_exec(fd);
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
832
if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
836
return fd;
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
86
if (my->fd != -1)
crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
87
isakmp_close(my->fd);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1562
int fd;
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1602
if ((fd = privsep_socket(addr->sa_family, SOCK_DGRAM, 0)) < 0) {
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1607
close_on_exec(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1608
if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1)
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1615
if (setsockopt(fd, IPPROTO_IP,
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1638
if (setsockopt(fd, SOL_UDP,
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1664
if (setsockopt(fd, IPPROTO_IPV6, pktinfo,
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1673
if (setsockopt(fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU,
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1685
if (setsockopt(fd, SOL_SOCKET,
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1698
if (setsockopt_bypass(fd, addr->sa_family) < 0)
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1701
if (privsep_bind(fd, addr, sysdep_sa_len(addr)) < 0) {
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1710
saddr2str(addr), fd);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1712
monitor_fd(fd, isakmp_handler, NULL, 1);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1713
return fd;
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1716
close(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1721
isakmp_close(int fd)
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1723
unmonitor_fd(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp.c
1724
close(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
126
int fd;
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
130
if ((fd = open(filename, O_RDONLY, 0)) == -1) {
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
136
if ((len = read(fd, buf, MAXMOTD)) == -1) {
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
139
close(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
142
close(fd);
crypto/dist/ipsec-tools/src/racoon/isakmp_var.h
73
extern void isakmp_close(int fd);
crypto/dist/ipsec-tools/src/racoon/misc.c
131
close_on_exec(int fd)
crypto/dist/ipsec-tools/src/racoon/misc.c
133
fcntl(fd, F_SETFD, FD_CLOEXEC);
crypto/dist/ipsec-tools/src/racoon/misc.h
53
extern void close_on_exec(int fd);
crypto/dist/ipsec-tools/src/racoon/pfkey.c
204
pfkey_handler(void *ctx __unused, int fd)
crypto/dist/ipsec-tools/src/racoon/pfkey.c
213
msg = (struct sadb_msg *) pk_recv(fd, &len);
crypto/dist/ipsec-tools/src/racoon/plainrsa-gen.c
231
int c, fd = -1, fdin = -1;
crypto/dist/ipsec-tools/src/racoon/plainrsa-gen.c
256
fd = open(fname, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, S_IRUSR | S_IWUSR);
crypto/dist/ipsec-tools/src/racoon/plainrsa-gen.c
257
if (fd < 0) {
crypto/dist/ipsec-tools/src/racoon/plainrsa-gen.c
264
fp = fdopen(fd, "w");
crypto/dist/ipsec-tools/src/racoon/plainrsa-gen.c
267
close(fd);
crypto/dist/ipsec-tools/src/racoon/privsep.c
1548
send_fd(int s, int fd)
crypto/dist/ipsec-tools/src/racoon/privsep.c
1559
if (sizeof(cmsbuf) < CMSG_SPACE(sizeof(fd))) {
crypto/dist/ipsec-tools/src/racoon/privsep.c
1570
msg.msg_controllen = CMSG_SPACE(sizeof(fd));
crypto/dist/ipsec-tools/src/racoon/privsep.c
1576
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
crypto/dist/ipsec-tools/src/racoon/privsep.c
1578
fdptr[0] = fd;
crypto/dist/ipsec-tools/src/racoon/privsep.c
193
privsep_do_exit(void *ctx __unused, int fd __unused)
crypto/dist/ipsec-tools/src/racoon/session.c
104
int (*callback)(void *ctx, int fd);
crypto/dist/ipsec-tools/src/racoon/session.c
107
int fd;
crypto/dist/ipsec-tools/src/racoon/session.c
127
monitor_fd(int fd, int (*callback)(void *, int), void *ctx, int priority)
crypto/dist/ipsec-tools/src/racoon/session.c
129
if (fd < 0 || fd >= FD_SETSIZE) {
crypto/dist/ipsec-tools/src/racoon/session.c
134
FD_SET(fd, &preset_mask);
crypto/dist/ipsec-tools/src/racoon/session.c
135
if (fd > nfds)
crypto/dist/ipsec-tools/src/racoon/session.c
136
nfds = fd;
crypto/dist/ipsec-tools/src/racoon/session.c
142
fd_monitors[fd].callback = callback;
crypto/dist/ipsec-tools/src/racoon/session.c
143
fd_monitors[fd].ctx = ctx;
crypto/dist/ipsec-tools/src/racoon/session.c
144
fd_monitors[fd].prio = priority;
crypto/dist/ipsec-tools/src/racoon/session.c
145
fd_monitors[fd].fd = fd;
crypto/dist/ipsec-tools/src/racoon/session.c
147
&fd_monitors[fd], chain);
crypto/dist/ipsec-tools/src/racoon/session.c
151
unmonitor_fd(int fd)
crypto/dist/ipsec-tools/src/racoon/session.c
153
if (fd < 0 || fd >= FD_SETSIZE) {
crypto/dist/ipsec-tools/src/racoon/session.c
158
if (fd_monitors[fd].callback == NULL)
crypto/dist/ipsec-tools/src/racoon/session.c
161
FD_CLR(fd, &preset_mask);
crypto/dist/ipsec-tools/src/racoon/session.c
162
FD_CLR(fd, &active_mask);
crypto/dist/ipsec-tools/src/racoon/session.c
163
fd_monitors[fd].callback = NULL;
crypto/dist/ipsec-tools/src/racoon/session.c
164
fd_monitors[fd].ctx = NULL;
crypto/dist/ipsec-tools/src/racoon/session.c
165
TAILQ_REMOVE(&fd_monitor_tree[fd_monitors[fd].prio],
crypto/dist/ipsec-tools/src/racoon/session.c
166
&fd_monitors[fd], chain);
crypto/dist/ipsec-tools/src/racoon/session.c
317
if (!FD_ISSET(fdm->fd, &active_mask))
crypto/dist/ipsec-tools/src/racoon/session.c
320
FD_CLR(fdm->fd, &active_mask);
crypto/dist/ipsec-tools/src/racoon/session.c
322
fdm->callback(fdm->ctx, fdm->fd);
crypto/dist/ipsec-tools/src/racoon/session.h
40
extern void monitor_fd(int fd, int (*callback)(void *, int), void *ctx, int priority);
crypto/dist/ipsec-tools/src/racoon/session.h
41
extern void unmonitor_fd(int fd);
crypto/dist/ipsec-tools/src/setkey/setkey.c
833
int fd;
crypto/dist/ipsec-tools/src/setkey/setkey.c
839
fd = open(fname, O_RDONLY);
crypto/dist/ipsec-tools/src/setkey/setkey.c
840
if (fd < 0)
crypto/dist/ipsec-tools/src/setkey/setkey.c
845
len = read(fd, rbuf + l, sizeof(rbuf) - l);
crypto/dist/ipsec-tools/src/setkey/setkey.c
847
close(fd);
crypto/dist/ipsec-tools/src/setkey/setkey.c
855
close(fd);
crypto/dist/ipsec-tools/src/setkey/setkey.c
859
close(fd);
dist/pf/libexec/tftp-proxy/tftp-proxy.c
151
if (ioctl(fd, FIONBIO, &on) < 0) {
dist/pf/libexec/tftp-proxy/tftp-proxy.c
156
if (setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)) == -1) {
dist/pf/libexec/tftp-proxy/tftp-proxy.c
162
if (getsockname(fd, (struct sockaddr *)&s_in, &j) == -1) {
dist/pf/libexec/tftp-proxy/tftp-proxy.c
171
if ((reqsize = recvfrom(fd, req, sizeof(req), MSG_PEEK,
dist/pf/libexec/tftp-proxy/tftp-proxy.c
194
if (recvmsg(fd, &msg, 0) < 0) {
dist/pf/libexec/tftp-proxy/tftp-proxy.c
199
close(fd);
dist/pf/libexec/tftp-proxy/tftp-proxy.c
243
if (getsockname(fd, (struct sockaddr *)&proxy, &j) == -1) {
dist/pf/libexec/tftp-proxy/tftp-proxy.c
84
int c, fd = 0, on = 1, out_fd = 0, peer, reqsize = 0;
dist/pf/sbin/pflogd/pflogd.c
315
int fd;
dist/pf/sbin/pflogd/pflogd.c
331
fd = priv_open_log();
dist/pf/sbin/pflogd/pflogd.c
332
if (fd < 0)
dist/pf/sbin/pflogd/pflogd.c
335
fp = fdopen(fd, "a+");
dist/pf/sbin/pflogd/pflogd.c
339
close(fd);
dist/pf/sbin/pflogd/pflogd.h
46
pcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf);
dist/pf/sbin/pflogd/privsep.c
164
fd = open(filename,
dist/pf/sbin/pflogd/privsep.c
168
send_fd(socks[0], fd);
dist/pf/sbin/pflogd/privsep.c
169
if (fd < 0)
dist/pf/sbin/pflogd/privsep.c
174
close(fd);
dist/pf/sbin/pflogd/privsep.c
214
int fd;
dist/pf/sbin/pflogd/privsep.c
224
fd = open(ren, O_CREAT|O_EXCL, 0);
dist/pf/sbin/pflogd/privsep.c
225
if (fd >= 0) {
dist/pf/sbin/pflogd/privsep.c
226
close(fd);
dist/pf/sbin/pflogd/privsep.c
278
int cmd, fd;
dist/pf/sbin/pflogd/privsep.c
285
fd = receive_fd(priv_fd);
dist/pf/sbin/pflogd/privsep.c
287
return (fd);
dist/pf/sbin/pflogd/privsep.c
325
may_read(int fd, void *buf, size_t n)
dist/pf/sbin/pflogd/privsep.c
331
res = read(fd, s + pos, n - pos);
dist/pf/sbin/pflogd/privsep.c
349
must_read(int fd, void *buf, size_t n)
dist/pf/sbin/pflogd/privsep.c
355
res = read(fd, s + pos, n - pos);
dist/pf/sbin/pflogd/privsep.c
372
must_write(int fd, void *buf, size_t n)
dist/pf/sbin/pflogd/privsep.c
378
res = write(fd, s + pos, n - pos);
dist/pf/sbin/pflogd/privsep.c
78
int i, fd, socks[2], cmd;
dist/pf/sbin/pflogd/privsep_fdpass.c
119
fd = (*(int *)CMSG_DATA(cmsg));
dist/pf/sbin/pflogd/privsep_fdpass.c
120
return fd;
dist/pf/sbin/pflogd/privsep_fdpass.c
51
send_fd(int sock, int fd)
dist/pf/sbin/pflogd/privsep_fdpass.c
62
if (fd >= 0) {
dist/pf/sbin/pflogd/privsep_fdpass.c
69
*(int *)CMSG_DATA(cmsg) = fd;
dist/pf/sbin/pflogd/privsep_fdpass.c
95
int fd;
distrib/utils/edlabel/edlabel.c
360
int fd;
distrib/utils/edlabel/edlabel.c
367
fd = open(dn, O_RDWR, 0);
distrib/utils/edlabel/edlabel.c
368
if (fd < 0) {
distrib/utils/edlabel/edlabel.c
372
if (ioctl(fd, DIOCWDINFO, d) < 0) {
distrib/utils/edlabel/edlabel.c
375
close(fd);
distrib/utils/edlabel/edlabel.c
381
int fd;
distrib/utils/edlabel/edlabel.c
383
fd = open(dn, O_RDONLY, 0);
distrib/utils/edlabel/edlabel.c
384
if (fd < 0) {
distrib/utils/edlabel/edlabel.c
388
if (ioctl(fd, DIOCGDINFO, dl) < 0) {
distrib/utils/edlabel/edlabel.c
399
close(fd);
distrib/utils/libhack/opendir.c
61
int fd;
distrib/utils/libhack/opendir.c
64
if ((fd = open(name, O_RDONLY | O_NONBLOCK)) == -1)
distrib/utils/libhack/opendir.c
66
if (fstat(fd, &sb) || !S_ISDIR(sb.st_mode)) {
distrib/utils/libhack/opendir.c
68
close(fd);
distrib/utils/libhack/opendir.c
71
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1 ||
distrib/utils/libhack/opendir.c
73
close(fd);
distrib/utils/libhack/opendir.c
86
close (fd);
distrib/utils/libhack/opendir.c
93
dirp->dd_fd = fd;
distrib/utils/more/os.c
169
iread(fd, buf, len)
distrib/utils/more/os.c
170
int fd;
distrib/utils/more/os.c
184
n = read(fd, buf, len);
games/boggle/boggle/timer.c
106
set[0].fd = STDIN_FILENO;
games/cribbage/crib.c
77
int fd;
games/cribbage/crib.c
91
fd = fileno(f);
games/cribbage/crib.c
92
flags = fcntl(fd, F_GETFD);
games/cribbage/crib.c
96
if (fcntl(fd, F_SETFD, flags) == -1)
games/cribbage/instr.c
62
int fd;
games/cribbage/instr.c
80
if ((fd = open(_PATH_INSTR, O_RDONLY)) == -1) {
games/cribbage/instr.c
84
if (dup2(fd, 0) == -1) {
games/dm/dm.c
264
int fd, n;
games/dm/dm.c
267
if ((fd = open(_PATH_NOGAMES, O_RDONLY, 0)) >= 0) {
games/dm/dm.c
270
while ((n = read(fd, buf, sizeof(buf))) > 0)
games/fish/fish.c
437
int fd;
games/fish/fish.c
460
if ((fd = open(_PATH_INSTR, O_RDONLY)) == -1)
games/fish/fish.c
462
if (dup2(fd, 0) == -1)
games/fortune/fortune/fortune.c
103
struct fd *child, *parent;
games/fortune/fortune/fortune.c
104
struct fd *next, *prev;
games/fortune/fortune/fortune.c
1048
if (fp->inf == NULL && (fp->inf = fdopen(fp->fd, "r")) == NULL)
games/fortune/fortune/fortune.c
1072
int fd;
games/fortune/fortune/fortune.c
1078
if ((fd = open(fp->posfile, O_RDONLY)) < 0 ||
games/fortune/fortune/fortune.c
1079
read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos)
games/fortune/fortune/fortune.c
1083
if (fd >= 0)
games/fortune/fortune/fortune.c
1084
(void) close(fd);
games/fortune/fortune/fortune.c
1102
int fd;
games/fortune/fortune/fortune.c
1108
if ((fd = open(fp->datfile, O_RDONLY)) < 0)
games/fortune/fortune/fortune.c
1110
if (read(fd, (char *) &fp->tbl, sizeof fp->tbl) != sizeof fp->tbl) {
games/fortune/fortune/fortune.c
1118
(void) close(fd);
games/fortune/fortune/fortune.c
194
int fd;
games/fortune/fortune/fortune.c
213
if ((fd = creat(Fortfile->posfile, 0666)) < 0)
games/fortune/fortune/fortune.c
221
(void) flock(fd, LOCK_EX);
games/fortune/fortune/fortune.c
223
write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos);
games/fortune/fortune/fortune.c
227
(void) flock(fd, LOCK_UN);
games/fortune/fortune/fortune.c
229
close(fd);
games/fortune/fortune/fortune.c
450
int fd;
games/fortune/fortune/fortune.c
488
if ((fd = open(path, O_RDONLY)) < 0) {
games/fortune/fortune/fortune.c
532
fp->fd = fd;
games/fortune/fortune/fortune.c
594
fp->fd = -1;
games/fortune/fortune/fortune.c
642
int fd;
games/fortune/fortune/fortune.c
651
if ((fd = open(offensive, O_RDONLY)) < 0)
games/fortune/fortune/fortune.c
665
fp->fd = -1;
games/fortune/fortune/fortune.c
668
obscene->fd = fd;
games/fortune/fortune/fortune.c
695
(void) close(fp->fd);
games/fortune/fortune/fortune.c
696
fp->fd = -1;
games/fortune/fortune/fortune.c
93
int fd, datfd;
games/hack/hack.bones.c
143
if ((fd = creat(bones, FMASK)) < 0)
games/hack/hack.bones.c
145
savelev(fd, dlevel);
games/hack/hack.bones.c
146
(void) close(fd);
games/hack/hack.bones.c
152
int fd, x, y, ok;
games/hack/hack.bones.c
158
if ((fd = open(bones, O_RDONLY)) < 0)
games/hack/hack.bones.c
160
if ((ok = uptodate(fd)) != 0) {
games/hack/hack.bones.c
161
getlev(fd, 0, dlevel);
games/hack/hack.bones.c
166
(void) close(fd);
games/hack/hack.bones.c
80
int fd;
games/hack/hack.bones.c
91
if ((fd = open(bones, O_RDONLY)) >= 0) {
games/hack/hack.bones.c
92
(void) close(fd);
games/hack/hack.do.c
194
int fd;
games/hack/hack.do.c
205
fd = creat(lock, FMASK);
games/hack/hack.do.c
206
if (fd < 0) {
games/hack/hack.do.c
230
savelev(fd, dlevel);
games/hack/hack.do.c
231
(void) close(fd);
games/hack/hack.do.c
241
if ((fd = open(lock, O_RDONLY)) < 0) {
games/hack/hack.do.c
246
getlev(fd, hackpid, dlevel);
games/hack/hack.do.c
247
(void) close(fd);
games/hack/hack.engrave.c
347
save_engravings(int fd)
games/hack/hack.engrave.c
355
bwrite(fd, &(ep->engr_lth), sizeof(ep->engr_lth));
games/hack/hack.engrave.c
356
bwrite(fd, ep, sizeof(struct engr) + ep->engr_lth);
games/hack/hack.engrave.c
359
bwrite(fd, nul, sizeof(unsigned));
games/hack/hack.engrave.c
364
rest_engravings(int fd)
games/hack/hack.engrave.c
370
mread(fd, &lth, sizeof(unsigned));
games/hack/hack.engrave.c
374
mread(fd, ep, sizeof(*ep) + lth);
games/hack/hack.lev.c
100
bwrite(fd, &moves, sizeof(long));
games/hack/hack.lev.c
101
bwrite(fd, &xupstair, sizeof(xupstair));
games/hack/hack.lev.c
102
bwrite(fd, &yupstair, sizeof(yupstair));
games/hack/hack.lev.c
103
bwrite(fd, &xdnstair, sizeof(xdnstair));
games/hack/hack.lev.c
104
bwrite(fd, &ydnstair, sizeof(ydnstair));
games/hack/hack.lev.c
105
savemonchn(fd, fmon);
games/hack/hack.lev.c
106
savegoldchn(fd, fgold);
games/hack/hack.lev.c
107
savetrapchn(fd, ftrap);
games/hack/hack.lev.c
108
saveobjchn(fd, fobj);
games/hack/hack.lev.c
109
saveobjchn(fd, billobjs);
games/hack/hack.lev.c
111
save_engravings(fd);
games/hack/hack.lev.c
113
bwrite(fd, rooms, sizeof(rooms));
games/hack/hack.lev.c
114
bwrite(fd, doors, sizeof(doors));
games/hack/hack.lev.c
121
bwrite(fd, wsegs, sizeof(wsegs));
games/hack/hack.lev.c
125
bwrite(fd, wtmp, sizeof(struct wseg));
games/hack/hack.lev.c
129
bwrite(fd, wgrowtime, sizeof(wgrowtime));
games/hack/hack.lev.c
134
bwrite(int fd, const void *loc, size_t num)
games/hack/hack.lev.c
137
if ((size_t)write(fd, loc, num) != num)
games/hack/hack.lev.c
138
panic("cannot write %zu bytes to file #%d", num, fd);
games/hack/hack.lev.c
142
saveobjchn(int fd, struct obj *otmp)
games/hack/hack.lev.c
151
bwrite(fd, &xl, sizeof(int));
games/hack/hack.lev.c
152
bwrite(fd, otmp, xl + sizeof(struct obj));
games/hack/hack.lev.c
156
bwrite(fd, &minusone, sizeof(int));
games/hack/hack.lev.c
160
savemonchn(int fd, struct monst *mtmp)
games/hack/hack.lev.c
167
bwrite(fd, &monbegin, sizeof(monbegin));
games/hack/hack.lev.c
172
bwrite(fd, &xl, sizeof(int));
games/hack/hack.lev.c
173
bwrite(fd, mtmp, xl + sizeof(struct monst));
games/hack/hack.lev.c
175
saveobjchn(fd, mtmp->minvent);
games/hack/hack.lev.c
179
bwrite(fd, &minusone, sizeof(int));
games/hack/hack.lev.c
183
savegoldchn(int fd, struct gold *gold)
games/hack/hack.lev.c
188
bwrite(fd, gold, sizeof(struct gold));
games/hack/hack.lev.c
192
bwrite(fd, nul, sizeof(struct gold));
games/hack/hack.lev.c
196
savetrapchn(int fd, struct trap *trap)
games/hack/hack.lev.c
201
bwrite(fd, trap, sizeof(struct trap));
games/hack/hack.lev.c
205
bwrite(fd, nul, sizeof(struct trap));
games/hack/hack.lev.c
209
getlev(int fd, int pid, xchar lev)
games/hack/hack.lev.c
222
mread(fd, &hpid, sizeof(hpid));
games/hack/hack.lev.c
223
mread(fd, &dlvl, sizeof(dlvl));
games/hack/hack.lev.c
232
mread(fd, levl, sizeof(levl));
games/hack/hack.lev.c
233
mread(fd, &omoves, sizeof(omoves));
games/hack/hack.lev.c
234
mread(fd, &xupstair, sizeof(xupstair));
games/hack/hack.lev.c
235
mread(fd, &yupstair, sizeof(yupstair));
games/hack/hack.lev.c
236
mread(fd, &xdnstair, sizeof(xdnstair));
games/hack/hack.lev.c
237
mread(fd, &ydnstair, sizeof(ydnstair));
games/hack/hack.lev.c
239
fmon = restmonchn(fd);
games/hack/hack.lev.c
269
mread(fd, gold, sizeof(struct gold));
games/hack/hack.lev.c
274
mread(fd, gold, sizeof(struct gold));
games/hack/hack.lev.c
278
mread(fd, trap, sizeof(struct trap));
games/hack/hack.lev.c
283
mread(fd, trap, sizeof(struct trap));
games/hack/hack.lev.c
286
fobj = restobjchn(fd);
games/hack/hack.lev.c
287
billobjs = restobjchn(fd);
games/hack/hack.lev.c
288
rest_engravings(fd);
games/hack/hack.lev.c
290
mread(fd, rooms, sizeof(rooms));
games/hack/hack.lev.c
291
mread(fd, doors, sizeof(doors));
games/hack/hack.lev.c
294
mread(fd, wsegs, sizeof(wsegs));
games/hack/hack.lev.c
299
mread(fd, wtmp, sizeof(struct wseg));
games/hack/hack.lev.c
306
mread(fd, wgrowtime, sizeof(wgrowtime));
games/hack/hack.lev.c
311
mread(int fd, void *buf, size_t len)
games/hack/hack.lev.c
315
rlen = read(fd, buf, len);
games/hack/hack.lev.c
85
savelev(int fd, xchar lev)
games/hack/hack.lev.c
92
if (fd < 0)
games/hack/hack.lev.c
97
bwrite(fd, &hackpid, sizeof(hackpid));
games/hack/hack.lev.c
98
bwrite(fd, &lev, sizeof(lev));
games/hack/hack.lev.c
99
bwrite(fd, levl, sizeof(levl));
games/hack/hack.main.c
102
int fd;
games/hack/hack.main.c
108
fd = open("/dev/null", O_RDONLY);
games/hack/hack.main.c
109
if (fd < 3)
games/hack/hack.main.c
111
close(fd);
games/hack/hack.main.c
313
if ((fd = open(SAVEF, O_RDONLY)) >= 0 &&
games/hack/hack.main.c
314
(uptodate(fd) || unlink(SAVEF) == 666)) {
games/hack/hack.main.c
318
if (!dorecover(fd))
games/hack/hack.main.c
566
int fd;
games/hack/hack.main.c
570
if ((fd = open(RECORD, O_RDWR)) < 0) {
games/hack/hack.main.c
574
(void) close(fd);
games/hack/hack.o_init.c
180
savenames(int fd)
games/hack/hack.o_init.c
184
bwrite(fd, bases, sizeof bases);
games/hack/hack.o_init.c
185
bwrite(fd, objects, sizeof objects);
games/hack/hack.o_init.c
195
bwrite(fd, &len, sizeof len); \
games/hack/hack.o_init.c
196
bwrite(fd, objects[i].FIELD, len); \
games/hack/hack.o_init.c
206
restnames(int fd)
games/hack/hack.o_init.c
210
mread(fd, bases, sizeof bases);
games/hack/hack.o_init.c
211
mread(fd, objects, sizeof objects);
games/hack/hack.o_init.c
215
mread(fd, &len, sizeof len); \
games/hack/hack.o_init.c
217
mread(fd, __UNCONST(objects[i].FIELD), len); \
games/hack/hack.pager.c
376
int fd = open(fnam, O_RDONLY);
games/hack/hack.pager.c
378
if (fd < 0) {
games/hack/hack.pager.c
391
if (dup(fd)) {
games/hack/hack.pager.c
401
(void) close(fd);
games/hack/hack.save.c
101
int fd, ofd;
games/hack/hack.save.c
106
if ((fd = creat(SAVEF, FMASK)) < 0) {
games/hack/hack.save.c
114
savelev(fd, dlevel);
games/hack/hack.save.c
115
saveobjchn(fd, invent);
games/hack/hack.save.c
116
saveobjchn(fd, fcobj);
games/hack/hack.save.c
117
savemonchn(fd, fallen_down);
games/hack/hack.save.c
119
bwrite(fd, &tmp, sizeof tmp);
games/hack/hack.save.c
120
bwrite(fd, &flags, sizeof(struct flag));
games/hack/hack.save.c
121
bwrite(fd, &dlevel, sizeof dlevel);
games/hack/hack.save.c
122
bwrite(fd, &maxdlevel, sizeof maxdlevel);
games/hack/hack.save.c
123
bwrite(fd, &moves, sizeof moves);
games/hack/hack.save.c
124
bwrite(fd, &u, sizeof(struct you));
games/hack/hack.save.c
126
bwrite(fd, &(u.ustuck->m_id), sizeof u.ustuck->m_id);
games/hack/hack.save.c
127
bwrite(fd, pl_character, sizeof pl_character);
games/hack/hack.save.c
128
bwrite(fd, genocided, sizeof genocided);
games/hack/hack.save.c
129
bwrite(fd, fut_geno, sizeof fut_geno);
games/hack/hack.save.c
130
savenames(fd);
games/hack/hack.save.c
139
(void) close(fd);
games/hack/hack.save.c
147
bwrite(fd, &tmp, sizeof tmp); /* level number */
games/hack/hack.save.c
148
savelev(fd, tmp); /* actual level */
games/hack/hack.save.c
151
(void) close(fd);
games/hack/hack.save.c
160
dorecover(int fd)
games/hack/hack.save.c
168
getlev(fd, 0, 0);
games/hack/hack.save.c
169
invent = restobjchn(fd);
games/hack/hack.save.c
173
fcobj = restobjchn(fd);
games/hack/hack.save.c
174
fallen_down = restmonchn(fd);
games/hack/hack.save.c
175
mread(fd, &tmp, sizeof tmp);
games/hack/hack.save.c
177
(void) close(fd);
games/hack/hack.save.c
183
mread(fd, &flags, sizeof(struct flag));
games/hack/hack.save.c
184
mread(fd, &dlevel, sizeof dlevel);
games/hack/hack.save.c
185
mread(fd, &maxdlevel, sizeof maxdlevel);
games/hack/hack.save.c
186
mread(fd, &moves, sizeof moves);
games/hack/hack.save.c
187
mread(fd, &u, sizeof(struct you));
games/hack/hack.save.c
189
mread(fd, &mid, sizeof mid);
games/hack/hack.save.c
190
mread(fd, pl_character, sizeof pl_character);
games/hack/hack.save.c
191
mread(fd, genocided, sizeof genocided);
games/hack/hack.save.c
192
mread(fd, fut_geno, sizeof fut_geno);
games/hack/hack.save.c
193
restnames(fd);
games/hack/hack.save.c
195
if (read(fd, &tmp, sizeof tmp) != sizeof tmp)
games/hack/hack.save.c
197
getlev(fd, 0, tmp);
games/hack/hack.save.c
204
(void) lseek(fd, (off_t) 0, SEEK_SET);
games/hack/hack.save.c
205
getlev(fd, 0, 0);
games/hack/hack.save.c
206
(void) close(fd);
games/hack/hack.save.c
244
restobjchn(int fd)
games/hack/hack.save.c
250
mread(fd, &xl, sizeof(xl));
games/hack/hack.save.c
258
mread(fd, otmp, (unsigned) xl + sizeof(struct obj));
games/hack/hack.save.c
271
restmonchn(int fd)
games/hack/hack.save.c
280
mread(fd, &monbegin, sizeof(monbegin));
games/hack/hack.save.c
288
mread(fd, &xl, sizeof(xl));
games/hack/hack.save.c
296
mread(fd, mtmp, (unsigned) xl + sizeof(struct monst));
games/hack/hack.save.c
302
mtmp->minvent = restobjchn(fd);
games/hack/hack.unix.c
216
uptodate(int fd)
games/hack/hack.unix.c
218
if (fstat(fd, &buf)) {
games/hack/hack.unix.c
231
veryold(int fd)
games/hack/hack.unix.c
236
if (fstat(fd, &buf))
games/hack/hack.unix.c
245
if (read(fd, &lockedpid, sizeof(lockedpid)) !=
games/hack/hack.unix.c
258
(void) close(fd);
games/hack/hack.unix.c
272
int i = 0, fd;
games/hack/hack.unix.c
308
if ((fd = open(lock, O_RDONLY)) == -1) {
games/hack/hack.unix.c
315
if (veryold(fd))/* if true, this closes fd and unlinks lock */
games/hack/hack.unix.c
317
(void) close(fd);
games/hack/hack.unix.c
324
fd = creat(lock, FMASK);
games/hack/hack.unix.c
327
if (fd == -1) {
games/hack/hack.unix.c
330
if (write(fd, &hackpid, sizeof(hackpid))
games/hack/hack.unix.c
334
if (close(fd) == -1) {
games/hack/makedefs.c
104
if ((fd = open(argv[1], O_RDONLY)) < 0) {
games/hack/makedefs.c
149
int n = read(fd, lp0, (line + LINSZ) - lp0);
games/hack/makedefs.c
79
int fd;
games/hunt/hunt/playit.c
208
set[0].fd = huntsocket;
games/hunt/hunt/playit.c
210
set[1].fd = STDIN_FILENO;
games/hunt/hunt/server.c
284
set[0].fd = contactsock;
games/hunt/huntd/answer.c
207
fdset[i].fd = newsock;
games/hunt/huntd/driver.c
477
fdset[0].fd = huntsock;
games/hunt/huntd/driver.c
479
fdset[1].fd = statsock;
games/hunt/huntd/driver.c
482
fdset[2].fd = -1;
games/hunt/huntd/driver.c
485
fdset[2].fd = contactsock;
games/hunt/huntd/driver.c
812
fdset[End_player - Player + 3].fd = -1;
games/hunt/huntd/driver.c
828
fdset[i].fd = -1;
games/hunt/huntd/driver.c
851
fdset[End_monitor - Monitor + MAXPL + 3].fd = -1;
games/hunt/huntd/driver.c
865
fdset[i].fd = -1;
games/larn/bill.c
128
int fd;
games/larn/bill.c
136
if ((fd = mkstemp(fname)) == -1)
games/larn/bill.c
143
write(fd, buf, strlen(buf));
games/larn/bill.c
148
write(fd, buf, strlen(buf));
games/larn/bill.c
150
write(fd, *cp, strlen(*cp));
games/larn/bill.c
155
close(fd);
games/phantasia/setup.c
119
if ((fd = creat(path, 0660)) < 0)
games/phantasia/setup.c
123
close(fd); /* close newly created file */
games/phantasia/setup.c
83
int fd; /* file descriptor */
games/rogue/init.c
88
int fd;
games/rogue/init.c
94
fd = open("/dev/null", O_RDONLY);
games/rogue/init.c
95
if (fd < 3)
games/rogue/init.c
97
close(fd);
games/rogue/machdep.c
441
static int fd = -1;
games/rogue/machdep.c
446
if ((fd = open(_PATH_SCOREFILE, O_RDONLY)) < 1) {
games/rogue/machdep.c
453
if (!flock(fd, LOCK_EX|LOCK_NB))
games/rogue/machdep.c
456
(void)flock(fd, LOCK_UN|LOCK_NB);
games/rogue/machdep.c
457
(void)close(fd);
games/sail/main.c
63
int fd;
games/sail/main.c
72
fd = open("/dev/null", O_RDONLY);
games/sail/main.c
73
if (fd < 3)
games/sail/main.c
75
close(fd);
games/snake/snscore/snscore.c
72
FILE *fd;
games/snake/snscore/snscore.c
82
fd = fopen(recfile, "r");
games/snake/snscore/snscore.c
83
if (fd == NULL)
games/snake/snscore/snscore.c
86
if (fread(&whoallbest, sizeof(short), 1, fd) == 0) {
games/snake/snscore/snscore.c
90
fread(&allbest, sizeof(short), 1, fd);
games/snake/snscore/snscore.c
93
if(fread(&score, sizeof(short), 1, fd) == 0)
games/tetris/input.c
89
set[0].fd = STDIN_FILENO;
games/tetris/tetris.c
140
int fd;
games/tetris/tetris.c
146
fd = open("/dev/null", O_RDONLY);
games/tetris/tetris.c
147
if (fd < 3)
games/tetris/tetris.c
149
close(fd);
games/trek/dumpgame.c
101
write(fd, d->area, i);
games/trek/dumpgame.c
104
close(fd);
games/trek/dumpgame.c
122
int fd;
games/trek/dumpgame.c
125
if ((fd = open("trek.dump", O_RDONLY)) < 0 ||
games/trek/dumpgame.c
126
read(fd, &version, sizeof version) != sizeof version ||
games/trek/dumpgame.c
128
readdump(fd)) {
games/trek/dumpgame.c
130
if (fd >= 0)
games/trek/dumpgame.c
131
close(fd);
games/trek/dumpgame.c
135
close(fd);
games/trek/dumpgame.c
152
int fd;
games/trek/dumpgame.c
157
fd = fd1;
games/trek/dumpgame.c
160
if (read(fd, &junk, sizeof junk) != (sizeof junk))
games/trek/dumpgame.c
165
if (read(fd, d->area, i) != i)
games/trek/dumpgame.c
170
return (read(fd, &junk, 1));
games/trek/dumpgame.c
86
int fd;
games/trek/dumpgame.c
90
if ((fd = creat("trek.dump", 0644)) < 0) {
games/trek/dumpgame.c
95
write(fd, &version, sizeof version);
games/trek/dumpgame.c
99
write(fd, &d->area, sizeof d->area);
games/warp/term.h
189
#define tcsetattr(fd, how, ti) ioctl(fd, how, ti)
games/warp/term.h
190
#define tcgetattr(fd, ti) ioctl(fd, TCGETA, ti)
games/wump/wump.c
749
int fd;
games/wump/wump.c
773
if ((fd = open(_PATH_WUMPINFO, O_RDONLY)) == -1)
games/wump/wump.c
775
if (dup2(fd, STDIN_FILENO) == -1)
include/db.h
124
int (*fd) (const struct __db *);
include/mpool.h
71
int fd; /* file descriptor */
lib/csu/common/crt0-common.c
85
#define write(fd, s, n) __syscall(SYS_write, (fd), (s), (n))
lib/libarch/alpha/alpha_bus_window.c
86
int fd;
lib/libarch/alpha/alpha_bus_window.c
88
fd = open(_PATH_MEM, O_RDWR, 0600);
lib/libarch/alpha/alpha_bus_window.c
89
if (fd == -1)
lib/libarch/alpha/alpha_bus_window.c
96
fd, (off_t) abst->abst_sys_start);
lib/libarch/alpha/alpha_bus_window.c
98
(void) close(fd);
lib/libarch/alpha/alpha_pci_mem.c
103
fd = open(_PATH_MEM, O_RDWR, 0600);
lib/libarch/alpha/alpha_pci_mem.c
104
if (fd == -1)
lib/libarch/alpha/alpha_pci_mem.c
114
fd, (off_t) (abw->abw_abst.abst_sys_start + offset));
lib/libarch/alpha/alpha_pci_mem.c
116
(void) close(fd);
lib/libarch/alpha/alpha_pci_mem.c
61
int i, fd;
lib/libbluetooth/bt_dev.c
850
int count, fd, rv, s;
lib/libbluetooth/bt_dev.c
865
fd = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
lib/libbluetooth/bt_dev.c
866
if (fd == -1) {
lib/libbluetooth/bt_dev.c
871
if (bt__devinfo(fd, btr.btr_name, &info) == -1) {
lib/libbluetooth/bt_dev.c
872
close(fd);
lib/libbluetooth/bt_dev.c
883
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1
lib/libbluetooth/bt_dev.c
884
|| connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
lib/libbluetooth/bt_dev.c
885
close(fd);
lib/libbluetooth/bt_dev.c
891
rv = (*cb)(fd, &info, arg);
lib/libbluetooth/bt_dev.c
892
close(fd);
lib/libc/cdb/cdbw.c
536
ret = write(fd, buf, cur_pos); \
lib/libc/cdb/cdbw.c
544
print_hash(struct cdbw *cdbw, struct state *state, int fd, const char *descr)
lib/libc/cdb/cdbw.c
591
ret = write(fd, cdbw->data_ptr[i], cdbw->data_len[i]);
lib/libc/cdb/cdbw.c
597
ret = write(fd, buf, cur_pos);
lib/libc/cdb/cdbw.c
605
cdbw_output(struct cdbw *cdbw, int fd, const char *descr,
lib/libc/cdb/cdbw.c
614
print_hash(cdbw, &state, fd, descr);
lib/libc/cdb/cdbw.c
657
rv = print_hash(cdbw, &state, fd, descr);
lib/libc/citrus/citrus_mmap.c
56
int fd, ret = 0;
lib/libc/citrus/citrus_mmap.c
64
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/citrus/citrus_mmap.c
67
if (fstat(fd, &st) == -1) {
lib/libc/citrus/citrus_mmap.c
77
fd, (off_t)0);
lib/libc/citrus/citrus_mmap.c
85
(void)close(fd);
lib/libc/compat/sys/compat_getdents.c
51
getdents(int fd, char *buf, size_t nbytes)
lib/libc/compat/sys/compat_getdents.c
59
if ((rv = __getdents30(fd, buf, nbytes)) == -1)
lib/libc/compat/sys/compat_getdirentries.c
47
getdirentries(int fd, char *buf, int nbytes, long *basep)
lib/libc/compat/sys/compat_getdirentries.c
49
*basep = (long)lseek(fd, (off_t)0, SEEK_CUR);
lib/libc/compat/sys/compat_getdirentries.c
50
return getdents(fd, buf, (size_t)nbytes);
lib/libc/compat/sys/compat_statvfs.c
86
__compat_fstatvfs(int fd, struct statvfs90 *buf)
lib/libc/compat/sys/compat_statvfs.c
89
int error = __fstatvfs190(fd, &sb, 0);
lib/libc/compat/sys/compat_statvfs.c
96
__compat_fstatvfs1(int fd, struct statvfs90 *buf, int flags)
lib/libc/compat/sys/compat_statvfs.c
99
int error = __fstatvfs190(fd, &sb, flags);
lib/libc/compat/sys/compat_utimes.c
79
futimes(int fd, const struct timeval50 tv50[2])
lib/libc/compat/sys/compat_utimes.c
87
return __futimes50(fd, tv50 ? tv : NULL);
lib/libc/db/btree/bt_close.c
104
fd = t->bt_fd;
lib/libc/db/btree/bt_close.c
107
return (close(fd) ? RET_ERROR : RET_SUCCESS);
lib/libc/db/btree/bt_close.c
69
int fd;
lib/libc/db/btree/bt_open.c
184
dbp->fd = __bt_fd;
lib/libc/db/db/db.c
102
dbp->fd = (int (*)(const DB *))__dberr;
lib/libc/db/db/dbfile.c
102
if ((fd = mkstemp(path)) != -1) {
lib/libc/db/db/dbfile.c
106
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
lib/libc/db/db/dbfile.c
109
if (sb && fstat(fd, sb) == -1)
lib/libc/db/db/dbfile.c
113
return fd;
lib/libc/db/db/dbfile.c
117
close(fd);
lib/libc/db/db/dbfile.c
51
int fd;
lib/libc/db/db/dbfile.c
58
if ((fd = open(file, flags | O_CLOEXEC, mode)) == -1)
lib/libc/db/db/dbfile.c
62
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
lib/libc/db/db/dbfile.c
66
if (sb && fstat(fd, sb) == -1)
lib/libc/db/db/dbfile.c
69
return fd;
lib/libc/db/db/dbfile.c
72
close(fd);
lib/libc/db/db/dbfile.c
83
int fd, serrno;
lib/libc/db/hash/hash.c
205
dbp->fd = hash_fd;
lib/libc/db/hash/hash_page.c
539
int fd, page, size;
lib/libc/db/hash/hash_page.c
544
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
547
if ((fd == -1) || !is_disk) {
lib/libc/db/hash/hash_page.c
555
if ((rsize = pread(fd, p, (size_t)size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/hash/hash_page.c
595
int fd, page, size;
lib/libc/db/hash/hash_page.c
602
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
625
if ((wsize = pwrite(fd, p, (size_t)size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/mpool/mpool.c
103
mp->fd = fd;
lib/libc/db/mpool/mpool.c
254
if ((nr = pread(mp->fd, bp->page, (size_t)mp->pagesize, off)) != (int)mp->pagesize) {
lib/libc/db/mpool/mpool.c
353
return fsync(mp->fd) ? RET_ERROR : RET_SUCCESS;
lib/libc/db/mpool/mpool.c
438
if (pwrite(mp->fd, bp->page, (size_t)mp->pagesize, off) !=
lib/libc/db/mpool/mpool.c
75
mpool_open(void *key, int fd, pgno_t pagesize, pgno_t maxcache)
lib/libc/db/mpool/mpool.c
87
if (fstat(fd, &sb))
lib/libc/db/recno/rec_open.c
193
dbp->fd = __rec_fd;
lib/libc/dlfcn/dlfcn_elf.c
104
dlclose(void *fd)
lib/libc/gen/closedir.c
64
int fd;
lib/libc/gen/closedir.c
72
fd = dirp->dd_fd;
lib/libc/gen/closedir.c
84
return(close(fd));
lib/libc/gen/closefrom.c
41
closefrom(int fd)
lib/libc/gen/closefrom.c
44
return (fcntl(fd, F_CLOSEM));
lib/libc/gen/daemon.c
54
int fd;
lib/libc/gen/daemon.c
71
if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
lib/libc/gen/daemon.c
72
(void)dup2(fd, STDIN_FILENO);
lib/libc/gen/daemon.c
73
(void)dup2(fd, STDOUT_FILENO);
lib/libc/gen/daemon.c
74
(void)dup2(fd, STDERR_FILENO);
lib/libc/gen/daemon.c
75
if (fd > STDERR_FILENO)
lib/libc/gen/daemon.c
76
(void)close(fd);
lib/libc/gen/fts.c
106
#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
lib/libc/gen/fts.c
1214
fts_safe_changedir(const FTS *sp, const FTSENT *p, int fd, const char *path)
lib/libc/gen/fts.c
1216
int oldfd = fd, ret = -1;
lib/libc/gen/fts.c
1222
if (oldfd < 0 && (fd = open(path, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/fts.c
1225
if (fstat(fd, &sb) == -1)
lib/libc/gen/fts.c
1233
ret = fchdir(fd);
lib/libc/gen/fts.c
1238
(void)close(fd);
lib/libc/gen/fts.c
559
int fd;
lib/libc/gen/fts.c
614
if ((fd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
lib/libc/gen/fts.c
617
if (fchdir(fd)) {
lib/libc/gen/fts.c
618
(void)close(fd);
lib/libc/gen/fts.c
621
(void)close(fd);
lib/libc/gen/getcap.c
254
getent(char **cap, size_t *len, const char * const *db_array, int fd,
lib/libc/gen/getcap.c
314
if (fd >= 0) {
lib/libc/gen/getcap.c
315
(void)lseek(fd, (off_t)0, SEEK_SET);
lib/libc/gen/getcap.c
355
fd = open(*db_p, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/getcap.c
356
if (fd < 0) {
lib/libc/gen/getcap.c
394
n = read(fd, buf, sizeof(buf));
lib/libc/gen/getcap.c
397
(void)close(fd);
lib/libc/gen/getcap.c
405
fd = -1;
lib/libc/gen/getcap.c
464
(void)close(fd);
lib/libc/gen/getcap.c
553
iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
lib/libc/gen/getcap.c
561
(void)close(fd);
lib/libc/gen/getcap.c
610
(void)close(fd);
lib/libc/gen/getcap.c
644
(void)close(fd);
lib/libc/gen/getpass.c
104
if (fd == NULL) {
lib/libc/gen/getpass.c
109
fd = fdc;
lib/libc/gen/getpass.c
110
if ((fd[0] = fd[1] = fd[2] = open(_PATH_TTY,
lib/libc/gen/getpass.c
112
fd[0] = STDIN_FILENO;
lib/libc/gen/getpass.c
113
fd[1] = fd[2] = STDERR_FILENO;
lib/libc/gen/getpass.c
120
if (tcgetattr(fd[0], &gt) == -1) {
lib/libc/gen/getpass.c
134
if (tcsetattr(fd[0], TCSAFLUSH|TCSASOFT, &st) == -1)
lib/libc/gen/getpass.c
140
(void)write(fd[1], prompt, plen);
lib/libc/gen/getpass.c
154
pfd.fd = fd[0];
lib/libc/gen/getpass.c
167
if (read(fd[0], &c, 1) != 1)
lib/libc/gen/getpass.c
173
(void)write(fd[2], "\a", 1); \
lib/libc/gen/getpass.c
175
#define erase() (void)write(fd[1], "\b \b", 3)
lib/libc/gen/getpass.c
282
(void)write(fd[1], "*", 1);
lib/libc/gen/getpass.c
284
(void)write(fd[1], isprint((unsigned char)c) ?
lib/libc/gen/getpass.c
294
(void)tcsetattr(fd[0], TCSAFLUSH|TCSASOFT, &gt);
lib/libc/gen/getpass.c
298
(void)write(fd[1], "\n", 1);
lib/libc/gen/getpass.c
302
(void)close(fd[0]);
lib/libc/gen/getpass.c
86
getpassfd(const char *prompt, char *buf, size_t len, int *fd, int flags,
lib/libc/gen/initdir.c
123
dirp->dd_seek = lseek(fd, (off_t)0, SEEK_CUR);
lib/libc/gen/initdir.c
124
n = getdents(fd, ddptr, space);
lib/libc/gen/initdir.c
134
lseek(fd, (off_t)0, SEEK_SET);
lib/libc/gen/initdir.c
155
(void) close(fd);
lib/libc/gen/initdir.c
156
if ((fd = open(name, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/gen/initdir.c
253
dirp->dd_fd = fd;
lib/libc/gen/initdir.c
56
_initdir(DIR *dirp, int fd, const char *name)
lib/libc/gen/isatty.c
53
isatty(int fd)
lib/libc/gen/isatty.c
57
return(tcgetattr(fd, &t) != -1);
lib/libc/gen/nlist.c
117
int fd, n;
lib/libc/gen/nlist.c
122
fd = open(name, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/nlist.c
123
if (fd < 0)
lib/libc/gen/nlist.c
125
n = __fdnlist(fd, list);
lib/libc/gen/nlist.c
126
(void)close(fd);
lib/libc/gen/nlist.c
131
__fdnlist(int fd, struct nlist *list)
lib/libc/gen/nlist.c
136
_DIAGASSERT(fd != -1);
lib/libc/gen/nlist.c
140
if ((rv = (*fdnlist_fmts[i].fdnlist)(fd, list)) != -1)
lib/libc/gen/nlist_aout.c
107
_DIAGASSERT(fd != -1);
lib/libc/gen/nlist_aout.c
110
if (pread(fd, &exec, sizeof(exec), (off_t)0) != sizeof(exec) ||
lib/libc/gen/nlist_aout.c
111
N_BADMAG(exec) || fstat(fd, &st) < 0)
lib/libc/gen/nlist_aout.c
131
fd, stroff);
lib/libc/gen/nlist_aout.c
152
if (lseek(fd, symoff, SEEK_SET) == -1)
lib/libc/gen/nlist_aout.c
165
if (read(fd, nbuf, cc) != (ssize_t) cc)
lib/libc/gen/nlist_aout.c
95
__fdnlist_aout(int fd, struct nlist *list)
lib/libc/gen/nlist_coff.c
103
if (fstat(fd, &st) < 0)
lib/libc/gen/nlist_coff.c
115
fd, 0);
lib/libc/gen/nlist_coff.c
84
__fdnlist_coff(int fd, struct nlist *list)
lib/libc/gen/nlist_coff.c
95
_DIAGASSERT(fd != -1);
lib/libc/gen/nlist_ecoff.c
100
fd, 0);
lib/libc/gen/nlist_ecoff.c
66
__fdnlist_ecoff(int fd, struct nlist *list)
lib/libc/gen/nlist_ecoff.c
80
_DIAGASSERT(fd != -1);
lib/libc/gen/nlist_ecoff.c
88
if (fstat(fd, &st) < 0)
lib/libc/gen/nlist_elf32.c
102
_DIAGASSERT(fd != -1);
lib/libc/gen/nlist_elf32.c
110
if (fstat(fd, &st) < 0)
lib/libc/gen/nlist_elf32.c
124
if ((ssize_t)(i = pread(fd, &ehdr, sizeof(Elf_Ehdr), (off_t)0)) == -1)
lib/libc/gen/nlist_elf32.c
169
error = ioctl(fd, KIOCGSYMBOL, &kg);
lib/libc/gen/nlist_elf32.c
176
error = ioctl(fd, OKIOCGSYMBOL, &okg);
lib/libc/gen/nlist_elf32.c
180
error = ioctl(fd, KIOCGSYMBOL, &kg);
lib/libc/gen/nlist_elf32.c
224
fd, (off_t)0);
lib/libc/gen/nlist_elf32.c
77
ELFNAMEEND(__fdnlist)(int fd, struct nlist *list)
lib/libc/gen/opendir.c
108
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
lib/libc/gen/opendir.c
111
return __opendir_common(fd, NULL, DTF_HIDEW|DTF_NODUP);
lib/libc/gen/opendir.c
116
__opendir_common(int fd, const char *name, int flags)
lib/libc/gen/opendir.c
139
if (fstatvfs1(fd, &sfb, ST_NOWAIT) < 0)
lib/libc/gen/opendir.c
155
error = _initdir(dirp, fd, name);
lib/libc/gen/opendir.c
79
int fd;
lib/libc/gen/opendir.c
81
if ((fd = open(name, O_RDONLY|O_DIRECTORY|O_NONBLOCK|O_CLOEXEC)) == -1)
lib/libc/gen/opendir.c
84
dirp = __opendir_common(fd, name, flags);
lib/libc/gen/opendir.c
87
(void)close(fd);
lib/libc/gen/opendir.c
95
_fdopendir(int fd)
lib/libc/gen/opendir.c
99
if (fstat(fd, &sb) == -1)
lib/libc/gen/popen.c
129
(void)close(old->fd); /* don't allow a flush */
lib/libc/gen/popen.c
160
cur->fd = pdes[0];
lib/libc/gen/popen.c
166
cur->fd = pdes[1];
lib/libc/gen/popen.c
70
int fd;
lib/libc/gen/rewinddir.c
58
int fd;
lib/libc/gen/rewinddir.c
65
fd = dirp->dd_fd;
lib/libc/gen/rewinddir.c
67
dirp->dd_seek = lseek(fd, (off_t)0, SEEK_SET);
lib/libc/gen/rewinddir.c
68
_initdir(dirp, fd, NULL);
lib/libc/gen/scandir.c
63
dirsize(int fd, size_t olen)
lib/libc/gen/scandir.c
68
if (fstat(fd, &stb) == -1)
lib/libc/gen/ttyname.c
60
ttyname_r(int fd, char *buf, size_t len)
lib/libc/gen/ttyname.c
66
_DIAGASSERT(fd != -1);
lib/libc/gen/ttyname.c
69
if (ioctl(fd, TIOCPTSNAME, &ptm) != -1) {
lib/libc/gen/ttyname.c
77
if (tcgetattr(fd, &ttyb) == -1)
lib/libc/gen/ttyname.c
80
if (fstat(fd, &sb))
lib/libc/gen/ttyname.c
91
ttyname(int fd)
lib/libc/gen/ttyname.c
96
rv = ttyname_r(fd, buf, sizeof(buf));
lib/libc/gen/utmpx.c
340
int fd;
lib/libc/gen/utmpx.c
346
fd = open(file, O_WRONLY|O_APPEND|O_SHLOCK|O_CLOEXEC);
lib/libc/gen/utmpx.c
348
if (fd == -1) {
lib/libc/gen/utmpx.c
349
if ((fd = open(file, O_CREAT|O_WRONLY|O_EXLOCK|O_CLOEXEC, 0644)) == -1)
lib/libc/gen/utmpx.c
354
if (write(fd, &ut, sizeof(ut)) == -1)
lib/libc/gen/utmpx.c
357
if (write(fd, utx, sizeof(*utx)) == -1)
lib/libc/gen/utmpx.c
359
if (close(fd) == -1)
lib/libc/gen/utmpx.c
365
(void) close(fd);
lib/libc/gen/xsyslog.c
147
int fd, saved_errno;
lib/libc/gen/xsyslog.c
354
(fd = open(_PATH_CONSOLE,
lib/libc/gen/xsyslog.c
358
(void)writev(fd, iov, iovcnt + 1);
lib/libc/gen/xsyslog.c
359
(void)close(fd);
lib/libc/gmon/gmon.c
377
int fd;
lib/libc/gmon/gmon.c
446
fd = open(proffile, OPEN_FLAGS, 0666);
lib/libc/gmon/gmon.c
447
if (fd < 0) {
lib/libc/gmon/gmon.c
455
(void)close(fd);
lib/libc/gmon/gmon.c
471
(void)write(fd, hdr, sizeof *hdr);
lib/libc/gmon/gmon.c
472
(void)write(fd, p->kcount, (size_t)p->kcountsize);
lib/libc/gmon/gmon.c
492
(void)write(fd, &rawarc, sizeof rawarc);
lib/libc/gmon/gmon.c
495
(void)close(fd);
lib/libc/hash/hashhl.c
102
if (fstat(fd, &sb) == -1) {
lib/libc/hash/hashhl.c
103
close(fd);
lib/libc/hash/hashhl.c
108
if (off > 0 && lseek(fd, off, SEEK_SET) < 0) {
lib/libc/hash/hashhl.c
109
close(fd);
lib/libc/hash/hashhl.c
113
while ((nr = read(fd, buffer, (size_t) MIN((off_t)sizeof(buffer), len)))
lib/libc/hash/hashhl.c
121
close(fd);
lib/libc/hash/hashhl.c
94
int fd, save_errno;
lib/libc/hash/hashhl.c
99
if ((fd = open(filename, O_RDONLY | O_CLOEXEC)) < 0)
lib/libc/isc/ev_streams.c
101
evRead(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
lib/libc/isc/ev_streams.c
111
new->fd = fd;
lib/libc/isc/ev_streams.c
113
if (evSelectFD(opaqueCtx, fd, EV_READ, readable, new, &new->file) < 0)
lib/libc/isc/ev_streams.c
270
writable(evContext opaqueCtx, void *uap, int fd, int evmask) {
lib/libc/isc/ev_streams.c
276
bytes = writev(fd, str->iovCur, str->iovCurCount);
lib/libc/isc/ev_streams.c
293
readable(evContext opaqueCtx, void *uap, int fd, int evmask) {
lib/libc/isc/ev_streams.c
299
bytes = readv(fd, str->iovCur, str->iovCurCount);
lib/libc/isc/ev_streams.c
51
static void writable(evContext opaqueCtx, void *uap, int fd, int evmask);
lib/libc/isc/ev_streams.c
52
static void readable(evContext opaqueCtx, void *uap, int fd, int evmask);
lib/libc/isc/ev_streams.c
67
evWrite(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
lib/libc/isc/ev_streams.c
77
new->fd = fd;
lib/libc/isc/ev_streams.c
79
if (evSelectFD(opaqueCtx, fd, EV_WRITE, writable, new, &new->file) < 0)
lib/libc/isc/eventlib_p.h
117
int fd;
lib/libc/isc/eventlib_p.h
133
int fd;
lib/libc/isc/eventlib_p.h
193
extern short *__fd_eventfield(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
195
extern void __fd_clr(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
196
extern void __fd_set(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
202
#define FD_SET(fd, maskp) \
lib/libc/isc/eventlib_p.h
203
__fd_set(fd, maskp)
lib/libc/isc/eventlib_p.h
206
#define FD_CLR(fd, maskp) \
lib/libc/isc/eventlib_p.h
207
__fd_clr(fd, maskp)
lib/libc/isc/eventlib_p.h
210
#define FD_ISSET(fd, maskp) \
lib/libc/isc/eventlib_p.h
211
((*__fd_eventfield(fd, maskp) & __poll_event(maskp)) != 0)
lib/libc/isc/eventlib_p.h
267
extern int evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd);
lib/libc/isc/eventlib_p.h
81
int fd;
lib/libc/isc/eventlib_p.h
92
int fd;
lib/libc/net/rcmd.c
294
reads[0].fd = s;
lib/libc/net/rcmd.c
296
reads[1].fd = s2;
lib/libc/nls/catopen.c
163
int fd;
lib/libc/nls/catopen.c
167
if ((fd = open(path, O_RDONLY|O_CLOEXEC)) == -1)
lib/libc/nls/catopen.c
170
if (fstat(fd, &st) != 0) {
lib/libc/nls/catopen.c
171
close (fd);
lib/libc/nls/catopen.c
175
data = mmap(0, (size_t)st.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd,
lib/libc/nls/catopen.c
177
close (fd);
lib/libc/posix1e/acl_get.c
109
acl_get_fd(int fd)
lib/libc/posix1e/acl_get.c
111
if (fpathconf(fd, _PC_ACL_NFS4) == 1)
lib/libc/posix1e/acl_get.c
112
return (acl_get_fd_np(fd, ACL_TYPE_NFS4));
lib/libc/posix1e/acl_get.c
114
return (acl_get_fd_np(fd, ACL_TYPE_ACCESS));
lib/libc/posix1e/acl_get.c
118
acl_get_fd_np(int fd, acl_type_t type)
lib/libc/posix1e/acl_get.c
128
error = __acl_get_fd(fd, type, &aclp->ats_acl);
lib/libc/posix1e/acl_set.c
101
acl_set_fd(int fd, acl_t acl)
lib/libc/posix1e/acl_set.c
104
if (fpathconf(fd, _PC_ACL_NFS4) == 1)
lib/libc/posix1e/acl_set.c
105
return (acl_set_fd_np(fd, acl, ACL_TYPE_NFS4));
lib/libc/posix1e/acl_set.c
107
return (acl_set_fd_np(fd, acl, ACL_TYPE_ACCESS));
lib/libc/posix1e/acl_set.c
111
acl_set_fd_np(int fd, acl_t acl, acl_type_t type)
lib/libc/posix1e/acl_set.c
128
return (__acl_set_fd(fd, type, &acl->ats_acl));
lib/libc/posix1e/acl_valid.c
115
acl_valid_fd_np(int fd, acl_type_t type, acl_t acl)
lib/libc/posix1e/acl_valid.c
128
return (__acl_aclcheck_fd(fd, type, &acl->ats_acl));
lib/libc/resolv/res_send.c
1008
pollfd.fd = s;
lib/libc/resolv/res_send.c
437
int fd;
lib/libc/resolv/res_send.c
443
fd = EXT(statp).nssocks[0];
lib/libc/resolv/res_send.c
456
EXT(statp).nssocks[lastns] = fd;
lib/libc/rpc/clnt_bcast.c
279
int fd; /* File descriptor */
lib/libc/rpc/clnt_bcast.c
326
int fd;
lib/libc/rpc/clnt_bcast.c
341
fd = socket(si.si_af, si.si_socktype, si.si_proto);
lib/libc/rpc/clnt_bcast.c
342
if (fd < 0) {
lib/libc/rpc/clnt_bcast.c
348
fdlist[fdlistno].fd = fd;
lib/libc/rpc/clnt_bcast.c
353
pfd[fdlistno].fd = fdlist[fdlistno].fd = fd;
lib/libc/rpc/clnt_bcast.c
364
close(fd);
lib/libc/rpc/clnt_bcast.c
466
__rpc_broadenable(fdlist[i].af, fdlist[i].fd,
lib/libc/rpc/clnt_bcast.c
474
if ((size_t)sendto(fdlist[i].fd, outbuf,
lib/libc/rpc/clnt_bcast.c
496
if ((size_t)sendto(fdlist[i].fd,
lib/libc/rpc/clnt_bcast.c
551
pfd[i].fd = -1;
lib/libc/rpc/clnt_bcast.c
561
inlen = recvfrom(fdlist[i].fd, inbuf, fdlist[i].dsize,
lib/libc/rpc/clnt_bcast.c
661
(void) close(fdlist[i].fd);
lib/libc/rpc/clnt_dg.c
108
#define release_fd_lock(fd, mask) { \
lib/libc/rpc/clnt_dg.c
110
dg_fd_locks[fd] = 0; \
lib/libc/rpc/clnt_dg.c
113
cond_signal(&dg_cv[fd]); \
lib/libc/rpc/clnt_dg.c
116
#define release_fd_lock(fd,mask)
lib/libc/rpc/clnt_dg.c
160
int fd, /* open file descriptor */
lib/libc/rpc/clnt_dg.c
218
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/clnt_dg.c
273
(void)bindresvport_sa(fd, (struct sockaddr *)svcaddr->buf);
lib/libc/rpc/clnt_dg.c
275
ioctl(fd, FIONBIO, (char *)(void *)&one);
lib/libc/rpc/clnt_dg.c
283
cu->cu_fd = fd;
lib/libc/rpc/clnt_dg.c
284
cu->cu_pfdp.fd = cu->cu_fd;
lib/libc/rpc/clnt_generic.c
292
int fd, /* fd */
lib/libc/rpc/clnt_generic.c
308
if (fd == RPC_ANYFD) {
lib/libc/rpc/clnt_generic.c
314
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/clnt_generic.c
316
if (fd == -1)
lib/libc/rpc/clnt_generic.c
321
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_generic.c
324
(void)bindresvport(fd, NULL);
lib/libc/rpc/clnt_generic.c
326
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_generic.c
343
cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz);
lib/libc/rpc/clnt_generic.c
346
(void)__rpc_setnodelay(fd, &si);
lib/libc/rpc/clnt_generic.c
349
cl = clnt_dg_create(fd, svcaddr, prog, vers, sendsz, recvsz);
lib/libc/rpc/clnt_generic.c
381
(void) close(fd);
lib/libc/rpc/clnt_simple.c
173
int fd;
lib/libc/rpc/clnt_simple.c
195
if (CLNT_CONTROL(rcp->client, CLGET_FD, (char *)(void *)&fd))
lib/libc/rpc/clnt_simple.c
196
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
lib/libc/rpc/clnt_vc.c
134
#define release_fd_lock(fd, mask) { \
lib/libc/rpc/clnt_vc.c
136
vc_fd_locks[fd] = 0; \
lib/libc/rpc/clnt_vc.c
139
cond_signal(&vc_cv[fd]); \
lib/libc/rpc/clnt_vc.c
142
#define release_fd_lock(fd,mask)
lib/libc/rpc/clnt_vc.c
187
int fd,
lib/libc/rpc/clnt_vc.c
259
if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/clnt_vc.c
265
if (connect(fd, (struct sockaddr *)raddr->buf, raddr->len) < 0){
lib/libc/rpc/clnt_vc.c
273
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_vc.c
281
ct->ct_fd = fd;
lib/libc/rpc/clnt_vc.c
307
(void)close(fd);
lib/libc/rpc/clnt_vc.c
696
struct pollfd fd;
lib/libc/rpc/clnt_vc.c
704
fd.fd = ct->ct_fd;
lib/libc/rpc/clnt_vc.c
705
fd.events = POLLIN;
lib/libc/rpc/clnt_vc.c
707
switch (pollts(&fd, 1, &ts, NULL)) {
lib/libc/rpc/rpc_generic.c
496
__rpcgettp(int fd)
lib/libc/rpc/rpc_generic.c
501
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/rpc_generic.c
511
__rpc_fd2sockinfo(int fd, struct __rpc_sockinfo *sip)
lib/libc/rpc/rpc_generic.c
520
if (getsockname(fd, (struct sockaddr *)(void *)&ss, &len) < 0)
lib/libc/rpc/rpc_generic.c
525
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len) < 0)
lib/libc/rpc/rpc_generic.c
857
__rpc_sockisbound(int fd)
lib/libc/rpc/rpc_generic.c
863
if (getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0)
lib/libc/rpc/rpc_generic.c
897
__rpc_setnodelay(int fd, const struct __rpc_sockinfo *si)
lib/libc/rpc/rpc_generic.c
902
return setsockopt(fd, si->si_proto, TCP_NODELAY, &one,
lib/libc/rpc/rpc_soc.c
113
int fd;
lib/libc/rpc/rpc_soc.c
121
fd = *sockp;
lib/libc/rpc/rpc_soc.c
129
if (fd == RPC_ANYSOCK) {
lib/libc/rpc/rpc_soc.c
130
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpc_soc.c
131
if (fd == -1)
lib/libc/rpc/rpc_soc.c
155
(void)bindresvport(fd, NULL);
lib/libc/rpc/rpc_soc.c
156
cl = clnt_tli_create(fd, nconf, &bindaddr, prog, vers,
lib/libc/rpc/rpc_soc.c
164
*sockp = fd;
lib/libc/rpc/rpc_soc.c
177
(void) close(fd);
lib/libc/rpc/rpc_soc.c
226
svc_com_create(int fd, u_int sendsize, u_int recvsize, const char *netid)
lib/libc/rpc/rpc_soc.c
240
if (fd == RPC_ANYSOCK) {
lib/libc/rpc/rpc_soc.c
241
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpc_soc.c
242
if (fd == -1) {
lib/libc/rpc/rpc_soc.c
253
(void)bindresvport(fd, &sccsin);
lib/libc/rpc/rpc_soc.c
258
if (listen(fd, SOMAXCONN) == -1) {
lib/libc/rpc/rpc_soc.c
270
svc = svc_tli_create(fd, nconf, NULL, sendsize, recvsize);
lib/libc/rpc/rpc_soc.c
279
(void) close(fd);
lib/libc/rpc/rpc_soc.c
284
svctcp_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/rpc_soc.c
286
return svc_com_create(fd, sendsize, recvsize, "tcp");
lib/libc/rpc/rpc_soc.c
290
svcudp_bufcreate(int fd, u_int sendsz, u_int recvsz)
lib/libc/rpc/rpc_soc.c
292
return svc_com_create(fd, sendsz, recvsz, "udp");
lib/libc/rpc/rpc_soc.c
296
svcfd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/rpc_soc.c
298
return svc_fd_create(fd, sendsize, recvsize);
lib/libc/rpc/rpc_soc.c
303
svcudp_create(int fd)
lib/libc/rpc/rpc_soc.c
305
return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp");
lib/libc/rpc/rpcb_clnt.c
479
int fd;
lib/libc/rpc/rpcb_clnt.c
498
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpcb_clnt.c
503
if (fd < 0)
lib/libc/rpc/rpcb_clnt.c
505
close(fd);
lib/libc/rpc/svc.c
653
int sock, bit, fd;
lib/libc/rpc/svc.c
662
fd = sock + bit - 1;
lib/libc/rpc/svc.c
663
svc_getreq_common(fd);
lib/libc/rpc/svc.c
675
svc_getreq_common(int fd)
lib/libc/rpc/svc.c
691
xprt = __svc_xports[fd];
lib/libc/rpc/svc.c
747
if (xprt != __svc_xports[fd]) {
lib/libc/rpc/svc.c
788
svc_fdset_clr(p->fd);
lib/libc/rpc/svc.c
791
svc_getreq_common(p->fd);
lib/libc/rpc/svc_dg.c
110
svc_dg_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_dg.c
118
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/svc_dg.c
147
xprt->xp_fd = fd;
lib/libc/rpc/svc_dg.c
154
if (getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0)
lib/libc/rpc/svc_fdset.c
112
int fd = fds->fdp[i].fd;
lib/libc/rpc/svc_fdset.c
113
if (fd == -1)
lib/libc/rpc/svc_fdset.c
115
fprintf(stderr, "%s%d", did, fd);
lib/libc/rpc/svc_fdset.c
174
pfd[i].fd = -1;
lib/libc/rpc/svc_fdset.c
196
svc_pollfd_add(int fd, struct svc_fdset *fds)
lib/libc/rpc/svc_fdset.c
204
if (pfd[i].fd == -1) {
lib/libc/rpc/svc_fdset.c
208
fd, i, fds->fdused);
lib/libc/rpc/svc_fdset.c
209
pfd[i].fd = fd;
lib/libc/rpc/svc_fdset.c
218
pfd[fds->fdnum].fd = fd;
lib/libc/rpc/svc_fdset.c
220
DPRINTF("add fd=%d slot=%d fdused=%d", fd, fds->fdnum, fds->fdused);
lib/libc/rpc/svc_fdset.c
227
svc_pollfd_del(int fd, struct svc_fdset *fds)
lib/libc/rpc/svc_fdset.c
235
if (pfd[i].fd != fd)
lib/libc/rpc/svc_fdset.c
238
pfd[i].fd = -1;
lib/libc/rpc/svc_fdset.c
239
DPRINTF("del fd=%d slot=%d", fd, fds->fdused);
lib/libc/rpc/svc_fdset.c
244
if (pfd[i].fd != -1)
lib/libc/rpc/svc_fdset.c
249
DPRINTF("del fd=%d fdused=%d", fd, fds->fdused);
lib/libc/rpc/svc_fdset.c
252
DPRINTF("del fd=%d not found", fd);
lib/libc/rpc/svc_fdset.c
257
svc_fdset_resize(int fd, struct svc_fdset *fds)
lib/libc/rpc/svc_fdset.c
259
if (fds->fdset && fd < fds->fdsize) {
lib/libc/rpc/svc_fdset.c
260
DPRINTF_FDSET(fds, "keeping %d < %d", fd, fds->fdsize);
lib/libc/rpc/svc_fdset.c
264
fd += FD_SETSIZE;
lib/libc/rpc/svc_fdset.c
266
char *newfdset = realloc(fds->fdset, __NFD_BYTES(fd));
lib/libc/rpc/svc_fdset.c
271
__NFD_BYTES(fd) - __NFD_BYTES(fds->fdsize));
lib/libc/rpc/svc_fdset.c
275
DPRINTF_FDSET(fds, "resize %d > %d", fd, fds->fdsize);
lib/libc/rpc/svc_fdset.c
276
fds->fdsize = fd;
lib/libc/rpc/svc_fdset.c
282
svc_fdset_alloc(int fd)
lib/libc/rpc/svc_fdset.c
288
return svc_fdset_resize(fd, &__svc_fdset);
lib/libc/rpc/svc_fdset.c
309
if (fd < fds->fdsize)
lib/libc/rpc/svc_fdset.c
313
return svc_fdset_resize(fd, fds);
lib/libc/rpc/svc_fdset.c
315
return svc_fdset_resize(fd, &__svc_fdset);
lib/libc/rpc/svc_fdset.c
348
svc_fdset_set(int fd)
lib/libc/rpc/svc_fdset.c
350
struct svc_fdset *fds = svc_fdset_alloc(fd);
lib/libc/rpc/svc_fdset.c
355
FD_SET(fd, fds->fdset);
lib/libc/rpc/svc_fdset.c
356
if (fd > fds->fdmax)
lib/libc/rpc/svc_fdset.c
357
fds->fdmax = fd;
lib/libc/rpc/svc_fdset.c
359
int rv = svc_pollfd_add(fd, fds) ? 0 : -1;
lib/libc/rpc/svc_fdset.c
360
DPRINTF_FDSET(fds, "%d", fd);
lib/libc/rpc/svc_fdset.c
367
svc_fdset_isset(int fd)
lib/libc/rpc/svc_fdset.c
369
struct svc_fdset *fds = svc_fdset_alloc(fd);
lib/libc/rpc/svc_fdset.c
374
DPRINTF_FDSET(fds, "%d", fd);
lib/libc/rpc/svc_fdset.c
376
return FD_ISSET(fd, fds->fdset) != 0;
lib/libc/rpc/svc_fdset.c
380
svc_fdset_clr(int fd)
lib/libc/rpc/svc_fdset.c
382
struct svc_fdset *fds = svc_fdset_alloc(fd);
lib/libc/rpc/svc_fdset.c
387
FD_CLR(fd, fds->fdset);
lib/libc/rpc/svc_fdset.c
389
int rv = svc_pollfd_del(fd, fds) ? 0 : -1;
lib/libc/rpc/svc_fdset.c
390
DPRINTF_FDSET(fds, "%d", fd);
lib/libc/rpc/svc_fdset.c
437
svc_fdset_getsize(int fd)
lib/libc/rpc/svc_fdset.c
439
struct svc_fdset *fds = svc_fdset_alloc(fd);
lib/libc/rpc/svc_fdset.c
485
svc_pollfd_getsize(int fd)
lib/libc/rpc/svc_fdset.c
487
struct svc_fdset *fds = svc_fdset_alloc(fd);
lib/libc/rpc/svc_generic.c
199
int fd, /* Connection end point */
lib/libc/rpc/svc_generic.c
211
if (fd == RPC_ANYFD) {
lib/libc/rpc/svc_generic.c
216
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/svc_generic.c
217
if (fd == -1) {
lib/libc/rpc/svc_generic.c
228
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/svc_generic.c
238
if (madefd || !__rpc_sockisbound(fd)) {
lib/libc/rpc/svc_generic.c
240
if (bindresvport(fd, NULL) < 0) {
lib/libc/rpc/svc_generic.c
244
if (bind(fd, (struct sockaddr *)(void *)&ss,
lib/libc/rpc/svc_generic.c
252
listen(fd, SOMAXCONN) == -1) {
lib/libc/rpc/svc_generic.c
258
if (bind(fd,
lib/libc/rpc/svc_generic.c
266
listen(fd, (int)bindaddr->qlen) == -1) {
lib/libc/rpc/svc_generic.c
279
if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen)
lib/libc/rpc/svc_generic.c
282
xprt = svc_fd_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
284
xprt = svc_vc_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
295
xprt = svc_dg_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
324
(void) close(fd);
lib/libc/rpc/svc_vc.c
133
svc_vc_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
142
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/svc_vc.c
165
xprt->xp_fd = fd;
lib/libc/rpc/svc_vc.c
168
if (getsockname(fd, (struct sockaddr *)(void *)&sslocal, &slen) < 0) {
lib/libc/rpc/svc_vc.c
177
if (setsockopt(fd, SOL_LOCAL, LOCAL_CREDS, &one,
lib/libc/rpc/svc_vc.c
206
svc_fd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
212
_DIAGASSERT(fd != -1);
lib/libc/rpc/svc_vc.c
214
ret = makefd_xprt(fd, sendsize, recvsize);
lib/libc/rpc/svc_vc.c
219
if (getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/svc_vc.c
232
if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/svc_vc.c
260
makefd_xprt(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
267
_DIAGASSERT(fd != -1);
lib/libc/rpc/svc_vc.c
283
xprt->xp_fd = fd;
lib/libc/rpc/svc_vc.c
284
if (__rpc_fd2sockinfo(fd, &si) && __rpc_sockinfo2netid(&si, &netid))
lib/libc/rpc/svc_vc.c
534
pollfd.fd = sock;
lib/libc/stdio/dprintf.c
52
dprintf(int fd, const char * __restrict fmt, ...)
lib/libc/stdio/dprintf.c
58
ret = vdprintf(fd, fmt, ap);
lib/libc/stdio/dprintf.c
64
dprintf_l(int fd, locale_t loc, const char * __restrict fmt, ...)
lib/libc/stdio/dprintf.c
70
ret = vdprintf_l(fd, loc, fmt, ap);
lib/libc/stdio/fdopen.c
116
fp->_file = fd;
lib/libc/stdio/fdopen.c
64
fdopen(int fd, const char *mode)
lib/libc/stdio/fdopen.c
69
_DIAGASSERT(fd != -1);
lib/libc/stdio/fdopen.c
78
if (fd >= USHRT_MAX) {
lib/libc/stdio/fdopen.c
87
if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0)
lib/libc/stdio/fdopen.c
97
if (fstat(fd, &st) == -1) {
lib/libc/stdio/mkostemp.c
33
int fd;
lib/libc/stdio/mkostemp.c
35
return GETTEMP(path, &fd, 0, 0, oflags) ? fd : -1;
lib/libc/stdio/mkostemps.c
33
int fd;
lib/libc/stdio/mkostemps.c
35
return GETTEMP(path, &fd, 0, slen, oflags) ? fd : -1;
lib/libc/stdio/mkstemp.c
51
int fd;
lib/libc/stdio/mkstemp.c
55
return GETTEMP(path, &fd, 0, 0, 0) ? fd : -1;
lib/libc/stdio/mkstemps.c
35
int fd;
lib/libc/stdio/mkstemps.c
37
return GETTEMP(path, &fd, 0, slen, 0) ? fd : -1;
lib/libc/stdio/tmpfile.c
59
int fd, sverrno;
lib/libc/stdio/tmpfile.c
69
fd = mkstemp(buf);
lib/libc/stdio/tmpfile.c
70
if (fd != -1)
lib/libc/stdio/tmpfile.c
75
if (fd == -1)
lib/libc/stdio/tmpfile.c
78
if ((fp = fdopen(fd, "w+")) == NULL) {
lib/libc/stdio/tmpfile.c
80
(void)close(fd);
lib/libc/stdio/vdprintf.c
112
vdprintf(int fd, const char * __restrict fmt, va_list ap)
lib/libc/stdio/vdprintf.c
114
return vdprintf_l(fd, _current_locale(), fmt, ap);
lib/libc/stdio/vdprintf.c
61
vdprintf_l(int fd, locale_t loc, const char * __restrict fmt, va_list ap)
lib/libc/stdio/vdprintf.c
68
_DIAGASSERT(fd != -1);
lib/libc/stdio/vdprintf.c
77
if (fd >= USHRT_MAX) {
lib/libc/stdio/vdprintf.c
82
if ((fdflags = fcntl(fd, F_GETFL, 0)) == -1)
lib/libc/stdio/vdprintf.c
96
f._file = fd;
lib/libc/sys/fdiscard.c
49
fdiscard(int fd, off_t off, off_t len)
lib/libc/sys/fdiscard.c
51
return __fdiscard(fd, 0, off, len);
lib/libc/sys/ftruncate.c
57
ftruncate(int fd, off_t length)
lib/libc/sys/ftruncate.c
60
return __ftruncate(fd, 0, length);
lib/libc/sys/lseek.c
57
lseek(int fd, off_t offset, int whence)
lib/libc/sys/lseek.c
60
return __lseek(fd, 0, offset, whence);
lib/libc/sys/mknodat.c
38
mknodat(int fd, const char *path, mode_t mode, dev_t dev)
lib/libc/sys/mknodat.c
40
return __mknodat(fd, path, mode, 0, dev);
lib/libc/sys/mmap.c
58
mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
lib/libc/sys/mmap.c
61
return __mmap(addr, len, prot, flags, fd, 0, offset);
lib/libc/sys/posix_fadvise.c
34
int __posix_fadvise50(int fd, int pad, off_t offset, off_t size, int hint);
lib/libc/sys/posix_fadvise.c
37
posix_fadvise(int fd, off_t offset, off_t size, int hint)
lib/libc/sys/posix_fadvise.c
39
return __posix_fadvise50(fd, 0, offset, size, hint);
lib/libc/sys/posix_fallocate.c
49
posix_fallocate(int fd, off_t off, off_t len)
lib/libc/sys/posix_fallocate.c
51
return __posix_fallocate(fd, 0, off, len);
lib/libc/sys/pread.c
58
_sys_pread(int fd, void *buf, size_t nbyte, off_t offset)
lib/libc/sys/pread.c
61
return __pread(fd, buf, nbyte, 0, offset);
lib/libc/sys/preadv.c
49
preadv(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
lib/libc/sys/preadv.c
52
return __preadv(fd, iovp, iovcnt, 0, offset);
lib/libc/sys/pwrite.c
58
_sys_pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
lib/libc/sys/pwrite.c
61
return __pwrite(fd, buf, nbyte, 0, offset);
lib/libc/sys/pwritev.c
49
pwritev(int fd, const struct iovec *iovp, int iovcnt, off_t offset)
lib/libc/sys/pwritev.c
52
return __pwritev(fd, iovp, iovcnt, 0, offset);
lib/libc/termios/tcdrain.c
53
tcdrain(int fd)
lib/libc/termios/tcdrain.c
56
_DIAGASSERT(fd != -1);
lib/libc/termios/tcdrain.c
58
return (ioctl(fd, TIOCDRAIN, 0));
lib/libc/termios/tcflow.c
54
tcflow(int fd, int action)
lib/libc/termios/tcflow.c
59
_DIAGASSERT(fd != -1);
lib/libc/termios/tcflow.c
63
return (ioctl(fd, TIOCSTOP, 0));
lib/libc/termios/tcflow.c
65
return (ioctl(fd, TIOCSTART, 0));
lib/libc/termios/tcflow.c
68
if (tcgetattr(fd, &term) == -1)
lib/libc/termios/tcflow.c
71
if (c != _POSIX_VDISABLE && write(fd, &c, sizeof(c)) == -1)
lib/libc/termios/tcflush.c
54
tcflush(int fd, int which)
lib/libc/termios/tcflush.c
58
_DIAGASSERT(fd != -1);
lib/libc/termios/tcflush.c
74
return (ioctl(fd, TIOCFLUSH, &com));
lib/libc/termios/tcgetattr.c
54
tcgetattr(int fd, struct termios *t)
lib/libc/termios/tcgetattr.c
59
return (ioctl(fd, TIOCGETA, t));
lib/libc/termios/tcgetpgrp.c
55
tcgetpgrp(int fd)
lib/libc/termios/tcgetpgrp.c
59
_DIAGASSERT(fd != -1);
lib/libc/termios/tcgetpgrp.c
61
if (ioctl(fd, TIOCGPGRP, &s) < 0)
lib/libc/termios/tcgetsid.c
55
tcgetsid(int fd)
lib/libc/termios/tcgetsid.c
59
_DIAGASSERT(fd != -1);
lib/libc/termios/tcgetsid.c
61
if (ioctl(fd, TIOCGSID, &s) < 0)
lib/libc/termios/tcgetwinsize.c
45
tcgetwinsize(int fd, struct winsize *ws)
lib/libc/termios/tcgetwinsize.c
47
return ioctl(fd, TIOCGWINSZ, ws);
lib/libc/termios/tcsendbreak.c
57
tcsendbreak(int fd, int len)
lib/libc/termios/tcsendbreak.c
61
_DIAGASSERT(fd != -1);
lib/libc/termios/tcsendbreak.c
63
if (ioctl(fd, TIOCSBRK, 0) == -1)
lib/libc/termios/tcsendbreak.c
66
if (ioctl(fd, TIOCCBRK, 0) == -1)
lib/libc/termios/tcsetattr.c
54
tcsetattr(int fd, int opt, const struct termios *t)
lib/libc/termios/tcsetattr.c
58
_DIAGASSERT(fd != -1);
lib/libc/termios/tcsetattr.c
68
return (ioctl(fd, TIOCSETA, t));
lib/libc/termios/tcsetattr.c
70
return (ioctl(fd, TIOCSETAW, t));
lib/libc/termios/tcsetattr.c
72
return (ioctl(fd, TIOCSETAF, t));
lib/libc/termios/tcsetpgrp.c
55
tcsetpgrp(int fd, pid_t pgrp)
lib/libc/termios/tcsetpgrp.c
59
_DIAGASSERT(fd != -1);
lib/libc/termios/tcsetpgrp.c
62
return (ioctl(fd, TIOCSPGRP, &s));
lib/libc/termios/tcsetwinsize.c
45
tcsetwinsize(int fd, const struct winsize *ws)
lib/libc/termios/tcsetwinsize.c
47
return ioctl(fd, TIOCSWINSZ, ws);
lib/libc/time/localtime.c
71
# define fstat(fd, st) (memset(st, 0, sizeof *(st)), 0)
lib/libc/time/localtime.c
935
tzfile_changed(int fd, struct stat *st)
lib/libc/time/localtime.c
943
if (!st->st_ctime && fstat(fd, st) < 0) {
lib/libc/time/zic.c
148
# define fchown(fd, owner, group) ((fd) < 0 ? -1 : 0)
lib/libc/time/zic.c
1652
int fd = open(*outname, oflags, creat_perms);
lib/libc/time/zic.c
1654
if (fd < 0)
lib/libc/time/zic.c
1657
FILE *fp = fdopen(fd, "wb");
lib/libc/time/zic.c
1661
close(fd);
lib/libc/time/zic.c
806
# define fchmod(fd, mode) 0
lib/libc/yp/yplib.c
106
int clnt_sock, fd, gpid;
lib/libc/yp/yplib.c
118
if ((fd = open(YPBINDLOCK, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/yp/yplib.c
120
if (!(flock(fd, LOCK_EX | LOCK_NB) == -1 && errno == EWOULDBLOCK)) {
lib/libc/yp/yplib.c
121
(void)close(fd);
lib/libc/yp/yplib.c
124
(void)close(fd);
lib/libc/yp/yplib.c
158
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/yp/yplib.c
165
if (flock(fd, LOCK_EX | LOCK_NB) == -1 &&
lib/libc/yp/yplib.c
177
r = readv(fd, iov, 2);
lib/libc/yp/yplib.c
179
(void)close(fd);
lib/libc/yp/yplib.c
196
(void)close(fd);
lib/libc/yp/yplib.c
200
(void)close(fd);
lib/libcompat/4.1/gtty.c
52
gtty(fd, tty)
lib/libcompat/4.1/gtty.c
53
int fd;
lib/libcompat/4.1/gtty.c
57
_DIAGASSERT(fd != -1);
lib/libcompat/4.1/gtty.c
60
return (ioctl(fd, TIOCGETP, tty));
lib/libcompat/4.1/stty.c
52
stty(fd, tty)
lib/libcompat/4.1/stty.c
53
int fd;
lib/libcompat/4.1/stty.c
57
_DIAGASSERT(fd != -1);
lib/libcompat/4.1/stty.c
60
return (ioctl(fd, TIOCSETP, tty));
lib/libcurses/refresh.c
763
fds[0].fd = _cursesi_screen->checkfd;
lib/libdm/libdm_ioctl.c
111
int fd;
lib/libdm/libdm_ioctl.c
113
if ((fd = rump_sys_open(path, O_RDWR)) < 0)
lib/libdm/libdm_ioctl.c
116
if ((fd = open(path, O_RDWR)) < 0)
lib/libdm/libdm_ioctl.c
119
return fd;
lib/libdm/libdm_ioctl.c
123
libdm_control_close(int fd)
lib/libdm/libdm_ioctl.c
127
return rump_sys_close(fd);
lib/libdm/libdm_ioctl.c
129
return close(fd);
lib/libedit/read.c
148
read__fixio(int fd __attribute__((__unused__)), int e)
lib/libedit/read.c
173
if ((e = fcntl(fd, F_GETFL, 0)) == -1)
lib/libedit/read.c
176
if (fcntl(fd, F_SETFL, e & ~O_NDELAY) == -1)
lib/libedit/read.c
186
if (ioctl(fd, FIONBIO, &zero) == -1)
lib/libedit/readline.c
1290
int fd;
lib/libedit/readline.c
1301
if ((fd = mkstemp(template)) == -1) {
lib/libedit/readline.c
1306
if ((tp = fdopen(fd, "r+")) == NULL) {
lib/libedit/readline.c
1307
close(fd);
lib/libedit/vi.c
1003
int fd;
lib/libedit/vi.c
1020
fd = mkstemp(tempfile);
lib/libedit/vi.c
1021
if (fd < 0)
lib/libedit/vi.c
1036
write(fd, cp, len);
lib/libedit/vi.c
1037
write(fd, "\n", (size_t)1);
lib/libedit/vi.c
1043
close(fd);
lib/libedit/vi.c
1050
lseek(fd, (off_t)0, SEEK_SET);
lib/libedit/vi.c
1051
st = read(fd, cp, TMP_BUFSIZ - 1);
lib/libedit/vi.c
1068
close(fd);
lib/libedit/vi.c
1075
close(fd);
lib/libexecinfo/backtrace.c
204
int fd = self_fd;
lib/libexecinfo/backtrace.c
206
if (fd != -1 || (fd = open_self(O_RDONLY)) != -1)
lib/libexecinfo/backtrace.c
207
st = symtab_create(fd, -1, STT_FUNC);
lib/libexecinfo/backtrace.c
238
if (fd != -1 && fd != self_fd)
lib/libexecinfo/backtrace.c
239
(void)close(fd);
lib/libexecinfo/backtrace.c
245
backtrace_symbols_fd_fmt(void *const *trace, size_t len, int fd,
lib/libexecinfo/backtrace.c
252
if (dprintf(fd, "%s\n", s[i]) < 0)
lib/libexecinfo/backtrace.c
267
backtrace_symbols_fd(void *const *trace, size_t len, int fd)
lib/libexecinfo/backtrace.c
269
return backtrace_symbols_fd_fmt(trace, len, fd, fmt);
lib/libexecinfo/symtab.c
104
elf = elf_begin(fd, ELF_C_READ, NULL);
lib/libexecinfo/symtab.c
92
symtab_create(int fd, int bind, int type)
lib/libintl/gettext.c
574
int fd;
lib/libintl/gettext.c
601
fd = open(path, O_RDONLY);
lib/libintl/gettext.c
602
if (fd < 0)
lib/libintl/gettext.c
604
if (read(fd, &magic, sizeof(magic)) != sizeof(magic) ||
lib/libintl/gettext.c
606
close(fd);
lib/libintl/gettext.c
609
if (read(fd, &revision, sizeof(revision)) != sizeof(revision)) {
lib/libintl/gettext.c
610
close(fd);
lib/libintl/gettext.c
621
close(fd);
lib/libintl/gettext.c
625
MAP_FILE | MAP_SHARED, fd, (off_t)0);
lib/libintl/gettext.c
627
close(fd);
lib/libintl/gettext.c
630
close(fd);
lib/libisns/isns.c
127
isns_add_servercon(ISNS_HANDLE isns_handle, int fd, struct addrinfo *ai)
lib/libisns/isns.c
175
task_p->var.init_socket_io.sd = fd;
lib/libisns/isns_fileio.c
42
isns_file_writev(int fd, const struct iovec *iov, int iovcnt)
lib/libisns/isns_fileio.c
48
error = wepe_sys_writev(fd, iov, iovcnt, &rval);
lib/libisns/isns_fileio.c
52
rval = writev(fd, iov, iovcnt);
lib/libisns/isns_fileio.c
62
isns_file_readv(int fd, const struct iovec *iov, int iovcnt)
lib/libisns/isns_fileio.c
68
error = wepe_sys_readv(fd, iov, iovcnt, &rval);
lib/libisns/isns_fileio.c
72
rval = readv(fd, iov, iovcnt);
lib/libkvm/kvm.c
158
Lseek(kvm_t *kd, int fd, off_t offset, int whence)
lib/libkvm/kvm.c
164
if ((off = lseek(fd, offset, whence)) == -1 && errno != 0) {
lib/libkvm/kvm.c
172
_kvm_pread(kvm_t *kd, int fd, void *buf, size_t size, off_t off)
lib/libkvm/kvm.c
191
return pread(fd, buf, size, off);
lib/libkvm/kvm.c
211
rv = pread(fd, kd->iobuf, dsize, doff);
lib/libkvm/kvm.c
236
Pread(kvm_t *kd, int fd, void *buf, size_t nbytes, off_t offset)
lib/libkvm/kvm.c
242
if ((rv = _kvm_pread(kd, fd, buf, nbytes, offset)) != nbytes &&
lib/libnpf/npf.c
1182
int error = 0, fd = -1;
lib/libnpf/npf.c
1225
if ((fd = mkstemp(sfn)) == -1) {
lib/libnpf/npf.c
1231
if (cdbw_output(cdbw, fd, "npf-table-cdb", NULL) == -1) {
lib/libnpf/npf.c
1235
if (fstat(fd, &sb) == -1) {
lib/libnpf/npf.c
1249
cdb = mmap(NULL, len, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
lib/libnpf/npf.c
1267
if (fd != -1) {
lib/libnpf/npf.c
1268
close(fd);
lib/libnpf/npf.c
1297
npf_table_replace(int fd, nl_table_t *tl, npf_error_t *errinfo)
lib/libnpf/npf.c
1306
error = _npf_xfer_fd(fd, IOC_NPF_TABLE_REPLACE, tl->table_dict, &resp);
lib/libnpf/npf.c
1388
_npf_conn_lookup(int fd, const int af, npf_addr_t *addr[2], in_port_t port[2],
lib/libnpf/npf.c
1429
error = _npf_xfer_fd(fd, IOC_NPF_CONN_LOOKUP, req, &resp);
lib/libnpf/npf.c
1459
npf_nat_lookup(int fd, int af, npf_addr_t *addr[2], in_port_t port[2],
lib/libnpf/npf.c
1465
error = _npf_conn_lookup(fd, af, addr, port, proto, NULL, 0);
lib/libnpf/npf.c
1517
npf_conn_list(int fd, npf_conn_func_t func, void *arg)
lib/libnpf/npf.c
1523
ncf = npf_config_retrieve(fd);
lib/libnpf/npf.c
1566
_npf_config_dump(nl_config_t *ncf, int fd)
lib/libnpf/npf.c
1569
nvlist_dump(ncf->ncf_dict, fd);
lib/libnpf/npf.c
254
_npf_xfer_fd(int fd, unsigned long cmd, nvlist_t *req, nvlist_t **resp)
lib/libnpf/npf.c
272
if (fstat(fd, &st) == -1) {
lib/libnpf/npf.c
278
if (nvlist_send(fd, req) == -1) {
lib/libnpf/npf.c
281
if (resp && (*resp = nvlist_recv(fd, 0)) == NULL) {
lib/libnpf/npf.c
289
if (ioctl(fd, IOC_NPF_VERSION, &kernver) == -1) {
lib/libnpf/npf.c
296
if (nvlist_xfer_ioctl(fd, cmd, req, resp) == -1) {
lib/libnpf/npf.c
320
_npf_xfer_fd_errno(int fd, unsigned long cmd, nvlist_t *req)
lib/libnpf/npf.c
325
error = _npf_xfer_fd(fd, cmd, req, &resp);
lib/libnpf/npf.c
353
npf_config_submit(nl_config_t *ncf, int fd, npf_error_t *errinfo)
lib/libnpf/npf.c
361
error = _npf_xfer_fd(fd, IOC_NPF_LOAD, ncf->ncf_dict, &resp);
lib/libnpf/npf.c
371
npf_config_retrieve(int fd)
lib/libnpf/npf.c
383
error = _npf_xfer_fd(fd, IOC_NPF_SAVE, req, &resp);
lib/libnpf/npf.c
421
npf_config_flush(int fd)
lib/libnpf/npf.c
432
error = npf_config_submit(ncf, fd, &errinfo);
lib/libnpf/npf.c
563
npf_ruleset_add(int fd, const char *rname, nl_rule_t *rl, uint64_t *id)
lib/libnpf/npf.c
580
error = _npf_xfer_fd(fd, IOC_NPF_RULE, rule_nvl, &resp);
lib/libnpf/npf.c
590
npf_ruleset_remove(int fd, const char *rname, uint64_t id)
lib/libnpf/npf.c
601
error = _npf_xfer_fd_errno(fd, IOC_NPF_RULE, rule_nvl);
lib/libnpf/npf.c
607
npf_ruleset_remkey(int fd, const char *rname, const void *key, size_t len)
lib/libnpf/npf.c
618
error = _npf_xfer_fd_errno(fd, IOC_NPF_RULE, rule_nvl);
lib/libnpf/npf.c
624
npf_ruleset_flush(int fd, const char *rname)
lib/libnpf/npf.c
634
error = _npf_xfer_fd_errno(fd, IOC_NPF_RULE, rule_nvl);
lib/libnpf/npf.c
885
_npf_ruleset_list(int fd, const char *rname, nl_config_t *ncf)
lib/libnpf/npf.c
896
error = _npf_xfer_fd(fd, IOC_NPF_RULE, req, &resp);
lib/libossaudio/oss3_mixer.c
103
retval = ioctl(fd, AUDIO_MIXER_READ, &mc);
lib/libossaudio/oss3_mixer.c
156
return ioctl(fd, AUDIO_MIXER_WRITE, &mc);
lib/libossaudio/oss3_mixer.c
170
retval = ioctl(fd, AUDIO_MIXER_READ, &mc);
lib/libossaudio/oss3_mixer.c
209
retval = ioctl(fd, AUDIO_MIXER_WRITE, &mc);
lib/libossaudio/oss3_mixer.c
232
getdevinfo(int fd)
lib/libossaudio/oss3_mixer.c
270
if (fstat(fd, &sb) < 0)
lib/libossaudio/oss3_mixer.c
291
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &mi) < 0)
lib/libossaudio/oss3_mixer.c
320
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &mi) < 0)
lib/libossaudio/oss3_mixer.c
56
_oss3_mixer_ioctl(int fd, unsigned long com, void *argp)
lib/libossaudio/oss3_mixer.c
68
di = getdevinfo(fd);
lib/libossaudio/oss3_mixer.c
78
error = ioctl(fd, AUDIO_GETDEV, &adev);
lib/libossaudio/oss3_mixer.c
95
retval = ioctl(fd, AUDIO_MIXER_READ, &mc);
lib/libossaudio/oss4_global.c
35
_oss4_global_ioctl(int fd, unsigned long com, void *argp)
lib/libossaudio/oss4_mixer.c
181
newfd = fd;
lib/libossaudio/oss4_mixer.c
185
if (newfd != fd)
lib/libossaudio/oss4_mixer.c
45
_oss4_mixer_ioctl(int fd, unsigned long com, void *argp)
lib/libossaudio/oss4_mixer.c
630
get_mixer_control_count(int fd)
lib/libossaudio/oss4_mixer.c
637
} while (ioctl(fd, AUDIO_MIXER_DEVINFO, &mdi) != -1);
lib/libossaudio/oss4_mixer.c
97
fstat(fd, &tmpstat);
lib/libossaudio/oss_caps.c
35
_oss_get_caps(int fd, int *out)
lib/libossaudio/oss_caps.c
41
if (ioctl(fd, AUDIO_GETPROPS, &props) < 0)
lib/libossaudio/oss_caps.c
49
if (ioctl(fd, AUDIO_GETFORMAT, &info) != -1) {
lib/libossaudio/oss_dsp.c
103
if (ioctl(fd, AUDIO_RERROR, &rerrors) != -1) {
lib/libossaudio/oss_dsp.c
127
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
130
retval = ioctl(fd, AUDIO_GETFORMAT, &hwfmt);
lib/libossaudio/oss_dsp.c
149
retval = ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
154
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
163
(void) ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
164
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
170
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
186
retval = ioctl(fd, AUDIO_GETFORMAT, &hwfmt);
lib/libossaudio/oss_dsp.c
189
retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
205
retval = ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
210
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
226
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
229
set_channels(fd, tmpinfo.mode, INTARG);
lib/libossaudio/oss_dsp.c
232
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
242
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
251
retval = ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
263
(void) ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
264
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
275
ioctl(fd, AUDIO_GETENC, &tmpenc) == 0;
lib/libossaudio/oss_dsp.c
285
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
297
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
309
retval = ioctl(fd, FIONBIO, &idat);
lib/libossaudio/oss_dsp.c
314
retval = _oss_get_caps(fd, (int *)argp);
lib/libossaudio/oss_dsp.c
319
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
327
(void)ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
330
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
341
retval = ioctl(fd, AUDIO_GETIOFFS, &tmpoffs);
lib/libossaudio/oss_dsp.c
350
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
364
retval = ioctl(fd, AUDIO_GETOOFFS, &tmpoffs);
lib/libossaudio/oss_dsp.c
373
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
387
set_vol(fd, INTARG, false);
lib/libossaudio/oss_dsp.c
390
retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
396
set_vol(fd, INTARG, true);
lib/libossaudio/oss_dsp.c
399
retval = ioctl(fd, AUDIO_GETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
410
retval = ioctl(fd, AUDIO_SETFD, &idat);
lib/libossaudio/oss_dsp.c
415
retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
474
set_vol(int fd, int volume, bool record)
lib/libossaudio/oss_dsp.c
498
(void)ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
50
_oss_dsp_ioctl(int fd, unsigned long com, void *argp)
lib/libossaudio/oss_dsp.c
519
set_channels(int fd, int mode, int nchannels)
lib/libossaudio/oss_dsp.c
523
if (ioctl(fd, AUDIO_GETFORMAT, &hwfmt) < 0) {
lib/libossaudio/oss_dsp.c
531
if (ioctl(fd, AUDIO_SETINFO, &tmpinfo) < 0) {
lib/libossaudio/oss_dsp.c
535
(void)ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
542
if (ioctl(fd, AUDIO_SETINFO, &tmpinfo) < 0) {
lib/libossaudio/oss_dsp.c
546
(void)ioctl(fd, AUDIO_SETINFO, &tmpinfo);
lib/libossaudio/oss_dsp.c
74
retval = ioctl(fd, AUDIO_FLUSH, 0);
lib/libossaudio/oss_dsp.c
79
retval = ioctl(fd, AUDIO_DRAIN, 0);
lib/libossaudio/oss_dsp.c
90
if ((retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo)) < 0)
lib/libossaudio/oss_dsp.c
96
if (ioctl(fd, AUDIO_PERROR, &perrors) != -1) {
lib/libossaudio/oss_ioctl.c
17
return _oss_dsp_ioctl(fd, com, argp);
lib/libossaudio/oss_ioctl.c
19
return _oss3_mixer_ioctl(fd, com, argp);
lib/libossaudio/oss_ioctl.c
21
return _oss4_mixer_ioctl(fd, com, argp);
lib/libossaudio/oss_ioctl.c
23
return _oss4_global_ioctl(fd, com, argp);
lib/libossaudio/oss_ioctl.c
25
return ioctl(fd, com, argp);
lib/libossaudio/oss_ioctl.c
7
_oss_ioctl(int fd, unsigned long com, ...)
lib/libpam/modules/pam_lastlog/pam_lastlog.c
354
int fd;
lib/libpam/modules/pam_lastlog/pam_lastlog.c
356
if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) == -1) {
lib/libpam/modules/pam_lastlog/pam_lastlog.c
361
(void)lseek(fd, (off_t)(pwd->pw_uid * sizeof(ll)), SEEK_SET);
lib/libpam/modules/pam_lastlog/pam_lastlog.c
364
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&
lib/libpam/modules/pam_lastlog/pam_lastlog.c
369
(void)lseek(fd, (off_t)(pwd->pw_uid * sizeof(ll)), SEEK_SET);
lib/libpam/modules/pam_lastlog/pam_lastlog.c
380
(void)write(fd, &ll, sizeof(ll));
lib/libpam/modules/pam_lastlog/pam_lastlog.c
381
(void)close(fd);
lib/libpam/modules/pam_nologin/pam_nologin.c
112
if ((fd = open(nologin, O_RDONLY, 0)) == -1) {
lib/libpam/modules/pam_nologin/pam_nologin.c
130
if (fstat(fd, &st) < 0) {
lib/libpam/modules/pam_nologin/pam_nologin.c
131
close(fd);
lib/libpam/modules/pam_nologin/pam_nologin.c
138
read(fd, mtmp, len);
lib/libpam/modules/pam_nologin/pam_nologin.c
143
close(fd);
lib/libpam/modules/pam_nologin/pam_nologin.c
75
int retval, fd;
lib/libpam/modules/pam_ssh/pam_ssh.c
305
int fd;
lib/libpam/modules/pam_ssh/pam_ssh.c
331
for (fd = 3; fd < getdtablesize(); ++fd)
lib/libpam/modules/pam_ssh/pam_ssh.c
332
(void)close(fd);
lib/libpci/pci_bus.c
58
pcibus_conf_read(int fd, u_int bus, u_int device, u_int func, u_int reg,
lib/libpci/pci_bus.c
69
rv = ioctl(fd, PCI_IOC_BDF_CFGREAD, &bdfr);
lib/libpci/pci_bus.c
85
pcibus_conf_write(int fd, u_int bus, u_int device, u_int func, u_int reg,
lib/libpci/pci_bus.c
96
return (ioctl(fd, PCI_IOC_BDF_CFGWRITE, &bdfr));
lib/libpci/pci_device.c
58
pcidev_conf_read(int fd, u_int reg, uint32_t *valp)
lib/libpci/pci_device.c
65
rv = ioctl(fd, PCI_IOC_CFGREAD, &r);
lib/libpci/pci_device.c
81
pcidev_conf_write(int fd, u_int reg, uint32_t val)
lib/libpci/pci_device.c
88
return (ioctl(fd, PCI_IOC_CFGWRITE, &r));
lib/libpci/pci_drvname.c
46
pci_drvname(int fd, u_int device, u_int func, char *name, size_t len)
lib/libpci/pci_drvname.c
54
rv = ioctl(fd, PCI_IOC_DRVNAME, &drvname);
lib/libpci/pci_drvname.c
68
pci_drvnameonbus(int fd, u_int bus, u_int device, u_int func, char *name,
lib/libpci/pci_drvname.c
78
rv = ioctl(fd, PCI_IOC_DRVNAMEONBUS, &drvname);
lib/libperfuse/ops.c
2474
struct fuse_dirent *fd;
lib/libperfuse/ops.c
2575
if (foh_len < sizeof(*foh) + sizeof(*fd)) {
lib/libperfuse/ops.c
2583
fd = GET_OUTPAYLOAD(ps, pm, fuse_dirent);
lib/libperfuse/ops.c
2592
(void)memcpy(afdp, fd, fd_len);
lib/libperfuse/ops.c
2600
pnd->pnd_fd_cookie = readdir_last_cookie(fd, fd_len);
lib/libperfuse/ops.c
570
readdir_last_cookie(struct fuse_dirent *fd, size_t fd_len)
lib/libperfuse/ops.c
577
len = FUSE_DIRENT_ALIGN(sizeof(*fd) + fd->namelen);
lib/libperfuse/ops.c
583
ndp = (char *)(void *)fd + (size_t)len;
lib/libperfuse/ops.c
584
fd = (struct fuse_dirent *)(void *)ndp;
lib/libperfuse/ops.c
587
return fd->off;
lib/libperfuse/ops.c
592
struct fuse_dirent *fd, size_t fd_len)
lib/libperfuse/ops.c
601
fd_base = fd;
lib/libperfuse/ops.c
612
reclen = _DIRENT_RECLEN(dents, fd->namelen);
lib/libperfuse/ops.c
643
strncpy(name, fd->name, fd->namelen);
lib/libperfuse/ops.c
644
name[fd->namelen] = '\0';
lib/libperfuse/ops.c
650
if (fd->ino == PERFUSE_UNKNOWN_INO) {
lib/libperfuse/ops.c
660
fd->ino = FUSE_ROOT_ID;
lib/libperfuse/ops.c
662
fd->ino = pnd->pnd_parent_nodeid;
lib/libperfuse/ops.c
664
fd->ino = pnd->pnd_nodeid;
lib/libperfuse/ops.c
674
fd->ino = pn->pn_va.va_fileid;
lib/libperfuse/ops.c
680
dents->d_fileno = fd->ino;
lib/libperfuse/ops.c
682
dents->d_namlen = fd->namelen;
lib/libperfuse/ops.c
683
dents->d_type = fd->type;
lib/libperfuse/ops.c
684
strlcpy(dents->d_name, name, fd->namelen + 1);
lib/libperfuse/ops.c
702
len = FUSE_DIRENT_ALIGN(sizeof(*fd) + fd->namelen);
lib/libperfuse/ops.c
726
fd = (struct fuse_dirent *)(void *)ndp;
lib/libperfuse/perfuse.c
124
int fd = -1;
lib/libperfuse/perfuse.c
133
fd = atoi(opt + strlen(fdopt));
lib/libperfuse/perfuse.c
141
if (fd == -1)
lib/libperfuse/perfuse.c
145
return fd;
lib/libpthread/pthread_cancelstub.c
247
fcntl(int fd, int cmd, ...)
lib/libpthread/pthread_cancelstub.c
256
retval = _sys_fcntl(fd, cmd, va_arg(ap, void *));
lib/libpthread/pthread_cancelstub.c
306
__kevent100(int fd, const struct kevent *ev, size_t nev, struct kevent *rev,
lib/libpthread/pthread_cancelstub.c
314
retval = _sys___kevent100(fd, ev, nev, rev, nrev, ts);
lib/libpthread/pthread_cancelstub.c
458
openat(int fd, const char *path, int flags, ...)
lib/libpthread/pthread_cancelstub.c
467
retval = _sys_openat(fd, path, flags, va_arg(ap, mode_t));
lib/libpthread/pthread_cancelstub.c
737
tcdrain(int fd)
lib/libpthread/pthread_cancelstub.c
744
retval = ioctl(fd, TIOCDRAIN, 0);
lib/libpuffs/framebuf.c
1016
puffs_framev_removefd(struct puffs_usermount *pu, int fd, int error)
lib/libpuffs/framebuf.c
1020
fio = getfiobyfd(pu, fd);
lib/libpuffs/framebuf.c
1030
puffs_framev_removeonclose(struct puffs_usermount *pu, int fd, int what)
lib/libpuffs/framebuf.c
1034
(void) puffs_framev_removefd(pu, fd, ECONNRESET);
lib/libpuffs/framebuf.c
1038
puffs_framev_unmountonclose(struct puffs_usermount *pu, int fd, int what)
lib/libpuffs/framebuf.c
1042
puffs_framev_removeonclose(pu, fd, what);
lib/libpuffs/framebuf.c
341
#define GETFIO(fd) \
lib/libpuffs/framebuf.c
343
fio = getfiobyfd(pu, fd); \
lib/libpuffs/framebuf.c
355
puffs_framev_enqueue_cc(struct puffs_cc *pcc, int fd,
lib/libpuffs/framebuf.c
368
GETFIO(fd);
lib/libpuffs/framebuf.c
393
puffs_framev_enqueue_cb(struct puffs_usermount *pu, int fd,
lib/libpuffs/framebuf.c
400
GETFIO(fd);
lib/libpuffs/framebuf.c
418
puffs_framev_enqueue_justsend(struct puffs_usermount *pu, int fd,
lib/libpuffs/framebuf.c
425
GETFIO(fd);
lib/libpuffs/framebuf.c
446
puffs_framev_enqueue_directreceive(struct puffs_cc *pcc, int fd,
lib/libpuffs/framebuf.c
454
fio = getfiobyfd(pu, fd);
lib/libpuffs/framebuf.c
482
puffs_framev_enqueue_directsend(struct puffs_cc *pcc, int fd,
lib/libpuffs/framebuf.c
493
GETFIO(fd);
lib/libpuffs/framebuf.c
535
puffs_framev_enqueue_waitevent(struct puffs_cc *pcc, int fd, int *what)
lib/libpuffs/framebuf.c
550
fio = getfiobyfd(pu, fd);
lib/libpuffs/framebuf.c
561
EV_SET(&kev, fd, EVFILT_READ, EV_ENABLE, 0, 0, fio);
lib/libpuffs/framebuf.c
579
EV_SET(&kev, fd, EVFILT_READ, EV_DISABLE, 0, 0, fio);
lib/libpuffs/framebuf.c
777
puffs__framev_addfd_ctrl(struct puffs_usermount *pu, int fd, int what,
lib/libpuffs/framebuf.c
795
fio->io_fd = fd;
lib/libpuffs/framebuf.c
810
if (fstat(fd, &st) == -1)
lib/libpuffs/framebuf.c
812
EV_SET(&kev[nf], fd, EVFILT_READ, EV_ADD|readenable, 0, 0, fio);
lib/libpuffs/framebuf.c
815
EV_SET(&kev[nf], fd, EVFILT_WRITE,
lib/libpuffs/framebuf.c
838
puffs_framev_addfd(struct puffs_usermount *pu, int fd, int what)
lib/libpuffs/framebuf.c
841
return puffs__framev_addfd_ctrl(pu, fd, what,
lib/libpuffs/framebuf.c
852
puffs_framev_enablefd(struct puffs_usermount *pu, int fd, int what)
lib/libpuffs/framebuf.c
860
fio = getfiobyfd(pu, fd);
lib/libpuffs/framebuf.c
868
EV_SET(&kev, fd, EVFILT_READ, EV_ENABLE, 0, 0, fio);
lib/libpuffs/framebuf.c
883
puffs_framev_disablefd(struct puffs_usermount *pu, int fd, int what)
lib/libpuffs/framebuf.c
892
fio = getfiobyfd(pu, fd);
lib/libpuffs/framebuf.c
900
EV_SET(&kev[0], fd, EVFILT_READ, EV_DISABLE, 0, 0, fio);
lib/libpuffs/framebuf.c
904
EV_SET(&kev[1], fd, EVFILT_WRITE, EV_DISABLE, 0, 0, fio);
lib/libpuffs/framebuf.c
92
getfiobyfd(struct puffs_usermount *pu, int fd)
lib/libpuffs/framebuf.c
97
if (fio->io_fd == fd)
lib/libpuffs/null.c
101
int fd;
lib/libpuffs/null.c
103
fd = open(path, O_WRONLY);
lib/libpuffs/null.c
104
if (fd == -1) {
lib/libpuffs/null.c
113
fd = open(path, O_WRONLY);
lib/libpuffs/null.c
114
if (fd == -1)
lib/libpuffs/null.c
124
return fd;
lib/libpuffs/null.c
340
int fd, rv;
lib/libpuffs/null.c
342
fd = open(PCNPATH(pcn), O_RDWR | O_CREAT | O_TRUNC);
lib/libpuffs/null.c
343
if (fd == -1)
lib/libpuffs/null.c
345
close(fd);
lib/libpuffs/null.c
411
int fd, rv;
lib/libpuffs/null.c
422
fd = dirfd(dirp);
lib/libpuffs/null.c
423
if (fd == -1) {
lib/libpuffs/null.c
429
if (fsync(fd) == -1)
lib/libpuffs/null.c
434
fd = writeableopen(PNPATH(pn));
lib/libpuffs/null.c
435
if (fd == -1)
lib/libpuffs/null.c
445
if (fsync_range(fd, fflags, offlo, offhi - offlo) == -1)
lib/libpuffs/null.c
448
close(fd);
lib/libpuffs/null.c
634
int fd, rv;
lib/libpuffs/null.c
637
fd = open(PNPATH(pn), O_RDONLY);
lib/libpuffs/null.c
638
if (fd == -1)
lib/libpuffs/null.c
640
off = lseek(fd, offset, SEEK_SET);
lib/libpuffs/null.c
646
n = read(fd, buf, *buflen);
lib/libpuffs/null.c
653
close(fd);
lib/libpuffs/null.c
666
int fd, rv;
lib/libpuffs/null.c
669
fd = writeableopen(PNPATH(pn));
lib/libpuffs/null.c
670
if (fd == -1)
lib/libpuffs/null.c
673
off = lseek(fd, offset, SEEK_SET);
lib/libpuffs/null.c
679
n = write(fd, buf, *buflen);
lib/libpuffs/null.c
686
close(fd);
lib/libpuffs/puffs.c
442
int parent, value, fd;
lib/libpuffs/puffs.c
485
fd = open(_PATH_DEVNULL, O_RDWR, 0);
lib/libpuffs/puffs.c
486
if (fd == -1)
lib/libpuffs/puffs.c
488
dup2(fd, STDIN_FILENO);
lib/libpuffs/puffs.c
489
dup2(fd, STDOUT_FILENO);
lib/libpuffs/puffs.c
490
dup2(fd, STDERR_FILENO);
lib/libpuffs/puffs.c
491
if (fd > STDERR_FILENO)
lib/libpuffs/puffs.c
492
close(fd);
lib/libpuffs/puffs.c
521
int rv, fd, sverrno;
lib/libpuffs/puffs.c
599
fd = open(_PATH_PUFFS, O_RDWR);
lib/libpuffs/puffs.c
600
if (fd == -1) {
lib/libpuffs/puffs.c
605
if (fd <= 2)
lib/libpuffs/puffs.c
607
"what you want?", __func__, fd);
lib/libpuffs/puffs.c
609
pu->pu_kargp->pa_fd = pu->pu_fd = fd;
lib/libpuffs/requests.c
119
int fd, int *done)
lib/libpuffs/requests.c
172
n = send(fd, win, winlen, MSG_NOSIGNAL);
lib/libpuffs/requests.c
174
n = write(fd, win, winlen);
lib/libpuffs/requests.c
60
int fd, int *done)
lib/libpuffs/requests.c
90
n = read(fd, win, winlen);
lib/libquota/quota_oldfiles.c
364
int fd;
lib/libquota/quota_oldfiles.c
366
fd = open(path, O_RDWR);
lib/libquota/quota_oldfiles.c
367
if (fd < 0 && (errno == EACCES || errno == EROFS)) {
lib/libquota/quota_oldfiles.c
368
fd = open(path, O_RDONLY);
lib/libquota/quota_oldfiles.c
369
if (fd < 0) {
lib/libquota/quota_oldfiles.c
373
*fd_ret = fd;
lib/libradius/radlib.c
391
if (h->fd != -1)
lib/libradius/radlib.c
392
close(h->fd);
lib/libradius/radlib.c
557
rad_continue_send_request(struct rad_handle *h, int selected, int *fd,
lib/libradius/radlib.c
568
rv = recvfrom(h->fd, h->response, (size_t)MSGSIZE,
lib/libradius/radlib.c
608
n = sendto(h->fd, h->request, h->req_len, 0,
lib/libradius/radlib.c
623
*fd = h->fd;
lib/libradius/radlib.c
709
rad_init_send_request(struct rad_handle *h, int *fd, struct timeval *tv)
lib/libradius/radlib.c
714
if (h->fd == -1) {
lib/libradius/radlib.c
717
if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
lib/libradius/radlib.c
726
if (bind(h->fd, (const struct sockaddr *)(void *)&saddr,
lib/libradius/radlib.c
729
close(h->fd);
lib/libradius/radlib.c
730
h->fd = -1;
lib/libradius/radlib.c
778
return rad_continue_send_request(h, 0, fd, tv);
lib/libradius/radlib.c
794
h->fd = -1;
lib/libradius/radlib.c
927
int fd;
lib/libradius/radlib.c
930
n = rad_init_send_request(h, &fd, &tv);
lib/libradius/radlib.c
942
FD_SET(fd, &readfds);
lib/libradius/radlib.c
944
n = select(fd + 1, &readfds, NULL, NULL, &tv);
lib/libradius/radlib.c
951
if (!FD_ISSET(fd, &readfds)) {
lib/libradius/radlib.c
960
n = rad_continue_send_request(h, n, &fd, &tv);
lib/libradius/radlib_private.h
75
int fd; /* Socket file descriptor */
lib/librefuse/fuse.h
314
fuse_new(int fd, int flags, const struct fuse_operations *op) {
lib/librefuse/fuse.h
315
return fuse_new_v11(fd, flags, op, _FUSE_OP_VERSION__);
lib/librefuse/fuse.h
334
fuse_new(int fd, const char *opts, const struct fuse_operations *op) {
lib/librefuse/fuse.h
335
return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
lib/librefuse/fuse.h
354
fuse_new(int fd, const char *opts, const struct fuse_operations *op) {
lib/librefuse/fuse.h
355
return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
lib/librefuse/fuse.h
362
char **mountpoint, int *multithreaded, int *fd) {
lib/librefuse/fuse.h
364
mountpoint, multithreaded, fd);
lib/librefuse/fuse.h
383
fuse_new(int fd, const char *opts, const struct fuse_operations *op,
lib/librefuse/fuse.h
385
return fuse_new_v21(fd, opts, op, _FUSE_OP_VERSION__, NULL);
lib/librefuse/fuse.h
392
char **mountpoint, int *multithreaded, int *fd) {
lib/librefuse/fuse.h
394
mountpoint, multithreaded, fd);
lib/librefuse/fuse.h
413
fuse_new(int fd, struct fuse_args *args, const struct fuse_operations *op,
lib/librefuse/fuse.h
415
return fuse_new_v25(fd, args, op, _FUSE_OP_VERSION__, NULL);
lib/librefuse/fuse.h
422
char **mountpoint, int *multithreaded, int *fd) {
lib/librefuse/fuse.h
424
mountpoint, multithreaded, fd);
lib/librefuse/refuse/buf.c
126
n_wrote = pwrite(dst->fd, (uint8_t*)src->mem + src_off, len,
lib/librefuse/refuse/buf.c
129
n_wrote = write(dst->fd, (uint8_t*)src->mem + src_off, len);
lib/librefuse/refuse/buf.c
81
n_read = pread(src->fd, (uint8_t*)dst->mem + dst_off, len,
lib/librefuse/refuse/buf.c
84
n_read = read(src->fd, (uint8_t*)dst->mem + dst_off, len);
lib/librefuse/refuse/buf.h
68
int fd;
lib/librefuse/refuse/v11.c
148
fuse_new_v11(int fd, int flags, const void *op, int op_version) {
lib/librefuse/refuse/v11.c
155
return fuse_new_v21(fd, opts, op, op_version, NULL);
lib/librefuse/refuse/v11.h
80
struct fuse *fuse_new_v11(int fd, int flags, const void *op, int op_version);
lib/librefuse/refuse/v21.c
64
fuse_new_v21(int fd, const char *opts, const void *op,
lib/librefuse/refuse/v21.c
70
chan = fuse_chan_peek(fd);
lib/librefuse/refuse/v21.c
72
warnx("%s: invalid channel: %d", __func__, fd);
lib/librefuse/refuse/v21.h
79
struct fuse *fuse_new_v21(int fd, const char *opts, const void *op,
lib/librefuse/refuse/v22.c
41
char **mountpoint, int *multithreaded, int *fd) {
lib/librefuse/refuse/v22.c
58
*fd = -1;
lib/librefuse/refuse/v22.c
64
int fd __attribute__((__unused__)),
lib/librefuse/refuse/v22.h
80
char **mountpoint, int *multithreaded, int *fd);
lib/librefuse/refuse/v22.h
83
void fuse_teardown_v22(struct fuse *fuse, int fd, char *mountpoint);
lib/librefuse/refuse/v25.c
114
return fuse_new_v21(fd, NULL, op, op_version, user_data);
lib/librefuse/refuse/v25.c
80
fuse_new_v25(int fd, struct fuse_args *args, const void *op,
lib/librefuse/refuse/v25.c
87
chan = fuse_chan_peek(fd);
lib/librefuse/refuse/v25.c
89
warnx("%s: invalid channel: %d", __func__, fd);
lib/librefuse/refuse/v25.h
92
struct fuse *fuse_new_v25(int fd, struct fuse_args *args, const void *op,
lib/librmt/rmtlib.c
630
int fd;
lib/librmt/rmtlib.c
640
fd = _rmt_open(path, oflag, (int)mode);
lib/librmt/rmtlib.c
642
return (fd == -1) ? -1 : (fd + REM_BIAS);
lib/librmt/rmtlib.c
671
isrmt(int fd)
lib/librmt/rmtlib.c
673
int unbias = fd - REM_BIAS;
lib/librmt/rmtlib.c
675
return (fd >= REM_BIAS) && unbias < MAXUNIT &&
lib/librmt/rmtlib.c
79
#define READ(fd) (Ctp[fd][0])
lib/librmt/rmtlib.c
80
#define WRITE(fd) (Ptc[fd][1])
lib/librmt/rmtlib.c
846
rmtfcntl(int fd, int cmd, ...)
lib/librmt/rmtlib.c
857
if (isrmt(fd)) {
lib/librmt/rmtlib.c
861
return fcntl(fd, cmd, arg);
lib/librmt/rmtlib.c
870
rmtisatty(int fd)
lib/librmt/rmtlib.c
873
if (isrmt(fd))
lib/librmt/rmtlib.c
876
return isatty(fd);
lib/librt/shm.c
65
int fd;
lib/librt/shm.c
69
fd = open(SHMFS_DIR_PATH, O_DIRECTORY|O_RDONLY);
lib/librt/shm.c
70
if (fd == -1)
lib/librt/shm.c
73
if (fstatvfs1(fd, &sv, ST_NOWAIT) == -1)
lib/librt/shm.c
79
if (fstat(fd, &st) == -1)
lib/librt/shm.c
88
close(fd);
lib/librumpclient/rumpclient.c
1091
int fd = *fdp;
lib/librumpclient/rumpclient.c
1098
for (; fd <= untilfd; fd++) {
lib/librumpclient/rumpclient.c
1099
if (fd == clispc.spc_fd || fd == holyfd)
lib/librumpclient/rumpclient.c
1101
(void)host_close(fd);
lib/librumpclient/rumpclient.c
1103
*fdp = fd;
lib/librumpclient/rumpclient.c
1108
if (fd == clispc.spc_fd) {
lib/librumpclient/rumpclient.c
1135
if (holyfd != -1 && fd == holyfd) {
lib/librumpclient/rumpclient.c
1244
int fd = open("/dev/null", O_RDWR);
lib/librumpclient/rumpclient.c
1245
dup2(fd, 0);
lib/librumpclient/rumpclient.c
1246
dup2(fd, 1);
lib/librumpclient/rumpclient.c
1247
dup2(fd, 2);
lib/librumpclient/rumpclient.c
1248
if (fd > 2)
lib/librumpclient/rumpclient.c
1249
close(fd);
lib/librumpclient/rumpclient.c
286
pfd[0].fd = clispc.spc_fd;
lib/librumpclient/rumpclient.c
288
pfd[1].fd = holyfd;
lib/librumpclient/rumpclient.c
406
int fd = open("/proc/self/comm", O_RDONLY);
lib/librumpclient/rumpclient.c
407
if (fd == -1) {
lib/librumpclient/rumpclient.c
413
if (read(fd, commname, sizeof(commname)) > 0) {
lib/librumpclient/rumpclient.c
423
close(fd);
lib/librumpclient/rumpclient.c
706
int i, fd;
lib/librumpclient/rumpclient.c
709
if ((fd = dupgood(host_kqueue(), 0)) == -1) {
lib/librumpclient/rumpclient.c
719
if (host_kevent(fd, kev, NSIG+1, NULL, 0, NULL) == -1) {
lib/librumpclient/rumpclient.c
721
host_close(fd);
lib/librumpclient/rumpclient.c
725
return fd;
lib/librumphijack/hijack.c
1045
fd_rump2host(int fd)
lib/librumphijack/hijack.c
1048
if (fd == -1)
lib/librumphijack/hijack.c
1049
return fd;
lib/librumphijack/hijack.c
1050
return fd + hijack_fdoff;
lib/librumphijack/hijack.c
1054
fd_rump2host_withdup(int fd)
lib/librumphijack/hijack.c
1058
_DIAGASSERT(fd != -1);
lib/librumphijack/hijack.c
1059
hfd = unmapdup2(fd);
lib/librumphijack/hijack.c
1064
return fd_rump2host(fd);
lib/librumphijack/hijack.c
1068
fd_host2rump(int fd)
lib/librumphijack/hijack.c
1070
if (!isdup2d(fd))
lib/librumphijack/hijack.c
1071
return fd - hijack_fdoff;
lib/librumphijack/hijack.c
1073
return mapdup2(fd);
lib/librumphijack/hijack.c
1077
fd_isrump(int fd)
lib/librumphijack/hijack.c
1080
return isdup2d(fd) || fd >= hijack_fdoff;
lib/librumphijack/hijack.c
1168
fd_host2host(int fd)
lib/librumphijack/hijack.c
1174
if (fd >= hijack_fdoff) {
lib/librumphijack/hijack.c
1175
op_close(fd);
lib/librumphijack/hijack.c
1180
for (i = 1; isdup2d(fd); i++) {
lib/librumphijack/hijack.c
1181
ofd = fd;
lib/librumphijack/hijack.c
1182
fd = op_fcntl(ofd, F_DUPFD, i);
lib/librumphijack/hijack.c
1186
return fd;
lib/librumphijack/hijack.c
1196
int fd, rfd;
lib/librumphijack/hijack.c
1211
fd = op_open(path, flags, va_arg(ap, mode_t));
lib/librumphijack/hijack.c
1215
rfd = fd_rump2host(fd);
lib/librumphijack/hijack.c
1217
rfd = fd_host2host(fd);
lib/librumphijack/hijack.c
1219
DPRINTF((" <- %d/%d (%s)\n", fd, rfd, whichfd(rfd)));
lib/librumphijack/hijack.c
1246
fchdir(int fd)
lib/librumphijack/hijack.c
1252
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1255
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1261
rv = op_fchdir(fd);
lib/librumphijack/hijack.c
1416
int fd, rfd;
lib/librumphijack/hijack.c
1425
fd = op_socket(domain, type, protocol);
lib/librumphijack/hijack.c
1428
rfd = fd_rump2host(fd);
lib/librumphijack/hijack.c
1430
rfd = fd_host2host(fd);
lib/librumphijack/hijack.c
1431
DPRINTF(("socket <- %d/%d (%s)\n", fd, rfd, whichfd(rfd)));
lib/librumphijack/hijack.c
1440
int fd, rfd;
lib/librumphijack/hijack.c
1452
fd = op_accept(s, addr, addrlen);
lib/librumphijack/hijack.c
1453
if (fd != -1 && isrump)
lib/librumphijack/hijack.c
1454
rfd = fd_rump2host(fd);
lib/librumphijack/hijack.c
1456
rfd = fd_host2host(fd);
lib/librumphijack/hijack.c
1458
DPRINTF((" <- %d/%d (%s)\n", fd, rfd, whichfd(rfd)));
lib/librumphijack/hijack.c
1470
int fd, rfd;
lib/librumphijack/hijack.c
1482
fd = op_paccept(s, addr, addrlen, sigmask, flags);
lib/librumphijack/hijack.c
1483
if (fd != -1 && isrump)
lib/librumphijack/hijack.c
1484
rfd = fd_rump2host(fd);
lib/librumphijack/hijack.c
1486
rfd = fd_host2host(fd);
lib/librumphijack/hijack.c
1488
DPRINTF((" <- %d/%d (%s)\n", fd, rfd, whichfd(rfd)));
lib/librumphijack/hijack.c
1505
ioctl(int fd, int cmd, ...)
lib/librumphijack/hijack.c
1509
ioctl(int fd, unsigned long cmd, ...)
lib/librumphijack/hijack.c
1516
DPRINTF(("ioctl -> %d (%s)\n", fd, whichfd(fd)));
lib/librumphijack/hijack.c
1517
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1518
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1525
rv = op_ioctl(fd, cmd, va_arg(ap, void *));
lib/librumphijack/hijack.c
1532
fcntl(int fd, int cmd, ...)
lib/librumphijack/hijack.c
1538
DPRINTF(("fcntl -> %d (cmd %d)\n", fd, cmd));
lib/librumphijack/hijack.c
1546
return dodup(fd, minfd);
lib/librumphijack/hijack.c
1556
if (fd < hijack_fdoff) {
lib/librumphijack/hijack.c
1557
int closemfd = fd;
lib/librumphijack/hijack.c
1582
if (fd >= hijack_fdoff)
lib/librumphijack/hijack.c
1583
fd -= hijack_fdoff;
lib/librumphijack/hijack.c
1585
fd = 0;
lib/librumphijack/hijack.c
1586
fd = MAX(maxdup2+1, fd);
lib/librumphijack/hijack.c
1589
return rump_sys_fcntl(fd, F_CLOSEM);
lib/librumphijack/hijack.c
1600
if ((rv = rump_sys_fcntl(fd, F_MAXFD)) != -1) {
lib/librumphijack/hijack.c
1611
return fd_rump2host(fd);
lib/librumphijack/hijack.c
1614
return op_fcntl(fd, F_MAXFD);
lib/librumphijack/hijack.c
1620
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1621
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1628
rv = op_fcntl(fd, cmd, va_arg(ap, void *));
lib/librumphijack/hijack.c
1636
flock(int fd, int operation)
lib/librumphijack/hijack.c
1640
DPRINTF(("flock -> %d (operation %d)\n", fd, operation));
lib/librumphijack/hijack.c
1642
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1643
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1649
return op_flock(fd, operation);
lib/librumphijack/hijack.c
1653
close(int fd)
lib/librumphijack/hijack.c
1658
DPRINTF(("close -> %d\n", fd));
lib/librumphijack/hijack.c
1659
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1663
if (isdup2d(ofd = fd)) {
lib/librumphijack/hijack.c
1667
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1668
if (!undup2 && killdup2alias(fd)) {
lib/librumphijack/hijack.c
1673
rv = op_close(fd);
lib/librumphijack/hijack.c
1678
if (rumpclient__closenotify(&fd, RUMPCLIENT_CLOSE_CLOSE) == -1)
lib/librumphijack/hijack.c
1681
rv = op_close(fd);
lib/librumphijack/hijack.c
1691
write(int fd, const void *buf, size_t blen)
lib/librumphijack/hijack.c
1695
if (fd_isrump(fd)) {
lib/librumphijack/hijack.c
1696
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1702
return op_write(fd, buf, blen);
lib/librumphijack/hijack.c
1758
recvmsg(int fd, struct msghdr *msg, int flags)
lib/librumphijack/hijack.c
1762
const bool isrump = fd_isrump(fd);
lib/librumphijack/hijack.c
1764
DPRINTF(("%s -> %d (%s)\n", __func__, fd, whichfd(fd)));
lib/librumphijack/hijack.c
1766
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1771
ret = op_recvmsg(fd, msg, flags);
lib/librumphijack/hijack.c
1787
recv(int fd, void *buf, size_t len, int flags)
lib/librumphijack/hijack.c
1790
return recvfrom(fd, buf, len, flags, NULL, NULL);
lib/librumphijack/hijack.c
1794
send(int fd, const void *buf, size_t len, int flags)
lib/librumphijack/hijack.c
1797
return sendto(fd, buf, len, flags, NULL, 0);
lib/librumphijack/hijack.c
1801
fd_check_rump(int fd)
lib/librumphijack/hijack.c
1804
return fd_isrump(fd) ? 0 : -1;
lib/librumphijack/hijack.c
1808
fd_check_host(int fd)
lib/librumphijack/hijack.c
1811
return !fd_isrump(fd) ? 0 : -1;
lib/librumphijack/hijack.c
1815
sendmsg(int fd, const struct msghdr *msg, int flags)
lib/librumphijack/hijack.c
1818
const bool isrump = fd_isrump(fd);
lib/librumphijack/hijack.c
1821
DPRINTF(("%s -> %d (%s)\n", __func__, fd, whichfd(fd)));
lib/librumphijack/hijack.c
1835
fd = fd_host2rump(fd);
lib/librumphijack/hijack.c
1849
return op_sendmsg(fd, msg, flags);
lib/librumphijack/hijack.c
2046
pfds[j].fd = i;
lib/librumphijack/hijack.c
2051
pfds[j].fd = i;
lib/librumphijack/hijack.c
2056
pfds[j].fd = i;
lib/librumphijack/hijack.c
2098
FD_SET(pfds[i].fd, readfds);
lib/librumphijack/hijack.c
2103
FD_SET(pfds[i].fd, writefds);
lib/librumphijack/hijack.c
2108
FD_SET(pfds[i].fd, exceptfds);
lib/librumphijack/hijack.c
2137
if (fds[i].fd == -1)
lib/librumphijack/hijack.c
2140
if (fd_isrump(fds[i].fd))
lib/librumphijack/hijack.c
2153
fds[i].fd = fdadj(fds[i].fd);
lib/librumphijack/hijack.c
2246
int fd;
lib/librumphijack/hijack.c
2249
if (fds[i].fd == -1) {
lib/librumphijack/hijack.c
2250
pfd_host[i].fd = -1;
lib/librumphijack/hijack.c
2251
pfd_rump[i].fd = -1;
lib/librumphijack/hijack.c
2252
} else if (fd_isrump(fds[i].fd)) {
lib/librumphijack/hijack.c
2253
pfd_host[i].fd = -1;
lib/librumphijack/hijack.c
2254
fd = fd_host2rump(fds[i].fd);
lib/librumphijack/hijack.c
2255
if (fd == rpipe[0] || fd == rpipe[1]) {
lib/librumphijack/hijack.c
2260
pfd_rump[i].fd = fd;
lib/librumphijack/hijack.c
2263
pfd_rump[i].fd = -1;
lib/librumphijack/hijack.c
2264
fd = fds[i].fd;
lib/librumphijack/hijack.c
2265
if (fd == hpipe[0] || fd == hpipe[1]) {
lib/librumphijack/hijack.c
2270
pfd_host[i].fd = fd;
lib/librumphijack/hijack.c
2279
pfd_host[nfds].fd = hpipe[0];
lib/librumphijack/hijack.c
2281
pfd_rump[nfds].fd = rpipe[0];
lib/librumphijack/hijack.c
2319
if (pfd_rump[i].fd != -1)
lib/librumphijack/hijack.c
2327
if (pfd_host[i].fd != -1)
lib/librumphijack/hijack.c
2434
mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
lib/librumphijack/hijack.c
2437
if (flags & MAP_FILE && fd_isrump(fd)) {
lib/librumphijack/hijack.c
2444
return host_mmap(addr, len, prot, flags, fd, offset);
lib/librumphijack/hijack.c
2493
(int fd, const char *path, const struct timespec t[2], int f), \
lib/librumphijack/hijack.c
2495
(fd, path, t, f))
lib/librumphijack/hijack.c
2499
(int fd, const struct sockaddr *name, socklen_t namelen), \
lib/librumphijack/hijack.c
2501
(fd, name, namelen))
lib/librumphijack/hijack.c
2504
(int fd, const struct sockaddr *name, socklen_t namelen), \
lib/librumphijack/hijack.c
2506
(fd, name, namelen))
lib/librumphijack/hijack.c
2509
(int fd, struct sockaddr *name, socklen_t *namelen), \
lib/librumphijack/hijack.c
2511
(fd, name, namelen))
lib/librumphijack/hijack.c
2514
(int fd, struct sockaddr *name, socklen_t *namelen), \
lib/librumphijack/hijack.c
2516
(fd, name, namelen))
lib/librumphijack/hijack.c
2519
(int fd, int backlog), \
lib/librumphijack/hijack.c
2521
(fd, backlog))
lib/librumphijack/hijack.c
2524
(int fd, void *buf, size_t len, int flags, \
lib/librumphijack/hijack.c
2527
(fd, buf, len, flags, from, fromlen))
lib/librumphijack/hijack.c
2530
(int fd, const void *buf, size_t len, int flags, \
lib/librumphijack/hijack.c
2534
(fd, buf, len, flags, to, tolen))
lib/librumphijack/hijack.c
2537
(int fd, int level, int optn, void *optval, socklen_t *optlen), \
lib/librumphijack/hijack.c
2539
(fd, level, optn, optval, optlen))
lib/librumphijack/hijack.c
2542
(int fd, int level, int optn, \
lib/librumphijack/hijack.c
2545
(fd, level, optn, optval, optlen))
lib/librumphijack/hijack.c
2548
(int fd, int how), \
lib/librumphijack/hijack.c
2550
(fd, how))
lib/librumphijack/hijack.c
2553
(int fd, void *buf, size_t buflen), \
lib/librumphijack/hijack.c
2555
(fd, buf, buflen))
lib/librumphijack/hijack.c
2563
(int fd, const struct iovec *iov, int iovcnt), \
lib/librumphijack/hijack.c
2565
(fd, iov, iovcnt))
lib/librumphijack/hijack.c
2568
(int fd, void *buf, size_t nbytes, off_t offset), \
lib/librumphijack/hijack.c
2570
(fd, buf, nbytes, offset))
lib/librumphijack/hijack.c
2573
(int fd, const struct iovec *iov, int iovcnt, off_t offset), \
lib/librumphijack/hijack.c
2575
(fd, iov, iovcnt, offset))
lib/librumphijack/hijack.c
2578
(int fd, const struct iovec *iov, int iovcnt), \
lib/librumphijack/hijack.c
2580
(fd, iov, iovcnt))
lib/librumphijack/hijack.c
2583
(int fd, const void *buf, size_t nbytes, off_t offset), \
lib/librumphijack/hijack.c
2585
(fd, buf, nbytes, offset))
lib/librumphijack/hijack.c
2588
(int fd, const struct iovec *iov, int iovcnt, off_t offset), \
lib/librumphijack/hijack.c
2590
(fd, iov, iovcnt, offset))
lib/librumphijack/hijack.c
2594
(int fd, struct stat *sb), \
lib/librumphijack/hijack.c
2596
(fd, sb))
lib/librumphijack/hijack.c
2601
(int fd, struct statvfs *buf, int flags), \
lib/librumphijack/hijack.c
2603
(fd, buf, flags))
lib/librumphijack/hijack.c
2607
(int fd, off_t offset, int whence), \
lib/librumphijack/hijack.c
2609
(fd, offset, whence))
lib/librumphijack/hijack.c
2616
(int fd, char *buf, size_t nbytes), \
lib/librumphijack/hijack.c
2618
(fd, buf, nbytes))
lib/librumphijack/hijack.c
2622
(int fd, uid_t owner, gid_t group), \
lib/librumphijack/hijack.c
2624
(fd, owner, group))
lib/librumphijack/hijack.c
2627
(int fd, mode_t mode), \
lib/librumphijack/hijack.c
2629
(fd, mode))
lib/librumphijack/hijack.c
2632
(int fd, off_t length), \
lib/librumphijack/hijack.c
2634
(fd, length))
lib/librumphijack/hijack.c
2637
(int fd), \
lib/librumphijack/hijack.c
2639
(fd))
lib/librumphijack/hijack.c
2643
(int fd, int how, off_t start, off_t length), \
lib/librumphijack/hijack.c
2645
(fd, how, start, length))
lib/librumphijack/hijack.c
2649
(int fd, const struct timeval tv[2]), \
lib/librumphijack/hijack.c
2651
(fd, tv))
lib/librumphijack/hijack.c
2654
(int fd, const struct timespec ts[2]), \
lib/librumphijack/hijack.c
2656
(fd, ts))
lib/librumphijack/hijack.c
2660
(int fd, u_long flags), \
lib/librumphijack/hijack.c
2662
(fd, flags))
lib/librumphijack/hijack.c
465
isdup2d(int fd)
lib/librumphijack/hijack.c
468
return fd <= DUP2HIGH && fd >= 0 && dup2vec[fd] & DUP2BIT;
lib/librumphijack/hijack.c
548
whichfd(int fd)
lib/librumphijack/hijack.c
551
if (fd == -1)
lib/librumphijack/hijack.c
553
else if (fd_isrump(fd))
lib/librumphijack/hijack.c
579
if (fd == AT_FDCWD || *path == '/') { \
lib/librumphijack/hijack.c
582
isrump = fd_isrump(fd); \
lib/librumphijack/hijack.c
586
fd, path, isrump ? "rump" : "host")); \
lib/librumphijack/hijack.c
591
if (fd != AT_FDCWD) \
lib/librumphijack/hijack.c
592
fd = fd_host2rump(fd); \
lib/librumphijack/hijack.c
605
DPRINTF(("%s -> %d (%s)\n", __STRING(name), fd, whichfd(fd))); \
lib/librumphijack/hijack.c
606
if (fd_isrump(fd)) { \
lib/librumphijack/hijack.c
608
fd = fd_host2rump(fd); \
lib/librumpuser/rumpfiber_bio.c
45
rumpuser_bio(int fd, int op, void *data, size_t dlen, int64_t doff,
lib/librumpuser/rumpfiber_bio.c
52
if ((rv = pread(fd, data, dlen, doff)) == -1)
lib/librumpuser/rumpfiber_bio.c
55
if ((rv = pwrite(fd, data, dlen, doff)) == -1)
lib/librumpuser/rumpfiber_bio.c
59
fsync_range(fd, FDATASYNC, doff, dlen);
lib/librumpuser/rumpfiber_bio.c
61
fsync(fd);
lib/librumpuser/rumpuser_bio.c
134
rumpuser_bio(int fd, int op, void *data, size_t dlen, int64_t doff,
lib/librumpuser/rumpuser_bio.c
166
bio.bio_fd = fd;
lib/librumpuser/rumpuser_daemonize.c
142
int fd, rv = 0;
lib/librumpuser/rumpuser_daemonize.c
150
fd = open(_PATH_DEVNULL, O_RDWR);
lib/librumpuser/rumpuser_daemonize.c
151
if (fd == -1) {
lib/librumpuser/rumpuser_daemonize.c
155
dup2(fd, STDIN_FILENO);
lib/librumpuser/rumpuser_daemonize.c
157
dup2(fd, STDOUT_FILENO);
lib/librumpuser/rumpuser_daemonize.c
159
dup2(fd, STDERR_FILENO);
lib/librumpuser/rumpuser_daemonize.c
160
if (fd > STDERR_FILENO)
lib/librumpuser/rumpuser_daemonize.c
161
close(fd);
lib/librumpuser/rumpuser_daemonize.c
60
int fd;
lib/librumpuser/rumpuser_daemonize.c
63
if ((fd = open(path, O_WRONLY|O_CREAT)) == -1)
lib/librumpuser/rumpuser_daemonize.c
65
dup2(fd, STDOUT_FILENO);
lib/librumpuser/rumpuser_daemonize.c
66
(void)close(fd);
lib/librumpuser/rumpuser_daemonize.c
69
if ((fd = open(path, O_WRONLY|O_CREAT)) == -1)
lib/librumpuser/rumpuser_daemonize.c
71
dup2(fd, STDERR_FILENO);
lib/librumpuser/rumpuser_daemonize.c
72
(void)close(fd);
lib/librumpuser/rumpuser_file.c
123
fd = open(path, O_RDONLY);
lib/librumpuser/rumpuser_file.c
124
if (fd == -1) {
lib/librumpuser/rumpuser_file.c
131
off_t off = lseek(fd, 0, SEEK_END);
lib/librumpuser/rumpuser_file.c
147
if (ioctl(fd, DIOCGDINFO, &lab) == 0) {
lib/librumpuser/rumpuser_file.c
158
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
lib/librumpuser/rumpuser_file.c
180
if (fd != -1)
lib/librumpuser/rumpuser_file.c
181
close(fd);
lib/librumpuser/rumpuser_file.c
189
int fd, flags, rv;
lib/librumpuser/rumpuser_file.c
211
KLOCK_WRAP(fd = open(path, flags, 0644));
lib/librumpuser/rumpuser_file.c
212
if (fd == -1) {
lib/librumpuser/rumpuser_file.c
215
*fdp = fd;
lib/librumpuser/rumpuser_file.c
224
rumpuser_close(int fd)
lib/librumpuser/rumpuser_file.c
229
fsync(fd);
lib/librumpuser/rumpuser_file.c
230
close(fd);
lib/librumpuser/rumpuser_file.c
242
rumpuser_iovread(int fd, struct rumpuser_iovec *ruiov, size_t iovlen,
lib/librumpuser/rumpuser_file.c
251
KLOCK_WRAP(nn = readv(fd, iov, iovlen));
lib/librumpuser/rumpuser_file.c
254
KLOCK_WRAP(nn = preadv(fd, iov, iovlen, off));
lib/librumpuser/rumpuser_file.c
259
if (lseek(fd, off, SEEK_SET) == off) {
lib/librumpuser/rumpuser_file.c
260
nn = readv(fd, iov, iovlen);
lib/librumpuser/rumpuser_file.c
279
rumpuser_iovwrite(int fd, const struct rumpuser_iovec *ruiov, size_t iovlen,
lib/librumpuser/rumpuser_file.c
288
KLOCK_WRAP(nn = writev(fd, iov, iovlen));
lib/librumpuser/rumpuser_file.c
291
KLOCK_WRAP(nn = pwritev(fd, iov, iovlen, off));
lib/librumpuser/rumpuser_file.c
296
if (lseek(fd, off, SEEK_SET) == off) {
lib/librumpuser/rumpuser_file.c
297
nn = writev(fd, iov, iovlen);
lib/librumpuser/rumpuser_file.c
316
rumpuser_syncfd(int fd, int flags, uint64_t start, uint64_t len)
lib/librumpuser/rumpuser_file.c
339
if (fsync_range(fd, fsflags, start, len) == -1)
lib/librumpuser/rumpuser_file.c
344
if (fsync(fd) == -1)
lib/librumpuser/rumpuser_file.c
78
int fd = -1;
lib/librumpuser/rumpuser_sp.c
1189
pfdlist[idx].fd = -1;
lib/librumpuser/rumpuser_sp.c
1197
pfdlist[0].fd = spclist[0].spc_fd = sarg->sps_sock;
lib/librumpuser/rumpuser_sp.c
1222
if (pfdlist[idx].fd != -1) {
lib/librumpuser/rumpuser_sp.c
1288
idx = serv_handleconn(pfdlist[0].fd,
lib/librumpuser/rumpuser_sp.c
565
pfdlist[idx].fd = -1;
lib/librumpuser/rumpuser_sp.c
610
serv_handleconn(int fd, connecthook_fn connhook, int busy)
lib/librumpuser/rumpuser_sp.c
618
newfd = accept(fd, (struct sockaddr *)&ss, &sl);
lib/librumpuser/rumpuser_sp.c
647
if (pfdlist[i].fd == -1 && spclist[i].spc_state == SPCSTATE_NEW)
lib/librumpuser/rumpuser_sp.c
662
pfdlist[i].fd = newfd;
lib/librumpuser/sp_common.c
315
int fd = spc->spc_fd;
lib/librumpuser/sp_common.c
317
pfd.fd = fd;
lib/librumpuser/sp_common.c
334
n = host_sendmsg(fd, &msg, MSG_NOSIGNAL);
lib/librumpuser/sp_common.c
471
int fd = spc->spc_fd;
lib/librumpuser/sp_common.c
483
n = host_read(fd, (uint8_t*)&spc->spc_hdr + spc->spc_off, left);
lib/librumpuser/sp_common.c
527
n = host_read(fd, spc->spc_buf + (spc->spc_off - HDRSZ), left);
lib/libskey/skeylogin.c
481
int fd;
lib/libskey/skeylogin.c
488
if ((fd = open(_SKEY_RAND_FILE_PATH_, O_RDONLY)) != -1
lib/libskey/skeylogin.c
489
&& fstat(fd, &sb) == 0 &&
lib/libskey/skeylogin.c
491
lseek(fd, ptr % (sb.st_size - SKEY_MAX_SEED_LEN),
lib/libskey/skeylogin.c
492
SEEK_SET) != -1 && read(fd, hseed,
lib/libskey/skeylogin.c
494
close(fd);
lib/libskey/skeylogin.c
495
fd = -1;
lib/libskey/skeylogin.c
505
if (fd != -1)
lib/libskey/skeylogin.c
506
close(fd);
lib/libukfs/ukfs.c
406
unlockdev(int fd, struct ukfs_part *part)
lib/libukfs/ukfs.c
418
if (fcntl(fd, F_SETLK, &flarg) == -1)
lib/libukfs/ukfs.c
851
int fd;
lib/libukfs/ukfs.c
854
fd = rump_sys_open(filename, flags, 0);
lib/libukfs/ukfs.c
856
if (fd == -1)
lib/libukfs/ukfs.c
859
return fd;
lib/libukfs/ukfs.c
866
int fd;
lib/libukfs/ukfs.c
870
fd = rump_sys_open(filename, RUMP_O_RDONLY, 0);
lib/libukfs/ukfs.c
871
if (fd == -1)
lib/libukfs/ukfs.c
874
xfer = rump_sys_pread(fd, buf, bufsize, off);
lib/libukfs/ukfs.c
875
rump_sys_close(fd);
lib/libukfs/ukfs.c
879
if (fd == -1) {
lib/libukfs/ukfs.c
887
ukfs_read_fd(struct ukfs *ukfs, int fd, off_t off, uint8_t *buf, size_t buflen)
lib/libukfs/ukfs.c
890
return rump_sys_pread(fd, buf, buflen, off);
lib/libukfs/ukfs.c
897
int fd;
lib/libukfs/ukfs.c
901
fd = rump_sys_open(filename, RUMP_O_WRONLY, 0);
lib/libukfs/ukfs.c
902
if (fd == -1)
lib/libukfs/ukfs.c
906
xfer = rump_sys_pwrite(fd, buf, bufsize, off);
lib/libukfs/ukfs.c
908
rump_sys_fsync(fd);
lib/libukfs/ukfs.c
910
rump_sys_close(fd);
lib/libukfs/ukfs.c
914
if (fd == -1) {
lib/libukfs/ukfs.c
922
ukfs_write_fd(struct ukfs *ukfs, int fd, off_t off, uint8_t *buf, size_t buflen,
lib/libukfs/ukfs.c
927
xfer = rump_sys_pwrite(fd, buf, buflen, off);
lib/libukfs/ukfs.c
929
rump_sys_fsync(fd);
lib/libukfs/ukfs.c
936
ukfs_close(struct ukfs *ukfs, int fd)
lib/libukfs/ukfs.c
939
rump_sys_close(fd);
lib/libukfs/ukfs.c
946
int fd;
lib/libukfs/ukfs.c
949
fd = rump_sys_open(filename, RUMP_O_WRONLY | RUMP_O_CREAT, mode);
lib/libukfs/ukfs.c
950
if (fd == -1)
lib/libukfs/ukfs.c
952
rump_sys_close(fd);
lib/libusbhid/descr.c
47
hid_get_report_desc(int fd)
lib/libusbhid/descr.c
51
_DIAGASSERT(fd != -1);
lib/libusbhid/descr.c
54
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
lib/libutil/compat/compat_login.c
62
int fd;
lib/libutil/compat/compat_login.c
69
if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) {
lib/libutil/compat/compat_login.c
70
(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
lib/libutil/compat/compat_login.c
71
(void)write(fd, &ut, sizeof(ut));
lib/libutil/compat/compat_login.c
72
(void)close(fd);
lib/libutil/compat/compat_login.c
74
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
lib/libutil/compat/compat_login.c
75
(void)write(fd, &ut, sizeof(ut));
lib/libutil/compat/compat_login.c
76
(void)close(fd);
lib/libutil/getfsspecname.c
142
fd = opendisk(dk, O_RDONLY, buf, bufsiz, 0);
lib/libutil/getfsspecname.c
143
if (fd == -1)
lib/libutil/getfsspecname.c
145
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == -1) {
lib/libutil/getfsspecname.c
148
(void)close(fd);
lib/libutil/getfsspecname.c
151
(void)close(fd);
lib/libutil/getfsspecname.c
159
fd = opendisk(name, O_RDONLY, buf, bufsiz, 0);
lib/libutil/getfsspecname.c
160
if (fd != -1) {
lib/libutil/getfsspecname.c
161
close(fd);
lib/libutil/getfsspecname.c
58
int fd, savee = errno;
lib/libutil/getfsspecname.c
93
if ((fd = open(rbuf, O_RDONLY)) == -1) {
lib/libutil/getfsspecname.c
99
close(fd);
lib/libutil/login.c
55
int fd;
lib/libutil/login.c
61
if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) {
lib/libutil/login.c
62
(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
lib/libutil/login.c
63
(void)write(fd, ut, sizeof(struct utmp));
lib/libutil/login.c
64
(void)close(fd);
lib/libutil/login.c
66
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
lib/libutil/login.c
67
(void)write(fd, ut, sizeof(struct utmp));
lib/libutil/login.c
68
(void)close(fd);
lib/libutil/login_tty.c
50
login_tty(int fd)
lib/libutil/login_tty.c
53
_DIAGASSERT(fd != -1);
lib/libutil/login_tty.c
56
if (ioctl(fd, TIOCSCTTY, NULL) == -1)
lib/libutil/login_tty.c
58
(void) dup2(fd, STDIN_FILENO);
lib/libutil/login_tty.c
59
(void) dup2(fd, STDOUT_FILENO);
lib/libutil/login_tty.c
60
(void) dup2(fd, STDERR_FILENO);
lib/libutil/login_tty.c
61
if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO)
lib/libutil/login_tty.c
62
(void) close(fd);
lib/libutil/logout.c
56
int fd, rval;
lib/libutil/logout.c
61
if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0)
lib/libutil/logout.c
64
while (read(fd, &ut, sizeof(ut)) == sizeof(ut)) {
lib/libutil/logout.c
71
(void)lseek(fd, -(off_t)sizeof(ut), SEEK_CUR);
lib/libutil/logout.c
72
(void)write(fd, &ut, sizeof(ut));
lib/libutil/logout.c
75
(void)close(fd);
lib/libutil/logwtmp.c
58
int fd;
lib/libutil/logwtmp.c
64
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
lib/libutil/logwtmp.c
66
if (fstat(fd, &buf) == 0) {
lib/libutil/logwtmp.c
71
if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp))
lib/libutil/logwtmp.c
72
(void) ftruncate(fd, buf.st_size);
lib/libutil/logwtmp.c
74
(void) close(fd);
lib/libutil/passwd.c
115
int i, fd;
lib/libutil/passwd.c
124
fd = open(filename, O_WRONLY|O_CREAT|O_EXCL, 0600);
lib/libutil/passwd.c
125
for (i = 0; i < retries && fd < 0 && errno == EEXIST; i++) {
lib/libutil/passwd.c
127
fd = open(filename, O_WRONLY|O_CREAT|O_EXCL,
lib/libutil/passwd.c
133
return(fd);
lib/libutil/pidfile.c
197
int fd;
lib/libutil/pidfile.c
209
fd = pf_fd;
lib/libutil/pidfile.c
210
else if ((fd = open(path, O_RDONLY | O_NONBLOCK)) == -1)
lib/libutil/pidfile.c
213
pid = pidfile_readfd(fd);
lib/libutil/pidfile.c
214
if (fd != pf_fd)
lib/libutil/pidfile.c
215
(void)close(fd);
lib/libutil/pidfile.c
254
int fd, opts;
lib/libutil/pidfile.c
263
if ((fd = open(path, opts, 0644)) == -1)
lib/libutil/pidfile.c
267
if ((opts = fcntl(fd, F_GETFD)) == -1 ||
lib/libutil/pidfile.c
268
fcntl(fd, F_SETFD, opts | FD_CLOEXEC) == -1) {
lib/libutil/pidfile.c
271
(void)close(fd);
lib/libutil/pidfile.c
277
if (flock(fd, LOCK_EX | LOCK_NB) == -1) {
lib/libutil/pidfile.c
280
(void)close(fd);
lib/libutil/pidfile.c
285
fd = -1;
lib/libutil/pidfile.c
290
if (fd == -1) {
lib/libutil/pidfile.c
308
pf_fd = fd;
lib/libutil/pidfile.c
64
pidfile_readfd(int fd)
lib/libutil/pidfile.c
71
if (lseek(fd, 0, SEEK_SET) == -1)
lib/libutil/pidfile.c
74
n = read(fd, buf, sizeof(buf) - 1);
lib/libutil/ttymsg.c
111
if ((fd = open(device, O_WRONLY|O_NONBLOCK, 0)) < 0) {
lib/libutil/ttymsg.c
119
if (!isatty(fd)) {
lib/libutil/ttymsg.c
122
(void)close(fd);
lib/libutil/ttymsg.c
130
wret = writev(fd, iov, iovcnt);
lib/libutil/ttymsg.c
155
(void) close(fd);
lib/libutil/ttymsg.c
164
(void)close(fd);
lib/libutil/ttymsg.c
172
(void)close(fd);
lib/libutil/ttymsg.c
176
(void)close(fd);
lib/libutil/ttymsg.c
186
(void)fcntl(fd, F_SETFL, 0); /* clear O_NONBLOCK */
lib/libutil/ttymsg.c
195
(void) close(fd);
lib/libutil/ttymsg.c
204
(void) close(fd);
lib/libutil/ttymsg.c
69
int fd, ret;
lib/libwrap/clean_exit.c
40
request->sink(request->fd);
lib/libwrap/fix_options.c
110
shutdown(fd, 2);
lib/libwrap/fix_options.c
123
shutdown(fd, 2);
lib/libwrap/fix_options.c
130
shutdown(fd, 2);
lib/libwrap/fix_options.c
140
if (setsockopt(fd, ipproto, IP_OPTIONS, (char *) 0, optsize) != 0) {
lib/libwrap/fix_options.c
142
shutdown(fd, 2);
lib/libwrap/fix_options.c
51
int fd = request->fd;
lib/libwrap/fix_options.c
64
if (getsockname(fd, (struct sockaddr *)(void *)&ss, &sslen) < 0) {
lib/libwrap/fix_options.c
76
if (getsockopt(fd, ipproto, IP_OPTIONS, optbuf, &optsize) == 0
lib/libwrap/hosts_access.c
111
int fd = request->fd != -1 ? request->fd : 3;
lib/libwrap/hosts_access.c
117
blocklist_sa_r(blstate, b, fd, request->client->sin,
lib/libwrap/hosts_access.c
120
blocklist_r(blstate, b, fd, request->daemon);
lib/libwrap/options.c
251
write(request->fd, "", 1);
lib/libwrap/options.c
257
write(request->fd, obuf, strlen(obuf));
lib/libwrap/options.c
345
if (setsockopt(request->fd, SOL_SOCKET, SO_LINGER, (char *) &linger,
lib/libwrap/options.c
360
if (dry_run == 0 && setsockopt(request->fd, SOL_SOCKET, SO_KEEPALIVE,
lib/libwrap/options.c
398
if (maybe_dup2(request->fd, 0) != 0 ||
lib/libwrap/options.c
399
maybe_dup2(request->fd, 1) != 1 ||
lib/libwrap/options.c
400
maybe_dup2(request->fd, 2) != 2) {
lib/libwrap/options.c
403
if (request->fd > 2)
lib/libwrap/options.c
404
close(request->fd);
lib/libwrap/socket.c
104
if (getpeername(fd, (struct sockaddr *)(void *)& client, &len) < 0) {
lib/libwrap/socket.c
107
if (recvfrom(fd, buf, sizeof(buf), MSG_PEEK,
lib/libwrap/socket.c
127
if (getsockname(fd, (struct sockaddr *) & server, &len) < 0) {
lib/libwrap/socket.c
279
sock_sink(int fd)
lib/libwrap/socket.c
290
(void) recvfrom(fd, buf, sizeof(buf), 0, (struct sockaddr *) & ss, &size);
lib/libwrap/socket.c
87
int fd = request->fd;
lib/libwrap/tcpd.h
26
int fd; /* socket handle */
lib/libwrap/update.c
107
request->fd = -1;
lib/libwrap/update.c
55
request->fd = va_arg(ap, int);
lib/lua/gpio/gpio.c
101
int *fd;
lib/lua/gpio/gpio.c
103
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
104
if (ioctl(*fd, GPIOINFO, &info) == -1)
lib/lua/gpio/gpio.c
130
int *fd;
lib/lua/gpio/gpio.c
132
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
136
if (ioctl(*fd, GPIOSET, &set) == -1)
lib/lua/gpio/gpio.c
145
int *fd;
lib/lua/gpio/gpio.c
147
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
150
if (ioctl(*fd, GPIOUNSET, &set) == -1)
lib/lua/gpio/gpio.c
159
int *fd;
lib/lua/gpio/gpio.c
161
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
164
if (ioctl(*fd, GPIOREAD, &req) == -1)
lib/lua/gpio/gpio.c
175
int *fd, val;
lib/lua/gpio/gpio.c
177
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
184
if (ioctl(*fd, GPIOWRITE, &req) == -1)
lib/lua/gpio/gpio.c
194
int *fd;
lib/lua/gpio/gpio.c
196
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
199
if (ioctl(*fd, GPIOTOGGLE, &req) == -1)
lib/lua/gpio/gpio.c
209
int *fd;
lib/lua/gpio/gpio.c
211
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
222
if (ioctl(*fd, GPIOATTACH, &attach) == -1)
lib/lua/gpio/gpio.c
70
int *fd;
lib/lua/gpio/gpio.c
72
fd = lua_newuserdata(L, sizeof(int));
lib/lua/gpio/gpio.c
73
*fd = open(luaL_checkstring(L, -2), O_RDWR);
lib/lua/gpio/gpio.c
74
if (*fd == -1) {
lib/lua/gpio/gpio.c
87
int *fd;
lib/lua/gpio/gpio.c
89
fd = luaL_checkudata(L, 1, GPIO_METATABLE);
lib/lua/gpio/gpio.c
90
if (*fd != -1) {
lib/lua/gpio/gpio.c
91
close(*fd);
lib/lua/gpio/gpio.c
92
*fd = -1;
libexec/atrun/atrun.c
118
write_string(int fd, const char *a)
libexec/atrun/atrun.c
120
return write(fd, a, strlen(a));
libexec/ftpd/cmds.c
588
fact_modify(const char *fact, FILE *fd, factelem *fe)
libexec/ftpd/cmds.c
593
cprintf(fd, "%s=%04d%02d%02d%02d%02d%02d;", fact,
libexec/ftpd/cmds.c
600
fact_perm(const char *fact, FILE *fd, factelem *fe)
libexec/ftpd/cmds.c
619
cprintf(fd, "%s=", fact);
libexec/ftpd/cmds.c
661
CPUTC('a', fd);
libexec/ftpd/cmds.c
665
CPUTC('c', fd);
libexec/ftpd/cmds.c
690
CPUTC('d', fd);
libexec/ftpd/cmds.c
695
CPUTC('e', fd);
libexec/ftpd/cmds.c
699
CPUTC('f', fd);
libexec/ftpd/cmds.c
703
CPUTC('l', fd);
libexec/ftpd/cmds.c
707
CPUTC('m', fd);
libexec/ftpd/cmds.c
711
CPUTC('p', fd);
libexec/ftpd/cmds.c
715
CPUTC('r', fd);
libexec/ftpd/cmds.c
719
CPUTC('w', fd);
libexec/ftpd/cmds.c
721
CPUTC(';', fd);
libexec/ftpd/cmds.c
725
fact_size(const char *fact, FILE *fd, factelem *fe)
libexec/ftpd/cmds.c
729
cprintf(fd, "%s=" LLF ";", fact, (LLT)fe->stat->st_size);
libexec/ftpd/cmds.c
733
fact_type(const char *fact, FILE *fd, factelem *fe)
libexec/ftpd/cmds.c
736
cprintf(fd, "%s=", fact);
libexec/ftpd/cmds.c
741
cprintf(fd, "cdir");
libexec/ftpd/cmds.c
743
cprintf(fd, "pdir");
libexec/ftpd/cmds.c
745
cprintf(fd, "dir");
libexec/ftpd/cmds.c
747
cprintf(fd, "dir");
libexec/ftpd/cmds.c
751
cprintf(fd, "file");
libexec/ftpd/cmds.c
754
cprintf(fd, "OS.unix=fifo");
libexec/ftpd/cmds.c
757
cprintf(fd, "OS.unix=slink");
libexec/ftpd/cmds.c
760
cprintf(fd, "OS.unix=socket");
libexec/ftpd/cmds.c
764
cprintf(fd, "OS.unix=%s-" ULLF "/" ULLF,
libexec/ftpd/cmds.c
770
cprintf(fd, "OS.unix=UNKNOWN(0%o)", fe->stat->st_mode & S_IFMT);
libexec/ftpd/cmds.c
773
CPUTC(';', fd);
libexec/ftpd/cmds.c
777
fact_unique(const char *fact, FILE *fd, factelem *fe)
libexec/ftpd/cmds.c
787
cprintf(fd, "%s=%s;", fact, obuf);
libexec/ftpd/conf.c
889
int fd;
libexec/ftpd/conf.c
906
if ((fd = open(fn, O_RDWR | O_CREAT, 0600)) == -1)
libexec/ftpd/conf.c
908
if (fcntl(fd, F_SETLK, &fl) == -1)
libexec/ftpd/conf.c
910
if (fstat(fd, &sb) == -1)
libexec/ftpd/conf.c
915
scount = read(fd, pids, sb.st_size);
libexec/ftpd/conf.c
941
if (lseek(fd, 0, SEEK_SET) == -1)
libexec/ftpd/conf.c
944
scount = write(fd, pids, count);
libexec/ftpd/conf.c
947
(void)ftruncate(fd, count);
libexec/ftpd/conf.c
951
(void)fcntl(fd, F_SETLK, &fl);
libexec/ftpd/conf.c
952
close(fd);
libexec/ftpd/ftpd.c
1065
FILE *fd;
libexec/ftpd/ftpd.c
1073
if ((fd = fopen(conffilename(fname), "r")) == NULL)
libexec/ftpd/ftpd.c
1078
(buf = fparseln(fd, &len, &line, NULL, FPARSELN_UNESCCOMM |
libexec/ftpd/ftpd.c
1199
(void) fclose(fd);
libexec/ftpd/ftpd.c
2099
closedataconn(FILE *fd)
libexec/ftpd/ftpd.c
2102
if (fd == NULL)
libexec/ftpd/ftpd.c
2104
(void)fclose(fd);
libexec/ftpd/ftpd.c
2112
write_data(int fd, char *buf, size_t size, off_t *bufrem,
libexec/ftpd/ftpd.c
2129
c = write(fd, buf, c);
libexec/ftpd/ftpd.c
3760
cprintf(FILE *fd, const char *fmt, ...)
libexec/ftpd/ftpd.c
3766
b = vfprintf(fd, fmt, ap);
libexec/ftpd/ftpd.c
510
int error, fd, i, n, *socks;
libexec/ftpd/ftpd.c
564
fds[n].fd = socks[n];
libexec/ftpd/ftpd.c
586
fd = accept(fds[i].fd, NULL, NULL);
libexec/ftpd/ftpd.c
587
if (fd == -1) {
libexec/ftpd/ftpd.c
599
(void)close(fd);
libexec/ftpd/ftpd.c
604
(void)dup2(fd, STDIN_FILENO);
libexec/ftpd/ftpd.c
605
(void)dup2(fd, STDOUT_FILENO);
libexec/ftpd/ftpd.c
606
(void)dup2(fd, STDERR_FILENO);
libexec/ftpd/ftpd.c
655
while (fgets(line, sizeof(line), fd) != NULL) {
libexec/ftpd/ftpd.c
661
(void) fclose(fd);
libexec/ftpd/logutmp.c
104
if ((topslot < 0) || ((fd < 0)
libexec/ftpd/logutmp.c
105
&& (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) < 0))
libexec/ftpd/logutmp.c
111
(void)lseek(fd, (off_t)(topslot * sizeof(UTMP)), SEEK_SET);
libexec/ftpd/logutmp.c
114
if (read(fd, &ubuf, sizeof(UTMP)) == sizeof(UTMP)) {
libexec/ftpd/logutmp.c
116
(void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR);
libexec/ftpd/logutmp.c
121
(void)lseek(fd, (off_t)(topslot * sizeof(UTMP)),
libexec/ftpd/logutmp.c
127
(void)write(fd, ut, sizeof(UTMP));
libexec/ftpd/logutmp.c
137
if (fd < 0)
libexec/ftpd/logutmp.c
140
(void)lseek(fd, 0, SEEK_SET);
libexec/ftpd/logutmp.c
142
while (read(fd, &ut, sizeof(UTMP)) == sizeof(UTMP)) {
libexec/ftpd/logutmp.c
149
(void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR);
libexec/ftpd/logutmp.c
150
(void)write(fd, &ut, sizeof(UTMP));
libexec/ftpd/logutmp.c
82
static int fd = -1;
libexec/ftpd/logwtmp.c
101
(void)ftruncate(fd, buf.st_size);
libexec/ftpd/logwtmp.c
71
static int fd = -1;
libexec/ftpd/logwtmp.c
77
if ((fd = open(wf, O_WRONLY|O_APPEND, 0)) == -1)
libexec/ftpd/logwtmp.c
92
if (fd < 0)
libexec/ftpd/logwtmp.c
94
if (fstat(fd, &buf) == 0) {
libexec/ftpd/logwtmp.c
99
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
libexec/getty/subr.c
692
set[0].fd = STDIN_FILENO;
libexec/httpd/bozohttpd.c
1822
int fd, isindex;
libexec/httpd/bozohttpd.c
1832
fd = -1;
libexec/httpd/bozohttpd.c
1836
fd = open(file, O_RDONLY);
libexec/httpd/bozohttpd.c
1837
if (fd >= 0)
libexec/httpd/bozohttpd.c
1844
if (fd < 0)
libexec/httpd/bozohttpd.c
1845
fd = open(file, O_RDONLY);
libexec/httpd/bozohttpd.c
1847
if (fd < 0) {
libexec/httpd/bozohttpd.c
1866
if (fstat(fd, &sb) < 0) {
libexec/httpd/bozohttpd.c
1931
if (mmap_and_write_part(httpd, fd, cur_byte_pos, sz)) {
libexec/httpd/bozohttpd.c
1944
close(fd);
libexec/httpd/bozohttpd.c
2394
bozodgetln(bozohttpd_t *httpd, int fd, ssize_t *lenp,
libexec/httpd/bozohttpd.c
2419
for (; readfn(httpd, fd, &c, 1) == 1; ) {
libexec/httpd/bozohttpd.c
909
mmap_and_write_part(bozohttpd_t *httpd, int fd, off_t first_byte_pos, size_t sz)
libexec/httpd/bozohttpd.c
936
addr = mmap(0, mappedsz, PROT_READ, MAP_SHARED, fd, mappedoffset);
libexec/httpd/daemon-bozo.c
167
httpd->fds[i].fd = httpd->sock[i];
libexec/httpd/daemon-bozo.c
200
daemon_runchild(bozohttpd_t *httpd, int fd)
libexec/httpd/daemon-bozo.c
205
dup2(fd, 0);
libexec/httpd/daemon-bozo.c
206
dup2(fd, 1);
libexec/httpd/daemon-bozo.c
208
close(fd);
libexec/httpd/daemon-bozo.c
218
httpd->fds[idx].fd, getpid(), httpd->fds[idx].revents,
libexec/httpd/daemon-bozo.c
263
int fd;
libexec/httpd/daemon-bozo.c
297
fd = accept(httpd->fds[i].fd,
libexec/httpd/daemon-bozo.c
299
if (fd == -1) {
libexec/httpd/daemon-bozo.c
318
daemon_runchild(httpd, fd);
libexec/httpd/daemon-bozo.c
327
close(fd);
libexec/httpd/daemon-bozo.c
332
daemon_runchild(httpd, fd);
libexec/httpd/daemon-bozo.c
336
close(fd);
libexec/httpd/dir-index-bozo.c
209
fd = open(buf, O_RDONLY);
libexec/httpd/dir-index-bozo.c
210
if (fd != -1) {
libexec/httpd/dir-index-bozo.c
213
rlen = read(fd, buf, sizeof buf);
libexec/httpd/dir-index-bozo.c
218
close(fd);
libexec/httpd/dir-index-bozo.c
62
int k, j, fd;
libexec/httpd/ssl-bozo.c
222
bozo_ssl_read(bozohttpd_t *httpd, int fd, void *buf, size_t nbytes)
libexec/httpd/ssl-bozo.c
227
USE_ARG(fd);
libexec/httpd/ssl-bozo.c
235
bozo_ssl_write(bozohttpd_t *httpd, int fd, const void *buf, size_t nbytes)
libexec/httpd/ssl-bozo.c
240
USE_ARG(fd);
libexec/httpd/ssl-bozo.c
408
bozo_read(bozohttpd_t *httpd, int fd, void *buf, size_t len)
libexec/httpd/ssl-bozo.c
412
return bozo_ssl_read(httpd, fd, buf, len);
libexec/httpd/ssl-bozo.c
415
return read(fd, buf, len);
libexec/httpd/ssl-bozo.c
419
bozo_write(bozohttpd_t *httpd, int fd, const void *buf, size_t len)
libexec/httpd/ssl-bozo.c
423
return bozo_ssl_write(httpd, fd, buf, len);
libexec/httpd/ssl-bozo.c
426
return write(fd, buf, len);
libexec/identd/identd.c
264
int fd, nfds, rv;
libexec/identd/identd.c
275
rfds[i].fd = socks[i+1];
libexec/identd/identd.c
289
fd = accept(rfds[i].fd, NULL, NULL);
libexec/identd/identd.c
290
if (fd < 0) {
libexec/identd/identd.c
302
(void)idhandle(fd, charset,
libexec/identd/identd.c
308
(void)close(fd);
libexec/identd/identd.c
325
idhandle(int fd, const char *charset, const char *fmt, const char *osname,
libexec/identd/identd.c
347
if (getpeername(fd, (struct sockaddr *)&ss[0], &len) < 0)
libexec/identd/identd.c
355
if (getsockname(fd, (struct sockaddr *)&ss[1], &len) < 0)
libexec/identd/identd.c
367
if ((n = recv(fd, &buf[qlen], sizeof(buf) - qlen, 0)) < 0) {
libexec/identd/identd.c
371
iderror(fd, 0, 0, "UNKNOWN-ERROR");
libexec/identd/identd.c
404
iderror(fd, 0, 0, eflag ? "UNKNOWN-ERROR" : "INVALID-PORT");
libexec/identd/identd.c
412
idparse(fd, lport, fport, charset, osname, idbuf);
libexec/identd/identd.c
441
forward(fd, (struct sockaddr *)&nat_addr,
libexec/identd/identd.c
453
idparse(fd, lport, fport, charset, osname, idbuf);
libexec/identd/identd.c
458
iderror(fd, lport, fport, eflag ? "UNKNOWN-ERROR" : "NO-USER");
libexec/identd/identd.c
477
iderror(fd, lport, fport, "HIDDEN-USER");
libexec/identd/identd.c
496
idparse(fd, lport, fport, charset, osname, idbuf);
libexec/identd/identd.c
512
idparse(fd, lport, fport, charset, osname, idbuf);
libexec/identd/identd.c
527
idparse(fd, lport, fport, charset, osname, buf);
libexec/identd/identd.c
529
idparse(fd, lport, fport, charset, osname, idbuf);
libexec/identd/identd.c
536
idparse(int fd, int lport, int fport, const char *charset, const char *osname,
libexec/identd/identd.c
544
if (send(fd, p, strlen(p), 0) < 0) {
libexec/identd/identd.c
553
iderror(int fd, int lport, int fport, const char *error)
libexec/identd/identd.c
559
if (send(fd, p, strlen(p), 0) < 0) {
libexec/identd/identd.c
801
forward(int fd, struct sockaddr *nat_addr, int nat_lport, int fport, int lport)
libexec/identd/identd.c
858
if (send(fd, buf, strlen(buf), 0) < 0) {
libexec/identd/identd.c
894
int fd;
libexec/identd/identd.c
900
if ((fd = open(path, O_RDONLY|O_NONBLOCK|O_NOFOLLOW, 0)) < 0) {
libexec/identd/identd.c
904
if (fstat(fd, &sb) < 0 || !S_ISREG(sb.st_mode)) {
libexec/identd/identd.c
905
(void)close(fd);
libexec/identd/identd.c
909
if ((n = read(fd, username, len - 1)) < 1) {
libexec/identd/identd.c
910
(void)close(fd);
libexec/identd/identd.c
919
(void)close(fd);
libexec/ld.elf_so/arch/powerpc/fixup.c
121
_rtld_espresso_fixup(const char *path, int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr,
libexec/ld.elf_so/arch/powerpc/fixup.c
134
shdr = mmap(NULL, shdr_size, PROT_READ, MAP_FILE | MAP_SHARED, fd,
libexec/ld.elf_so/arch/powerpc/fixup.c
174
_rtld_map_segment_fixup(const char *path, int fd, Elf_Ehdr *ehdr,
libexec/ld.elf_so/arch/powerpc/fixup.c
196
return _rtld_espresso_fixup(path, fd, ehdr, phdr, data_addr,
libexec/ld.elf_so/load.c
117
int fd = -1;
libexec/ld.elf_so/load.c
145
if ((fd = open(filepath, O_RDONLY)) == -1) {
libexec/ld.elf_so/load.c
149
if (fstat(fd, &sb) == -1) {
libexec/ld.elf_so/load.c
151
close(fd);
libexec/ld.elf_so/load.c
156
close(fd);
libexec/ld.elf_so/load.c
169
close(fd);
libexec/ld.elf_so/load.c
176
obj = _rtld_map_object(filepath, fd, &sb);
libexec/ld.elf_so/load.c
177
(void)close(fd);
libexec/ld.elf_so/map_object.c
127
ehdr = mmap(NULL, _rtld_pagesz, PROT_READ, MAP_FILE | MAP_SHARED, fd,
libexec/ld.elf_so/map_object.c
363
data_flags, fd, data_offset) == MAP_FAILED) {
libexec/ld.elf_so/map_object.c
370
if (_rtld_map_segment_fixup(path, fd, ehdr, segs[i], data_addr,
libexec/ld.elf_so/map_object.c
65
_rtld_map_object(const char *path, int fd, const struct stat *sb)
libexec/ld.elf_so/paths.c
340
int fd;
libexec/ld.elf_so/paths.c
347
if ((fd = open(fname, O_RDONLY)) == -1) {
libexec/ld.elf_so/paths.c
355
sz = read(fd, buf, sizeof(small));
libexec/ld.elf_so/paths.c
358
(void)close(fd);
libexec/ld.elf_so/paths.c
362
if (fstat(fd, &st) == -1) {
libexec/ld.elf_so/paths.c
365
(void)close(fd);
libexec/ld.elf_so/paths.c
371
buf = mmap(0, sz, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0);
libexec/ld.elf_so/paths.c
374
(void)close(fd);
libexec/ld.elf_so/paths.c
378
(void)close(fd);
libexec/ld.elf_so/rtld.c
1045
int fd = pAUX_execfd->a_v;
libexec/ld.elf_so/rtld.c
1047
_rtld_objmain = _rtld_map_object(objmain_name, fd, NULL);
libexec/ld.elf_so/rtld.c
1048
close(fd);
libexec/ld.elf_so/xmalloc.c
391
int fd = -1;
libexec/ld.elf_so/xmalloc.c
395
fd = open("/dev/zero", O_RDWR, 0);
libexec/ld.elf_so/xmalloc.c
396
if (fd == -1)
libexec/ld.elf_so/xmalloc.c
411
MAP_ANON|MAP_PRIVATE, fd, 0)) == (caddr_t)-1) {
libexec/ld.elf_so/xmalloc.c
419
close(fd);
libexec/lfs_cleanerd/cleansrv.c
164
int fd;
libexec/lfs_cleanerd/cleansrv.c
173
fd = open("/var/run/lfs_cleanerd.pid", O_RDONLY);
libexec/lfs_cleanerd/cleansrv.c
174
if (fd >= 0) {
libexec/lfs_cleanerd/cleansrv.c
175
read(fd, scratch, 80);
libexec/lfs_cleanerd/cleansrv.c
182
close(fd);
libexec/lfs_cleanerd/fdfs.c
108
vp->v_fd = fd;
libexec/lfs_cleanerd/fdfs.c
61
fd_vget(int fd, int bsize, int segsize, int nseg)
libexec/lfs_cleanerd/fdfs.c
91
fs->fd_fd = fd;
libexec/mail.local/mail.local.c
120
fd = store(from);
libexec/mail.local/mail.local.c
124
rval = deliver(fd, *argv, lockfile);
libexec/mail.local/mail.local.c
136
int fd, eline;
libexec/mail.local/mail.local.c
142
if ((fd = mkstemp(tn)) == -1 || !(fp = fdopen(fd, "w+")))
libexec/mail.local/mail.local.c
173
if ((fd = dup(fd)) == -1)
libexec/mail.local/mail.local.c
176
return fd;
libexec/mail.local/mail.local.c
195
deliver(int fd, char *name, int lockfile)
libexec/mail.local/mail.local.c
276
if (lseek(fd, 0, SEEK_SET) == (off_t)-1) {
libexec/mail.local/mail.local.c
281
while ((nr = read(fd, buf, sizeof(buf))) > 0)
libexec/mail.local/mail.local.c
77
int ch, fd, eval, lockfile = 0;
libexec/rexecd/rexecd.c
283
fds[0].fd = s;
libexec/rexecd/rexecd.c
284
fds[1].fd = pv[0];
libexec/rlogind/rlogind.c
465
set[0].fd = p;
libexec/rlogind/rlogind.c
466
set[1].fd = f;
libexec/rlogind/rlogind.c
666
setup_term(int fd)
libexec/rlogind/rlogind.c
673
tcgetattr(fd, &tt);
libexec/rlogind/rlogind.c
686
tcsetattr(fd, TCSAFLUSH, &tt);
libexec/rlogind/rlogind.c
694
tcgetattr(fd, &tt);
libexec/rlogind/rlogind.c
696
tcsetattr(fd, TCSAFLUSH, &tt);
libexec/rshd/rshd.c
573
set[0].fd = s;
libexec/rshd/rshd.c
575
set[1].fd = pv[0];
libexec/rshd/rshd.c
645
for (fd = getdtablesize(); fd > STDERR_FILENO; fd--)
libexec/rshd/rshd.c
646
(void)close(fd);
libexec/telnetd/telnetd.c
921
FILE *fd;
libexec/telnetd/telnetd.c
923
if ((fd = fopen(IF, "r")) != NULL) {
libexec/telnetd/telnetd.c
924
while (fgets(buf, sizeof(buf) - 1, fd) != NULL)
libexec/telnetd/telnetd.c
926
fclose(fd);
libexec/telnetd/telnetd.c
949
set[0].fd = f;
libexec/telnetd/telnetd.c
950
set[1].fd = p;
libexec/telnetd/utility.c
98
set[0].fd = s;
libexec/tftpd/tftpd.c
160
int n, ch, on, fd;
libexec/tftpd/tftpd.c
168
fd = 0;
libexec/tftpd/tftpd.c
325
if (ioctl(fd, FIONBIO, &on) < 0) {
libexec/tftpd/tftpd.c
330
n = recvfrom(fd, buf, sizeof (buf), 0,
libexec/tftpd/tftpd.c
370
i = recvfrom(fd, buf, sizeof (buf), 0,
libexec/tftpd/tftpd.c
393
if (getsockname(fd, (struct sockaddr *)&me, &len) == 0) {
libexec/tftpd/tftpd.c
412
close(fd);
libexec/tftpd/tftpd.c
780
int fd;
libexec/tftpd/tftpd.c
895
fd = open(filename, mode == RRQ ? O_RDONLY : O_WRONLY | trunc | create,
libexec/tftpd/tftpd.c
897
if (fd < 0)
libexec/tftpd/tftpd.c
899
file = fdopen(fd, (mode == RRQ)? "r":"w");
libexec/tftpd/tftpd.c
901
close(fd);
libexec/utmp_update/utmp_update.c
137
fd = open(tty, O_RDONLY|O_NONBLOCK, 0);
libexec/utmp_update/utmp_update.c
138
if (fd != -1) {
libexec/utmp_update/utmp_update.c
139
if (fstat(fd, &st) == -1)
libexec/utmp_update/utmp_update.c
143
if (!isatty(fd))
libexec/utmp_update/utmp_update.c
145
(void)close(fd);
libexec/utmp_update/utmp_update.c
80
int fd;
regress/sys/fs/lfs/ckckp/ckckp.c
43
int fd, e, sno;
regress/sys/fs/lfs/ckckp/ckckp.c
52
fd = open(argv[1], 0, 0);
regress/sys/fs/lfs/ckckp/ckckp.c
53
if (fd < 0)
regress/sys/fs/lfs/ckckp/ckckp.c
63
fcntl(fd, LFCNWRAPSTOP, &dowait);
regress/sys/fs/lfs/ckckp/ckckp.c
92
fcntl(fd, LFCNWRAPGO, &dowait);
regress/sys/kern/kqueue/vnode/vnode.c
133
lseek(fd, 0, SEEK_END);
regress/sys/kern/kqueue/vnode/vnode.c
134
n = read(fd, buffer, 128);
regress/sys/kern/kqueue/vnode/vnode.c
51
int fd, kq, n, i;
regress/sys/kern/kqueue/vnode/vnode.c
56
fd = open(argv[1], O_RDONLY|O_CREAT, 0644);
regress/sys/kern/kqueue/vnode/vnode.c
57
if (fd == -1)
regress/sys/kern/kqueue/vnode/vnode.c
61
sprintf(buffer, "/mnt/fd/%d", fd);
regress/sys/kern/kqueue/vnode/vnode.c
62
if ((fd = open(buffer, O_RDONLY)) < 0)
regress/sys/kern/kqueue/vnode/vnode.c
67
lseek(fd, 0, SEEK_END);
regress/sys/kern/kqueue/vnode/vnode.c
75
EV_SET(&event[i], fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
regress/sys/kern/kqueue/vnode/vnode.c
81
EV_SET(&event[i], fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, NULL, NULL);
regress/sys/kern/kqueue/vnode/write.c
45
int fd, n;
regress/sys/kern/kqueue/vnode/write.c
51
fd = open(argv[1], O_WRONLY);
regress/sys/kern/kqueue/vnode/write.c
52
if (fd < 0)
regress/sys/kern/kqueue/vnode/write.c
55
lseek(fd, 0, SEEK_SET);
regress/sys/kern/kqueue/vnode/write.c
58
n = write(fd, buffer, sizeof(buffer));
regress/sys/kern/kqueue/vnode/write.c
64
close(fd);
regress/sys/kern/select/select.c
100
fd, FD_SETSIZE);
regress/sys/kern/select/select.c
104
assert(!FD_ISSET(fd, &set));
regress/sys/kern/select/select.c
105
FD_SET(fd, &set);
regress/sys/kern/select/select.c
107
if (fd > maxfd) {
regress/sys/kern/select/select.c
108
maxfd = fd;
regress/sys/kern/select/select.c
142
for (fd = 0; fd <= maxfd; fd++) {
regress/sys/kern/select/select.c
143
if (FD_ISSET(fd, &set)) {
regress/sys/kern/select/select.c
148
(void *)pthread_self(), fd);
regress/sys/kern/select/select.c
150
if (!FD_ISSET(fd, &oset)) {
regress/sys/kern/select/select.c
155
if (read(fd, buf, sizeof(buf)) == -1) {
regress/sys/kern/select/select.c
63
int fd;
regress/sys/kern/select/select.c
67
fd = fds[i][1];
regress/sys/kern/select/select.c
69
printf("[%p] write %d\n", (void *)pthread_self(), fd);
regress/sys/kern/select/select.c
71
if (write(fd, buf, sizeof(buf)) == -1) {
regress/sys/kern/select/select.c
90
int fd;
regress/sys/kern/select/select.c
96
fd = fds[i][0];
regress/sys/kern/select/select.c
97
if (fd > FD_SETSIZE) {
regress/sys/kern/unfdpass/unfdpass.c
150
if ((fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
regress/sys/kern/unfdpass/unfdpass.c
153
if (write(fd, buf, strlen(buf)) != strlen(buf))
regress/sys/kern/unfdpass/unfdpass.c
155
(void) close(fd);
regress/sys/kern/unfdpass/unfdpass.c
352
int i, fd, sock, nfd, *files;
regress/sys/kern/unfdpass/unfdpass.c
395
if ((fd = open(fname, O_RDONLY, 0666)) == -1)
regress/sys/kern/unfdpass/unfdpass.c
397
files[i] = fd;
regress/sys/kern/unfdpass/unfdpass.c
404
if ((fd = open(dirname, O_RDONLY, 0)) == -1) {
regress/sys/kern/unfdpass/unfdpass.c
407
files[i] = fd;
regress/sys/kern/unfdpass/unfdpass.c
90
int listensock, sock, fd, i;
sbin/amrctl/amrctl.c
159
amr_ioctl_enquiry(int fd, uint8_t cmd, uint8_t cmdsub, uint8_t cmdqual)
sbin/amrctl/amrctl.c
178
r = ioctl(fd, AMR_IO_COMMAND, &am);
sbin/amrctl/amrctl.c
215
describe_card(int fd, int verbosity, int globalparam)
sbin/amrctl/amrctl.c
224
enq_result = amr_ioctl_enquiry(fd, AMR_CMD_CONFIG,
sbin/amrctl/amrctl.c
259
enq_result = amr_ioctl_enquiry(fd, AMR_CMD_EXT_ENQUIRY2, 0, 0);
sbin/amrctl/amrctl.c
264
enq_result = amr_ioctl_enquiry(fd, AMR_CMD_ENQUIRY, 0, 0);
sbin/amrctl/amrctl.c
393
describe_battery(int fd, int verbosity, int fwint, int bflags, int globalparam)
sbin/amrctl/amrctl.c
399
enq_result = amr_ioctl_enquiry(fd, AMR_CMD_CONFIG,
sbin/amrctl/amrctl.c
585
int fd = -1;
sbin/amrctl/amrctl.c
650
fd = open(filename, O_RDONLY);
sbin/amrctl/amrctl.c
651
if (fd == -1) {
sbin/amrctl/amrctl.c
654
if (ioctl(fd, AMR_IO_VERSION, &i) == -1) {
sbin/amrctl/amrctl.c
680
i = describe_card(fd, verbosity, globalparam);
sbin/amrctl/amrctl.c
681
describe_battery(fd, verbosity, i, bflags, globalparam);
sbin/atactl/atactl.c
174
static int fd; /* file descriptor for device */
sbin/atactl/atactl.c
1962
error = ioctl(fd, ATABUSIORESET, NULL);
sbin/atactl/atactl.c
513
fd = opendisk(dvname, O_RDWR, dvname_store, sizeof(dvname_store), 0);
sbin/atactl/atactl.c
514
if (fd == -1) {
sbin/atactl/atactl.c
523
fd = opendisk(dvname, O_RDWR, dvname_store,
sbin/atactl/atactl.c
525
if (fd == -1)
sbin/atactl/atactl.c
590
error = ioctl(fd, ATAIOCCOMMAND, req);
sbin/atactl/atactl.c
718
error = ioctl(fd, SCIOCCOMMAND, &sreq);
sbin/bioctl/bioctl.c
1011
bio_blink(int fd, char *enclosure, int target, int blinktype)
sbin/bioctl/bioctl.c
1017
if (ioctl(fd, BIOCLOCATE, &bio) == -1)
sbin/bioctl/bioctl.c
1026
if (ioctl(fd, BIOCBLINK, &blink) == -1)
sbin/bioctl/bioctl.c
147
int fd = 0, i;
sbin/bioctl/bioctl.c
168
fd = open("/dev/bio", O_RDWR);
sbin/bioctl/bioctl.c
169
if (fd == -1)
sbin/bioctl/bioctl.c
173
if (ioctl(fd, BIOCLOCATE, &bl) == -1)
sbin/bioctl/bioctl.c
178
(*commands[i].cmd_func)(fd, argc, argv);
sbin/bioctl/bioctl.c
180
(void)close(fd);
sbin/bioctl/bioctl.c
249
if (ioctl(bt->fd, BIOCVOL, bv) == -1)
sbin/bioctl/bioctl.c
355
if (ioctl(bt->fd, BIOCDISK_NOVOL, &bd) == -1)
sbin/bioctl/bioctl.c
360
if (ioctl(bt->fd, BIOCDISK, &bd) == -1)
sbin/bioctl/bioctl.c
429
bio_show_common(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
456
if (ioctl(fd, BIOCINQ, &bi) == -1)
sbin/bioctl/bioctl.c
473
biot->fd = fd;
sbin/bioctl/bioctl.c
530
bio_alarm(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
560
if (ioctl(fd, BIOCALARM, &ba) == -1)
sbin/bioctl/bioctl.c
572
bio_setstate_hotspare(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
589
bio_setstate_common(fd, argv[1], &bs, &location);
sbin/bioctl/bioctl.c
596
bio_setstate_passthru(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
623
bio_setstate_common(fd, argv[1], &bs, &location);
sbin/bioctl/bioctl.c
629
bio_setstate_common(fd, argv[2], &bs, &location);
sbin/bioctl/bioctl.c
637
bio_setstate_consistency(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
65
int fd;
sbin/bioctl/bioctl.c
658
bio_setstate_common(fd, NULL, &bs, NULL);
sbin/bioctl/bioctl.c
662
bio_setstate_common(int fd, char *arg, struct bioc_setstate *bs,
sbin/bioctl/bioctl.c
681
if (ioctl(fd, BIOCSETSTATE, bs) == -1)
sbin/bioctl/bioctl.c
689
bio_volops_create(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
771
if (ioctl(fd, BIOCINQ, &bi) == -1)
sbin/bioctl/bioctl.c
776
if (ioctl(fd, BIOCDISK_NOVOL, &bd) == -1)
sbin/bioctl/bioctl.c
866
if (ioctl(fd, BIOCVOLOPS, &bc) == -1)
sbin/bioctl/bioctl.c
887
bio_volops_modify(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
897
bio_volops_remove(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
923
if (ioctl(fd, BIOCVOLOPS, &bc) == -1)
sbin/bioctl/bioctl.c
934
bio_setblink(int fd, int argc, char **argv)
sbin/bioctl/bioctl.c
964
rv = ioctl(fd, BIOCBLINK, &bb);
sbin/bioctl/bioctl.c
971
rv = ioctl(fd, BIOCINQ, &bi);
sbin/bioctl/bioctl.c
979
rv = ioctl(fd, BIOCVOL, &bv);
sbin/bioctl/bioctl.c
989
rv = ioctl(fd, BIOCDISK, &bd);
sbin/bioctl/bioctl.c
997
bio_blink(fd, bd.bd_procdev,
sbin/blkdiscard/blkdiscard.c
173
int fd = open(name, O_RDWR);
sbin/blkdiscard/blkdiscard.c
174
if (fd < 0)
sbin/blkdiscard/blkdiscard.c
180
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
sbin/blkdiscard/blkdiscard.c
188
if (size == 0 && fstat(fd, &sb) != -1) {
sbin/blkdiscard/blkdiscard.c
191
if (ioctl(fd, DIOCGDINFO, &dl) != -1) {
sbin/blkdiscard/blkdiscard.c
249
write_one(fd, discard_size, first_byte);
sbin/blkdiscard/blkdiscard.c
265
if (close(fd) != 0)
sbin/blkdiscard/blkdiscard.c
83
write_one(int fd, off_t discard_size, off_t first_byte)
sbin/blkdiscard/blkdiscard.c
89
if (pwrite(fd, zeros, discard_size, first_byte) != discard_size)
sbin/blkdiscard/blkdiscard.c
91
} else if (fdiscard(fd, first_byte, discard_size) != 0)
sbin/brconfig/brconfig.c
384
u_int8_t ht, fd, ma;
sbin/brconfig/brconfig.c
396
fd = param.ifbrp_fwddelay;
sbin/brconfig/brconfig.c
403
prefix, pri, ht, fd, ma);
sbin/ccdconfig/ccdconfig.c
498
int fd;
sbin/ccdconfig/ccdconfig.c
501
if ((fd = open(path, O_RDWR, 0640)) < 0) {
sbin/ccdconfig/ccdconfig.c
506
if (ioctl(fd, cmd, cciop) < 0) {
sbin/ccdconfig/ccdconfig.c
520
(void)close(fd);
sbin/ccdconfig/ccdconfig.c
524
(void)close(fd);
sbin/ccdconfig/ccdconfig.c
531
int fd;
sbin/ccdconfig/ccdconfig.c
542
fd = opendisk(dev + 5, O_RDONLY, nbuf, sizeof nbuf, 0);
sbin/ccdconfig/ccdconfig.c
544
fd = opendisk(dev, O_RDONLY, nbuf, sizeof nbuf, 0);
sbin/ccdconfig/ccdconfig.c
546
fd = open(dev, O_RDONLY);
sbin/ccdconfig/ccdconfig.c
548
if (fd < 0)
sbin/ccdconfig/ccdconfig.c
551
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == -1) {
sbin/ccdconfig/ccdconfig.c
552
close(fd);
sbin/ccdconfig/ccdconfig.c
555
close(fd);
sbin/ccdconfig/ccdconfig.c
604
int fd;
sbin/ccdconfig/ccdconfig.c
614
fd = opendisk(ccdname, O_RDONLY, buf, sizeof buf, 0);
sbin/ccdconfig/ccdconfig.c
615
if (fd < 0)
sbin/ccdconfig/ccdconfig.c
618
if (ioctl(fd, DIOCGSECTORSIZE, &sector_size) == -1)
sbin/ccdconfig/ccdconfig.c
621
(void) close(fd);
sbin/cgdconfig/cgdconfig.c
1003
if (prog_ioctl(fd, CGDIOCSET, &ci) == -1) {
sbin/cgdconfig/cgdconfig.c
1019
verify(struct params *p, int fd)
sbin/cgdconfig/cgdconfig.c
1026
return verify_disklabel(fd);
sbin/cgdconfig/cgdconfig.c
1028
return verify_ffs(fd);
sbin/cgdconfig/cgdconfig.c
1032
return verify_mbr(fd);
sbin/cgdconfig/cgdconfig.c
1034
return verify_gpt(fd);
sbin/cgdconfig/cgdconfig.c
1037
return verify_zfs(fd);
sbin/cgdconfig/cgdconfig.c
1046
verify_disklabel(int fd)
sbin/cgdconfig/cgdconfig.c
1059
ret = prog_pread(fd, buf, SCANSIZE, 0);
sbin/cgdconfig/cgdconfig.c
1071
verify_mbr(int fd)
sbin/cgdconfig/cgdconfig.c
1082
ret = prog_pread(fd, buf, SCANSIZE, 0);
sbin/cgdconfig/cgdconfig.c
1157
verify_gpt(int fd)
sbin/cgdconfig/cgdconfig.c
1170
ret = prog_pread(fd, buf, SCANSIZE, 0);
sbin/cgdconfig/cgdconfig.c
1206
verify_zfs(int fd)
sbin/cgdconfig/cgdconfig.c
1211
if (prog_ioctl(fd, DIOCGMEDIASIZE, &vdev_size) == -1) {
sbin/cgdconfig/cgdconfig.c
1224
ssize_t ret = prog_pread(fd, vdev_phys, sizeof(*vdev_phys),
sbin/cgdconfig/cgdconfig.c
1299
verify_ffs(int fd)
sbin/cgdconfig/cgdconfig.c
1310
ret = prog_pread(fd, &u, sizeof(u), sblock_try[i]);
sbin/cgdconfig/cgdconfig.c
1625
int fd;
sbin/cgdconfig/cgdconfig.c
1627
fd = opendisk(dev, O_RDONLY, path, sizeof(path), 0);
sbin/cgdconfig/cgdconfig.c
1628
if (fd == -1) {
sbin/cgdconfig/cgdconfig.c
1634
if (prog_ioctl(fd, CGDIOCGET, &cgu) == -1) {
sbin/cgdconfig/cgdconfig.c
1635
close(fd);
sbin/cgdconfig/cgdconfig.c
1665
close(fd);
sbin/cgdconfig/cgdconfig.c
695
int fd;
sbin/cgdconfig/cgdconfig.c
707
fd = opendisk1(*argv, O_RDWR, buf, sizeof(buf), 1, prog_open);
sbin/cgdconfig/cgdconfig.c
708
if (fd == -1) {
sbin/cgdconfig/cgdconfig.c
723
ret = unconfigure_fd(fd);
sbin/cgdconfig/cgdconfig.c
724
(void)prog_close(fd);
sbin/cgdconfig/cgdconfig.c
729
unconfigure_fd(int fd)
sbin/cgdconfig/cgdconfig.c
733
if (prog_ioctl(fd, CGDIOCCLR, &ci) == -1) {
sbin/cgdconfig/cgdconfig.c
747
int fd;
sbin/cgdconfig/cgdconfig.c
764
fd = opendisk1(*argv, O_RDWR, cgdname, sizeof(cgdname), 1, prog_open)
sbin/cgdconfig/cgdconfig.c
769
if (prog_ioctl(fd, CGDIOCGET, &cgu) != -1 && cgu.cgu_dev != 0) {
sbin/cgdconfig/cgdconfig.c
771
prog_close(fd);
sbin/cgdconfig/cgdconfig.c
774
prog_close(fd);
sbin/cgdconfig/cgdconfig.c
839
fd = opendisk_werror(argv[0], cgdname, sizeof(cgdname));
sbin/cgdconfig/cgdconfig.c
840
if (fd == -1)
sbin/cgdconfig/cgdconfig.c
850
ret = configure_params(fd, cgdname, dev, p);
sbin/cgdconfig/cgdconfig.c
854
ret = verify(p, fd);
sbin/cgdconfig/cgdconfig.c
856
(void)unconfigure_fd(fd);
sbin/cgdconfig/cgdconfig.c
865
(void)unconfigure_fd(fd);
sbin/cgdconfig/cgdconfig.c
866
(void)prog_close(fd);
sbin/cgdconfig/cgdconfig.c
897
(void)prog_close(fd);
sbin/cgdconfig/cgdconfig.c
902
(void)prog_close(fd);
sbin/cgdconfig/cgdconfig.c
909
int fd;
sbin/cgdconfig/cgdconfig.c
939
fd = opendisk_werror(argv[0], cgdname, sizeof(cgdname));
sbin/cgdconfig/cgdconfig.c
940
if (fd == -1)
sbin/cgdconfig/cgdconfig.c
949
return configure_params(fd, cgdname, dev, p);
sbin/cgdconfig/cgdconfig.c
955
int fd;
sbin/cgdconfig/cgdconfig.c
969
fd = opendisk1(cgd, O_RDWR, buf, buflen, 0, prog_open);
sbin/cgdconfig/cgdconfig.c
970
if (fd == -1)
sbin/cgdconfig/cgdconfig.c
973
return fd;
sbin/cgdconfig/cgdconfig.c
977
configure_params(int fd, const char *cgd, const char *dev, struct params *p)
sbin/clri/clri.c
104
if (pread(fd, sblock, sizeof(sblock), sblockloc) != sizeof(sblock))
sbin/clri/clri.c
148
if (lseek(fd, sblockloc, SEEK_SET) < 0)
sbin/clri/clri.c
150
if (write(fd, sblock, sizeof(sblock)) != sizeof(sblock))
sbin/clri/clri.c
152
(void)fsync(fd);
sbin/clri/clri.c
178
if (lseek(fd, offset, SEEK_SET) < 0)
sbin/clri/clri.c
180
if ((size_t)read(fd, ibuf, bsize) != bsize)
sbin/clri/clri.c
201
if (lseek(fd, offset, SEEK_SET) < 0)
sbin/clri/clri.c
203
if ((size_t)write(fd, ibuf, bsize) != bsize)
sbin/clri/clri.c
205
(void)fsync(fd);
sbin/clri/clri.c
208
(void)close(fd);
sbin/clri/clri.c
78
int fd;
sbin/clri/clri.c
98
if ((fd = open(fs, O_RDWR, 0)) < 0)
sbin/disklabel/interact.c
101
cmd_help(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
113
cmd_adjust(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
117
if (dk_ioctl(fd, DIOCGDEFLABEL, &dl) == -1) {
sbin/disklabel/interact.c
139
cmd_chain(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
164
cmd_printall(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
173
cmd_print(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
181
cmd_info(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
230
cmd_name(lp, s, fd);
sbin/disklabel/interact.c
430
cmd_name(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
444
cmd_round(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
471
cmd_part(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
584
cmd_label(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
598
if (writelabel(fd, lp) != 0) {
sbin/disklabel/interact.c
607
cmd_listfstypes(struct disklabel *lp, char *s, int fd)
sbin/disklabel/interact.c
615
runcmd(struct disklabel *lp, char *line, int fd)
sbin/disklabel/interact.c
623
(*cmd->func)(lp, line, fd);
sbin/disklabel/interact.c
629
cmd_part(lp, line, fd);
sbin/disklabel/interact.c
800
interact(struct disklabel *lp, int fd)
sbin/disklabel/interact.c
811
if (runcmd(lp, line, fd) == -1)
sbin/disklabel/main.c
1518
int first, ch, fd;
sbin/disklabel/main.c
1525
if ((fd = mkstemp(tmpfil)) == -1 || (fp = fdopen(fd, "w")) == NULL) {
sbin/disklabel/main.c
1529
(void)fchmod(fd, 0600);
sbin/dkctl/dkctl.c
200
fd = opendisk(dvname, command->open_flags, dvname_store,
sbin/dkctl/dkctl.c
202
if (fd == -1)
sbin/dkctl/dkctl.c
209
(void)close(fd);
sbin/dkctl/dkctl.c
268
if (ioctl(fd, DIOCGSTRATEGY, &odks) == -1) {
sbin/dkctl/dkctl.c
281
if (ioctl(fd, DIOCSSTRATEGY, &dks) == -1) {
sbin/dkctl/dkctl.c
297
if (ioctl(fd, DIOCGCACHE, &bits) == -1)
sbin/dkctl/dkctl.c
354
if (ioctl(fd, DIOCSCACHE, &bits) == -1)
sbin/dkctl/dkctl.c
379
if (ioctl(fd, DIOCCACHESYNC, &force) == -1)
sbin/dkctl/dkctl.c
398
if (ioctl(fd, DIOCKLABEL, &keep) == -1)
sbin/dkctl/dkctl.c
431
if (ioctl(fd, DIOCBSLIST, (caddr_t)&dbsi) == -1)
sbin/dkctl/dkctl.c
446
if (ioctl(fd, DIOCBSFLUSH) == -1)
sbin/dkctl/dkctl.c
456
if (fstat(fd, &sb) == -1)
sbin/dkctl/dkctl.c
479
if (ioctl(fd, DIOCBSLIST, (caddr_t)&dbsi) == -1)
sbin/dkctl/dkctl.c
515
if (ioctl(fd, DIOCBSFLUSH) == -1)
sbin/dkctl/dkctl.c
534
if (lseek(fd, (off_t)blk * DEV_BSIZE,
sbin/dkctl/dkctl.c
541
if (read(fd, block, DEV_BSIZE) != DEV_BSIZE)
sbin/dkctl/dkctl.c
593
if (ioctl(fd, DIOCAWEDGE, &dkw) == -1)
sbin/dkctl/dkctl.c
613
if (ioctl(fd, DIOCDWEDGE, &dkw) == -1)
sbin/dkctl/dkctl.c
625
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == -1)
sbin/dkctl/dkctl.c
643
if (ioctl(fd, DIOCGMEDIASIZE, &bytes) == -1)
sbin/dkctl/dkctl.c
647
if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1)
sbin/dkctl/dkctl.c
690
if (ioctl(fd, DIOCLWEDGES, &dkwl) == -1)
sbin/dkctl/dkctl.c
736
if (ioctl(fd, DIOCMWEDGES, &bits) == -1)
sbin/dkctl/dkctl.c
87
static int fd; /* file descriptor for device */
sbin/drvctl/drvctl.c
113
fd = open(DRVCTLDEV, OPEN_MODE(mode), 0);
sbin/drvctl/drvctl.c
114
if (fd == -1)
sbin/drvctl/drvctl.c
124
if (ioctl(fd, DRVRESUMEDEV, &paa) == -1)
sbin/drvctl/drvctl.c
130
if (ioctl(fd, DRVSUSPENDDEV, &paa) == -1)
sbin/drvctl/drvctl.c
136
if (ioctl(fd, DRVDETACHDEV, &daa) == -1)
sbin/drvctl/drvctl.c
140
list_children(fd, argc ? argv[0] : NULL, nflag, tflag, 0);
sbin/drvctl/drvctl.c
157
if (ioctl(fd, DRVRESCANBUS, &raa) == -1)
sbin/drvctl/drvctl.c
171
res = prop_dictionary_sendrecv_ioctl(command_dict, fd,
sbin/drvctl/drvctl.c
291
list_children(int fd, char *dvname, bool nflag, bool tflag, int depth)
sbin/drvctl/drvctl.c
307
if (ioctl(fd, DRVLISTDEV, &laa) == -1)
sbin/drvctl/drvctl.c
315
if (ioctl(fd, DRVLISTDEV, &laa) == -1)
sbin/drvctl/drvctl.c
329
list_children(fd, laa.l_childname[i], nflag,
sbin/drvctl/drvctl.c
71
int fd, res;
sbin/dump/itime.c
172
int fd;
sbin/dump/itime.c
179
fd = fileno(df);
sbin/dump/itime.c
180
(void) flock(fd, LOCK_EX);
sbin/dump/itime.c
215
if (ftruncate(fd, ftell(df)))
sbin/dump/snapshot.c
113
fd = mkstemp(path);
sbin/dump/snapshot.c
117
fd = open(fss.fss_bstore, O_RDWR);
sbin/dump/snapshot.c
122
fd = open(fss.fss_bstore, O_CREAT|O_EXCL|O_WRONLY, 0600);
sbin/dump/snapshot.c
125
if (fd < 0)
sbin/dump/snapshot.c
128
if (fstat(fd, &sb) < 0)
sbin/dump/snapshot.c
140
if (ftruncate(fd, (off_t)fsb.f_frsize*fsb.f_bavail) < 0)
sbin/dump/snapshot.c
144
if (close(fd) < 0)
sbin/dump/snapshot.c
155
if ((fd = open(fss_dev, O_RDWR, 0)) < 0)
sbin/dump/snapshot.c
158
if (ioctl(fd, FSSIOCSET, &fss) < 0) {
sbin/dump/snapshot.c
161
close(fd);
sbin/dump/snapshot.c
162
fd = -1;
sbin/dump/snapshot.c
170
ioctl(fd, FSSIOCCLR);
sbin/dump/snapshot.c
175
if (ioctl(fd, FSSIOCGET, &fsg) < 0) {
sbin/dump/snapshot.c
176
ioctl(fd, FSSIOCCLR);
sbin/dump/snapshot.c
184
return fd;
sbin/dump/snapshot.c
192
if (fd >= 0)
sbin/dump/snapshot.c
193
close(fd);
sbin/dump/snapshot.c
59
int i, n, fd, israw, fsinternal, dounlink;
sbin/dump/snapshot.c
68
fd = -1;
sbin/dump/tape.c
102
int fd; /* FD for this worker */
sbin/dump/tape.c
286
if (atomic_write(wp->fd, wp->req, siz) != siz)
sbin/dump/tape.c
297
if (atomic_read(wp->fd, &got, sizeof got)
sbin/dump/tape.c
314
if (atomic_read(workers[i].fd,
sbin/dump/tape.c
370
if (atomic_read(workers[f].fd, &got, sizeof got)
sbin/dump/tape.c
382
(void) close(workers[f].fd);
sbin/dump/tape.c
510
if (atomic_write(wp->fd, q, size) != size) {
sbin/dump/tape.c
550
if (atomic_read(wp->fd, &got, sizeof got)
sbin/dump/tape.c
775
workers[i].fd = cmd[1];
sbin/dump/tape.c
779
(void) close(workers[j].fd);
sbin/dump/tape.c
788
(void) atomic_write(workers[i].fd,
sbin/dump/tape.c
937
atomic_read(int fd, void *buf, int count)
sbin/dump/tape.c
941
while ((got = read(fd, buf, need)) > 0 && (need -= got) > 0)
sbin/dump/tape.c
951
atomic_write(int fd, const void *buf, int count)
sbin/dump/tape.c
955
while ((got = write(fd, buf, need)) > 0 && (need -= got) > 0)
sbin/efi/efiio.c
103
get_next_variable(int fd, struct efi_var_ioc *ev)
sbin/efi/efiio.c
107
rv = ioctl(fd, EFIIOC_VAR_NEXT, ev);
sbin/efi/efiio.c
114
get_table(int fd, struct uuid *uuid, size_t *buflen)
sbin/efi/efiio.c
121
xioctl(fd, EFIIOC_GET_TABLE, &egt);
sbin/efi/efiio.c
125
xioctl(fd, EFIIOC_GET_TABLE, &egt);
sbin/efi/efiio.c
131
get_variable_info(int fd, bool (*choose)(struct efi_var_ioc *, void *),
sbin/efi/efiio.c
147
if (ioctl(fd, EFIIOC_VAR_NEXT, &ev) == -1) {
sbin/efi/efiio.c
161
rv = get_variable_core(fd, &ev);
sbin/efi/efiio.c
61
xioctl(int fd, unsigned long request, void *buf)
sbin/efi/efiio.c
65
rv = ioctl(fd, request, buf);
sbin/efi/efiio.c
72
set_variable(int fd, struct efi_var_ioc *ev)
sbin/efi/efiio.c
75
return ioctl(fd, EFIIOC_VAR_SET, ev);
sbin/efi/efiio.c
79
get_variable_core(int fd, struct efi_var_ioc *ev)
sbin/efi/efiio.c
82
if (xioctl(fd, EFIIOC_VAR_GET, ev) == -1)
sbin/efi/efiio.c
86
xioctl(fd, EFIIOC_VAR_GET, ev);
sbin/efi/efiio.c
91
get_variable(int fd, const char *name, struct uuid *vendor,
sbin/efi/efiio.c
97
get_variable_core(fd, &ev);
sbin/efi/getvars.c
135
get_variables(int fd, const char *regexp, efi_var_t ***array_ptr,
sbin/efi/getvars.c
154
var_cnt = get_variable_info(fd, choose_variable, save_variable, &args);
sbin/efi/gptsubr.c
323
int fd, rv;
sbin/efi/gptsubr.c
340
fd = open(p, O_RDONLY);
sbin/efi/gptsubr.c
341
if (fd == -1)
sbin/efi/gptsubr.c
344
rv = ioctl(fd, DIOCGWEDGEINFO, &dkinfo);
sbin/efi/gptsubr.c
345
close(fd);
sbin/efi/gptsubr.c
504
int fd = open(p, O_RDONLY);
sbin/efi/gptsubr.c
505
if (fd == -1)
sbin/efi/gptsubr.c
508
rv = ioctl(fd, DIOCGWEDGEINFO, &dkinfo);
sbin/efi/gptsubr.c
519
rv = ioctl(fd, DIOCGDINFO, &dl);
sbin/efi/gptsubr.c
542
close(fd);
sbin/efi/setvar.c
118
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
126
remove_bootorder(int fd, const char *target, const char *csus,
sbin/efi/setvar.c
136
ev = get_variable(fd, targetorder, &EFI_GLOBAL_VARIABLE, 0);
sbin/efi/setvar.c
166
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
174
set_bootorder(int fd, const char *target, const char *bootorder)
sbin/efi/setvar.c
194
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
203
delete_variable(int fd, const char *varname)
sbin/efi/setvar.c
214
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
220
del_bootorder(int fd, const char *target __unused)
sbin/efi/setvar.c
224
rv = delete_variable(fd, BOOTORDER);
sbin/efi/setvar.c
232
del_bootorder_dups(int fd, const char *target)
sbin/efi/setvar.c
241
ev = get_variable(fd, targetorder, &EFI_GLOBAL_VARIABLE, 0);
sbin/efi/setvar.c
264
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
272
set_bootnext(int fd, uint16_t bootnum)
sbin/efi/setvar.c
288
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
297
del_bootnext(int fd)
sbin/efi/setvar.c
301
rv = delete_variable(fd, BOOTNEXT);
sbin/efi/setvar.c
309
set_timeout(int fd, uint16_t timeout)
sbin/efi/setvar.c
325
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
334
del_timeout(int fd)
sbin/efi/setvar.c
338
rv = delete_variable(fd, TIMEOUT);
sbin/efi/setvar.c
372
del_variable(int fd, const char *varname)
sbin/efi/setvar.c
383
rv = set_variable(fd, &ev);
sbin/efi/setvar.c
83
prefix_bootorder(int fd, const char *target, const char *csus,
sbin/efi/setvar.c
93
ev = get_variable(fd, targetorder,
sbin/efi/setvar.h
33
int del_bootnext(int fd);
sbin/efi/setvar.h
34
int del_bootorder(int fd, const char *);
sbin/efi/utils.c
406
int fd, fd_flags;
sbin/efi/utils.c
413
fd = STDIN_FILENO;
sbin/efi/utils.c
414
if ((fd_flags = fcntl(fd, F_GETFL)) == -1)
sbin/efi/utils.c
417
if (fcntl(fd, F_SETFL, O_NONBLOCK | fd_flags) == -1)
sbin/efi/utils.c
422
fd = open(fname, O_RDONLY);
sbin/efi/utils.c
423
if (fd == -1)
sbin/efi/utils.c
433
ssz = read(fd, cp, (size_t)(ep - cp));
sbin/efi/utils.c
466
fcntl(fd, F_SETFL, fd_flags);
sbin/efi/utils.c
468
close(fd);
sbin/fdisk/fdisk.c
210
static int fd = -1, wfd = -1, *rfd = &fd;
sbin/fdisk/fdisk.c
2495
fd = opendisk(disk, flags, namebuf, sizeof(namebuf), 0);
sbin/fdisk/fdisk.c
2496
if (fd < 0) {
sbin/fdisk/fdisk.c
2505
fd = open(disk, flags, 0);
sbin/fdisk/fdisk.c
2506
if (fd == -1) {
sbin/fdisk/fdisk.c
2513
close(fd);
sbin/fdisk/fdisk.c
2514
fd = -1;
sbin/fdisk/fdisk.c
2522
close(fd);
sbin/fdisk/fdisk.c
2523
fd = -1;
sbin/fdisk/fdisk.c
2527
wfd = fd;
sbin/fdisk/fdisk.c
2609
if (fstat(fd, &st) == -1) {
sbin/fdisk/fdisk.c
2626
else if (ioctl(fd, DIOCGDEFLABEL, &disklabel) == -1) {
sbin/fdisk/fdisk.c
2628
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
sbin/fdisk/fdisk.c
2792
if (wfd == fd && F_flag == 0 && ioctl(wfd, DIOCWLABEL, &flag) < 0)
sbin/fdisk/fdisk.c
2816
if (wfd == fd && F_flag == 0 && ioctl(wfd, DIOCWLABEL, &flag) < 0)
sbin/fsck/fsck.c
556
int fd;
sbin/fsck/fsck.c
563
if ((fd = opendisk(str, O_RDONLY, buf, sizeof(buf), 0)) == -1)
sbin/fsck/fsck.c
567
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
sbin/fsck/fsck.c
569
(void) close(fd);
sbin/fsck/fsck.c
573
if (ioctl(fd, DIOCGDINFO, &dl) == -1)
sbin/fsck/fsck.c
576
(void) close(fd);
sbin/fsck/partutil.c
117
error = prop_dictionary_recv_ioctl(fd, DIOCGDISKINFO, &disk_dict);
sbin/fsck/partutil.c
130
if (ioctl(fd, DIOCGDINFO, lp) == -1) {
sbin/fsck/partutil.c
147
if (ioctl(fd, DIOCGWEDGEINFO, dkw) != -1) {
sbin/fsck/partutil.c
152
if (ioctl(fd, DIOCGDINFO, lp) == -1) {
sbin/fsck/partutil.c
187
int fd, error;
sbin/fsck/partutil.c
189
if ((fd = opendisk(name, O_RDONLY, buf, sizeof(buf), 0)) == -1)
sbin/fsck/partutil.c
192
error = getdiskinfo(name, fd, NULL, &geo, NULL);
sbin/fsck/partutil.c
193
close(fd);
sbin/fsck/partutil.c
99
getdiskinfo(const char *s, int fd, const char *dt, struct disk_geom *geo,
sbin/fsck/preen.c
287
int fd;
sbin/fsck/preen.c
289
if ((fd = opendisk(name, O_RDONLY, buf, sizeof(buf), 0)) != -1) {
sbin/fsck/preen.c
290
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) != -1)
sbin/fsck/preen.c
292
(void)close(fd);
sbin/fsck_ext2fs/utilities.c
223
flush(int fd, struct bufarea *bp)
sbin/fsck_ext2fs/utilities.c
235
bwrite(fd, bp->b_un.b_buf, bp->b_bno, (long)bp->b_size);
sbin/fsck_ext2fs/utilities.c
309
bread(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ext2fs/utilities.c
317
if (lseek(fd, offset, 0) < 0)
sbin/fsck_ext2fs/utilities.c
319
else if (read(fd, buf, (int)size) == size)
sbin/fsck_ext2fs/utilities.c
322
if (lseek(fd, offset, 0) < 0)
sbin/fsck_ext2fs/utilities.c
328
if (read(fd, cp, (int)secsize) != secsize) {
sbin/fsck_ext2fs/utilities.c
329
(void)lseek(fd, offset + i + secsize, 0);
sbin/fsck_ext2fs/utilities.c
345
bwrite(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ext2fs/utilities.c
351
if (fd < 0)
sbin/fsck_ext2fs/utilities.c
355
if (lseek(fd, offset, 0) < 0)
sbin/fsck_ext2fs/utilities.c
357
else if (write(fd, buf, (int)size) == size) {
sbin/fsck_ext2fs/utilities.c
362
if (lseek(fd, offset, 0) < 0)
sbin/fsck_ext2fs/utilities.c
366
if (write(fd, cp, (int)dev_bsize) != dev_bsize) {
sbin/fsck_ext2fs/utilities.c
367
(void)lseek(fd, offset + i + dev_bsize, 0);
sbin/fsck_ffs/setup.c
100
int fd;
sbin/fsck_ffs/setup.c
143
fd = open(origdev, O_RDONLY);
sbin/fsck_ffs/setup.c
144
if (fd < 0) {
sbin/fsck_ffs/setup.c
149
fd = fsreadfd;
sbin/fsck_ffs/setup.c
151
if (!forceimage && getdiskinfo(origdev, fd, NULL, &geo, &dkw) != -1)
sbin/fsck_ffs/utilities.c
223
flush(int fd, struct bufarea *bp)
sbin/fsck_ffs/utilities.c
236
bwrite(fd, bp->b_un.b_buf, bp->b_bno, (long)bp->b_size);
sbin/fsck_ffs/utilities.c
348
bread(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ffs/utilities.c
356
if ((pread(fd, buf, (int)size, offset) == size) &&
sbin/fsck_ffs/utilities.c
364
if (pread(fd, cp, (int)secsize, offset + i) != secsize) {
sbin/fsck_ffs/utilities.c
380
bwrite(int fd, char *buf, daddr_t blk, long size)
sbin/fsck_ffs/utilities.c
386
if (fd < 0)
sbin/fsck_ffs/utilities.c
390
if (pwrite(fd, buf, (int)size, offset) == size) {
sbin/fsck_ffs/utilities.c
397
if (pwrite(fd, cp, (int)dev_bsize, offset + i) != dev_bsize)
sbin/fsck_lfs/lfs.c
332
lfs_raw_vget(struct lfs * fs, ino_t ino, int fd, daddr_t daddr)
sbin/fsck_lfs/lfs.c
341
vp->v_fd = fd;
sbin/fsck_v7fs/fsck_v7fs.c
154
if ((fd = open(device, openflags)) == -1) {
sbin/fsck_v7fs/fsck_v7fs.c
157
if (fstat(fd, &st)) {
sbin/fsck_v7fs/fsck_v7fs.c
167
if ((fd = open(device, openflags)) == -1) {
sbin/fsck_v7fs/fsck_v7fs.c
172
if (ioctl(fd, DIOCGDINFO, &d) == -1) {
sbin/fsck_v7fs/fsck_v7fs.c
189
mount.device.fd = fd;
sbin/fsck_v7fs/fsck_v7fs.c
194
close(fd);
sbin/fsck_v7fs/fsck_v7fs.c
71
int fd, ch;
sbin/fsdb/fsdb.c
135
int fd;
sbin/fsdb/fsdb.c
1759
wrinfo.fd = open(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0644);
sbin/fsdb/fsdb.c
1760
if (wrinfo.fd == -1) {
sbin/fsdb/fsdb.c
572
wrinfo.fd = open(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0644);
sbin/fsdb/fsdb.c
573
if (wrinfo.fd == -1) {
sbin/fsdb/fsdb.c
884
if (write(wrp->fd, buf, size) != size)
sbin/fsirand/fsirand.c
133
fixinodes(int fd, struct fs *fs, struct disklabel *lab, int pflag, long xorval)
sbin/fsirand/fsirand.c
158
if (lseek(fd, sp, SEEK_SET) == (off_t) -1)
sbin/fsirand/fsirand.c
161
if (read(fd, buf, size) != size)
sbin/fsirand/fsirand.c
191
if (lseek(fd, sp, SEEK_SET) == (off_t) -1)
sbin/fsirand/fsirand.c
194
if (write(fd, buf, size) != size)
sbin/fsirand/fsirand.c
234
int fd, c, Fflag, pflag, openflags;
sbin/fsirand/fsirand.c
269
fd = open(special, openflags);
sbin/fsirand/fsirand.c
271
fd = opendisk(special, openflags, device, sizeof(device), 0);
sbin/fsirand/fsirand.c
274
if (fd == -1)
sbin/fsirand/fsirand.c
281
if (ioctl(fd, DIOCGDINFO, &lab) == -1)
sbin/fsirand/fsirand.c
287
getsblock(fd, special, fs);
sbin/fsirand/fsirand.c
288
fixinodes(fd, fs, &lab, pflag, xorval);
sbin/fsirand/fsirand.c
290
(void) close(fd);
sbin/fsirand/fsirand.c
86
getsblock(int fd, const char *name, struct fs *fs)
sbin/fsirand/fsirand.c
93
if (pread(fd, fs, SBLOCKSIZE, sblock_try[i]) != SBLOCKSIZE)
sbin/gpt/biosboot.c
310
ioctl(gpt->fd, DIOCGWEDGEINFO, &dkw) != -1) {
sbin/gpt/gpt.c
257
if (lseek(gpt->fd, ofs, SEEK_SET) == ofs &&
sbin/gpt/gpt.c
258
read(gpt->fd, buf, count) == (ssize_t)count)
sbin/gpt/gpt.c
277
if (lseek(gpt->fd, ofs, SEEK_SET) != ofs ||
sbin/gpt/gpt.c
278
write(gpt->fd, map->map_data, count) != (ssize_t)count)
sbin/gpt/gpt.c
505
gpt->fd = opendisk(dev, mode, gpt->device_name,
sbin/gpt/gpt.c
507
if (gpt->fd == -1 && !(gpt->flags & GPT_READONLY) && errno == EACCES) {
sbin/gpt/gpt.c
508
gpt->fd = opendisk(dev, O_RDONLY, gpt->device_name,
sbin/gpt/gpt.c
510
if (gpt->fd != -1) {
sbin/gpt/gpt.c
516
if (gpt->fd == -1 && !(gpt->flags & GPT_READONLY) && mediasz != 0 &&
sbin/gpt/gpt.c
520
gpt->fd = open(dev, O_RDWR|O_EXCL|O_CREAT, 0644);
sbin/gpt/gpt.c
522
if (gpt->fd == -1) {
sbin/gpt/gpt.c
528
if (fstat(gpt->fd, &gpt->sb) == -1) {
sbin/gpt/gpt.c
541
if (ioctl(gpt->fd, DIOCGSECTORSIZE, &gpt->secsz) == -1) {
sbin/gpt/gpt.c
553
if (ioctl(gpt->fd, DIOCGMEDIASIZE, &gpt->mediasz) == -1) {
sbin/gpt/gpt.c
649
if (gpt->fd != -1)
sbin/gpt/gpt.c
650
close(gpt->fd);
sbin/gpt/gpt.c
668
if (ioctl(gpt->fd, DIOCMWEDGES, &bits) == -1)
sbin/gpt/gpt.c
679
close(gpt->fd);
sbin/gpt/gpt_private.h
39
int fd;
sbin/gpt/gpt_uuid.c
287
int fd;
sbin/gpt/gpt_uuid.c
292
fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
sbin/gpt/gpt_uuid.c
293
if (fd == -1) {
sbin/gpt/gpt_uuid.c
298
nread = read(fd, p, n);
sbin/gpt/gpt_uuid.c
312
(void)close(fd);
sbin/gpt/gpt_uuid.c
320
(void)close(fd);
sbin/gpt/restore.c
284
if (lseek(gpt->fd, 0LL, SEEK_SET) == -1) {
sbin/gpt/restore.c
289
if (write(gpt->fd, secbuf, gpt->secsz) != (ssize_t)gpt->secsz) {
sbin/gpt/restore.c
294
if (lseek(gpt->fd, (lastdata + 1) * gpt->secsz, SEEK_SET) == -1) {
sbin/gpt/restore.c
299
if (write(gpt->fd, secbuf, gpt->secsz) != (ssize_t)gpt->secsz) {
sbin/gpt/restore.c
323
if (lseek(gpt->fd, 0LL, SEEK_SET) == -1 ||
sbin/gpt/restore.c
324
write(gpt->fd, mbr, gpt->secsz) != (ssize_t)gpt->secsz) {
sbin/gpt/restore.c
339
if (lseek(gpt->fd, 2 * gpt->secsz, SEEK_SET) == -1 ||
sbin/gpt/restore.c
340
write(gpt->fd, (char *)secbuf + gpt->secsz, len) != (ssize_t) len) {
sbin/gpt/restore.c
345
if (lseek(gpt->fd, (lastdata + 1) * gpt->secsz, SEEK_SET) == -1 ||
sbin/gpt/restore.c
346
write(gpt->fd, (char *)secbuf + gpt->secsz, len) != (ssize_t) len) {
sbin/gpt/restore.c
366
if (lseek(gpt->fd, gpt->secsz, SEEK_SET) == -1 ||
sbin/gpt/restore.c
367
write(gpt->fd, hdr, gpt->secsz) != (ssize_t)gpt->secsz) {
sbin/gpt/restore.c
377
if (lseek(gpt->fd, last * gpt->secsz, SEEK_SET) == -1 ||
sbin/gpt/restore.c
378
write(gpt->fd, hdr, gpt->secsz) != (ssize_t)gpt->secsz) {
sbin/init/init.c
404
int fd, len;
sbin/init/init.c
407
fd = open(_PATH_CONSOLE, O_WRONLY);
sbin/init/init.c
408
if (fd == -1)
sbin/init/init.c
413
(void)write(fd, (void *)errbuf, len);
sbin/init/init.c
414
(void)close(fd);
sbin/init/init.c
625
int fd;
sbin/init/init.c
629
if ((fd = open(name, O_RDWR)) == -1) {
sbin/init/init.c
633
if (login_tty(fd) == -1) {
sbin/ldconfig/ldconfig.c
382
int fd;
sbin/ldconfig/ldconfig.c
462
if ((fd = mkstemp(tempfile)) == -1) {
sbin/ldconfig/ldconfig.c
467
if (write(fd, &hdr, sizeof(struct hints_header)) !=
sbin/ldconfig/ldconfig.c
472
if ((size_t)write(fd, blist, hdr.hh_nbucket * sizeof(struct hints_bucket)) !=
sbin/ldconfig/ldconfig.c
477
if (write(fd, strtab, strtab_sz) != strtab_sz) {
sbin/ldconfig/ldconfig.c
481
if (fchmod(fd, 0444) == -1) {
sbin/ldconfig/ldconfig.c
485
if (close(fd) != 0) {
sbin/ldconfig/ldconfig.c
505
(void)close(fd);
sbin/ldconfig/ldconfig.c
515
int fd;
sbin/ldconfig/ldconfig.c
526
if ((fd = open(_PATH_LD_HINTS, O_RDONLY, 0)) == -1) {
sbin/ldconfig/ldconfig.c
531
if (fstat(fd, &st) == -1) {
sbin/ldconfig/ldconfig.c
542
addr = mmap(0, msize, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
sbin/ldconfig/ldconfig.c
594
if (fd != -1)
sbin/ldconfig/ldconfig.c
595
close(fd);
sbin/mount/mount.c
729
int fd;
sbin/mount/mount.c
736
if ((fd = open(str, O_RDONLY)) == -1) {
sbin/mount/mount.c
753
if ((fd = open(buf, O_RDONLY)) == -1)
sbin/mount/mount.c
758
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == 0) {
sbin/mount/mount.c
760
close(fd);
sbin/mount/mount.c
766
if (ioctl(fd, DIOCGDINFO, &dl) == -1) {
sbin/mount/mount.c
767
(void) close(fd);
sbin/mount/mount.c
771
(void) close(fd);
sbin/mount_portal/activate.c
107
send_reply(int so, int fd, int error)
sbin/mount_portal/activate.c
135
if (fd >= 0) {
sbin/mount_portal/activate.c
151
files[0] = fd;
sbin/mount_portal/activate.c
174
if (fd >= 0)
sbin/mount_portal/activate.c
175
(void) close(fd);
sbin/mount_portal/activate.c
187
int fd = -1;
sbin/mount_portal/activate.c
212
error = activate_argv(&pcred, key, v, &fd);
sbin/mount_portal/activate.c
214
fd = -1;
sbin/mount_portal/activate.c
215
else if (fd < 0)
sbin/mount_portal/activate.c
221
send_reply(so, fd, error);
sbin/mount_portal/pt_file.c
133
int fd;
sbin/mount_portal/pt_file.c
154
fd = open(pbuf, O_RDWR | O_CREAT, 0666);
sbin/mount_portal/pt_file.c
155
if (fd < 0) {
sbin/mount_portal/pt_file.c
162
fd = open(pbuf, O_RDONLY, 0);
sbin/mount_portal/pt_file.c
163
if (fd < 0) {
sbin/mount_portal/pt_file.c
179
if (fd >= 0) {
sbin/mount_portal/pt_file.c
180
(void) close(fd);
sbin/mount_portal/pt_file.c
181
fd = -1;
sbin/mount_portal/pt_file.c
185
*fdp = fd;
sbin/mount_portal/puffs_portal.c
113
readfd(struct puffs_framebuf *pufbuf, int fd, int *done)
sbin/mount_portal/puffs_portal.c
133
n = recvmsg(fd, &msg, 0);
sbin/mount_portal/puffs_portal.c
165
readdata(struct puffs_framebuf *pufbuf, int fd, int *done)
sbin/mount_portal/puffs_portal.c
181
n = read(fd, buf, MIN(sizeof(buf), max));
sbin/mount_portal/puffs_portal.c
189
close(fd);
sbin/mount_portal/puffs_portal.c
217
int fd, int *done)
sbin/mount_portal/puffs_portal.c
225
return readfd(pufbuf, fd, done);
sbin/mount_portal/puffs_portal.c
227
return readdata(pufbuf, fd, done);
sbin/mount_portal/puffs_portal.c
234
int fd, int *done)
sbin/mount_portal/puffs_portal.c
250
n = write(fd, win, winlen);
sbin/mount_portal/puffs_portal.c
277
sendfd(int s, int fd, int error)
sbin/mount_portal/puffs_portal.c
302
*(int *)CMSG_DATA(cmp) = fd;
sbin/mount_portal/puffs_portal.c
331
int fd, error;
sbin/mount_portal/puffs_portal.c
351
error = activate_argv(portc, portn->path, v, &fd);
sbin/mount_portal/puffs_portal.c
352
sendfd(s[1], fd, error);
sbin/mount_portal/puffs_portal.c
377
&fd, sizeof(int));
sbin/mount_portal/puffs_portal.c
381
if (ioctl(fd, FIONBIO, &data) == -1)
sbin/mount_portal/puffs_portal.c
384
if (puffs_framev_addfd(pu, fd, PUFFS_FBIO_WRITE) == -1)
sbin/mount_portal/puffs_portal.c
387
portn->fd = fd;
sbin/mount_portal/puffs_portal.c
493
portn->fd = -1;
sbin/mount_portal/puffs_portal.c
55
int fd;
sbin/mount_portal/puffs_portal.c
580
if (portn->fd == -1) {
sbin/mount_portal/puffs_portal.c
589
if (fstat(portn->fd, &st) == -1)
sbin/mount_portal/puffs_portal.c
614
puffs_framev_removefd(pu, portn->fd, 0);
sbin/mount_portal/puffs_portal.c
615
close(portn->fd);
sbin/mount_portal/puffs_portal.c
616
portn->fd = -1;
sbin/mount_portal/puffs_portal.c
671
rv = puffs_framev_enablefd(pu, portn->fd, PUFFS_FBIO_READ);
sbin/mount_portal/puffs_portal.c
682
rv = readdata(pufbuf, portn->fd, &dummy);
sbin/mount_portal/puffs_portal.c
689
portn->fd, pufbuf, 0);
sbin/mount_portal/puffs_portal.c
719
puffs_framev_disablefd(pu, portn->fd, PUFFS_FBIO_READ);
sbin/mount_portal/puffs_portal.c
746
rv = portal_frame_wf(pu, pufbuf, portn->fd, &dummy);
sbin/mount_portal/puffs_portal.c
752
rv = puffs_framev_enqueue_directsend(pcc, portn->fd, pufbuf, 0);
sbin/mount_portal/puffs_portal.c
777
if (opc == PORTAL_ROOT || portn->fd == -1)
sbin/mount_portal/puffs_portal.c
780
if (lseek(portn->fd, newoff, SEEK_SET) == -1)
sbin/mount_portal/puffs_portal.c
800
if (puffs_framev_enqueue_waitevent(pcc, portn->fd, &what) == -1) {
sbin/mount_portal/puffs_portal.c
832
if (portn->fd != -1) {
sbin/mount_portal/puffs_portal.c
833
puffs_framev_removefd(pu, portn->fd, 0);
sbin/mount_portal/puffs_portal.c
834
close(portn->fd);
sbin/newfs_lfs/newfs.c
114
auto_segsize(int fd, off_t len, int version)
sbin/newfs_lfs/newfs.c
127
if (pread(fd, buf, CHUNKSIZE, off) < 0)
sbin/newfs_lfs/newfs.c
140
if (pread(fd, buf, dbtob(1), dbtob(off)) < 0)
sbin/newfs_msdos/mkfs_msdos.c
264
int ch, fd, fd1;
sbin/newfs_msdos/mkfs_msdos.c
286
fd = open(fname, oflags, 0644);
sbin/newfs_msdos/mkfs_msdos.c
287
if (fd == -1) {
sbin/newfs_msdos/mkfs_msdos.c
291
(void)lseek(fd, o.create_size - 1, SEEK_SET);
sbin/newfs_msdos/mkfs_msdos.c
292
if (write(fd, "\0", 1) != 1) {
sbin/newfs_msdos/mkfs_msdos.c
296
(void)lseek(fd, 0, SEEK_SET);
sbin/newfs_msdos/mkfs_msdos.c
297
} else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1 ||
sbin/newfs_msdos/mkfs_msdos.c
298
fstat(fd, &sb)) {
sbin/newfs_msdos/mkfs_msdos.c
311
if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) {
sbin/newfs_msdos/mkfs_msdos.c
336
if (getbpbinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb,
sbin/newfs_msdos/mkfs_msdos.c
758
if ((n = write(fd, img, bpb.bps)) == -1) {
sbin/newfs_msdos/mkfs_msdos.c
828
getbpbinfo(int fd, const char *fname, const char *dtype, int iflag,
sbin/newfs_msdos/mkfs_msdos.c
868
if (getdiskinfo(fname, fd, NULL, &geo, &dkw) != -1) {
sbin/newfs_msdos/mkfs_msdos.c
878
if (fstat(fd, &st) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
109
if (ioctl(fd, DIOCGDINFO, &d) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
134
fd = open(device, O_RDWR|O_CREAT|O_TRUNC, 0666);
sbin/newfs_sysvbfs/newfs_sysvbfs.c
135
if (fd == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
144
if ((size_t)write(fd, zbuf, writenow) != writenow) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
151
if (lseek(fd, filesize-1, SEEK_SET) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
155
if (write(fd, zbuf, 1) != 1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
159
if (lseek(fd, 0, SEEK_SET) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
166
if (bfs_newfs(fd, partsize) != 0)
sbin/newfs_sysvbfs/newfs_sysvbfs.c
169
close(fd);
sbin/newfs_sysvbfs/newfs_sysvbfs.c
173
close(fd);
sbin/newfs_sysvbfs/newfs_sysvbfs.c
178
bfs_newfs(int fd, uint32_t nsectors)
sbin/newfs_sysvbfs/newfs_sysvbfs.c
197
if ((error = lseek(fd, 0, SEEK_SET)) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
201
if (write(fd, buf, BFS_BSIZE) < 0) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
219
if (write(fd, buf, BFS_BSIZE) < 0) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
231
if (write(fd, buf, BFS_BSIZE) < 0) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
65
int fd, ch;
sbin/newfs_sysvbfs/newfs_sysvbfs.c
95
if ((fd = open(device, O_RDWR)) == -1) {
sbin/newfs_sysvbfs/newfs_sysvbfs.c
99
if (fstat(fd, &st) != 0) {
sbin/newfs_v7fs/newfs_v7fs.c
130
if ((fd = open(device, O_RDWR)) == -1) {
sbin/newfs_v7fs/newfs_v7fs.c
133
if (fstat(fd, &st) != 0) {
sbin/newfs_v7fs/newfs_v7fs.c
142
if (ioctl(fd, DIOCGDINFO, &d) == -1) {
sbin/newfs_v7fs/newfs_v7fs.c
166
fd = open(device, O_RDWR|O_CREAT|O_TRUNC, 0666);
sbin/newfs_v7fs/newfs_v7fs.c
167
if (fd == -1) {
sbin/newfs_v7fs/newfs_v7fs.c
176
if ((size_t)write(fd, zbuf, writenow) !=
sbin/newfs_v7fs/newfs_v7fs.c
183
if (lseek(fd, filesize - 1, SEEK_SET) == -1) {
sbin/newfs_v7fs/newfs_v7fs.c
186
if (write(fd, zbuf, 1) != 1) {
sbin/newfs_v7fs/newfs_v7fs.c
189
if (lseek(fd, 0, SEEK_SET) == -1) {
sbin/newfs_v7fs/newfs_v7fs.c
196
{ .device.fd = fd, .endian = endian, .sectors = partsize },
sbin/newfs_v7fs/newfs_v7fs.c
200
close(fd);
sbin/newfs_v7fs/newfs_v7fs.c
204
close(fd);
sbin/newfs_v7fs/newfs_v7fs.c
70
int fd, ch;
sbin/nvmectl/devlist.c
103
read_controller_data(fd, &cdata);
sbin/nvmectl/devlist.c
110
read_namespace_data(fd, i+1, &nsdata);
sbin/nvmectl/devlist.c
118
close(fd);
sbin/nvmectl/devlist.c
76
int ch, ctrlr, fd, found, ret;
sbin/nvmectl/devlist.c
92
ret = open_dev(name, &fd, 0, 0);
sbin/nvmectl/firmware.c
107
if ((*size = read(fd, *buf, filesize)) < 0)
sbin/nvmectl/firmware.c
117
update_firmware(int fd, uint8_t *payload, int32_t payload_size)
sbin/nvmectl/firmware.c
142
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/firmware.c
154
activate_firmware(int fd, int slot, int commit_action)
sbin/nvmectl/firmware.c
163
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/firmware.c
188
int fd = -1;
sbin/nvmectl/firmware.c
252
open_dev(controller, &fd, 1, 1);
sbin/nvmectl/firmware.c
253
read_controller_data(fd, &cdata);
sbin/nvmectl/firmware.c
268
if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot))
sbin/nvmectl/firmware.c
307
update_firmware(fd, buf, size);
sbin/nvmectl/firmware.c
316
reboot_required = activate_firmware(fd, slot, commit_action);
sbin/nvmectl/firmware.c
332
close(fd);
sbin/nvmectl/firmware.c
62
slot_has_valid_firmware(int fd, int slot)
sbin/nvmectl/firmware.c
67
read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, 0xffffffff, &fw, sizeof(fw));
sbin/nvmectl/firmware.c
80
int fd;
sbin/nvmectl/firmware.c
85
if ((fd = open(path, O_RDONLY)) < 0)
sbin/nvmectl/firmware.c
87
if (fstat(fd, &sb) < 0)
sbin/nvmectl/identify.c
200
int ch, fd, hexflag = 0, hexlength;
sbin/nvmectl/identify.c
220
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/identify.c
221
read_controller_data(fd, &cdata);
sbin/nvmectl/identify.c
222
close(fd);
sbin/nvmectl/identify.c
248
int ch, fd, hexflag = 0, hexlength, nsid;
sbin/nvmectl/identify.c
273
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/identify.c
274
close(fd);
sbin/nvmectl/identify.c
283
open_dev(path, &fd, 1, 1);
sbin/nvmectl/identify.c
284
read_namespace_data(fd, nsid, &nsdata);
sbin/nvmectl/identify.c
285
close(fd);
sbin/nvmectl/logpage.c
1037
open_dev(cname, &fd, 1, 1);
sbin/nvmectl/logpage.c
1041
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/logpage.c
1044
read_controller_data(fd, &cdata);
sbin/nvmectl/logpage.c
109
read_logpage(int fd, uint8_t log_page, int nsid, void *payload,
sbin/nvmectl/logpage.c
1092
read_logpage(fd, log_page, nsid, buf, size);
sbin/nvmectl/logpage.c
1095
close(fd);
sbin/nvmectl/logpage.c
123
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/logpage.c
982
int fd, nsid;
sbin/nvmectl/nvmectl.c
154
read_controller_data(int fd, struct nvm_identify_controller *cdata)
sbin/nvmectl/nvmectl.c
165
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/nvmectl.c
176
read_namespace_data(int fd, int nsid, struct nvm_identify_namespace *nsdata)
sbin/nvmectl/nvmectl.c
187
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/nvmectl.c
198
open_dev(const char *str, int *fd, int show_error, int exit_on_error)
sbin/nvmectl/nvmectl.c
213
*fd = open(full_path, O_RDWR);
sbin/nvmectl/nvmectl.c
214
if (*fd < 0) {
sbin/nvmectl/perftest.c
179
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/perftest.c
180
if (ioctl(fd, ioctl_cmd, &io_test) < 0)
sbin/nvmectl/perftest.c
183
close(fd);
sbin/nvmectl/perftest.c
91
int fd;
sbin/nvmectl/power.c
109
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/power.c
117
power_show(int fd)
sbin/nvmectl/power.c
125
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/power.c
140
int ch, listflag = 0, powerflag = 0, power_val = 0, fd, saveflag = 0;
sbin/nvmectl/power.c
181
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/power.c
182
read_controller_data(fd, &cdata);
sbin/nvmectl/power.c
190
power_set(fd, power_val, workload, saveflag);
sbin/nvmectl/power.c
193
power_show(fd);
sbin/nvmectl/power.c
196
close(fd);
sbin/nvmectl/power.c
99
power_set(int fd, int power_val, int workload, int saveflag)
sbin/nvmectl/reset.c
63
int ch, fd;
sbin/nvmectl/reset.c
76
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/reset.c
77
if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
sbin/nvmectl/wdc.c
101
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmectl/wdc.c
108
wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode,
sbin/nvmectl/wdc.c
122
wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix);
sbin/nvmectl/wdc.c
137
wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid);
sbin/nvmectl/wdc.c
177
int ch, fd;
sbin/nvmectl/wdc.c
192
open_dev(argv[optind], &fd, 1, 1);
sbin/nvmectl/wdc.c
194
wdc_do_dump(fd, path_tmpl, "cap_diag", WDC_NVME_CAP_DIAG_OPCODE,
sbin/nvmectl/wdc.c
197
close(fd);
sbin/nvmectl/wdc.c
67
wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix)
sbin/nvmectl/wdc.c
75
read_controller_data(fd, &cdata);
sbin/nvmectl/wdc.c
85
wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd,
sbin/ping/ping.c
788
fdmaskp[0].fd = s;
sbin/ping6/ping6.c
975
fdmaskp[0].fd = s;
sbin/raidctl/raidctl.c
1004
do_ioctl(fd, RAIDFRAME_REWRITEPARITY, NULL,
sbin/raidctl/raidctl.c
1010
do_meter(fd,
sbin/raidctl/raidctl.c
1013
do_ioctl(fd,
sbin/raidctl/raidctl.c
1020
do_ioctl(fd,
sbin/raidctl/raidctl.c
1038
check_status(int fd, int meter)
sbin/raidctl/raidctl.c
1043
do_ioctl(fd, RAIDFRAME_CHECK_RECON_STATUS, &recon_percent_done,
sbin/raidctl/raidctl.c
1046
do_ioctl(fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS,
sbin/raidctl/raidctl.c
1055
do_meter(fd,RAIDFRAME_CHECK_RECON_STATUS_EXT);
sbin/raidctl/raidctl.c
1058
do_meter(fd,RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT);
sbin/raidctl/raidctl.c
1066
do_meter(int fd, u_long option)
sbin/raidctl/raidctl.c
1090
do_ioctl(fd, option, pInfoPtr, "");
sbin/raidctl/raidctl.c
1153
do_ioctl( fd, option, pInfoPtr, "");
sbin/raidctl/raidctl.c
1254
rf_simple_create(int fd, int argc, char *argv[])
sbin/raidctl/raidctl.c
128
int fd;
sbin/raidctl/raidctl.c
1351
do_ioctl(fd, RAIDFRAME_CONFIGURE, &generic, "RAIDFRAME_CONFIGURE");
sbin/raidctl/raidctl.c
1354
do_ioctl(fd, RAIDFRAME_REWRITEPARITY, NULL,
sbin/raidctl/raidctl.c
148
fd = opendisk(name, openmode, dev_name, sizeof(dev_name), 0);
sbin/raidctl/raidctl.c
149
if (fd != -1) {
sbin/raidctl/raidctl.c
151
if (fstat(fd, &st) == -1)
sbin/raidctl/raidctl.c
158
rf_simple_create(fd,argc-3,&argv[3]);
sbin/raidctl/raidctl.c
167
init_component_labels(fd, serial_number);
sbin/raidctl/raidctl.c
169
set_autoconfig(fd, raidID, autoconf);
sbin/raidctl/raidctl.c
174
close(fd);
sbin/raidctl/raidctl.c
346
fd = opendisk1(name, openmode, dev_name, sizeof(dev_name), 0,
sbin/raidctl/raidctl.c
348
if (fd == -1)
sbin/raidctl/raidctl.c
350
if (prog_fstat(fd, &st) == -1)
sbin/raidctl/raidctl.c
359
add_hot_spare(fd, component);
sbin/raidctl/raidctl.c
362
remove_component(fd, component);
sbin/raidctl/raidctl.c
365
rf_configure(fd, config_filename, force);
sbin/raidctl/raidctl.c
368
set_autoconfig(fd, raidID, autoconf);
sbin/raidctl/raidctl.c
371
rf_fail_disk(fd, component, do_recon);
sbin/raidctl/raidctl.c
374
set_component_label(fd, component);
sbin/raidctl/raidctl.c
377
get_component_label(fd, component);
sbin/raidctl/raidctl.c
380
init_component_labels(fd, serial_number);
sbin/raidctl/raidctl.c
384
do_ioctl(fd, RAIDFRAME_REWRITEPARITY, NULL,
sbin/raidctl/raidctl.c
389
do_meter(fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT);
sbin/raidctl/raidctl.c
393
check_status(fd,1);
sbin/raidctl/raidctl.c
397
rf_output_configuration(fd, dev_name);
sbin/raidctl/raidctl.c
399
rf_get_device_status(fd);
sbin/raidctl/raidctl.c
402
rf_output_pmstat(fd, raidID);
sbin/raidctl/raidctl.c
405
rf_pm_configure(fd, raidID, parityconf, parityparams);
sbin/raidctl/raidctl.c
408
rebuild_in_place(fd, component);
sbin/raidctl/raidctl.c
411
check_parity(fd, do_rewrite, dev_name);
sbin/raidctl/raidctl.c
414
do_ioctl(fd, RAIDFRAME_SHUTDOWN, NULL, "RAIDFRAME_SHUTDOWN");
sbin/raidctl/raidctl.c
417
do_ioctl(fd, RAIDFRAME_SET_LAST_UNIT, &last_unit,
sbin/raidctl/raidctl.c
421
do_ioctl(fd, RAIDFRAME_RESCAN, NULL, "RAIDFRAME_RESCAN");
sbin/raidctl/raidctl.c
427
prog_close(fd);
sbin/raidctl/raidctl.c
432
do_ioctl(int fd, unsigned long command, void *arg, const char *ioctl_name)
sbin/raidctl/raidctl.c
434
if (prog_ioctl(fd, command, arg) == -1)
sbin/raidctl/raidctl.c
440
rf_configure(int fd, char *config_file, int force)
sbin/raidctl/raidctl.c
457
do_ioctl(fd, RAIDFRAME_CONFIGURE, &generic, "RAIDFRAME_CONFIGURE");
sbin/raidctl/raidctl.c
486
rf_get_device_status(int fd)
sbin/raidctl/raidctl.c
495
do_ioctl(fd, RAIDFRAME_GET_INFO, &cfg_ptr, "RAIDFRAME_GET_INFO");
sbin/raidctl/raidctl.c
518
get_component_label(fd, device_config.devs[i].devname);
sbin/raidctl/raidctl.c
532
get_component_label(fd,
sbin/raidctl/raidctl.c
543
do_ioctl(fd, RAIDFRAME_CHECK_PARITY, &is_clean,
sbin/raidctl/raidctl.c
550
check_status(fd,0);
sbin/raidctl/raidctl.c
554
rf_output_pmstat(int fd, int raidID)
sbin/raidctl/raidctl.c
561
if (prog_ioctl(fd, RAIDFRAME_PARITYMAP_STATUS, &st) == -1) {
sbin/raidctl/raidctl.c
605
do_ioctl(fd, RAIDFRAME_PARITYMAP_GET_DISABLE, &dis,
sbin/raidctl/raidctl.c
612
rf_pm_configure(int fd, int raidID, char *parityconf, int parityparams[])
sbin/raidctl/raidctl.c
626
do_ioctl(fd, RAIDFRAME_PARITYMAP_SET_PARAMS, &params,
sbin/raidctl/raidctl.c
649
do_ioctl(fd, RAIDFRAME_PARITYMAP_SET_DISABLE, &dis,
sbin/raidctl/raidctl.c
665
rf_output_configuration(int fd, const char *name)
sbin/raidctl/raidctl.c
679
do_ioctl(fd, RAIDFRAME_GET_INFO, &cfg_ptr, "RAIDFRAME_GET_INFO");
sbin/raidctl/raidctl.c
711
get_component_number(fd, device_config.devs[i].devname,
sbin/raidctl/raidctl.c
717
do_ioctl(fd, RAIDFRAME_GET_COMPONENT_LABEL, label_ptr,
sbin/raidctl/raidctl.c
734
get_component_number(int fd, char *component_name, int *component_number,
sbin/raidctl/raidctl.c
746
do_ioctl(fd, RAIDFRAME_GET_INFO, &cfg_ptr,
sbin/raidctl/raidctl.c
782
rf_fail_disk(int fd, char *component_to_fail, int do_recon)
sbin/raidctl/raidctl.c
788
get_component_number(fd, component_to_fail, &component_num, &num_cols);
sbin/raidctl/raidctl.c
796
do_ioctl(fd, RAIDFRAME_FAIL_DISK, &recon_request,
sbin/raidctl/raidctl.c
801
do_meter(fd,RAIDFRAME_CHECK_RECON_STATUS_EXT);
sbin/raidctl/raidctl.c
806
get_component_label(int fd, char *component)
sbin/raidctl/raidctl.c
813
get_component_number(fd, component, &component_num, &num_cols);
sbin/raidctl/raidctl.c
820
do_ioctl( fd, RAIDFRAME_GET_COMPONENT_LABEL, label_ptr,
sbin/raidctl/raidctl.c
849
set_component_label(int fd, char *component)
sbin/raidctl/raidctl.c
855
get_component_number(fd, component, &component_num, &num_cols);
sbin/raidctl/raidctl.c
869
do_ioctl( fd, RAIDFRAME_SET_COMPONENT_LABEL, &component_label,
sbin/raidctl/raidctl.c
875
init_component_labels(int fd, int serial_number)
sbin/raidctl/raidctl.c
889
do_ioctl( fd, RAIDFRAME_INIT_LABELS, &component_label,
sbin/raidctl/raidctl.c
894
set_autoconfig(int fd, int raidID, char *autoconf)
sbin/raidctl/raidctl.c
915
do_ioctl(fd, RAIDFRAME_SET_AUTOCONFIG, &auto_config,
sbin/raidctl/raidctl.c
918
do_ioctl(fd, RAIDFRAME_SET_ROOT, &root_config,
sbin/raidctl/raidctl.c
931
add_hot_spare(int fd, char *component)
sbin/raidctl/raidctl.c
940
do_ioctl( fd, RAIDFRAME_ADD_HOT_SPARE, &hot_spare,
sbin/raidctl/raidctl.c
945
remove_component(int fd, char *component)
sbin/raidctl/raidctl.c
951
get_component_number(fd, component, &component_num, &num_cols);
sbin/raidctl/raidctl.c
959
do_ioctl( fd, RAIDFRAME_REMOVE_COMPONENT, &comp,
sbin/raidctl/raidctl.c
964
rebuild_in_place(int fd, char *component)
sbin/raidctl/raidctl.c
970
get_component_number(fd, component, &component_num, &num_cols);
sbin/raidctl/raidctl.c
976
do_ioctl( fd, RAIDFRAME_REBUILD_IN_PLACE, &comp,
sbin/raidctl/raidctl.c
982
do_meter(fd,RAIDFRAME_CHECK_RECON_STATUS_EXT);
sbin/raidctl/raidctl.c
988
check_parity(int fd, int do_rewrite, char *dev_name)
sbin/raidctl/raidctl.c
995
do_ioctl(fd, RAIDFRAME_CHECK_PARITY, &is_clean,
sbin/resize_ffs/resize_ffs.c
180
fstat(fd, &stb);
sbin/resize_ffs/resize_ffs.c
189
fstat(fd, &stb);
sbin/resize_ffs/resize_ffs.c
200
if (lseek(fd, blkno * DEV_BSIZE, L_SET) < 0)
sbin/resize_ffs/resize_ffs.c
2124
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) != -1)
sbin/resize_ffs/resize_ffs.c
2126
if (ioctl(fd, DIOCGDINFO, &lp) != -1) {
sbin/resize_ffs/resize_ffs.c
213
rv = read(fd, bp, n);
sbin/resize_ffs/resize_ffs.c
2133
if (fstat(fd, &st) != -1 && S_ISREG(st.st_mode))
sbin/resize_ffs/resize_ffs.c
2213
fd = open(special, O_RDWR, 0);
sbin/resize_ffs/resize_ffs.c
2214
if (fd < 0)
sbin/resize_ffs/resize_ffs.c
224
rv = read(fd, buf, size);
sbin/resize_ffs/resize_ffs.c
2312
ftruncate(fd,newsize * DEV_BSIZE);
sbin/resize_ffs/resize_ffs.c
240
if (lseek(fd, blkno * DEV_BSIZE, L_SET) < 0)
sbin/resize_ffs/resize_ffs.c
252
rv = write(fd, bp, n);
sbin/resize_ffs/resize_ffs.c
263
rv = write(fd, buf, size);
sbin/resize_ffs/resize_ffs.c
69
static int fd;
sbin/restore/dirs.c
578
int fd;
sbin/restore/dirs.c
580
if ((fd = open(name, O_RDONLY)) == -1)
sbin/restore/dirs.c
583
(void)close(fd);
sbin/restore/dirs.c
586
rdirp->dd_fd = fd;
sbin/restore/symtab.c
456
FILE *fd;
sbin/restore/symtab.c
462
if ((fd = fopen(filename, "w")) == NULL) {
sbin/restore/symtab.c
467
clearerr(fd);
sbin/restore/symtab.c
476
(int)allocsize(ep->e_namlen), fd);
sbin/restore/symtab.c
503
(void) fwrite((char *)tep, sizeof(struct entry), 1, fd);
sbin/restore/symtab.c
514
(void) fwrite((char *)&tentry, sizeof(struct entry *), 1, fd);
sbin/restore/symtab.c
523
(void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd);
sbin/restore/symtab.c
524
if (ferror(fd)) {
sbin/restore/symtab.c
529
(void) fclose(fd);
sbin/restore/symtab.c
545
int fd;
sbin/restore/symtab.c
558
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
sbin/restore/symtab.c
562
if (fstat(fd, &stbuf) < 0) {
sbin/restore/symtab.c
570
if (read(fd, base, (int)tblsize) < 0 ||
sbin/restore/symtab.c
571
read(fd, (char *)&hdr, sizeof(struct symtableheader)) < 0) {
sbin/restore/symtab.c
575
(void)close(fd);
sbin/restore/tape.c
835
set_extattr(int fd, char *name, void *buf, int size, enum set_extattr_mode mode)
sbin/restore/tape.c
868
res = extattr_set_fd(fd, eap->ea_namespace,
sbin/restore/tape.c
901
error = acl_set_fd(fd, EXTATTR_CONTENT(eap));
sbin/restore/tape.c
926
error = acl_set_fd(fd, EXTATTR_CONTENT(eap));
sbin/rndctl/rndctl.c
434
int fd;
sbin/rndctl/rndctl.c
437
fd = open(_PATH_URANDOM, O_RDONLY, 0644);
sbin/rndctl/rndctl.c
438
if (fd < 0)
sbin/rndctl/rndctl.c
441
res = ioctl(fd, RNDCTL, rctl);
sbin/rndctl/rndctl.c
445
close(fd);
sbin/rndctl/rndctl.c
497
int fd;
sbin/rndctl/rndctl.c
502
fd = open(_PATH_URANDOM, O_RDONLY, 0644);
sbin/rndctl/rndctl.c
503
if (fd < 0)
sbin/rndctl/rndctl.c
508
res = ioctl(fd, RNDGETESTNAME, &rstat_name);
sbin/rndctl/rndctl.c
515
close(fd);
sbin/rndctl/rndctl.c
528
res = ioctl(fd, RNDGETESTNUM, &rstat);
sbin/rndctl/rndctl.c
545
close(fd);
sbin/rndctl/rndctl.c
552
int fd;
sbin/rndctl/rndctl.c
554
fd = open(_PATH_URANDOM, O_RDONLY, 0644);
sbin/rndctl/rndctl.c
555
if (fd < 0)
sbin/rndctl/rndctl.c
558
if (ioctl(fd, RNDGETPOOLSTAT, &rs) < 0)
sbin/rndctl/rndctl.c
564
close(fd);
sbin/routed/trace.c
198
int fd;
sbin/routed/trace.c
208
fd = open(_PATH_DEVNULL, O_RDWR);
sbin/routed/trace.c
209
if (fd == -1)
sbin/routed/trace.c
212
(void)dup2(fd, STDIN_FILENO);
sbin/routed/trace.c
214
(void)dup2(fd, STDOUT_FILENO);
sbin/routed/trace.c
216
(void)dup2(fd, STDERR_FILENO);
sbin/routed/trace.c
217
(void)close(fd);
sbin/savecore/savecore.c
903
int fd;
sbin/savecore/savecore.c
905
if ((fd = open(name, rw, 0)) < 0) {
sbin/savecore/savecore.c
909
return (fd);
sbin/savecore/savecore.c
913
Lseek(int fd, off_t off, int flag)
sbin/savecore/savecore.c
917
ret = lseek(fd, off, flag);
sbin/savecore/savecore.c
927
int fd;
sbin/savecore/savecore.c
929
fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
sbin/savecore/savecore.c
930
if (fd < 0) {
sbin/savecore/savecore.c
934
return (fd);
sbin/scan_ffs/scan_ffs.c
430
scan_disk(int fd, daddr_t beg, daddr_t end, int fflags)
sbin/scan_ffs/scan_ffs.c
452
if (pread(fd, buf, sizeof(buf), blk * 512) == -1) {
sbin/scan_ffs/scan_ffs.c
453
if (fflag && fd >= 0)
sbin/scan_ffs/scan_ffs.c
454
(void)close(fd);
sbin/scan_ffs/scan_ffs.c
483
if (fflag && fd >= 0)
sbin/scan_ffs/scan_ffs.c
484
(void)close(fd);
sbin/scan_ffs/scan_ffs.c
503
int ch, fd;
sbin/scan_ffs/scan_ffs.c
557
fd = open(fpath, O_RDONLY | O_DIRECT);
sbin/scan_ffs/scan_ffs.c
562
fd = opendisk(argv[0], O_RDONLY, device, sizeof(device), 0);
sbin/scan_ffs/scan_ffs.c
564
if (ioctl(fd, DIOCGDINFO, &dl) == -1) {
sbin/scan_ffs/scan_ffs.c
578
if (fd == -1)
sbin/scan_ffs/scan_ffs.c
582
return scan_disk(fd, beg, end, flags);
sbin/scsictl/scsi_subr.c
110
scsi_command(fd, &cmd, sizeof(cmd), buf, len, 10000, SCCMD_READ);
sbin/scsictl/scsi_subr.c
114
scsi_mode_select(int fd, u_int8_t byte2, void *buf, size_t len)
sbin/scsictl/scsi_subr.c
124
scsi_command(fd, &cmd, sizeof(cmd), buf, len, 10000, SCCMD_WRITE);
sbin/scsictl/scsi_subr.c
128
scsi_request_sense(int fd, void *buf, size_t len)
sbin/scsictl/scsi_subr.c
137
scsi_command(fd, &cmd, sizeof(cmd), buf, len, 10000, SCCMD_READ);
sbin/scsictl/scsi_subr.c
62
scsi_command(int fd, const void *cmd, size_t cmdlen,
sbin/scsictl/scsi_subr.c
78
if (ioctl(fd, SCIOCCOMMAND, &req) == -1)
sbin/scsictl/scsi_subr.c
99
scsi_mode_sense(int fd, u_int8_t pgcode, u_int8_t pctl, void *buf, size_t len)
sbin/scsictl/scsictl.c
1048
scsi_mode_sense(fd, 0x08, 0x00, &data, sizeof(data));
sbin/scsictl/scsictl.c
1062
scsi_mode_select(fd, byte2, &data, dlen);
sbin/scsictl/scsictl.c
1086
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
1126
scsi_command(fd, &cmd, sizeof(cmd), pd, sizeof(pd), 10000, SCCMD_WRITE);
sbin/scsictl/scsictl.c
1183
scsi_command(fd, &cmd, sizeof(cmd), data, dlen, 30000, SCCMD_READ);
sbin/scsictl/scsictl.c
1232
scsi_mode_sense(fd, 0x01, 0x00, &data, sizeof(data));
sbin/scsictl/scsictl.c
1286
scsi_mode_sense(fd, 0x01, 0x00, &data, sizeof(data));
sbin/scsictl/scsictl.c
1297
scsi_mode_select(fd, byte2, &data, dlen);
sbin/scsictl/scsictl.c
1319
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
1343
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
1367
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 30000, 0);
sbin/scsictl/scsictl.c
1391
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 30000, 0);
sbin/scsictl/scsictl.c
1414
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
1436
if (ioctl(fd, SCBUSIORESET, NULL) != 0)
sbin/scsictl/scsictl.c
1473
if (ioctl(fd, SCBUSIOSCAN, &args) != 0)
sbin/scsictl/scsictl.c
1510
if (ioctl(fd, SCBUSIODETACH, &args) != 0)
sbin/scsictl/scsictl.c
155
fd = opendisk(dvname, O_RDWR, dvname_store, sizeof(dvname_store), 0);
sbin/scsictl/scsictl.c
156
if (fd == -1) {
sbin/scsictl/scsictl.c
165
fd = opendisk(dvname, O_RDWR, dvname_store,
sbin/scsictl/scsictl.c
167
if (fd == -1)
sbin/scsictl/scsictl.c
178
if (ioctl(fd, SCIOCIDENTIFY, &dvaddr) < 0)
sbin/scsictl/scsictl.c
306
scsi_command(fd, &cmd, sizeof(cmd), data, dlen, 30000, SCCMD_READ);
sbin/scsictl/scsictl.c
492
scsi_request_sense(fd, &sense, sizeof (sense));
sbin/scsictl/scsictl.c
509
scsi_mode_sense(fd, 0x03, 0x00, &mode_page, sizeof(mode_page));
sbin/scsictl/scsictl.c
556
scsi_mode_select(fd, 0, &data_select, sizeof(data_select));
sbin/scsictl/scsictl.c
582
scsi_command(fd, &cmd, sizeof(cmd), &dfl, sizeof(dfl),
sbin/scsictl/scsictl.c
605
if (ioctl(fd, SCIOCCOMMAND, &req) == -1) {
sbin/scsictl/scsictl.c
72
static int fd; /* file descriptor for device */
sbin/scsictl/scsictl.c
755
scsi_command(fd, &cmd, sizeof(cmd), &inqbuf, sizeof(inqbuf),
sbin/scsictl/scsictl.c
775
scsi_command(fd, &cmd, sizeof(cmd), &evpdbuf, sizeof(evpdbuf),
sbin/scsictl/scsictl.c
789
scsi_command(fd, &cmd, sizeof(cmd), &evpdbuf, sizeof(evpdbuf),
sbin/scsictl/scsictl.c
807
scsi_command(fd, &cmd, sizeof(cmd), &evpdbuf, sizeof(evpdbuf),
sbin/scsictl/scsictl.c
877
scsi_command(fd, &cmd, sizeof(cmd), data, dlen, 30000, SCCMD_WRITE);
sbin/scsictl/scsictl.c
904
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
930
scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
sbin/scsictl/scsictl.c
948
if (ioctl(fd, SCIOCRESET, NULL) != 0)
sbin/scsictl/scsictl.c
970
if (ioctl(fd, SCIOCDEBUG, &lvl) != 0)
sbin/scsictl/scsictl.c
994
scsi_mode_sense(fd, 0x08, 0x00, &data, sizeof(data));
sbin/slattach/slattach.c
127
if ((fd = open(dev, O_RDWR | O_NDELAY)) < 0)
sbin/slattach/slattach.c
136
if (tcsetattr(fd, TCSADRAIN, &tty) < 0)
sbin/slattach/slattach.c
138
if (ioctl(fd, TIOCSDTR, 0) < 0 && errno != ENOTTY)
sbin/slattach/slattach.c
140
if (ioctl(fd, TIOCSLINED, ldisc) < 0)
sbin/slattach/slattach.c
79
int fd;
sbin/swapctl/swapctl.c
161
static int do_wedgesofdisk(int fd, int);
sbin/swapctl/swapctl.c
162
static int do_partitionsofdisk(const char *, int fd, int);
sbin/swapctl/swapctl.c
591
int fd;
sbin/swapctl/swapctl.c
594
if ((fd = opendisk(disk, O_RDONLY, dvname, sizeof(dvname), 0)) == -1)
sbin/swapctl/swapctl.c
597
if (!do_wedgesofdisk(fd, add))
sbin/swapctl/swapctl.c
598
do_partitionsofdisk(disk, fd, add);
sbin/swapctl/swapctl.c
600
close(fd);
sbin/swapctl/swapctl.c
604
do_wedgesofdisk(int fd, int add)
sbin/swapctl/swapctl.c
617
if (ioctl(fd, DIOCLWEDGES, &dkwl) == -1)
sbin/swapctl/swapctl.c
659
do_partitionsofdisk(const char *prefix, int fd, int add)
sbin/swapctl/swapctl.c
665
if (ioctl(fd, DIOCGDINFO, &lab) != 0)
sbin/ttyflags/ttyflags.c
165
int fd, flags, rval, st, sep;
sbin/ttyflags/ttyflags.c
217
if ((fd = open(path, O_RDWR | O_NONBLOCK, 0)) == -1) {
sbin/ttyflags/ttyflags.c
225
if (ioctl(fd, TIOCSFLAGS, &flags) == -1)
sbin/ttyflags/ttyflags.c
230
if (close(fd) == -1) {
sbin/tunefs/tunefs.c
484
isactive(int fd, struct statvfs *rsfs)
sbin/tunefs/tunefs.c
490
if (fstat(fd, &st0) == -1) {
sbin/umbctl/umbctl.c
141
int fd;
sbin/umbctl/umbctl.c
146
if((fd = _umbctl_socket()) < 0)
sbin/umbctl/umbctl.c
154
if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0
sbin/umbctl/umbctl.c
156
|| _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM,
sbin/umbctl/umbctl.c
159
close(fd);
sbin/umbctl/umbctl.c
166
if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0)
sbin/umbctl/umbctl.c
168
close(fd);
sbin/umbctl/umbctl.c
173
if(close(fd) != 0)
sbin/umbctl/umbctl.c
183
int fd;
sbin/umbctl/umbctl.c
229
if((fd = _umbctl_socket()) < 0)
sbin/umbctl/umbctl.c
234
if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0
sbin/umbctl/umbctl.c
235
|| _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM, &ifr) != 0)
sbin/umbctl/umbctl.c
237
close(fd);
sbin/umbctl/umbctl.c
243
if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0)
sbin/umbctl/umbctl.c
245
close(fd);
sbin/umbctl/umbctl.c
250
if(close(fd) != 0)
sbin/umbctl/umbctl.c
291
static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request,
sbin/umbctl/umbctl.c
294
if(ioctl(fd, request, ifr) != 0)
sbin/umbctl/umbctl.c
434
int fd;
sbin/umbctl/umbctl.c
436
if((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
sbin/umbctl/umbctl.c
438
return fd;
sbin/umbctl/umbctl.c
86
static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request,
sbin/umount/umount.c
483
int fd;
sbin/umount/umount.c
491
if ((fd = opendisk(dev, O_RDWR, rdev, sizeof(rdev), 0)) == -1) {
sbin/umount/umount.c
499
if (ioctl(fd, VNDIOCCLR, &vndio) == -1) {
sbin/umount/umount.c
501
close(fd);
sbin/umount/umount.c
504
close(fd);
sbin/wdogctl/wdogctl.c
191
int fd;
sbin/wdogctl/wdogctl.c
195
fd = open(_PATH_WATCHDOG, O_RDWR, 0644);
sbin/wdogctl/wdogctl.c
196
if (fd == -1)
sbin/wdogctl/wdogctl.c
199
if (ioctl(fd, WDOGIOC_SMODE, &wm) == -1)
sbin/wdogctl/wdogctl.c
202
(void)close(fd);
sbin/wdogctl/wdogctl.c
209
int fd;
sbin/wdogctl/wdogctl.c
213
fd = open(_PATH_WATCHDOG, O_RDWR, 0644);
sbin/wdogctl/wdogctl.c
214
if (fd == -1)
sbin/wdogctl/wdogctl.c
216
if (ioctl(fd, WDOGIOC_SMODE, &wm) == -1) {
sbin/wdogctl/wdogctl.c
219
if (ioctl(fd, WDOGIOC_TICKLE) == -1)
sbin/wdogctl/wdogctl.c
223
(void)close(fd);
sbin/wdogctl/wdogctl.c
233
int fd, rv;
sbin/wdogctl/wdogctl.c
239
fd = open(_PATH_WATCHDOG, O_RDWR, 0644);
sbin/wdogctl/wdogctl.c
240
if (fd == -1)
sbin/wdogctl/wdogctl.c
255
if (ioctl(fd, WDOGIOC_SMODE, &wm) == -1) {
sbin/wdogctl/wdogctl.c
259
(void)close(fd);
sbin/wdogctl/wdogctl.c
273
rv = ioctl(fd, WDOGIOC_WHICH, &wm);
sbin/wdogctl/wdogctl.c
276
if (ioctl(fd, WDOGIOC_TICKLE) == -1)
sbin/wdogctl/wdogctl.c
294
if (ioctl(fd, WDOGIOC_TICKLE) == -1)
sbin/wdogctl/wdogctl.c
303
if (ioctl(fd, WDOGIOC_TICKLE) == -1)
sbin/wdogctl/wdogctl.c
314
int fd;
sbin/wdogctl/wdogctl.c
316
fd = open(_PATH_WATCHDOG, O_RDWR, 0644);
sbin/wdogctl/wdogctl.c
317
if (fd == -1)
sbin/wdogctl/wdogctl.c
319
if (ioctl(fd, WDOGIOC_TICKLE) == -1)
sbin/wdogctl/wdogctl.c
322
(void)close(fd);
sbin/wdogctl/wdogctl.c
330
int fd, mode;
sbin/wdogctl/wdogctl.c
332
fd = open(_PATH_WATCHDOG, O_RDWR, 0644);
sbin/wdogctl/wdogctl.c
333
if (fd == -1)
sbin/wdogctl/wdogctl.c
336
if (ioctl(fd, WDOGIOC_WHICH, &wm) == -1) {
sbin/wdogctl/wdogctl.c
338
(void)close(fd);
sbin/wdogctl/wdogctl.c
349
if (ioctl(fd, WDOGIOC_GTICKLER, &tickler) == -1)
sbin/wdogctl/wdogctl.c
351
(void)close(fd);
sbin/wdogctl/wdogctl.c
355
if (ioctl(fd, WDOGIOC_SMODE, &wm) == -1) {
sbin/wdogctl/wdogctl.c
359
(void)close(fd);
sbin/wdogctl/wdogctl.c
369
int fd, count, i, mode;
sbin/wdogctl/wdogctl.c
372
fd = open(_PATH_WATCHDOG, O_RDONLY, 0644);
sbin/wdogctl/wdogctl.c
373
if (fd == -1)
sbin/wdogctl/wdogctl.c
379
if (ioctl(fd, WDOGIOC_GWDOGS, &wc) == -1)
sbin/wdogctl/wdogctl.c
394
if (ioctl(fd, WDOGIOC_GWDOGS, &wc) == -1)
sbin/wdogctl/wdogctl.c
409
if (ioctl(fd, WDOGIOC_GMODE, &wm) == -1)
sbin/wdogctl/wdogctl.c
413
if (ioctl(fd, WDOGIOC_GTICKLER, &tickler) == -1)
sbin/wdogctl/wdogctl.c
437
(void)close(fd);
sbin/wsconsctl/display.c
109
display_get_values(int fd)
sbin/wsconsctl/display.c
115
if (ioctl(fd, WSDISPLAYIO_GFONT, &gfont) < 0)
sbin/wsconsctl/display.c
120
if (ioctl(fd, WSDISPLAYIO_GTYPE, &dpytype) < 0)
sbin/wsconsctl/display.c
124
if (ioctl(fd, WSDISPLAYIO_GBORDER, &border) < 0)
sbin/wsconsctl/display.c
129
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &backlight) < 0)
sbin/wsconsctl/display.c
135
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &brightness))
sbin/wsconsctl/display.c
141
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &contrast))
sbin/wsconsctl/display.c
153
if (ioctl(fd, WSDISPLAYIO_GMSGATTRS, &ma) < 0) {
sbin/wsconsctl/display.c
179
if (ioctl(fd, WSDISPLAYIO_DGSCROLL, &scroll_l) < 0) {
sbin/wsconsctl/display.c
186
if (display_get_edid(fd, &edid_info) < 0)
sbin/wsconsctl/display.c
192
display_put_values(int fd)
sbin/wsconsctl/display.c
196
if (ioctl(fd, WSDISPLAYIO_SFONT, &font) < 0)
sbin/wsconsctl/display.c
202
if (ioctl(fd, WSDISPLAYIO_SBORDER, &border) < 0)
sbin/wsconsctl/display.c
209
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &backlight) < 0)
sbin/wsconsctl/display.c
216
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &brightness) < 0)
sbin/wsconsctl/display.c
223
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &contrast) < 0)
sbin/wsconsctl/display.c
229
if (ioctl(fd, WSDISPLAYIO_SSPLASH, &splash_enable) < 0)
sbin/wsconsctl/display.c
235
if (ioctl(fd, WSDISPLAYIO_SPROGRESS, &splash_progress) < 0)
sbin/wsconsctl/display.c
248
if (ioctl(fd, WSDISPLAYIO_GMSGATTRS, &ma) < 0)
sbin/wsconsctl/display.c
285
if (ioctl(fd, WSDISPLAYIO_SMSGATTRS, &ma) < 0)
sbin/wsconsctl/display.c
295
ioctl(fd, WSDISPLAYIO_DSSCROLL, &scroll_l) < 0)
sbin/wsconsctl/display.c
83
display_get_edid(int fd, struct wsdisplayio_edid_info *ei)
sbin/wsconsctl/display.c
96
res = ioctl(fd, WSDISPLAYIO_GET_EDID, ei);
sbin/wsconsctl/keyboard.c
112
keyboard_get_values(int fd)
sbin/wsconsctl/keyboard.c
116
if (ioctl(fd, WSKBDIO_GTYPE, &kbtype) < 0)
sbin/wsconsctl/keyboard.c
120
ioctl(fd, WSKBDIO_GETMODE, &kbmode);
sbin/wsconsctl/keyboard.c
131
if (bell.which != 0 && ioctl(fd, WSKBDIO_GETBELL, &bell) < 0)
sbin/wsconsctl/keyboard.c
142
ioctl(fd, WSKBDIO_GETDEFAULTBELL, &dfbell) < 0)
sbin/wsconsctl/keyboard.c
147
if (ioctl(fd, WSKBDIO_GETMAP, &kbmap) < 0)
sbin/wsconsctl/keyboard.c
158
ioctl(fd, WSKBDIO_GETKEYREPEAT, &repeat) < 0)
sbin/wsconsctl/keyboard.c
167
ioctl(fd, WSKBDIO_GETKEYREPEAT, &dfrepeat) < 0)
sbin/wsconsctl/keyboard.c
171
if (ioctl(fd, WSKBDIO_GETLEDS, &ledstate) < 0)
sbin/wsconsctl/keyboard.c
175
if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) < 0)
sbin/wsconsctl/keyboard.c
179
ioctl(fd, WSKBDIO_GETKEYCLICK, &keyclick);
sbin/wsconsctl/keyboard.c
189
if (ioctl(fd, WSKBDIO_GETSCROLL, &scroll) == -1) {
sbin/wsconsctl/keyboard.c
199
keyboard_put_values(int fd)
sbin/wsconsctl/keyboard.c
203
if (ioctl(fd, WSKBDIO_SETMODE, &kbmode) < 0)
sbin/wsconsctl/keyboard.c
215
if (bell.which != 0 && ioctl(fd, WSKBDIO_SETBELL, &bell) < 0)
sbin/wsconsctl/keyboard.c
232
ioctl(fd, WSKBDIO_SETDEFAULTBELL, &dfbell) < 0)
sbin/wsconsctl/keyboard.c
242
if (ioctl(fd, WSKBDIO_SETMAP, &kbmap) < 0)
sbin/wsconsctl/keyboard.c
257
ioctl(fd, WSKBDIO_SETKEYREPEAT, &repeat) < 0)
sbin/wsconsctl/keyboard.c
270
ioctl(fd, WSKBDIO_SETDEFAULTKEYREPEAT, &dfrepeat) < 0)
sbin/wsconsctl/keyboard.c
278
if (ioctl(fd, WSKBDIO_SETLEDS, &ledstate) < 0)
sbin/wsconsctl/keyboard.c
284
if (ioctl(fd, WSKBDIO_SETENCODING, &kbdencoding) < 0)
sbin/wsconsctl/keyboard.c
290
if (ioctl(fd, WSKBDIO_SETKEYCLICK, &keyclick) < 0)
sbin/wsconsctl/keyboard.c
310
if (ioctl(fd, WSKBDIO_SETSCROLL, &scroll) == -1) {
sbin/wsconsctl/mouse.c
107
mouse_get_calibration(fd);
sbin/wsconsctl/mouse.c
113
mouse_get_repeat(fd);
sbin/wsconsctl/mouse.c
118
mouse_get_parameters(fd);
sbin/wsconsctl/mouse.c
122
mouse_get_parameters(int fd)
sbin/wsconsctl/mouse.c
138
if (ioctl(fd, WSMOUSEIO_GETPARAMS, &pl) < 0) {
sbin/wsconsctl/mouse.c
164
mouse_get_calibration(int fd)
sbin/wsconsctl/mouse.c
171
if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, &tmp) < 0) {
sbin/wsconsctl/mouse.c
216
mouse_get_repeat(int fd)
sbin/wsconsctl/mouse.c
220
if (ioctl(fd, WSMOUSEIO_GETREPEAT, &tmp) < 0)
sbin/wsconsctl/mouse.c
234
mouse_put_values(int fd)
sbin/wsconsctl/mouse.c
240
if (ioctl(fd, WSMOUSEIO_SRES, &tmp) < 0)
sbin/wsconsctl/mouse.c
247
if (ioctl(fd, WSMOUSEIO_SRATE, &tmp) < 0)
sbin/wsconsctl/mouse.c
257
mouse_put_calibration(fd);
sbin/wsconsctl/mouse.c
263
mouse_put_repeat(fd);
sbin/wsconsctl/mouse.c
268
mouse_put_parameters(fd);
sbin/wsconsctl/mouse.c
272
mouse_put_parameters(int fd)
sbin/wsconsctl/mouse.c
295
if (ioctl(fd, WSMOUSEIO_SETPARAMS, &pl) < 0) {
sbin/wsconsctl/mouse.c
307
mouse_put_calibration(int fd)
sbin/wsconsctl/mouse.c
315
if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, &tmp) < 0)
sbin/wsconsctl/mouse.c
354
if (ioctl(fd, WSMOUSEIO_SCALIBCOORDS, &tmp) < 0)
sbin/wsconsctl/mouse.c
371
mouse_put_repeat(int fd)
sbin/wsconsctl/mouse.c
376
if (ioctl(fd, WSMOUSEIO_GETREPEAT, &tmp) < 0)
sbin/wsconsctl/mouse.c
390
if (ioctl(fd, WSMOUSEIO_SETREPEAT, &tmp) < 0)
sbin/wsconsctl/mouse.c
95
mouse_get_values(int fd)
sbin/wsconsctl/mouse.c
99
if (ioctl(fd, WSMOUSEIO_GTYPE, &mstype) < 0)
sbin/wsconsctl/wsconsctl.c
163
fd = open(file, O_WRONLY);
sbin/wsconsctl/wsconsctl.c
164
if (fd < 0)
sbin/wsconsctl/wsconsctl.c
165
fd = open(file, O_RDONLY);
sbin/wsconsctl/wsconsctl.c
166
if (fd < 0)
sbin/wsconsctl/wsconsctl.c
173
(*getval)(fd);
sbin/wsconsctl/wsconsctl.c
205
(*getval)(fd);
sbin/wsconsctl/wsconsctl.c
212
(*putval)(fd);
sbin/wsconsctl/wsconsctl.c
223
(*getval)(fd);
sbin/wsconsctl/wsconsctl.c
234
close(fd);
sbin/wsconsctl/wsconsctl.c
238
close(fd);
sbin/wsconsctl/wsconsctl.c
76
int i, ch, fd;
share/examples/pud/intro/doioctl.c
16
int fd, i;
share/examples/pud/intro/doioctl.c
21
fd = open(argv[1], O_RDWR);
share/examples/pud/intro/doioctl.c
22
if (fd == -1)
share/examples/pud/intro/doioctl.c
28
if (ioctl(fd, INTROTOGGLE, &i) == -1)
share/examples/pud/intro/doioctl.c
31
if (ioctl(fd, INTROTOGGLE_R, &i) == -1)
share/examples/pud/intro/intro.c
166
n = write(fd, pdr, pdr->pdr_pth.pth_framelen);
share/examples/pud/intro/intro.c
48
int fd;
share/examples/pud/intro/intro.c
57
fd = open(argv[1], O_RDWR);
share/examples/pud/intro/intro.c
58
if (fd == -1)
share/examples/pud/intro/intro.c
74
n = write(fd, &pcr, pcr.pm_pdr.pdr_pth.pth_framelen);
share/examples/pud/intro/intro.c
82
n = read(fd, pdr, DEFALLOC);
share/examples/puffs/pgfs/mount.c
179
int fd;
share/examples/puffs/pgfs/mount.c
186
fd = open(path, O_RDONLY | O_DIRECTORY);
share/examples/puffs/pgfs/mount.c
187
if (fd == -1) {
share/examples/puffs/pgfs/mount.c
194
ret = fchroot(fd);
share/examples/puffs/pgfs/mount.c
198
ret = close(fd);
share/examples/puffs/pgfs/pgfs_db.c
799
int fd, int *done)
share/examples/puffs/pgfs/pgfs_db.c
805
if (PQsocket(xc->conn) == fd) {
share/examples/puffs/pgfs/pgfs_puffs.c
1047
int fd;
share/examples/puffs/pgfs/pgfs_puffs.c
1062
error = my_lo_open(xc, loid, INV_WRITE, &fd);
share/examples/puffs/pgfs/pgfs_puffs.c
1067
error = my_lo_write(xc, fd, target, targetlen, &resultlen);
share/examples/puffs/pgfs/pgfs_puffs.c
1096
int fd;
share/examples/puffs/pgfs/pgfs_puffs.c
1101
error = lo_open_by_fileid(xc, fileid, INV_READ, &fd);
share/examples/puffs/pgfs/pgfs_puffs.c
1106
error = my_lo_read(xc, fd, buf, *buflenp, &resultlen);
share/examples/puffs/pgfs/pgfs_puffs.c
469
int fd;
share/examples/puffs/pgfs/pgfs_puffs.c
485
error = lo_open_by_fileid(xc, fileid, INV_WRITE, &fd);
share/examples/puffs/pgfs/pgfs_puffs.c
492
error = my_lo_lseek(xc, fd, 0, SEEK_END, &off);
share/examples/puffs/pgfs/pgfs_puffs.c
508
error = my_lo_lseek(xc, fd, offset, SEEK_SET, NULL);
share/examples/puffs/pgfs/pgfs_puffs.c
513
error = my_lo_write(xc, fd, (const char *)buf, *resid, &resultlen);
share/examples/puffs/pgfs/pgfs_puffs.c
543
int fd;
share/examples/puffs/pgfs/pgfs_puffs.c
561
error = lo_open_by_fileid(xc, fileid, INV_READ, &fd);
share/examples/puffs/pgfs/pgfs_puffs.c
565
error = my_lo_lseek(xc, fd, offset, SEEK_SET, NULL);
share/examples/puffs/pgfs/pgfs_puffs.c
569
error = my_lo_read(xc, fd, buf, *resid, &resultlen);
share/examples/puffs/pgfs/pgfs_puffs.c
914
int fd;
share/examples/puffs/pgfs/pgfs_puffs.c
920
error = lo_open_by_fileid(xc, fileid, INV_READ|INV_WRITE, &fd);
share/examples/puffs/pgfs/pgfs_puffs.c
924
error = my_lo_truncate(xc, fd, va->va_size);
share/examples/puffs/pgfs/pgfs_puffs.c
928
error = my_lo_close(xc, fd);
share/examples/puffs/pgfs/pgfs_subs.c
215
my_lo_truncate(struct Xconn *xc, int32_t fd, int32_t size)
share/examples/puffs/pgfs/pgfs_subs.c
222
error = sendcmd(xc, c, fd, size);
share/examples/puffs/pgfs/pgfs_subs.c
243
my_lo_lseek(struct Xconn *xc, int32_t fd, int32_t offset, int32_t whence,
share/examples/puffs/pgfs/pgfs_subs.c
251
error = sendcmd(xc, c, fd, offset, whence);
share/examples/puffs/pgfs/pgfs_subs.c
266
my_lo_read(struct Xconn *xc, int32_t fd, void *buf, size_t size,
share/examples/puffs/pgfs/pgfs_subs.c
274
error = sendcmdx(xc, 1, c, fd, (int32_t)size);
share/examples/puffs/pgfs/pgfs_subs.c
290
my_lo_write(struct Xconn *xc, int32_t fd, const void *buf, size_t size,
share/examples/puffs/pgfs/pgfs_subs.c
298
error = sendcmd(xc, c, fd, buf, (int32_t)size);
share/examples/puffs/pgfs/pgfs_subs.c
336
my_lo_close(struct Xconn *xc, int32_t fd)
share/examples/puffs/pgfs/pgfs_subs.c
351
error = sendcmd(xc, c, fd);
share/examples/puffs/pgfs/pgfs_subs.c
388
int fd;
share/examples/puffs/pgfs/pgfs_subs.c
395
error = my_lo_open(xc, loid, mode, &fd);
share/examples/puffs/pgfs/pgfs_subs.c
399
*fdp = fd;
share/examples/puffs/pgfs/pgfs_subs.c
407
int fd;
share/examples/puffs/pgfs/pgfs_subs.c
410
error = lo_open_by_fileid(xc, fileid, INV_READ, &fd);
share/examples/puffs/pgfs/pgfs_subs.c
414
error = my_lo_lseek(xc, fd, 0, SEEK_END, &size);
share/examples/puffs/pgfs/pgfs_subs.c
418
error = my_lo_close(xc, fd);
share/examples/refuse/fanoutfs/fanoutfs.c
282
int fd;
share/examples/refuse/fanoutfs/fanoutfs.c
290
if ((fd = open(name, O_RDONLY, 0666)) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
293
if (lseek(fd, offset, SEEK_SET) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
294
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
297
if ((cc = read(fd, buf, size)) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
298
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
301
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
311
int fd;
share/examples/refuse/fanoutfs/fanoutfs.c
319
if ((fd = open(name, O_WRONLY, 0666)) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
322
if (lseek(fd, offset, SEEK_SET) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
323
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
326
if ((cc = write(fd, buf, size)) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
327
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
330
(void) close(fd);
share/examples/refuse/fanoutfs/fanoutfs.c
431
int fd;
share/examples/refuse/fanoutfs/fanoutfs.c
436
if ((fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0666)) < 0) {
share/examples/refuse/fanoutfs/fanoutfs.c
439
(void) close(fd);
share/examples/refuse/ian/ian/ian.c
104
fd = mkstemp(tmpname);
share/examples/refuse/ian/ian/ian.c
105
if ((out = fdopen(fd, "w")) == NULL) {
share/examples/refuse/ian/ian/ian.c
197
int fd;
share/examples/refuse/ian/ian/ian.c
202
if ((fd = open(ep->tgt, O_RDONLY, 0666)) < 0) {
share/examples/refuse/ian/ian/ian.c
205
if (lseek(fd, offset, SEEK_SET) < 0) {
share/examples/refuse/ian/ian/ian.c
206
(void) close(fd);
share/examples/refuse/ian/ian/ian.c
209
if ((cc = read(fd, buf, size)) < 0) {
share/examples/refuse/ian/ian/ian.c
210
(void) close(fd);
share/examples/refuse/ian/ian/ian.c
213
(void) close(fd);
share/examples/refuse/ian/ian/ian.c
72
int fd;
share/examples/refuse/icfs/icfs.c
162
int fd;
share/examples/refuse/icfs/icfs.c
171
if ((fd = open(name, O_RDONLY, 0666)) < 0) {
share/examples/refuse/icfs/icfs.c
174
if (lseek(fd, offset, SEEK_SET) < 0) {
share/examples/refuse/icfs/icfs.c
175
(void) close(fd);
share/examples/refuse/icfs/icfs.c
178
if ((cc = read(fd, buf, size)) < 0) {
share/examples/refuse/icfs/icfs.c
179
(void) close(fd);
share/examples/refuse/icfs/icfs.c
182
(void) close(fd);
share/examples/refuse/icfs/icfs.c
193
int fd;
share/examples/refuse/icfs/icfs.c
202
if ((fd = open(name, O_WRONLY, 0666)) < 0) {
share/examples/refuse/icfs/icfs.c
205
if (lseek(fd, offset, SEEK_SET) < 0) {
share/examples/refuse/icfs/icfs.c
206
(void) close(fd);
share/examples/refuse/icfs/icfs.c
209
if ((cc = write(fd, buf, size)) < 0) {
share/examples/refuse/icfs/icfs.c
210
(void) close(fd);
share/examples/refuse/icfs/icfs.c
213
(void) close(fd);
share/examples/refuse/icfs/icfs.c
328
int fd;
share/examples/refuse/icfs/icfs.c
337
if ((fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0666)) < 0) {
share/examples/refuse/icfs/icfs.c
340
(void) close(fd);
share/examples/rump/dmtest/dmt.c
54
int fd;
share/examples/rump/dmtest/dmt.c
65
fd = rump_sys_open("/dev/mapper/control", O_RDWR, 0);
share/examples/rump/dmtest/dmt.c
66
if (fd == -1)
share/examples/rump/dmtest/dmt.c
74
err = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
share/examples/rump/dmtest/dmt.c
83
rump_sys_close(fd);
share/examples/rump/sdread/sdread.c
101
int fd, n, fd_h, sverrno;
share/examples/rump/sdread/sdread.c
149
fd = rump_sys_open("/mp", O_RDONLY, 0);
share/examples/rump/sdread/sdread.c
150
if (fd == -1) {
share/examples/rump/sdread/sdread.c
155
while ((n = rump_sys_getdents(fd, buf, sizeof(buf))) > 0) {
share/examples/rump/sdread/sdread.c
162
rump_sys_close(fd);
share/examples/rump/sdread/sdread.c
167
fd = rump_sys_open(argv[1], O_RDONLY, 0);
share/examples/rump/sdread/sdread.c
168
if (fd == -1) {
share/examples/rump/sdread/sdread.c
179
while ((n = rump_sys_read(fd, buf, sizeof(buf))) == sizeof(buf)) {
share/examples/rump/sdread/sdread.c
198
rump_sys_close(fd);
share/examples/rump/sdread/sdread.c
63
int fd, val = 0, rounds = 0;
share/examples/rump/sdread/sdread.c
65
fd = rump_sys_open("/dev/rcd0d", O_RDWR);
share/examples/rump/sdread/sdread.c
66
if (fd == -1)
share/examples/rump/sdread/sdread.c
79
if (rump_sys_ioctl(fd, DIOCTUR, &val) == -1)
share/examples/rump/sdread/sdread.c
89
rump_sys_close(fd);
share/examples/rump/tipsy/tipsy.c
68
int fd = (int)(intptr_t)arg;
share/examples/rump/tipsy/tipsy.c
71
n = rump_sys_read(fd, buf, sizeof(buf));
share/examples/rump/ttyserv/ttyserv.c
155
n = write(fd, pdr, pdr->pdr_pth.pth_framelen);
share/examples/rump/ttyserv/ttyserv.c
172
fd = open(_PATH_PUD, O_RDWR);
share/examples/rump/ttyserv/ttyserv.c
173
if (fd == -1)
share/examples/rump/ttyserv/ttyserv.c
186
n = write(fd, &pcr, pcr.pm_pdr.pdr_pth.pth_framelen);
share/examples/rump/ttyserv/ttyserv.c
211
n = read(fd, pdr, PDRSIZE);
share/examples/rump/ttyserv/ttyserv.c
78
static int fd;
share/examples/rump/ukbd_read/kbd.c
56
int fd;
share/examples/rump/ukbd_read/kbd.c
61
fd = rump_sys_open("/dev/wskbd", 0);
share/examples/rump/ukbd_read/kbd.c
62
if (fd == -1)
share/examples/rump/ukbd_read/kbd.c
65
while (rump_sys_read(fd, buf, sizeof(buf)) > 0) {
share/examples/rump/ums_draw/ms.c
54
int fd, x = 0, y = 0;
share/examples/rump/ums_draw/ms.c
59
fd = rump_sys_open("/dev/wsmouse", 0);
share/examples/rump/ums_draw/ms.c
60
if (fd == -1)
share/examples/rump/ums_draw/ms.c
65
while (rump_sys_read(fd, buf, sizeof(buf)) > 0) {
share/examples/rump/umserv/umserv.c
101
int fd, rv, i;
share/examples/rump/umserv/umserv.c
106
fd = open(_PATH_PUD, O_RDWR);
share/examples/rump/umserv/umserv.c
107
if (fd == -1)
share/examples/rump/umserv/umserv.c
125
n = write(fd, &pcr, pcr.pm_pdr.pdr_pth.pth_framelen);
share/examples/rump/umserv/umserv.c
160
n = read(fd, pdr, PDRSIZE);
share/examples/rump/umserv/umserv.c
222
n = write(fd, pdr, pdr->pdr_pth.pth_framelen);
share/man/tools/noso.c
13
int i, fd, count = 0;
share/man/tools/noso.c
21
fd = open(argv[i], O_RDONLY);
share/man/tools/noso.c
22
if (fd < 0) {
share/man/tools/noso.c
26
if (read(fd, buf, 3) != 3) {
share/man/tools/noso.c
27
close(fd);
share/man/tools/noso.c
32
close(fd);
sys/arch/acorn32/mainbus/fd.c
1005
type = fd->sc_type;
sys/arch/acorn32/mainbus/fd.c
1007
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/acorn32/mainbus/fd.c
1009
sec = fd->sc_blkno % type->seccyl;
sys/arch/acorn32/mainbus/fd.c
1011
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/acorn32/mainbus/fd.c
1013
fd->sc_nblks = nblks;
sys/arch/acorn32/mainbus/fd.c
1014
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
sys/arch/acorn32/mainbus/fd.c
1019
block = (fd->sc_cylin * type->heads + head) * type->sectrac + sec;
sys/arch/acorn32/mainbus/fd.c
1020
if (block != fd->sc_blkno) {
sys/arch/acorn32/mainbus/fd.c
1023
block, fd->sc_blkno);
sys/arch/acorn32/mainbus/fd.c
1042
fdc->sc_fr.fr_r10 = fd->sc_nbytes;
sys/arch/acorn32/mainbus/fd.c
1044
(u_int)((uintptr_t)bp->b_data + fd->sc_skip);
sys/arch/acorn32/mainbus/fd.c
1049
fdc->sc_fr.fr_r12, (u_int)bp->b_data, fd->sc_skip);
sys/arch/acorn32/mainbus/fd.c
1058
read ? "read" : "write", fd->sc_drive, fd->sc_cylin,
sys/arch/acorn32/mainbus/fd.c
1068
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/acorn32/mainbus/fd.c
1078
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/acorn32/mainbus/fd.c
1079
out_fdc(iot, ioh, fd->sc_cylin); /* track */
sys/arch/acorn32/mainbus/fd.c
1089
disk_busy(&fd->sc_dk);
sys/arch/acorn32/mainbus/fd.c
1106
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/acorn32/mainbus/fd.c
1111
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/acorn32/mainbus/fd.c
1113
fdcstatus(fd->sc_dev, 2, "seek failed");
sys/arch/acorn32/mainbus/fd.c
1118
fd->sc_cylin = bp->b_cylinder;
sys/arch/acorn32/mainbus/fd.c
1133
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/acorn32/mainbus/fd.c
1140
fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/arch/acorn32/mainbus/fd.c
1143
fd->sc_blkno, fd->sc_nblks);
sys/arch/acorn32/mainbus/fd.c
1153
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
sys/arch/acorn32/mainbus/fd.c
1158
fd->sc_blkno += fd->sc_nblks;
sys/arch/acorn32/mainbus/fd.c
1159
fd->sc_skip += fd->sc_nbytes;
sys/arch/acorn32/mainbus/fd.c
1160
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/acorn32/mainbus/fd.c
1161
if (!finfo && fd->sc_bcount > 0) {
sys/arch/acorn32/mainbus/fd.c
1162
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/acorn32/mainbus/fd.c
1165
fdfinish(fd, bp);
sys/arch/acorn32/mainbus/fd.c
1188
out_fdc(iot, ioh, fd->sc_drive);
sys/arch/acorn32/mainbus/fd.c
1206
fdcstatus(fd->sc_dev, 2, "recalibrate failed");
sys/arch/acorn32/mainbus/fd.c
1211
fd->sc_cylin = 0;
sys/arch/acorn32/mainbus/fd.c
1215
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/acorn32/mainbus/fd.c
1220
fdcstatus(fd->sc_dev, 0, "stray interrupt");
sys/arch/acorn32/mainbus/fd.c
1233
struct fd_softc *fd;
sys/arch/acorn32/mainbus/fd.c
1236
fd = fdc->sc_drives.tqh_first;
sys/arch/acorn32/mainbus/fd.c
1237
bp = bufq_peek(fd->sc_q);
sys/arch/acorn32/mainbus/fd.c
1239
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/acorn32/mainbus/fd.c
1259
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/acorn32/mainbus/fd.c
1261
fd->sc_skip / FDC_BSIZE,
sys/arch/acorn32/mainbus/fd.c
1267
fdfinish(fd, bp);
sys/arch/acorn32/mainbus/fd.c
1275
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/acorn32/mainbus/fd.c
1289
buffer.d_secpercyl = fd->sc_type->seccyl;
sys/arch/acorn32/mainbus/fd.c
1319
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/acorn32/mainbus/fd.c
1320
form_parms->ncyl = fd->sc_type->cyls;
sys/arch/acorn32/mainbus/fd.c
1321
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/acorn32/mainbus/fd.c
1322
form_parms->ntrk = fd->sc_type->heads;
sys/arch/acorn32/mainbus/fd.c
1323
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/acorn32/mainbus/fd.c
1324
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/acorn32/mainbus/fd.c
1325
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/acorn32/mainbus/fd.c
1326
form_parms->interleave = fd->sc_type->interleave;
sys/arch/acorn32/mainbus/fd.c
1327
switch (fd->sc_type->rate) {
sys/arch/acorn32/mainbus/fd.c
1357
fd->sc_type->rate = FDC_500KBPS;
sys/arch/acorn32/mainbus/fd.c
1360
fd->sc_type->rate = FDC_300KBPS;
sys/arch/acorn32/mainbus/fd.c
1363
fd->sc_type->rate = FDC_250KBPS;
sys/arch/acorn32/mainbus/fd.c
1373
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/acorn32/mainbus/fd.c
1376
fd->sc_type->heads = form_parms->ntrk;
sys/arch/acorn32/mainbus/fd.c
1377
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/acorn32/mainbus/fd.c
1378
fd->sc_type->secsize = ffs(scratch)-1;
sys/arch/acorn32/mainbus/fd.c
1379
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/acorn32/mainbus/fd.c
1380
fd->sc_type->cyls = form_parms->ncyl;
sys/arch/acorn32/mainbus/fd.c
1381
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/acorn32/mainbus/fd.c
1383
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/acorn32/mainbus/fd.c
1384
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/acorn32/mainbus/fd.c
1385
fd->sc_type->interleave = form_parms->interleave;
sys/arch/acorn32/mainbus/fd.c
1395
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/acorn32/mainbus/fd.c
1396
form_cmd->cylinder >= fd->sc_type->cyls) {
sys/arch/acorn32/mainbus/fd.c
1403
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/acorn32/mainbus/fd.c
1404
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/acorn32/mainbus/fd.c
1405
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/acorn32/mainbus/fd.c
1406
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/acorn32/mainbus/fd.c
1407
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/acorn32/mainbus/fd.c
1414
j += fd->sc_type->interleave;
sys/arch/acorn32/mainbus/fd.c
1420
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/acorn32/mainbus/fd.c
1428
*(int *)addr = fd->sc_opts;
sys/arch/acorn32/mainbus/fd.c
1432
fd->sc_opts = *(int *)addr;
sys/arch/acorn32/mainbus/fd.c
1448
struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(dev));
sys/arch/acorn32/mainbus/fd.c
1449
struct fd_type *type = fd->sc_type;
sys/arch/acorn32/mainbus/fd.c
257
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/acorn32/mainbus/fd.c
315
void fdfinish(struct fd_softc *fd, struct buf *bp);
sys/arch/acorn32/mainbus/fd.c
497
struct fd_softc *fd = device_private(self);
sys/arch/acorn32/mainbus/fd.c
502
fd->sc_dev = self;
sys/arch/acorn32/mainbus/fd.c
504
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/acorn32/mainbus/fd.c
505
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/acorn32/mainbus/fd.c
515
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/acorn32/mainbus/fd.c
516
fd->sc_cylin = -1;
sys/arch/acorn32/mainbus/fd.c
517
fd->sc_drive = drive;
sys/arch/acorn32/mainbus/fd.c
518
fd->sc_deftype = type;
sys/arch/acorn32/mainbus/fd.c
519
fdc->sc_fd[drive] = fd;
sys/arch/acorn32/mainbus/fd.c
524
disk_init(&fd->sc_dk, device_xname(fd->sc_dev), &fddkdriver);
sys/arch/acorn32/mainbus/fd.c
525
disk_attach(&fd->sc_dk);
sys/arch/acorn32/mainbus/fd.c
558
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/acorn32/mainbus/fd.c
564
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/arch/acorn32/mainbus/fd.c
570
struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(bp->b_dev));
sys/arch/acorn32/mainbus/fd.c
588
if (bp->b_blkno + sz > fd->sc_type->size) {
sys/arch/acorn32/mainbus/fd.c
589
sz = fd->sc_type->size - bp->b_blkno;
sys/arch/acorn32/mainbus/fd.c
604
bp->b_cylinder = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE) / fd->sc_type->seccyl;
sys/arch/acorn32/mainbus/fd.c
608
bp->b_blkno, bp->b_bcount, fd->sc_blkno, bp->b_cylinder, sz);
sys/arch/acorn32/mainbus/fd.c
613
bufq_put(fd->sc_q, bp);
sys/arch/acorn32/mainbus/fd.c
614
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/acorn32/mainbus/fd.c
615
if (fd->sc_active == 0)
sys/arch/acorn32/mainbus/fd.c
616
fdstart(fd);
sys/arch/acorn32/mainbus/fd.c
620
device_private(device_parent(fd->sc_dev));
sys/arch/acorn32/mainbus/fd.c
637
fdstart(struct fd_softc *fd)
sys/arch/acorn32/mainbus/fd.c
639
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/acorn32/mainbus/fd.c
643
fd->sc_active = 1;
sys/arch/acorn32/mainbus/fd.c
644
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/acorn32/mainbus/fd.c
652
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/acorn32/mainbus/fd.c
654
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/acorn32/mainbus/fd.c
662
(void)bufq_get(fd->sc_q);
sys/arch/acorn32/mainbus/fd.c
663
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
sys/arch/acorn32/mainbus/fd.c
664
fd->sc_ops = 0;
sys/arch/acorn32/mainbus/fd.c
665
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/acorn32/mainbus/fd.c
666
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/acorn32/mainbus/fd.c
667
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/acorn32/mainbus/fd.c
669
fd->sc_active = 0;
sys/arch/acorn32/mainbus/fd.c
671
bp->b_resid = fd->sc_bcount;
sys/arch/acorn32/mainbus/fd.c
672
fd->sc_skip = 0;
sys/arch/acorn32/mainbus/fd.c
676
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/acorn32/mainbus/fd.c
697
struct fd_softc *fd;
sys/arch/acorn32/mainbus/fd.c
701
if ((fd = fdc->sc_drives.tqh_first) != NULL)
sys/arch/acorn32/mainbus/fd.c
702
status = fd->sc_drive;
sys/arch/acorn32/mainbus/fd.c
708
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/acorn32/mainbus/fd.c
716
struct fd_softc *fd = arg;
sys/arch/acorn32/mainbus/fd.c
720
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/acorn32/mainbus/fd.c
721
fd_set_motor(device_private(device_parent(fd->sc_dev)), 0);
sys/arch/acorn32/mainbus/fd.c
728
struct fd_softc *fd = arg;
sys/arch/acorn32/mainbus/fd.c
729
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/acorn32/mainbus/fd.c
733
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/acorn32/mainbus/fd.c
734
if ((fdc->sc_drives.tqh_first == fd) && (fdc->sc_state == MOTORWAIT))
sys/arch/acorn32/mainbus/fd.c
785
struct fd_softc *fd;
sys/arch/acorn32/mainbus/fd.c
788
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/acorn32/mainbus/fd.c
789
if (fd == NULL)
sys/arch/acorn32/mainbus/fd.c
791
type = fd_dev_to_type(fd, dev);
sys/arch/acorn32/mainbus/fd.c
795
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/acorn32/mainbus/fd.c
796
memcmp(fd->sc_type, type, sizeof(*type)))
sys/arch/acorn32/mainbus/fd.c
799
fd->sc_type_copy = *type;
sys/arch/acorn32/mainbus/fd.c
800
fd->sc_type = &fd->sc_type_copy;
sys/arch/acorn32/mainbus/fd.c
801
fd->sc_cylin = -1;
sys/arch/acorn32/mainbus/fd.c
802
fd->sc_flags |= FD_OPEN;
sys/arch/acorn32/mainbus/fd.c
810
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/acorn32/mainbus/fd.c
812
fd->sc_flags &= ~FD_OPEN;
sys/arch/acorn32/mainbus/fd.c
813
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/acorn32/mainbus/fd.c
882
struct fd_softc *fd = fdc->sc_drives.tqh_first;
sys/arch/acorn32/mainbus/fd.c
889
fdcstatus(fd->sc_dev, 0, "timeout");
sys/arch/acorn32/mainbus/fd.c
891
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/acorn32/mainbus/fd.c
917
struct fd_softc *fd;
sys/arch/acorn32/mainbus/fd.c
927
fd = fdc->sc_drives.tqh_first;
sys/arch/acorn32/mainbus/fd.c
928
if (fd == NULL) {
sys/arch/acorn32/mainbus/fd.c
934
bp = bufq_peek(fd->sc_q);
sys/arch/acorn32/mainbus/fd.c
936
fd->sc_ops = 0;
sys/arch/acorn32/mainbus/fd.c
937
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/acorn32/mainbus/fd.c
938
fd->sc_active = 0;
sys/arch/acorn32/mainbus/fd.c
948
fd->sc_skip = 0;
sys/arch/acorn32/mainbus/fd.c
949
fd->sc_bcount = bp->b_bcount;
sys/arch/acorn32/mainbus/fd.c
950
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/arch/acorn32/mainbus/fd.c
951
callout_stop(&fd->sc_motoroff_ch);
sys/arch/acorn32/mainbus/fd.c
952
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/acorn32/mainbus/fd.c
956
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/acorn32/mainbus/fd.c
958
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/acorn32/mainbus/fd.c
963
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/acorn32/mainbus/fd.c
967
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/acorn32/mainbus/fd.c
968
fd_motor_on, fd);
sys/arch/acorn32/mainbus/fd.c
977
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/acorn32/mainbus/fd.c
987
out_fdc(iot, ioh, fd->sc_type->steprate);
sys/arch/acorn32/mainbus/fd.c
991
out_fdc(iot, ioh, fd->sc_drive); /* drive number */
sys/arch/acorn32/mainbus/fd.c
992
out_fdc(iot, ioh, bp->b_cylinder * fd->sc_type->step);
sys/arch/acorn32/mainbus/fd.c
994
fd->sc_cylin = -1;
sys/arch/acorn32/mainbus/fd.c
997
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/acorn32/mainbus/fd.c
998
disk_busy(&fd->sc_dk);
sys/arch/alpha/stand/common/boot.c
104
booted_dev_setfd(fd);
sys/arch/alpha/stand/common/boot.c
79
main(long fd)
sys/arch/alpha/stand/common/bootxx.c
101
fd = open("boot", 0);
sys/arch/alpha/stand/common/bootxx.c
102
if (fd == -1 || (fstat(fd, &sb) == -1)) {
sys/arch/alpha/stand/common/bootxx.c
112
if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
sys/arch/alpha/stand/common/bootxx.c
89
int fd;
sys/arch/alpha/stand/common/common.h
59
#define booted_dev_setfd(fd) ((void)(booted_dev_fd = fd))
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
169
if ((fd = open(netboot, O_RDONLY, 0)) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
171
if (fstat(fd, &sb) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
182
if (read(fd, netbb, sb.st_size) != sb.st_size)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
188
close(fd);
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
232
if ((fd = open(outfilename, O_WRONLY | O_CREAT, 0666)) == -1)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
237
if (write(fd, netbb, sb.st_size) != sb.st_size)
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
243
close(fd);
sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
75
int c, fd, i;
sys/arch/amiga/dev/fd.c
243
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/amiga/stand/binpatch/binpatch.c
110
int fd;
sys/arch/amiga/stand/binpatch/binpatch.c
191
if ((fd = open(fname, 0)) < 0) {
sys/arch/amiga/stand/binpatch/binpatch.c
195
if (read(fd, &e, sizeof(e)) != sizeof(e)
sys/arch/amiga/stand/binpatch/binpatch.c
253
close(fd);
sys/arch/amiga/stand/binpatch/binpatch.c
254
if ((fd = open(fname, 2)) == -1) {
sys/arch/amiga/stand/binpatch/binpatch.c
270
if (lseek(fd, off, 0) == -1) {
sys/arch/amiga/stand/binpatch/binpatch.c
280
if (read(fd, &cval, 1) != 1) {
sys/arch/amiga/stand/binpatch/binpatch.c
287
if (read(fd, &sval, 2) != 2) {
sys/arch/amiga/stand/binpatch/binpatch.c
294
if (read(fd, &lval, 4) != 4) {
sys/arch/amiga/stand/binpatch/binpatch.c
309
if (lseek(fd, off, 0) == -1) {
sys/arch/amiga/stand/binpatch/binpatch.c
318
if (write(fd, &cval, 1) != 1) {
sys/arch/amiga/stand/binpatch/binpatch.c
328
if (write(fd, &sval, 2) != 2) {
sys/arch/amiga/stand/binpatch/binpatch.c
334
if (write(fd, &replace, 4) != 4) {
sys/arch/amiga/stand/binpatch/binpatch.c
343
close(fd);
sys/arch/amiga/stand/loadkmap/loadkmap.c
38
int fd;
sys/arch/amiga/stand/loadkmap/loadkmap.c
41
if ((fd = open (file, 0)) >= 0)
sys/arch/amiga/stand/loadkmap/loadkmap.c
43
if (read (fd, buf, sizeof (buf)) == sizeof (buf))
sys/arch/amiga/stand/loadkmap/loadkmap.c
53
close (fd);
sys/arch/arc/arc/minidebug.c
865
i.FRType.fd, i.FRType.fs, i.FRType.ft);
sys/arch/arc/jazz/fd.c
1001
out_fdc(iot, ioh, fd->sc_drive);
sys/arch/arc/jazz/fd.c
1017
fdcstatus(fd->sc_dev, 2, "recalibrate failed");
sys/arch/arc/jazz/fd.c
1022
fd->sc_cylin = 0;
sys/arch/arc/jazz/fd.c
1026
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/arc/jazz/fd.c
1031
fdcstatus(fd->sc_dev, 0, "stray interrupt");
sys/arch/arc/jazz/fd.c
1044
struct fd_softc *fd;
sys/arch/arc/jazz/fd.c
1047
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/arc/jazz/fd.c
1048
bp = bufq_peek(fd->sc_q);
sys/arch/arc/jazz/fd.c
1070
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
sys/arch/arc/jazz/fd.c
1074
fdfinish(fd, bp);
sys/arch/arc/jazz/fd.c
1082
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/arc/jazz/fd.c
1090
buffer.d_secpercyl = fd->sc_type->seccyl;
sys/arch/arc/jazz/fd.c
180
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc), fdprobe, fdattach, NULL, NULL);
sys/arch/arc/jazz/fd.c
337
struct fd_softc *fd = device_private(self);
sys/arch/arc/jazz/fd.c
342
fd->sc_dev = self;
sys/arch/arc/jazz/fd.c
344
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/arc/jazz/fd.c
345
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/arc/jazz/fd.c
355
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/arc/jazz/fd.c
356
fd->sc_cylin = -1;
sys/arch/arc/jazz/fd.c
357
fd->sc_drive = drive;
sys/arch/arc/jazz/fd.c
358
fd->sc_deftype = type;
sys/arch/arc/jazz/fd.c
359
fdc->sc_fd[drive] = fd;
sys/arch/arc/jazz/fd.c
364
disk_init(&fd->sc_dk, device_xname(fd->sc_dev), &fddkdriver);
sys/arch/arc/jazz/fd.c
365
disk_attach(&fd->sc_dk);
sys/arch/arc/jazz/fd.c
368
mountroothook_establish(fd_mountroot_hook, fd->sc_dev);
sys/arch/arc/jazz/fd.c
378
struct fd_softc *fd;
sys/arch/arc/jazz/fd.c
380
fd = device_private(self);
sys/arch/arc/jazz/fd.c
381
fd_motor_off(fd);
sys/arch/arc/jazz/fd.c
424
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/arc/jazz/fd.c
430
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/arch/arc/jazz/fd.c
436
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(bp->b_dev));
sys/arch/arc/jazz/fd.c
453
if (bp->b_blkno + sz > fd->sc_type->size) {
sys/arch/arc/jazz/fd.c
454
sz = fd->sc_type->size - bp->b_blkno;
sys/arch/arc/jazz/fd.c
470
bp->b_blkno / (FDC_BSIZE / DEV_BSIZE) / fd->sc_type->seccyl;
sys/arch/arc/jazz/fd.c
475
bp->b_blkno, bp->b_bcount, fd->sc_blkno, bp->b_cylinder, sz);
sys/arch/arc/jazz/fd.c
480
bufq_put(fd->sc_q, bp);
sys/arch/arc/jazz/fd.c
481
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/arc/jazz/fd.c
482
if (fd->sc_active == 0)
sys/arch/arc/jazz/fd.c
483
fdstart(fd);
sys/arch/arc/jazz/fd.c
487
device_private(device_parent(fd->sc_dev));
sys/arch/arc/jazz/fd.c
504
fdstart(struct fd_softc *fd)
sys/arch/arc/jazz/fd.c
506
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/arc/jazz/fd.c
510
fd->sc_active = 1;
sys/arch/arc/jazz/fd.c
511
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/arc/jazz/fd.c
519
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/arc/jazz/fd.c
521
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/arc/jazz/fd.c
529
(void)bufq_get(fd->sc_q);
sys/arch/arc/jazz/fd.c
530
if (TAILQ_NEXT(fd, sc_drivechain) && ++fd->sc_ops >= 8) {
sys/arch/arc/jazz/fd.c
531
fd->sc_ops = 0;
sys/arch/arc/jazz/fd.c
532
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/arc/jazz/fd.c
533
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/arc/jazz/fd.c
534
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/arc/jazz/fd.c
536
fd->sc_active = 0;
sys/arch/arc/jazz/fd.c
538
bp->b_resid = fd->sc_bcount;
sys/arch/arc/jazz/fd.c
539
fd->sc_skip = 0;
sys/arch/arc/jazz/fd.c
542
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/arc/jazz/fd.c
563
struct fd_softc *fd;
sys/arch/arc/jazz/fd.c
567
if ((fd = TAILQ_FIRST(&fdc->sc_drives)) != NULL)
sys/arch/arc/jazz/fd.c
568
status = fd->sc_drive;
sys/arch/arc/jazz/fd.c
574
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/arc/jazz/fd.c
582
struct fd_softc *fd = arg;
sys/arch/arc/jazz/fd.c
583
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/arc/jazz/fd.c
587
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/arc/jazz/fd.c
595
struct fd_softc *fd = arg;
sys/arch/arc/jazz/fd.c
596
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/arc/jazz/fd.c
600
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/arc/jazz/fd.c
601
if ((TAILQ_FIRST(&fdc->sc_drives) == fd) &&
sys/arch/arc/jazz/fd.c
652
struct fd_softc *fd;
sys/arch/arc/jazz/fd.c
655
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/arc/jazz/fd.c
656
if (fd == NULL)
sys/arch/arc/jazz/fd.c
659
type = fd_dev_to_type(fd, dev);
sys/arch/arc/jazz/fd.c
663
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/arc/jazz/fd.c
664
memcmp(fd->sc_type, type, sizeof(*type)))
sys/arch/arc/jazz/fd.c
667
fd->sc_type_copy = *type;
sys/arch/arc/jazz/fd.c
668
fd->sc_type = &fd->sc_type_copy;
sys/arch/arc/jazz/fd.c
669
fd->sc_cylin = -1;
sys/arch/arc/jazz/fd.c
670
fd->sc_flags |= FD_OPEN;
sys/arch/arc/jazz/fd.c
678
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/arc/jazz/fd.c
680
fd->sc_flags &= ~FD_OPEN;
sys/arch/arc/jazz/fd.c
749
struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/arc/jazz/fd.c
756
fdcstatus(fd->sc_dev, 0, "timeout");
sys/arch/arc/jazz/fd.c
758
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/arc/jazz/fd.c
784
struct fd_softc *fd;
sys/arch/arc/jazz/fd.c
793
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/arc/jazz/fd.c
794
if (fd == NULL) {
sys/arch/arc/jazz/fd.c
800
bp = bufq_peek(fd->sc_q);
sys/arch/arc/jazz/fd.c
802
fd->sc_ops = 0;
sys/arch/arc/jazz/fd.c
803
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/arc/jazz/fd.c
804
fd->sc_active = 0;
sys/arch/arc/jazz/fd.c
811
fd->sc_skip = 0;
sys/arch/arc/jazz/fd.c
812
fd->sc_bcount = bp->b_bcount;
sys/arch/arc/jazz/fd.c
813
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/arch/arc/jazz/fd.c
814
callout_stop(&fd->sc_motoroff_ch);
sys/arch/arc/jazz/fd.c
815
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/arc/jazz/fd.c
819
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/arc/jazz/fd.c
821
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/arc/jazz/fd.c
826
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/arc/jazz/fd.c
830
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/arc/jazz/fd.c
831
fd_motor_on, fd);
sys/arch/arc/jazz/fd.c
840
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/arc/jazz/fd.c
844
out_fdc(iot, ioh, fd->sc_type->steprate);
sys/arch/arc/jazz/fd.c
848
out_fdc(iot, ioh, fd->sc_drive); /* drive number */
sys/arch/arc/jazz/fd.c
849
out_fdc(iot, ioh, bp->b_cylinder * fd->sc_type->step);
sys/arch/arc/jazz/fd.c
851
fd->sc_cylin = -1;
sys/arch/arc/jazz/fd.c
854
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/arc/jazz/fd.c
855
disk_busy(&fd->sc_dk);
sys/arch/arc/jazz/fd.c
862
type = fd->sc_type;
sys/arch/arc/jazz/fd.c
863
sec = fd->sc_blkno % type->seccyl;
sys/arch/arc/jazz/fd.c
865
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/arc/jazz/fd.c
867
fd->sc_nblks = nblks;
sys/arch/arc/jazz/fd.c
868
fd->sc_nbytes = nblks * FDC_BSIZE;
sys/arch/arc/jazz/fd.c
874
block = (fd->sc_cylin * type->heads + head) *
sys/arch/arc/jazz/fd.c
876
if (block != fd->sc_blkno) {
sys/arch/arc/jazz/fd.c
878
"\n", __func__, block, fd->sc_blkno);
sys/arch/arc/jazz/fd.c
886
FDCDMA_START(fdc, (uint8_t *)bp->b_data + fd->sc_skip,
sys/arch/arc/jazz/fd.c
887
fd->sc_nbytes, read);
sys/arch/arc/jazz/fd.c
891
__func__, read ? "read" : "write", fd->sc_drive,
sys/arch/arc/jazz/fd.c
892
fd->sc_cylin, head, sec, nblks);
sys/arch/arc/jazz/fd.c
898
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/arc/jazz/fd.c
899
out_fdc(iot, ioh, fd->sc_cylin); /* track */
sys/arch/arc/jazz/fd.c
908
disk_busy(&fd->sc_dk);
sys/arch/arc/jazz/fd.c
922
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/arc/jazz/fd.c
927
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/arc/jazz/fd.c
929
fdcstatus(fd->sc_dev, 2, "seek failed");
sys/arch/arc/jazz/fd.c
934
fd->sc_cylin = bp->b_cylinder;
sys/arch/arc/jazz/fd.c
949
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/arc/jazz/fd.c
956
fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/arch/arc/jazz/fd.c
959
fd->sc_blkno, fd->sc_nblks);
sys/arch/arc/jazz/fd.c
967
fd->sc_skip / FDC_BSIZE, NULL);
sys/arch/arc/jazz/fd.c
971
fd->sc_blkno += fd->sc_nblks;
sys/arch/arc/jazz/fd.c
972
fd->sc_skip += fd->sc_nbytes;
sys/arch/arc/jazz/fd.c
973
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/arc/jazz/fd.c
974
if (fd->sc_bcount > 0) {
sys/arch/arc/jazz/fd.c
975
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/arc/jazz/fd.c
978
fdfinish(fd, bp);
sys/arch/arc/stand/boot/disk.c
110
u_long fd;
sys/arch/arc/stand/boot/disk.c
133
error = arcbios_Open(device, 0, &fd);
sys/arch/arc/stand/boot/disk.c
143
sc->sc_fd = fd;
sys/arch/arm/broadcom/bcm2835_spi.c
244
uint32_t fd;
sys/arch/arm/broadcom/bcm2835_spi.c
254
fd = *chunk->chunk_wptr++;
sys/arch/arm/broadcom/bcm2835_spi.c
256
fd = '\0';
sys/arch/arm/broadcom/bcm2835_spi.c
258
bus_space_write_4(sc->sc_iot, sc->sc_ioh, SPI_FIFO, fd);
sys/arch/arm/broadcom/bcm2835_spi.c
268
uint32_t fd;
sys/arch/arm/broadcom/bcm2835_spi.c
277
fd = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SPI_FIFO);
sys/arch/arm/broadcom/bcm2835_spi.c
279
*chunk->chunk_rptr++ = fd & 0xff;
sys/arch/arm/sunxi/sun6i_spi.c
322
uint8_t fd;
sys/arch/arm/sunxi/sun6i_spi.c
333
fd = *chunk->chunk_wptr++;
sys/arch/arm/sunxi/sun6i_spi.c
335
fd = '\0';
sys/arch/arm/sunxi/sun6i_spi.c
337
bus_space_write_1(sc->sc_iot, sc->sc_ioh, SPI_TXD, fd);
sys/arch/arm/sunxi/sun6i_spi.c
347
uint8_t fd;
sys/arch/arm/sunxi/sun6i_spi.c
357
fd = bus_space_read_1(sc->sc_iot, sc->sc_ioh, SPI_RXD);
sys/arch/arm/sunxi/sun6i_spi.c
359
*chunk->chunk_rptr++ = fd;
sys/arch/arm/ti/ti_iic.c
76
#define OMAP2_I2C_FIFOBYTES(fd) (8 << (fd))
sys/arch/atari/dev/fd.c
384
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/atari/dev/hdfd.c
1003
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/atari/dev/hdfd.c
1004
fd_motor_on, fd);
sys/arch/atari/dev/hdfd.c
1013
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/atari/dev/hdfd.c
1017
out_fdc(fd->sc_type->steprate);
sys/arch/atari/dev/hdfd.c
1023
out_fdc(fd->sc_drive); /* drive number */
sys/arch/atari/dev/hdfd.c
1024
out_fdc(bp->b_cylinder * fd->sc_type->step);
sys/arch/atari/dev/hdfd.c
1026
fd->sc_cylin = -1;
sys/arch/atari/dev/hdfd.c
1029
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/atari/dev/hdfd.c
1030
disk_busy(&fd->sc_dk);
sys/arch/atari/dev/hdfd.c
1038
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/atari/dev/hdfd.c
1041
type = fd->sc_type;
sys/arch/atari/dev/hdfd.c
1042
sec = fd->sc_blkno % type->seccyl;
sys/arch/atari/dev/hdfd.c
1046
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/atari/dev/hdfd.c
1048
fd->sc_nblks = nblks;
sys/arch/atari/dev/hdfd.c
1049
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
sys/arch/atari/dev/hdfd.c
1054
block = (fd->sc_cylin * type->heads + head)
sys/arch/atari/dev/hdfd.c
1056
if (block != fd->sc_blkno) {
sys/arch/atari/dev/hdfd.c
1058
block, fd->sc_blkno);
sys/arch/atari/dev/hdfd.c
1070
fddmaaddr = (char *)bp->b_data + fd->sc_skip;
sys/arch/atari/dev/hdfd.c
1071
fddmalen = fd->sc_nbytes;
sys/arch/atari/dev/hdfd.c
1077
fd->sc_drive, fd->sc_cylin, head, sec, nblks);
sys/arch/atari/dev/hdfd.c
1088
out_fdc((head << 2) | fd->sc_drive);
sys/arch/atari/dev/hdfd.c
1098
out_fdc((head << 2) | fd->sc_drive);
sys/arch/atari/dev/hdfd.c
1099
out_fdc(fd->sc_cylin); /* track */
sys/arch/atari/dev/hdfd.c
1109
disk_busy(&fd->sc_dk);
sys/arch/atari/dev/hdfd.c
1124
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/atari/dev/hdfd.c
1129
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/atari/dev/hdfd.c
1131
fdcstatus(fd->sc_dev, 2, "seek failed");
sys/arch/atari/dev/hdfd.c
1136
fd->sc_cylin = bp->b_cylinder;
sys/arch/atari/dev/hdfd.c
1149
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/atari/dev/hdfd.c
1162
fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/arch/atari/dev/hdfd.c
1165
fd->sc_blkno, fd->sc_nblks);
sys/arch/atari/dev/hdfd.c
1172
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
sys/arch/atari/dev/hdfd.c
1177
fd->sc_blkno += fd->sc_nblks;
sys/arch/atari/dev/hdfd.c
1178
fd->sc_skip += fd->sc_nbytes;
sys/arch/atari/dev/hdfd.c
1179
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/atari/dev/hdfd.c
1180
if (!finfo && fd->sc_bcount > 0) {
sys/arch/atari/dev/hdfd.c
1181
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/atari/dev/hdfd.c
1184
fdfinish(fd, bp);
sys/arch/atari/dev/hdfd.c
1209
out_fdc(fd->sc_drive);
sys/arch/atari/dev/hdfd.c
1225
fdcstatus(fd->sc_dev, 2, "recalibrate failed");
sys/arch/atari/dev/hdfd.c
1230
fd->sc_cylin = 0;
sys/arch/atari/dev/hdfd.c
1234
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/atari/dev/hdfd.c
1239
fdcstatus(fd->sc_dev, 0, "stray interrupt");
sys/arch/atari/dev/hdfd.c
1253
struct fd_softc *fd;
sys/arch/atari/dev/hdfd.c
1256
fd = fdc->sc_drives.tqh_first;
sys/arch/atari/dev/hdfd.c
1257
bp = bufq_peek(fd->sc_q);
sys/arch/atari/dev/hdfd.c
1259
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/atari/dev/hdfd.c
1280
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/atari/dev/hdfd.c
1282
fd->sc_skip / FDC_BSIZE,
sys/arch/atari/dev/hdfd.c
1287
fdfinish(fd, bp);
sys/arch/atari/dev/hdfd.c
1295
struct fd_softc *fd;
sys/arch/atari/dev/hdfd.c
1305
fd = device_lookup_private(&hdfd_cd, FDUNIT(dev));
sys/arch/atari/dev/hdfd.c
1310
fdgetdisklabel(fd, dev);
sys/arch/atari/dev/hdfd.c
1314
error = disk_ioctl(&fd->sc_dk, RAW_PART, cmd, addr, flag, l);
sys/arch/atari/dev/hdfd.c
1330
fd->sc_flags &= ~FD_HAVELAB; /* Invalid */
sys/arch/atari/dev/hdfd.c
1342
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/atari/dev/hdfd.c
1343
form_parms->ncyl = fd->sc_type->tracks;
sys/arch/atari/dev/hdfd.c
1344
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/atari/dev/hdfd.c
1345
form_parms->ntrk = fd->sc_type->heads;
sys/arch/atari/dev/hdfd.c
1346
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/atari/dev/hdfd.c
1347
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/atari/dev/hdfd.c
1348
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/atari/dev/hdfd.c
1349
form_parms->interleave = fd->sc_type->interleave;
sys/arch/atari/dev/hdfd.c
1350
switch (fd->sc_type->rate) {
sys/arch/atari/dev/hdfd.c
1383
fd->sc_type->rate = FDC_500KBPS;
sys/arch/atari/dev/hdfd.c
1386
fd->sc_type->rate = FDC_300KBPS;
sys/arch/atari/dev/hdfd.c
1389
fd->sc_type->rate = FDC_250KBPS;
sys/arch/atari/dev/hdfd.c
1392
fd->sc_type->rate = FDC_125KBPS;
sys/arch/atari/dev/hdfd.c
1402
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/atari/dev/hdfd.c
1405
fd->sc_type->heads = form_parms->ntrk;
sys/arch/atari/dev/hdfd.c
1406
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/atari/dev/hdfd.c
1407
fd->sc_type->secsize = ffs(scratch)-1;
sys/arch/atari/dev/hdfd.c
1408
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/atari/dev/hdfd.c
1409
fd->sc_type->tracks = form_parms->ncyl;
sys/arch/atari/dev/hdfd.c
1410
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/atari/dev/hdfd.c
1412
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/atari/dev/hdfd.c
1413
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/atari/dev/hdfd.c
1414
fd->sc_type->interleave = form_parms->interleave;
sys/arch/atari/dev/hdfd.c
1424
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/atari/dev/hdfd.c
1425
form_cmd->cylinder >= fd->sc_type->tracks) {
sys/arch/atari/dev/hdfd.c
1432
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/atari/dev/hdfd.c
1433
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/atari/dev/hdfd.c
1434
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/atari/dev/hdfd.c
1435
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/atari/dev/hdfd.c
1436
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/atari/dev/hdfd.c
1443
j += fd->sc_type->interleave;
sys/arch/atari/dev/hdfd.c
1449
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/atari/dev/hdfd.c
1457
*(int *)addr = fd->sc_opts;
sys/arch/atari/dev/hdfd.c
1461
fd->sc_opts = *(int *)addr;
sys/arch/atari/dev/hdfd.c
1478
struct fd_softc *fd = device_lookup_private(&hdfd_cd, FDUNIT(dev));
sys/arch/atari/dev/hdfd.c
1479
struct fd_type *type = fd->sc_type;
sys/arch/atari/dev/hdfd.c
1535
fdgetdisklabel(struct fd_softc *fd, dev_t dev)
sys/arch/atari/dev/hdfd.c
1540
if (fd->sc_flags & FD_HAVELAB)
sys/arch/atari/dev/hdfd.c
1543
lp = fd->sc_dk.dk_label;
sys/arch/atari/dev/hdfd.c
1548
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/atari/dev/hdfd.c
1551
lp->d_secperunit = fd->sc_type->size;
sys/arch/atari/dev/hdfd.c
1557
fdgetdefaultlabel(fd, lp, RAW_PART);
sys/arch/atari/dev/hdfd.c
1558
fd->sc_flags |= FD_HAVELAB;
sys/arch/atari/dev/hdfd.c
1560
if ((FDC_BSIZE * fd->sc_type->size)
sys/arch/atari/dev/hdfd.c
1567
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/atari/dev/hdfd.c
1570
lp->d_secperunit = fd->sc_type->size;
sys/arch/atari/dev/hdfd.c
1579
fdgetdefaultlabel(struct fd_softc *fd, struct disklabel *lp, int part)
sys/arch/atari/dev/hdfd.c
1583
lp->d_secsize = 128 * (1 << fd->sc_type->secsize);
sys/arch/atari/dev/hdfd.c
1584
lp->d_ntracks = fd->sc_type->heads;
sys/arch/atari/dev/hdfd.c
1585
lp->d_nsectors = fd->sc_type->sectrac;
sys/arch/atari/dev/hdfd.c
1587
lp->d_ncylinders = fd->sc_type->size / lp->d_secpercyl;
sys/arch/atari/dev/hdfd.c
1588
lp->d_secperunit = fd->sc_type->size;
sys/arch/atari/dev/hdfd.c
528
struct fd_softc *fd = device_private(self);
sys/arch/atari/dev/hdfd.c
533
fd->sc_dev = self;
sys/arch/atari/dev/hdfd.c
534
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/atari/dev/hdfd.c
535
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/atari/dev/hdfd.c
545
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/atari/dev/hdfd.c
546
fd->sc_cylin = -1;
sys/arch/atari/dev/hdfd.c
547
fd->sc_drive = drive;
sys/arch/atari/dev/hdfd.c
548
fd->sc_deftype = type;
sys/arch/atari/dev/hdfd.c
549
fdc->sc_fd[drive] = fd;
sys/arch/atari/dev/hdfd.c
554
disk_init(&fd->sc_dk, device_xname(self), &fddkdriver);
sys/arch/atari/dev/hdfd.c
555
disk_attach(&fd->sc_dk);
sys/arch/atari/dev/hdfd.c
558
fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd);
sys/arch/atari/dev/hdfd.c
596
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/atari/dev/hdfd.c
602
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/arch/atari/dev/hdfd.c
608
struct fd_softc *fd = device_lookup_private(&hdfd_cd, FDUNIT(bp->b_dev));
sys/arch/atari/dev/hdfd.c
626
if (bp->b_blkno + sz > fd->sc_type->size) {
sys/arch/atari/dev/hdfd.c
627
sz = fd->sc_type->size - bp->b_blkno;
sys/arch/atari/dev/hdfd.c
642
bp->b_cylinder = bp->b_blkno / (FDC_BSIZE/DEV_BSIZE) / fd->sc_type->seccyl;
sys/arch/atari/dev/hdfd.c
646
" %d\n", bp->b_blkno, bp->b_bcount, (long)fd->sc_blkno,
sys/arch/atari/dev/hdfd.c
652
bufq_put(fd->sc_q, bp);
sys/arch/atari/dev/hdfd.c
653
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/atari/dev/hdfd.c
654
if (fd->sc_active == 0)
sys/arch/atari/dev/hdfd.c
655
fdstart(fd);
sys/arch/atari/dev/hdfd.c
660
fdc = device_private(device_parent(fd->sc_dev));
sys/arch/atari/dev/hdfd.c
677
fdstart(struct fd_softc *fd)
sys/arch/atari/dev/hdfd.c
679
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/atari/dev/hdfd.c
683
fd->sc_active = 1;
sys/arch/atari/dev/hdfd.c
684
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/atari/dev/hdfd.c
692
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/atari/dev/hdfd.c
694
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/atari/dev/hdfd.c
702
(void)bufq_get(fd->sc_q);
sys/arch/atari/dev/hdfd.c
703
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
sys/arch/atari/dev/hdfd.c
704
fd->sc_ops = 0;
sys/arch/atari/dev/hdfd.c
705
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/atari/dev/hdfd.c
706
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/atari/dev/hdfd.c
707
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/atari/dev/hdfd.c
709
fd->sc_active = 0;
sys/arch/atari/dev/hdfd.c
711
bp->b_resid = fd->sc_bcount;
sys/arch/atari/dev/hdfd.c
712
fd->sc_skip = 0;
sys/arch/atari/dev/hdfd.c
716
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/atari/dev/hdfd.c
737
struct fd_softc *fd;
sys/arch/atari/dev/hdfd.c
741
if ((fd = fdc->sc_drives.tqh_first) != NULL)
sys/arch/atari/dev/hdfd.c
742
status = fd->sc_drive;
sys/arch/atari/dev/hdfd.c
748
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/atari/dev/hdfd.c
756
struct fd_softc *fd = arg;
sys/arch/atari/dev/hdfd.c
757
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/atari/dev/hdfd.c
761
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/atari/dev/hdfd.c
769
struct fd_softc *fd = arg;
sys/arch/atari/dev/hdfd.c
770
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/atari/dev/hdfd.c
774
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/atari/dev/hdfd.c
775
if ((fdc->sc_drives.tqh_first == fd) && (fdc->sc_state == MOTORWAIT))
sys/arch/atari/dev/hdfd.c
821
struct fd_softc *fd;
sys/arch/atari/dev/hdfd.c
824
fd = device_lookup_private(&hdfd_cd, FDUNIT(dev));
sys/arch/atari/dev/hdfd.c
825
if (fd == NULL)
sys/arch/atari/dev/hdfd.c
827
type = fd_dev_to_type(fd, dev);
sys/arch/atari/dev/hdfd.c
831
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/atari/dev/hdfd.c
832
fd->sc_type != type)
sys/arch/atari/dev/hdfd.c
835
fd->sc_type = type;
sys/arch/atari/dev/hdfd.c
836
fd->sc_cylin = -1;
sys/arch/atari/dev/hdfd.c
837
fd->sc_flags |= FD_OPEN;
sys/arch/atari/dev/hdfd.c
838
fdgetdisklabel(fd, dev);
sys/arch/atari/dev/hdfd.c
846
struct fd_softc *fd = device_lookup_private(&hdfd_cd, FDUNIT(dev));
sys/arch/atari/dev/hdfd.c
848
fd->sc_flags &= ~(FD_OPEN|FD_HAVELAB);
sys/arch/atari/dev/hdfd.c
849
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/atari/dev/hdfd.c
920
struct fd_softc *fd = fdc->sc_drives.tqh_first;
sys/arch/atari/dev/hdfd.c
924
fdcstatus(fd->sc_dev, 0, "timeout");
sys/arch/atari/dev/hdfd.c
926
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/atari/dev/hdfd.c
954
struct fd_softc *fd;
sys/arch/atari/dev/hdfd.c
962
fd = fdc->sc_drives.tqh_first;
sys/arch/atari/dev/hdfd.c
963
if (fd == NULL) {
sys/arch/atari/dev/hdfd.c
969
bp = bufq_peek(fd->sc_q);
sys/arch/atari/dev/hdfd.c
971
fd->sc_ops = 0;
sys/arch/atari/dev/hdfd.c
972
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/atari/dev/hdfd.c
973
fd->sc_active = 0;
sys/arch/atari/dev/hdfd.c
984
fd->sc_skip = 0;
sys/arch/atari/dev/hdfd.c
985
fd->sc_bcount = bp->b_bcount;
sys/arch/atari/dev/hdfd.c
986
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/arch/atari/dev/hdfd.c
987
callout_stop(&fd->sc_motoroff_ch);
sys/arch/atari/dev/hdfd.c
988
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/atari/dev/hdfd.c
992
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/atari/dev/hdfd.c
994
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/atari/dev/hdfd.c
999
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/atari/dev/ite_et.c
577
font_info *fd;
sys/arch/atari/dev/ite_et.c
594
fd = &font_info_8x8;
sys/arch/atari/dev/ite_et.c
596
fd = &font_info_8x16;
sys/arch/atari/dev/ite_et.c
633
c = (unsigned char *) (fb) + (32 * fd->font_lo);
sys/arch/atari/dev/ite_et.c
634
f = fd->font_p;
sys/arch/atari/dev/ite_et.c
635
z = fd->font_lo;
sys/arch/atari/dev/ite_et.c
636
for (; z <= fd->font_hi; z++, c += (32 - fd->height))
sys/arch/atari/dev/ite_et.c
637
for (y = 0; y < fd->height; y++) {
sys/arch/atari/dev/ite_et.c
655
etregs->crt[CRT_ID_MAX_ROW_ADDRESS] = tmp | (fd->height - 1);
sys/arch/atari/dev/ite_et.c
657
etregs->crt[CRT_ID_UNDERLINE_LOC] = tmp | (fd->height - 1);
sys/arch/atari/dev/ite_et.c
663
etregs->crt[CRT_ID_CURSOR_END] = fd->height - 1;
sys/arch/atari/pci/pci_vga.c
292
font_info *fd;
sys/arch/atari/pci/pci_vga.c
297
fd = &font_info_8x8;
sys/arch/atari/pci/pci_vga.c
299
fd = &font_info_8x16;
sys/arch/atari/pci/pci_vga.c
316
c = (uint8_t *)(fb) + (32 * fd->font_lo);
sys/arch/atari/pci/pci_vga.c
317
f = fd->font_p;
sys/arch/atari/pci/pci_vga.c
318
z = fd->font_lo;
sys/arch/atari/pci/pci_vga.c
319
for (; z <= fd->font_hi; z++, c += (32 - fd->height))
sys/arch/atari/pci/pci_vga.c
320
for (y = 0; y < fd->height; y++) {
sys/arch/atari/pci/pci_vga.c
337
WCrt(ba, CRT_ID_MAX_ROW_ADDRESS, tmp | (fd->height - 1));
sys/arch/atari/pci/pci_vga.c
339
WCrt(ba, CRT_ID_UNDERLINE_LOC, tmp | (fd->height - 1));
sys/arch/atari/pci/pci_vga.c
345
WCrt(ba, CRT_ID_CURSOR_END , fd->height - 1);
sys/arch/atari/stand/ahdilabel/magic.c
39
check_magic(int fd, u_int offset, int flags)
sys/arch/atari/stand/ahdilabel/magic.c
46
bblk = disk_read(fd, offset, nsec);
sys/arch/atari/stand/ahdilabel/read.c
102
read_rsec (int fd, struct ahdi_ptable *ptable, u_int rsec, u_int esec, int flags)
sys/arch/atari/stand/ahdilabel/read.c
109
if ((root = disk_read (fd, rsec, 1)) == NULL) {
sys/arch/atari/stand/ahdilabel/read.c
147
if ((rv = read_rsec (fd, ptable, offs,
sys/arch/atari/stand/ahdilabel/read.c
192
disk_read (fd, start, count)
sys/arch/atari/stand/ahdilabel/read.c
193
int fd;
sys/arch/atari/stand/ahdilabel/read.c
208
if (lseek (fd, offset, SEEK_SET) != offset) {
sys/arch/atari/stand/ahdilabel/read.c
212
if (read (fd, buffer, size) != size) {
sys/arch/atari/stand/ahdilabel/read.c
254
read_dl (int fd)
sys/arch/atari/stand/ahdilabel/read.c
262
if (ioctl (fd, DIOCGDINFO, dl) < 0) {
sys/arch/atari/stand/ahdilabel/read.c
49
int fd, rv;
sys/arch/atari/stand/ahdilabel/read.c
52
if (!(fd = openraw (diskname, O_RDONLY)))
sys/arch/atari/stand/ahdilabel/read.c
55
if ((dl = read_dl (fd)) == NULL) {
sys/arch/atari/stand/ahdilabel/read.c
56
close (fd);
sys/arch/atari/stand/ahdilabel/read.c
61
close (fd);
sys/arch/atari/stand/ahdilabel/read.c
65
if ((rv = check_magic(fd, LABELSECTOR, flags)) < 0) {
sys/arch/atari/stand/ahdilabel/read.c
66
close (fd);
sys/arch/atari/stand/ahdilabel/read.c
72
if ((rv = read_rsec (fd, ptable, AHDI_BBLOCK, AHDI_BBLOCK, flags))
sys/arch/atari/stand/ahdilabel/read.c
74
close (fd);
sys/arch/atari/stand/ahdilabel/read.c
82
close (fd);
sys/arch/atari/stand/ahdilabel/read.c
94
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
163
if (!disk_write (fd, AHDI_BBLOCK, 1, root)) {
sys/arch/atari/stand/ahdilabel/write.c
165
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
243
if (!disk_write (fd, rsec, 1, root)) {
sys/arch/atari/stand/ahdilabel/write.c
244
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
261
if (!(flags & AHDI_KEEP_BSL) && !write_bsl (fd)) {
sys/arch/atari/stand/ahdilabel/write.c
262
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
266
if (!(flags & AHDI_KEEP_NBDA) && !invalidate_netbsd_label(fd, nbdsec)) {
sys/arch/atari/stand/ahdilabel/write.c
267
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
275
if (ioctl (fd, DIOCKLABEL, &keep) < 0) {
sys/arch/atari/stand/ahdilabel/write.c
276
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
280
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
288
write_bsl (int fd)
sys/arch/atari/stand/ahdilabel/write.c
300
if (!disk_write (fd, (u_int) BSL_OFFSET, (u_int) BSL_SIZE, bsl)) {
sys/arch/atari/stand/ahdilabel/write.c
313
invalidate_netbsd_label (int fd, u_int32_t nbdsec)
sys/arch/atari/stand/ahdilabel/write.c
320
if ((bb = disk_read (fd, nbdsec, nsec)) == NULL) {
sys/arch/atari/stand/ahdilabel/write.c
332
if (!disk_write (fd, nbdsec, nsec, bb)) {
sys/arch/atari/stand/ahdilabel/write.c
343
disk_write (fd, start, count, buf)
sys/arch/atari/stand/ahdilabel/write.c
344
int fd;
sys/arch/atari/stand/ahdilabel/write.c
355
if (lseek (fd, offset, SEEK_SET) != offset)
sys/arch/atari/stand/ahdilabel/write.c
357
if (write (fd, buf, size) != size)
sys/arch/atari/stand/ahdilabel/write.c
54
int fd, i, j, k, firstxgm, keep, cksum_ok;
sys/arch/atari/stand/ahdilabel/write.c
59
if (!(fd = openraw (diskname, O_RDWR)))
sys/arch/atari/stand/ahdilabel/write.c
63
close (fd);
sys/arch/atari/stand/ahdilabel/write.c
68
if ((root = disk_read (fd, AHDI_BBLOCK, 1)) == NULL) {
sys/arch/atari/stand/ahdilabel/write.c
80
close (fd);
sys/arch/atari/stand/ahdilabel/writedtab.c
100
fprintf (fd, "\\\n\t:p%c#%u:o%c#0:t%c=unknown:",
sys/arch/atari/stand/ahdilabel/writedtab.c
104
fprintf (fd, "\n\n");
sys/arch/atari/stand/ahdilabel/writedtab.c
106
fclose (fd);
sys/arch/atari/stand/ahdilabel/writedtab.c
44
FILE *fd;
sys/arch/atari/stand/ahdilabel/writedtab.c
47
if ((fd = fopen (strlen (disktab) ? disktab : _PATH_DISKTAB, "a"))
sys/arch/atari/stand/ahdilabel/writedtab.c
51
fprintf (fd, "%s disk|%s:\\\n",
sys/arch/atari/stand/ahdilabel/writedtab.c
53
fprintf (fd, "\t:ty#winchester:dt=%s:ns#%u:nt#%u:nc#%u:sc#%u:su#%u",
sys/arch/atari/stand/ahdilabel/writedtab.c
63
fprintf (fd,
sys/arch/atari/stand/ahdilabel/writedtab.c
70
fprintf (fd, "\\\n\t:p%c#%u:o%c#%u:t%c=",
sys/arch/atari/stand/ahdilabel/writedtab.c
81
fprintf (fd, "4.2BSD:");
sys/arch/atari/stand/ahdilabel/writedtab.c
84
fprintf (fd, "swap:");
sys/arch/atari/stand/ahdilabel/writedtab.c
88
fprintf (fd, "MSDOS:");
sys/arch/atari/stand/ahdilabel/writedtab.c
91
fprintf (fd, "unknown:" );
sys/arch/atari/stand/binpatch/binpatch.c
130
int ch, fd, rv, i, n;
sys/arch/atari/stand/binpatch/binpatch.c
198
if ((fd = open(fname, replace ? O_RDWR : O_RDONLY, 0)) == -1)
sys/arch/atari/stand/binpatch/binpatch.c
204
if ((rv = __fdnlist(fd, nl)) != 0)
sys/arch/atari/stand/binpatch/binpatch.c
215
if (fstat(fd, &sb) == -1)
sys/arch/atari/stand/binpatch/binpatch.c
222
MAP_FILE | MAP_SHARED, fd, 0)) == (char *)-1)
sys/arch/atari/stand/binpatch/binpatch.c
338
close(fd);
sys/arch/atari/stand/bootpref/bootpref.c
284
setNVpref (fd, bootpref, set, verbose);
sys/arch/atari/stand/bootpref/bootpref.c
286
getNVpref (fd, bootpref);
sys/arch/atari/stand/bootpref/bootpref.c
288
closeNVRAM (fd);
sys/arch/atari/stand/bootpref/bootpref.c
307
int fd;
sys/arch/atari/stand/bootpref/bootpref.c
309
if ((fd = open (nvrdev, O_RDWR)) < 0) {
sys/arch/atari/stand/bootpref/bootpref.c
312
return (fd);
sys/arch/atari/stand/bootpref/bootpref.c
316
closeNVRAM (int fd)
sys/arch/atari/stand/bootpref/bootpref.c
318
if (close (fd) < 0) {
sys/arch/atari/stand/bootpref/bootpref.c
324
readNVRAM (int fd, int pos)
sys/arch/atari/stand/bootpref/bootpref.c
328
if (lseek(fd, (off_t)pos, SEEK_SET) != pos) {
sys/arch/atari/stand/bootpref/bootpref.c
331
if (read (fd, &val, (size_t)1) != 1) {
sys/arch/atari/stand/bootpref/bootpref.c
338
writeNVRAM (int fd, int pos, u_char val)
sys/arch/atari/stand/bootpref/bootpref.c
340
if (lseek(fd, (off_t)pos, SEEK_SET) != pos) {
sys/arch/atari/stand/bootpref/bootpref.c
343
if (write (fd, &val, (size_t)1) != 1) {
sys/arch/atari/stand/bootpref/bootpref.c
349
getNVpref (int fd, u_char bootpref[])
sys/arch/atari/stand/bootpref/bootpref.c
353
showOS (readNVRAM (fd, NVRAM_BOOTPREF));
sys/arch/atari/stand/bootpref/bootpref.c
355
printf ("Boot delay is %d seconds\n", readNVRAM (fd, NVRAM_BOOTDLY));
sys/arch/atari/stand/bootpref/bootpref.c
358
showLang (readNVRAM (fd, NVRAM_LANG));
sys/arch/atari/stand/bootpref/bootpref.c
361
showKbdLang (readNVRAM (fd, NVRAM_KBDLANG));
sys/arch/atari/stand/bootpref/bootpref.c
364
if (readNVRAM (fd, NVRAM_HOSTID) & HOSTID_VALID) {
sys/arch/atari/stand/bootpref/bootpref.c
365
printf ("%d\n", readNVRAM (fd, NVRAM_HOSTID) ^ HOSTID_VALID);
sys/arch/atari/stand/bootpref/bootpref.c
371
showDateFmt (readNVRAM (fd, NVRAM_DATIME));
sys/arch/atari/stand/bootpref/bootpref.c
373
showDateSep (readNVRAM (fd, NVRAM_DATESEP));
sys/arch/atari/stand/bootpref/bootpref.c
375
printf ("Video is (0x%02x, 0x%02x) :\n", readNVRAM (fd, NVRAM_VID2),
sys/arch/atari/stand/bootpref/bootpref.c
376
readNVRAM (fd, NVRAM_VID1));
sys/arch/atari/stand/bootpref/bootpref.c
377
showVideo2 (readNVRAM (fd, NVRAM_VID2));
sys/arch/atari/stand/bootpref/bootpref.c
378
showVideo1 (readNVRAM (fd, NVRAM_VID1), readNVRAM (fd, NVRAM_VID2));
sys/arch/atari/stand/bootpref/bootpref.c
382
setNVpref (int fd, u_char bootpref[], int set, int verbose)
sys/arch/atari/stand/bootpref/bootpref.c
386
writeNVRAM (fd, NVRAM_BOOTPREF, bootpref[ARRAY_OS]);
sys/arch/atari/stand/bootpref/bootpref.c
389
showOS (readNVRAM (fd, NVRAM_BOOTPREF));
sys/arch/atari/stand/bootpref/bootpref.c
394
writeNVRAM (fd, NVRAM_BOOTDLY, bootpref[ARRAY_BOOTDLY]);
sys/arch/atari/stand/bootpref/bootpref.c
396
printf ("Boot delay set to %d seconds\n", readNVRAM (fd,
sys/arch/atari/stand/bootpref/bootpref.c
402
writeNVRAM (fd, NVRAM_LANG, bootpref[ARRAY_LANG]);
sys/arch/atari/stand/bootpref/bootpref.c
405
showLang (readNVRAM (fd, NVRAM_LANG));
sys/arch/atari/stand/bootpref/bootpref.c
410
writeNVRAM (fd, NVRAM_KBDLANG, bootpref[ARRAY_KBDLANG]);
sys/arch/atari/stand/bootpref/bootpref.c
413
showKbdLang (readNVRAM (fd, NVRAM_KBDLANG));
sys/arch/atari/stand/bootpref/bootpref.c
418
writeNVRAM (fd, NVRAM_HOSTID, bootpref[ARRAY_HOSTID] |
sys/arch/atari/stand/bootpref/bootpref.c
422
printf ("%d\n", readNVRAM (fd, NVRAM_HOSTID) ^
sys/arch/atari/stand/bootpref/bootpref.c
428
writeNVRAM (fd, NVRAM_DATIME, bootpref[ARRAY_DATIME]);
sys/arch/atari/stand/bootpref/bootpref.c
431
showDateFmt (readNVRAM (fd, NVRAM_DATIME));
sys/arch/atari/stand/bootpref/bootpref.c
436
writeNVRAM (fd, NVRAM_DATESEP, bootpref[ARRAY_DATESEP]);
sys/arch/atari/stand/bootpref/bootpref.c
439
showDateSep (readNVRAM (fd, NVRAM_DATESEP));
sys/arch/atari/stand/bootpref/bootpref.c
445
writeNVRAM (fd, NVRAM_VID2, bootpref[ARRAY_VID2]);
sys/arch/atari/stand/bootpref/bootpref.c
448
writeNVRAM (fd, NVRAM_VID1, bootpref[ARRAY_VID1]);
sys/arch/atari/stand/bootpref/bootpref.c
452
readNVRAM (fd, NVRAM_VID2),
sys/arch/atari/stand/bootpref/bootpref.c
453
readNVRAM (fd, NVRAM_VID1));
sys/arch/atari/stand/bootpref/bootpref.c
454
showVideo2 (readNVRAM (fd, NVRAM_VID2));
sys/arch/atari/stand/bootpref/bootpref.c
455
showVideo1 (readNVRAM (fd, NVRAM_VID1),
sys/arch/atari/stand/bootpref/bootpref.c
456
readNVRAM (fd, NVRAM_VID2));
sys/arch/atari/stand/bootpref/bootpref.c
89
int fd;
sys/arch/atari/stand/bootpref/bootpref.c
93
fd = openNVRAM ();
sys/arch/atari/stand/bootpref/bootpref.c
94
bootpref[ARRAY_VID2] = readNVRAM (fd, NVRAM_VID2);
sys/arch/atari/stand/bootpref/bootpref.c
95
bootpref[ARRAY_VID1] = readNVRAM (fd, NVRAM_VID1);
sys/arch/atari/stand/bootxx/bootxx.c
175
int fd = -1;
sys/arch/atari/stand/bootxx/bootxx.c
189
if ((fd = open(fname, 0)) < 0)
sys/arch/atari/stand/bootxx/bootxx.c
194
if (fd < 0)
sys/arch/atari/stand/bootxx/bootxx.c
196
while ((bsize = read(fd, bstart, 1024)) > 0) {
sys/arch/atari/stand/bootxx/bootxx.c
199
close(fd);
sys/arch/atari/stand/bootxxx/bootxxx.c
52
int fd;
sys/arch/atari/stand/bootxxx/bootxxx.c
72
if ((fd = open(od->osname, 0)) < 0) {
sys/arch/atari/stand/bootxxx/bootxxx.c
77
if (elf_load(fd, od, &errmsg, 1) != 0)
sys/arch/atari/stand/edahdi/edahdi.c
112
int fd;
sys/arch/atari/stand/edahdi/edahdi.c
126
if ((fd = open(argv[1], O_RDWR)) < 0)
sys/arch/atari/stand/edahdi/edahdi.c
128
if (fstat(fd, &st) < 0)
sys/arch/atari/stand/edahdi/edahdi.c
133
if ((rv = bsd_label(fd, LABELSECTOR)) < 0)
sys/arch/atari/stand/edahdi/edahdi.c
145
if ((ahdi_getparts(fd, &ptable, AHDI_BBLOCK, AHDI_BBLOCK) != 0)
sys/arch/atari/stand/edahdi/edahdi.c
149
edit_parts(fd, &ptable);
sys/arch/atari/stand/edahdi/edahdi.c
154
edit_parts(int fd, ptable_t *ptable)
sys/arch/atari/stand/edahdi/edahdi.c
202
update_disk(ptable, fd, value);
sys/arch/atari/stand/edahdi/edahdi.c
334
bsd_label(int fd, u_int offset)
sys/arch/atari/stand/edahdi/edahdi.c
341
bblk = disk_read(fd, offset, nsec);
sys/arch/atari/stand/edahdi/edahdi.c
396
ahdi_getparts(fd, ptable, rsec, esec)
sys/arch/atari/stand/edahdi/edahdi.c
397
int fd;
sys/arch/atari/stand/edahdi/edahdi.c
406
root = disk_read(fd, rsec, 1);
sys/arch/atari/stand/edahdi/edahdi.c
423
rv = ahdi_getparts(fd, ptable, offs,
sys/arch/atari/stand/edahdi/edahdi.c
453
disk_read(fd, start, count)
sys/arch/atari/stand/edahdi/edahdi.c
454
int fd;
sys/arch/atari/stand/edahdi/edahdi.c
467
if (lseek(fd, offset, SEEK_SET) != offset) {
sys/arch/atari/stand/edahdi/edahdi.c
471
if (read(fd, buffer, size) != size) {
sys/arch/atari/stand/edahdi/edahdi.c
480
update_disk(ptable_t *ptable, int fd, int pno)
sys/arch/atari/stand/edahdi/edahdi.c
489
root = disk_read(fd, rsec, 1);
sys/arch/atari/stand/edahdi/edahdi.c
510
disk_write(fd, rsec, 1, root);
sys/arch/atari/stand/edahdi/edahdi.c
515
disk_write(fd, start, count, buf)
sys/arch/atari/stand/edahdi/edahdi.c
516
int fd;
sys/arch/atari/stand/edahdi/edahdi.c
527
if (lseek(fd, offset, SEEK_SET) != offset)
sys/arch/atari/stand/edahdi/edahdi.c
529
if (write(fd, buf, size) != size)
sys/arch/atari/stand/installboot/disklabel.c
103
bsd_label(int fd, off_t offs, struct disklabel *label)
sys/arch/atari/stand/installboot/disklabel.c
108
if (lseek(fd, offs, SEEK_SET) != offs)
sys/arch/atari/stand/installboot/disklabel.c
110
if (read(fd, &bb, sizeof(bb)) != sizeof(bb))
sys/arch/atari/stand/installboot/disklabel.c
128
ahdi_label(int fd, uint32_t *bbsec, struct disklabel *label)
sys/arch/atari/stand/installboot/disklabel.c
135
if ((e = ahdi_getparts(fd, AHDI_BBLOCK, AHDI_BBLOCK, &al)) != 0)
sys/arch/atari/stand/installboot/disklabel.c
177
if ((e = bsd_label(fd, offs, label)) < 0)
sys/arch/atari/stand/installboot/disklabel.c
190
ahdi_getparts(int fd, daddr_t rsec, daddr_t esec, struct ahdilabel *alab)
sys/arch/atari/stand/installboot/disklabel.c
197
if (lseek(fd, ro, SEEK_SET) != ro) {
sys/arch/atari/stand/installboot/disklabel.c
198
off_t mend = lseek(fd, 0, SEEK_END);
sys/arch/atari/stand/installboot/disklabel.c
203
if (read(fd, &root, sizeof(root)) != sizeof(root))
sys/arch/atari/stand/installboot/disklabel.c
222
e = ahdi_getparts(fd, aux,
sys/arch/atari/stand/installboot/disklabel.c
78
int fd, e;
sys/arch/atari/stand/installboot/disklabel.c
83
if ((fd = open(fn, O_RDONLY)) < 0)
sys/arch/atari/stand/installboot/disklabel.c
87
if ((e = bsd_label(fd, (off_t)0, dl)) < 0)
sys/arch/atari/stand/installboot/disklabel.c
93
if ((e = ahdi_label(fd, &bbsec, dl)) < 0)
sys/arch/atari/stand/installboot/installboot.c
104
int fd, c;
sys/arch/atari/stand/installboot/installboot.c
145
fd = open(dn, O_RDONLY);
sys/arch/atari/stand/installboot/installboot.c
146
if (fd < 0 && errno == ENOENT) {
sys/arch/atari/stand/installboot/installboot.c
148
fd = open(dn, O_RDONLY);
sys/arch/atari/stand/installboot/installboot.c
152
fd = open(dn, O_RDONLY);
sys/arch/atari/stand/installboot/installboot.c
154
if (fd < 0)
sys/arch/atari/stand/installboot/installboot.c
156
if (ioctl(fd, DIOCGDINFO, &dl))
sys/arch/atari/stand/installboot/installboot.c
158
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
266
int fd;
sys/arch/atari/stand/installboot/installboot.c
267
if ((fd = open(devnm, O_WRONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
269
if (write(fd, &bootarea, sizeof(bootarea)) != sizeof(bootarea))
sys/arch/atari/stand/installboot/installboot.c
271
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
336
int fd;
sys/arch/atari/stand/installboot/installboot.c
338
if ((fd = open(devnm, O_WRONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
340
if (lseek(fd, bbo, SEEK_SET) != bbo)
sys/arch/atari/stand/installboot/installboot.c
342
if (write(fd, &bootarea, sizeof(bootarea)) != sizeof(bootarea))
sys/arch/atari/stand/installboot/installboot.c
348
if (lseek(fd, (off_t)0, SEEK_SET) != 0)
sys/arch/atari/stand/installboot/installboot.c
350
if (write(fd, &ahdiboot, sizeof(ahdiboot)) !=
sys/arch/atari/stand/installboot/installboot.c
357
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
368
int fd;
sys/arch/atari/stand/installboot/installboot.c
371
if ((fd = open(xxb00t, O_RDONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
373
if (read(fd, &tmproot, sizeof(tmproot)) != sizeof(tmproot))
sys/arch/atari/stand/installboot/installboot.c
375
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
382
if ((fd = open(devnm, O_RDONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
384
if (read(fd, newroot, sizeof(*newroot)) != sizeof(*newroot))
sys/arch/atari/stand/installboot/installboot.c
386
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
412
int fd;
sys/arch/atari/stand/installboot/installboot.c
423
if ((fd = open(bxx, O_RDONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
425
if (read(fd, bb->bb_bootxx, sizeof(bb->bb_bootxx))
sys/arch/atari/stand/installboot/installboot.c
428
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
432
if ((fd = open(xxb, O_RDONLY)) < 0)
sys/arch/atari/stand/installboot/installboot.c
434
if (read(fd, bb->bb_xxboot, sizeof(bb->bb_xxboot))
sys/arch/atari/stand/installboot/installboot.c
437
if (close(fd))
sys/arch/atari/stand/installboot/installboot.c
502
int fd;
sys/arch/atari/stand/installboot/installboot.c
504
if ((fd = open(nvrdev, O_RDWR)) < 0)
sys/arch/atari/stand/installboot/installboot.c
506
if (lseek(fd, (off_t)1, SEEK_SET) != 1)
sys/arch/atari/stand/installboot/installboot.c
508
if (write(fd, &bootpref, (size_t)1) != 1)
sys/arch/atari/stand/installboot/installboot.c
510
if (close(fd))
sys/arch/atari/stand/loadkmap/loadkmap.c
47
int fd;
sys/arch/atari/stand/loadkmap/loadkmap.c
53
if ((fd = open(file, 0)) >= 0) {
sys/arch/atari/stand/loadkmap/loadkmap.c
54
if (read(fd, buf, sizeof(buf)) == sizeof(buf)) {
sys/arch/atari/stand/loadkmap/loadkmap.c
56
close(fd);
sys/arch/atari/stand/loadkmap/loadkmap.c
63
close(fd);
sys/arch/atari/stand/msconfig/msconfig.c
50
int fd;
sys/arch/atari/stand/msconfig/msconfig.c
70
if ((fd = open(mousedev,O_RDONLY | O_NONBLOCK)) < 0) {
sys/arch/atari/stand/msconfig/msconfig.c
76
if(ioctl(fd, MIOCS3B_EMUL, (char *)&emul3b) < 0) {;
sys/arch/atari/stand/msconfig/msconfig.c
78
close(fd);
sys/arch/atari/stand/msconfig/msconfig.c
82
if(ioctl(fd, MIOCG3B_EMUL, (char *)&emul3b) < 0) {;
sys/arch/atari/stand/msconfig/msconfig.c
84
close(fd);
sys/arch/atari/stand/msconfig/msconfig.c
92
close(fd);
sys/arch/atari/stand/tostools/file2swp/file2swp.c
120
if ((fd = open(Infile, O_RDONLY)) < 0) {
sys/arch/atari/stand/tostools/file2swp/file2swp.c
129
while ((c = read(fd, buf, sizeof(buf))) > 0) {
sys/arch/atari/stand/tostools/file2swp/file2swp.c
140
close(fd);
sys/arch/atari/stand/tostools/file2swp/file2swp.c
79
int rv, c, fd;
sys/arch/atari/stand/tostools/libtos/aout.c
110
if (lseek(fd, ehdr.a_text+ehdr.a_data+ehdr.a_syms+sizeof(ehdr),
sys/arch/atari/stand/tostools/libtos/aout.c
114
if (read(fd, (char *)&stringsz, sizeof(long)) != sizeof(long))
sys/arch/atari/stand/tostools/libtos/aout.c
117
if (lseek(fd, sizeof(ehdr), 0) <= 0)
sys/arch/atari/stand/tostools/libtos/aout.c
130
if ((read(fd, (char *)(od->kstart), ehdr.a_text) != ehdr.a_text)
sys/arch/atari/stand/tostools/libtos/aout.c
131
||(read(fd,(char *)(od->kstart+textsz),ehdr.a_data) != ehdr.a_data))
sys/arch/atari/stand/tostools/libtos/aout.c
144
if (read(fd, (char *)p, ehdr.a_syms) != ehdr.a_syms)
sys/arch/atari/stand/tostools/libtos/aout.c
148
if (read(fd, (char *)p, stringsz) != stringsz)
sys/arch/atari/stand/tostools/libtos/aout.c
80
aout_load(int fd, osdsc_t *od, char **errp, int loadsyms)
sys/arch/atari/stand/tostools/libtos/aout.c
88
lseek(fd, (off_t)0, SEEK_SET);
sys/arch/atari/stand/tostools/libtos/aout.c
89
if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
sys/arch/atari/stand/tostools/libtos/cread.c
128
got = cread(s->fd, s->inbuf, Z_BUFSIZE);
sys/arch/atari/stand/tostools/libtos/cread.c
228
int fd;
sys/arch/atari/stand/tostools/libtos/cread.c
231
if ( ((fd = open(fname, mode)) == -1) || (mode != O_RDONLY) )
sys/arch/atari/stand/tostools/libtos/cread.c
233
return(fd);
sys/arch/atari/stand/tostools/libtos/cread.c
235
ss[fd] = s = malloc(sizeof(struct sd));
sys/arch/atari/stand/tostools/libtos/cread.c
249
s->fd = fd;
sys/arch/atari/stand/tostools/libtos/cread.c
251
return(fd);
sys/arch/atari/stand/tostools/libtos/cread.c
256
close(fd);
sys/arch/atari/stand/tostools/libtos/cread.c
261
cclose(int fd)
sys/arch/atari/stand/tostools/libtos/cread.c
265
s = ss[fd];
sys/arch/atari/stand/tostools/libtos/cread.c
272
return (close(fd));
sys/arch/atari/stand/tostools/libtos/cread.c
276
cread(int fd, void *buf, size_t len)
sys/arch/atari/stand/tostools/libtos/cread.c
281
s = ss[fd];
sys/arch/atari/stand/tostools/libtos/cread.c
308
got = read(s->fd, s->stream.next_out,
sys/arch/atari/stand/tostools/libtos/cread.c
320
got = read(fd, s->inbuf, Z_BUFSIZE);
sys/arch/atari/stand/tostools/libtos/cread.c
364
clseek(int fd, off_t offset, int where)
sys/arch/atari/stand/tostools/libtos/cread.c
368
s = ss[fd];
sys/arch/atari/stand/tostools/libtos/cread.c
371
off_t res = lseek(fd, offset, where);
sys/arch/atari/stand/tostools/libtos/cread.c
388
res = lseek(fd, 0, SEEK_SET);
sys/arch/atari/stand/tostools/libtos/cread.c
401
s->fd = fd;
sys/arch/atari/stand/tostools/libtos/cread.c
414
if (cread(fd, dummybuf, len) != len) {
sys/arch/atari/stand/tostools/libtos/cread.c
80
int fd;
sys/arch/atari/stand/tostools/libtos/elf.c
116
if (lseek(fd, (off_t)ehdr.e_shoff, SEEK_SET) != ehdr.e_shoff)
sys/arch/atari/stand/tostools/libtos/elf.c
122
if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
sys/arch/atari/stand/tostools/libtos/elf.c
154
if (lseek(fd, (off_t)php->p_offset, SEEK_SET) != php->p_offset)
sys/arch/atari/stand/tostools/libtos/elf.c
158
if (read(fd, p, php->p_filesz) != php->p_filesz)
sys/arch/atari/stand/tostools/libtos/elf.c
178
if (lseek(fd, (off_t)ehdr.e_shoff, SEEK_SET) != ehdr.e_shoff)
sys/arch/atari/stand/tostools/libtos/elf.c
181
if (read(fd, p, nhdrs * sizeof(*shp)) != nhdrs * sizeof(*shp))
sys/arch/atari/stand/tostools/libtos/elf.c
191
if (lseek(fd, (off_t)shp[i].sh_offset, SEEK_SET) !=
sys/arch/atari/stand/tostools/libtos/elf.c
195
if (read(fd, p, shp[i].sh_size) != shp[i].sh_size)
sys/arch/atari/stand/tostools/libtos/elf.c
204
if (lseek(fd, (off_t)shp[j].sh_offset, SEEK_SET) !=
sys/arch/atari/stand/tostools/libtos/elf.c
208
if (read(fd, p, shp[j].sh_size) != shp[j].sh_size)
sys/arch/atari/stand/tostools/libtos/elf.c
68
elf_load(int fd, osdsc_t *od, char **errp, int loadsyms)
sys/arch/atari/stand/tostools/libtos/elf.c
78
lseek(fd, (off_t)0, SEEK_SET);
sys/arch/atari/stand/tostools/libtos/elf.c
79
if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
sys/arch/atari/stand/tostools/libtos/elf.c
94
if (read(fd, phdrs, i) != i)
sys/arch/atari/stand/tostools/libtos/eprintf.c
42
int fd;
sys/arch/atari/stand/tostools/libtos/eprintf.c
44
fd = creat(fn, 0666);
sys/arch/atari/stand/tostools/libtos/eprintf.c
45
if (fd < 0 || dup2(fd, STDOUT_FILENO) < 0)
sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
155
if ((fd = open(kname, O_RDONLY)) < 0)
sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
157
if ((err = elf_load(fd, od, &errmsg, !N_flag)) == -1) {
sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
161
if (err = aout_load(fd, od, &errmsg, !N_flag)) {
sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
172
close(fd);
sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
75
int fd;
sys/arch/atari/stand/tostools/rawwrite/rawwrite.c
104
if ((fd = open(infile, O_RDONLY)) < 0)
sys/arch/atari/stand/tostools/rawwrite/rawwrite.c
108
n = read(fd, buf, nsect * SECT_SIZE);
sys/arch/atari/stand/tostools/rawwrite/rawwrite.c
124
close(fd);
sys/arch/atari/stand/tostools/rawwrite/rawwrite.c
60
int fd;
sys/arch/emips/stand/common/bootxx.c
114
int fd, i;
sys/arch/emips/stand/common/bootxx.c
141
if ((fd = open(bootfname, 0)) < 0) {
sys/arch/emips/stand/common/bootxx.c
147
i = read(fd, (char *)&ehdr, sizeof(ehdr));
sys/arch/emips/stand/common/bootxx.c
156
if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0)
sys/arch/emips/stand/common/bootxx.c
158
if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr))
sys/arch/emips/stand/common/bootxx.c
162
if (lseek(fd, (off_t)phdr.p_offset, 0) < 0)
sys/arch/emips/stand/common/bootxx.c
164
if (read(fd, (char *)phdr.p_paddr, phdr.p_filesz) != phdr.p_filesz)
sys/arch/emips/stand/common/bootxx.c
171
(void) close(fd);
sys/arch/evbarm/stand/boot2440/main.c
113
int fd;
sys/arch/evbarm/stand/boot2440/main.c
208
fd = open(bootfile, 0);
sys/arch/evbarm/stand/boot2440/main.c
209
if (fd < 0) {
sys/arch/evbarm/stand/boot2440/main.c
211
close(fd);
sys/arch/evbarm/stand/boot2440/main.c
215
if (fdloadfile(fd, marks, LOAD_ALL) == 0) {
sys/arch/evbarm/stand/boot2440/main.c
244
lseek(fd, (off_t)0, SEEK_SET);
sys/arch/evbarm/stand/boot2440/main.c
245
read(fd, &hdr, sizeof(hdr));
sys/arch/evbmips/stand/sbmips/common/boot.c
105
booted_dev_setfd(fd);
sys/arch/evbmips/stand/sbmips/common/boot.c
77
main(long fwhandle,long fd,long fwentry)
sys/arch/evbmips/stand/sbmips/common/bootxx.c
109
if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
sys/arch/evbmips/stand/sbmips/common/bootxx.c
85
int fd;
sys/arch/evbmips/stand/sbmips/common/bootxx.c
98
fd = open("boot", 0);
sys/arch/evbmips/stand/sbmips/common/bootxx.c
99
if (fd == -1 || (fstat(fd, &sb) == -1)) {
sys/arch/evbmips/stand/sbmips/common/common.h
56
#define booted_dev_setfd(fd) ((void)(booted_dev_fd = fd))
sys/arch/evbppc/stand/wii/boot.c
100
int fd;
sys/arch/evbppc/stand/wii/boot.c
103
fd = loadfile(fname, marks, LOAD_KERNEL);
sys/arch/evbppc/stand/wii/boot.c
104
if (fd == -1) {
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
31
int fd, size, c;
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
63
fd = open(kernel, OptRead);
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
64
if (fd == -1) {
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
92
size = read(fd, mem, 0x4000);
sys/arch/evbsh3/stand/mesboot/src/mesboot.c
97
close(fd);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
116
close(fd);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
122
fd = open(argp[1], O_RDWR);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
123
read(fd, buf, fileoff);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
125
lseek(fd, 8, SEEK_CUR);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
126
while ((i = read(fd, buf, 1024)) > 0)
sys/arch/ews4800mips/stand/common/coffhdrfix.c
128
close(fd);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
83
int fd, fdout, fileoff, i;
sys/arch/ews4800mips/stand/common/coffhdrfix.c
92
if ((fd = open(argp[1], O_RDWR)) < 0) {
sys/arch/ews4800mips/stand/common/coffhdrfix.c
96
read(fd, &file, sizeof file);
sys/arch/ews4800mips/stand/common/coffhdrfix.c
97
read(fd, &aout, sizeof aout);
sys/arch/hp300/dev/frodo.c
150
const struct frodo_device *fd;
sys/arch/hp300/dev/frodo.c
191
for (fd = frodo_subdevs; fd->fd_name != NULL; fd++) {
sys/arch/hp300/dev/frodo.c
197
if (fd->fd_offset == FRODO_APCI_OFFSET(1) &&
sys/arch/hp300/dev/frodo.c
203
if (fd->fd_offset == FRODO_CALENDAR && mmuid != MMUID_425_E)
sys/arch/hp300/dev/frodo.c
205
fa.fa_name = fd->fd_name;
sys/arch/hp300/dev/frodo.c
208
fa.fa_offset = fd->fd_offset;
sys/arch/hp300/dev/frodo.c
209
fa.fa_line = fd->fd_line;
sys/arch/hp300/stand/common/exec.c
51
int fd;
sys/arch/hp300/stand/common/exec.c
54
if ((fd = loadfile(file, marks, LOAD_KERNEL)) == -1)
sys/arch/hp300/stand/mkboot/mkboot.c
231
int fd;
sys/arch/hp300/stand/mkboot/mkboot.c
235
if ((fd = open(from, 0)) < 0)
sys/arch/hp300/stand/mkboot/mkboot.c
237
fstat(fd, &statb);
sys/arch/hp300/stand/mkboot/mkboot.c
242
if (read(fd, bp, statb.st_size) < 0)
sys/arch/hp300/stand/mkboot/mkboot.c
244
(void)close(fd);
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
571
WIN32_FIND_DATA fd;
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
575
find = FindFirstFile(path, &fd);
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
579
int attr = fd.dwFileAttributes;
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
582
!is_ignore_directory(fd.cFileName)) {
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
583
wcscpy(path, fd.cFileName);
sys/arch/hpc/stand/hpcboot/menu/menu.cpp
587
} while (FindNextFile(find, &fd));
sys/arch/hpcmips/dev/mq200debug.c
133
int fd, sd, rc;
sys/arch/hpcmips/dev/mq200debug.c
135
fd = (reg&MQ200_GCC_MCLK_FD_MASK)>>MQ200_GCC_MCLK_FD_SHIFT;
sys/arch/hpcmips/dev/mq200debug.c
138
FIXEDFLOAT1000(clocks[rc]*10/fd_vals[fd]/sd),
sys/arch/hpcmips/dev/mq200debug.c
139
clknames[rc], fd_names[fd], sd);
sys/arch/hpcmips/dev/mq200debug.c
155
int fd, sd, rc;
sys/arch/hpcmips/dev/mq200debug.c
157
fd = (reg&MQ200_GCC_MCLK_FD_MASK)>>MQ200_GCC_MCLK_FD_SHIFT;
sys/arch/hpcmips/dev/mq200debug.c
160
FIXEDFLOAT1000(clocks[rc]*10/fd_vals[fd]/sd),
sys/arch/hpcmips/dev/mq200debug.c
161
clknames[rc], fd_names[fd], sd);
sys/arch/hpcmips/stand/pbsdboot/elf.c
102
if (read(fd, vaddr, n) != n) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
129
scanfile(int fd, void **start, void **end, void **entry, int load)
sys/arch/hpcmips/stand/pbsdboot/elf.c
141
if (lseek(fd, 0, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
146
if (read(fd, (void*)elf, sizeof(Elf_Ehdr)) != sizeof(Elf_Ehdr)) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
159
if (lseek(fd, elf->e_phoff, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
164
if (read(fd, (void *)phtbl, sizeof(Elf_Phdr) * elf->e_phnum)
sys/arch/hpcmips/stand/pbsdboot/elf.c
171
if (lseek(fd, elf->e_shoff, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
176
if (read(fd, (void *)shtbl, sizeof(Elf_Shdr) * elf->e_shnum)
sys/arch/hpcmips/stand/pbsdboot/elf.c
202
if (lseek(fd, phtbl[i].p_offset, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
208
if (vmem_sub(VMEM_LOAD, (void*)fd,
sys/arch/hpcmips/stand/pbsdboot/elf.c
308
if (lseek(fd, shtbl[sh_symidx].sh_offset, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
314
if (vmem_sub(VMEM_LOAD, (void*)fd,
sys/arch/hpcmips/stand/pbsdboot/elf.c
321
if (lseek(fd, shtbl[sh_stridx].sh_offset, SEEK_SET) == -1) {
sys/arch/hpcmips/stand/pbsdboot/elf.c
327
if (vmem_sub(VMEM_LOAD, (void*)fd,
sys/arch/hpcmips/stand/pbsdboot/elf.c
52
scanfile(int fd, void **start, void **end, void **entry, int load);
sys/arch/hpcmips/stand/pbsdboot/elf.c
57
getinfo(int fd, void **start, void **end)
sys/arch/hpcmips/stand/pbsdboot/elf.c
59
return (scanfile(fd, start, end, NULL, 0));
sys/arch/hpcmips/stand/pbsdboot/elf.c
63
loadfile(int fd, void **entry)
sys/arch/hpcmips/stand/pbsdboot/elf.c
65
return (scanfile(fd, NULL, NULL, entry, 1));
sys/arch/hpcmips/stand/pbsdboot/elf.c
79
int fd = (int)xxx;
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
103
if (0 <= fd) {
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
104
close(fd);
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
49
int fd = -1;
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
52
if (CheckCancel(0) || (fd = open((char*)wkernel_name, O_RDONLY)) < 0) {
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
59
if (CheckCancel(0) || getinfo(fd, &start, &end) < 0) {
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c
88
if (CheckCancel(0) || loadfile(fd, &start) < 0) {
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.h
141
int getinfo(int fd, void **start, void **end);
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.h
142
int loadfile(int fd, void **entry);
sys/arch/hppa/stand/boot/boot.c
230
int fd;
sys/arch/hppa/stand/boot/boot.c
237
if ((fd = loadfile(file, marks, LOAD_KERNEL)) == -1)
sys/arch/hppa/stand/cdboot/cdboot.c
108
if ((fd = loadfile(path, marks, LOAD_KERNEL)) == -1)
sys/arch/hppa/stand/cdboot/cdboot.c
90
int fd;
sys/arch/hppa/stand/common/dev_hppa.c
251
ttyname(int fd)
sys/arch/hppa/stand/common/exec_som.c
38
som_probe(int fd, union x_header *hdr)
sys/arch/hppa/stand/common/exec_som.c
45
som_load(int fd, struct x_param *xp)
sys/arch/hppa/stand/common/exec_som.c
50
if (lseek(fd, xf->aux_loc, SEEK_SET) < 0 ||
sys/arch/hppa/stand/common/exec_som.c
51
read (fd, &x, sizeof(x)) != sizeof(x)) {
sys/arch/hppa/stand/common/exec_som.c
83
som_ldsym(int fd, struct x_param *xp)
sys/arch/hppa/stand/xxboot/readufs.c
28
int fd;
sys/arch/hppa/stand/xxboot/readufs.c
331
if ((fd = open(argv[1], O_RDONLY)) < 0)
sys/arch/hppa/stand/xxboot/readufs.c
34
if (pread(fd, buf, bytelen, (off_t)dbtob(blkpos)) != (ssize_t) bytelen)
sys/arch/i386/stand/bootxx/boot1.c
104
fd = ob();
sys/arch/i386/stand/bootxx/boot1.c
105
if (fd != -1)
sys/arch/i386/stand/bootxx/boot1.c
122
fd = ob();
sys/arch/i386/stand/bootxx/boot1.c
125
if (fd == -1 || fstat(fd, &sb) == -1)
sys/arch/i386/stand/bootxx/boot1.c
134
if (read(fd, (void *)SECONDARY_LOAD_ADDRESS, biosdev) != biosdev)
sys/arch/i386/stand/bootxx/boot1.c
71
int fd;
sys/arch/i386/stand/bootxx/boot1.c
85
fd = ob();
sys/arch/i386/stand/bootxx/boot1.c
86
if (fd != -1)
sys/arch/i386/stand/bootxx/boot1.c
95
fd = ob();
sys/arch/i386/stand/bootxx/boot1.c
96
if (fd != -1)
sys/arch/i386/stand/lib/exec.c
316
int fd, flags;
sys/arch/i386/stand/lib/exec.c
325
if ((fd = loadfile(prekernpath, marks, flags)) == -1)
sys/arch/i386/stand/lib/exec.c
327
close(fd);
sys/arch/i386/stand/lib/exec.c
338
if ((fd = loadfile(file, marks, flags)) == -1)
sys/arch/i386/stand/lib/exec.c
340
close(fd);
sys/arch/i386/stand/lib/exec.c
376
int fd;
sys/arch/i386/stand/lib/exec.c
382
if ((fd = loadfile(file, marks,
sys/arch/i386/stand/lib/exec.c
386
close(fd);
sys/arch/i386/stand/lib/exec.c
609
int fd;
sys/arch/i386/stand/lib/exec.c
614
fd = open(path, mode);
sys/arch/i386/stand/lib/exec.c
615
if (fd != -1) {
sys/arch/i386/stand/lib/exec.c
620
fd = open(bm->bm_path, mode);
sys/arch/i386/stand/lib/exec.c
621
if (fd != -1 && (howto & AB_SILENT) == 0 && doload)
sys/arch/i386/stand/lib/exec.c
624
if (!doload && fd == -1) {
sys/arch/i386/stand/lib/exec.c
630
return fd;
sys/arch/i386/stand/lib/exec.c
683
int err, fd, nfail = 0;
sys/arch/i386/stand/lib/exec.c
691
fd = module_open(bm, 0, kdev, module_base, false);
sys/arch/i386/stand/lib/exec.c
692
if (fd == -1) {
sys/arch/i386/stand/lib/exec.c
697
err = fstat(fd, &st);
sys/arch/i386/stand/lib/exec.c
700
close(fd);
sys/arch/i386/stand/lib/exec.c
706
close(fd);
sys/arch/i386/stand/lib/exec.c
728
fd = module_open(bm, 0, kdev, module_base, true);
sys/arch/i386/stand/lib/exec.c
729
if (fd == -1)
sys/arch/i386/stand/lib/exec.c
732
len = pread(fd, (void *)(uintptr_t)image_end, SSIZE_MAX);
sys/arch/i386/stand/lib/exec.c
765
close(fd);
sys/arch/i386/stand/lib/exec_multiboot1.c
222
int fd = -1;
sys/arch/i386/stand/lib/exec_multiboot1.c
228
if ((fd = open(path, 0)) == -1)
sys/arch/i386/stand/lib/exec_multiboot1.c
231
readen = read(fd, buf, sizeof(buf));
sys/arch/i386/stand/lib/exec_multiboot1.c
261
if (fd != -1)
sys/arch/i386/stand/lib/exec_multiboot1.c
262
close(fd);
sys/arch/i386/stand/lib/exec_multiboot2.c
1480
int fd = -1;
sys/arch/i386/stand/lib/exec_multiboot2.c
1489
if ((fd = open(path, 0)) == -1)
sys/arch/i386/stand/lib/exec_multiboot2.c
1492
readen = read(fd, buf, sizeof(buf));
sys/arch/i386/stand/lib/exec_multiboot2.c
1526
if (lseek(fd, i, SEEK_SET) != i) {
sys/arch/i386/stand/lib/exec_multiboot2.c
1534
if (read(fd, mbh, mbh_len) != mbh_len) {
sys/arch/i386/stand/lib/exec_multiboot2.c
1632
if (fd != -1)
sys/arch/i386/stand/lib/exec_multiboot2.c
1633
close(fd);
sys/arch/i386/stand/lib/pread.c
44
pread(int fd, void *dest, size_t size)
sys/arch/i386/stand/lib/pread.c
58
got = read(fd, buf, count);
sys/arch/i386/stand/lib/test/biosdisk_user.c
103
if (read(fd, buf, nsec * 512) != nsec * 512) {
sys/arch/i386/stand/lib/test/biosdisk_user.c
48
static int fd = -1;
sys/arch/i386/stand/lib/test/biosdisk_user.c
55
if (fd != -1) {
sys/arch/i386/stand/lib/test/biosdisk_user.c
56
close(fd);
sys/arch/i386/stand/lib/test/biosdisk_user.c
57
fd = -1;
sys/arch/i386/stand/lib/test/biosdisk_user.c
72
fd = open(emuldisktab[i].name, O_RDONLY, 0);
sys/arch/i386/stand/lib/test/biosdisk_user.c
73
if (fd < 0) {
sys/arch/i386/stand/lib/test/biosdisk_user.c
97
if (lseek(fd, ((cyl * emuldisktab[currentdte].heads + head)
sys/arch/ia64/ia64/sal.c
127
struct ia64_fdesc *fd;
sys/arch/ia64/ia64/sal.c
169
fd = (struct ia64_fdesc *) os_boot_rendez;
sys/arch/ia64/ia64/sal.c
171
SAL_OS_BOOT_RENDEZ, ia64_tpa(fd->func),
sys/arch/ia64/ia64/sal.c
172
ia64_tpa(fd->gp), 0, 0, 0, 0);
sys/arch/ia64/stand/common/boot.c
293
int fd, error;
sys/arch/ia64/stand/common/boot.c
299
if ((fd = open(lbuf, O_RDONLY)) < 0)
sys/arch/ia64/stand/common/boot.c
304
while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) {
sys/arch/ia64/stand/common/boot.c
344
close(fd);
sys/arch/ia64/stand/common/bootstrap.h
320
ssize_t (*arch_readin)(const int fd, vaddr_t dest,
sys/arch/ia64/stand/common/bootstrap.h
403
extern int fgetstr(char *buf, int size, int fd);
sys/arch/ia64/stand/common/bootstrap.h
88
int kern_pread(int fd, vaddr_t dest, size_t len, off_t off);
sys/arch/ia64/stand/common/bootstrap.h
89
void *alloc_pread(int fd, off_t off, size_t len);
sys/arch/ia64/stand/common/commands.c
81
help_getnext(int fd, char **topic, char **subtopic, char **desc)
sys/arch/ia64/stand/common/commands.c
86
if (fgetstr(line, 80, fd) < 0)
sys/arch/ia64/stand/common/gets.c
100
err = read(fd, &c, sizeof(c));
sys/arch/ia64/stand/common/gets.c
92
fgetstr(char *buf, int size, int fd)
sys/arch/ia64/stand/common/interp.c
204
int prevsrcid, fd, line;
sys/arch/ia64/stand/common/interp.c
208
int fd, flags, line;
sys/arch/ia64/stand/common/interp.c
211
if (((fd = open(filename, O_RDONLY)) == -1)) {
sys/arch/ia64/stand/common/interp.c
222
while (fgetstr(input, sizeof(input), fd) >= 0) {
sys/arch/ia64/stand/common/interp.c
260
close(fd);
sys/arch/ia64/stand/common/interp.c
269
bf_vm->sourceID.i = fd;
sys/arch/ia64/stand/common/load_elf64.c
56
int fd;
sys/arch/ia64/stand/common/load_elf64.c
78
if ((fd = loadfile(filename, marks, LOAD_KERNEL)) == -1) {
sys/arch/ia64/stand/common/load_elf64.c
82
close(fd);
sys/arch/ia64/stand/common/ls.c
104
while ((d = readdirfd(fd)) != NULL) {
sys/arch/ia64/stand/common/ls.c
129
if (fd != -1)
sys/arch/ia64/stand/common/ls.c
130
close(fd);
sys/arch/ia64/stand/common/ls.c
144
int fd;
sys/arch/ia64/stand/common/ls.c
149
fd = -1;
sys/arch/ia64/stand/common/ls.c
164
fd = open(path, O_RDONLY);
sys/arch/ia64/stand/common/ls.c
165
if (fd < 0) {
sys/arch/ia64/stand/common/ls.c
169
if (fstat(fd, &sb) < 0) {
sys/arch/ia64/stand/common/ls.c
179
return(fd);
sys/arch/ia64/stand/common/ls.c
184
if (fd != -1)
sys/arch/ia64/stand/common/ls.c
185
close(fd);
sys/arch/ia64/stand/common/ls.c
61
int fd;
sys/arch/ia64/stand/common/ls.c
70
fd = -1;
sys/arch/ia64/stand/common/ls.c
94
fd = ls_getdir(&path);
sys/arch/ia64/stand/common/ls.c
95
if (fd == -1) {
sys/arch/ia64/stand/common/misc.c
124
kern_pread(int fd, vaddr_t dest, size_t len, off_t off)
sys/arch/ia64/stand/common/misc.c
128
if (lseek(fd, off, SEEK_SET) == -1) {
sys/arch/ia64/stand/common/misc.c
132
nread = archsw.arch_readin(fd, dest, len);
sys/arch/ia64/stand/common/misc.c
145
alloc_pread(int fd, off_t off, size_t len)
sys/arch/ia64/stand/common/misc.c
155
if (lseek(fd, off, SEEK_SET) == -1) {
sys/arch/ia64/stand/common/misc.c
160
nread = read(fd, buf, len);
sys/arch/ia64/stand/common/pager.c
138
int fd;
sys/arch/ia64/stand/common/pager.c
141
if ((fd = open(fname, O_RDONLY)) == -1) {
sys/arch/ia64/stand/common/pager.c
147
hmuch = read(fd, buf, sizeof(buf) - 1);
sys/arch/ia64/stand/common/pager.c
162
close(fd);
sys/arch/ia64/stand/common/readdir.c
44
readdirfd(int fd)
sys/arch/ia64/stand/common/readdir.c
47
struct open_file *f = &files[fd];
sys/arch/ia64/stand/common/readdir.c
49
if ((unsigned)fd >= SOPEN_MAX) {
sys/arch/ia64/stand/efi/libefi/copy.c
57
efi_readin(int fd, vaddr_t va, size_t len)
sys/arch/ia64/stand/efi/libefi/copy.c
60
return (read(fd, (void *)efimd_va2pa(va), len));
sys/arch/ia64/stand/efi/libefi/efiboot.h
85
extern ssize_t efi_readin(const int fd, vaddr_t dest, size_t len);
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
130
int fd;
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
138
if ((fd = open(path, 0)) < 0
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
139
|| fstat(fd, &sb) < 0
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
143
if (fd >= 0)
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
144
close(fd);
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
153
fd = open(p, 0);
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
156
fd = open("", 0);
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
160
if (fd < 0) {
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
164
if (fstat(fd, &sb) < 0) {
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
174
while ((size = read(fd, dirbuf, DIRBLKSIZ)) == DIRBLKSIZ) {
sys/arch/ia64/stand/efi/libefi/efifs_ls.c
232
close(fd);
sys/arch/ia64/stand/ia64/ski/copy.c
60
ski_readin(int fd, vaddr_t dest, size_t len)
sys/arch/ia64/stand/ia64/ski/copy.c
62
return (read(fd, (void*) IA64_RR_MASK(dest), len));
sys/arch/ia64/stand/ia64/ski/libski.h
71
extern ssize_t ski_readin(int fd, vaddr_t dest, size_t len);
sys/arch/ia64/stand/ia64/ski/sal_stub.c
118
struct ia64_fdesc *fd;
sys/arch/ia64/stand/ia64/ski/sal_stub.c
120
fd = (void*)PalProc;
sys/arch/ia64/stand/ia64/ski/sal_stub.c
121
sal_systab.entry.sale_pal_proc = fd->func;
sys/arch/ia64/stand/ia64/ski/sal_stub.c
122
fd = (void*)SalProc;
sys/arch/ia64/stand/ia64/ski/sal_stub.c
123
sal_systab.entry.sale_sal_proc = fd->func;
sys/arch/ia64/stand/ia64/ski/sal_stub.c
124
sal_systab.entry.sale_sal_gp = fd->gp;
sys/arch/ia64/stand/ia64/ski/skifs.c
46
int fd;
sys/arch/ia64/stand/ia64/ski/skifs.c
53
int fd;
sys/arch/ia64/stand/ia64/ski/skifs.c
62
fd = ssc((u_int64_t) path, 1, 0, 0, SSC_OPEN);
sys/arch/ia64/stand/ia64/ski/skifs.c
64
if (fd > 0) {
sys/arch/ia64/stand/ia64/ski/skifs.c
65
f->f_fsdata = (void*)(u_int64_t) fd;
sys/arch/ia64/stand/ia64/ski/skifs.c
87
stat.fd = (u_int64_t) f->f_fsdata;
sys/arch/landisk/stand/boot/boot2.c
272
int fd;
sys/arch/landisk/stand/boot/boot2.c
277
if ((fd = loadfile(file, marks, LOAD_KERNEL)) == -1)
sys/arch/landisk/stand/bootxx/boot1.c
101
fd = open("boot", 0);
sys/arch/landisk/stand/bootxx/boot1.c
104
if (fd == -1 || fstat(fd, &sb) == -1)
sys/arch/landisk/stand/bootxx/boot1.c
112
if (read(fd, (void *)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size)
sys/arch/landisk/stand/bootxx/boot1.c
60
int fd;
sys/arch/landisk/stand/bootxx/boot1.c
71
fd = open("boot", 0);
sys/arch/landisk/stand/bootxx/boot1.c
72
if (fd != -1)
sys/arch/landisk/stand/bootxx/boot1.c
82
fd = open("boot", 0);
sys/arch/landisk/stand/bootxx/boot1.c
83
if (fd != -1)
sys/arch/mac68k/obio/iwm_fd.c
1001
fdstart(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1035
st = (*state[st])(fd);
sys/arch/mac68k/obio/iwm_fd.c
1049
fdstart_Init(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1057
bp = bufq_peek(fd->bufQueue);
sys/arch/mac68k/obio/iwm_fd.c
1063
fd->ioDirection = bp->b_flags & B_READ;
sys/arch/mac68k/obio/iwm_fd.c
1065
disk_busy(&fd->diskInfo);
sys/arch/mac68k/obio/iwm_fd.c
1066
if (!(fd->state & IWM_FD_MOTOR_ON)) {
sys/arch/mac68k/obio/iwm_fd.c
1067
iwmMotor(fd->unit, 1);
sys/arch/mac68k/obio/iwm_fd.c
1068
fd->state |= IWM_FD_MOTOR_ON;
sys/arch/mac68k/obio/iwm_fd.c
1070
fd->current_buffer = bp->b_data;
sys/arch/mac68k/obio/iwm_fd.c
1073
fd->startBlk = bp->b_blkno;
sys/arch/mac68k/obio/iwm_fd.c
1075
fd->iwmErr = 0;
sys/arch/mac68k/obio/iwm_fd.c
1076
fd->ioRetries = 0; /* XXX */
sys/arch/mac68k/obio/iwm_fd.c
1077
fd->seekRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1078
fd->bytesDone = 0;
sys/arch/mac68k/obio/iwm_fd.c
1079
fd->bytesLeft = bp->b_bcount;
sys/arch/mac68k/obio/iwm_fd.c
1088
fdstart_Seek(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1094
printf(" Remap block %lld ", (long long) fd->startBlk);
sys/arch/mac68k/obio/iwm_fd.c
1095
remap_geometry(fd->startBlk,
sys/arch/mac68k/obio/iwm_fd.c
1096
fd->currentType->heads, &fd->pos);
sys/arch/mac68k/obio/iwm_fd.c
1098
printf("to c%d_h%d_s%d ", fd->pos.track,
sys/arch/mac68k/obio/iwm_fd.c
1099
fd->pos.side, fd->pos.sector);
sys/arch/mac68k/obio/iwm_fd.c
1101
if (fd->cachedSide != fd->pos.side) {
sys/arch/mac68k/obio/iwm_fd.c
1104
invalidateCylinderCache(fd);
sys/arch/mac68k/obio/iwm_fd.c
1105
fd->cachedSide = fd->pos.side;
sys/arch/mac68k/obio/iwm_fd.c
1112
if (fd->pos.track != fd->pos.oldTrack &&
sys/arch/mac68k/obio/iwm_fd.c
1113
0 != (fd->iwmErr = seek(fd, IWM_SEEK_VANILLA))) {
sys/arch/mac68k/obio/iwm_fd.c
1116
state = (fd->ioDirection == IWM_WRITE)
sys/arch/mac68k/obio/iwm_fd.c
1137
fdstart_Read(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1145
fd->seekRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1146
fd->sectRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1147
pos = &fd->pos;
sys/arch/mac68k/obio/iwm_fd.c
1148
shdr = &fd->sHdr;
sys/arch/mac68k/obio/iwm_fd.c
1152
fd->ioDirection ? "Read" : "Write",
sys/arch/mac68k/obio/iwm_fd.c
1157
if (fd->r_slots[i].valid) {
sys/arch/mac68k/obio/iwm_fd.c
1160
memcpy(fd->current_buffer, fd->r_slots[i].secbuf,
sys/arch/mac68k/obio/iwm_fd.c
1161
fd->currentType->sectorSize);
sys/arch/mac68k/obio/iwm_fd.c
1171
fd->iwmErr = iwmReadSector(&fd->sHdr, fd->r_slots,
sys/arch/mac68k/obio/iwm_fd.c
1172
fd->current_buffer);
sys/arch/mac68k/obio/iwm_fd.c
1178
shdr->sector, fd->iwmErr, fd->sectRetries);
sys/arch/mac68k/obio/iwm_fd.c
1181
if (fd->iwmErr != 0)
sys/arch/mac68k/obio/iwm_fd.c
1188
pos->track, shdr->track, fd->seekRetries);
sys/arch/mac68k/obio/iwm_fd.c
1190
if (iwm->maxRetries > fd->seekRetries++) {
sys/arch/mac68k/obio/iwm_fd.c
1191
fd->iwmErr = seek(fd, IWM_SEEK_RECAL);
sys/arch/mac68k/obio/iwm_fd.c
1193
printf("[%d]", fd->seekRetries);
sys/arch/mac68k/obio/iwm_fd.c
1194
(void)checkTrack(&fd->pos, 1);
sys/arch/mac68k/obio/iwm_fd.c
1197
fd->iwmErr = seekErr;
sys/arch/mac68k/obio/iwm_fd.c
1198
return (0 == fd->iwmErr) ? state_Read : state_Fault;
sys/arch/mac68k/obio/iwm_fd.c
1206
shdr->sector, fd->sectRetries);
sys/arch/mac68k/obio/iwm_fd.c
1207
fd->iwmErr = noAdrMkErr;
sys/arch/mac68k/obio/iwm_fd.c
1222
fdstart_Write(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1227
fd->sHdr.side = fd->pos.side;
sys/arch/mac68k/obio/iwm_fd.c
1228
fd->sHdr.sector = fd->pos.sector;
sys/arch/mac68k/obio/iwm_fd.c
1229
fd->sHdr.track = fd->pos.track;
sys/arch/mac68k/obio/iwm_fd.c
1231
i = fd->pos.sector;
sys/arch/mac68k/obio/iwm_fd.c
1232
fd->w_slots[i].secbuf = fd->current_buffer;
sys/arch/mac68k/obio/iwm_fd.c
1233
fd->w_slots[i].valid = 1; /* "valid" is a dirty buffer here */
sys/arch/mac68k/obio/iwm_fd.c
1237
fd->ioDirection ? "Read" : "Write",
sys/arch/mac68k/obio/iwm_fd.c
1238
fd->pos.track, fd->pos.side, fd->pos.sector);
sys/arch/mac68k/obio/iwm_fd.c
1250
fdstart_Flush(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1259
pos = &fd->pos;
sys/arch/mac68k/obio/iwm_fd.c
1260
shdr = &fd->sHdr;
sys/arch/mac68k/obio/iwm_fd.c
1264
if (fd->w_slots[i].valid) {
sys/arch/mac68k/obio/iwm_fd.c
1271
fd->ioDirection ? "Read" : "Write",
sys/arch/mac68k/obio/iwm_fd.c
1275
fd->iwmErr = iwmWriteSector(&fd->sHdr, fd->w_slots);
sys/arch/mac68k/obio/iwm_fd.c
1277
switch (fd->iwmErr) {
sys/arch/mac68k/obio/iwm_fd.c
1282
if (0 != fd->w_slots[i].valid)
sys/arch/mac68k/obio/iwm_fd.c
1284
fd->pos.track, fd->pos.side,
sys/arch/mac68k/obio/iwm_fd.c
1285
fd->pos.sector);
sys/arch/mac68k/obio/iwm_fd.c
1290
fd->w_slots[i].valid = 0;
sys/arch/mac68k/obio/iwm_fd.c
1291
fd->w_slots[i].secbuf = NULL;
sys/arch/mac68k/obio/iwm_fd.c
1293
fd->seekRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1300
pos->track, shdr->track, fd->seekRetries);
sys/arch/mac68k/obio/iwm_fd.c
1302
if (iwm->maxRetries > fd->seekRetries++) {
sys/arch/mac68k/obio/iwm_fd.c
1303
fd->iwmErr = seek(fd, IWM_SEEK_RECAL);
sys/arch/mac68k/obio/iwm_fd.c
1305
printf("[%d]", fd->seekRetries);
sys/arch/mac68k/obio/iwm_fd.c
1308
state = (0 == fd->iwmErr) ? state_Exit : state_Fault;
sys/arch/mac68k/obio/iwm_fd.c
1324
fdstart_IOFinish(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1330
fd->ioDirection ? "Read" : "Write",
sys/arch/mac68k/obio/iwm_fd.c
1331
fd->sHdr.track, fd->sHdr.side >> 3, fd->sHdr.sector);
sys/arch/mac68k/obio/iwm_fd.c
1333
fd->bytesDone += fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
1334
fd->bytesLeft -= fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
1335
fd->current_buffer += fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
1342
fd->startBlk++;
sys/arch/mac68k/obio/iwm_fd.c
1343
if (fd->bytesLeft > 0) {
sys/arch/mac68k/obio/iwm_fd.c
1344
if (++fd->pos.sector < fd->pos.maxSect) {
sys/arch/mac68k/obio/iwm_fd.c
1347
state = (fd->ioDirection == IWM_WRITE)
sys/arch/mac68k/obio/iwm_fd.c
1355
if (fd->ioDirection == IWM_WRITE) {
sys/arch/mac68k/obio/iwm_fd.c
1358
state = (state_Exit == fdstart_Flush(fd))
sys/arch/mac68k/obio/iwm_fd.c
1364
invalidateCylinderCache(fd);
sys/arch/mac68k/obio/iwm_fd.c
1369
state = (fd->ioDirection == IWM_WRITE)
sys/arch/mac68k/obio/iwm_fd.c
1382
fdstart_IOErr(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1389
fd->ioDirection ? "Read" : "Write",
sys/arch/mac68k/obio/iwm_fd.c
1390
fd->iwmErr, fd->ioRetries, fd->pos.track,
sys/arch/mac68k/obio/iwm_fd.c
1391
fd->pos.side, fd->pos.sector);
sys/arch/mac68k/obio/iwm_fd.c
1394
if (fd->ioRetries++ < iwm->maxRetries)
sys/arch/mac68k/obio/iwm_fd.c
1395
state = (fd->ioDirection == IWM_WRITE)
sys/arch/mac68k/obio/iwm_fd.c
1409
fdstart_Fault(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1414
fd->seekRetries, fd->ioRetries, fd->sectRetries,
sys/arch/mac68k/obio/iwm_fd.c
1415
fd->sHdr.track, fd->sHdr.side >> 3, fd->sHdr.sector);
sys/arch/mac68k/obio/iwm_fd.c
1416
printf("A non-recoverable error: %d ", fd->iwmErr);
sys/arch/mac68k/obio/iwm_fd.c
1430
fdstart_Exit(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1437
invalidateCylinderCache(fd);
sys/arch/mac68k/obio/iwm_fd.c
1442
if (0 != fd->w_slots[i].valid)
sys/arch/mac68k/obio/iwm_fd.c
1444
fd->pos.track, fd->pos.side, fd->pos.sector);
sys/arch/mac68k/obio/iwm_fd.c
1447
bp = bufq_get(fd->bufQueue);
sys/arch/mac68k/obio/iwm_fd.c
1449
bp->b_resid = fd->bytesLeft;
sys/arch/mac68k/obio/iwm_fd.c
1450
bp->b_error = (0 == fd->iwmErr) ? 0 : EIO;
sys/arch/mac68k/obio/iwm_fd.c
1454
fd->iwmErr, bp->b_error);
sys/arch/mac68k/obio/iwm_fd.c
1460
bufq_peek(fd->bufQueue));
sys/arch/mac68k/obio/iwm_fd.c
1461
disk_unbusy(&fd->diskInfo, bp->b_bcount - bp->b_resid,
sys/arch/mac68k/obio/iwm_fd.c
1470
callout_reset(&fd->motor_ch, 10 * hz, motor_off, fd);
sys/arch/mac68k/obio/iwm_fd.c
1531
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
1533
fd = param;
sys/arch/mac68k/obio/iwm_fd.c
1537
(void)iwmMotor(fd->unit, 0);
sys/arch/mac68k/obio/iwm_fd.c
1538
fd->state &= ~IWM_FD_MOTOR_ON;
sys/arch/mac68k/obio/iwm_fd.c
1552
fdGetDiskLabel(fd_softc_t *fd, dev_t dev)
sys/arch/mac68k/obio/iwm_fd.c
1563
lp = fd->diskInfo.dk_label;
sys/arch/mac68k/obio/iwm_fd.c
1564
clp = fd->diskInfo.dk_cpulabel;
sys/arch/mac68k/obio/iwm_fd.c
1574
lp->d_secsize = fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
1575
lp->d_ntracks = fd->currentType->heads;
sys/arch/mac68k/obio/iwm_fd.c
1576
lp->d_ncylinders = fd->currentType->tracks;
sys/arch/mac68k/obio/iwm_fd.c
1577
lp->d_nsectors = fd->currentType->secPerTrack;
sys/arch/mac68k/obio/iwm_fd.c
1578
lp->d_secpercyl = fd->currentType->secPerCyl;
sys/arch/mac68k/obio/iwm_fd.c
1579
lp->d_secperunit = fd->currentType->secPerDisk;
sys/arch/mac68k/obio/iwm_fd.c
1580
lp->d_interleave = fd->currentType->interleave;
sys/arch/mac68k/obio/iwm_fd.c
1581
lp->d_trkseek = fd->currentType->stepRate;
sys/arch/mac68k/obio/iwm_fd.c
1624
initCylinderCache(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1631
secsize = fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
1632
fd->cachedSide = 0;
sys/arch/mac68k/obio/iwm_fd.c
1634
fd->cbuf = kmem_alloc(IWM_MAX_GCR_SECTORS * secsize, KM_SLEEP);
sys/arch/mac68k/obio/iwm_fd.c
1635
if (NULL == fd->cbuf)
sys/arch/mac68k/obio/iwm_fd.c
1639
fd->w_slots[i].valid = 0;
sys/arch/mac68k/obio/iwm_fd.c
1640
fd->w_slots[i].secbuf = NULL;
sys/arch/mac68k/obio/iwm_fd.c
1642
fd->r_slots[i].valid = 0;
sys/arch/mac68k/obio/iwm_fd.c
1643
fd->r_slots[i].secbuf = fd->cbuf + i * secsize;
sys/arch/mac68k/obio/iwm_fd.c
1655
invalidateCylinderCache(fd_softc_t *fd)
sys/arch/mac68k/obio/iwm_fd.c
1659
fd->cachedSide = 0;
sys/arch/mac68k/obio/iwm_fd.c
1661
fd->r_slots[i].valid = 0;
sys/arch/mac68k/obio/iwm_fd.c
1714
fdDeviceToType(fd_softc_t *fd, dev_t dev)
sys/arch/mac68k/obio/iwm_fd.c
1725
thisInfo = (type == 0) ? fd->defaultType : &fdTypes[type - 1];
sys/arch/mac68k/obio/iwm_fd.c
1739
seek(fd_softc_t *fd, int style)
sys/arch/mac68k/obio/iwm_fd.c
1766
fd->seekRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1767
fd->verifyRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1769
loc = &fd->pos;
sys/arch/mac68k/obio/iwm_fd.c
1784
fd->seekRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1785
fd->verifyRetries = 0;
sys/arch/mac68k/obio/iwm_fd.c
1814
if (fd->seekRetries++ < iwm->maxRetries)
sys/arch/mac68k/obio/iwm_fd.c
1829
if (fd->verifyRetries++ < iwm->maxRetries)
sys/arch/mac68k/obio/iwm_fd.c
223
CFATTACH_DECL_NEW(fd, sizeof(fd_softc_t),
sys/arch/mac68k/obio/iwm_fd.c
374
iwm->fd[ia.unit] = NULL;
sys/arch/mac68k/obio/iwm_fd.c
437
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
442
fd = device_private(self);
sys/arch/mac68k/obio/iwm_fd.c
443
fd->sc_dev = self;
sys/arch/mac68k/obio/iwm_fd.c
448
fd->currentType = ia->driveType;
sys/arch/mac68k/obio/iwm_fd.c
449
fd->unit = ia->unit;
sys/arch/mac68k/obio/iwm_fd.c
450
fd->defaultType = &fdTypes[IWM_800K_GCR];
sys/arch/mac68k/obio/iwm_fd.c
451
fd->stepDirection = 0;
sys/arch/mac68k/obio/iwm_fd.c
453
iwm->fd[ia->unit] = fd; /* iwm has ptr to this drive */
sys/arch/mac68k/obio/iwm_fd.c
456
bufq_alloc(&fd->bufQueue, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/mac68k/obio/iwm_fd.c
457
callout_init(&fd->motor_ch, 0);
sys/arch/mac68k/obio/iwm_fd.c
459
printf(" drive %d: ", fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
466
iwmDiskEject(fd->unit); /* XXX */
sys/arch/mac68k/obio/iwm_fd.c
469
fd->currentType->description,
sys/arch/mac68k/obio/iwm_fd.c
470
fd->currentType->tracks,
sys/arch/mac68k/obio/iwm_fd.c
471
fd->currentType->heads);
sys/arch/mac68k/obio/iwm_fd.c
479
flags = iwmQueryDrvFlag(fd->unit, reg);
sys/arch/mac68k/obio/iwm_fd.c
484
disk_init(&fd->diskInfo, device_xname(fd->sc_dev), &fd_dkDriver);
sys/arch/mac68k/obio/iwm_fd.c
485
disk_attach(&fd->diskInfo);
sys/arch/mac68k/obio/iwm_fd.c
526
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
533
fd = NULL; /* XXX shut up gcc3 */
sys/arch/mac68k/obio/iwm_fd.c
552
fd = iwm->fd[fdUnit];
sys/arch/mac68k/obio/iwm_fd.c
553
err = (NULL == fd) ? ENXIO : 0;
sys/arch/mac68k/obio/iwm_fd.c
556
if (fd->state & IWM_FD_IS_OPEN) {
sys/arch/mac68k/obio/iwm_fd.c
563
err = (fd->partition == fdType) ? 0 : ENXIO;
sys/arch/mac68k/obio/iwm_fd.c
569
info = fdDeviceToType(fd, dev);
sys/arch/mac68k/obio/iwm_fd.c
577
if (!err && !(fd->state & IWM_FD_IS_OPEN)) {
sys/arch/mac68k/obio/iwm_fd.c
581
fd->writeLabel = 0; /* XXX currently unused */
sys/arch/mac68k/obio/iwm_fd.c
582
fd->partition = fdType;
sys/arch/mac68k/obio/iwm_fd.c
583
fd->currentType = info;
sys/arch/mac68k/obio/iwm_fd.c
584
fd->drvFlags = iwmCheckDrive(fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
586
if (fd->drvFlags & IWM_NO_DISK) {
sys/arch/mac68k/obio/iwm_fd.c
589
printf(" Drive %d is empty.\n", fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
592
if (!(fd->drvFlags & IWM_WRITABLE) && (flags & FWRITE)) {
sys/arch/mac68k/obio/iwm_fd.c
599
if (!(fd->drvFlags & IWM_DD_DISK)) {
sys/arch/mac68k/obio/iwm_fd.c
604
(void)iwmDiskEject(fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
607
fd->state |= IWM_FD_IS_OPEN;
sys/arch/mac68k/obio/iwm_fd.c
608
err = initCylinderCache(fd);
sys/arch/mac68k/obio/iwm_fd.c
621
memset(&fd->pos, 0, sizeof(diskPosition_t));
sys/arch/mac68k/obio/iwm_fd.c
622
ierr = seek(fd, IWM_SEEK_RECAL);
sys/arch/mac68k/obio/iwm_fd.c
632
if (fd->diskInfo.dk_openmask == 0)
sys/arch/mac68k/obio/iwm_fd.c
633
fdGetDiskLabel(fd, dev);
sys/arch/mac68k/obio/iwm_fd.c
639
fd->diskInfo.dk_copenmask |= partitionMask;
sys/arch/mac68k/obio/iwm_fd.c
643
fd->diskInfo.dk_bopenmask |= partitionMask;
sys/arch/mac68k/obio/iwm_fd.c
646
fd->diskInfo.dk_openmask =
sys/arch/mac68k/obio/iwm_fd.c
647
fd->diskInfo.dk_copenmask | fd->diskInfo.dk_bopenmask;
sys/arch/mac68k/obio/iwm_fd.c
661
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
669
fd = iwm->fd[fdUnit];
sys/arch/mac68k/obio/iwm_fd.c
671
if (fd->cbuf != NULL) {
sys/arch/mac68k/obio/iwm_fd.c
672
kmem_free(fd->cbuf,
sys/arch/mac68k/obio/iwm_fd.c
673
IWM_MAX_GCR_SECTORS * fd->currentType->sectorSize);
sys/arch/mac68k/obio/iwm_fd.c
679
fd->state &= ~IWM_FD_IS_OPEN;
sys/arch/mac68k/obio/iwm_fd.c
683
fd->diskInfo.dk_copenmask &= ~partitionMask;
sys/arch/mac68k/obio/iwm_fd.c
687
fd->diskInfo.dk_bopenmask &= ~partitionMask;
sys/arch/mac68k/obio/iwm_fd.c
690
fd->diskInfo.dk_openmask =
sys/arch/mac68k/obio/iwm_fd.c
691
fd->diskInfo.dk_copenmask | fd->diskInfo.dk_bopenmask;
sys/arch/mac68k/obio/iwm_fd.c
706
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
723
fd = iwm->fd[fdUnit];
sys/arch/mac68k/obio/iwm_fd.c
726
error = disk_ioctl(&fd->diskInfo, fdType, cmd, data, flag, l);
sys/arch/mac68k/obio/iwm_fd.c
736
result = setdisklabel(fd->diskInfo.dk_label,
sys/arch/mac68k/obio/iwm_fd.c
738
fd->diskInfo.dk_cpulabel);
sys/arch/mac68k/obio/iwm_fd.c
748
result = setdisklabel(fd->diskInfo.dk_label,
sys/arch/mac68k/obio/iwm_fd.c
750
fd->diskInfo.dk_cpulabel);
sys/arch/mac68k/obio/iwm_fd.c
753
fd->diskInfo.dk_label,
sys/arch/mac68k/obio/iwm_fd.c
754
fd->diskInfo.dk_cpulabel);
sys/arch/mac68k/obio/iwm_fd.c
787
fd->writeLabel = *(int *)data;
sys/arch/mac68k/obio/iwm_fd.c
795
fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
796
result = iwmDiskEject(fd->unit);
sys/arch/mac68k/obio/iwm_fd.c
850
fd_softc_t *fd;
sys/arch/mac68k/obio/iwm_fd.c
856
fd = NULL; /* XXX shut up gcc3 */
sys/arch/mac68k/obio/iwm_fd.c
879
fd = iwm->fd[fdUnit];
sys/arch/mac68k/obio/iwm_fd.c
880
err = (NULL == fd) ? EINVAL : 0;
sys/arch/mac68k/obio/iwm_fd.c
883
sectSize = fd->currentType->sectorSize;
sys/arch/mac68k/obio/iwm_fd.c
904
if (bp->b_blkno + transferSize > fd->currentType->secPerDisk) {
sys/arch/mac68k/obio/iwm_fd.c
910
fd->currentType->secPerDisk);
sys/arch/mac68k/obio/iwm_fd.c
915
transferSize = fd->currentType->secPerDisk -
sys/arch/mac68k/obio/iwm_fd.c
933
remap_geometry(bp->b_blkno, fd->currentType->heads,
sys/arch/mac68k/obio/iwm_fd.c
945
callout_stop(&fd->motor_ch);
sys/arch/mac68k/obio/iwm_fd.c
946
bufq_put(fd->bufQueue, bp);
sys/arch/mac68k/obio/iwm_fd.c
947
if (fd->sc_active == 0)
sys/arch/mac68k/obio/iwm_fd.c
948
fdstart(fd);
sys/arch/mac68k/obio/iwm_fdvar.h
180
fd_softc_t *fd[IWM_MAX_DRIVE]; /* ptrs to children */
sys/arch/macppc/stand/bootxx/bootxx.c
315
int fd, blk, chosen, options, j;
sys/arch/macppc/stand/bootxx/bootxx.c
350
fd = OF_open(bootpath);
sys/arch/macppc/stand/bootxx/bootxx.c
358
OF_seek(fd, (u_quad_t)blk * 512);
sys/arch/macppc/stand/bootxx/bootxx.c
359
OF_read(fd, addr, bbinfo.bbi_block_size);
sys/arch/macppc/stand/fixcoff/fixcoff.c
127
int fd, i, n, ch;
sys/arch/macppc/stand/fixcoff/fixcoff.c
146
if ((fd = open(argv[0], O_RDWR, 0)) == -1)
sys/arch/macppc/stand/fixcoff/fixcoff.c
152
if (read(fd, &fh, sizeof(fh)) != sizeof(fh))
sys/arch/macppc/stand/fixcoff/fixcoff.c
167
if (read(fd, &aoh, i) != i)
sys/arch/macppc/stand/fixcoff/fixcoff.c
175
if (read(fd, &sh, sizeof(sh)) != sizeof(sh))
sys/arch/macppc/stand/fixcoff/fixcoff.c
188
if (pwrite(fd, &aoh, sizeof(aoh), sizeof(struct filehdr))
sys/arch/macppc/stand/fixcoff/fixcoff.c
191
close(fd);
sys/arch/macppc/stand/ofwboot/netif_of.c
105
netif_of_close(int fd)
sys/arch/macppc/stand/ofwboot/netif_of.c
110
printf("netif_close(%x)...", fd);
sys/arch/macppc/stand/ofwboot/netif_of.c
114
if (fd != 0) {
sys/arch/mips/cavium/dev/octeon_fau.c
103
octfau_op_init(struct octfau_desc *fd, size_t scroff, size_t regno)
sys/arch/mips/cavium/dev/octeon_fau.c
106
fd->fd_scroff = scroff;
sys/arch/mips/cavium/dev/octeon_fau.c
107
fd->fd_regno = regno;
sys/arch/mips/cavium/dev/octeon_fau.c
111
octfau_op_save(struct octfau_desc *fd)
sys/arch/mips/cavium/dev/octeon_fau.c
115
return octeon_cvmseg_read_8(fd->fd_scroff);
sys/arch/mips/cavium/dev/octeon_fau.c
119
octfau_op_restore(struct octfau_desc *fd, uint64_t backup)
sys/arch/mips/cavium/dev/octeon_fau.c
122
octeon_cvmseg_write_8(fd->fd_scroff, backup);
sys/arch/mips/cavium/dev/octeon_fau.c
126
octfau_op_inc_8(struct octfau_desc *fd, int64_t v)
sys/arch/mips/cavium/dev/octeon_fau.c
129
octfau_op_iobdma_store_data(fd->fd_scroff, v, 0, OCT_FAU_OP_SIZE_64/* XXX */,
sys/arch/mips/cavium/dev/octeon_fau.c
130
fd->fd_regno);
sys/arch/mips/cavium/dev/octeon_fau.c
132
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
sys/arch/mips/cavium/dev/octeon_fau.c
136
octfau_op_incwait_8(struct octfau_desc *fd, int v)
sys/arch/mips/cavium/dev/octeon_fau.c
139
octfau_op_iobdma_store_data(fd->fd_scroff, v, 1, OCT_FAU_OP_SIZE_64/* XXX */,
sys/arch/mips/cavium/dev/octeon_fau.c
140
fd->fd_regno);
sys/arch/mips/cavium/dev/octeon_fau.c
144
return octeon_cvmseg_read_8(fd->fd_scroff)/* XXX */;
sys/arch/mips/cavium/dev/octeon_fau.c
148
octfau_op_add_8(struct octfau_desc *fd, int64_t v)
sys/arch/mips/cavium/dev/octeon_fau.c
151
octfau_op_store_paddr(0, fd->fd_regno, v);
sys/arch/mips/cavium/dev/octeon_fau.c
155
octfau_op_set_8(struct octfau_desc *fd, int64_t v)
sys/arch/mips/cavium/dev/octeon_fau.c
158
octfau_op_store_paddr(1, fd->fd_regno, v);
sys/arch/mips/cavium/dev/octeon_fauvar.h
119
octfau_op_inc_fetch_8(struct octfau_desc *fd, int64_t v)
sys/arch/mips/cavium/dev/octeon_fauvar.h
122
octfau_op_iobdma_store_data(fd->fd_scroff, v, 0,
sys/arch/mips/cavium/dev/octeon_fauvar.h
123
OCT_FAU_OP_SIZE_64/* XXX */, fd->fd_regno);
sys/arch/mips/cavium/dev/octeon_fauvar.h
127
octfau_op_inc_read_8(struct octfau_desc *fd)
sys/arch/mips/cavium/dev/octeon_fauvar.h
131
return octeon_cvmseg_read_8(fd->fd_scroff);
sys/arch/mips/include/mips_opcode.h
121
unsigned fd: 5;
sys/arch/mips/include/mips_opcode.h
75
unsigned fd: 5;
sys/arch/mips/mips/db_disasm.c
717
i.FRType.fd, i.FRType.fs, i.FRType.ft);
sys/arch/mipsco/obio/i82072.c
93
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/mipsco/stand/common/bootxx.c
118
int fd, i;
sys/arch/mipsco/stand/common/bootxx.c
131
if ((fd = open(bootfname, 0)) < 0) {
sys/arch/mipsco/stand/common/bootxx.c
137
i = read(fd, (char *)&ehdr, sizeof(ehdr));
sys/arch/mipsco/stand/common/bootxx.c
146
if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0)
sys/arch/mipsco/stand/common/bootxx.c
148
if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr))
sys/arch/mipsco/stand/common/bootxx.c
152
if (lseek(fd, (off_t)phdr.p_offset, 0) < 0)
sys/arch/mipsco/stand/common/bootxx.c
154
if (read(fd, (char *)phdr.p_paddr, phdr.p_filesz) != phdr.p_filesz)
sys/arch/mipsco/stand/common/bootxx.c
161
(void) close(fd);
sys/arch/mipsco/stand/installboot/installboot.c
167
int fd;
sys/arch/mipsco/stand/installboot/installboot.c
173
if ((fd = open(bootstrap, O_RDONLY)) == -1)
sys/arch/mipsco/stand/installboot/installboot.c
175
if (fstat(fd, &bootstrapsb) == -1)
sys/arch/mipsco/stand/installboot/installboot.c
191
len = read(fd, boot_code, bootstrapsb.st_size);
sys/arch/mipsco/stand/installboot/installboot.c
196
(void)close(fd);
sys/arch/mipsco/stand/installboot/installboot.c
220
if ((fd = open(disk, O_WRONLY)) == -1)
sys/arch/mipsco/stand/installboot/installboot.c
222
len = pwrite(fd, boot_code, boot_size, BOOTBLOCK_OFFSET);
sys/arch/mipsco/stand/installboot/installboot.c
228
(void) close(fd);
sys/arch/mmeye/stand/bootcoff/osloader.c
53
coff_find_section(FILE *fd, struct coff_filehdr *fp, struct coff_scnhdr *sh, int s_type)
sys/arch/mmeye/stand/bootcoff/osloader.c
60
if (fread(sh, 1, siz, fd) != siz) {
sys/arch/mmeye/stand/bootelf/boot.c
54
int fd, sz, i;
sys/arch/mmeye/stand/bootelf/boot.c
67
fd = loadfile(netbsd, marks, COUNT_ALL);
sys/arch/mmeye/stand/bootelf/boot.c
68
if (fd == -1)
sys/arch/mmeye/stand/bootelf/boot.c
70
close(fd);
sys/arch/mmeye/stand/bootelf/boot.c
86
fd = loadfile(netbsd, marks, LOAD_ALL);
sys/arch/mmeye/stand/bootelf/boot.c
87
if (fd == -1)
sys/arch/mmeye/stand/bootelf/boot.c
89
close(fd);
sys/arch/mvme68k/stand/installboot/installboot.c
181
int fd;
sys/arch/mvme68k/stand/installboot/installboot.c
184
fd = -1;
sys/arch/mvme68k/stand/installboot/installboot.c
193
if ((fd = loadfile(fname, marks, COUNT_TEXT|COUNT_DATA)) == -1)
sys/arch/mvme68k/stand/installboot/installboot.c
195
(void)close(fd);
sys/arch/mvme68k/stand/installboot/installboot.c
203
if ((fd = loadfile(fname, marks, LOAD_TEXT|LOAD_DATA)) == -1)
sys/arch/mvme68k/stand/installboot/installboot.c
205
(void)close(fd);
sys/arch/mvme68k/stand/installboot/installboot.c
225
devread(int fd, void *buf, daddr_t blk, size_t size, char *msg)
sys/arch/mvme68k/stand/installboot/installboot.c
228
if (lseek(fd, dbtob(blk), SEEK_SET) != dbtob(blk))
sys/arch/mvme68k/stand/installboot/installboot.c
231
if (read(fd, buf, size) != size)
sys/arch/mvme68k/stand/installboot/installboot.c
240
int i, fd;
sys/arch/mvme68k/stand/installboot/installboot.c
257
if ((fd = open(boot, O_RDONLY)) < 0)
sys/arch/mvme68k/stand/installboot/installboot.c
260
if (fstatvfs(fd, &statvfsbuf) != 0)
sys/arch/mvme68k/stand/installboot/installboot.c
270
if (fsync(fd) != 0)
sys/arch/mvme68k/stand/installboot/installboot.c
273
if (fstat(fd, &statbuf) != 0)
sys/arch/mvme68k/stand/installboot/installboot.c
276
close(fd);
sys/arch/mvme68k/stand/libsa/bugdev.c
44
int fd; /* Prom file descriptor */
sys/arch/mvme68k/stand/libsa/bugdev.c
90
pp->fd = bugscopen(f);
sys/arch/mvme68k/stand/libsa/bugdev.c
92
if (pp->fd < 0) {
sys/arch/mvme68k/stand/libsa/exec_mvme.c
54
int fd;
sys/arch/mvme68k/stand/libsa/exec_mvme.c
62
if ((fd = loadfile(file, marks, lflags)) == -1)
sys/arch/mvme68k/stand/libsa/exec_mvme.c
64
close(fd);
sys/arch/mvme68k/stand/wrtvid/wrtvid.c
118
int fd;
sys/arch/mvme68k/stand/wrtvid/wrtvid.c
168
if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
sys/arch/mvme68k/stand/wrtvid/wrtvid.c
173
if (write(fd, vid, SIZEOF_VID) != SIZEOF_VID) {
sys/arch/mvme68k/stand/wrtvid/wrtvid.c
178
close(fd);
sys/arch/mvmeppc/stand/libsa/exec_mvme.c
84
int fd;
sys/arch/mvmeppc/stand/libsa/exec_mvme.c
94
if ((fd = loadfile(file, marks, lflags)) == -1)
sys/arch/mvmeppc/stand/libsa/exec_mvme.c
96
close(fd);
sys/arch/news68k/stand/boot/boot.c
134
fd = loadfile(file, marks, loadflag);
sys/arch/news68k/stand/boot/boot.c
135
if (fd != -1)
sys/arch/news68k/stand/boot/boot.c
79
int fd, i;
sys/arch/news68k/stand/boot/devopen.c
102
rom_close(dev->fd);
sys/arch/news68k/stand/boot/devopen.c
114
rom_lseek(dev->fd, blk * 512, 0);
sys/arch/news68k/stand/boot/devopen.c
115
rom_read(dev->fd, buf, size);
sys/arch/news68k/stand/boot/devopen.c
58
int fd;
sys/arch/news68k/stand/boot/devopen.c
64
int fd;
sys/arch/news68k/stand/boot/devopen.c
73
fd = rom_open(devname, 0);
sys/arch/news68k/stand/boot/devopen.c
75
DPRINTF("devname = %s, fd = %d\n", devname, fd);
sys/arch/news68k/stand/boot/devopen.c
76
if (fd == -1)
sys/arch/news68k/stand/boot/devopen.c
79
romdev.fd = fd;
sys/arch/news68k/stand/bootxx/bootxx.c
119
fd = rom_open(devname, 0);
sys/arch/news68k/stand/bootxx/bootxx.c
120
if (fd == -1) {
sys/arch/news68k/stand/bootxx/bootxx.c
133
rom_lseek(fd, blk * 512, 0);
sys/arch/news68k/stand/bootxx/bootxx.c
134
rom_read(fd, addr, bs);
sys/arch/news68k/stand/bootxx/bootxx.c
138
rom_close(fd);
sys/arch/news68k/stand/bootxx/bootxx.c
85
int fd, blk, bs;
sys/arch/newsmips/stand/boot/boot.c
171
fd = loadfile(file, marks, loadflag);
sys/arch/newsmips/stand/boot/boot.c
172
if (fd != -1)
sys/arch/newsmips/stand/boot/boot.c
63
int fd, i;
sys/arch/newsmips/stand/boot/devopen.c
140
apcall_close(dev->fd);
sys/arch/newsmips/stand/boot/devopen.c
142
rom_close(dev->fd);
sys/arch/newsmips/stand/boot/devopen.c
156
apcall_lseek(dev->fd, blk * 512, 0);
sys/arch/newsmips/stand/boot/devopen.c
157
apcall_read(dev->fd, buf, size);
sys/arch/newsmips/stand/boot/devopen.c
159
rom_lseek(dev->fd, blk * 512, 0);
sys/arch/newsmips/stand/boot/devopen.c
160
rom_read(dev->fd, buf, size);
sys/arch/newsmips/stand/boot/devopen.c
173
apcall_ioctl(dev->fd, APIOCEJECT, NULL);
sys/arch/newsmips/stand/boot/devopen.c
174
apcall_close(dev->fd);
sys/arch/newsmips/stand/boot/devopen.c
176
dev->fd = apcall_open(dev->devname, 2);
sys/arch/newsmips/stand/boot/devopen.c
178
rom_ioctl(dev->fd, SYSIOCEJECT, NULL);
sys/arch/newsmips/stand/boot/devopen.c
179
rom_close(dev->fd);
sys/arch/newsmips/stand/boot/devopen.c
181
dev->fd = rom_open(dev->devname, 2);
sys/arch/newsmips/stand/boot/devopen.c
75
int fd;
sys/arch/newsmips/stand/boot/devopen.c
85
fd = apcall_open(romdev.devname, 2);
sys/arch/newsmips/stand/boot/devopen.c
87
fd = rom_open(romdev.devname, 2);
sys/arch/newsmips/stand/boot/devopen.c
89
DPRINTF("devname = %s, fd = %d\n", romdev.devname, fd);
sys/arch/newsmips/stand/boot/devopen.c
90
if (fd == -1)
sys/arch/newsmips/stand/boot/devopen.c
93
romdev.fd = fd;
sys/arch/newsmips/stand/boot/netif_news.c
134
rv = apcall_write(pd->fd, pkt, sendlen);
sys/arch/newsmips/stand/boot/netif_news.c
166
len = apcall_read(pd->fd, pkt, maxlen);
sys/arch/newsmips/stand/boot/netif_news.c
194
if (apcall_ioctl(pd->fd, APIOCGIFHWADDR, ea))
sys/arch/newsmips/stand/boot/netif_news.c
92
netif_news_close(int fd)
sys/arch/newsmips/stand/boot/promdev.h
2
int fd;
sys/arch/newsmips/stand/bootxx/bootxx.c
114
fd = rom_open(devname, 0);
sys/arch/newsmips/stand/bootxx/bootxx.c
116
if (fd == -1) {
sys/arch/newsmips/stand/bootxx/bootxx.c
130
apcall_lseek(fd, blk * 512, 0);
sys/arch/newsmips/stand/bootxx/bootxx.c
131
apcall_read(fd, addr, bs);
sys/arch/newsmips/stand/bootxx/bootxx.c
133
rom_lseek(fd, blk * 512, 0);
sys/arch/newsmips/stand/bootxx/bootxx.c
134
rom_read(fd, addr, bs);
sys/arch/newsmips/stand/bootxx/bootxx.c
140
apcall_close(fd);
sys/arch/newsmips/stand/bootxx/bootxx.c
142
rom_close(fd);
sys/arch/newsmips/stand/bootxx/bootxx.c
65
int fd, blk, bs;
sys/arch/newsmips/stand/bootxx/bootxx.c
98
fd = apcall_open(devname, 0);
sys/arch/next68k/stand/boot/boot.c
117
fd = loadfile(kernel, marks, LOAD_KERNEL);
sys/arch/next68k/stand/boot/boot.c
118
if (fd != -1) {
sys/arch/next68k/stand/boot/boot.c
70
int fd;
sys/arch/ofppc/stand/ofwboot/netif_of.c
101
netif_of_close(int fd)
sys/arch/ofppc/stand/ofwboot/netif_of.c
106
printf("netif_close(%x)...", fd);
sys/arch/ofppc/stand/ofwboot/netif_of.c
110
if (fd != 0) {
sys/arch/pmax/stand/common/bootxx.c
136
int fd, i;
sys/arch/pmax/stand/common/bootxx.c
163
if ((fd = open(bootfname, 0)) < 0) {
sys/arch/pmax/stand/common/bootxx.c
169
i = read(fd, (char *)&ehdr, sizeof(ehdr));
sys/arch/pmax/stand/common/bootxx.c
178
if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0)
sys/arch/pmax/stand/common/bootxx.c
180
if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr))
sys/arch/pmax/stand/common/bootxx.c
184
if (lseek(fd, (off_t)phdr.p_offset, 0) < 0)
sys/arch/pmax/stand/common/bootxx.c
186
if (read(fd, (char *)phdr.p_paddr, phdr.p_filesz) != phdr.p_filesz)
sys/arch/pmax/stand/common/bootxx.c
193
(void) close(fd);
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
141
int fd;
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
143
if ((fd = open(file, 0)) < 0)
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
145
fstat(fd, f_stat);
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
147
if (read(fd, hdr, sizeof(Elf32_External_Ehdr)) !=
sys/arch/powerpc/stand/mkbootimage/mkbootimage.c
164
return fd;
sys/arch/prep/stand/installboot/installboot.c
104
lseek(fd, 0L, SEEK_SET);
sys/arch/prep/stand/installboot/installboot.c
113
(void)lseek(fd, be32toh(eh.e_phoff) + sizeof(ph) * i, SEEK_SET);
sys/arch/prep/stand/installboot/installboot.c
114
if (read(fd, &ph, sizeof(ph)) != sizeof(ph)) {
sys/arch/prep/stand/installboot/installboot.c
124
lseek(fd, be32toh(ph.p_offset), SEEK_SET);
sys/arch/prep/stand/installboot/installboot.c
136
if (load_prep_partition(fd, 0)) {
sys/arch/prep/stand/installboot/installboot.c
141
if (lseek(fd, (off_t)dbtob(1), SEEK_SET) != dbtob(1)) {
sys/arch/prep/stand/installboot/installboot.c
145
if (read(fd, buf, DEV_BSIZE) != DEV_BSIZE) {
sys/arch/prep/stand/installboot/installboot.c
152
lseek(fd, le32toh(*(u_int32_t *)buf), SEEK_SET);
sys/arch/prep/stand/installboot/installboot.c
160
if (read(fd, bp, imgsz) != imgsz) {
sys/arch/prep/stand/installboot/installboot.c
171
close(fd);
sys/arch/prep/stand/installboot/installboot.c
177
if (fd >= 0)
sys/arch/prep/stand/installboot/installboot.c
178
close(fd);
sys/arch/prep/stand/installboot/installboot.c
60
devread(int fd, void *buf, daddr_t blk, size_t size, char *msg)
sys/arch/prep/stand/installboot/installboot.c
63
if (lseek(fd, (off_t)dbtob(blk), SEEK_SET) != dbtob(blk)) {
sys/arch/prep/stand/installboot/installboot.c
67
if (read(fd, buf, size) != size) {
sys/arch/prep/stand/installboot/installboot.c
80
int fd;
sys/arch/prep/stand/installboot/installboot.c
85
if ((fd = open(boot, O_RDONLY)) < 0) {
sys/arch/prep/stand/installboot/installboot.c
90
if (fstat(fd, &st) != 0) {
sys/arch/prep/stand/installboot/installboot.c
98
if (read(fd, &eh, sizeof(eh)) != sizeof(eh)) {
sys/arch/sandpoint/stand/altboot/main.c
135
int err, fd, howto, i, n;
sys/arch/sandpoint/stand/altboot/main.c
325
if ((fd = open(bname, 0)) < 0) {
sys/arch/sandpoint/stand/altboot/main.c
335
len = read(fd, (void *)0x100000, 0x1000000 - 0x100000);
sys/arch/sandpoint/stand/altboot/main.c
338
close(fd);
sys/arch/sandpoint/stand/altboot/main.c
350
err = fdloadfile(fd, marks, LOAD_KERNEL);
sys/arch/sandpoint/stand/altboot/main.c
351
close(fd);
sys/arch/sandpoint/stand/altboot/main.c
505
int size, fd;
sys/arch/sandpoint/stand/altboot/main.c
534
fd = module_open(bm);
sys/arch/sandpoint/stand/altboot/main.c
535
if (fd == -1)
sys/arch/sandpoint/stand/altboot/main.c
537
if (fstat(fd, &st) == -1 || st.st_size == -1) {
sys/arch/sandpoint/stand/altboot/main.c
539
close(fd);
sys/arch/sandpoint/stand/altboot/main.c
543
close(fd);
sys/arch/sandpoint/stand/altboot/main.c
566
fd = module_open(bm);
sys/arch/sandpoint/stand/altboot/main.c
568
size = read(fd, (char *)kmodloadp, SSIZE_MAX);
sys/arch/sandpoint/stand/altboot/main.c
582
close(fd);
sys/arch/sandpoint/stand/altboot/main.c
591
int fd;
sys/arch/sandpoint/stand/altboot/main.c
595
fd = open(path, 0);
sys/arch/sandpoint/stand/altboot/main.c
596
return fd;
sys/arch/sbmips/stand/common/boot.c
105
booted_dev_setfd(fd);
sys/arch/sbmips/stand/common/boot.c
77
main(long fwhandle,long fd,long fwentry)
sys/arch/sbmips/stand/common/bootxx.c
109
if (read(fd, (void*)SECONDARY_LOAD_ADDRESS, sb.st_size) != sb.st_size) {
sys/arch/sbmips/stand/common/bootxx.c
85
int fd;
sys/arch/sbmips/stand/common/bootxx.c
98
fd = open("boot", 0);
sys/arch/sbmips/stand/common/bootxx.c
99
if (fd == -1 || (fstat(fd, &sb) == -1)) {
sys/arch/sbmips/stand/common/common.h
56
#define booted_dev_setfd(fd) ((void)(booted_dev_fd = fd))
sys/arch/sgimips/dev/crmfb.c
1453
void *fd;
sys/arch/sgimips/dev/crmfb.c
1464
fd = (uint8_t *)font->data + uc * ri->ri_fontscale;
sys/arch/sgimips/dev/crmfb.c
1486
fd8 = fd;
sys/arch/sgimips/dev/crmfb.c
1502
fd16 = fd;
sys/arch/sgimips/dev/crmfb.c
1529
void *fd;
sys/arch/sgimips/dev/crmfb.c
1540
fd = (uint8_t *)font->data + uc * ri->ri_fontscale;
sys/arch/sgimips/dev/crmfb.c
1550
memcpy(sc->sc_lptr, fd, ri->ri_fontscale);
sys/arch/sgimips/stand/common/disk.c
110
u_long fd;
sys/arch/sgimips/stand/common/disk.c
133
error = arcbios_Open(device, 0, &fd);
sys/arch/sgimips/stand/common/disk.c
143
sc->sc_fd = fd;
sys/arch/sgimips/stand/sgivol/sgivol.c
201
fd = open(argv[0],
sys/arch/sgimips/stand/sgivol/sgivol.c
203
if (fd == -1) {
sys/arch/sgimips/stand/sgivol/sgivol.c
207
fd = open(buf, (opt_i | opt_w | opt_d | opt_p)
sys/arch/sgimips/stand/sgivol/sgivol.c
209
if (fd == -1)
sys/arch/sgimips/stand/sgivol/sgivol.c
214
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
sys/arch/sgimips/stand/sgivol/sgivol.c
218
if (fstat(fd, &st) == -1)
sys/arch/sgimips/stand/sgivol/sgivol.c
230
if (ioctl(fd, DIOCGDINFO, &lbl) == -1)
sys/arch/sgimips/stand/sgivol/sgivol.c
405
lseek(fd, be32toh(volhdr->voldir[i].block) * 512, SEEK_SET);
sys/arch/sgimips/stand/sgivol/sgivol.c
411
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
sys/arch/sgimips/stand/sgivol/sgivol.c
489
off = lseek(fd, block * 512, SEEK_SET);
sys/arch/sgimips/stand/sgivol/sgivol.c
500
if (write(fd, fbuf, 512) != 512)
sys/arch/sgimips/stand/sgivol/sgivol.c
601
i = lseek(fd, 0, SEEK_SET);
sys/arch/sgimips/stand/sgivol/sgivol.c
606
i = write(fd, buf, 512);
sys/arch/sgimips/stand/sgivol/sgivol.c
61
int fd;
sys/arch/sgimips/stand/undist/undist.c
777
int fd;
sys/arch/sgimips/stand/undist/undist.c
780
fd = open(file, flags, filemode);
sys/arch/sgimips/stand/undist/undist.c
781
if (fd != -1)
sys/arch/sgimips/stand/undist/undist.c
782
return (fd);
sys/arch/sgimips/stand/undist/undist.c
787
fd = open(file, flags, filemode);
sys/arch/sgimips/stand/undist/undist.c
788
if (fd != -1)
sys/arch/sgimips/stand/undist/undist.c
789
return (fd);
sys/arch/sgimips/stand/undist/undist.c
814
fd = open(file, flags, filemode);
sys/arch/sgimips/stand/undist/undist.c
816
return (fd);
sys/arch/shark/stand/ofwboot/netif_of.c
101
netif_of_close(int fd)
sys/arch/shark/stand/ofwboot/netif_of.c
106
printf("netif_close(%x)...", fd);
sys/arch/shark/stand/ofwboot/netif_of.c
110
if (fd != 0) {
sys/arch/sparc/dev/fd.c
1000
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1006
if ((fd = fdc->sc_drives.tqh_first) != NULL)
sys/arch/sparc/dev/fd.c
1007
status |= fd->sc_drive;
sys/arch/sparc/dev/fd.c
1010
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/sparc/dev/fd.c
1017
if ((fd = fdc->sc_fd[n]) != NULL &&
sys/arch/sparc/dev/fd.c
1018
(fd->sc_flags & FD_MOTOR) != 0) {
sys/arch/sparc/dev/fd.c
1030
struct fd_softc *fd = arg;
sys/arch/sparc/dev/fd.c
1034
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/sparc/dev/fd.c
1035
fd_set_motor(device_private(device_parent(fd->sc_dv)));
sys/arch/sparc/dev/fd.c
1042
struct fd_softc *fd = arg;
sys/arch/sparc/dev/fd.c
1043
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
1047
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc/dev/fd.c
1048
if ((fdc->sc_drives.tqh_first == fd) && (fdc->sc_state == MOTORWAIT))
sys/arch/sparc/dev/fd.c
1127
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1131
fd = device_lookup_private(&fd_cd, unit);
sys/arch/sparc/dev/fd.c
1132
if (fd == NULL)
sys/arch/sparc/dev/fd.c
1134
type = fd_dev_to_type(fd, dev);
sys/arch/sparc/dev/fd.c
1138
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/sparc/dev/fd.c
1139
fd->sc_type != type)
sys/arch/sparc/dev/fd.c
1142
fd->sc_type = type;
sys/arch/sparc/dev/fd.c
1143
fd->sc_cylin = -1;
sys/arch/sparc/dev/fd.c
1144
fd->sc_flags |= FD_OPEN;
sys/arch/sparc/dev/fd.c
1149
if (fd->sc_dk.dk_openmask == 0)
sys/arch/sparc/dev/fd.c
1156
fd->sc_dk.dk_copenmask |= pmask;
sys/arch/sparc/dev/fd.c
1160
fd->sc_dk.dk_bopenmask |= pmask;
sys/arch/sparc/dev/fd.c
1163
fd->sc_dk.dk_openmask =
sys/arch/sparc/dev/fd.c
1164
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc/dev/fd.c
1172
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc/dev/fd.c
1175
fd->sc_flags &= ~FD_OPEN;
sys/arch/sparc/dev/fd.c
1176
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/sparc/dev/fd.c
1180
fd->sc_dk.dk_copenmask &= ~pmask;
sys/arch/sparc/dev/fd.c
1184
fd->sc_dk.dk_bopenmask &= ~pmask;
sys/arch/sparc/dev/fd.c
1187
fd->sc_dk.dk_openmask =
sys/arch/sparc/dev/fd.c
1188
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc/dev/fd.c
1256
struct fd_softc *fd = fdc->sc_drives.tqh_first;
sys/arch/sparc/dev/fd.c
1275
fd ? device_xname(fd->sc_dv) : "fdc", s, fdc->sc_state);
sys/arch/sparc/dev/fd.c
1284
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1288
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc/dev/fd.c
1289
if (fd == NULL) {
sys/arch/sparc/dev/fd.c
1297
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/sparc/dev/fd.c
1439
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1459
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc/dev/fd.c
1460
if (fd == NULL) {
sys/arch/sparc/dev/fd.c
1466
bp = bufq_peek(fd->sc_q);
sys/arch/sparc/dev/fd.c
1468
fd->sc_ops = 0;
sys/arch/sparc/dev/fd.c
1469
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc/dev/fd.c
1470
fd->sc_active = 0;
sys/arch/sparc/dev/fd.c
1480
fd->sc_skip = 0;
sys/arch/sparc/dev/fd.c
1481
fd->sc_bcount = bp->b_bcount;
sys/arch/sparc/dev/fd.c
1482
fd->sc_blkno = (bp->b_blkno * DEV_BSIZE) / FD_BSIZE(fd);
sys/arch/sparc/dev/fd.c
1483
callout_stop(&fd->sc_motoroff_ch);
sys/arch/sparc/dev/fd.c
1484
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/sparc/dev/fd.c
1488
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/sparc/dev/fd.c
1490
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/sparc/dev/fd.c
1495
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/sparc/dev/fd.c
1500
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/sparc/dev/fd.c
1501
fd_motor_on, fd);
sys/arch/sparc/dev/fd.c
1503
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc/dev/fd.c
1519
fd->sc_cylin = bp->b_cylinder;
sys/arch/sparc/dev/fd.c
1524
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/sparc/dev/fd.c
1527
fd->sc_cylin = -1;
sys/arch/sparc/dev/fd.c
1531
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/sparc/dev/fd.c
1533
disk_busy(&fd->sc_dk);
sys/arch/sparc/dev/fd.c
1538
FDC_WRFIFO(fdc, fd->sc_type->steprate);
sys/arch/sparc/dev/fd.c
1545
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc/dev/fd.c
1546
FDC_WRFIFO(fdc, bp->b_cylinder * fd->sc_type->step);
sys/arch/sparc/dev/fd.c
1555
disk_busy(&fd->sc_dk);
sys/arch/sparc/dev/fd.c
1557
fd->sc_cylin = -1;
sys/arch/sparc/dev/fd.c
1564
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc/dev/fd.c
1565
FDC_WRFIFO(fdc, 1 * fd->sc_type->step);
sys/arch/sparc/dev/fd.c
1570
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/sparc/dev/fd.c
1572
cyl != 1 * fd->sc_type->step) {
sys/arch/sparc/dev/fd.c
1588
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/sparc/dev/fd.c
1590
type = fd->sc_type;
sys/arch/sparc/dev/fd.c
1591
sec = fd->sc_blkno % type->seccyl;
sys/arch/sparc/dev/fd.c
1593
nblks = uimin(nblks, fd->sc_bcount / FD_BSIZE(fd));
sys/arch/sparc/dev/fd.c
1594
nblks = uimin(nblks, FDC_MAXIOSIZE / FD_BSIZE(fd));
sys/arch/sparc/dev/fd.c
1595
fd->sc_nblks = nblks;
sys/arch/sparc/dev/fd.c
1596
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FD_BSIZE(fd);
sys/arch/sparc/dev/fd.c
1601
block = (fd->sc_cylin * type->heads + head) * type->sectrac + sec;
sys/arch/sparc/dev/fd.c
1602
if (block != fd->sc_blkno) {
sys/arch/sparc/dev/fd.c
1603
printf("fdcintr: block %d != blkno %d\n", block, (int)fd->sc_blkno);
sys/arch/sparc/dev/fd.c
1612
fdc->sc_data = (char *)bp->b_data + fd->sc_skip;
sys/arch/sparc/dev/fd.c
1613
fdc->sc_tc = fd->sc_nbytes;
sys/arch/sparc/dev/fd.c
1623
fd->sc_drive, fd->sc_cylin, head, sec, nblks);
sys/arch/sparc/dev/fd.c
1629
disk_busy(&fd->sc_dk);
sys/arch/sparc/dev/fd.c
1637
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc/dev/fd.c
1647
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc/dev/fd.c
1648
FDC_WRFIFO(fdc, fd->sc_cylin); /*track*/
sys/arch/sparc/dev/fd.c
1671
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/sparc/dev/fd.c
1675
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/sparc/dev/fd.c
1683
fd->sc_cylin = bp->b_cylinder;
sys/arch/sparc/dev/fd.c
1716
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc/dev/fd.c
1724
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc/dev/fd.c
1736
(long long)fd->sc_blkno, fd->sc_nblks,
sys/arch/sparc/dev/fd.c
1769
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc/dev/fd.c
1789
fd->sc_blkno += fd->sc_nblks;
sys/arch/sparc/dev/fd.c
1790
fd->sc_skip += fd->sc_nbytes;
sys/arch/sparc/dev/fd.c
1791
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/sparc/dev/fd.c
1792
if (finfo == NULL && fd->sc_bcount > 0) {
sys/arch/sparc/dev/fd.c
1793
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/sparc/dev/fd.c
1796
fdfinish(fd, bp);
sys/arch/sparc/dev/fd.c
1822
FDC_WRFIFO(fdc, fd->sc_drive);
sys/arch/sparc/dev/fd.c
1844
fd->sc_cylin = 0;
sys/arch/sparc/dev/fd.c
1848
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/sparc/dev/fd.c
1878
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1882
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc/dev/fd.c
1883
bp = bufq_peek(fd->sc_q);
sys/arch/sparc/dev/fd.c
1886
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/sparc/dev/fd.c
1895
device_xname(fd->sc_dv));
sys/arch/sparc/dev/fd.c
1921
device_xname(fd->sc_dv));
sys/arch/sparc/dev/fd.c
1932
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/sparc/dev/fd.c
1934
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc/dev/fd.c
1942
fdfinish(fd, bp);
sys/arch/sparc/dev/fd.c
1950
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
1966
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc/dev/fd.c
1968
fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
1973
*(struct disklabel *)addr = *(fd->sc_dk.dk_label);
sys/arch/sparc/dev/fd.c
1986
error = setdisklabel(fd->sc_dk.dk_label,
sys/arch/sparc/dev/fd.c
1988
fd->sc_dk.dk_cpulabel);
sys/arch/sparc/dev/fd.c
1993
fd->sc_dk.dk_label,
sys/arch/sparc/dev/fd.c
1994
fd->sc_dk.dk_cpulabel);
sys/arch/sparc/dev/fd.c
2010
if ((fd->sc_dk.dk_openmask & ~(1 << part)) != 0 ||
sys/arch/sparc/dev/fd.c
2011
fd->sc_dk.dk_bopenmask + fd->sc_dk.dk_copenmask !=
sys/arch/sparc/dev/fd.c
2012
fd->sc_dk.dk_openmask) {
sys/arch/sparc/dev/fd.c
2018
fd_do_eject(fd);
sys/arch/sparc/dev/fd.c
2024
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/sparc/dev/fd.c
2025
form_parms->ncyl = fd->sc_type->cylinders;
sys/arch/sparc/dev/fd.c
2026
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/sparc/dev/fd.c
2027
form_parms->ntrk = fd->sc_type->heads;
sys/arch/sparc/dev/fd.c
2028
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/sparc/dev/fd.c
2029
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/sparc/dev/fd.c
2030
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/sparc/dev/fd.c
2031
form_parms->interleave = fd->sc_type->interleave;
sys/arch/sparc/dev/fd.c
2032
switch (fd->sc_type->rate) {
sys/arch/sparc/dev/fd.c
2063
fd->sc_type->rate = FDC_500KBPS;
sys/arch/sparc/dev/fd.c
2066
fd->sc_type->rate = FDC_300KBPS;
sys/arch/sparc/dev/fd.c
2069
fd->sc_type->rate = FDC_250KBPS;
sys/arch/sparc/dev/fd.c
2079
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/sparc/dev/fd.c
2082
fd->sc_type->heads = form_parms->ntrk;
sys/arch/sparc/dev/fd.c
2083
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/sparc/dev/fd.c
2084
fd->sc_type->secsize = ffs(i)-1;
sys/arch/sparc/dev/fd.c
2085
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/sparc/dev/fd.c
2086
fd->sc_type->cylinders = form_parms->ncyl;
sys/arch/sparc/dev/fd.c
2087
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/sparc/dev/fd.c
2089
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/sparc/dev/fd.c
2090
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/sparc/dev/fd.c
2091
fd->sc_type->interleave = form_parms->interleave;
sys/arch/sparc/dev/fd.c
2103
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/sparc/dev/fd.c
2104
form_cmd->cylinder >= fd->sc_type->cylinders) {
sys/arch/sparc/dev/fd.c
2111
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/sparc/dev/fd.c
2112
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/sparc/dev/fd.c
2113
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/sparc/dev/fd.c
2114
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/sparc/dev/fd.c
2115
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/sparc/dev/fd.c
2122
j += fd->sc_type->interleave;
sys/arch/sparc/dev/fd.c
2128
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/sparc/dev/fd.c
2136
*(int *)addr = fd->sc_opts;
sys/arch/sparc/dev/fd.c
2140
fd->sc_opts = *(int *)addr;
sys/arch/sparc/dev/fd.c
2181
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc/dev/fd.c
2182
struct fd_type *type = fd->sc_type;
sys/arch/sparc/dev/fd.c
2201
+ finfo->head * type->sectrac) * FD_BSIZE(fd))
sys/arch/sparc/dev/fd.c
2245
struct fd_softc *fd = device_lookup_private(&fd_cd, unit);
sys/arch/sparc/dev/fd.c
2246
struct disklabel *lp = fd->sc_dk.dk_label;
sys/arch/sparc/dev/fd.c
2247
struct cpu_disklabel *clp = fd->sc_dk.dk_cpulabel;
sys/arch/sparc/dev/fd.c
2253
lp->d_secsize = FD_BSIZE(fd);
sys/arch/sparc/dev/fd.c
2254
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/sparc/dev/fd.c
2255
lp->d_nsectors = fd->sc_type->sectrac;
sys/arch/sparc/dev/fd.c
2256
lp->d_ncylinders = fd->sc_type->cylinders;
sys/arch/sparc/dev/fd.c
2257
lp->d_ntracks = fd->sc_type->heads; /* Go figure... */
sys/arch/sparc/dev/fd.c
2304
fd_do_eject(struct fd_softc *fd)
sys/arch/sparc/dev/fd.c
2306
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
297
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/sparc/dev/fd.c
782
struct fd_softc *fd = device_private(self);
sys/arch/sparc/dev/fd.c
787
fd->sc_dv = self;
sys/arch/sparc/dev/fd.c
789
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/sparc/dev/fd.c
790
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/sparc/dev/fd.c
800
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/sparc/dev/fd.c
801
fd->sc_cylin = -1;
sys/arch/sparc/dev/fd.c
802
fd->sc_drive = drive;
sys/arch/sparc/dev/fd.c
803
fd->sc_deftype = type;
sys/arch/sparc/dev/fd.c
804
fdc->sc_fd[drive] = fd;
sys/arch/sparc/dev/fd.c
814
disk_init(&fd->sc_dk, device_xname(fd->sc_dv), &fddkdriver);
sys/arch/sparc/dev/fd.c
815
disk_attach(&fd->sc_dk);
sys/arch/sparc/dev/fd.c
821
mountroothook_establish(fd_mountroot_hook, fd->sc_dv);
sys/arch/sparc/dev/fd.c
830
struct fd_softc *fd = device_private(self);
sys/arch/sparc/dev/fd.c
832
fd_motor_off(fd);
sys/arch/sparc/dev/fd.c
844
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/sparc/dev/fd.c
850
return (type ? &fd_types[type - 1] : fd->sc_deftype);
sys/arch/sparc/dev/fd.c
856
struct fd_softc *fd;
sys/arch/sparc/dev/fd.c
862
if ((fd = device_lookup_private(&fd_cd, unit)) == 0 ||
sys/arch/sparc/dev/fd.c
864
(((bp->b_bcount % FD_BSIZE(fd)) != 0 ||
sys/arch/sparc/dev/fd.c
865
(bp->b_blkno * DEV_BSIZE) % FD_BSIZE(fd) != 0) &&
sys/arch/sparc/dev/fd.c
877
if (bp->b_blkno + sz > (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)) {
sys/arch/sparc/dev/fd.c
878
sz = (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)
sys/arch/sparc/dev/fd.c
896
(FD_BSIZE(fd) * fd->sc_type->seccyl);
sys/arch/sparc/dev/fd.c
902
(long long)fd->sc_blkno, bp->b_cylinder);
sys/arch/sparc/dev/fd.c
907
bufq_put(fd->sc_q, bp);
sys/arch/sparc/dev/fd.c
908
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/sparc/dev/fd.c
909
if (fd->sc_active == 0)
sys/arch/sparc/dev/fd.c
910
fdstart(fd);
sys/arch/sparc/dev/fd.c
913
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
929
fdstart(struct fd_softc *fd)
sys/arch/sparc/dev/fd.c
931
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
935
fd->sc_active = 1;
sys/arch/sparc/dev/fd.c
936
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc/dev/fd.c
944
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/sparc/dev/fd.c
946
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sparc/dev/fd.c
954
(void)bufq_get(fd->sc_q);
sys/arch/sparc/dev/fd.c
955
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
sys/arch/sparc/dev/fd.c
956
fd->sc_ops = 0;
sys/arch/sparc/dev/fd.c
957
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc/dev/fd.c
958
if (bufq_peek(fd->sc_q) != NULL) {
sys/arch/sparc/dev/fd.c
959
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc/dev/fd.c
961
fd->sc_active = 0;
sys/arch/sparc/dev/fd.c
963
bp->b_resid = fd->sc_bcount;
sys/arch/sparc/dev/fd.c
964
fd->sc_skip = 0;
sys/arch/sparc/dev/fd.c
968
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/sparc/dev/fdvar.h
32
#define FD_BSIZE(fd) (128 * (1 << fd->sc_type->secsize))
sys/arch/sparc/include/promlib.h
193
#define prom_close(fd) ((*promops.po_close)(fd))
sys/arch/sparc/include/promlib.h
194
#define prom_instance_to_package(fd) \
sys/arch/sparc/include/promlib.h
195
((*promops.po_instance_to_package)(fd))
sys/arch/sparc/include/promlib.h
196
#define prom_read(fd,b,n) ((*promops.po_read)(fd,b,n))
sys/arch/sparc/include/promlib.h
197
#define prom_write(fd,b,n) ((*promops.po_write)(fd,b,n))
sys/arch/sparc/include/promlib.h
198
#define prom_seek(fd,o) ((*promops.po_seek)(fd,o))
sys/arch/sparc/sparc/promlib.c
200
int fd = *obpvec->pv_v2bootargs.v2_fd1;
sys/arch/sparc/sparc/promlib.c
201
(*obpvec->pv_v2devops.v2_write)(fd, str, n);
sys/arch/sparc/sparc/promlib.c
554
int fd;
sys/arch/sparc/sparc/promlib.c
561
fd = prom_open(path);
sys/arch/sparc/sparc/promlib.c
562
if (fd == 0)
sys/arch/sparc/sparc/promlib.c
565
return (prom_instance_to_package(fd));
sys/arch/sparc/sparc/promlib.c
778
obp_v0_read(int fd, void *buf, int len)
sys/arch/sparc/sparc/promlib.c
780
if (fd != prom_stdin())
sys/arch/sparc/sparc/promlib.c
781
prom_printf("obp_v0_read: unimplemented read from %d\n", fd);
sys/arch/sparc/sparc/promlib.c
786
obp_v0_write(int fd, const void *buf, int len)
sys/arch/sparc/sparc/promlib.c
788
if (fd != prom_stdout())
sys/arch/sparc/sparc/promlib.c
789
prom_printf("obp_v0_write: unimplemented write on %d\n", fd);
sys/arch/sparc/stand/boot/boot.c
170
int fd, error;
sys/arch/sparc/stand/boot/boot.c
176
if ((fd = open(kernel, 0)) < 0)
sys/arch/sparc/stand/boot/boot.c
180
if ((error = fdloadfile(fd, marks, COUNT_KERNEL)) != 0)
sys/arch/sparc/stand/boot/boot.c
233
error = fdloadfile(fd, marks, flags);
sys/arch/sparc/stand/boot/boot.c
235
close(fd);
sys/arch/sparc/stand/common/netif_sun.c
106
netif_close(int fd)
sys/arch/sparc/stand/common/netif_sun.c
111
if (fd != 0) {
sys/arch/sparc/stand/common/netif_sun.c
116
io = &sockets[fd];
sys/arch/sparc/stand/common/netif_sun.c
95
node = prom_instance_to_package(pd->fd);
sys/arch/sparc/stand/common/promdev.c
194
int error = 0, fd = 0;
sys/arch/sparc/stand/common/promdev.c
223
fd = prom_open(prom_bootdevice);
sys/arch/sparc/stand/common/promdev.c
224
if (fd == 0) {
sys/arch/sparc/stand/common/promdev.c
228
pd->fd = fd;
sys/arch/sparc/stand/common/promdev.c
262
pd->devtype = getdevtype(fd, prom_bootdevice);
sys/arch/sparc/stand/common/promdev.c
294
int fd = pd->fd;
sys/arch/sparc/stand/common/promdev.c
304
#define prom_bread(fd, nblk, dblk, buf) \
sys/arch/sparc/stand/common/promdev.c
305
(*obpvec->pv_v0devops.v0_rbdev)(fd, nblk, dblk, buf)
sys/arch/sparc/stand/common/promdev.c
306
#define prom_bwrite(fd, nblk, dblk, buf) \
sys/arch/sparc/stand/common/promdev.c
307
(*obpvec->pv_v0devops.v0_wbdev)(fd, nblk, dblk, buf)
sys/arch/sparc/stand/common/promdev.c
316
prom_bread(fd, btodb(DEV_BSIZE), LABELSECTOR, &labelbuf[0]);
sys/arch/sparc/stand/common/promdev.c
324
? prom_bread(fd, btodb(size), dblk, buf)
sys/arch/sparc/stand/common/promdev.c
325
: prom_bwrite(fd, btodb(size), dblk, buf);
sys/arch/sparc/stand/common/promdev.c
342
int fd = pd->fd;
sys/arch/sparc/stand/common/promdev.c
354
prom_seek(fd, dbtob(LABELSECTOR));
sys/arch/sparc/stand/common/promdev.c
355
prom_read(fd, &labelbuf[0], DEV_BSIZE);
sys/arch/sparc/stand/common/promdev.c
364
prom_seek(fd, dbtob(dblk));
sys/arch/sparc/stand/common/promdev.c
367
? prom_read(fd, buf, size)
sys/arch/sparc/stand/common/promdev.c
368
: prom_write(fd, buf, size);
sys/arch/sparc/stand/common/promdev.c
445
register int fd = pd->fd;
sys/arch/sparc/stand/common/promdev.c
451
prom_close(fd);
sys/arch/sparc/stand/common/promdev.c
475
return ((*obpvec->pv_v0devops.v0_wnet)(pd->fd, len, buf));
sys/arch/sparc/stand/common/promdev.c
482
return (prom_write(pd->fd, buf, len));
sys/arch/sparc/stand/common/promdev.c
489
return ((*obpvec->pv_v0devops.v0_rnet)(pd->fd, len, buf));
sys/arch/sparc/stand/common/promdev.c
497
n = prom_read(pd->fd, buf, len);
sys/arch/sparc/stand/common/promdev.c
574
getdevtype(int fd, char *name)
sys/arch/sparc/stand/common/promdev.c
593
node = prom_instance_to_package(fd);
sys/arch/sparc/stand/common/promdev.h
35
int fd; /* Openboot descriptor */
sys/arch/sparc/stand/ofwboot/boot.c
369
int fd;
sys/arch/sparc/stand/ofwboot/boot.c
383
if ( (fd = loadfile(kernel, marks, LOAD_HDR|COUNT_TEXT)) != -1) {
sys/arch/sparc/stand/ofwboot/boot.c
392
if (fdloadfile(fd, marks, flags) != -1) {
sys/arch/sparc/stand/ofwboot/boot.c
393
close(fd);
sys/arch/sparc/stand/ofwboot/netif_of.c
105
netif_close(int fd)
sys/arch/sparc/stand/ofwboot/netif_of.c
111
printf("netif_close(%x)...", fd);
sys/arch/sparc/stand/ofwboot/netif_of.c
113
if (fd != 0) {
sys/arch/sparc/stand/ofwboot/netif_of.c
121
io = &sockets[fd];
sys/arch/sparc64/dev/fdc.c
1003
struct fd_softc *fd = device_private(self);
sys/arch/sparc64/dev/fdc.c
1005
fd_motor_off(fd);
sys/arch/sparc64/dev/fdc.c
1017
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/sparc64/dev/fdc.c
1023
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/arch/sparc64/dev/fdc.c
1029
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
1034
fd = device_lookup_private(&fd_cd, FDUNIT(bp->b_dev));
sys/arch/sparc64/dev/fdc.c
1035
if (fd == NULL) {
sys/arch/sparc64/dev/fdc.c
1041
(((bp->b_bcount % FD_BSIZE(fd)) != 0 ||
sys/arch/sparc64/dev/fdc.c
1042
(bp->b_blkno * DEV_BSIZE) % FD_BSIZE(fd) != 0) &&
sys/arch/sparc64/dev/fdc.c
1054
if (bp->b_blkno + sz > (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)) {
sys/arch/sparc64/dev/fdc.c
1055
sz = (fd->sc_type->size * DEV_BSIZE) / FD_BSIZE(fd)
sys/arch/sparc64/dev/fdc.c
1073
(FD_BSIZE(fd) * fd->sc_type->seccyl);
sys/arch/sparc64/dev/fdc.c
1079
(long long)fd->sc_blkno, bp->b_cylinder, sz);
sys/arch/sparc64/dev/fdc.c
1084
bufq_put(fd->sc_q, bp);
sys/arch/sparc64/dev/fdc.c
1085
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/sparc64/dev/fdc.c
1086
if (fd->sc_active == 0)
sys/arch/sparc64/dev/fdc.c
1087
fdstart(fd);
sys/arch/sparc64/dev/fdc.c
1091
device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
1107
fdstart(struct fd_softc *fd)
sys/arch/sparc64/dev/fdc.c
1109
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
1113
fd->sc_active = 1;
sys/arch/sparc64/dev/fdc.c
1114
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fdc.c
1122
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/sparc64/dev/fdc.c
1124
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
1132
(void)bufq_get(fd->sc_q);
sys/arch/sparc64/dev/fdc.c
1133
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
sys/arch/sparc64/dev/fdc.c
1134
fd->sc_ops = 0;
sys/arch/sparc64/dev/fdc.c
1135
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fdc.c
1136
if (bufq_peek(fd->sc_q) != NULL) {
sys/arch/sparc64/dev/fdc.c
1137
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fdc.c
1139
fd->sc_active = 0;
sys/arch/sparc64/dev/fdc.c
1141
bp->b_resid = fd->sc_bcount;
sys/arch/sparc64/dev/fdc.c
1142
fd->sc_skip = 0;
sys/arch/sparc64/dev/fdc.c
1146
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/sparc64/dev/fdc.c
1178
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
1184
if ((fd = fdc->sc_drives.tqh_first) != NULL)
sys/arch/sparc64/dev/fdc.c
1185
status |= fd->sc_drive;
sys/arch/sparc64/dev/fdc.c
1188
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/sparc64/dev/fdc.c
1196
if ((fd = fdc->sc_fd[n]) != NULL &&
sys/arch/sparc64/dev/fdc.c
1197
(fd->sc_flags & FD_MOTOR) != 0) {
sys/arch/sparc64/dev/fdc.c
1210
struct fd_softc *fd = arg;
sys/arch/sparc64/dev/fdc.c
1214
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/sparc64/dev/fdc.c
1215
fd_set_motor(device_private(device_parent(fd->sc_dev)));
sys/arch/sparc64/dev/fdc.c
1222
struct fd_softc *fd = arg;
sys/arch/sparc64/dev/fdc.c
1223
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
1227
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fdc.c
1228
if ((fdc->sc_drives.tqh_first == fd) && (fdc->sc_state == MOTORWAIT))
sys/arch/sparc64/dev/fdc.c
1311
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
1314
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc64/dev/fdc.c
1315
if (fd == NULL)
sys/arch/sparc64/dev/fdc.c
1317
type = fd_dev_to_type(fd, dev);
sys/arch/sparc64/dev/fdc.c
1321
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/sparc64/dev/fdc.c
1322
fd->sc_type != type)
sys/arch/sparc64/dev/fdc.c
1325
fd->sc_type = type;
sys/arch/sparc64/dev/fdc.c
1326
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fdc.c
1327
fd->sc_flags |= FD_OPEN;
sys/arch/sparc64/dev/fdc.c
1332
if (fd->sc_dk.dk_openmask == 0)
sys/arch/sparc64/dev/fdc.c
1339
fd->sc_dk.dk_copenmask |= pmask;
sys/arch/sparc64/dev/fdc.c
1343
fd->sc_dk.dk_bopenmask |= pmask;
sys/arch/sparc64/dev/fdc.c
1346
fd->sc_dk.dk_openmask =
sys/arch/sparc64/dev/fdc.c
1347
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc64/dev/fdc.c
1355
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc64/dev/fdc.c
1358
fd->sc_flags &= ~FD_OPEN;
sys/arch/sparc64/dev/fdc.c
1359
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/sparc64/dev/fdc.c
1363
fd->sc_dk.dk_copenmask &= ~pmask;
sys/arch/sparc64/dev/fdc.c
1367
fd->sc_dk.dk_bopenmask &= ~pmask;
sys/arch/sparc64/dev/fdc.c
1370
fd->sc_dk.dk_openmask =
sys/arch/sparc64/dev/fdc.c
1371
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sparc64/dev/fdc.c
1423
struct fd_softc *fd = fdc->sc_drives.tqh_first;
sys/arch/sparc64/dev/fdc.c
1443
fd ? device_xname(fd->sc_dev) : "fdc", s, fdc->sc_state);
sys/arch/sparc64/dev/fdc.c
1468
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
1472
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc64/dev/fdc.c
1473
if (fd == NULL) {
sys/arch/sparc64/dev/fdc.c
1480
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/sparc64/dev/fdc.c
1622
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
1642
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc64/dev/fdc.c
1643
if (fd == NULL) {
sys/arch/sparc64/dev/fdc.c
1649
bp = bufq_peek(fd->sc_q);
sys/arch/sparc64/dev/fdc.c
1651
fd->sc_ops = 0;
sys/arch/sparc64/dev/fdc.c
1652
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sparc64/dev/fdc.c
1653
fd->sc_active = 0;
sys/arch/sparc64/dev/fdc.c
1663
fd->sc_skip = 0;
sys/arch/sparc64/dev/fdc.c
1664
fd->sc_bcount = bp->b_bcount;
sys/arch/sparc64/dev/fdc.c
1665
fd->sc_blkno = (bp->b_blkno * DEV_BSIZE) / FD_BSIZE(fd);
sys/arch/sparc64/dev/fdc.c
1666
callout_stop(&fd->sc_motoroff_ch);
sys/arch/sparc64/dev/fdc.c
1667
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/sparc64/dev/fdc.c
1671
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/sparc64/dev/fdc.c
1673
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/sparc64/dev/fdc.c
1678
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fdc.c
1683
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/sparc64/dev/fdc.c
1684
fd_motor_on, fd);
sys/arch/sparc64/dev/fdc.c
1686
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sparc64/dev/fdc.c
1702
fd->sc_cylin = bp->b_cylinder;
sys/arch/sparc64/dev/fdc.c
1707
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/sparc64/dev/fdc.c
1710
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fdc.c
1714
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/sparc64/dev/fdc.c
1716
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fdc.c
1721
FDC_WRFIFO(fdc, fd->sc_type->steprate);
sys/arch/sparc64/dev/fdc.c
1728
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc64/dev/fdc.c
1729
FDC_WRFIFO(fdc, bp->b_cylinder * fd->sc_type->step);
sys/arch/sparc64/dev/fdc.c
1738
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fdc.c
1740
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fdc.c
1747
FDC_WRFIFO(fdc, fd->sc_drive); /* drive number */
sys/arch/sparc64/dev/fdc.c
1748
FDC_WRFIFO(fdc, 1 * fd->sc_type->step);
sys/arch/sparc64/dev/fdc.c
1753
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/sparc64/dev/fdc.c
1755
cyl != 1 * fd->sc_type->step) {
sys/arch/sparc64/dev/fdc.c
1771
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/sparc64/dev/fdc.c
1773
type = fd->sc_type;
sys/arch/sparc64/dev/fdc.c
1774
sec = fd->sc_blkno % type->seccyl;
sys/arch/sparc64/dev/fdc.c
1776
nblks = uimin(nblks, fd->sc_bcount / FD_BSIZE(fd));
sys/arch/sparc64/dev/fdc.c
1777
nblks = uimin(nblks, FDC_MAXIOSIZE / FD_BSIZE(fd));
sys/arch/sparc64/dev/fdc.c
1778
fd->sc_nblks = nblks;
sys/arch/sparc64/dev/fdc.c
1779
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FD_BSIZE(fd);
sys/arch/sparc64/dev/fdc.c
1784
block = (fd->sc_cylin * type->heads + head) * type->sectrac +
sys/arch/sparc64/dev/fdc.c
1786
if (block != fd->sc_blkno) {
sys/arch/sparc64/dev/fdc.c
1788
(int)fd->sc_blkno);
sys/arch/sparc64/dev/fdc.c
1797
fdc->sc_data = (char *)bp->b_data + fd->sc_skip;
sys/arch/sparc64/dev/fdc.c
1798
fdc->sc_tc = fd->sc_nbytes;
sys/arch/sparc64/dev/fdc.c
1808
fd->sc_drive, fd->sc_cylin, head, sec, nblks);
sys/arch/sparc64/dev/fdc.c
1814
disk_busy(&fd->sc_dk);
sys/arch/sparc64/dev/fdc.c
1822
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc64/dev/fdc.c
1832
FDC_WRFIFO(fdc, (head << 2) | fd->sc_drive);
sys/arch/sparc64/dev/fdc.c
1833
FDC_WRFIFO(fdc, fd->sc_cylin); /*track*/
sys/arch/sparc64/dev/fdc.c
1856
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/sparc64/dev/fdc.c
1860
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/sparc64/dev/fdc.c
1868
fd->sc_cylin = bp->b_cylinder;
sys/arch/sparc64/dev/fdc.c
1901
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc64/dev/fdc.c
1909
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sparc64/dev/fdc.c
1920
(long long)fd->sc_blkno, fd->sc_nblks,
sys/arch/sparc64/dev/fdc.c
1954
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc64/dev/fdc.c
1975
fd->sc_blkno += fd->sc_nblks;
sys/arch/sparc64/dev/fdc.c
1976
fd->sc_skip += fd->sc_nbytes;
sys/arch/sparc64/dev/fdc.c
1977
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/sparc64/dev/fdc.c
1978
if (finfo == NULL && fd->sc_bcount > 0) {
sys/arch/sparc64/dev/fdc.c
1979
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/sparc64/dev/fdc.c
1982
fdfinish(fd, bp);
sys/arch/sparc64/dev/fdc.c
2008
FDC_WRFIFO(fdc, fd->sc_drive);
sys/arch/sparc64/dev/fdc.c
2031
fd->sc_cylin = 0;
sys/arch/sparc64/dev/fdc.c
2035
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/sparc64/dev/fdc.c
2065
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
2069
fd = fdc->sc_drives.tqh_first;
sys/arch/sparc64/dev/fdc.c
2070
bp = bufq_peek(fd->sc_q);
sys/arch/sparc64/dev/fdc.c
2073
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/sparc64/dev/fdc.c
2117
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/sparc64/dev/fdc.c
2119
fd->sc_skip / FD_BSIZE(fd),
sys/arch/sparc64/dev/fdc.c
2127
fdfinish(fd, bp);
sys/arch/sparc64/dev/fdc.c
2135
struct fd_softc *fd;
sys/arch/sparc64/dev/fdc.c
2149
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc64/dev/fdc.c
2150
fdc = device_private(device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
2154
*(struct disklabel *)addr = *(fd->sc_dk.dk_label);
sys/arch/sparc64/dev/fdc.c
2167
error = setdisklabel(fd->sc_dk.dk_label,
sys/arch/sparc64/dev/fdc.c
2169
fd->sc_dk.dk_cpulabel);
sys/arch/sparc64/dev/fdc.c
2174
fd->sc_dk.dk_label,
sys/arch/sparc64/dev/fdc.c
2175
fd->sc_dk.dk_cpulabel);
sys/arch/sparc64/dev/fdc.c
2191
if ((fd->sc_dk.dk_openmask & ~(1 << part)) != 0 ||
sys/arch/sparc64/dev/fdc.c
2192
fd->sc_dk.dk_bopenmask + fd->sc_dk.dk_copenmask !=
sys/arch/sparc64/dev/fdc.c
2193
fd->sc_dk.dk_openmask) {
sys/arch/sparc64/dev/fdc.c
2201
fd_do_eject(fd);
sys/arch/sparc64/dev/fdc.c
2207
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/sparc64/dev/fdc.c
2208
form_parms->ncyl = fd->sc_type->cylinders;
sys/arch/sparc64/dev/fdc.c
2209
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/sparc64/dev/fdc.c
2210
form_parms->ntrk = fd->sc_type->heads;
sys/arch/sparc64/dev/fdc.c
2211
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/sparc64/dev/fdc.c
2212
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/sparc64/dev/fdc.c
2213
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/sparc64/dev/fdc.c
2214
form_parms->interleave = fd->sc_type->interleave;
sys/arch/sparc64/dev/fdc.c
2215
switch (fd->sc_type->rate) {
sys/arch/sparc64/dev/fdc.c
2246
fd->sc_type->rate = FDC_500KBPS;
sys/arch/sparc64/dev/fdc.c
2249
fd->sc_type->rate = FDC_300KBPS;
sys/arch/sparc64/dev/fdc.c
2252
fd->sc_type->rate = FDC_250KBPS;
sys/arch/sparc64/dev/fdc.c
2262
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/sparc64/dev/fdc.c
2265
fd->sc_type->heads = form_parms->ntrk;
sys/arch/sparc64/dev/fdc.c
2266
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/sparc64/dev/fdc.c
2267
fd->sc_type->secsize = ffs(i)-1;
sys/arch/sparc64/dev/fdc.c
2268
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/sparc64/dev/fdc.c
2269
fd->sc_type->cylinders = form_parms->ncyl;
sys/arch/sparc64/dev/fdc.c
2270
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/sparc64/dev/fdc.c
2272
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/sparc64/dev/fdc.c
2273
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/sparc64/dev/fdc.c
2274
fd->sc_type->interleave = form_parms->interleave;
sys/arch/sparc64/dev/fdc.c
2286
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/sparc64/dev/fdc.c
2287
form_cmd->cylinder >= fd->sc_type->cylinders) {
sys/arch/sparc64/dev/fdc.c
2294
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/sparc64/dev/fdc.c
2295
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/sparc64/dev/fdc.c
2296
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/sparc64/dev/fdc.c
2297
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/sparc64/dev/fdc.c
2298
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/sparc64/dev/fdc.c
2305
j += fd->sc_type->interleave;
sys/arch/sparc64/dev/fdc.c
2311
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/sparc64/dev/fdc.c
2319
*(int *)addr = fd->sc_opts;
sys/arch/sparc64/dev/fdc.c
2323
fd->sc_opts = *(int *)addr;
sys/arch/sparc64/dev/fdc.c
2364
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc64/dev/fdc.c
2365
struct fd_type *type = fd->sc_type;
sys/arch/sparc64/dev/fdc.c
2384
+ finfo->head * type->sectrac) * FD_BSIZE(fd))
sys/arch/sparc64/dev/fdc.c
2428
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sparc64/dev/fdc.c
2429
struct disklabel *lp = fd->sc_dk.dk_label;
sys/arch/sparc64/dev/fdc.c
2430
struct cpu_disklabel *clp = fd->sc_dk.dk_cpulabel;
sys/arch/sparc64/dev/fdc.c
2436
lp->d_secsize = FD_BSIZE(fd);
sys/arch/sparc64/dev/fdc.c
2437
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/sparc64/dev/fdc.c
2438
lp->d_nsectors = fd->sc_type->sectrac;
sys/arch/sparc64/dev/fdc.c
2439
lp->d_ncylinders = fd->sc_type->cylinders;
sys/arch/sparc64/dev/fdc.c
2440
lp->d_ntracks = fd->sc_type->heads; /* Go figure... */
sys/arch/sparc64/dev/fdc.c
2488
fd_do_eject(struct fd_softc *fd)
sys/arch/sparc64/dev/fdc.c
2490
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/sparc64/dev/fdc.c
2584
fd_set_geometry(struct fd_softc *fd)
sys/arch/sparc64/dev/fdc.c
2588
fdt = fd->sc_type;
sys/arch/sparc64/dev/fdc.c
2590
fdt = fd->sc_deftype;
sys/arch/sparc64/dev/fdc.c
2595
struct disk_geom *dg = &fd->sc_dk.dk_geom;
sys/arch/sparc64/dev/fdc.c
2612
disk_set_info(fd->sc_dev, &fd->sc_dk, NULL);
sys/arch/sparc64/dev/fdc.c
329
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/sparc64/dev/fdc.c
954
struct fd_softc *fd = device_private(self);
sys/arch/sparc64/dev/fdc.c
959
fd->sc_dev = self;
sys/arch/sparc64/dev/fdc.c
960
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/sparc64/dev/fdc.c
961
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/sparc64/dev/fdc.c
971
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/sparc64/dev/fdc.c
972
fd->sc_cylin = -1;
sys/arch/sparc64/dev/fdc.c
973
fd->sc_drive = drive;
sys/arch/sparc64/dev/fdc.c
974
fd->sc_deftype = type;
sys/arch/sparc64/dev/fdc.c
975
fdc->sc_fd[drive] = fd;
sys/arch/sparc64/dev/fdc.c
985
disk_init(&fd->sc_dk, device_xname(fd->sc_dev), &fddkdriver);
sys/arch/sparc64/dev/fdc.c
986
disk_attach(&fd->sc_dk);
sys/arch/sparc64/dev/fdc.c
992
mountroothook_establish(fd_mountroot_hook, fd->sc_dev);
sys/arch/sparc64/dev/fdc.c
994
fd_set_geometry(fd);
sys/arch/sparc64/dev/fdcvar.h
32
#define FD_BSIZE(fd) (128 * (1 << fd->sc_type->secsize))
sys/arch/sun3/dev/fd.c
1037
struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sun3/dev/fd.c
1041
fdcstatus(fd->sc_dv, 0, "timeout");
sys/arch/sun3/dev/fd.c
1043
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/sun3/dev/fd.c
1163
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
1185
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/sun3/dev/fd.c
1186
if (fd == NULL) {
sys/arch/sun3/dev/fd.c
1192
bp = bufq_peek(fd->sc_q);
sys/arch/sun3/dev/fd.c
1194
fd->sc_ops = 0;
sys/arch/sun3/dev/fd.c
1195
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sun3/dev/fd.c
1196
fd->sc_active = 0;
sys/arch/sun3/dev/fd.c
1206
fd->sc_skip = 0;
sys/arch/sun3/dev/fd.c
1207
fd->sc_bcount = bp->b_bcount;
sys/arch/sun3/dev/fd.c
1208
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/arch/sun3/dev/fd.c
1209
callout_stop(&fd->sc_motoroff_ch);
sys/arch/sun3/dev/fd.c
1210
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/sun3/dev/fd.c
1214
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/sun3/dev/fd.c
1216
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/arch/sun3/dev/fd.c
1221
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/sun3/dev/fd.c
1226
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/arch/sun3/dev/fd.c
1227
fd_motor_on, fd);
sys/arch/sun3/dev/fd.c
1229
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sun3/dev/fd.c
1242
fd->sc_cylin = bp->b_cylinder;
sys/arch/sun3/dev/fd.c
1247
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/sun3/dev/fd.c
1252
OUT_FDC(fdc, fd->sc_type->steprate, SEEKTIMEDOUT);
sys/arch/sun3/dev/fd.c
1258
OUT_FDC(fdc, fd->sc_drive, SEEKTIMEDOUT); /* drive number */
sys/arch/sun3/dev/fd.c
1259
OUT_FDC(fdc, bp->b_cylinder * fd->sc_type->step, SEEKTIMEDOUT);
sys/arch/sun3/dev/fd.c
1261
fd->sc_cylin = -1;
sys/arch/sun3/dev/fd.c
1265
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/sun3/dev/fd.c
1266
disk_busy(&fd->sc_dk);
sys/arch/sun3/dev/fd.c
1285
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/sun3/dev/fd.c
1287
type = fd->sc_type;
sys/arch/sun3/dev/fd.c
1288
sec = fd->sc_blkno % type->seccyl;
sys/arch/sun3/dev/fd.c
1290
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/sun3/dev/fd.c
1292
fd->sc_nblks = nblks;
sys/arch/sun3/dev/fd.c
1293
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
sys/arch/sun3/dev/fd.c
1300
block = (fd->sc_cylin * type->heads + head) *
sys/arch/sun3/dev/fd.c
1302
if (block != fd->sc_blkno) {
sys/arch/sun3/dev/fd.c
1305
fd->sc_blkno);
sys/arch/sun3/dev/fd.c
1315
fdc->sc_data = (char *)bp->b_data + fd->sc_skip;
sys/arch/sun3/dev/fd.c
1316
fdc->sc_tc = fd->sc_nbytes;
sys/arch/sun3/dev/fd.c
1323
read ? "read" : "write", fd->sc_drive,
sys/arch/sun3/dev/fd.c
1324
fd->sc_cylin, head, sec, nblks);
sys/arch/sun3/dev/fd.c
1332
OUT_FDC(fdc, (head << 2) | fd->sc_drive, IOTIMEDOUT);
sys/arch/sun3/dev/fd.c
1342
OUT_FDC(fdc, (head << 2) | fd->sc_drive, IOTIMEDOUT);
sys/arch/sun3/dev/fd.c
1343
OUT_FDC(fdc, fd->sc_cylin, IOTIMEDOUT); /*track*/
sys/arch/sun3/dev/fd.c
1352
disk_busy(&fd->sc_dk);
sys/arch/sun3/dev/fd.c
1370
disk_unbusy(&fd->sc_dk, 0, 0);
sys/arch/sun3/dev/fd.c
1374
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/arch/sun3/dev/fd.c
1377
fdcstatus(fd->sc_dv, 2, "seek failed");
sys/arch/sun3/dev/fd.c
1382
fd->sc_cylin = bp->b_cylinder;
sys/arch/sun3/dev/fd.c
1402
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/arch/sun3/dev/fd.c
1408
fdcstatus(fd->sc_dv, 7,
sys/arch/sun3/dev/fd.c
1412
(int)fd->sc_blkno, fd->sc_nblks,
sys/arch/sun3/dev/fd.c
1446
fd->sc_skip / FDC_BSIZE, NULL);
sys/arch/sun3/dev/fd.c
1466
fd->sc_blkno += fd->sc_nblks;
sys/arch/sun3/dev/fd.c
1467
fd->sc_skip += fd->sc_nbytes;
sys/arch/sun3/dev/fd.c
1468
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/sun3/dev/fd.c
1469
if (!finfo && fd->sc_bcount > 0) {
sys/arch/sun3/dev/fd.c
1470
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/arch/sun3/dev/fd.c
1473
fdfinish(fd, bp);
sys/arch/sun3/dev/fd.c
1499
OUT_FDC(fdc, fd->sc_drive, RECALTIMEDOUT);
sys/arch/sun3/dev/fd.c
1517
fdcstatus(fd->sc_dv, 2, "recalibrate failed");
sys/arch/sun3/dev/fd.c
1522
fd->sc_cylin = 0;
sys/arch/sun3/dev/fd.c
1526
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/sun3/dev/fd.c
1531
fdcstatus(fd->sc_dv, 0, "stray interrupt");
sys/arch/sun3/dev/fd.c
1545
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
1548
fd = fdc->sc_drives.tqh_first;
sys/arch/sun3/dev/fd.c
1549
bp = bufq_peek(fd->sc_q);
sys/arch/sun3/dev/fd.c
1552
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/sun3/dev/fd.c
1576
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/sun3/dev/fd.c
1578
fd->sc_skip / FDC_BSIZE, NULL);
sys/arch/sun3/dev/fd.c
1584
fdfinish(fd, bp);
sys/arch/sun3/dev/fd.c
1592
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sun3/dev/fd.c
1602
*(struct disklabel *)addr = *(fd->sc_dk.dk_label);
sys/arch/sun3/dev/fd.c
1615
error = setdisklabel(fd->sc_dk.dk_label,
sys/arch/sun3/dev/fd.c
1616
(struct disklabel *)addr, 0, fd->sc_dk.dk_cpulabel);
sys/arch/sun3/dev/fd.c
1620
error = writedisklabel(dev, fdstrategy, fd->sc_dk.dk_label,
sys/arch/sun3/dev/fd.c
1621
fd->sc_dk.dk_cpulabel);
sys/arch/sun3/dev/fd.c
1637
if ((fd->sc_dk.dk_openmask & ~(1 << part)) != 0 ||
sys/arch/sun3/dev/fd.c
1638
fd->sc_dk.dk_bopenmask + fd->sc_dk.dk_copenmask !=
sys/arch/sun3/dev/fd.c
1639
fd->sc_dk.dk_openmask) {
sys/arch/sun3/dev/fd.c
1645
fd_do_eject(device_private(device_parent(fd->sc_dv)),
sys/arch/sun3/dev/fd.c
1646
fd->sc_drive);
sys/arch/sun3/dev/fd.c
1652
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/sun3/dev/fd.c
1653
form_parms->ncyl = fd->sc_type->tracks;
sys/arch/sun3/dev/fd.c
1654
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/sun3/dev/fd.c
1655
form_parms->ntrk = fd->sc_type->heads;
sys/arch/sun3/dev/fd.c
1656
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/sun3/dev/fd.c
1657
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/sun3/dev/fd.c
1658
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/sun3/dev/fd.c
1659
form_parms->interleave = fd->sc_type->interleave;
sys/arch/sun3/dev/fd.c
1660
switch (fd->sc_type->rate) {
sys/arch/sun3/dev/fd.c
1691
fd->sc_type->rate = FDC_500KBPS;
sys/arch/sun3/dev/fd.c
1694
fd->sc_type->rate = FDC_300KBPS;
sys/arch/sun3/dev/fd.c
1697
fd->sc_type->rate = FDC_250KBPS;
sys/arch/sun3/dev/fd.c
1707
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/sun3/dev/fd.c
1710
fd->sc_type->heads = form_parms->ntrk;
sys/arch/sun3/dev/fd.c
1711
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/sun3/dev/fd.c
1712
fd->sc_type->secsize = ffs(i) - 1;
sys/arch/sun3/dev/fd.c
1713
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/sun3/dev/fd.c
1714
fd->sc_type->tracks = form_parms->ncyl;
sys/arch/sun3/dev/fd.c
1715
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/sun3/dev/fd.c
1717
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/sun3/dev/fd.c
1718
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/sun3/dev/fd.c
1719
fd->sc_type->interleave = form_parms->interleave;
sys/arch/sun3/dev/fd.c
1731
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/sun3/dev/fd.c
1732
form_cmd->cylinder >= fd->sc_type->tracks) {
sys/arch/sun3/dev/fd.c
1739
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/sun3/dev/fd.c
1740
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/sun3/dev/fd.c
1741
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/sun3/dev/fd.c
1742
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/sun3/dev/fd.c
1743
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/sun3/dev/fd.c
1750
j += fd->sc_type->interleave;
sys/arch/sun3/dev/fd.c
1756
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/sun3/dev/fd.c
1764
*(int *)addr = fd->sc_opts;
sys/arch/sun3/dev/fd.c
1768
fd->sc_opts = *(int *)addr;
sys/arch/sun3/dev/fd.c
1776
device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
1790
device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
1802
device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
1827
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sun3/dev/fd.c
1828
struct fd_type *type = fd->sc_type;
sys/arch/sun3/dev/fd.c
1871
struct fd_softc *fd = device_lookup_private(&fd_cd, unit);
sys/arch/sun3/dev/fd.c
1872
struct disklabel *lp = fd->sc_dk.dk_label;
sys/arch/sun3/dev/fd.c
1873
struct cpu_disklabel *clp = fd->sc_dk.dk_cpulabel;
sys/arch/sun3/dev/fd.c
1880
lp->d_secpercyl = fd->sc_type->seccyl;
sys/arch/sun3/dev/fd.c
1881
lp->d_nsectors = fd->sc_type->sectrac;
sys/arch/sun3/dev/fd.c
1882
lp->d_ncylinders = fd->sc_type->tracks;
sys/arch/sun3/dev/fd.c
1883
lp->d_ntracks = fd->sc_type->heads; /* Go figure... */
sys/arch/sun3/dev/fd.c
1947
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
1951
fd = device_private(dev);
sys/arch/sun3/dev/fd.c
1953
fd_do_eject(fdc, fd->sc_drive);
sys/arch/sun3/dev/fd.c
1979
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
2020
fd = device_lookup_private(&fd_cd, 0);
sys/arch/sun3/dev/fd.c
2021
fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
271
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/sun3/dev/fd.c
566
struct fd_softc *fd = device_private(self);
sys/arch/sun3/dev/fd.c
571
fd->sc_dv = self;
sys/arch/sun3/dev/fd.c
573
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/sun3/dev/fd.c
574
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/sun3/dev/fd.c
584
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/sun3/dev/fd.c
585
fd->sc_cylin = -1;
sys/arch/sun3/dev/fd.c
586
fd->sc_drive = drive;
sys/arch/sun3/dev/fd.c
587
fd->sc_deftype = type;
sys/arch/sun3/dev/fd.c
588
fdc->sc_fd[drive] = fd;
sys/arch/sun3/dev/fd.c
593
disk_init(&fd->sc_dk, device_xname(self), &fddkdriver);
sys/arch/sun3/dev/fd.c
594
disk_attach(&fd->sc_dk);
sys/arch/sun3/dev/fd.c
639
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
641
fd = device_private(self);
sys/arch/sun3/dev/fd.c
642
fd_motor_off(fd);
sys/arch/sun3/dev/fd.c
648
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/sun3/dev/fd.c
654
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/arch/sun3/dev/fd.c
660
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
666
if ((fd = device_lookup_private(&fd_cd, unit)) == 0 ||
sys/arch/sun3/dev/fd.c
680
if (bp->b_blkno + sz > fd->sc_type->size) {
sys/arch/sun3/dev/fd.c
681
sz = fd->sc_type->size - bp->b_blkno;
sys/arch/sun3/dev/fd.c
698
bp->b_blkno / (FDC_BSIZE / DEV_BSIZE) / fd->sc_type->seccyl;
sys/arch/sun3/dev/fd.c
704
(int)fd->sc_blkno, bp->b_cylinder);
sys/arch/sun3/dev/fd.c
709
bufq_put(fd->sc_q, bp);
sys/arch/sun3/dev/fd.c
710
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/sun3/dev/fd.c
711
if (fd->sc_active == 0)
sys/arch/sun3/dev/fd.c
712
fdstart(fd);
sys/arch/sun3/dev/fd.c
717
fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
733
fdstart(struct fd_softc *fd)
sys/arch/sun3/dev/fd.c
735
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
739
fd->sc_active = 1;
sys/arch/sun3/dev/fd.c
740
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sun3/dev/fd.c
748
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/sun3/dev/fd.c
750
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
758
(void)bufq_get(fd->sc_q);
sys/arch/sun3/dev/fd.c
759
if (TAILQ_NEXT(fd, sc_drivechain) && ++fd->sc_ops >= 8) {
sys/arch/sun3/dev/fd.c
760
fd->sc_ops = 0;
sys/arch/sun3/dev/fd.c
761
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sun3/dev/fd.c
762
if (bufq_peek(fd->sc_q) != NULL) {
sys/arch/sun3/dev/fd.c
763
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/sun3/dev/fd.c
765
fd->sc_active = 0;
sys/arch/sun3/dev/fd.c
767
bp->b_resid = fd->sc_bcount;
sys/arch/sun3/dev/fd.c
768
fd->sc_skip = 0;
sys/arch/sun3/dev/fd.c
772
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/sun3/dev/fd.c
796
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
802
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/arch/sun3/dev/fd.c
815
struct fd_softc *fd = arg;
sys/arch/sun3/dev/fd.c
819
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/sun3/dev/fd.c
820
fd_set_motor(device_private(device_parent(fd->sc_dv)));
sys/arch/sun3/dev/fd.c
827
struct fd_softc *fd = arg;
sys/arch/sun3/dev/fd.c
828
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dv));
sys/arch/sun3/dev/fd.c
832
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/sun3/dev/fd.c
833
if ((TAILQ_FIRST(&fdc->sc_drives) == fd) &&
sys/arch/sun3/dev/fd.c
883
struct fd_softc *fd;
sys/arch/sun3/dev/fd.c
887
fd = device_lookup_private(&fd_cd, unit);
sys/arch/sun3/dev/fd.c
888
if (fd == NULL)
sys/arch/sun3/dev/fd.c
890
type = fd_dev_to_type(fd, dev);
sys/arch/sun3/dev/fd.c
894
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/sun3/dev/fd.c
895
fd->sc_type != type)
sys/arch/sun3/dev/fd.c
898
fd->sc_type = type;
sys/arch/sun3/dev/fd.c
899
fd->sc_cylin = -1;
sys/arch/sun3/dev/fd.c
900
fd->sc_flags |= FD_OPEN;
sys/arch/sun3/dev/fd.c
905
if (fd->sc_dk.dk_openmask == 0)
sys/arch/sun3/dev/fd.c
912
fd->sc_dk.dk_copenmask |= pmask;
sys/arch/sun3/dev/fd.c
916
fd->sc_dk.dk_bopenmask |= pmask;
sys/arch/sun3/dev/fd.c
919
fd->sc_dk.dk_openmask =
sys/arch/sun3/dev/fd.c
920
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sun3/dev/fd.c
928
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/sun3/dev/fd.c
931
fd->sc_flags &= ~FD_OPEN;
sys/arch/sun3/dev/fd.c
932
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/arch/sun3/dev/fd.c
936
fd->sc_dk.dk_copenmask &= ~pmask;
sys/arch/sun3/dev/fd.c
940
fd->sc_dk.dk_bopenmask &= ~pmask;
sys/arch/sun3/dev/fd.c
943
fd->sc_dk.dk_openmask =
sys/arch/sun3/dev/fd.c
944
fd->sc_dk.dk_copenmask | fd->sc_dk.dk_bopenmask;
sys/arch/sun68k/stand/libsa/netif_sun.c
218
int fd, error;
sys/arch/sun68k/stand/libsa/netif_sun.c
221
for (fd = 0, s = sockets; fd < SOPEN_MAX; fd++, s++)
sys/arch/sun68k/stand/libsa/netif_sun.c
235
return (fd);
sys/arch/sun68k/stand/libsa/netif_sun.c
239
netif_close(int fd)
sys/arch/sun68k/stand/libsa/netif_sun.c
244
if (fd < 0 || fd >= SOPEN_MAX) {
sys/arch/sun68k/stand/libsa/netif_sun.c
248
s = &sockets[fd];
sys/arch/sun68k/stand/libsa/netif_sun.c
260
socktodesc(int fd)
sys/arch/sun68k/stand/libsa/netif_sun.c
262
if (fd < 0 || fd >= SOPEN_MAX) {
sys/arch/sun68k/stand/libsa/netif_sun.c
266
return (&sockets[fd]);
sys/arch/sun68k/stand/libsa/xxboot.c
109
fd = loadfile(file, marks, LOAD_KERNEL);
sys/arch/sun68k/stand/libsa/xxboot.c
110
if (fd == -1) {
sys/arch/sun68k/stand/libsa/xxboot.c
123
fd = loadfile(file, marks, LOAD_KERNEL);
sys/arch/sun68k/stand/libsa/xxboot.c
124
if (fd != -1)
sys/arch/sun68k/stand/libsa/xxboot.c
140
fd = loadfile(file, marks, LOAD_KERNEL);
sys/arch/sun68k/stand/libsa/xxboot.c
141
if (fd != -1)
sys/arch/sun68k/stand/libsa/xxboot.c
69
int fd;
sys/arch/sun68k/stand/tapeboot/boot.c
110
if ((fd = loadfile(file, marks,
sys/arch/sun68k/stand/tapeboot/boot.c
117
close(fd);
sys/arch/sun68k/stand/tapeboot/boot.c
64
int fd;
sys/arch/usermode/include/thunk.h
132
int thunk_kgdb_getc(int fd, char *ch);
sys/arch/usermode/include/thunk.h
133
int thunk_kgdb_putc(int fd, char ch);
sys/arch/usermode/include/thunk.h
146
int thunk_ioctl(int fd, unsigned long request, void *opaque);
sys/arch/usermode/include/thunk.h
156
void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
sys/arch/usermode/usermode/thunk.c
1059
int fd, flags;
sys/arch/usermode/usermode/thunk.c
1061
fd = accept(sockfd, (struct sockaddr *) &client_addr, &client_addrlen);
sys/arch/usermode/usermode/thunk.c
1062
if (fd < 0) {
sys/arch/usermode/usermode/thunk.c
1068
flags = fcntl(fd, F_GETFL, 0);
sys/arch/usermode/usermode/thunk.c
1071
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
sys/arch/usermode/usermode/thunk.c
1074
return fd;
sys/arch/usermode/usermode/thunk.c
1078
thunk_kgdb_getc(int fd, char *ch)
sys/arch/usermode/usermode/thunk.c
1080
return safe_recv(fd, ch, 1);
sys/arch/usermode/usermode/thunk.c
1084
thunk_kgdb_putc(int fd, char ch)
sys/arch/usermode/usermode/thunk.c
1086
return safe_send(fd, &ch, 1);
sys/arch/usermode/usermode/thunk.c
1339
fds[0].fd = rfb->sockfd;
sys/arch/usermode/usermode/thunk.c
425
thunk_tcgetattr(int fd, struct thunk_termios *tt)
sys/arch/usermode/usermode/thunk.c
430
error = tcgetattr(fd, &t);
sys/arch/usermode/usermode/thunk.c
438
thunk_tcsetattr(int fd, int action, const struct thunk_termios *tt)
sys/arch/usermode/usermode/thunk.c
443
return tcsetattr(fd, action, &t);
sys/arch/usermode/usermode/thunk.c
467
fds[0].fd = STDIN_FILENO;
sys/arch/usermode/usermode/thunk.c
508
thunk_close(int fd)
sys/arch/usermode/usermode/thunk.c
510
return close(fd);
sys/arch/usermode/usermode/thunk.c
514
thunk_fstat_getsize(int fd, off_t *size, ssize_t *blksize)
sys/arch/usermode/usermode/thunk.c
519
error = fstat(fd, &st);
sys/arch/usermode/usermode/thunk.c
556
thunk_fsync(int fd)
sys/arch/usermode/usermode/thunk.c
558
return fsync(fd);
sys/arch/usermode/usermode/thunk.c
666
thunk_ioctl(int fd, unsigned long request, void *opaque)
sys/arch/usermode/usermode/thunk.c
668
return ioctl(fd, request, opaque);
sys/arch/usermode/usermode/thunk.c
714
thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
sys/arch/usermode/usermode/thunk.c
722
a = mmap(addr, len, nprot, nflags, fd, offset);
sys/arch/usermode/usermode/thunk.c
786
int fd;
sys/arch/usermode/usermode/thunk.c
788
fd = open("/proc/cpuinfo", O_RDONLY);
sys/arch/usermode/usermode/thunk.c
789
if (fd == -1)
sys/arch/usermode/usermode/thunk.c
791
rlen = read(fd, cp, *len);
sys/arch/usermode/usermode/thunk.c
792
close(fd);
sys/arch/usermode/usermode/thunk.c
829
thunk_setown(int fd)
sys/arch/usermode/usermode/thunk.c
831
return fcntl(fd, F_SETOWN, getpid());
sys/arch/usermode/usermode/thunk.c
837
int fd, error, enable;
sys/arch/usermode/usermode/thunk.c
840
fd = open(device, O_RDWR);
sys/arch/usermode/usermode/thunk.c
841
if (fd == -1)
sys/arch/usermode/usermode/thunk.c
846
error = ioctl(fd, FIOASYNC, &enable);
sys/arch/usermode/usermode/thunk.c
850
return fd;
sys/arch/usermode/usermode/thunk.c
854
thunk_pollin_tap(int fd, int timeout)
sys/arch/usermode/usermode/thunk.c
859
fds[0].fd = fd;
sys/arch/usermode/usermode/thunk.c
867
error = ioctl(fd, FIONREAD, &len);
sys/arch/usermode/usermode/thunk.c
876
thunk_pollout_tap(int fd, int timeout)
sys/arch/usermode/usermode/thunk.c
880
fds[0].fd = fd;
sys/arch/usermode/usermode/thunk.c
909
thunk_audio_close(int fd)
sys/arch/usermode/usermode/thunk.c
911
return close(fd);
sys/arch/usermode/usermode/thunk.c
915
thunk_audio_config(int fd, const thunk_audio_config_t *pconf,
sys/arch/usermode/usermode/thunk.c
932
error = ioctl(fd, AUDIO_SETINFO, &info);
sys/arch/usermode/usermode/thunk.c
940
thunk_audio_pollout(int fd)
sys/arch/usermode/usermode/thunk.c
946
error = ioctl(fd, AUDIO_GETBUFINFO, &info);
sys/arch/usermode/usermode/thunk.c
954
thunk_audio_pollin(int fd)
sys/arch/usermode/usermode/thunk.c
960
error = ioctl(fd, AUDIO_GETBUFINFO, &info);
sys/arch/usermode/usermode/thunk.c
968
thunk_audio_write(int fd, const void *buf, size_t buflen)
sys/arch/usermode/usermode/thunk.c
970
return write(fd, buf, buflen);
sys/arch/usermode/usermode/thunk.c
974
thunk_audio_read(int fd, void *buf, size_t buflen)
sys/arch/usermode/usermode/thunk.c
976
return read(fd, buf, buflen);
sys/arch/vax/boot/boot/boot.c
140
fd = loadfile(filelist[fileindex].name, marks,
sys/arch/vax/boot/boot/boot.c
142
if (fd >= 0) {
sys/arch/vax/boot/boot/boot.c
143
close(fd);
sys/arch/vax/boot/boot/boot.c
200
int howto, fl, fd;
sys/arch/vax/boot/boot/boot.c
233
fd = loadfile(fn, marks, LOAD_KERNEL|COUNT_KERNEL);
sys/arch/vax/boot/boot/boot.c
234
if (fd >= 0) {
sys/arch/vax/boot/boot/boot.c
235
close(fd);
sys/arch/vax/boot/boot/boot.c
96
int j, nu, fd;
sys/arch/x68k/dev/fd.c
1065
struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/x68k/dev/fd.c
1069
fdcstatus(fd->sc_dev, 0, "timeout");
sys/arch/x68k/dev/fd.c
1071
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/x68k/dev/fd.c
1100
struct fd_softc *fd;
sys/arch/x68k/dev/fd.c
1110
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/x68k/dev/fd.c
1111
if (fd == NULL) {
sys/arch/x68k/dev/fd.c
1129
bp = bufq_peek(fd->sc_q);
sys/arch/x68k/dev/fd.c
1131
fd->sc_ops = 0;
sys/arch/x68k/dev/fd.c
1132
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/x68k/dev/fd.c
1133
fd->sc_active = 0;
sys/arch/x68k/dev/fd.c
1144
fd->sc_skip = 0;
sys/arch/x68k/dev/fd.c
1145
fd->sc_bcount = bp->b_bcount;
sys/arch/x68k/dev/fd.c
1146
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/arch/x68k/dev/fd.c
1147
callout_stop(&fd->sc_motoroff_ch);
sys/arch/x68k/dev/fd.c
1148
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/arch/x68k/dev/fd.c
1152
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/arch/x68k/dev/fd.c
1165
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/arch/x68k/dev/fd.c
1170
callout_reset(&fd->sc_motoron_ch, hz / 2,
sys/arch/x68k/dev/fd.c
1171
fd_motor_on, fd);
sys/arch/x68k/dev/fd.c
1182
if (fd->sc_cylin == bp->b_cylinder)
sys/arch/x68k/dev/fd.c
1190
out_fdc(iot, ioh, fd->sc_drive); /* drive number */
sys/arch/x68k/dev/fd.c
1191
out_fdc(iot, ioh, bp->b_cylinder * fd->sc_type->step);
sys/arch/x68k/dev/fd.c
1193
fd->sc_cylin = -1;
sys/arch/x68k/dev/fd.c
1196
iostat_seek(fd->sc_dk.dk_stats);
sys/arch/x68k/dev/fd.c
1197
disk_busy(&fd->sc_dk);
sys/arch/x68k/dev/fd.c
1205
type = fd->sc_type;
sys/arch/x68k/dev/fd.c
1207
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/arch/x68k/dev/fd.c
1210
pos = fd->sc_blkno % (sectrac * (1 << (type->secsize - 2)));
sys/arch/x68k/dev/fd.c
1213
fd->sc_part = SEC_P11;
sys/arch/x68k/dev/fd.c
1215
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/x68k/dev/fd.c
1217
} else if ((fd->sc_blkno % 2) == 0) {
sys/arch/x68k/dev/fd.c
1218
if (fd->sc_bcount & 0x00000200) {
sys/arch/x68k/dev/fd.c
1219
if (fd->sc_bcount == FDC_BSIZE) {
sys/arch/x68k/dev/fd.c
1220
fd->sc_part = SEC_P10;
sys/arch/x68k/dev/fd.c
1224
fd->sc_part = SEC_P11;
sys/arch/x68k/dev/fd.c
1227
fd->sc_bcount / FDC_BSIZE - 1);
sys/arch/x68k/dev/fd.c
1231
fd->sc_part = SEC_P11;
sys/arch/x68k/dev/fd.c
1233
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/arch/x68k/dev/fd.c
1237
fd->sc_part = SEC_P01;
sys/arch/x68k/dev/fd.c
1243
fd->sc_nblks = nblks;
sys/arch/x68k/dev/fd.c
1244
fd->sc_nbytes =
sys/arch/x68k/dev/fd.c
1246
head = (fd->sc_blkno
sys/arch/x68k/dev/fd.c
1253
block = ((fd->sc_cylin * type->heads + head) *
sys/arch/x68k/dev/fd.c
1255
block += (fd->sc_part == SEC_P01) ? 1 : 0;
sys/arch/x68k/dev/fd.c
1256
if (block != fd->sc_blkno) {
sys/arch/x68k/dev/fd.c
1258
fd->sc_cylin, head, sec, type->secsize);
sys/arch/x68k/dev/fd.c
1261
block, fd->sc_blkno);
sys/arch/x68k/dev/fd.c
1271
read ? "read" : "write", fd->sc_drive, fd->sc_cylin,
sys/arch/x68k/dev/fd.c
1272
head, sec, nblks, fd->sc_skip));
sys/arch/x68k/dev/fd.c
1273
DPRINTF(("C H R N: %d %d %d %d\n", fd->sc_cylin, head, sec,
sys/arch/x68k/dev/fd.c
1276
if (finfo == NULL && fd->sc_part != SEC_P11)
sys/arch/x68k/dev/fd.c
1279
fdc_dmastart(fdc, read, (char *)bp->b_data + fd->sc_skip,
sys/arch/x68k/dev/fd.c
1280
fd->sc_nbytes);
sys/arch/x68k/dev/fd.c
1288
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/x68k/dev/fd.c
1298
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/x68k/dev/fd.c
1309
disk_busy(&fd->sc_dk);
sys/arch/x68k/dev/fd.c
1318
type = fd->sc_type;
sys/arch/x68k/dev/fd.c
1319
head = (fd->sc_blkno
sys/arch/x68k/dev/fd.c
1322
pos = fd->sc_blkno %
sys/arch/x68k/dev/fd.c
1325
fdc_dmastart(fdc, B_READ, fd->sc_copybuf, 1024);
sys/arch/x68k/dev/fd.c
1327
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/x68k/dev/fd.c
1344
type = fd->sc_type;
sys/arch/x68k/dev/fd.c
1346
pos = fd->sc_blkno % (sectrac * (1 << (type->secsize - 2)));
sys/arch/x68k/dev/fd.c
1348
head = (fd->sc_blkno
sys/arch/x68k/dev/fd.c
1354
block = ((fd->sc_cylin * type->heads + head) *
sys/arch/x68k/dev/fd.c
1356
block += (fd->sc_part == SEC_P01) ? 1 : 0;
sys/arch/x68k/dev/fd.c
1357
if (block != fd->sc_blkno) {
sys/arch/x68k/dev/fd.c
1360
block, fd->sc_blkno);
sys/arch/x68k/dev/fd.c
1368
memcpy((char *)bp->b_data + fd->sc_skip, fd->sc_copybuf
sys/arch/x68k/dev/fd.c
1369
+ (fd->sc_part & SEC_P01 ? FDC_BSIZE : 0),
sys/arch/x68k/dev/fd.c
1374
memcpy((char *)fd->sc_copybuf
sys/arch/x68k/dev/fd.c
1375
+ (fd->sc_part & SEC_P01 ? FDC_BSIZE : 0),
sys/arch/x68k/dev/fd.c
1376
(char *)bp->b_data + fd->sc_skip, FDC_BSIZE);
sys/arch/x68k/dev/fd.c
1377
fdc_dmastart(fdc, read, fd->sc_copybuf, 1024);
sys/arch/x68k/dev/fd.c
1380
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/arch/x68k/dev/fd.c
1384
out_fdc(iot, ioh, fd->sc_type->secsize); /* sector size */
sys/arch/x68k/dev/fd.c
1386
out_fdc(iot, ioh, fd->sc_type->gap1); /* gap1 size */
sys/arch/x68k/dev/fd.c
1387
out_fdc(iot, ioh, fd->sc_type->datalen); /* data length */
sys/arch/x68k/dev/fd.c
1416
fdcstatus(fd->sc_dev, 2, "seek failed");
sys/arch/x68k/dev/fd.c
1421
fd->sc_cylin = bp->b_cylinder;
sys/arch/x68k/dev/fd.c
1437
fdcstatus(fd->sc_dev, tmp, bp->b_flags & B_READ ?
sys/arch/x68k/dev/fd.c
1440
fd->sc_blkno, fd->sc_nblks);
sys/arch/x68k/dev/fd.c
1447
fd->sc_skip / FDC_BSIZE, (struct disklabel *)NULL);
sys/arch/x68k/dev/fd.c
1451
fd->sc_blkno += fd->sc_nblks;
sys/arch/x68k/dev/fd.c
1452
fd->sc_skip += fd->sc_nbytes;
sys/arch/x68k/dev/fd.c
1453
fd->sc_bcount -= fd->sc_nbytes;
sys/arch/x68k/dev/fd.c
1454
DPRINTF(("fd->sc_bcount = %d\n", fd->sc_bcount));
sys/arch/x68k/dev/fd.c
1455
if (finfo == NULL && fd->sc_bcount > 0) {
sys/arch/x68k/dev/fd.c
1456
bp->b_cylinder = fd->sc_blkno
sys/arch/x68k/dev/fd.c
1457
/ (fd->sc_type->seccyl
sys/arch/x68k/dev/fd.c
1458
* (1 << (fd->sc_type->secsize - 2)));
sys/arch/x68k/dev/fd.c
1461
fdfinish(fd, bp);
sys/arch/x68k/dev/fd.c
1470
fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/arch/x68k/dev/fd.c
1473
fd->sc_blkno, fd->sc_nblks);
sys/arch/x68k/dev/fd.c
1502
out_fdc(iot, ioh, fd->sc_drive);
sys/arch/x68k/dev/fd.c
1527
fdcstatus(fd->sc_dev, 2, "recalibrate failed");
sys/arch/x68k/dev/fd.c
1532
fd->sc_cylin = 0;
sys/arch/x68k/dev/fd.c
1537
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/arch/x68k/dev/fd.c
1541
KASSERT(fd->sc_flags & FD_MOTOR_WAIT);
sys/arch/x68k/dev/fd.c
1546
device_xname(fd->sc_dev));
sys/arch/x68k/dev/fd.c
1550
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/x68k/dev/fd.c
1555
fdcstatus(fd->sc_dev, 0, "stray interrupt");
sys/arch/x68k/dev/fd.c
1568
struct fd_softc *fd;
sys/arch/x68k/dev/fd.c
1572
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/arch/x68k/dev/fd.c
1573
bp = bufq_peek(fd->sc_q);
sys/arch/x68k/dev/fd.c
1575
if (fd->sc_opts & FDOPT_NORETRY)
sys/arch/x68k/dev/fd.c
1598
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/arch/x68k/dev/fd.c
1600
fd->sc_skip, (struct disklabel *)NULL);
sys/arch/x68k/dev/fd.c
1605
fdfinish(fd, bp);
sys/arch/x68k/dev/fd.c
1613
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/x68k/dev/fd.c
1614
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
1625
error = disk_ioctl(&fd->sc_dk, dev, cmd, addr, flag, l);
sys/arch/x68k/dev/fd.c
1655
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/arch/x68k/dev/fd.c
1656
form_parms->ncyl = fd->sc_type->cyls;
sys/arch/x68k/dev/fd.c
1657
form_parms->nspt = fd->sc_type->sectrac;
sys/arch/x68k/dev/fd.c
1658
form_parms->ntrk = fd->sc_type->heads;
sys/arch/x68k/dev/fd.c
1659
form_parms->stepspercyl = fd->sc_type->step;
sys/arch/x68k/dev/fd.c
1660
form_parms->gaplen = fd->sc_type->gap2;
sys/arch/x68k/dev/fd.c
1661
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/arch/x68k/dev/fd.c
1662
form_parms->interleave = fd->sc_type->interleave;
sys/arch/x68k/dev/fd.c
1663
switch (fd->sc_type->rate) {
sys/arch/x68k/dev/fd.c
1694
fd->sc_type->rate = FDC_500KBPS;
sys/arch/x68k/dev/fd.c
1697
fd->sc_type->rate = FDC_300KBPS;
sys/arch/x68k/dev/fd.c
1700
fd->sc_type->rate = FDC_250KBPS;
sys/arch/x68k/dev/fd.c
1710
fd->sc_type->sectrac = form_parms->nspt;
sys/arch/x68k/dev/fd.c
1713
fd->sc_type->heads = form_parms->ntrk;
sys/arch/x68k/dev/fd.c
1714
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/arch/x68k/dev/fd.c
1715
fd->sc_type->secsize = ffs(scratch)-1;
sys/arch/x68k/dev/fd.c
1716
fd->sc_type->gap2 = form_parms->gaplen;
sys/arch/x68k/dev/fd.c
1717
fd->sc_type->cyls = form_parms->ncyl;
sys/arch/x68k/dev/fd.c
1718
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/arch/x68k/dev/fd.c
1720
fd->sc_type->step = form_parms->stepspercyl;
sys/arch/x68k/dev/fd.c
1721
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/arch/x68k/dev/fd.c
1722
fd->sc_type->interleave = form_parms->interleave;
sys/arch/x68k/dev/fd.c
1733
if (form_cmd->head >= fd->sc_type->heads ||
sys/arch/x68k/dev/fd.c
1734
form_cmd->cylinder >= fd->sc_type->cyls) {
sys/arch/x68k/dev/fd.c
1742
fd_formb->transfer_rate = fd->sc_type->rate;
sys/arch/x68k/dev/fd.c
1743
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/arch/x68k/dev/fd.c
1744
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/arch/x68k/dev/fd.c
1745
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/arch/x68k/dev/fd.c
1746
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/arch/x68k/dev/fd.c
1753
j += fd->sc_type->interleave;
sys/arch/x68k/dev/fd.c
1759
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/arch/x68k/dev/fd.c
1768
*(int *)addr = fd->sc_opts;
sys/arch/x68k/dev/fd.c
1773
fd->sc_opts = *(int *)addr;
sys/arch/x68k/dev/fd.c
1789
if ((fd->sc_dk.dk_openmask & ~(1 << part)) != 0 ||
sys/arch/x68k/dev/fd.c
1790
fd->sc_dk.dk_bopenmask + fd->sc_dk.dk_copenmask !=
sys/arch/x68k/dev/fd.c
1791
fd->sc_dk.dk_openmask) {
sys/arch/x68k/dev/fd.c
1814
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/arch/x68k/dev/fd.c
1815
struct fd_type *type = fd->sc_type;
sys/arch/x68k/dev/fd.c
1910
struct fd_softc *fd = device_private(dev);
sys/arch/x68k/dev/fd.c
1911
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
263
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/arch/x68k/dev/fd.c
629
struct fd_softc *fd = device_private(self);
sys/arch/x68k/dev/fd.c
635
callout_init(&fd->sc_motoron_ch, 0);
sys/arch/x68k/dev/fd.c
637
callout_init(&fd->sc_motoroff_ch, 0);
sys/arch/x68k/dev/fd.c
639
fd->sc_dev = self;
sys/arch/x68k/dev/fd.c
640
fd->sc_flags = 0;
sys/arch/x68k/dev/fd.c
648
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/arch/x68k/dev/fd.c
649
fd->sc_cylin = -1;
sys/arch/x68k/dev/fd.c
650
fd->sc_drive = drive;
sys/arch/x68k/dev/fd.c
651
fd->sc_deftype = type;
sys/arch/x68k/dev/fd.c
652
fdc->sc_fd[drive] = fd;
sys/arch/x68k/dev/fd.c
654
fd->sc_copybuf = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK);
sys/arch/x68k/dev/fd.c
655
if (fd->sc_copybuf == 0)
sys/arch/x68k/dev/fd.c
657
fd->sc_flags |= FD_ALIVE;
sys/arch/x68k/dev/fd.c
662
disk_init(&fd->sc_dk, device_xname(fd->sc_dev), &fddkdriver);
sys/arch/x68k/dev/fd.c
663
disk_attach(&fd->sc_dk);
sys/arch/x68k/dev/fd.c
669
mountroothook_establish(fd_mountroot_hook, fd->sc_dev);
sys/arch/x68k/dev/fd.c
671
rnd_attach_source(&fd->rnd_source, device_xname(fd->sc_dev),
sys/arch/x68k/dev/fd.c
676
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/arch/x68k/dev/fd.c
688
struct fd_softc *fd;
sys/arch/x68k/dev/fd.c
694
fd = device_lookup_private(&fd_cd, unit);
sys/arch/x68k/dev/fd.c
695
if (fd == NULL) {
sys/arch/x68k/dev/fd.c
717
(fd->sc_type->size << (fd->sc_type->secsize - 2))) {
sys/arch/x68k/dev/fd.c
718
sz = (fd->sc_type->size << (fd->sc_type->secsize - 2))
sys/arch/x68k/dev/fd.c
736
(fd->sc_type->seccyl * (1 << (fd->sc_type->secsize - 2)));
sys/arch/x68k/dev/fd.c
743
bufq_put(fd->sc_q, bp);
sys/arch/x68k/dev/fd.c
744
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/arch/x68k/dev/fd.c
745
if (fd->sc_active == 0)
sys/arch/x68k/dev/fd.c
746
fdstart(fd);
sys/arch/x68k/dev/fd.c
751
fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
767
fdstart(struct fd_softc *fd)
sys/arch/x68k/dev/fd.c
769
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
773
fd->sc_active = 1;
sys/arch/x68k/dev/fd.c
774
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/x68k/dev/fd.c
782
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/arch/x68k/dev/fd.c
784
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
792
(void)bufq_get(fd->sc_q);
sys/arch/x68k/dev/fd.c
793
if (TAILQ_NEXT(fd, sc_drivechain) && ++fd->sc_ops >= 8) {
sys/arch/x68k/dev/fd.c
794
fd->sc_ops = 0;
sys/arch/x68k/dev/fd.c
795
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/x68k/dev/fd.c
796
if (bufq_peek(fd->sc_q) != NULL)
sys/arch/x68k/dev/fd.c
797
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/arch/x68k/dev/fd.c
799
fd->sc_active = 0;
sys/arch/x68k/dev/fd.c
801
bp->b_resid = fd->sc_bcount;
sys/arch/x68k/dev/fd.c
802
fd->sc_skip = 0;
sys/arch/x68k/dev/fd.c
804
rnd_add_uint32(&fd->rnd_source, bp->b_blkno);
sys/arch/x68k/dev/fd.c
808
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/arch/x68k/dev/fd.c
829
struct fd_softc *fd;
sys/arch/x68k/dev/fd.c
834
fd = fdc->sc_fd[n];
sys/arch/x68k/dev/fd.c
835
if (fd != NULL && (fd->sc_flags & FD_MOTOR) != 0)
sys/arch/x68k/dev/fd.c
837
0x80 | (fd->sc_type->rate << 4)| n);
sys/arch/x68k/dev/fd.c
844
struct fd_softc *fd = arg;
sys/arch/x68k/dev/fd.c
845
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
851
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/arch/x68k/dev/fd.c
853
(fd->sc_type->rate << 4) | fd->sc_drive);
sys/arch/x68k/dev/fd.c
864
struct fd_softc *fd = arg;
sys/arch/x68k/dev/fd.c
865
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
871
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/arch/x68k/dev/fd.c
872
if ((TAILQ_FIRST(&fdc->sc_drives) == fd) &&
sys/arch/x68k/dev/fd.c
927
struct fd_softc *fd;
sys/arch/x68k/dev/fd.c
932
fd = device_lookup_private(&fd_cd, unit);
sys/arch/x68k/dev/fd.c
933
if (fd == NULL)
sys/arch/x68k/dev/fd.c
935
type = fd_dev_to_type(fd, dev);
sys/arch/x68k/dev/fd.c
939
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/arch/x68k/dev/fd.c
940
fd->sc_type != type)
sys/arch/x68k/dev/fd.c
943
fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
944
if ((fd->sc_flags & FD_OPEN) == 0) {
sys/arch/x68k/dev/fd.c
951
fd->sc_type = type;
sys/arch/x68k/dev/fd.c
952
fd->sc_cylin = -1;
sys/arch/x68k/dev/fd.c
956
fd->sc_flags |= FD_COPEN;
sys/arch/x68k/dev/fd.c
959
fd->sc_flags |= FD_BOPEN;
sys/arch/x68k/dev/fd.c
963
fdgetdisklabel(fd, dev);
sys/arch/x68k/dev/fd.c
972
struct fd_softc *fd = device_lookup_private(&fd_cd, unit);
sys/arch/x68k/dev/fd.c
973
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/arch/x68k/dev/fd.c
979
fd->sc_flags &= ~FD_COPEN;
sys/arch/x68k/dev/fd.c
982
fd->sc_flags &= ~FD_BOPEN;
sys/arch/x68k/dev/fd.c
987
fd->sc_opts &= ~(FDOPT_NORETRY | FDOPT_SILENT);
sys/arch/x68k/dev/fd.c
989
if ((fd->sc_flags & FD_OPEN) == 0) {
sys/arch/x68k/stand/boot/boot.c
129
int fd;
sys/arch/x68k/stand/boot/boot.c
217
if ((fd = loadfile(file, marks, loadflag)) == -1) {
sys/arch/x68k/stand/boot/boot.c
221
close(fd);
sys/arch/x68k/stand/boot_ufs/readufs.c
28
int fd;
sys/arch/x68k/stand/boot_ufs/readufs.c
335
if ((fd = open(argv[1], O_RDONLY)) < 0)
sys/arch/x68k/stand/boot_ufs/readufs.c
34
if (pread(fd, buf, bytelen, (off_t)dbtob(blkpos)) != (ssize_t) bytelen)
sys/arch/x68k/stand/common/xprintf.c
222
xvfdprintf(int fd, const char *fmt, va_list ap)
sys/arch/x68k/stand/common/xprintf.c
229
ret = DOS_WRITE(fd, buf, ret);
sys/arch/x68k/stand/common/xprintf.h
17
size_t xvfdprintf(int fd, const char *fmt, va_list ap);
sys/arch/x68k/stand/installboot/installboot.c
117
int fd, part;
sys/arch/x68k/stand/installboot/installboot.c
119
fd = open(rawname, O_RDONLY | O_EXLOCK);
sys/arch/x68k/stand/installboot/installboot.c
120
if (fd < 0)
sys/arch/x68k/stand/installboot/installboot.c
127
if (ioctl(fd, DIOCGDINFO, &label) < 0)
sys/arch/x68k/stand/installboot/installboot.c
136
if (read(fd, bootblock, blocksize) != blocksize)
sys/arch/x68k/stand/installboot/installboot.c
138
close(fd);
sys/arch/x68k/stand/installboot/installboot.c
175
int fd;
sys/arch/x68k/stand/installboot/installboot.c
216
fd = open(bootprog, O_RDONLY);
sys/arch/x68k/stand/installboot/installboot.c
217
if (fd < 0)
sys/arch/x68k/stand/installboot/installboot.c
219
if (read(fd, bootblock + bboffset, bootprogsize) != bootprogsize)
sys/arch/x68k/stand/installboot/installboot.c
221
close(fd);
sys/arch/x68k/stand/installboot/installboot.c
229
fd = mkstemp(target);
sys/arch/x68k/stand/installboot/installboot.c
230
if (fd < 0)
sys/arch/x68k/stand/installboot/installboot.c
235
fd = open(target, O_WRONLY);
sys/arch/x68k/stand/installboot/installboot.c
236
if (fd < 0)
sys/arch/x68k/stand/installboot/installboot.c
238
if (merging && ioctl(fd, DIOCWLABEL, &writable) < 0)
sys/arch/x68k/stand/installboot/installboot.c
242
if (write(fd, bootblock, bootprogsize) != bootprogsize) {
sys/arch/x68k/stand/installboot/installboot.c
246
ioctl(fd, DIOCWLABEL, &writable);
sys/arch/x68k/stand/installboot/installboot.c
253
ioctl(fd, DIOCWLABEL, &writable);
sys/arch/x68k/stand/installboot/installboot.c
255
close(fd);
sys/arch/x68k/stand/loadbsd/loadbsd.c
301
int fd;
sys/arch/x68k/stand/loadbsd/loadbsd.c
310
if ((fd = DOS_OPEN(fn, 0x00)) < 0) /* read only */
sys/arch/x68k/stand/loadbsd/loadbsd.c
313
if ((int)(fcb = DOS_GET_FCB_ADR(fd)) < 0)
sys/arch/x68k/stand/loadbsd/loadbsd.c
337
if ((nread = DOS_READ(fd, buf, filesize)) != filesize) {
sys/arch/x68k/stand/loadbsd/loadbsd.c
344
if (DOS_CLOSE(fd) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
106
fd = opendisk(argv[0], O_RDONLY, dev, MAXPATHLEN, 0);
sys/arch/x68k/stand/newdisk/newdisk.c
107
if (fd < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
112
if (read(fd, buf, 512) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
123
if (ioctl(fd, DIOCGDINFO, &label) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
125
close(fd);
sys/arch/x68k/stand/newdisk/newdisk.c
147
fd = open(mboot, O_RDONLY);
sys/arch/x68k/stand/newdisk/newdisk.c
148
if (fd < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
150
if (read(fd, buf+1024, 1024) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
152
close(fd);
sys/arch/x68k/stand/newdisk/newdisk.c
173
fd = mkstemp(filename);
sys/arch/x68k/stand/newdisk/newdisk.c
174
if (fd < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
176
if (write(fd, buf, 4096) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
178
close(fd);
sys/arch/x68k/stand/newdisk/newdisk.c
185
fd = open(dev, O_WRONLY);
sys/arch/x68k/stand/newdisk/newdisk.c
186
if (fd < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
188
if (ioctl(fd, DIOCWLABEL, (char *)&mode) < 0)
sys/arch/x68k/stand/newdisk/newdisk.c
190
if (write(fd, buf, 4096) != 4096) {
sys/arch/x68k/stand/newdisk/newdisk.c
192
ioctl(fd, DIOCWLABEL, (char *)&mode);
sys/arch/x68k/stand/newdisk/newdisk.c
195
ioctl(fd, DIOCWLABEL, (char *)&mode);
sys/arch/x68k/stand/newdisk/newdisk.c
198
close(fd);
sys/arch/x68k/stand/newdisk/newdisk.c
73
int fd;
sys/arch/x68k/stand/xxboot/bootmain.c
169
int bootdev, fd;
sys/arch/x68k/stand/xxboot/bootmain.c
233
fd = loadfile("USTAR.volsize.4540", marks,
sys/arch/x68k/stand/xxboot/bootmain.c
237
fd = loadfile("x68k/boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS);
sys/arch/x68k/stand/xxboot/bootmain.c
238
if (fd < 0)
sys/arch/x68k/stand/xxboot/bootmain.c
239
fd = loadfile("boot", marks, LOAD_TEXT|LOAD_DATA|LOAD_BSS);
sys/arch/x68k/stand/xxboot/bootmain.c
241
if (fd >= 0) {
sys/arch/x68k/stand/xxboot/bootmain.c
242
close(fd);
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
196
int fd;
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
201
if ((fd = open(path, 0)) >= 0) {
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
202
if (read(fd, &voice, sizeof(voice)) != sizeof(voice))
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
204
close(fd);
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
210
if ((fd = open("/dev/bell", O_RDWR)) < 0)
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
212
if (ioctl(fd, BELLIOCSVOICE, &voice))
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
215
close(fd);
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
221
int fd;
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
224
if ((fd = open("/dev/bell", O_RDWR)) < 0)
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
226
if (ioctl(fd, BELLIOCGPARAM, &param))
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
236
if (ioctl(fd, BELLIOCSPARAM, &values))
sys/arch/x68k/usr.bin/bellctrl/bellctrl.c
239
close(fd);
sys/arch/x68k/usr.bin/loadfont/loadfont.c
39
int fd;
sys/arch/x68k/usr.bin/loadfont/loadfont.c
41
if ((fd = open(file, O_RDONLY)) >= 0) {
sys/arch/x68k/usr.bin/loadfont/loadfont.c
42
if (read (fd, buf, sizeof(buf)) == sizeof (buf)) {
sys/arch/x68k/usr.bin/loadfont/loadfont.c
51
close(fd);
sys/arch/x68k/usr.bin/loadkmap/loadkmap.c
39
int fd;
sys/arch/x68k/usr.bin/loadkmap/loadkmap.c
41
if ((fd = open(file, 0)) >= 0) {
sys/arch/x68k/usr.bin/loadkmap/loadkmap.c
42
if (read(fd, buf, sizeof(buf)) == sizeof(buf)) {
sys/arch/x68k/usr.bin/loadkmap/loadkmap.c
51
close (fd);
sys/arch/x68k/usr.bin/palette/palette.c
26
int fd;
sys/arch/x68k/usr.bin/palette/palette.c
41
if ((fd = open("/dev/grf0", O_RDWR, 0)) < 0) {
sys/arch/x68k/usr.bin/palette/palette.c
47
MAP_FILE | MAP_SHARED, fd, PALETTE_OFFSET);
sys/arch/x68k/usr.bin/palette/palette.c
50
close(fd);
sys/arch/x68k/usr.bin/palette/palette.c
53
close(fd);
sys/arch/xen/xen/xenevt.c
319
int fd, error;
sys/arch/xen/xen/xenevt.c
324
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/arch/xen/xen/xenevt.c
332
return fd_clone(fp, fd, flags, &xenevt_fileops, d);
sys/arch/zaurus/stand/zboot/diskprobe.c
150
int fd, off, len;
sys/arch/zaurus/stand/zboot/diskprobe.c
152
fd = uopen(_PATH_PARTITIONS, LINUX_O_RDONLY);
sys/arch/zaurus/stand/zboot/diskprobe.c
153
if (fd == -1)
sys/arch/zaurus/stand/zboot/diskprobe.c
156
if (ufstat(fd, &sb) < 0) {
sys/arch/zaurus/stand/zboot/diskprobe.c
157
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
164
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
170
len = uread(fd, bc + off, 1024);
sys/arch/zaurus/stand/zboot/diskprobe.c
177
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
374
int fd;
sys/arch/zaurus/stand/zboot/diskprobe.c
384
if ((fd = uopen(path, LINUX_O_RDONLY)) == -1 && errno == ENXIO) {
sys/arch/zaurus/stand/zboot/diskprobe.c
385
while (fd == -1 && timeout > 0) {
sys/arch/zaurus/stand/zboot/diskprobe.c
388
fd = uopen(path, LINUX_O_RDONLY);
sys/arch/zaurus/stand/zboot/diskprobe.c
390
if (fd != -1)
sys/arch/zaurus/stand/zboot/diskprobe.c
393
if (fd == -1)
sys/arch/zaurus/stand/zboot/diskprobe.c
397
if (unixstrategy((void *)fd, F_READ, MBR_BBSECTOR, DEV_BSIZE, buf,
sys/arch/zaurus/stand/zboot/diskprobe.c
399
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
411
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
415
uclose(fd);
sys/arch/zaurus/stand/zboot/diskprobe.c
426
int fd;
sys/arch/zaurus/stand/zboot/diskprobe.c
436
if ((fd = uopen(path, LINUX_O_RDONLY)) != -1) {
sys/arch/zaurus/stand/zboot/diskprobe.c
439
if (unixstrategy((void *)fd, F_READ, LABELSECTOR,
sys/arch/zaurus/stand/zboot/diskprobe.c
442
uclose(fd);
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
101
zboot_exec(int fd, u_long *marks, int flags)
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
147
if (lseek(fd, 0, SEEK_SET) != 0) {
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
152
while ((sz = read(fd, buf, sizeof(buf))) == sizeof(buf)) {
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
41
static int fdloadfile_zboot(int fd, u_long *marks, int flags);
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
42
static int zboot_exec(int fd, u_long *marks, int flags);
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
47
int fd, error;
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
50
if ((fd = open(fname, 0)) < 0) {
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
56
if ((error = fdloadfile_zboot(fd, marks, flags)) != 0) {
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
57
(void)close(fd);
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
62
return fd;
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
66
fdloadfile_zboot(int fd, u_long *marks, int flags)
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
73
if (lseek(fd, 0, SEEK_SET) == (off_t)-1)
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
75
nr = read(fd, &elf32, sizeof(elf32));
sys/arch/zaurus/stand/zboot/loadfile_zboot.c
88
rval = zboot_exec(fd, marks, flags);
sys/arch/zaurus/stand/zboot/pathfs.c
34
pathfs_open(const char *path, struct open_file *fd)
sys/arch/zaurus/stand/zboot/pathfs.c
37
if (strcmp(fd->f_dev->dv_name, "path"))
sys/arch/zaurus/stand/zboot/pathfs.c
40
(void) ulseek((int)fd->f_devdata, 0L, SEEK_SET);
sys/arch/zaurus/stand/zboot/pathfs.c
45
pathfs_read(struct open_file *fd, void *vbuf, size_t nbyte, size_t *resid)
sys/arch/zaurus/stand/zboot/pathfs.c
52
rsz = uread((int)fd->f_devdata, buf + off, nbyte - off);
sys/arch/zaurus/stand/zboot/pathfs.c
65
pathfs_write(struct open_file *fd, void *vbuf, size_t size, size_t *resid)
sys/arch/zaurus/stand/zboot/pathfs.c
72
pathfs_seek(struct open_file *fd, off_t offset, int whence)
sys/arch/zaurus/stand/zboot/pathfs.c
75
return ulseek((int)fd->f_devdata, offset, whence);
sys/arch/zaurus/stand/zboot/pathfs.c
79
pathfs_close(struct open_file *fd)
sys/arch/zaurus/stand/zboot/pathfs.c
86
pathfs_stat(struct open_file *fd, struct stat *sb)
sys/arch/zaurus/stand/zboot/pathfs.c
91
rv = ufstat((int)fd->f_devdata, &lsb);
sys/arch/zaurus/stand/zboot/termios.c
105
return uioctl(fd, action, t);
sys/arch/zaurus/stand/zboot/termios.c
84
linux_tcgetattr(int fd, struct linux_termios *t)
sys/arch/zaurus/stand/zboot/termios.c
87
return uioctl(fd, LINUX_TCGETS, t);
sys/arch/zaurus/stand/zboot/termios.c
92
linux_tcsetattr(int fd, int action, struct linux_termios *t)
sys/arch/zaurus/stand/zboot/unixcons.c
118
common_putc(int fd, int c)
sys/arch/zaurus/stand/zboot/unixcons.c
121
(void)uwrite(fd, &c, 1);
sys/arch/zaurus/stand/zboot/unixcons.c
125
common_getc(int fd, int timo)
sys/arch/zaurus/stand/zboot/unixcons.c
138
FD_SET(fd, &fdset);
sys/arch/zaurus/stand/zboot/unixcons.c
146
for (fd = 0; fd < nfds; fd++) {
sys/arch/zaurus/stand/zboot/unixcons.c
147
if (FD_ISSET(fd, &fdset)) {
sys/arch/zaurus/stand/zboot/unixcons.c
148
return (uread(fd, &c, 1) < 1 ? -1 : c);
sys/arch/zaurus/stand/zboot/unixcons.c
45
static void common_putc(int fd, int c);
sys/arch/zaurus/stand/zboot/unixcons.c
46
static int common_getc(int fd, int timo);
sys/arch/zaurus/stand/zboot/unixcons.c
52
int fd;
sys/arch/zaurus/stand/zboot/unixcons.c
80
fd = uopen(comdevname[iodev - CONSDEV_COM0], LINUX_O_RDWR);
sys/arch/zaurus/stand/zboot/unixcons.c
81
if (fd < 0)
sys/arch/zaurus/stand/zboot/unixcons.c
83
infd = outfd = fd;
sys/arch/zaurus/stand/zboot/unixcons.c
86
linux_tcgetattr(fd, &termios);
sys/arch/zaurus/stand/zboot/unixcons.c
92
if (linux_tcsetattr(fd, LINUX_TCSETS, &termios) < 0)
sys/arch/zaurus/stand/zboot/unixdev.c
190
ulseek(int fd, off_t off, int wh)
sys/arch/zaurus/stand/zboot/unixdev.c
198
if (ulseek32(fd, 0, SEEK_SET) != 0)
sys/arch/zaurus/stand/zboot/unixdev.c
202
if (ulseek32(fd, OFFT_OFFSET_MAX, SEEK_CUR) < 0 &&
sys/arch/zaurus/stand/zboot/unixdev.c
206
r = ulseek32(fd, (long)off, SEEK_CUR);
sys/arch/zaurus/stand/zboot/unixdev.c
210
r = ulseek32(fd, (long)off, wh);
sys/arch/zaurus/stand/zboot/unixdev.c
47
int fd = (int)devdata;
sys/arch/zaurus/stand/zboot/unixdev.c
56
if ((rc = ulseek(fd, off, SEEK_SET)) >= 0)
sys/arch/zaurus/stand/zboot/unixdev.c
57
rc = (rw == F_READ) ? uread(fd, buf, size) :
sys/arch/zaurus/stand/zboot/unixdev.c
58
uwrite(fd, buf, size);
sys/coda/coda.h
706
int fd;
sys/coda/coda.h
846
int fd; /* Opened device */
sys/compat/aoutm68k/aoutm68k_stat.c
142
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/aoutm68k/aoutm68k_stat.c
191
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/aoutm68k/aoutm68k_stat.c
92
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/aoutm68k/aoutm68k_syscallargs.h
179
syscallarg(int) fd;
sys/compat/aoutm68k/aoutm68k_syscallargs.h
445
syscallarg(int) fd;
sys/compat/aoutm68k/aoutm68k_syscallargs.h
577
syscallarg(int) fd;
sys/compat/common/kern_event_100.c
70
return kevent1(retval, SCARG(uap, fd),
sys/compat/common/kern_select_50.c
93
return kevent1(retval, SCARG(uap, fd),
sys/compat/common/vfs_syscalls_12.c
137
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/common/vfs_syscalls_12.c
257
fd_putfile(SCARG(uap, fd));
sys/compat/common/vfs_syscalls_12.c
328
error = do_sys_fstat(SCARG(uap, fd), &ub);
sys/compat/common/vfs_syscalls_20.c
129
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/common/vfs_syscalls_20.c
137
fd_putfile(SCARG(uap, fd));
sys/compat/common/vfs_syscalls_30.c
189
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/common/vfs_syscalls_30.c
225
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/common/vfs_syscalls_30.c
329
fd_putfile(SCARG(uap, fd));
sys/compat/common/vfs_syscalls_43.c
210
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/common/vfs_syscalls_43.c
231
syscallarg(int) fd;
sys/compat/common/vfs_syscalls_43.c
236
SCARG(&nuap, fd) = SCARG(uap, fd);
sys/compat/common/vfs_syscalls_43.c
276
syscallarg(int) fd;
sys/compat/common/vfs_syscalls_43.c
284
SCARG(&nuap, fd) = SCARG(uap, fd);
sys/compat/common/vfs_syscalls_43.c
355
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/common/vfs_syscalls_43.c
475
fd_putfile(SCARG(uap, fd));
sys/compat/common/vfs_syscalls_50.c
174
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/common/vfs_syscalls_50.c
253
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/common/vfs_syscalls_50.c
257
fd_putfile(SCARG(uap, fd));
sys/compat/common/vfs_syscalls_90.c
118
int error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
sys/compat/common/vm_43.c
101
syscallarg(int) fd;
sys/compat/common/vm_43.c
147
SCARG(&nargs, fd) = SCARG(uap, fd);
sys/compat/freebsd/freebsd_ioctl.c
103
SCARG(nap, fd) = SCARG(uap, fd);
sys/compat/freebsd/freebsd_ioctl.c
69
SCARG(rap, fd) = SCARG(uap, fd);
sys/compat/freebsd/freebsd_misc.c
110
if ((fd != -1)
sys/compat/freebsd/freebsd_misc.c
124
SCARG(&bma, fd) = fd;
sys/compat/freebsd/freebsd_misc.c
93
int flags, prot, fd;
sys/compat/freebsd/freebsd_misc.c
98
fd = SCARG(uap, fd);
sys/compat/freebsd/freebsd_syscallargs.h
137
syscallarg(int) fd;
sys/compat/freebsd/freebsd_syscallargs.h
409
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_machdep.h
94
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
1027
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
103
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
1097
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
1137
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
1159
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
122
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
143
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
167
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
179
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
186
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
192
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
201
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
211
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
237
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
249
syscallarg(unsigned int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
255
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
263
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
278
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
285
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
296
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
312
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
329
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
337
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
345
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
354
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
383
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
391
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
399
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
404
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
418
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
426
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
432
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
56
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
81
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_syscallargs.h
992
syscallarg(int) fd;
sys/compat/linux/arch/aarch64/linux_systrace_args.c
124
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
157
iarg[2] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1587
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1645
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1653
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
176
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1782
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1839
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
1867
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
192
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
208
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
217
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
225
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
234
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
242
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
252
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
261
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
271
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
308
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
324
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
332
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
342
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
358
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
372
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
380
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
389
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
40
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
400
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
409
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
419
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
434
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
443
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
452
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
461
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
470
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
479
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
488
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
498
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
508
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
519
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
552
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
562
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
572
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
585
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
592
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
599
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
617
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
627
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
635
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
71
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/aarch64/linux_systrace_args.c
99
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/alpha/linux_machdep.c
493
SCARG(&bia, fd) = SCARG(uap, fd);
sys/compat/linux/arch/alpha/linux_osf1.c
554
if ((error = fd_getvnode(SCARG(uap, fd), &fp)))
sys/compat/linux/arch/alpha/linux_osf1.c
565
fd_putfile(SCARG(uap, fd));
sys/compat/linux/arch/alpha/linux_pipe.c
65
int fd[2], error;
sys/compat/linux/arch/alpha/linux_pipe.c
67
if ((error = pipe1(l, fd, 0)))
sys/compat/linux/arch/alpha/linux_pipe.c
70
retval[0] = fd[0];
sys/compat/linux/arch/alpha/linux_pipe.c
71
(l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1];
sys/compat/linux/arch/alpha/linux_pipe.c
83
int fd[2], error, flags;
sys/compat/linux/arch/alpha/linux_pipe.c
89
if ((error = pipe1(l, fd, flags)))
sys/compat/linux/arch/alpha/linux_pipe.c
92
retval[0] = fd[0];
sys/compat/linux/arch/alpha/linux_pipe.c
93
(l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1];
sys/compat/linux/arch/alpha/linux_syscallargs.h
1071
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1130
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1137
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1143
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1153
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1161
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1170
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1178
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1200
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1207
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1236
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1260
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1282
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1296
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1304
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1339
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1348
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1365
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1405
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
1427
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
146
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
205
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
211
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
453
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
549
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
559
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
638
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
716
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
724
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
820
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
827
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
858
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
883
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
905
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
924
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
966
syscallarg(int) fd;
sys/compat/linux/arch/alpha/linux_syscallargs.h
985
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1020
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1027
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1033
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1043
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
105
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1051
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1060
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1068
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1090
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1097
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
112
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1126
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1134
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1162
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1170
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1178
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
120
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1221
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1230
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1256
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1303
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
1325
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
362
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
373
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
384
syscallarg(unsigned int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
390
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
57
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
590
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
721
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
746
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
771
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
793
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
812
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
858
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
878
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_syscallargs.h
952
syscallarg(int) fd;
sys/compat/linux/arch/amd64/linux_systrace_args.c
1121
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1348
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1379
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1410
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1438
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1463
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1523
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1549
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
155
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
164
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1653
iarg[2] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
174
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1750
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1759
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1767
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1777
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1786
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1796
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
18
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1807
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1817
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
184
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1848
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1856
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1866
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1875
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1923
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
193
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1933
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1969
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1979
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
1989
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
2046
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
2057
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
2089
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
2155
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
2183
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
27
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
300
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
45
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
60
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
645
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
654
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
662
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
669
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
684
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
692
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
716
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
794
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
811
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
85
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/amd64/linux_systrace_args.c
98
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_machdep.c
280
SCARG(&bia, fd) = SCARG(uap, fd);
sys/compat/linux/arch/arm/linux_syscallargs.h
1009
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1025
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1094
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1101
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1107
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1117
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1125
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1134
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1142
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1164
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1171
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1200
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1224
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1243
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1251
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1259
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1294
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1303
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1337
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1381
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
1403
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
175
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
182
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
310
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
330
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
353
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
381
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
479
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
488
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
514
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
655
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
663
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
701
syscallarg(unsigned int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
719
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
775
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
786
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
793
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
818
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
843
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
865
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
884
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_syscallargs.h
932
syscallarg(int) fd;
sys/compat/linux/arch/arm/linux_systrace_args.c
1150
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1160
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1213
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1229
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1253
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1322
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1404
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1431
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1445
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1476
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
150
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1507
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1535
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1560
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1622
iarg[2] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1731
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1757
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1849
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1858
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1866
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1876
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1885
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1895
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1906
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1916
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1947
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1955
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1965
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
1974
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2022
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2052
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2077
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2087
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2097
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2144
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2155
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2197
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2258
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
2286
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
264
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
329
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
338
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
35
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
44
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
575
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
607
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
615
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
62
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
623
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
667
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
716
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
766
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
831
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
859
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
870
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
890
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
907
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
916
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/arm/linux_systrace_args.c
932
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_machdep.c
788
int fd;
sys/compat/linux/arch/i386/linux_machdep.c
797
fd = SCARG(uap, fd);
sys/compat/linux/arch/i386/linux_machdep.c
798
SCARG(&bia, fd) = fd;
sys/compat/linux/arch/i386/linux_machdep.c
802
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/linux/arch/i386/linux_machdep.c
985
fd_putfile(fd);
sys/compat/linux/arch/i386/linux_syscallargs.h
1056
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1072
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1133
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1140
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1146
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1156
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1164
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1173
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1181
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1203
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1210
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1239
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1263
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1282
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1290
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1298
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1333
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1342
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1359
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1391
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
1413
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
180
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
187
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
315
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
335
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
358
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
393
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
497
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
506
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
532
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
678
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
686
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
724
syscallarg(unsigned int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
742
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
808
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
815
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
822
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
847
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
872
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
894
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
913
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
959
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_syscallargs.h
979
syscallarg(int) fd;
sys/compat/linux/arch/i386/linux_systrace_args.c
1189
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1199
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1252
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1268
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1292
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1361
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1461
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1470
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1484
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1515
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1546
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
157
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1574
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1599
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1659
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1685
iarg[2] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1794
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1820
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1902
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1911
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1919
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1929
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1938
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1948
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1959
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
1969
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2000
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2008
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2018
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2027
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2075
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2105
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2130
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2140
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2150
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2197
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2208
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2229
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2276
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
2304
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
271
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
336
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
345
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
35
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
44
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
582
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
614
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
62
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
622
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
630
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
674
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
732
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
789
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
863
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
891
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
902
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
922
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
939
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
948
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/i386/linux_systrace_args.c
964
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux/arch/m68k/linux_machdep.c
897
SCARG(&bia, fd) = SCARG(uap, fd);
sys/compat/linux/arch/m68k/linux_syscallargs.h
1003
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1019
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1071
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1078
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1084
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1094
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1102
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1111
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1119
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1141
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1148
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1177
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1215
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1234
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1242
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1250
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1285
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1294
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1311
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1362
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
1384
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
178
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
185
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
314
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
337
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
360
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
388
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
478
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
487
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
513
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
654
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
662
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
700
syscallarg(unsigned int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
718
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
780
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
811
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
836
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
858
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
877
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
897
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
904
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
911
syscallarg(int) fd;
sys/compat/linux/arch/m68k/linux_syscallargs.h
926
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1007
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1132
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1139
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1145
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1155
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1163
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1172
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1180
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1202
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1209
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1234
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1262
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1275
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1289
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1295
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1332
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1341
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1375
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
1415
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
170
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
177
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
276
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
309
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
344
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
442
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
451
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
492
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
758
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
766
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
792
syscallarg(unsigned int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
810
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
820
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
827
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
834
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
859
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
884
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
906
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
925
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
973
syscallarg(int) fd;
sys/compat/linux/arch/mips/linux_syscallargs.h
992
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_machdep.c
476
SCARG(&bia, fd) = SCARG(uap, fd);
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1019
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1026
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1050
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1060
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1068
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1077
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1085
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1107
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1114
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1141
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1160
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1168
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1176
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1184
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1219
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1228
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1262
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1296
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
1318
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
170
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
177
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
293
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
328
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
356
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
454
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
463
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
489
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
635
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
643
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
667
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
683
syscallarg(unsigned int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
701
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
707
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
714
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
749
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
774
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
796
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
815
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
850
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
870
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
951
syscallarg(int) fd;
sys/compat/linux/arch/powerpc/linux_syscallargs.h
958
syscallarg(int) fd;
sys/compat/linux/common/linux_blkio.c
121
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_blkio.c
74
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_cdrom.c
145
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_cdrom.c
440
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_fadvise64.c
74
return do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
sys/compat/linux/common/linux_fadvise64_64.c
74
return do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
sys/compat/linux/common/linux_fcntl.h
182
#define do_linux_getlk(fd, cmd, arg, LINUX, FLOCK) do { \
sys/compat/linux/common/linux_fcntl.h
189
fl_error = do_fcntl_lock(fd, F_GETLK, &bfl); \
sys/compat/linux/common/linux_fcntl.h
196
#define do_linux_setlk(fd, cmd, arg, LINUX, FLOCK, setlk) do { \
sys/compat/linux/common/linux_fcntl.h
203
return do_fcntl_lock(fd, cmd == setlk ? F_SETLK : F_SETLKW, &bfl); \
sys/compat/linux/common/linux_fcntl64.c
70
do_linux_getlk(SCARG(uap, fd), cmd, SCARG(uap, arg),
sys/compat/linux/common/linux_fcntl64.c
74
do_linux_setlk(SCARG(uap, fd), cmd, SCARG(uap, arg),
sys/compat/linux/common/linux_fdio.c
169
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_fdio.c
80
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_file.c
1015
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
195
linux_open_ctty(struct lwp *l, int flags, int fd)
sys/compat/linux/common/linux_file.c
208
fp = fd_getfile(fd);
sys/compat/linux/common/linux_file.c
215
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
266
SCARG(&boa, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
294
int fd, cmd, error;
sys/compat/linux/common/linux_file.c
305
fd = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
324
SCARG(&fca, fd) = fd;
sys/compat/linux/common/linux_file.c
353
if (((fp1 = fd_getfile(fd)) == NULL))
sys/compat/linux/common/linux_file.c
361
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
366
SCARG(&fca, fd) = fd;
sys/compat/linux/common/linux_file.c
379
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
386
do_linux_getlk(fd, cmd, arg, linux, flock);
sys/compat/linux/common/linux_file.c
390
do_linux_setlk(fd, cmd, arg, linux, flock, LINUX_F_SETLK);
sys/compat/linux/common/linux_file.c
400
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/linux/common/linux_file.c
407
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
419
fd_putfile(fd);
sys/compat/linux/common/linux_file.c
469
SCARG(&fca, fd) = fd;
sys/compat/linux/common/linux_file.c
529
error = do_sys_fstat(SCARG(uap, fd), &tmpst);
sys/compat/linux/common/linux_file.c
668
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
690
SCARG(&ua, fd) = LINUX_AT_FDCWD;
sys/compat/linux/common/linux_file.c
715
SCARG(&bma, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
728
return do_sys_mknodat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file.c
743
return do_sys_chmodat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file.c
761
return do_sys_chownat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file.c
775
return do_sys_accessat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file.c
811
SCARG(&pra, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
835
SCARG(&pra, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
860
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
885
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
942
int fd = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
945
return do_sys_accessat(l, fd, path, mode, flag);
sys/compat/linux/common/linux_file.c
966
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
992
int error, fd;
sys/compat/linux/common/linux_file.c
993
fd = SCARG(uap, fd);
sys/compat/linux/common/linux_file.c
996
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/compat/linux/common/linux_file64.c
193
error = do_sys_fstat(SCARG(uap, fd), &tmpst);
sys/compat/linux/common/linux_file64.c
248
linux_statat(struct lwp *l, int fd, const char *path, int lflag,
sys/compat/linux/common/linux_file64.c
267
if (fd == LINUX_AT_FDCWD) {
sys/compat/linux/common/linux_file64.c
279
error = do_sys_fstat(fd, st);
sys/compat/linux/common/linux_file64.c
290
return do_sys_statat(l, fd, path, nd_flag, st);
sys/compat/linux/common/linux_file64.c
306
error = linux_statat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file64.c
332
error = linux_statat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_file64.c
373
SCARG(&ta, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_file64.c
420
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/linux/common/linux_file64.c
535
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_hdio.c
166
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_hdio.c
80
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_inotify.c
276
int error, fd;
sys/compat/linux/common/linux_inotify.c
303
error = fd_allocfile(&fp, &fd);
sys/compat/linux/common/linux_inotify.c
313
fd_set_exclose(l, fd, (flags & LINUX_IN_CLOEXEC) != 0);
sys/compat/linux/common/linux_inotify.c
314
fd_affix(p, fp, fd);
sys/compat/linux/common/linux_inotify.c
316
*retval = fd;
sys/compat/linux/common/linux_inotify.c
437
const int fd = SCARG(uap, fd);
sys/compat/linux/common/linux_inotify.c
443
fp = fd_getfile(fd);
sys/compat/linux/common/linux_inotify.c
608
fd_putfile(fd);
sys/compat/linux/common/linux_inotify.c
670
const int fd = SCARG(uap, fd);
sys/compat/linux/common/linux_inotify.c
673
fp = fd_getfile(fd);
sys/compat/linux/common/linux_inotify.c
691
fd_putfile(fd);
sys/compat/linux/common/linux_ioctl.c
125
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_ioctl.c
157
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_ioctl.c
162
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_ioctl.c
181
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_ioctl.c
187
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_ioctl.c
97
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_llseek.c
73
SCARG(&bla, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_misc.c
1615
linux_do_sys_utimensat(struct lwp *l, int fd, const char *path, struct timespec *tsp, int flags, register_t *retval)
sys/compat/linux/common/linux_misc.c
1621
if (path == NULL && fd != AT_FDCWD) {
sys/compat/linux/common/linux_misc.c
1625
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/compat/linux/common/linux_misc.c
1629
fd_putfile(fd);
sys/compat/linux/common/linux_misc.c
1633
return do_sys_utimensat(l, fd, NULL, path, follow, tsp, UIO_SYSSPACE);
sys/compat/linux/common/linux_misc.c
1659
return linux_do_sys_utimensat(l, SCARG(uap, fd), SCARG(uap, path),
sys/compat/linux/common/linux_misc.c
1854
SCARG(uap, fd), eep);
sys/compat/linux/common/linux_misc.c
2080
unsigned int fd, last;
sys/compat/linux/common/linux_misc.c
2098
for (fd = SCARG(uap, first); fd <= last; fd++) {
sys/compat/linux/common/linux_misc.c
2099
fp = fd_getfile(fd);
sys/compat/linux/common/linux_misc.c
2104
fd_set_exclose(l, fd, true);
sys/compat/linux/common/linux_misc.c
2105
fd_putfile(fd);
sys/compat/linux/common/linux_misc.c
2107
fd_close(fd);
sys/compat/linux/common/linux_misc.c
2128
const int fd = SCARG(uap, fd);
sys/compat/linux/common/linux_misc.c
2130
fp = fd_getfile(fd);
sys/compat/linux/common/linux_misc.c
2137
fd_putfile(fd);
sys/compat/linux/common/linux_misc.c
2141
return do_posix_fadvise(fd, SCARG(uap, offset), SCARG(uap, count),
sys/compat/linux/common/linux_misc.c
417
error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
sys/compat/linux/common/linux_misc.c
567
SCARG(cma, fd) = flags & MAP_ANON ? -1 : SCARG(uap, fd);
sys/compat/linux/common/linux_misc.c
780
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/linux/common/linux_misc.c
921
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_misc_notalpha.c
167
SCARG(&da, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_misc_notalpha.c
383
error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
sys/compat/linux/common/linux_mmap.h
86
syscallarg(int) fd;
sys/compat/linux/common/linux_mtio.c
126
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_mtio.c
85
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_oldmmap.c
98
SCARG(&nlmap,fd) = lmap.lm_fd;
sys/compat/linux/common/linux_pipe.c
68
int fd[2], error;
sys/compat/linux/common/linux_pipe.c
70
if ((error = pipe1(l, fd, 0)))
sys/compat/linux/common/linux_pipe.c
73
if ((error = copyout(fd, SCARG(uap, pfds), sizeof(fd))) != 0)
sys/compat/linux/common/linux_pipe.c
88
int fd[2], error, flags;
sys/compat/linux/common/linux_pipe.c
94
if ((error = pipe1(l, fd, flags)))
sys/compat/linux/common/linux_pipe.c
97
if ((error = copyout(fd, SCARG(uap, pfds), sizeof(fd))) != 0)
sys/compat/linux/common/linux_sg.c
213
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_sg.c
82
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_socket.c
1274
linux_getifhwaddr(struct lwp *l, register_t *retval, u_int fd,
sys/compat/linux/common/linux_socket.c
1298
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/linux/common/linux_socket.c
1395
fd_putfile(fd);
sys/compat/linux/common/linux_socket.c
1415
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_socket.c
1487
error = linux_getifhwaddr(l, retval, SCARG(uap, fd),
sys/compat/linux/common/linux_socket.c
1496
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_socket.c
1499
SCARG(&ia, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_socket.c
1820
int fd = (int)*retval;
sys/compat/linux/common/linux_socket.c
1821
if (fd_getfile(fd) != NULL)
sys/compat/linux/common/linux_socket.c
1822
(void)fd_close(fd);
sys/compat/linux/common/linux_termios.c
351
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_termios.c
379
SCARG(&ia, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_termios.c
383
fd_putfile(SCARG(uap, fd));
sys/compat/linux/common/linux_termios.c
86
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux/common/linux_time.c
495
error = do_timerfd_gettime(l, SCARG(uap, fd), &its, retval);
sys/compat/linux/common/linux_time.c
556
error = do_timerfd_settime(l, SCARG(uap, fd), nflags,
sys/compat/linux/common/linux_time.c
579
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux/common/linux_uid16.c
82
SCARG(&bfa, fd) = SCARG(uap, fd);
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1026
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1041
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1049
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1057
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1076
syscallarg(netbsd32_intp) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1082
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1091
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
1110
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
150
syscallarg(netbsd32_intp) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
175
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
182
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
283
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
303
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
326
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
354
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
439
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
448
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
474
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
615
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
623
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
650
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
663
syscallarg(unsigned int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
682
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
744
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
881
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
897
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
933
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
943
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
951
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
960
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
968
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
990
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_syscallargs.h
997
syscallarg(int) fd;
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1105
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1115
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1159
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1176
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1201
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1270
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1352
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1381
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1417
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1448
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1476
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
150
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1501
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1645
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1671
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1813
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1823
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1832
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1842
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1853
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1863
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1894
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1902
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1912
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1921
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1969
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
1994
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2004
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2014
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2039
uarg[0] = (intptr_t) SCARG(p, fd).i32; /* netbsd32_intp */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2047
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2058
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
2088
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
264
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
271
uarg[0] = (intptr_t) SCARG(p, fd).i32; /* netbsd32_intp */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
329
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
338
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
35
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
44
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
540
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
572
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
580
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
588
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
62
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
632
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
681
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
731
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
787
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
815
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
826
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
846
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
863
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
872
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/aarch64/linux32_systrace_args.c
888
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_missing.h
48
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_missing.h
53
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1006
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1035
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1050
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1058
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1066
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1085
syscallarg(netbsd32_intp) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1091
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
1100
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
155
syscallarg(netbsd32_intp) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
180
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
187
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
288
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
308
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
331
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
361
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
455
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
464
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
490
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
631
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
639
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
666
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
679
syscallarg(unsigned int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
698
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
764
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
839
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
916
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
932
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
942
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
952
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
960
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
969
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
977
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_syscallargs.h
999
syscallarg(int) fd;
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1137
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1147
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1191
iarg[4] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1208
uarg[0] = SCARG(p, fd); /* unsigned int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1233
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1302
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1402
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1413
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1449
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1480
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1508
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1533
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
157
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1593
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1702
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1728
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1740
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1750
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1759
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1769
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1780
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1790
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1821
iarg[1] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1829
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1839
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1848
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1896
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1921
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1931
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1941
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1966
uarg[0] = (intptr_t) SCARG(p, fd).i32; /* netbsd32_intp */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1974
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
1985
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
271
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
278
uarg[0] = (intptr_t) SCARG(p, fd).i32; /* netbsd32_intp */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
336
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
345
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
35
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
44
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
547
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
579
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
587
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
595
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
62
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
639
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
697
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
754
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
819
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
847
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
858
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
878
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
895
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
904
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/arch/amd64/linux32_systrace_args.c
920
iarg[0] = SCARG(p, fd); /* int */
sys/compat/linux32/common/linux32_dirent.c
119
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/linux32/common/linux32_dirent.c
259
fd_putfile(SCARG(uap, fd));
sys/compat/linux32/common/linux32_dirent.c
273
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_dirent.c
291
SCARG(&da, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_fcntl.c
126
do_linux_getlk(SCARG(uap, fd), cmd, SCARG_P32(uap, arg),
sys/compat/linux32/common/linux32_fcntl.c
130
do_linux_setlk(SCARG(uap, fd), cmd, SCARG_P32(uap, arg),
sys/compat/linux32/common/linux32_fcntl.c
133
do_linux_getlk(SCARG(uap, fd), cmd, SCARG_P32(uap, arg),
sys/compat/linux32/common/linux32_fcntl.c
137
do_linux_setlk(SCARG(uap, fd), cmd, SCARG_P32(uap, arg),
sys/compat/linux32/common/linux32_fcntl.c
143
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_fcntl.c
164
return do_posix_fadvise(SCARG(uap, fd), off,
sys/compat/linux32/common/linux32_fcntl.c
184
return do_posix_fadvise(SCARG(uap, fd), off,
sys/compat/linux32/common/linux32_ioctl.c
101
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_ioctl.c
108
fd_putfile(SCARG(uap, fd));
sys/compat/linux32/common/linux32_ioctl.c
114
SCARG(&ossuap, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_ioctl.c
141
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_ioctl.c
80
printf("linux32_sys_ioctl(%d, 0x%x/\'%c\', %p)\n", SCARG(uap, fd),
sys/compat/linux32/common/linux32_ioctl.c
96
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux32/common/linux32_misc.c
108
error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
sys/compat/linux32/common/linux32_misc.c
152
error = do_sys_fstatvfs(l, SCARG(uap, fd), ST_WAIT, sb);
sys/compat/linux32/common/linux32_misc.c
299
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_misc.c
404
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_misc.c
426
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_mman.c
139
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_socket.c
505
linux32_getifhwaddr(struct lwp *l, register_t *retval, u_int fd,
sys/compat/linux32/common/linux32_socket.c
528
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/linux32/common/linux32_socket.c
622
fd_putfile(fd);
sys/compat/linux32/common/linux32_socket.c
642
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux32/common/linux32_socket.c
714
error = linux32_getifhwaddr(l, retval, SCARG(uap, fd),
sys/compat/linux32/common/linux32_socket.c
723
fd_putfile(SCARG(uap, fd));
sys/compat/linux32/common/linux32_socket.c
726
SCARG(&ia, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_stat.c
190
error = do_sys_fstat(SCARG(uap, fd), &st);
sys/compat/linux32/common/linux32_stat.c
247
error = do_sys_fstat(SCARG(uap, fd), &st);
sys/compat/linux32/common/linux32_stat.c
269
error = linux_statat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_stat.c
295
error = linux_statat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_termios.c
360
fd_putfile(SCARG(uap, fd));
sys/compat/linux32/common/linux32_termios.c
388
SCARG(&ia, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_termios.c
392
fd_putfile(SCARG(uap, fd));
sys/compat/linux32/common/linux32_termios.c
94
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/linux32/common/linux32_time.c
519
error = do_timerfd_gettime(l, SCARG(uap, fd), &its, retval);
sys/compat/linux32/common/linux32_time.c
559
error = do_timerfd_settime(l, SCARG(uap, fd), nflags,
sys/compat/linux32/common/linux32_uid16.c
109
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_unistd.c
106
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_unistd.c
318
if ((error = copyout(f, SCARG_P32(uap, fd), sizeof(f))) != 0)
sys/compat/linux32/common/linux32_unistd.c
340
if ((error = copyout(f, SCARG_P32(uap, fd), sizeof(f))) != 0)
sys/compat/linux32/common/linux32_unistd.c
376
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_unistd.c
395
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_unistd.c
447
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_unistd.c
463
return do_sys_chmodat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_unistd.c
480
return do_sys_chownat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_unistd.c
493
return do_sys_accessat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_unistd.c
519
return linux_do_sys_utimensat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/linux32/common/linux32_unistd.c
739
NETBSD32TO64_UAP(fd);
sys/compat/linux32/common/linux32_unistd.c
785
SCARG(&pra, fd) = SCARG(uap, fd);
sys/compat/linux32/common/linux32_unistd.c
809
SCARG(&pra, fd) = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_compat_100.c
127
return netbsd32_kevent1(retval, SCARG(uap, fd),
sys/compat/netbsd32/netbsd32_compat_12.c
164
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/netbsd32/netbsd32_compat_12.c
207
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_compat_20.c
195
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_compat_20.c
205
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_compat_30.c
100
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_compat_30.c
137
error = do_sys_fstat(SCARG(uap, fd), &ub);
sys/compat/netbsd32/netbsd32_compat_30.c
83
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_compat_43.c
128
SCARG(&ua, fd) = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_compat_43.c
184
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/compat/netbsd32/netbsd32_compat_43.c
215
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_compat_43.c
231
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_compat_43.c
361
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_compat_50.c
308
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_compat_50.c
313
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_compat_50.c
614
return netbsd32_kevent1(retval, SCARG(uap, fd),
sys/compat/netbsd32/netbsd32_compat_50.c
723
error = do_sys_fstat(SCARG(uap, fd), &ub);
sys/compat/netbsd32/netbsd32_compat_90.c
111
error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
sys/compat/netbsd32/netbsd32_epoll.c
84
SCARG(uap, fd), eep);
sys/compat/netbsd32/netbsd32_event.c
106
error = kevent1(retval, fd, NETBSD32PTR64(changelist), nchanges,
sys/compat/netbsd32/netbsd32_event.c
131
return netbsd32_kevent1(retval, SCARG(uap, fd),
sys/compat/netbsd32/netbsd32_event.c
95
netbsd32_kevent1(register_t *retval, int fd,
sys/compat/netbsd32/netbsd32_execve.c
89
return execve1(l, false, NULL, SCARG(uap, fd), SCARG_P32(uap, argp),
sys/compat/netbsd32/netbsd32_fd.c
120
int fd[2], error;
sys/compat/netbsd32/netbsd32_fd.c
122
error = pipe1(l, fd, SCARG(uap, flags));
sys/compat/netbsd32/netbsd32_fd.c
126
error = copyout(fd, SCARG_P32(uap, fildes), sizeof(fd));
sys/compat/netbsd32/netbsd32_fs.c
1189
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
119
int fd = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_fs.c
1209
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
122
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/netbsd32/netbsd32_fs.c
1229
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
1248
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
126
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
1268
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
1289
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
130
return dofilereadv32(fd, fp,
sys/compat/netbsd32/netbsd32_fs.c
1315
error = do_sys_statat(l, SCARG(uap, fd), SCARG_P32(uap, path),
sys/compat/netbsd32/netbsd32_fs.c
1343
return do_sys_utimensat(l, SCARG(uap, fd), NULL,
sys/compat/netbsd32/netbsd32_fs.c
1359
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
137
dofilereadv32(int fd, struct file *fp, struct netbsd32_iovec *iovp, int iovcnt, off_t *offset, int flags, register_t *retval)
sys/compat/netbsd32/netbsd32_fs.c
1379
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
1399
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
1416
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_fs.c
1440
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_fs.c
1444
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_fs.c
205
ktrgeniov(fd, UIO_READ, ktriov, cnt, error);
sys/compat/netbsd32/netbsd32_fs.c
214
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
226
int fd = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_fs.c
229
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/netbsd32/netbsd32_fs.c
233
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
237
return dofilewritev32(fd, fp,
sys/compat/netbsd32/netbsd32_fs.c
243
dofilewritev32(int fd, struct file *fp, struct netbsd32_iovec *iovp, int iovcnt, off_t *offset, int flags, register_t *retval)
sys/compat/netbsd32/netbsd32_fs.c
316
ktrgeniov(fd, UIO_WRITE, ktriov, cnt, error);
sys/compat/netbsd32/netbsd32_fs.c
324
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
440
error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
sys/compat/netbsd32/netbsd32_fs.c
502
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_fs.c
507
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_fs.c
524
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/netbsd32/netbsd32_fs.c
532
ktrgenio(SCARG(uap, fd), UIO_READ, SCARG_P32(uap, buf), done, error);
sys/compat/netbsd32/netbsd32_fs.c
535
fd_putfile(SCARG(uap, fd));
sys/compat/netbsd32/netbsd32_fs.c
591
error = do_sys_fstat(SCARG(uap, fd), &ub);
sys/compat/netbsd32/netbsd32_fs.c
653
int error, fd = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_fs.c
655
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/netbsd32/netbsd32_fs.c
659
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
673
return dofilereadv32(fd, fp, SCARG_P32(uap, iovp),
sys/compat/netbsd32/netbsd32_fs.c
677
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
693
int error, fd = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_fs.c
695
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/netbsd32/netbsd32_fs.c
699
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_fs.c
713
return dofilewritev32(fd, fp, SCARG_P32(uap, iovp),
sys/compat/netbsd32/netbsd32_fs.c
717
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_ioctl.c
1311
unsigned int fd;
sys/compat/netbsd32/netbsd32_ioctl.c
1330
SCARG(uap, fd), SCARG(uap, com), SCARG(uap, data).i32,
sys/compat/netbsd32/netbsd32_ioctl.c
1343
fd = SCARG(uap, fd);
sys/compat/netbsd32/netbsd32_ioctl.c
1344
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/netbsd32/netbsd32_ioctl.c
1354
fd_set_exclose(l, fd, com == FIOCLEX);
sys/compat/netbsd32/netbsd32_ioctl.c
1414
ktrgenio(fd, UIO_WRITE, SCARG_P32(uap, data),
sys/compat/netbsd32/netbsd32_ioctl.c
1778
ktrgenio(fd, UIO_READ, SCARG_P32(uap, data),
sys/compat/netbsd32/netbsd32_ioctl.c
1788
fd_putfile(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1093
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1192
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1216
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1303
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1346
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1392
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1496
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1650
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1698
NETBSD32TOX_UAP(fd, int);
sys/compat/netbsd32/netbsd32_netbsd.c
1757
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1847
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
187
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1910
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
1971
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2023
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
206
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2108
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2187
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
220
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2245
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2297
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2341
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2359
*retval = do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
sys/compat/netbsd32/netbsd32_netbsd.c
2529
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
2547
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
289
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
471
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
515
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
810
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
841
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
976
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_netbsd.c
992
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_syscallargs.h
1016
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
104
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1043
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1055
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1067
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1082
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1116
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1278
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
141
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1454
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1500
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1525
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1550
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1558
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1567
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1611
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1779
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1826
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1854
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1902
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1911
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1920
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
1952
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2012
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2037
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2059
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2078
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2090
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2102
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2200
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2242
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
232
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2324
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2358
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2486
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2493
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2502
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2509
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2517
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2525
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2534
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2541
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2549
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2557
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
256
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2565
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2574
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2580
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2587
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2644
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2652
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2691
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2799
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
2816
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
312
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
359
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
383
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
48
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
482
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
498
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
55
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
643
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
650
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
663
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
670
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
69
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
710
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
716
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
826
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
840
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
926
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
935
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
963
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
971
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_syscallargs.h
998
syscallarg(int) fd;
sys/compat/netbsd32/netbsd32_systrace_args.c
112
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1136
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1154
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1264
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1275
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1311
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1321
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1358
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1382
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1417
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1431
iarg[4] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1448
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1467
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1511
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
161
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1723
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
1960
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2020
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2058
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2091
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2101
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2112
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2170
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2417
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2481
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2517
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2577
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2588
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2599
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2639
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2713
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2744
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2772
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2797
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2813
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2829
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
293
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
2955
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3009
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3115
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3157
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3321
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3330
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3341
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
335
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3350
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3360
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3370
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3381
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3390
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3400
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3410
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3420
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3431
iarg[1] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3439
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3448
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3519
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3529
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3578
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3718
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
3739
iarg[2] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
38
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
429
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
47
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
492
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
532
iarg[4] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
65
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
678
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
698
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
887
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
896
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
913
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
922
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
974
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_systrace_args.c
982
iarg[0] = SCARG(p, fd); /* int */
sys/compat/netbsd32/netbsd32_time.c
564
error = do_timerfd_settime(l, SCARG(uap, fd), SCARG(uap, flags),
sys/compat/netbsd32/netbsd32_time.c
590
error = do_timerfd_gettime(l, SCARG(uap, fd), &its, retval);
sys/compat/netbsd32/netbsd32_vm.c
77
NETBSD32TO64_UAP(fd);
sys/compat/netbsd32/netbsd32_vm.c
85
(long)SCARG(&ua, fd), (long)SCARG(&ua, pos));
sys/compat/ossaudio/ossaudio.c
1078
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/ossaudio/ossaudio.c
1302
fd_putfile(SCARG(uap, fd));
sys/compat/ossaudio/ossaudio.c
1324
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/ossaudio/ossaudio.c
1515
fd_putfile(SCARG(uap, fd));
sys/compat/ossaudio/ossaudio.c
191
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/ossaudio/ossaudio.c
862
fd_putfile(SCARG(uap, fd));
sys/compat/ossaudio/ossaudiovar.h
30
syscallarg(int) fd;
sys/compat/sunos/sunos_ioctl.c
1032
SCARG(&bsd_ua, fd) = SCARG(uap, fd);
sys/compat/sunos/sunos_ioctl.c
1063
error = do_fcntl_lock(SCARG(uap, fd), SCARG(uap, cmd),
sys/compat/sunos/sunos_ioctl.c
416
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/compat/sunos/sunos_ioctl.c
915
fd_putfile(SCARG(uap, fd));
sys/compat/sunos/sunos_ioctl.c
917
SCARG(&pass_ua, fd) = SCARG(uap, fd);
sys/compat/sunos/sunos_misc.c
378
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/sunos/sunos_misc.c
486
fd_putfile(SCARG(uap, fd));
sys/compat/sunos/sunos_misc.c
510
SCARG(&ouap, fd) = SCARG(uap, fd);
sys/compat/sunos/sunos_misc.c
598
int error, fd;
sys/compat/sunos/sunos_misc.c
601
fd = (int)*retval;
sys/compat/sunos/sunos_misc.c
602
if ((error = fd_getsock(fd, &so)) == 0) {
sys/compat/sunos/sunos_misc.c
605
fd_putfile(fd);
sys/compat/sunos/sunos_misc.c
713
int fd;
sys/compat/sunos/sunos_misc.c
715
fd = (int)*retval;
sys/compat/sunos/sunos_misc.c
716
fp = fd_getfile(fd);
sys/compat/sunos/sunos_misc.c
722
fd_putfile(fd);
sys/compat/sunos/sunos_misc.c
822
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/sunos/sunos_misc.c
831
fd_putfile(SCARG(uap, fd));
sys/compat/sunos/sunos_syscallargs.h
134
syscallarg(int) fd;
sys/compat/sunos/sunos_syscallargs.h
175
syscallarg(int) fd;
sys/compat/sunos/sunos_syscallargs.h
213
syscallarg(int) fd;
sys/compat/sunos/sunos_syscallargs.h
361
syscallarg(int) fd;
sys/compat/sunos/sunos_syscallargs.h
429
syscallarg(int) fd;
sys/compat/sunos32/sunos32_ioctl.c
1063
SCARG(&bsd_ua, fd) = SCARG(uap, fd);
sys/compat/sunos32/sunos32_ioctl.c
1093
error = do_fcntl_lock(SCARG(uap, fd), SCARG(uap, cmd),
sys/compat/sunos32/sunos32_ioctl.c
440
sunos32_do_ioctl(int fd, int cmd, void *arg, struct lwp *l)
sys/compat/sunos32/sunos32_ioctl.c
446
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/compat/sunos32/sunos32_ioctl.c
449
fd_putfile(fd);
sys/compat/sunos32/sunos32_ioctl.c
458
fd_putfile(fd);
sys/compat/sunos32/sunos32_ioctl.c
474
SCARG(&bsd_ua, fd) = SCARG(uap, fd);
sys/compat/sunos32/sunos32_ioctl.c
497
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCSETD, &disc, l);
sys/compat/sunos32/sunos32_ioctl.c
514
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCCONS, &on, l);
sys/compat/sunos32/sunos32_ioctl.c
521
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCGWINSZ, &ws,
sys/compat/sunos32/sunos32_ioctl.c
533
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCSWINSZ, &ws, l);
sys/compat/sunos32/sunos32_ioctl.c
540
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCGWINSZ, &ws,
sys/compat/sunos32/sunos32_ioctl.c
561
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCGPGRP, &pgrp,
sys/compat/sunos32/sunos32_ioctl.c
577
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCGETA, &bts,
sys/compat/sunos32/sunos32_ioctl.c
604
if ((error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCGETA,
sys/compat/sunos32/sunos32_ioctl.c
616
return sunos32_do_ioctl(SCARG(&bsd_ua, fd),
sys/compat/sunos32/sunos32_ioctl.c
630
return sunos32_do_ioctl(SCARG(&bsd_ua, fd),
sys/compat/sunos32/sunos32_ioctl.c
642
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCUCNTL, &on, l);
sys/compat/sunos32/sunos32_ioctl.c
650
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCSIG, &sig, l);
sys/compat/sunos32/sunos32_ioctl.c
661
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), a, &ifreq, l); \
sys/compat/sunos32/sunos32_ioctl.c
668
if ((error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), a, &ifreq, l)) != 0) \
sys/compat/sunos32/sunos32_ioctl.c
758
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), OOSIOCGIFCONF,
sys/compat/sunos32/sunos32_ioctl.c
774
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), AUDIO_GETINFO, &aui, l);
sys/compat/sunos32/sunos32_ioctl.c
839
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), AUDIO_SETINFO,
sys/compat/sunos32/sunos32_ioctl.c
847
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), AUDIO_DRAIN, NULL,
sys/compat/sunos32/sunos32_ioctl.c
876
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), TIOCFLUSH, &tmp, l);
sys/compat/sunos32/sunos32_ioctl.c
884
return sunos32_do_ioctl(SCARG(&bsd_ua, fd), FIOASYNC, &on, l);
sys/compat/sunos32/sunos32_ioctl.c
895
error = sunos32_do_ioctl(SCARG(&bsd_ua, fd), DIOCGDINFO,
sys/compat/sunos32/sunos32_ioctl.c
926
int fd = SCARG(&bsd_ua, fd);
sys/compat/sunos32/sunos32_ioctl.c
928
error = sunos32_do_ioctl(fd, DIOCGPARTINFO, &pi, l);
sys/compat/sunos32/sunos32_ioctl.c
931
error = sunos32_do_ioctl(fd, DIOCGDINFO, &label, l);
sys/compat/sunos32/sunos32_misc.c
1056
error = do_sys_fstatvfs(l, SCARG(uap, fd), 0, sp);
sys/compat/sunos32/sunos32_misc.c
567
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/sunos32/sunos32_misc.c
675
fd_putfile(SCARG(uap, fd));
sys/compat/sunos32/sunos32_misc.c
708
SUNOS32TO64_UAP(fd);
sys/compat/sunos32/sunos32_misc.c
816
int error, fd;
sys/compat/sunos32/sunos32_misc.c
819
fd = (int)*retval;
sys/compat/sunos32/sunos32_misc.c
820
if ((error = fd_getsock(fd, &so)) == 0) {
sys/compat/sunos32/sunos32_misc.c
823
fd_putfile(fd);
sys/compat/sunos32/sunos32_misc.c
944
int fd;
sys/compat/sunos32/sunos32_misc.c
946
fd = (int)*retval;
sys/compat/sunos32/sunos32_misc.c
947
fp = fd_getfile(fd);
sys/compat/sunos32/sunos32_misc.c
953
fd_putfile(fd);
sys/compat/sunos32/sunos32_syscallargs.h
146
syscallarg(int) fd;
sys/compat/sunos32/sunos32_syscallargs.h
187
syscallarg(int) fd;
sys/compat/sunos32/sunos32_syscallargs.h
225
syscallarg(int) fd;
sys/compat/sunos32/sunos32_syscallargs.h
373
syscallarg(int) fd;
sys/compat/sunos32/sunos32_syscallargs.h
438
syscallarg(int) fd;
sys/compat/ultrix/ultrix_ioctl.c
455
ultrix_do_ioctl(int fd, int cmd, void *arg, struct lwp *l)
sys/compat/ultrix/ultrix_ioctl.c
460
if ((fp = fd_getfile(fd)) == NULL)
sys/compat/ultrix/ultrix_ioctl.c
467
fd_putfile(fd);
sys/compat/ultrix/ultrix_ioctl.c
478
SCARG(&ap, fd) = SCARG(uap, fd);
sys/compat/ultrix/ultrix_ioctl.c
500
return ultrix_do_ioctl(SCARG(&ap, fd), TIOCSETD, &disc, l);
sys/compat/ultrix/ultrix_ioctl.c
517
return ultrix_do_ioctl(SCARG(&ap, fd), TIOCCONS, &on, l);
sys/compat/ultrix/ultrix_ioctl.c
524
error = ultrix_do_ioctl(SCARG(&ap, fd), TIOCGWINSZ, &ws, l);
sys/compat/ultrix/ultrix_ioctl.c
534
return ultrix_do_ioctl(SCARG(&ap, fd), TIOCSWINSZ, &ws, l);
sys/compat/ultrix/ultrix_ioctl.c
541
error = ultrix_do_ioctl(SCARG(&ap, fd), TIOCGWINSZ, &ws, l);
sys/compat/ultrix/ultrix_ioctl.c
566
error = ultrix_do_ioctl(SCARG(&ap, fd), TIOCGETA, &bts, l);
sys/compat/ultrix/ultrix_ioctl.c
592
error = ultrix_do_ioctl(SCARG(&ap, fd), TIOCGETA, &bts, l);
sys/compat/ultrix/ultrix_ioctl.c
608
return ultrix_do_ioctl(SCARG(&ap, fd),
sys/compat/ultrix/ultrix_ioctl.c
611
result = ultrix_do_ioctl(SCARG(&ap, fd),
sys/compat/ultrix/ultrix_ioctl.c
631
return ultrix_do_ioctl(SCARG(&ap, fd),
sys/compat/ultrix/ultrix_ioctl.c
643
return ultrix_do_ioctl(SCARG(&ap, fd), TIOCUCNTL, &on, l);
sys/compat/ultrix/ultrix_ioctl.c
651
return ultrix_do_ioctl(SCARG(&ap, fd), TIOCSIG, &sig, l);
sys/compat/ultrix/ultrix_ioctl.c
662
return ultrix_do_ioctl(SCARG(&ap, fd), a, &localbuf, l); \
sys/compat/ultrix/ultrix_ioctl.c
670
if ((error = ultrix_do_ioctl(SCARG(&ap, fd), a, &localbuf, l)) != 0) \
sys/compat/ultrix/ultrix_ioctl.c
680
return ultrix_do_ioctl(SCARG(&ap, fd), a, &ifreq, l); \
sys/compat/ultrix/ultrix_ioctl.c
687
if ((error = ultrix_do_ioctl(SCARG(&ap, fd), a, &ifreq, l)) != 0) \
sys/compat/ultrix/ultrix_ioctl.c
736
error = ultrix_do_ioctl(SCARG(&ap, fd), OSIOCGIFCONF,
sys/compat/ultrix/ultrix_misc.c
326
SCARG(&ouap, fd) = SCARG(uap, fd);
sys/compat/ultrix/ultrix_misc.c
756
error = do_fcntl_lock(SCARG(uap, fd), SCARG(uap, cmd), &fl);
sys/compat/ultrix/ultrix_pathname.c
177
int fd;
sys/compat/ultrix/ultrix_pathname.c
179
fd = (int)*retval;
sys/compat/ultrix/ultrix_pathname.c
180
fp = fd_getfile(fd);
sys/compat/ultrix/ultrix_pathname.c
186
fd_putfile(fd);
sys/compat/ultrix/ultrix_pathname.c
265
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/compat/ultrix/ultrix_pathname.c
274
fd_putfile(SCARG(uap, fd));
sys/compat/ultrix/ultrix_syscallargs.h
123
syscallarg(int) fd;
sys/compat/ultrix/ultrix_syscallargs.h
153
syscallarg(int) fd;
sys/compat/ultrix/ultrix_syscallargs.h
198
syscallarg(int) fd;
sys/compat/ultrix/ultrix_syscallargs.h
354
syscallarg(int) fd;
sys/crypto/adiantum/adiantum.c
1958
read_block(int fd, void *buf, size_t len)
sys/crypto/adiantum/adiantum.c
1965
if ((nread = read(fd, p, n)) == -1)
sys/crypto/adiantum/adiantum.c
1982
write_block(int fd, const void *buf, size_t len)
sys/crypto/adiantum/adiantum.c
1989
if ((nwrit = write(fd, p, n)) == -1)
sys/dev/audio/audio.c
2340
int fd;
sys/dev/audio/audio.c
2588
error = fd_allocfile(&fp, &fd);
sys/dev/audio/audio.c
2592
error = fd_clone(fp, fd, flags, &audio_fileops, af);
sys/dev/audio/audio.c
3721
int fd;
sys/dev/audio/audio.c
3728
error = fd_allocfile(&fp, &fd);
sys/dev/audio/audio.c
3740
fd_abort(curproc, fp, fd);
sys/dev/audio/audio.c
3748
error = fd_clone(fp, fd, flags, &audio_fileops, af);
sys/dev/audio/audio.c
8389
int error, fd;
sys/dev/audio/audio.c
8393
error = fd_allocfile(&fp, &fd);
sys/dev/audio/audio.c
8405
fd_abort(curproc, fp, fd);
sys/dev/audio/audio.c
8413
error = fd_clone(fp, fd, flags, &audio_fileops, af);
sys/dev/dmover/dmover_io.c
789
int error, fd;
sys/dev/dmover/dmover_io.c
791
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/dev/dmover/dmover_io.c
796
return fd_clone(fp, fd, flag, &dmio_fileops, ds);
sys/dev/dtv/dtv_demux.c
296
int error, fd;
sys/dev/dtv/dtv_demux.c
307
error = fd_allocfile(&fp, &fd);
sys/dev/dtv/dtv_demux.c
318
return fd_clone(fp, fd, flags, &dtv_demux_fileops, demux);
sys/dev/ieee1394/if_fwip.c
617
struct fw_device *fd;
sys/dev/ieee1394/if_fwip.c
624
fd = fw_noderesolve_eui64(fc, &eui);
sys/dev/ieee1394/if_fwip.c
625
if (!fd) {
sys/dev/ieee1394/if_fwip.c
634
FWLOCALBUS | fd->dst;
sys/dev/ieee1394/if_fwip.c
768
struct fw_device *fd;
sys/dev/ieee1394/if_fwip.c
771
fd = fw_noderesolve_nodeid(sc->sc_fd.fc,
sys/dev/ieee1394/if_fwip.c
773
if (fd) {
sys/dev/ieee1394/if_fwip.c
774
p2[0] = htonl(fd->eui.hi);
sys/dev/ieee1394/if_fwip.c
775
p2[1] = htonl(fd->eui.lo);
sys/dev/ieee1394/if_fwip.c
871
struct fw_device *fd;
sys/dev/ieee1394/if_fwip.c
874
fd = fw_noderesolve_nodeid(sc->sc_fd.fc,
sys/dev/ieee1394/if_fwip.c
876
if (fd) {
sys/dev/ieee1394/if_fwip.c
877
p[0] = htonl(fd->eui.hi);
sys/dev/ieee1394/if_fwip.c
878
p[1] = htonl(fd->eui.lo);
sys/dev/isa/fd.c
1031
struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
sys/dev/isa/fd.c
1037
fdcstatus(fd->sc_dev, 0, "timeout");
sys/dev/isa/fd.c
1039
if (bufq_peek(fd->sc_q) != NULL)
sys/dev/isa/fd.c
1053
struct fd_softc *fd;
sys/dev/isa/fd.c
1072
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/dev/isa/fd.c
1073
if (fd == NULL) {
sys/dev/isa/fd.c
1079
bp = bufq_peek(fd->sc_q);
sys/dev/isa/fd.c
1081
fd->sc_ops = 0;
sys/dev/isa/fd.c
1082
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
1083
fd->sc_active = 0;
sys/dev/isa/fd.c
1093
fd->sc_skip = 0;
sys/dev/isa/fd.c
1094
fd->sc_bcount = bp->b_bcount;
sys/dev/isa/fd.c
1095
fd->sc_blkno = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE);
sys/dev/isa/fd.c
1096
callout_stop(&fd->sc_motoroff_ch);
sys/dev/isa/fd.c
1097
if ((fd->sc_flags & FD_MOTOR_WAIT) != 0) {
sys/dev/isa/fd.c
1101
if ((fd->sc_flags & FD_MOTOR) == 0) {
sys/dev/isa/fd.c
1103
struct fd_softc *ofd = fdc->sc_fd[fd->sc_drive ^ 1];
sys/dev/isa/fd.c
1108
fd->sc_flags |= FD_MOTOR | FD_MOTOR_WAIT;
sys/dev/isa/fd.c
1112
callout_reset(&fd->sc_motoron_ch, hz / 4,
sys/dev/isa/fd.c
1113
fd_motor_on, fd);
sys/dev/isa/fd.c
1122
if (fd->sc_cylin == bp->b_cylinder)
sys/dev/isa/fd.c
1126
out_fdc(iot, ioh, fd->sc_type->steprate);
sys/dev/isa/fd.c
1130
out_fdc(iot, ioh, fd->sc_drive); /* drive number */
sys/dev/isa/fd.c
1131
out_fdc(iot, ioh, bp->b_cylinder * fd->sc_type->step);
sys/dev/isa/fd.c
1133
fd->sc_cylin = -1;
sys/dev/isa/fd.c
1136
iostat_seek(fd->sc_dk.dk_stats);
sys/dev/isa/fd.c
1137
disk_busy(&fd->sc_dk);
sys/dev/isa/fd.c
1144
type = fd->sc_type;
sys/dev/isa/fd.c
1146
fd->sc_skip = (char *)&(finfo->fd_formb_cylno(0)) -
sys/dev/isa/fd.c
1148
sec = fd->sc_blkno % type->seccyl;
sys/dev/isa/fd.c
1150
nblks = uimin(nblks, fd->sc_bcount / FDC_BSIZE);
sys/dev/isa/fd.c
1152
fd->sc_nblks = nblks;
sys/dev/isa/fd.c
1153
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
sys/dev/isa/fd.c
1159
block = (fd->sc_cylin * type->heads + head)
sys/dev/isa/fd.c
1161
if (block != fd->sc_blkno) {
sys/dev/isa/fd.c
1163
"%" PRId64 "\n", block, fd->sc_blkno);
sys/dev/isa/fd.c
1172
(char *)bp->b_data + fd->sc_skip, fd->sc_nbytes,
sys/dev/isa/fd.c
1177
read ? "read" : "write", fd->sc_drive, fd->sc_cylin,
sys/dev/isa/fd.c
1187
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/dev/isa/fd.c
1197
out_fdc(iot, ioh, (head << 2) | fd->sc_drive);
sys/dev/isa/fd.c
1198
out_fdc(iot, ioh, fd->sc_cylin); /* track */
sys/dev/isa/fd.c
1208
disk_busy(&fd->sc_dk);
sys/dev/isa/fd.c
1223
disk_unbusy(&fd->sc_dk, 0, 0);
sys/dev/isa/fd.c
1228
cyl != bp->b_cylinder * fd->sc_type->step) {
sys/dev/isa/fd.c
1230
fdcstatus(fd->sc_dev, 2, "seek failed");
sys/dev/isa/fd.c
1235
fd->sc_cylin = bp->b_cylinder;
sys/dev/isa/fd.c
1250
disk_unbusy(&fd->sc_dk, (bp->b_bcount - bp->b_resid),
sys/dev/isa/fd.c
1256
fdcstatus(fd->sc_dev, 7, bp->b_flags & B_READ ?
sys/dev/isa/fd.c
1259
(unsigned long long)fd->sc_blkno, fd->sc_nblks);
sys/dev/isa/fd.c
1267
fd->sc_skip / FDC_BSIZE, NULL);
sys/dev/isa/fd.c
1271
fd->sc_blkno += fd->sc_nblks;
sys/dev/isa/fd.c
1272
fd->sc_skip += fd->sc_nbytes;
sys/dev/isa/fd.c
1273
fd->sc_bcount -= fd->sc_nbytes;
sys/dev/isa/fd.c
1274
if (!finfo && fd->sc_bcount > 0) {
sys/dev/isa/fd.c
1275
bp->b_cylinder = fd->sc_blkno / fd->sc_type->seccyl;
sys/dev/isa/fd.c
1278
fdfinish(fd, bp);
sys/dev/isa/fd.c
1301
out_fdc(iot, ioh, fd->sc_drive);
sys/dev/isa/fd.c
1317
fdcstatus(fd->sc_dev, 2, "recalibrate failed");
sys/dev/isa/fd.c
1322
fd->sc_cylin = 0;
sys/dev/isa/fd.c
1326
if (fd->sc_flags & FD_MOTOR_WAIT)
sys/dev/isa/fd.c
1331
fdcstatus(fd->sc_dev, 0, "stray interrupt");
sys/dev/isa/fd.c
1363
struct fd_softc *fd;
sys/dev/isa/fd.c
1366
fd = TAILQ_FIRST(&fdc->sc_drives);
sys/dev/isa/fd.c
1367
bp = bufq_peek(fd->sc_q);
sys/dev/isa/fd.c
1369
if (fd->sc_opts & FDOPT_NORETRY)
sys/dev/isa/fd.c
1389
if ((fd->sc_opts & FDOPT_SILENT) == 0) {
sys/dev/isa/fd.c
1391
fd->sc_skip / FDC_BSIZE, NULL);
sys/dev/isa/fd.c
1396
fdfinish(fd, bp);
sys/dev/isa/fd.c
1404
struct fd_softc *fd =
sys/dev/isa/fd.c
1409
struct disklabel *lp = fd->sc_dk.dk_label;
sys/dev/isa/fd.c
1428
lp->d_nsectors = fd->sc_type->sectrac;
sys/dev/isa/fd.c
1429
lp->d_ntracks = fd->sc_type->heads;
sys/dev/isa/fd.c
1430
lp->d_ncylinders = fd->sc_type->cyls;
sys/dev/isa/fd.c
1431
lp->d_secpercyl = fd->sc_type->seccyl;
sys/dev/isa/fd.c
1432
lp->d_secperunit = fd->sc_type->size;
sys/dev/isa/fd.c
1439
error = disk_ioctl(&fd->sc_dk, dev, cmd, addr, flag, l);
sys/dev/isa/fd.c
1475
form_parms->nbps = 128 * (1 << fd->sc_type->secsize);
sys/dev/isa/fd.c
1476
form_parms->ncyl = fd->sc_type->cyls;
sys/dev/isa/fd.c
1477
form_parms->nspt = fd->sc_type->sectrac;
sys/dev/isa/fd.c
1478
form_parms->ntrk = fd->sc_type->heads;
sys/dev/isa/fd.c
1479
form_parms->stepspercyl = fd->sc_type->step;
sys/dev/isa/fd.c
1480
form_parms->gaplen = fd->sc_type->gap2;
sys/dev/isa/fd.c
1481
form_parms->fillbyte = fd->sc_type->fillbyte;
sys/dev/isa/fd.c
1482
form_parms->interleave = fd->sc_type->interleave;
sys/dev/isa/fd.c
1483
switch (fd->sc_type->rate) {
sys/dev/isa/fd.c
1513
fd->sc_type->rate = FDC_500KBPS;
sys/dev/isa/fd.c
1516
fd->sc_type->rate = FDC_300KBPS;
sys/dev/isa/fd.c
1519
fd->sc_type->rate = FDC_250KBPS;
sys/dev/isa/fd.c
1529
fd->sc_type->sectrac = form_parms->nspt;
sys/dev/isa/fd.c
1532
fd->sc_type->heads = form_parms->ntrk;
sys/dev/isa/fd.c
1533
fd->sc_type->seccyl = form_parms->nspt * form_parms->ntrk;
sys/dev/isa/fd.c
1534
fd->sc_type->secsize = ffs(scratch)-1;
sys/dev/isa/fd.c
1535
fd->sc_type->gap2 = form_parms->gaplen;
sys/dev/isa/fd.c
1536
fd->sc_type->cyls = form_parms->ncyl;
sys/dev/isa/fd.c
1537
fd->sc_type->size = fd->sc_type->seccyl * form_parms->ncyl *
sys/dev/isa/fd.c
1539
fd->sc_type->step = form_parms->stepspercyl;
sys/dev/isa/fd.c
1540
fd->sc_type->fillbyte = form_parms->fillbyte;
sys/dev/isa/fd.c
1541
fd->sc_type->interleave = form_parms->interleave;
sys/dev/isa/fd.c
1551
if (form_cmd->head >= fd->sc_type->heads ||
sys/dev/isa/fd.c
1552
form_cmd->cylinder >= fd->sc_type->cyls) {
sys/dev/isa/fd.c
1559
fd_formb->transfer_rate = fd->sc_type->rate;
sys/dev/isa/fd.c
1560
fd_formb->fd_formb_secshift = fd->sc_type->secsize;
sys/dev/isa/fd.c
1561
fd_formb->fd_formb_nsecs = fd->sc_type->sectrac;
sys/dev/isa/fd.c
1562
fd_formb->fd_formb_gaplen = fd->sc_type->gap2;
sys/dev/isa/fd.c
1563
fd_formb->fd_formb_fillbyte = fd->sc_type->fillbyte;
sys/dev/isa/fd.c
1570
j += fd->sc_type->interleave;
sys/dev/isa/fd.c
1576
fd_formb->fd_formb_secsize(i) = fd->sc_type->secsize;
sys/dev/isa/fd.c
1584
*(int *)addr = fd->sc_opts;
sys/dev/isa/fd.c
1588
fd->sc_opts = *(int *)addr;
sys/dev/isa/fd.c
1604
struct fd_softc *fd =
sys/dev/isa/fd.c
1606
struct fd_type *type = fd->sc_type;
sys/dev/isa/fd.c
1665
fd_set_geometry(struct fd_softc *fd)
sys/dev/isa/fd.c
1669
fdt = fd->sc_type;
sys/dev/isa/fd.c
1671
fdt = fd->sc_deftype;
sys/dev/isa/fd.c
1676
struct disk_geom *dg = &fd->sc_dk.dk_geom;
sys/dev/isa/fd.c
1693
disk_set_info(fd->sc_dev, &fd->sc_dk, NULL);
sys/dev/isa/fd.c
215
CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
sys/dev/isa/fd.c
272
void fdfinish(struct fd_softc *fd, struct buf *bp);
sys/dev/isa/fd.c
275
static void fd_set_geometry(struct fd_softc *fd);
sys/dev/isa/fd.c
320
struct fd_softc *fd;
sys/dev/isa/fd.c
326
if ((fd = fdc->sc_fd[drive]) == NULL)
sys/dev/isa/fd.c
328
fd->sc_flags &= ~(FD_MOTOR|FD_MOTOR_WAIT);
sys/dev/isa/fd.c
339
struct fd_softc *fd = device_private(child);
sys/dev/isa/fd.c
340
int drive = fd->sc_drive;
sys/dev/isa/fd.c
342
KASSERT(fdc->sc_fd[drive] == fd); /* but the kid is not my son */
sys/dev/isa/fd.c
560
struct fd_softc *fd = device_private(self);
sys/dev/isa/fd.c
565
fd->sc_dev = self;
sys/dev/isa/fd.c
567
callout_init(&fd->sc_motoron_ch, 0);
sys/dev/isa/fd.c
568
callout_init(&fd->sc_motoroff_ch, 0);
sys/dev/isa/fd.c
578
bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
sys/dev/isa/fd.c
579
fd->sc_cylin = -1;
sys/dev/isa/fd.c
580
fd->sc_drive = drive;
sys/dev/isa/fd.c
581
fd->sc_deftype = type;
sys/dev/isa/fd.c
582
fdc->sc_fd[drive] = fd;
sys/dev/isa/fd.c
587
disk_init(&fd->sc_dk, device_xname(fd->sc_dev), &fddkdriver);
sys/dev/isa/fd.c
588
disk_attach(&fd->sc_dk);
sys/dev/isa/fd.c
593
fd->sc_roothook =
sys/dev/isa/fd.c
594
mountroothook_establish(fd_mountroot_hook, fd->sc_dev);
sys/dev/isa/fd.c
596
rnd_attach_source(&fd->rnd_source, device_xname(fd->sc_dev),
sys/dev/isa/fd.c
599
fd_set_geometry(fd);
sys/dev/isa/fd.c
608
struct fd_softc *fd = device_private(self);
sys/dev/isa/fd.c
611
fd_motor_off(fd);
sys/dev/isa/fd.c
627
fd_set_geometry(fd);
sys/dev/isa/fd.c
630
rnd_detach_source(&fd->rnd_source);
sys/dev/isa/fd.c
632
disk_detach(&fd->sc_dk);
sys/dev/isa/fd.c
633
disk_destroy(&fd->sc_dk);
sys/dev/isa/fd.c
636
bufq_drain(fd->sc_q);
sys/dev/isa/fd.c
638
bufq_free(fd->sc_q);
sys/dev/isa/fd.c
640
callout_destroy(&fd->sc_motoroff_ch);
sys/dev/isa/fd.c
641
callout_destroy(&fd->sc_motoron_ch);
sys/dev/isa/fd.c
690
fd_dev_to_type(struct fd_softc *fd, dev_t dev)
sys/dev/isa/fd.c
696
return type ? &fd_types[type - 1] : fd->sc_deftype;
sys/dev/isa/fd.c
702
struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(bp->b_dev));
sys/dev/isa/fd.c
703
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/dev/isa/fd.c
720
if (bp->b_blkno + sz > fd->sc_type->size) {
sys/dev/isa/fd.c
721
sz = fd->sc_type->size - bp->b_blkno;
sys/dev/isa/fd.c
737
bp->b_blkno / (FDC_BSIZE / DEV_BSIZE) / fd->sc_type->seccyl;
sys/dev/isa/fd.c
742
(unsigned long long)fd->sc_blkno, bp->b_cylinder, sz);
sys/dev/isa/fd.c
747
bufq_put(fd->sc_q, bp);
sys/dev/isa/fd.c
748
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
sys/dev/isa/fd.c
749
if (fd->sc_active == 0)
sys/dev/isa/fd.c
750
fdstart(fd);
sys/dev/isa/fd.c
769
fdstart(struct fd_softc *fd)
sys/dev/isa/fd.c
771
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/dev/isa/fd.c
776
fd->sc_active = 1;
sys/dev/isa/fd.c
777
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
785
fdfinish(struct fd_softc *fd, struct buf *bp)
sys/dev/isa/fd.c
787
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/dev/isa/fd.c
795
(void)bufq_get(fd->sc_q);
sys/dev/isa/fd.c
796
if (TAILQ_NEXT(fd, sc_drivechain) && ++fd->sc_ops >= 8) {
sys/dev/isa/fd.c
797
fd->sc_ops = 0;
sys/dev/isa/fd.c
798
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
799
if (bufq_peek(fd->sc_q) != NULL)
sys/dev/isa/fd.c
800
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
sys/dev/isa/fd.c
802
fd->sc_active = 0;
sys/dev/isa/fd.c
804
bp->b_resid = fd->sc_bcount;
sys/dev/isa/fd.c
805
fd->sc_skip = 0;
sys/dev/isa/fd.c
807
rnd_add_uint32(&fd->rnd_source, bp->b_blkno);
sys/dev/isa/fd.c
811
callout_reset(&fd->sc_motoroff_ch, 5 * hz, fd_motor_off, fd);
sys/dev/isa/fd.c
832
struct fd_softc *fd;
sys/dev/isa/fd.c
836
if ((fd = TAILQ_FIRST(&fdc->sc_drives)) != NULL)
sys/dev/isa/fd.c
837
status = fd->sc_drive;
sys/dev/isa/fd.c
843
if ((fd = fdc->sc_fd[n]) && (fd->sc_flags & FD_MOTOR))
sys/dev/isa/fd.c
851
struct fd_softc *fd = arg;
sys/dev/isa/fd.c
854
fdc = device_private(device_parent(fd->sc_dev));
sys/dev/isa/fd.c
857
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
sys/dev/isa/fd.c
865
struct fd_softc *fd = arg;
sys/dev/isa/fd.c
866
struct fdc_softc *fdc = device_private(device_parent(fd->sc_dev));
sys/dev/isa/fd.c
869
fd->sc_flags &= ~FD_MOTOR_WAIT;
sys/dev/isa/fd.c
870
if (TAILQ_FIRST(&fdc->sc_drives) == fd && fdc->sc_state == MOTORWAIT)
sys/dev/isa/fd.c
924
struct fd_softc *fd;
sys/dev/isa/fd.c
927
fd = device_lookup_private(&fd_cd, FDUNIT(dev));
sys/dev/isa/fd.c
928
if (fd == NULL)
sys/dev/isa/fd.c
931
type = fd_dev_to_type(fd, dev);
sys/dev/isa/fd.c
935
if ((fd->sc_flags & FD_OPEN) != 0 &&
sys/dev/isa/fd.c
936
memcmp(fd->sc_type, type, sizeof(*type)))
sys/dev/isa/fd.c
939
fd->sc_type_copy = *type;
sys/dev/isa/fd.c
940
fd->sc_type = &fd->sc_type_copy;
sys/dev/isa/fd.c
941
fd->sc_cylin = -1;
sys/dev/isa/fd.c
942
fd->sc_flags |= FD_OPEN;
sys/dev/isa/fd.c
944
fd_set_geometry(fd);
sys/dev/isa/fd.c
952
struct fd_softc *fd =
sys/dev/isa/fd.c
955
fd->sc_flags &= ~FD_OPEN;
sys/dev/isa/fd.c
956
fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
sys/dev/iscsi/iscsi_main.c
138
int error, fd, unit;
sys/dev/iscsi/iscsi_main.c
148
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/dev/iscsi/iscsi_main.c
160
fd_abort(curproc, fp, fd);
sys/dev/iscsi/iscsi_main.c
166
return fd_clone(fp, fd, flag, &iscsi_fileops, d);
sys/dev/microcode/ral/build.c
34
int fd;
sys/dev/microcode/ral/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/ral/build.c
39
if (fd == -1)
sys/dev/microcode/ral/build.c
42
rlen = write(fd, ucode, size);
sys/dev/microcode/ral/build.c
48
close(fd);
sys/dev/microcode/rum/build.c
34
int fd;
sys/dev/microcode/rum/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/rum/build.c
39
if (fd == -1)
sys/dev/microcode/rum/build.c
42
rlen = write(fd, ucode, size);
sys/dev/microcode/rum/build.c
48
close(fd);
sys/dev/microcode/run/build.c
34
int fd;
sys/dev/microcode/run/build.c
38
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/run/build.c
39
if (fd == -1)
sys/dev/microcode/run/build.c
42
rlen = write(fd, ucode, size);
sys/dev/microcode/run/build.c
48
close(fd);
sys/dev/microcode/zyd/build.c
33
int fd;
sys/dev/microcode/zyd/build.c
37
fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
sys/dev/microcode/zyd/build.c
38
if (fd == -1)
sys/dev/microcode/zyd/build.c
41
rlen = write(fd, ucode, size);
sys/dev/microcode/zyd/build.c
47
close(fd);
sys/dev/nvmm/nvmm.c
1134
int error, fd;
sys/dev/nvmm/nvmm.c
1142
error = fd_allocfile(&fp, &fd);
sys/dev/nvmm/nvmm.c
1153
return fd_clone(fp, fd, flags, &nvmm_fileops, owner);
sys/dev/pad/pad.c
360
int error, fd;
sys/dev/pad/pad.c
362
error = fd_allocfile(&fp, &fd);
sys/dev/pad/pad.c
381
error = fd_clone(fp, fd, flags, &pad_fileops, sc);
sys/dev/pad/pad.c
391
fd_abort(curproc, fp, fd);
sys/dev/pci/vio9p.c
179
int error, fd;
sys/dev/pci/vio9p.c
190
error = fd_allocfile(&fp, &fd);
sys/dev/pci/vio9p.c
196
return fd_clone(fp, fd, flag, &vio9p_fileops, sc);
sys/dev/pud/pud.c
349
pud_config(int fd, int flags, int fmt)
sys/dev/pud/pud.c
354
pd->pd_pi = putter_attach(curlwp->l_proc->p_pid, fd, pd, &pud_putter);
sys/dev/putter/putter.c
105
return pc->pc_config(fd, flags, fmt);
sys/dev/putter/putter.c
535
int error, fd, idx;
sys/dev/putter/putter.c
553
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/dev/putter/putter.c
556
if ((error = putter_configure(dev, flags, fmt, fd)) != 0)
sys/dev/putter/putter.c
562
error = fd_clone(fp, fd, FREAD|FWRITE, &putter_fileops, pi);
sys/dev/putter/putter.c
567
fd_abort(p, fp, fd);
sys/dev/putter/putter.c
595
putter_attach(pid_t pid, int fd, void *ppriv, struct putter_ops *pop)
sys/dev/putter/putter.c
603
pi->pi_fd = fd;
sys/dev/putter/putter.c
93
putter_configure(dev_t dev, int flags, int fmt, int fd)
sys/dev/usb/ugen.c
1986
struct usb_full_desc *fd = (struct usb_full_desc *)addr;
sys/dev/usb/ugen.c
1988
cdesc = ugen_get_cdesc(sc, fd->ufd_config_index, &cdesclen);
sys/dev/usb/ugen.c
1992
if (len > fd->ufd_size)
sys/dev/usb/ugen.c
1993
len = fd->ufd_size;
sys/dev/usb/ugen.c
1994
iov.iov_base = (void *)fd->ufd_data;
sys/dev/usb/vhci.c
1004
error = fd_allocfile(&fp, &fd);
sys/dev/usb/vhci.c
1013
return fd_clone(fp, fd, flags, &vhci_fileops, vfd);
sys/dev/usb/vhci.c
998
int error, fd;
sys/dev/wscons/wsdisplay.c
1318
struct wsdisplay_font fd;
sys/dev/wscons/wsdisplay.c
1416
fd.name = namebuf;
sys/dev/wscons/wsdisplay.c
1418
fd.name = 0;
sys/dev/wscons/wsdisplay.c
1419
fd.data = 0;
sys/dev/wscons/wsdisplay.c
1421
scr->scr_dconf->emulcookie, &fd);
sys/dev/wsfont/wsfontdev.c
84
struct wsdisplayio_fontdesc fd;
sys/dev/wsfont/wsfontdev.c
89
memset(&fd, 0, sizeof(fd));
sys/dev/wsfont/wsfontdev.c
90
strncpy(fd.fd_name, f->name, sizeof(fd.fd_name) - 1);
sys/dev/wsfont/wsfontdev.c
91
fd.fd_width = f->fontwidth;
sys/dev/wsfont/wsfontdev.c
92
fd.fd_height = f->fontheight;
sys/dev/wsfont/wsfontdev.c
97
copyout(&fd, &fi->fi_fonts[fi->fi_numentries],
sys/fs/nfs/server/nfs_nfsdport.c
2871
fp_getfvp(struct thread *p, int fd, struct file **fpp, struct vnode **vpp)
sys/fs/nfs/server/nfs_nfsdport.c
2878
if (fd < 0 || fd >= fdp->fd_nfiles ||
sys/fs/nfs/server/nfs_nfsdport.c
2879
(fp = fdp->fd_ofiles[fd].fde_file) == NULL) {
sys/fs/v7fs/v7fs_impl.h
125
int fd; /* NetBSD newfs,fsck */
sys/fs/v7fs/v7fs_io_user.c
115
fsync(lio->fd);
sys/fs/v7fs/v7fs_io_user.c
125
int fd = lio->fd;
sys/fs/v7fs/v7fs_io_user.c
127
if ((lseek(fd, (off_t)sector * blksz, SEEK_SET) < 0) ||
sys/fs/v7fs/v7fs_io_user.c
128
(read(fd, buf, blksz) < (ssize_t)blksz)) {
sys/fs/v7fs/v7fs_io_user.c
141
int fd = lio->fd;
sys/fs/v7fs/v7fs_io_user.c
143
if ((lseek(fd, (off_t)sector * blksz, SEEK_SET) < 0) ||
sys/fs/v7fs/v7fs_io_user.c
144
(write(fd, buf, blksz) < (ssize_t)blksz)) {
sys/fs/v7fs/v7fs_io_user.c
59
int fd;
sys/fs/v7fs/v7fs_io_user.c
86
local.fd = mount->device.fd;
sys/fs/v7fs/v7fs_io_user.c
89
MAP_FILE | MAP_SHARED/*writeback*/, local.fd, 0);
sys/kern/kern_descrip.c
1180
fd_affix(proc_t *p, file_t *fp, unsigned fd)
sys/kern/kern_descrip.c
1198
ff = dt->dt_ff[fd];
sys/kern/kern_descrip.c
1203
KASSERT(fd_isused(fdp, fd));
sys/kern/kern_descrip.c
1204
KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
1214
fd_abort(proc_t *p, file_t *fp, unsigned fd)
sys/kern/kern_descrip.c
1222
ff = atomic_load_consume(&fdp->fd_dt)->dt_ff[fd];
sys/kern/kern_descrip.c
1226
KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
1229
KASSERT(fd_isused(fdp, fd));
sys/kern/kern_descrip.c
1230
fd_unused(fdp, fd);
sys/kern/kern_descrip.c
1323
unsigned fd;
sys/kern/kern_descrip.c
1342
for (fd = 0; fd < NDFDFILE; fd++) {
sys/kern/kern_descrip.c
1343
KASSERT(fdp->fd_dtbuiltin.dt_ff[fd] ==
sys/kern/kern_descrip.c
1344
(fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
1346
for (fd = NDFDFILE; fd < NDFILE; fd++) {
sys/kern/kern_descrip.c
1347
KASSERT(fdp->fd_dtbuiltin.dt_ff[fd] == NULL);
sys/kern/kern_descrip.c
1571
int fd, nf;
sys/kern/kern_descrip.c
1595
for (fd = 0, nf = dt->dt_nfiles; fd < nf; fd++) {
sys/kern/kern_descrip.c
1596
ff = dt->dt_ff[fd];
sys/kern/kern_descrip.c
1597
KASSERT(fd >= NDFDFILE ||
sys/kern/kern_descrip.c
1598
ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
1616
fd_close(fd);
sys/kern/kern_descrip.c
1624
if (fd >= NDFDFILE) {
sys/kern/kern_descrip.c
1627
dt->dt_ff[fd] = NULL;
sys/kern/kern_descrip.c
1784
int fd;
sys/kern/kern_descrip.c
1811
for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
sys/kern/kern_descrip.c
1812
if ((ff = dt->dt_ff[fd]) == NULL) {
sys/kern/kern_descrip.c
1813
KASSERT(fd >= NDFDFILE);
sys/kern/kern_descrip.c
1816
KASSERT(fd >= NDFDFILE ||
sys/kern/kern_descrip.c
1817
ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
182
fd_isused(filedesc_t *fdp, unsigned fd)
sys/kern/kern_descrip.c
1828
fd_close(fd);
sys/kern/kern_descrip.c
184
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
186
KASSERT(fd < atomic_load_consume(&fdp->fd_dt)->dt_nfiles);
sys/kern/kern_descrip.c
188
return (fdp->fd_lomap[off] & (1U << (fd & NDENTRYMASK))) != 0;
sys/kern/kern_descrip.c
1880
fd_set_exclose(struct lwp *l, int fd, bool exclose)
sys/kern/kern_descrip.c
1883
fdfile_t *ff = atomic_load_consume(&fdp->fd_dt)->dt_ff[fd];
sys/kern/kern_descrip.c
1891
fd_set_foclose(struct lwp *l, int fd, bool foclose)
sys/kern/kern_descrip.c
1894
fdfile_t *ff = atomic_load_consume(&fdp->fd_dt)->dt_ff[fd];
sys/kern/kern_descrip.c
1962
fd_clone(file_t *fp, unsigned fd, int flag, const struct fileops *fops,
sys/kern/kern_descrip.c
1967
fd_set_exclose(curlwp, fd, (flag & O_CLOEXEC) != 0);
sys/kern/kern_descrip.c
1968
fd_set_foclose(curlwp, fd, (flag & O_CLOFORK) != 0);
sys/kern/kern_descrip.c
1972
curlwp->l_dupfd = fd;
sys/kern/kern_descrip.c
1973
fd_affix(curproc, fp, fd);
sys/kern/kern_descrip.c
199
u_int fd;
sys/kern/kern_descrip.c
2062
struct filedesc *fd = p->p_fd;
sys/kern/kern_descrip.c
2066
mutex_enter(&fd->fd_lock);
sys/kern/kern_descrip.c
2067
dt = fd->fd_dt;
sys/kern/kern_descrip.c
2080
mutex_exit(&fd->fd_lock);
sys/kern/kern_descrip.c
210
for (fd = 0; fd < dt->dt_nfiles; fd++) {
sys/kern/kern_descrip.c
211
if (fd < NDFDFILE) {
sys/kern/kern_descrip.c
212
KASSERT(dt->dt_ff[fd] ==
sys/kern/kern_descrip.c
213
(fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
2137
struct filedesc *fd;
sys/kern/kern_descrip.c
215
if (dt->dt_ff[fd] == NULL) {
sys/kern/kern_descrip.c
216
KASSERT(!fd_isused(fdp, fd));
sys/kern/kern_descrip.c
2168
fd = p->p_fd;
sys/kern/kern_descrip.c
2169
mutex_enter(&fd->fd_lock);
sys/kern/kern_descrip.c
217
} else if (dt->dt_ff[fd]->ff_file != NULL) {
sys/kern/kern_descrip.c
2170
dt = fd->fd_dt;
sys/kern/kern_descrip.c
218
KASSERT(fd_isused(fdp, fd));
sys/kern/kern_descrip.c
2208
mutex_exit(&fd->fd_lock);
sys/kern/kern_descrip.c
2243
struct filedesc *fd;
sys/kern/kern_descrip.c
2325
fd = p->p_fd;
sys/kern/kern_descrip.c
2326
mutex_enter(&fd->fd_lock);
sys/kern/kern_descrip.c
2327
dt = fd->fd_dt;
sys/kern/kern_descrip.c
2345
mutex_exit(&fd->fd_lock);
sys/kern/kern_descrip.c
2348
mutex_enter(&fd->fd_lock);
sys/kern/kern_descrip.c
2360
mutex_exit(&fd->fd_lock);
sys/kern/kern_descrip.c
260
fd_last_set(filedesc_t *fd, int last)
sys/kern/kern_descrip.c
263
fdfile_t **ff = fd->fd_dt->dt_ff;
sys/kern/kern_descrip.c
264
uint32_t *bitmap = fd->fd_lomap;
sys/kern/kern_descrip.c
266
KASSERT(mutex_owned(&fd->fd_lock));
sys/kern/kern_descrip.c
268
fd_checkmaps(fd);
sys/kern/kern_descrip.c
290
fd_used(filedesc_t *fdp, unsigned fd)
sys/kern/kern_descrip.c
292
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
295
ff = fdp->fd_dt->dt_ff[fd];
sys/kern/kern_descrip.c
298
KASSERT((fdp->fd_lomap[off] & (1U << (fd & NDENTRYMASK))) == 0);
sys/kern/kern_descrip.c
304
fdp->fd_lomap[off] |= 1U << (fd & NDENTRYMASK);
sys/kern/kern_descrip.c
311
if ((int)fd > fdp->fd_lastfile) {
sys/kern/kern_descrip.c
312
fdp->fd_lastfile = fd;
sys/kern/kern_descrip.c
319
fd_unused(filedesc_t *fdp, unsigned fd)
sys/kern/kern_descrip.c
321
u_int off = fd >> NDENTRYSHIFT;
sys/kern/kern_descrip.c
324
ff = fdp->fd_dt->dt_ff[fd];
sys/kern/kern_descrip.c
331
if (fd < fdp->fd_freefile) {
sys/kern/kern_descrip.c
332
fdp->fd_freefile = fd;
sys/kern/kern_descrip.c
341
KASSERT((fdp->fd_lomap[off] & (1U << (fd & NDENTRYMASK))) != 0);
sys/kern/kern_descrip.c
342
fdp->fd_lomap[off] &= ~(1U << (fd & NDENTRYMASK));
sys/kern/kern_descrip.c
345
KASSERT(fd <= fdp->fd_lastfile);
sys/kern/kern_descrip.c
346
if (fd == fdp->fd_lastfile) {
sys/kern/kern_descrip.c
347
fdp->fd_lastfile = fd_last_set(fdp, fd);
sys/kern/kern_descrip.c
357
fd_getfile(unsigned fd)
sys/kern/kern_descrip.c
370
if (__predict_false(fd >= dt->dt_nfiles)) {
sys/kern/kern_descrip.c
373
ff = dt->dt_ff[fd];
sys/kern/kern_descrip.c
374
KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
440
fd_putfile(fd);
sys/kern/kern_descrip.c
448
fd_putfile(unsigned fd)
sys/kern/kern_descrip.c
455
KASSERT(fd < atomic_load_consume(&fdp->fd_dt)->dt_nfiles);
sys/kern/kern_descrip.c
456
ff = atomic_load_consume(&fdp->fd_dt)->dt_ff[fd];
sys/kern/kern_descrip.c
460
KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
469
fd_close(fd);
sys/kern/kern_descrip.c
501
(void)fd_close(fd);
sys/kern/kern_descrip.c
509
fd_getvnode(unsigned fd, file_t **fpp)
sys/kern/kern_descrip.c
514
fp = fd_getfile(fd);
sys/kern/kern_descrip.c
519
fd_putfile(fd);
sys/kern/kern_descrip.c
525
fd_putfile(fd);
sys/kern/kern_descrip.c
537
fd_getsock1(unsigned fd, struct socket **sop, file_t **fp)
sys/kern/kern_descrip.c
539
*fp = fd_getfile(fd);
sys/kern/kern_descrip.c
544
fd_putfile(fd);
sys/kern/kern_descrip.c
552
fd_getsock(unsigned fd, struct socket **sop)
sys/kern/kern_descrip.c
555
return fd_getsock1(fd, sop, &fp);
sys/kern/kern_descrip.c
570
fd_getfile2(proc_t *p, unsigned fd)
sys/kern/kern_descrip.c
580
if (fd >= dt->dt_nfiles) {
sys/kern/kern_descrip.c
584
if ((ff = dt->dt_ff[fd]) == NULL) {
sys/kern/kern_descrip.c
607
fd_close(unsigned fd)
sys/kern/kern_descrip.c
620
ff = atomic_load_consume(&fdp->fd_dt)->dt_ff[fd];
sys/kern/kern_descrip.c
622
KASSERT(fd >= NDFDFILE || ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/kern_descrip.c
689
knote_fdclose(fd);
sys/kern/kern_descrip.c
740
fd_unused(fdp, fd);
sys/kern/kern_drvctl.c
180
int fd;
sys/kern/kern_drvctl.c
183
ret = fd_allocfile(&fp, &fd);
sys/kern/kern_drvctl.c
189
ret = fd_clone(fp, fd, flags, &drvctl_fileops, /* context */NULL);
sys/kern/kern_event.c
1727
int fd, error;
sys/kern/kern_event.c
1729
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/kern/kern_event.c
1740
*retval = fd;
sys/kern/kern_event.c
1742
fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
sys/kern/kern_event.c
1743
fd_affix(curproc, fp, fd);
sys/kern/kern_event.c
1805
return kevent1(retval, SCARG(uap, fd), SCARG(uap, changelist),
sys/kern/kern_event.c
1811
kevent1(register_t *retval, int fd,
sys/kern/kern_event.c
1826
fp = fd_getfile(fd);
sys/kern/kern_event.c
1831
fd_putfile(fd);
sys/kern/kern_event.c
1885
fd_putfile(fd);
sys/kern/kern_event.c
1901
int error, fd, rv;
sys/kern/kern_event.c
1907
fd = 0;
sys/kern/kern_event.c
1925
|| (fp = fd_getfile(fd = kev->ident)) == NULL) {
sys/kern/kern_event.c
1931
ff = fdp->fd_dt->dt_ff[fd];
sys/kern/kern_event.c
1936
if (fd <= fdp->fd_lastkqfile) {
sys/kern/kern_event.c
2159
fd_putfile(fd);
sys/kern/kern_event.c
2654
kqueue_doclose(struct kqueue *kq, struct klist *list, int fd)
sys/kern/kern_event.c
2798
knote_fdclose(int fd)
sys/kern/kern_event.c
2807
list = (struct klist *)&fdp->fd_dt->dt_ff[fd]->ff_knlist;
sys/kern/kern_exec.c
1477
execve1(struct lwp *l, bool has_path, const char *path, int fd,
sys/kern/kern_exec.c
1484
error = execve_loadvm(l, has_path, path, fd, args, envs, fetch_element,
sys/kern/kern_exec.c
622
return execve1(l, false, NULL, SCARG(uap, fd), SCARG(uap, argp),
sys/kern/kern_exec.c
748
execve_loadvm(struct lwp *l, bool has_path, const char *path, int fd,
sys/kern/kern_exec.c
823
epp->ep_xfd = fd;
sys/kern/kern_ksyms.c
1205
int fd = -1;
sys/kern/kern_ksyms.c
1217
error = fd_allocfile(&fp, &fd);
sys/kern/kern_ksyms.c
1296
fd_abort(curproc, fp, fd);
sys/kern/kern_ksyms.c
1302
error = fd_clone(fp, fd, flags, &ksyms_fileops, ks);
sys/kern/kern_ktrace.c
1187
int error, fd;
sys/kern/kern_ktrace.c
1189
fd = SCARG(uap, fd);
sys/kern/kern_ktrace.c
1190
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/kern_ktrace.c
1197
fd_putfile(fd);
sys/kern/kern_ktrace.c
654
ktr_execfd(int fd, u_int dtype)
sys/kern/kern_ktrace.c
667
ktp->ktr_fd = fd;
sys/kern/kern_ktrace.c
706
ktr_io(lwp_t *l, int fd, enum uio_rw rw, struct iovec *iov, size_t len)
sys/kern/kern_ktrace.c
719
ktp->ktr_fd = fd;
sys/kern/kern_ktrace.c
764
ktr_genio(int fd, enum uio_rw rw, const void *addr, size_t len, int error)
sys/kern/kern_ktrace.c
773
ktr_io(l, fd, rw, &iov, len);
sys/kern/kern_ktrace.c
777
ktr_geniov(int fd, enum uio_rw rw, struct iovec *iov, size_t len, int error)
sys/kern/kern_ktrace.c
783
ktr_io(l, fd, rw, iov, len);
sys/kern/kern_ktrace.c
787
ktr_mibio(int fd, enum uio_rw rw, const void *addr, size_t len, int error)
sys/kern/kern_ktrace.c
796
ktr_io(l, fd, rw, &iov, len);
sys/kern/kern_ktrace_vfs.c
130
if ((error = fd_allocfile(&fp, &fd)) != 0) {
sys/kern/kern_ktrace_vfs.c
144
fd_abort(curproc, fp, fd);
sys/kern/kern_ktrace_vfs.c
98
int fd;
sys/kern/kern_sig.c
1050
size_t fd;
sys/kern/kern_sig.c
1056
for (fd = 0; fd < dt->dt_nfiles; fd++) {
sys/kern/kern_sig.c
1057
if ((ff = dt->dt_ff[fd]) == NULL)
sys/kern/kern_sig.c
1062
ksi->ksi_fd = fd;
sys/kern/subr_exec_fd.c
106
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/kern/subr_exec_fd.c
108
KASSERT(fd < CHECK_UPTO);
sys/kern/subr_exec_fd.c
116
fd_abort(p, fp, fd);
sys/kern/subr_exec_fd.c
124
fd_affix(p, fp, fd);
sys/kern/subr_exec_fd.c
53
int fd;
sys/kern/subr_exec_fd.c
60
for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
sys/kern/subr_exec_fd.c
61
if ((ff = dt->dt_ff[fd]) == NULL) {
sys/kern/subr_exec_fd.c
62
KASSERT(fd >= NDFDFILE);
sys/kern/subr_exec_fd.c
65
KASSERT(fd >= NDFDFILE ||
sys/kern/subr_exec_fd.c
66
ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
sys/kern/subr_exec_fd.c
69
ktr_execfd(fd, fp->f_type);
sys/kern/subr_exec_fd.c
91
int fd, i, error, flags = FREAD|FWRITE;
sys/kern/subr_kcov.c
453
int error, fd;
sys/kern/subr_kcov.c
456
error = fd_allocfile(&fp, &fd);
sys/kern/subr_kcov.c
463
return fd_clone(fp, fd, flag, &kcov_fileops, kd);
sys/kern/sys_aio.c
1663
const int fd = aiocb.aio_fildes;
sys/kern/sys_aio.c
1664
struct file *fp = fd_getfile2(p, fd);
sys/kern/sys_descrip.c
114
oldfd = SCARG(uap, fd);
sys/kern/sys_descrip.c
182
fcntl_forfs(int fd, file_t *fp, int cmd, void *arg)
sys/kern/sys_descrip.c
240
do_fcntl_lock(int fd, int cmd, struct flock *fl)
sys/kern/sys_descrip.c
247
if ((fp = fd_getfile(fd)) == NULL) {
sys/kern/sys_descrip.c
319
fd_putfile(fd);
sys/kern/sys_descrip.c
334
int fd, i, tmp, error, cmd, newmin;
sys/kern/sys_descrip.c
343
fd = SCARG(uap, fd);
sys/kern/sys_descrip.c
350
if (fd < 0)
sys/kern/sys_descrip.c
352
while ((i = fdp->fd_lastfile) >= fd) {
sys/kern/sys_descrip.c
371
error = do_fcntl_lock(fd, cmd, &fl);
sys/kern/sys_descrip.c
381
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_descrip.c
385
error = fcntl_forfs(fd, fp, cmd, SCARG(uap, arg));
sys/kern/sys_descrip.c
386
fd_putfile(fd);
sys/kern/sys_descrip.c
406
fd_putfile(fd);
sys/kern/sys_descrip.c
415
*retval = (dt->dt_ff[fd]->ff_exclose ? FD_CLOEXEC : 0) |
sys/kern/sys_descrip.c
416
(dt->dt_ff[fd]->ff_foclose ? FD_CLOFORK: 0);
sys/kern/sys_descrip.c
421
fd_set_exclose(l, fd, (tmp & FD_CLOEXEC) != 0);
sys/kern/sys_descrip.c
422
fd_set_foclose(l, fd, (tmp & FD_CLOFORK) != 0);
sys/kern/sys_descrip.c
515
fd_putfile(fd);
sys/kern/sys_descrip.c
529
int fd = SCARG(uap, fd);
sys/kern/sys_descrip.c
531
if (fd_getfile(fd) == NULL) {
sys/kern/sys_descrip.c
535
error = fd_close(fd);
sys/kern/sys_descrip.c
539
l->l_proc->p_comm, (int)l->l_proc->p_pid, fd);
sys/kern/sys_descrip.c
552
do_sys_fstat(int fd, struct stat *sb)
sys/kern/sys_descrip.c
557
if ((fp = fd_getfile(fd)) == NULL) {
sys/kern/sys_descrip.c
561
fd_putfile(fd);
sys/kern/sys_descrip.c
580
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/kern/sys_descrip.c
598
int fd, name, error;
sys/kern/sys_descrip.c
601
fd = SCARG(uap, fd);
sys/kern/sys_descrip.c
605
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_descrip.c
611
fd_putfile(fd);
sys/kern/sys_descrip.c
629
int fd, how, error;
sys/kern/sys_descrip.c
634
fd = SCARG(uap, fd);
sys/kern/sys_descrip.c
637
if ((fp = fd_getfile(fd)) == NULL) {
sys/kern/sys_descrip.c
675
fd_putfile(fd);
sys/kern/sys_descrip.c
680
do_posix_fadvise(int fd, off_t offset, off_t len, int advice)
sys/kern/sys_descrip.c
685
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_descrip.c
693
fd_putfile(fd);
sys/kern/sys_descrip.c
710
*retval = do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
sys/kern/sys_descrip.c
719
int fd[2], error;
sys/kern/sys_descrip.c
721
if ((error = pipe1(l, fd, 0)) != 0)
sys/kern/sys_descrip.c
724
retval[0] = fd[0];
sys/kern/sys_descrip.c
725
retval[1] = fd[1];
sys/kern/sys_descrip.c
737
int fd[2], error;
sys/kern/sys_descrip.c
739
if ((error = pipe1(l, fd, SCARG(uap, flags))) != 0)
sys/kern/sys_descrip.c
742
if ((error = copyout(fd, SCARG(uap, fildes), sizeof(fd))) != 0)
sys/kern/sys_epoll.c
117
epoll_to_kevent(int epfd, int fd, struct epoll_event *l_event,
sys/kern/sys_epoll.c
135
EV_SET(kevent, fd, EVFILT_READ, kev_flags, 0, 0, 0);
sys/kern/sys_epoll.c
138
kevent->kext_fd = fd;
sys/kern/sys_epoll.c
143
EV_SET(kevent, fd, EVFILT_WRITE, kev_flags, 0, 0, 0);
sys/kern/sys_epoll.c
146
kevent->kext_fd = fd;
sys/kern/sys_epoll.c
152
EV_SET(kevent++, fd, EVFILT_READ, EV_ADD|EV_DISABLE, 0, 0, 0);
sys/kern/sys_epoll.c
252
epoll_ctl_common(struct lwp *l, register_t *retval, int epfd, int op, int fd,
sys/kern/sys_epoll.c
279
fp = fd_getfile(fd);
sys/kern/sys_epoll.c
295
fd_putfile(fd);
sys/kern/sys_epoll.c
300
if (epfd == fd) {
sys/kern/sys_epoll.c
305
error = epoll_to_kevent(epfd, fd, event, kev, &nchanges);
sys/kern/sys_epoll.c
312
error = epoll_delete_all_events(retval, epfd, fd);
sys/kern/sys_epoll.c
318
if (epoll_fd_registered(retval, epfd, fd))
sys/kern/sys_epoll.c
320
error = epoll_check_loop_and_depth(l, epfd, fd);
sys/kern/sys_epoll.c
327
return epoll_delete_all_events(retval, epfd, fd);
sys/kern/sys_epoll.c
371
SCARG(uap, fd), eep);
sys/kern/sys_epoll.c
494
epoll_register_kevent(register_t *retval, int epfd, int fd, int filter,
sys/kern/sys_epoll.c
505
EV_SET(&kev, fd, filter, flags, 0, 0, 0);
sys/kern/sys_epoll.c
514
epoll_fd_registered(register_t *retval, int epfd, int fd)
sys/kern/sys_epoll.c
524
if (epoll_register_kevent(retval, epfd, fd, EVFILT_READ, 0) != ENOENT ||
sys/kern/sys_epoll.c
525
epoll_register_kevent(retval, epfd, fd, EVFILT_WRITE, 0) != ENOENT)
sys/kern/sys_epoll.c
536
epoll_delete_all_events(register_t *retval, int epfd, int fd)
sys/kern/sys_epoll.c
540
error1 = epoll_register_kevent(retval, epfd, fd, EVFILT_READ,
sys/kern/sys_epoll.c
542
error2 = epoll_register_kevent(retval, epfd, fd, EVFILT_WRITE,
sys/kern/sys_epoll.c
579
edges[nedges_so_far].fd =
sys/kern/sys_epoll.c
626
edges[i].fd, depth);
sys/kern/sys_epoll.c
639
epoll_check_loop_and_depth(struct lwp *l, int epfd, int fd)
sys/kern/sys_epoll.c
649
fp = fd_getfile(fd);
sys/kern/sys_epoll.c
653
fd_putfile(fd);
sys/kern/sys_epoll.c
671
edges[0].fd = fd;
sys/kern/sys_epoll.c
69
int fd;
sys/kern/sys_eventfd.c
554
int fd, error;
sys/kern/sys_eventfd.c
560
if ((error = fd_allocfile(&fp, &fd)) != 0) {
sys/kern/sys_eventfd.c
571
fd_set_exclose(l, fd, !!(flags & EFD_CLOEXEC));
sys/kern/sys_eventfd.c
572
fd_affix(curproc, fp, fd);
sys/kern/sys_eventfd.c
574
*retval = fd;
sys/kern/sys_generic.c
108
int fd;
sys/kern/sys_generic.c
110
fd = SCARG(uap, fd);
sys/kern/sys_generic.c
112
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_generic.c
116
fd_putfile(fd);
sys/kern/sys_generic.c
121
return (dofileread(fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
sys/kern/sys_generic.c
126
dofileread(int fd, struct file *fp, void *buf, size_t nbyte,
sys/kern/sys_generic.c
162
ktrgenio(fd, UIO_READ, buf, cnt, error);
sys/kern/sys_generic.c
165
fd_putfile(fd);
sys/kern/sys_generic.c
181
return do_filereadv(SCARG(uap, fd), SCARG(uap, iovp),
sys/kern/sys_generic.c
186
do_filereadv(int fd, const struct iovec *iovp, int iovcnt,
sys/kern/sys_generic.c
200
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_generic.c
204
fd_putfile(fd);
sys/kern/sys_generic.c
283
ktrgeniov(fd, UIO_READ, ktriov, cnt, error);
sys/kern/sys_generic.c
291
fd_putfile(fd);
sys/kern/sys_generic.c
307
int fd;
sys/kern/sys_generic.c
309
fd = SCARG(uap, fd);
sys/kern/sys_generic.c
311
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_generic.c
315
fd_putfile(fd);
sys/kern/sys_generic.c
320
return (dofilewrite(fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
sys/kern/sys_generic.c
325
dofilewrite(int fd, struct file *fp, const void *buf,
sys/kern/sys_generic.c
364
ktrgenio(fd, UIO_WRITE, buf, cnt, error);
sys/kern/sys_generic.c
367
fd_putfile(fd);
sys/kern/sys_generic.c
383
return do_filewritev(SCARG(uap, fd), SCARG(uap, iovp),
sys/kern/sys_generic.c
388
do_filewritev(int fd, const struct iovec *iovp, int iovcnt,
sys/kern/sys_generic.c
402
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_generic.c
406
fd_putfile(fd);
sys/kern/sys_generic.c
491
ktrgeniov(fd, UIO_WRITE, ktriov, cnt, error);
sys/kern/sys_generic.c
499
fd_putfile(fd);
sys/kern/sys_generic.c
535
if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
sys/kern/sys_generic.c
547
fd_set_exclose(l, SCARG(uap, fd), com == FIOCLEX);
sys/kern/sys_generic.c
638
ktrgenio(SCARG(uap, fd), UIO_WRITE,
sys/kern/sys_generic.c
683
ktrgenio(SCARG(uap, fd), UIO_READ, SCARG(uap, data),
sys/kern/sys_generic.c
691
fd_putfile(SCARG(uap, fd));
sys/kern/sys_memfd.c
122
error = fd_allocfile(&fp, &fd);
sys/kern/sys_memfd.c
130
fd_set_exclose(l, fd, (flags & MFD_CLOEXEC) != 0);
sys/kern/sys_memfd.c
131
fd_set_foclose(l, fd, (flags & MFD_CLOFORK) != 0);
sys/kern/sys_memfd.c
132
fd_affix(p, fp, fd);
sys/kern/sys_memfd.c
134
*retval = fd;
sys/kern/sys_memfd.c
96
int error, fd;
sys/kern/sys_mqueue.c
278
const int fd = (int)mqd;
sys/kern/sys_mqueue.c
282
fp = fd_getfile(fd);
sys/kern/sys_mqueue.c
287
fd_putfile(fd);
sys/kern/sys_mqueue.c
291
fd_putfile(fd);
sys/kern/sys_pipe.c
212
int fd, error;
sys/kern/sys_pipe.c
228
error = fd_allocfile(&rf, &fd);
sys/kern/sys_pipe.c
231
fildes[0] = fd;
sys/kern/sys_pipe.c
233
error = fd_allocfile(&wf, &fd);
sys/kern/sys_pipe.c
236
fildes[1] = fd;
sys/kern/sys_select.c
513
int msk, i, j, fd, n;
sys/kern/sys_select.c
529
while ((j = ffs(ibits)) && (fd = i + --j) < nfd) {
sys/kern/sys_select.c
531
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/sys_select.c
537
l->l_selrec = fd;
sys/kern/sys_select.c
549
fd_putfile(fd);
sys/kern/sys_select.c
686
if (fds->fd < 0) {
sys/kern/sys_select.c
688
} else if ((fp = fd_getfile(fds->fd)) == NULL) {
sys/kern/sys_select.c
699
fd_putfile(fds->fd);
sys/kern/sys_select.c
831
const int fd = sip->sel_fdinfo, fbit = 1 << (fd & __NFDMASK);
sys/kern/sys_select.c
832
const int idx = fd >> __NFDSHIFT;
sys/kern/sys_timerfd.c
495
int fd, error;
sys/kern/sys_timerfd.c
511
if ((error = fd_allocfile(&fp, &fd)) != 0) {
sys/kern/sys_timerfd.c
522
fd_set_exclose(l, fd, !!(flags & TFD_CLOEXEC));
sys/kern/sys_timerfd.c
523
fd_affix(curproc, fp, fd);
sys/kern/sys_timerfd.c
525
*retval = fd;
sys/kern/sys_timerfd.c
546
do_timerfd_gettime(struct lwp *l, int fd, struct itimerspec *curr_value,
sys/kern/sys_timerfd.c
551
if ((fp = fd_getfile(fd)) == NULL) {
sys/kern/sys_timerfd.c
556
fd_putfile(fd);
sys/kern/sys_timerfd.c
565
fd_putfile(fd);
sys/kern/sys_timerfd.c
581
error = do_timerfd_gettime(l, SCARG(uap, fd), &oits, retval);
sys/kern/sys_timerfd.c
592
do_timerfd_settime(struct lwp *l, int fd, int flags,
sys/kern/sys_timerfd.c
608
if ((fp = fd_getfile(fd)) == NULL) {
sys/kern/sys_timerfd.c
613
fd_putfile(fd);
sys/kern/sys_timerfd.c
664
fd_putfile(fd);
sys/kern/sys_timerfd.c
691
error = do_timerfd_settime(l, SCARG(uap, fd), SCARG(uap, flags),
sys/kern/systrace_args.c
112
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1141
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1159
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1278
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1289
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1325
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1335
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1406
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1430
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1465
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1479
iarg[4] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1496
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1515
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1559
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
161
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
1784
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2021
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2081
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2119
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2152
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2162
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2173
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2231
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2520
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2584
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2620
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2680
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2691
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2702
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2742
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2816
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2847
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2875
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2900
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2916
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
293
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
2932
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3121
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3183
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3289
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3340
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
335
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3504
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3513
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3524
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3533
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3543
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3553
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3564
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3573
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3583
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3593
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3603
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3614
iarg[1] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3622
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3631
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3702
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3712
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3761
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
38
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3901
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
3922
iarg[2] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
429
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
47
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
492
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
532
iarg[4] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
65
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
678
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
698
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
887
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
896
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
913
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
922
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
974
iarg[0] = SCARG(p, fd); /* int */
sys/kern/systrace_args.c
982
iarg[0] = SCARG(p, fd); /* int */
sys/kern/tty_ptm.c
159
pty_alloc_master(struct lwp *l, int *fd, dev_t *dev, struct mount *mp,
sys/kern/tty_ptm.c
167
if ((error = fd_allocfile(&fp, fd)) != 0) {
sys/kern/tty_ptm.c
210
fd_set_exclose(l, *fd, (flags & O_CLOEXEC) != 0);
sys/kern/tty_ptm.c
211
fd_set_foclose(l, *fd, (flags & O_CLOFORK) != 0);
sys/kern/tty_ptm.c
212
fd_affix(curproc, fp, *fd);
sys/kern/tty_ptm.c
215
fd_abort(curproc, fp, *fd);
sys/kern/tty_ptm.c
261
pty_alloc_slave(struct lwp *l, int *fd, dev_t dev, struct mount *mp)
sys/kern/tty_ptm.c
268
if ((error = fd_allocfile(&fp, fd)) != 0) {
sys/kern/tty_ptm.c
288
fd_affix(curproc, fp, *fd);
sys/kern/tty_ptm.c
291
fd_abort(curproc, fp, *fd);
sys/kern/tty_ptm.c
342
int fd;
sys/kern/tty_ptm.c
351
if ((error = pty_alloc_master(l, &fd, &ttydev, mp, flag)) != 0)
sys/kern/tty_ptm.c
360
file_t *fp = fd_getfile(fd);
sys/kern/tty_ptm.c
362
fd_close(fd);
sys/kern/tty_ptm.c
367
curlwp->l_dupfd = fd;
sys/kern/uipc_sem.c
1022
int fd, error;
sys/kern/uipc_sem.c
1026
error = ksem_get(SCARG(uap, id), &ks, &fd);
sys/kern/uipc_sem.c
1032
ksem_release(ks, fd);
sys/kern/uipc_sem.c
1044
int fd, error;
sys/kern/uipc_sem.c
1049
error = ksem_get(id, &ks, &fd);
sys/kern/uipc_sem.c
1067
KASSERT(fd == -1);
sys/kern/uipc_sem.c
1073
fd = ks->ks_pshared_fd;
sys/kern/uipc_sem.c
1079
file_t *fp __diagused = fd_getfile(fd);
sys/kern/uipc_sem.c
1087
fd_putfile(fd);
sys/kern/uipc_sem.c
1090
return fd_close(fd);
sys/kern/uipc_sem.c
402
int fd;
sys/kern/uipc_sem.c
414
fd = -1;
sys/kern/uipc_sem.c
416
fd = (int)id;
sys/kern/uipc_sem.c
417
file_t *fp = fd_getfile(fd);
sys/kern/uipc_sem.c
422
fd_putfile(fd);
sys/kern/uipc_sem.c
433
*fdp = fd;
sys/kern/uipc_sem.c
518
ksem_release(ksem_t *ksem, int fd)
sys/kern/uipc_sem.c
538
if (fd != -1) {
sys/kern/uipc_sem.c
539
fd_putfile(fd);
sys/kern/uipc_sem.c
564
int fd, error;
sys/kern/uipc_sem.c
577
error = fd_allocfile(&fp, &fd);
sys/kern/uipc_sem.c
585
if (fd >= KSEM_MARKER_MIN) {
sys/kern/uipc_sem.c
591
fd_abort(p, fp, fd);
sys/kern/uipc_sem.c
598
fd_abort(p, fp, fd);
sys/kern/uipc_sem.c
604
ks->ks_pshared_fd = fd;
sys/kern/uipc_sem.c
608
id = (intptr_t)fd;
sys/kern/uipc_sem.c
614
fd_abort(p, fp, fd);
sys/kern/uipc_sem.c
619
fd_affix(p, fp, fd);
sys/kern/uipc_sem.c
648
int fd, error;
sys/kern/uipc_sem.c
654
error = fd_allocfile(&fp, &fd);
sys/kern/uipc_sem.c
663
if (fd >= KSEM_MARKER_MIN) {
sys/kern/uipc_sem.c
669
fd_abort(p, fp, fd);
sys/kern/uipc_sem.c
677
id = (intptr_t)fd;
sys/kern/uipc_sem.c
747
fd_affix(p, fp, fd);
sys/kern/uipc_sem.c
751
fd_abort(p, fp, fd);
sys/kern/uipc_sem.c
767
int fd, error;
sys/kern/uipc_sem.c
770
error = ksem_get(id, &ks, &fd);
sys/kern/uipc_sem.c
781
if (fd != -1)
sys/kern/uipc_sem.c
782
fd_putfile(fd);
sys/kern/uipc_sem.c
785
return fd_close(fd);
sys/kern/uipc_sem.c
914
int fd, error;
sys/kern/uipc_sem.c
917
error = ksem_get(SCARG(uap, id), &ks, &fd);
sys/kern/uipc_sem.c
931
ksem_release(ks, fd);
sys/kern/uipc_sem.c
938
int fd, error, timeo;
sys/kern/uipc_sem.c
941
error = ksem_get(id, &ks, &fd);
sys/kern/uipc_sem.c
964
ksem_release(ks, fd);
sys/kern/uipc_socket.c
590
int error, fd, flags;
sys/kern/uipc_socket.c
601
if ((error = fd_allocfile(&fp, &fd)) != 0) {
sys/kern/uipc_socket.c
605
fd_set_exclose(l, fd, (flags & SOCK_CLOEXEC) != 0);
sys/kern/uipc_socket.c
606
fd_set_foclose(l, fd, (flags & SOCK_CLOFORK) != 0);
sys/kern/uipc_socket.c
619
*fdout = fd;
sys/kern/uipc_syscalls.c
116
int fd, error;
sys/kern/uipc_syscalls.c
120
SCARG(uap, protocol), &fd, &fp, NULL);
sys/kern/uipc_syscalls.c
122
fd_affix(l->l_proc, fp, fd);
sys/kern/uipc_syscalls.c
123
*retval = fd;
sys/kern/uipc_syscalls.c
1348
do_sys_getpeername(int fd, struct sockaddr *nam)
sys/kern/uipc_syscalls.c
1353
if ((error = fd_getsock(fd, &so)) != 0)
sys/kern/uipc_syscalls.c
1363
fd_putfile(fd);
sys/kern/uipc_syscalls.c
1371
do_sys_getsockname(int fd, struct sockaddr *nam)
sys/kern/uipc_syscalls.c
1376
if ((error = fd_getsock(fd, &so)) != 0)
sys/kern/uipc_syscalls.c
1382
fd_putfile(fd);
sys/kern/uipc_syscalls.c
147
do_sys_bind(struct lwp *l, int fd, struct sockaddr *nam)
sys/kern/uipc_syscalls.c
152
if ((error = fd_getsock(fd, &so)) != 0)
sys/kern/uipc_syscalls.c
155
fd_putfile(fd);
sys/kern/uipc_syscalls.c
1638
int fd;
sys/kern/uipc_syscalls.c
1653
error = fd_allocfile(&nfp, &fd);
sys/kern/uipc_syscalls.c
1663
*(int *) data = fd;
sys/kern/uipc_syscalls.c
1676
fd_abort(curlwp->l_proc, nfp, fd);
sys/kern/uipc_syscalls.c
1688
fd_affix(curlwp->l_proc, nfp, fd);
sys/kern/uipc_syscalls.c
181
int error, fd;
sys/kern/uipc_syscalls.c
191
if ((error = fd_allocfile(&fp2, &fd)) != 0) {
sys/kern/uipc_syscalls.c
195
*new_sock = fd;
sys/kern/uipc_syscalls.c
258
fd_abort(curproc, NULL, fd);
sys/kern/uipc_syscalls.c
260
fd_set_exclose(l, fd, (flags & SOCK_CLOEXEC) != 0);
sys/kern/uipc_syscalls.c
261
fd_set_foclose(l, fd, (flags & SOCK_CLOFORK) != 0);
sys/kern/uipc_syscalls.c
262
fd_affix(curproc, fp2, fd);
sys/kern/uipc_syscalls.c
271
fd_abort(curproc, fp2, fd);
sys/kern/uipc_syscalls.c
285
int error, fd;
sys/kern/uipc_syscalls.c
296
fd = (int)*retval;
sys/kern/uipc_syscalls.c
297
if (fd_getfile(fd) != NULL)
sys/kern/uipc_syscalls.c
298
(void)fd_close(fd);
sys/kern/uipc_syscalls.c
314
int error, fd;
sys/kern/uipc_syscalls.c
334
fd = (int)*retval;
sys/kern/uipc_syscalls.c
335
if (fd_getfile(fd) != NULL)
sys/kern/uipc_syscalls.c
336
(void)fd_close(fd);
sys/kern/uipc_syscalls.c
360
do_sys_connect(struct lwp *l, int fd, struct sockaddr *nam)
sys/kern/uipc_syscalls.c
366
if ((error = fd_getsock(fd, &so)) != 0) {
sys/kern/uipc_syscalls.c
407
fd_putfile(fd);
sys/kern/uipc_syscalls.c
423
int fd, error, sv[2];
sys/kern/uipc_syscalls.c
430
error = fsocreate(domain, &so1, type|flags, proto, &fd, &fp1, NULL);
sys/kern/uipc_syscalls.c
433
sv[0] = fd;
sys/kern/uipc_syscalls.c
435
error = fsocreate(domain, &so2, type|flags, proto, &fd, &fp2, so1);
sys/kern/uipc_syscalls.c
438
sv[1] = fd;
sys/kern/uipc_usrreq.c
1483
const int fd = fdp[i];
sys/kern/uipc_usrreq.c
1485
fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
sys/kern/uipc_usrreq.c
1486
fd_set_foclose(l, fd, (flags & O_CLOFORK) != 0);
sys/kern/uipc_usrreq.c
1487
fd_affix(p, fp, fd);
sys/kern/uipc_usrreq.c
1491
*ofdp++ = fd;
sys/kern/uipc_usrreq.c
1546
int i, fd, *fdp;
sys/kern/uipc_usrreq.c
1567
fd = *fdp++;
sys/kern/uipc_usrreq.c
1574
if ((fp = fd_getfile(fd)) == NULL
sys/kern/uipc_usrreq.c
1577
fd_putfile(fd);
sys/kern/vfs_syscalls.c
1388
do_sys_fstatvfs(struct lwp *l, int fd, int flags, struct statvfs *sb)
sys/kern/vfs_syscalls.c
1395
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/kern/vfs_syscalls.c
1399
fd_putfile(fd);
sys/kern/vfs_syscalls.c
1417
error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
sys/kern/vfs_syscalls.c
1503
do_sys_fchdir(struct lwp *l, int fd, register_t *retval)
sys/kern/vfs_syscalls.c
1513
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/kern/vfs_syscalls.c
1556
fd_putfile(fd);
sys/kern/vfs_syscalls.c
1572
return do_sys_fchdir(l, SCARG(uap, fd), retval);
sys/kern/vfs_syscalls.c
1585
int error, fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
1591
if ((error = fd_getvnode(fd, &fp)) != 0)
sys/kern/vfs_syscalls.c
1606
fd_putfile(fd);
sys/kern/vfs_syscalls.c
1757
int open_mode, int *fd)
sys/kern/vfs_syscalls.c
1802
*fd = indx;
sys/kern/vfs_syscalls.c
1808
*fd = indx;
sys/kern/vfs_syscalls.c
1816
fd_open(const char *path, int open_flags, int open_mode, int *fd)
sys/kern/vfs_syscalls.c
1829
error = do_open(curlwp, NULL, pb, open_flags, open_mode, fd);
sys/kern/vfs_syscalls.c
1837
int mode, int *fd)
sys/kern/vfs_syscalls.c
1873
error = do_open(l, dvp, pb, flags, mode, fd);
sys/kern/vfs_syscalls.c
1892
int fd;
sys/kern/vfs_syscalls.c
1895
SCARG(uap, flags), SCARG(uap, mode), &fd);
sys/kern/vfs_syscalls.c
1898
*retval = fd;
sys/kern/vfs_syscalls.c
1914
int fd;
sys/kern/vfs_syscalls.c
1916
error = do_sys_openat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
1917
SCARG(uap, oflags), SCARG(uap, mode), &fd);
sys/kern/vfs_syscalls.c
1920
*retval = fd;
sys/kern/vfs_syscalls.c
2409
return do_posix_mknodat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2561
return do_sys_mkfifoat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2797
return do_sys_symlinkat(l, SCARG(uap, path1), SCARG(uap, fd),
sys/kern/vfs_syscalls.c
2872
return do_sys_unlinkat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
2994
int error, fd;
sys/kern/vfs_syscalls.c
3005
fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
3007
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/vfs_syscalls.c
3018
fd_putfile(fd);
sys/kern/vfs_syscalls.c
3036
int error, fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
3038
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/vfs_syscalls.c
3042
fd_putfile(fd);
sys/kern/vfs_syscalls.c
3057
return dofileread(fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
sys/kern/vfs_syscalls.c
3061
fd_putfile(fd);
sys/kern/vfs_syscalls.c
3080
return do_filereadv(SCARG(uap, fd), SCARG(uap, iovp),
sys/kern/vfs_syscalls.c
3099
int error, fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
3101
if ((fp = fd_getfile(fd)) == NULL)
sys/kern/vfs_syscalls.c
3105
fd_putfile(fd);
sys/kern/vfs_syscalls.c
3120
return dofilewrite(fd, fp, SCARG(uap, buf), SCARG(uap, nbyte),
sys/kern/vfs_syscalls.c
3124
fd_putfile(fd);
sys/kern/vfs_syscalls.c
3143
return do_filewritev(SCARG(uap, fd), SCARG(uap, iovp),
sys/kern/vfs_syscalls.c
3237
return do_sys_accessat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
3340
error = do_sys_statat(l, SCARG(uap, fd), SCARG(uap, path), nd_flag,
sys/kern/vfs_syscalls.c
3472
return do_sys_readlinkat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
3517
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3522
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
3623
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3626
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
3641
return do_sys_chmodat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
3773
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3777
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
3793
return do_sys_chownat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
3815
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3819
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
3973
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3977
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
3993
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
3997
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
4035
error = do_sys_utimensat(l, SCARG(uap, fd), NULL,
sys/kern/vfs_syscalls.c
4228
int error, fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
4230
fp = fd_getfile(fd);
sys/kern/vfs_syscalls.c
4238
fd_putfile(fd);
sys/kern/vfs_syscalls.c
4257
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
4263
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
4291
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
4333
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
4353
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
4359
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
4781
return do_sys_mkdirat(l, SCARG(uap, fd), SCARG(uap, path),
sys/kern/vfs_syscalls.c
4872
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/kern/vfs_syscalls.c
4880
ktrgenio(SCARG(uap, fd), UIO_READ, SCARG(uap, buf), done, error);
sys/kern/vfs_syscalls.c
4883
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_syscalls.c
4967
int fd;
sys/kern/vfs_syscalls.c
4973
fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
4982
error = fd_getvnode(fd, &fp);
sys/kern/vfs_syscalls.c
5002
fd_putfile(fd);
sys/kern/vfs_syscalls.c
5021
int fd;
sys/kern/vfs_syscalls.c
5027
fd = SCARG(uap, fd);
sys/kern/vfs_syscalls.c
5035
error = fd_getvnode(fd, &fp);
sys/kern/vfs_syscalls.c
5054
fd_putfile(fd);
sys/kern/vfs_xattr.c
1035
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
1045
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
1173
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
1207
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
1295
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
1304
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
447
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
455
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
547
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
555
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
645
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
652
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
731
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
740
fd_putfile(SCARG(uap, fd));
sys/kern/vfs_xattr.c
926
error = fd_getvnode(SCARG(uap, fd), &fp);
sys/kern/vfs_xattr.c
937
fd_putfile(SCARG(uap, fd));
sys/lib/libsa/bootcfg.c
106
int fd, err;
sys/lib/libsa/bootcfg.c
119
fd = open(conf, 0);
sys/lib/libsa/bootcfg.c
120
if (fd < 0)
sys/lib/libsa/bootcfg.c
123
err = fstat(fd, &st);
sys/lib/libsa/bootcfg.c
131
close(fd);
sys/lib/libsa/bootcfg.c
138
close(fd);
sys/lib/libsa/bootcfg.c
154
len = read(fd, bc + off, uimin(1024, resid));
sys/lib/libsa/bootcfg.c
162
close(fd);
sys/lib/libsa/close.c
67
close(int fd)
sys/lib/libsa/close.c
69
oclose(int fd)
sys/lib/libsa/close.c
72
struct open_file *f = &files[fd];
sys/lib/libsa/close.c
76
if ((unsigned int)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/cread.c
158
got = oread(s->fd, s->inbuf, Z_BUFSIZE);
sys/lib/libsa/cread.c
263
int fd;
sys/lib/libsa/cread.c
266
if (((fd = oopen(fname, mode)) == -1) || (mode != 0))
sys/lib/libsa/cread.c
268
return fd;
sys/lib/libsa/cread.c
270
ss[fd] = s = alloc(sizeof(struct sd));
sys/lib/libsa/cread.c
284
s->fd = fd;
sys/lib/libsa/cread.c
286
return fd;
sys/lib/libsa/cread.c
291
ss[fd] = NULL;
sys/lib/libsa/cread.c
292
oclose(fd);
sys/lib/libsa/cread.c
297
close(int fd)
sys/lib/libsa/cread.c
302
if ((unsigned int)fd >= SOPEN_MAX) {
sys/lib/libsa/cread.c
308
s = ss[fd];
sys/lib/libsa/cread.c
317
return oclose(fd);
sys/lib/libsa/cread.c
321
read(int fd, void *buf, size_t len)
sys/lib/libsa/cread.c
328
s = ss[fd];
sys/lib/libsa/cread.c
355
got = oread(s->fd, s->stream.next_out,
sys/lib/libsa/cread.c
367
got = oread(fd, s->inbuf, Z_BUFSIZE);
sys/lib/libsa/cread.c
426
lseek(int fd, off_t offset, int where)
sys/lib/libsa/cread.c
432
if ((unsigned int)fd >= SOPEN_MAX) {
sys/lib/libsa/cread.c
437
f = &files[fd];
sys/lib/libsa/cread.c
440
return olseek(fd, offset, where);
sys/lib/libsa/cread.c
442
s = ss[fd];
sys/lib/libsa/cread.c
445
off_t res = olseek(fd, offset, where);
sys/lib/libsa/cread.c
463
res = olseek(fd, 0, SEEK_SET);
sys/lib/libsa/cread.c
477
s->fd = fd;
sys/lib/libsa/cread.c
492
if (read(fd, dummybuf, len) != len) {
sys/lib/libsa/cread.c
74
int fd;
sys/lib/libsa/dosfs.c
180
dos_mount(DOS_FS *fs, struct open_file *fd)
sys/lib/libsa/dosfs.c
185
fs->fd = fd;
sys/lib/libsa/dosfs.c
187
(err = ioget(fs->fd, 0, fs->buf, 1)) ||
sys/lib/libsa/dosfs.c
228
dosfs_open(const char *path, struct open_file *fd)
sys/lib/libsa/dosfs.c
239
if ((err = dos_mount(fs, fd)))
sys/lib/libsa/dosfs.c
269
fd->f_fsdata = (void *)f;
sys/lib/libsa/dosfs.c
280
dosfs_read(struct open_file *fd, void *vbuf, size_t nbyte, size_t *resid)
sys/lib/libsa/dosfs.c
285
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
sys/lib/libsa/dosfs.c
338
dosfs_write(struct open_file *fd, void *start, size_t size, size_t *resid)
sys/lib/libsa/dosfs.c
350
dosfs_seek(struct open_file *fd, off_t offset, int whence)
sys/lib/libsa/dosfs.c
354
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
sys/lib/libsa/dosfs.c
384
dosfs_close(struct open_file *fd)
sys/lib/libsa/dosfs.c
386
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
sys/lib/libsa/dosfs.c
400
dosfs_stat(struct open_file *fd, struct stat *sb)
sys/lib/libsa/dosfs.c
402
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
sys/lib/libsa/dosfs.c
550
if ((err = ioget(fs->fd, lsec + sec, dir, 1)))
sys/lib/libsa/dosfs.c
68
struct open_file *fd; /* file descriptor */
sys/lib/libsa/dosfs.c
762
if ((err = ioget(fs->fd, bytsec(offset), s, bytsec(nbyte))))
sys/lib/libsa/dosfs.c
784
if ((err = ioget(fs->fd, lsec, fs->buf, 1)))
sys/lib/libsa/dosfs.c
795
ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec)
sys/lib/libsa/dosfs.c
803
err = DEV_STRATEGY(fd->f_dev)(fd->f_devdata, F_READ, lsec,
sys/lib/libsa/fstat.c
37
fstat(int fd, struct stat *sb)
sys/lib/libsa/fstat.c
39
struct open_file *f = &files[fd];
sys/lib/libsa/fstat.c
42
if ((unsigned int)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/getfile.c
40
int fd;
sys/lib/libsa/getfile.c
48
} while ((fd = open(buf, mode)) < 0);
sys/lib/libsa/getfile.c
50
return fd;
sys/lib/libsa/ioctl.c
66
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
73
if ((unsigned int)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/loadfile.c
100
if ((fd = open(fname, 0)) < 0) {
sys/lib/libsa/loadfile.c
106
if ((error = fdloadfile(fd, marks, flags)) != 0) {
sys/lib/libsa/loadfile.c
107
(void)close(fd);
sys/lib/libsa/loadfile.c
112
return fd;
sys/lib/libsa/loadfile.c
121
fdloadfile(int fd, u_long *marks, int flags)
sys/lib/libsa/loadfile.c
141
if (lseek(fd, 0, SEEK_SET) == (off_t)-1)
sys/lib/libsa/loadfile.c
143
nr = read(fd, &hdr, sizeof(hdr));
sys/lib/libsa/loadfile.c
156
rval = loadfile_coff(fd, &hdr.coff, marks, flags);
sys/lib/libsa/loadfile.c
164
rval = loadfile_elf32(fd, &hdr.elf32, marks, flags);
sys/lib/libsa/loadfile.c
172
rval = loadfile_elf64(fd, &hdr.elf64, marks, flags);
sys/lib/libsa/loadfile.c
181
rval = loadfile_aout(fd, &hdr.aout, marks, flags);
sys/lib/libsa/loadfile.c
97
int fd, error;
sys/lib/libsa/loadfile.h
67
int fdloadfile(int fd, u_long *, int);
sys/lib/libsa/loadfile_aout.c
110
if (lseek(fd, sizeof(*x), SEEK_SET) == -1) {
sys/lib/libsa/loadfile_aout.c
137
nr = READ(fd, maxp, x->a_text - sub);
sys/lib/libsa/loadfile_aout.c
148
if (lseek(fd, x->a_text - sub, SEEK_CUR) == -1) {
sys/lib/libsa/loadfile_aout.c
178
nr = READ(fd, maxp, x->a_data);
sys/lib/libsa/loadfile_aout.c
190
if (lseek(fd, x->a_data, SEEK_CUR) == -1) {
sys/lib/libsa/loadfile_aout.c
229
nr = READ(fd, maxp, x->a_syms);
sys/lib/libsa/loadfile_aout.c
240
if (lseek(fd, x->a_syms, SEEK_CUR) == -1) {
sys/lib/libsa/loadfile_aout.c
248
nr = read(fd, &cc, sizeof(cc));
sys/lib/libsa/loadfile_aout.c
276
nr = READ(fd, maxp, cc);
sys/lib/libsa/loadfile_aout.c
287
if (lseek(fd, cc, SEEK_CUR) == -1) {
sys/lib/libsa/loadfile_aout.c
88
loadfile_aout(int fd, struct exec *x, u_long *marks, int flags)
sys/lib/libsa/loadfile_ecoff.c
101
nr = READ(fd, coff->a.data_start, coff->a.dsize);
sys/lib/libsa/loadfile_ecoff.c
54
loadfile_coff(int fd, struct ecoff_exechdr *coff, u_long *marks, int flags)
sys/lib/libsa/loadfile_ecoff.c
64
if (lseek(fd, ECOFF_TXTOFF(coff), SEEK_SET) == -1) {
sys/lib/libsa/loadfile_ecoff.c
72
nr = READ(fd, coff->a.text_start, coff->a.tsize);
sys/lib/libsa/loadfile_ecoff.c
82
if (lseek(fd, coff->a.tsize, SEEK_CUR) == -1) {
sys/lib/libsa/loadfile_elf32.c
281
ELFNAMEEND(readfile_local)(int fd, Elf_Off elfoff, void *addr, size_t size)
sys/lib/libsa/loadfile_elf32.c
285
if (lseek(fd, elfoff, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf32.c
289
nr = read(fd, addr, size);
sys/lib/libsa/loadfile_elf32.c
307
ELFNAMEEND(readfile_global)(int fd, u_long offset, Elf_Off elfoff,
sys/lib/libsa/loadfile_elf32.c
315
if (lseek(fd, elfoff, SEEK_SET) == -1) {
sys/lib/libsa/loadfile_elf32.c
319
nr = READ(fd, addr, size);
sys/lib/libsa/loadfile_elf32.c
347
ELFNAMEEND(loadfile_dynamic)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
sys/lib/libsa/loadfile_elf32.c
369
ret = ELFNAMEEND(readfile_local)(fd, elf->e_shoff, shdr, shdrsz);
sys/lib/libsa/loadfile_elf32.c
421
ret = ELFNAMEEND(readfile_global)(fd, offset,
sys/lib/libsa/loadfile_elf32.c
466
ret = ELFNAMEEND(readfile_global)(fd, offset,
sys/lib/libsa/loadfile_elf32.c
507
ELFNAMEEND(loadsym)(int fd, Elf_Ehdr *elf, Elf_Addr maxp, Elf_Addr elfp,
sys/lib/libsa/loadfile_elf32.c
527
ret = ELFNAMEEND(readfile_local)(fd, elf->e_shoff, shp, sz);
sys/lib/libsa/loadfile_elf32.c
547
ret = ELFNAMEEND(readfile_global)(fd, offset,
sys/lib/libsa/loadfile_elf32.c
556
ret = ELFNAMEEND(readfile_local)(fd, shstroff, shstr, shstrsz);
sys/lib/libsa/loadfile_elf32.c
605
ret = ELFNAMEEND(readfile_global)(fd, offset,
sys/lib/libsa/loadfile_elf32.c
623
ret = ELFNAMEEND(readfile_local)(fd, shp[i].sh_offset,
sys/lib/libsa/loadfile_elf32.c
685
ELFNAMEEND(loadfile_static)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
sys/lib/libsa/loadfile_elf32.c
709
ret = ELFNAMEEND(readfile_local)(fd, elf->e_phoff, phdr, sz);
sys/lib/libsa/loadfile_elf32.c
736
ret = ELFNAMEEND(readfile_global)(fd, offset,
sys/lib/libsa/loadfile_elf32.c
784
if (ELFNAMEEND(loadsym)(fd, elf, maxp, elfp, marks, flags,
sys/lib/libsa/loadfile_elf32.c
818
ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
sys/lib/libsa/loadfile_elf32.c
821
return ELFNAMEEND(loadfile_dynamic)(fd, elf, marks, flags);
sys/lib/libsa/loadfile_elf32.c
823
return ELFNAMEEND(loadfile_static)(fd, elf, marks, flags);
sys/lib/libsa/ls.c
102
if ((fd = open(path, 0)) < 0
sys/lib/libsa/ls.c
103
|| fstat(fd, &sb) < 0
sys/lib/libsa/ls.c
107
if (fd >= 0)
sys/lib/libsa/ls.c
108
close(fd);
sys/lib/libsa/ls.c
118
fd = open(p, 0);
sys/lib/libsa/ls.c
121
fd = open("", 0);
sys/lib/libsa/ls.c
125
if (fd < 0) {
sys/lib/libsa/ls.c
129
if (fstat(fd, &sb) < 0) {
sys/lib/libsa/ls.c
139
f = &files[fd];
sys/lib/libsa/ls.c
142
if ((unsigned int)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/ls.c
162
close(fd);
sys/lib/libsa/ls.c
95
int fd;
sys/lib/libsa/lseek.c
67
lseek(int fd, off_t offset, int where)
sys/lib/libsa/lseek.c
69
olseek(int fd, off_t offset, int where)
sys/lib/libsa/lseek.c
72
struct open_file *f = &files[fd];
sys/lib/libsa/lseek.c
75
if ((unsigned int)fd >= SOPEN_MAX || f->f_flags == 0) {
sys/lib/libsa/netif.c
277
int fd;
sys/lib/libsa/netif.c
282
for (fd = 0, s = sockets; fd < SOPEN_MAX; fd++, s++)
sys/lib/libsa/netif.c
304
return fd;
sys/lib/libsa/open.c
122
return fd;
sys/lib/libsa/open.c
133
return fd;
sys/lib/libsa/open.c
142
return fd;
sys/lib/libsa/open.c
81
int fd, error;
sys/lib/libsa/open.c
88
for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++)
sys/lib/libsa/read.c
68
read(int fd, void *dest, size_t bcount)
sys/lib/libsa/read.c
70
oread(int fd, void *dest, size_t bcount)
sys/lib/libsa/read.c
73
struct open_file *f = &files[fd];
sys/lib/libsa/read.c
77
if ((unsigned int)fd >= SOPEN_MAX || !(f->f_flags & F_READ)) {
sys/lib/libsa/stat.c
39
int fd, rv;
sys/lib/libsa/stat.c
41
fd = open(str, 0);
sys/lib/libsa/stat.c
42
if (fd < 0)
sys/lib/libsa/stat.c
44
rv = fstat(fd, sb);
sys/lib/libsa/stat.c
45
(void)close(fd);
sys/lib/libsa/write.c
67
write(int fd, const void *destp, size_t bcount)
sys/lib/libsa/write.c
69
struct open_file *f = &files[fd];
sys/lib/libsa/write.c
74
if ((unsigned int)fd >= SOPEN_MAX || !(f->f_flags & F_WRITE)) {
sys/miscfs/fdesc/fdesc_vfsops.c
177
struct fdescnode *fd;
sys/miscfs/fdesc/fdesc_vfsops.c
182
fd = kmem_alloc(sizeof(struct fdescnode), KM_SLEEP);
sys/miscfs/fdesc/fdesc_vfsops.c
183
fd->fd_fd = -1;
sys/miscfs/fdesc/fdesc_vfsops.c
184
fd->fd_link = NULL;
sys/miscfs/fdesc/fdesc_vfsops.c
185
fd->fd_ix = ix;
sys/miscfs/fdesc/fdesc_vfsops.c
186
fd->fd_vnode = vp;
sys/miscfs/fdesc/fdesc_vfsops.c
189
vp->v_data = fd;
sys/miscfs/fdesc/fdesc_vfsops.c
192
fd->fd_type = Froot;
sys/miscfs/fdesc/fdesc_vfsops.c
197
fd->fd_type = Fdevfd;
sys/miscfs/fdesc/fdesc_vfsops.c
201
fd->fd_type = Fctty;
sys/miscfs/fdesc/fdesc_vfsops.c
205
fd->fd_type = Flink;
sys/miscfs/fdesc/fdesc_vfsops.c
206
fd->fd_link = "fd/0";
sys/miscfs/fdesc/fdesc_vfsops.c
210
fd->fd_type = Flink;
sys/miscfs/fdesc/fdesc_vfsops.c
211
fd->fd_link = "fd/1";
sys/miscfs/fdesc/fdesc_vfsops.c
215
fd->fd_type = Flink;
sys/miscfs/fdesc/fdesc_vfsops.c
216
fd->fd_link = "fd/2";
sys/miscfs/fdesc/fdesc_vfsops.c
221
fd->fd_type = Fdesc;
sys/miscfs/fdesc/fdesc_vfsops.c
222
fd->fd_fd = ix - FD_DESC;
sys/miscfs/fdesc/fdesc_vfsops.c
227
*new_key = &fd->fd_ix;
sys/miscfs/fdesc/fdesc_vnops.c
183
unsigned fd = 0;
sys/miscfs/fdesc/fdesc_vnops.c
246
fd = 0;
sys/miscfs/fdesc/fdesc_vnops.c
248
fd = 10 * fd + *pname++ - '0';
sys/miscfs/fdesc/fdesc_vnops.c
249
if (fd >= dt->dt_nfiles)
sys/miscfs/fdesc/fdesc_vnops.c
258
if (fd >= dt->dt_nfiles || dt->dt_ff[fd] == NULL ||
sys/miscfs/fdesc/fdesc_vnops.c
259
dt->dt_ff[fd]->ff_file == NULL) {
sys/miscfs/fdesc/fdesc_vnops.c
264
ix = FD_DESC + fd;
sys/miscfs/fdesc/fdesc_vnops.c
328
fdesc_attr(int fd, struct vattr *vap, kauth_cred_t cred)
sys/miscfs/fdesc/fdesc_vnops.c
334
if ((fp = fd_getfile(fd)) == NULL)
sys/miscfs/fdesc/fdesc_vnops.c
388
fd_putfile(fd);
sys/miscfs/fdesc/fdesc_vnops.c
403
unsigned fd;
sys/miscfs/fdesc/fdesc_vnops.c
459
fd = VTOFDESC(vp)->fd_fd;
sys/miscfs/fdesc/fdesc_vnops.c
460
error = fdesc_attr(fd, vap, ap->a_cred);
sys/miscfs/fdesc/fdesc_vnops.c
483
unsigned fd;
sys/miscfs/fdesc/fdesc_vnops.c
499
fd = VTOFDESC(ap->a_vp)->fd_fd;
sys/miscfs/fdesc/fdesc_vnops.c
500
if ((fp = fd_getfile(fd)) == NULL)
sys/miscfs/fdesc/fdesc_vnops.c
508
fd_putfile(fd);
sys/miscfs/fdesc/fdesc_vnops.c
803
int error, fd;
sys/miscfs/fdesc/fdesc_vnops.c
813
fd = VTOFDESC(ap->a_vp)->fd_fd;
sys/miscfs/fdesc/fdesc_vnops.c
814
if ((fp = fd_getfile(fd)) == NULL)
sys/miscfs/fdesc/fdesc_vnops.c
817
fd_putfile(fd);
sys/miscfs/fdesc/fdesc_vnops.c
834
struct fdescnode *fd = VTOFDESC(vp);
sys/miscfs/fdesc/fdesc_vnops.c
840
if (fd->fd_type == Fctty || fd->fd_type == Fdesc)
sys/miscfs/fdesc/fdesc_vnops.c
853
struct fdescnode *fd = VTOFDESC(vp);
sys/miscfs/fdesc/fdesc_vnops.c
858
kmem_free(fd, sizeof(struct fdescnode));
sys/miscfs/procfs/procfs.h
203
#define PROCFS_FILENO(pid, type, fd) procfs_fileno(pid, type, fd)
sys/miscfs/procfs/procfs_subr.c
128
pfstype type, int fd)
sys/miscfs/procfs/procfs_subr.c
135
key.pk_fd = fd;
sys/miscfs/procfs/procfs_vnops.c
1200
int fd;
sys/miscfs/procfs/procfs_vnops.c
1213
fd = atoi(pname, cnp->cn_namelen);
sys/miscfs/procfs/procfs_vnops.c
1215
fp = fd_getfile2(p, fd);
sys/miscfs/procfs/procfs_vnops.c
1234
PFSfd, fd);
sys/modules/examples/fopsmapper/fopsmapper.c
100
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/modules/examples/fopsmapper/fopsmapper.c
105
return fd_clone(fp, fd, flag, &mapper_fileops, fo);
sys/modules/examples/fopsmapper/fopsmapper.c
98
int fd, error;
sys/modules/examples/pollpal/cmd_pollpal.c
110
ret = write(fd, wbuf, sizeof(wbuf) - 1);
sys/modules/examples/pollpal/cmd_pollpal.c
121
ret = read(fd, rbuf, BUFFLEN);
sys/modules/examples/pollpal/cmd_pollpal.c
48
static int fd;
sys/modules/examples/pollpal/cmd_pollpal.c
83
fd = open(dev, O_RDWR, 0);
sys/modules/examples/pollpal/cmd_pollpal.c
84
if (fd == -1)
sys/modules/examples/pollpal/cmd_pollpal.c
87
fds.fd = fd;
sys/modules/examples/pollpal/pollpal.c
128
int error, fd;
sys/modules/examples/pollpal/pollpal.c
131
error = fd_allocfile(&fp, &fd);
sys/modules/examples/pollpal/pollpal.c
144
return fd_clone(fp, fd, flag, &pollpal_fileops, pl);
sys/net/bpf.c
589
int error, fd;
sys/net/bpf.c
592
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/net/bpf.c
623
return fd_clone(fp, fd, flag, &bpf_fileops, d);
sys/net/if_gre.c
1006
int fd, ofd, rc;
sys/net/if_gre.c
1011
fd = -1;
sys/net/if_gre.c
1019
rc = fd_dup(fp, 0, &fd, false, false);
sys/net/if_gre.c
1031
sc->sc_fd = fd;
sys/net/if_gre.c
1064
gre_ssock(struct ifnet *ifp, struct gre_soparm *sp, int fd)
sys/net/if_gre.c
1073
if ((fp = fd_getfile(fd)) == NULL)
sys/net/if_gre.c
1076
fd_putfile(fd);
sys/net/if_gre.c
1116
fd_putfile(fd);
sys/net/if_gre.c
1164
int fd, error = 0, oproto, otype, s;
sys/net/if_gre.c
1343
fd = 0;
sys/net/if_gre.c
1344
error = gre_socreate(sc, sp, &fd);
sys/net/if_gre.c
1351
error = gre_ssock(ifp, sp, fd);
sys/net/if_gre.c
1356
if (fd_getfile(fd) != NULL)
sys/net/if_gre.c
1357
fd_close(fd);
sys/net/if_gre.c
1383
fd = (int)ifr->ifr_value;
sys/net/if_gre.c
437
int fd, rc;
sys/net/if_gre.c
447
rc = fsocreate(af, &so, sp->sp_type, sp->sp_proto, &fd, &fp, NULL);
sys/net/if_gre.c
487
fd_abort(curproc, fp, fd);
sys/net/if_gre.c
489
fd_affix(curproc, fp, fd);
sys/net/if_gre.c
490
*fdout = fd;
sys/net/if_tap.c
719
int error, fd;
sys/net/if_tap.c
721
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/net/if_tap.c
725
fd_abort(curproc, fp, fd);
sys/net/if_tap.c
732
return fd_clone(fp, fd, FREAD | FWRITE, &tap_fileops,
sys/net/zlib.c
181
# define fdopen(fd,mode) NULL /* No fdopen() */
sys/net/zlib.c
195
# define fdopen(fd,mode) NULL /* No fdopen() */
sys/net/zlib.c
199
# define fdopen(fd,type) _fdopen(fd,type)
sys/netinet/sctputil.c
561
sctp_audit_log(u_int8_t ev, u_int8_t fd)
sys/netinet/sctputil.c
564
sctp_audit_data[sctp_audit_indx][1] = fd;
sys/opencrypto/cryptodev.c
1079
int fd, error;
sys/opencrypto/cryptodev.c
1087
if ((error = fd_allocfile(&fp, &fd)) != 0) {
sys/opencrypto/cryptodev.c
1093
error = fd_clone(fp, fd, flag, &cryptofops, fcr);
sys/rump/dev/lib/libugenhc/ugenhc.c
447
int fd, error;
sys/rump/dev/lib/libugenhc/ugenhc.c
457
error = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &fd);
sys/rump/dev/lib/libugenhc/ugenhc.c
463
sc->sc_ugenfd[UGEN_EPT_CTRL] = fd;
sys/rump/dev/lib/libugenhc/ugenhc.c
484
error = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &fd);
sys/rump/dev/lib/libugenhc/ugenhc.c
485
if (fd == -1)
sys/rump/dev/lib/libugenhc/ugenhc.c
488
error = rumpuser_close(fd);
sys/rump/dev/lib/libugenhc/ugenhc.c
776
int fd, val;
sys/rump/dev/lib/libugenhc/ugenhc.c
824
error = rumpuser_open(buf, oflags, &fd);
sys/rump/dev/lib/libugenhc/ugenhc.c
829
if (rumpcomp_ugenhc_ioctl(fd, USB_SET_TIMEOUT, &val,
sys/rump/dev/lib/libugenhc/ugenhc.c
832
sc->sc_ugenfd[endpt] = fd;
sys/rump/dev/lib/libugenhc/ugenhc_user.c
45
rumpcomp_ugenhc_ioctl(int fd, u_long cmd, void *data, int *ioctlrv)
sys/rump/dev/lib/libugenhc/ugenhc_user.c
51
*ioctlrv = ioctl(fd, cmd, data);
sys/rump/fs/lib/libsyspuffs/puffs_rumpglue.c
182
rump_syspuffs_glueinit(int fd, int *newfd)
sys/rump/fs/lib/libsyspuffs/puffs_rumpglue.c
196
pap->comfd = fd;
sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c
115
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c
188
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c
251
fd_putfile(SCARG(uap, fd));
sys/rump/kern/lib/libsys_linux/linux_rump.c
27
SCARG(&ua, fd) = SCARG(uap, fd);
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
157
error = do_sys_fstat(SCARG(uap, fd), &sb);
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
274
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
380
fd_putfile(SCARG(uap, fd));
sys/rump/librump/rumpkern/cons.c
79
int fd, error;
sys/rump/librump/rumpkern/cons.c
86
if ((error = fd_allocfile(&fp, &fd)) != 0)
sys/rump/librump/rumpkern/cons.c
93
fd_affix(curproc, fp, fd);
sys/rump/librump/rumpkern/cons.c
95
KASSERT(fd == 0);
sys/rump/librump/rumpkern/rump_syscalls.c
100
rump___sysimpl_write(int fd, const void * buf, size_t nbyte)
sys/rump/librump/rumpkern/rump_syscalls.c
108
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1312
rump___sysimpl_fcntl(int fd, int cmd, void * arg)
sys/rump/librump/rumpkern/rump_syscalls.c
1320
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1376
rump___sysimpl_fsync(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
1384
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1557
rump___sysimpl_readv(int fd, const struct iovec * iovp, int iovcnt)
sys/rump/librump/rumpkern/rump_syscalls.c
1565
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1587
rump___sysimpl_writev(int fd, const struct iovec * iovp, int iovcnt)
sys/rump/librump/rumpkern/rump_syscalls.c
1595
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
160
rump___sysimpl_close(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
1617
rump___sysimpl_fchown(int fd, uid_t uid, gid_t gid)
sys/rump/librump/rumpkern/rump_syscalls.c
1625
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1647
rump___sysimpl_fchmod(int fd, mode_t mode)
sys/rump/librump/rumpkern/rump_syscalls.c
1655
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
168
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
1763
rump___sysimpl_flock(int fd, int how)
sys/rump/librump/rumpkern/rump_syscalls.c
1771
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2055
rump___sysimpl_pread(int fd, void * buf, size_t nbyte, off_t offset)
sys/rump/librump/rumpkern/rump_syscalls.c
2063
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2087
rump___sysimpl_pwrite(int fd, const void * buf, size_t nbyte, off_t offset)
sys/rump/librump/rumpkern/rump_syscalls.c
2095
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2232
rump___sysimpl_fpathconf(int fd, int name)
sys/rump/librump/rumpkern/rump_syscalls.c
2240
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2351
rump___sysimpl_lseek(int fd, off_t offset, int whence)
sys/rump/librump/rumpkern/rump_syscalls.c
2359
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2412
rump___sysimpl_ftruncate(int fd, off_t length)
sys/rump/librump/rumpkern/rump_syscalls.c
2420
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2476
rump___sysimpl_futimes(int fd, const struct timeval * tptr)
sys/rump/librump/rumpkern/rump_syscalls.c
2484
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
2679
rump___sysimpl_fdatasync(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
2687
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
273
rump___sysimpl_fchdir(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
281
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3172
rump___sysimpl___posix_fchown(int fd, uid_t uid, gid_t gid)
sys/rump/librump/rumpkern/rump_syscalls.c
3180
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3260
rump___sysimpl_fktrace(int fd, int ops, int facs, pid_t pid)
sys/rump/librump/rumpkern/rump_syscalls.c
3268
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3291
rump___sysimpl_preadv(int fd, const struct iovec * iovp, int iovcnt, off_t offset)
sys/rump/librump/rumpkern/rump_syscalls.c
3299
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3323
rump___sysimpl_pwritev(int fd, const struct iovec * iovp, int iovcnt, off_t offset)
sys/rump/librump/rumpkern/rump_syscalls.c
3331
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3384
rump___sysimpl_fchroot(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
3392
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3516
rump___sysimpl_kevent(int fd, const struct kevent * changelist, size_t nchanges, struct kevent * eventlist, size_t nevents, const struct timespec * timeout)
sys/rump/librump/rumpkern/rump_syscalls.c
3524
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3550
rump___sysimpl_fsync_range(int fd, int flags, off_t start, off_t length)
sys/rump/librump/rumpkern/rump_syscalls.c
3558
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3707
rump___sysimpl_extattr_set_fd(int fd, int attrnamespace, const char * attrname, const void * data, size_t nbytes)
sys/rump/librump/rumpkern/rump_syscalls.c
3715
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3739
rump___sysimpl_extattr_get_fd(int fd, int attrnamespace, const char * attrname, void * data, size_t nbytes)
sys/rump/librump/rumpkern/rump_syscalls.c
3747
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3771
rump___sysimpl_extattr_delete_fd(int fd, int attrnamespace, const char * attrname)
sys/rump/librump/rumpkern/rump_syscalls.c
3779
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
3895
rump___sysimpl_extattr_list_fd(int fd, int attrnamespace, void * data, size_t nbytes)
sys/rump/librump/rumpkern/rump_syscalls.c
3903
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4120
rump___sysimpl_fsetxattr(int fd, const char * name, const void * value, size_t size, int flags)
sys/rump/librump/rumpkern/rump_syscalls.c
4128
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4214
rump___sysimpl_fgetxattr(int fd, const char * name, void * value, size_t size)
sys/rump/librump/rumpkern/rump_syscalls.c
4222
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4305
rump___sysimpl_flistxattr(int fd, char * list, size_t size)
sys/rump/librump/rumpkern/rump_syscalls.c
4313
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4393
rump___sysimpl_fremovexattr(int fd, const char * name)
sys/rump/librump/rumpkern/rump_syscalls.c
4401
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4455
rump___sysimpl_fstat30(int fd, struct stat * sb)
sys/rump/librump/rumpkern/rump_syscalls.c
4463
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4518
rump___sysimpl_getdents30(int fd, char * buf, size_t count)
sys/rump/librump/rumpkern/rump_syscalls.c
4526
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
4909
rump___sysimpl_posix_fadvise50(int fd, off_t offset, off_t len, int advice)
sys/rump/librump/rumpkern/rump_syscalls.c
4916
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5091
rump___sysimpl_futimes50(int fd, const struct timeval * tptr)
sys/rump/librump/rumpkern/rump_syscalls.c
5099
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5333
rump___sysimpl_kevent50(int fd, const struct kevent * changelist, size_t nchanges, struct kevent * eventlist, size_t nevents, const struct timespec * timeout)
sys/rump/librump/rumpkern/rump_syscalls.c
5341
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5495
rump___sysimpl_fstat50(int fd, struct stat * sb)
sys/rump/librump/rumpkern/rump_syscalls.c
5503
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5863
rump___sysimpl_mkfifoat(int fd, const char * path, mode_t mode)
sys/rump/librump/rumpkern/rump_syscalls.c
5871
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5893
rump___sysimpl_mknodat(int fd, const char * path, mode_t mode, dev_t dev)
sys/rump/librump/rumpkern/rump_syscalls.c
5901
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5925
rump___sysimpl_mkdirat(int fd, const char * path, mode_t mode)
sys/rump/librump/rumpkern/rump_syscalls.c
5933
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5955
rump___sysimpl_faccessat(int fd, const char * path, int amode, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
5963
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
5986
rump___sysimpl_fchmodat(int fd, const char * path, mode_t mode, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
5994
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6017
rump___sysimpl_fchownat(int fd, const char * path, uid_t owner, gid_t group, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
6025
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6049
rump___sysimpl_fstatat(int fd, const char * path, struct stat * buf, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
6057
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6080
rump___sysimpl_utimensat(int fd, const char * path, const struct timespec * tptr, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
6088
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6111
rump___sysimpl_openat(int fd, const char * path, int oflags, mode_t mode)
sys/rump/librump/rumpkern/rump_syscalls.c
6119
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6142
rump___sysimpl_readlinkat(int fd, const char * path, char * buf, size_t bufsize)
sys/rump/librump/rumpkern/rump_syscalls.c
6150
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6173
rump___sysimpl_symlinkat(const char * path1, int fd, const char * path2)
sys/rump/librump/rumpkern/rump_syscalls.c
6182
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6203
rump___sysimpl_unlinkat(int fd, const char * path, int flag)
sys/rump/librump/rumpkern/rump_syscalls.c
6211
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6233
rump___sysimpl_futimens(int fd, const struct timespec * tptr)
sys/rump/librump/rumpkern/rump_syscalls.c
6241
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6381
rump___sysimpl_posix_fallocate(int fd, off_t pos, off_t len)
sys/rump/librump/rumpkern/rump_syscalls.c
6388
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6408
rump___sysimpl_fdiscard(int fd, off_t pos, off_t len)
sys/rump/librump/rumpkern/rump_syscalls.c
6416
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6531
rump___sysimpl_fstatvfs190(int fd, struct statvfs * buf, int flags)
sys/rump/librump/rumpkern/rump_syscalls.c
6539
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6623
rump___sysimpl_kevent100(int fd, const struct kevent * changelist, size_t nchanges, struct kevent * eventlist, size_t nevents, const struct timespec * timeout)
sys/rump/librump/rumpkern/rump_syscalls.c
6631
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
6688
rump_sys_pipe(int *fd)
sys/rump/librump/rumpkern/rump_syscalls.c
6697
fd[0] = retval[0];
sys/rump/librump/rumpkern/rump_syscalls.c
6698
fd[1] = retval[1];
sys/rump/librump/rumpkern/rump_syscalls.c
70
rump___sysimpl_read(int fd, void * buf, size_t nbyte)
sys/rump/librump/rumpkern/rump_syscalls.c
750
rump___sysimpl_fchflags(int fd, u_long flags)
sys/rump/librump/rumpkern/rump_syscalls.c
758
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
78
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
813
rump___sysimpl_dup(int fd)
sys/rump/librump/rumpkern/rump_syscalls.c
821
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpkern/rump_syscalls.c
969
rump___sysimpl_ioctl(int fd, u_long com, void * data)
sys/rump/librump/rumpkern/rump_syscalls.c
977
SPARG(&callarg, fd) = fd;
sys/rump/librump/rumpvfs/rumpblk.c
366
int error, fd;
sys/rump/librump/rumpvfs/rumpblk.c
370
RUMPUSER_OPEN_RDWR | RUMPUSER_OPEN_BIO, &fd);
sys/rump/librump/rumpvfs/rumpblk.c
373
RUMPUSER_OPEN_RDONLY | RUMPUSER_OPEN_BIO, &fd);
sys/rump/librump/rumpvfs/rumpblk.c
381
rblk->rblk_fd = fd;
sys/rump/net/lib/libshmif/shmif_user.c
114
rumpcomp_shmif_watchsetup(int *inotifyp, int fd)
sys/rump/net/lib/libshmif/shmif_user.c
130
snprintf(procbuf, sizeof(procbuf), "/proc/self/fd/%d", fd);
sys/rump/net/lib/libshmif/shmif_user.c
183
rumpcomp_shmif_watchsetup(int *nono, int fd)
sys/rump/net/lib/libshmif/shmif_user.c
210
rumpcomp_shmif_mmap(int fd, size_t len, void **memp)
sys/rump/net/lib/libshmif/shmif_user.c
215
if (ftruncate(fd, len) == -1) {
sys/rump/net/lib/libshmif/shmif_user.c
224
mem = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0);
sys/rump/net/lib/libshmif/shmif_user.c
59
rumpcomp_shmif_watchsetup(int *kqp, int fd)
sys/rump/net/lib/libshmif/shmif_user.c
73
EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR,
sys/rump/net/lib/libsockin/sockin.c
365
pfds[i].fd = SO2S(su_iter->su_so);
sys/rump/net/lib/libsockin/sockin.c
381
if (SO2S(su_iter->su_so)==pfds[i].fd) {
sys/rump/net/lib/libvirtif/virtif_user.c
107
if (ioctl(fd, TUNSETIFF, &ifr) == -1) {
sys/rump/net/lib/libvirtif/virtif_user.c
108
close(fd);
sys/rump/net/lib/libvirtif/virtif_user.c
109
fd = -1;
sys/rump/net/lib/libvirtif/virtif_user.c
116
return fd;
sys/rump/net/lib/libvirtif/virtif_user.c
137
pfd[0].fd = viu->viu_fd;
sys/rump/net/lib/libvirtif/virtif_user.c
139
pfd[1].fd = viu->viu_pipe[0];
sys/rump/net/lib/libvirtif/virtif_user.c
79
int fd = -1;
sys/rump/net/lib/libvirtif/virtif_user.c
85
fd = open(tapdev, O_RDWR);
sys/rump/net/lib/libvirtif/virtif_user.c
86
if (fd == -1) {
sys/rump/net/lib/libvirtif/virtif_user.c
95
fd = open("/dev/net/tun", O_RDWR);
sys/rump/net/lib/libvirtif/virtif_user.c
96
if (fd == -1) {
sys/rump/net/lib/libwg/wg_user.c
100
error = ioctl(fd, TUNSLMODE, &i);
sys/rump/net/lib/libwg/wg_user.c
102
close(fd);
sys/rump/net/lib/libwg/wg_user.c
103
fd = -1;
sys/rump/net/lib/libwg/wg_user.c
106
return fd;
sys/rump/net/lib/libwg/wg_user.c
135
pfd[0].fd = wgu->wgu_fd;
sys/rump/net/lib/libwg/wg_user.c
137
pfd[1].fd = wgu->wgu_pipe[0];
sys/rump/net/lib/libwg/wg_user.c
139
pfd[2].fd = wgu->wgu_sock4;
sys/rump/net/lib/libwg/wg_user.c
141
pfd[3].fd = wgu->wgu_sock6;
sys/rump/net/lib/libwg/wg_user.c
87
int n, fd, error;
sys/rump/net/lib/libwg/wg_user.c
93
fd = open(tun_path, O_RDWR);
sys/rump/net/lib/libwg/wg_user.c
94
if (fd == -1) {
sys/stand/cat.c
48
register int fd;
sys/stand/cat.c
51
fd = getfile("File", 0);
sys/stand/cat.c
52
while (read(fd, &c, 1) == 1)
sys/stand/efiboot/exec.c
105
len = read(fd, (void *)(uintptr_t)*paddr, expectedlen);
sys/stand/efiboot/exec.c
106
close(fd);
sys/stand/efiboot/exec.c
173
int fd, ohowto;
sys/stand/efiboot/exec.c
182
fd = loadfile(fname, marks, COUNT_KERNEL | LOAD_NOTE);
sys/stand/efiboot/exec.c
184
if (fd < 0) {
sys/stand/efiboot/exec.c
188
close(fd);
sys/stand/efiboot/exec.c
209
fd = loadfile(fname, marks, LOAD_KERNEL);
sys/stand/efiboot/exec.c
210
if (fd < 0) {
sys/stand/efiboot/exec.c
214
close(fd);
sys/stand/efiboot/exec.c
58
int fd;
sys/stand/efiboot/exec.c
63
fd = open(path, 0);
sys/stand/efiboot/exec.c
64
if (fd < 0) {
sys/stand/efiboot/exec.c
71
if (fstat(fd, &st) < 0) {
sys/stand/efiboot/exec.c
73
close(fd);
sys/stand/efiboot/exec.c
80
close(fd);
sys/stand/efiboot/exec.c
99
close(fd);
sys/stand/ls.c
61
int fd;
sys/stand/ls.c
64
if ((fd = getfile("ls", 0)) == -1)
sys/stand/ls.c
67
if (fstat(fd, &st) == -1) {
sys/stand/ls.c
80
ls(fd);
sys/stand/ls.c
86
ls(register int fd)
sys/stand/ls.c
93
while ((size = read(fd, dirbuf, DIRBLKSIZ)) == DIRBLKSIZ)
sys/sys/acl.h
407
acl_t acl_get_fd_np(int fd, acl_type_t _type);
sys/sys/epoll.h
68
int fd;
sys/sys/epoll.h
83
int fd, struct epoll_event *event);
sys/sys/epoll.h
92
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
sys/sys/ktrace.h
467
ktrexecfd(int fd, u_int dtype)
sys/sys/ktrace.h
470
ktr_execfd(fd, dtype);
sys/sys/midiio.h
622
int fd;
sys/sys/midiio.h
626
fd = open("/dev/music", O_RDWR);
sys/sys/midiio.h
627
write(fd, &SEQ_MK_TIMING(START), sizeof (seq_event_t));
sys/sys/midiio.h
629
read(fd, &e, sizeof e);
sys/sys/poll.h
40
int fd; /* file descriptor */
sys/sys/syscallargs.h
1094
syscallarg(int) fd;
sys/sys/syscallargs.h
1103
syscallarg(int) fd;
sys/sys/syscallargs.h
1138
syscallarg(int) fd;
sys/sys/syscallargs.h
1148
syscallarg(int) fd;
sys/sys/syscallargs.h
121
syscallarg(int) fd;
sys/sys/syscallargs.h
1213
syscallarg(int) fd;
sys/sys/syscallargs.h
1234
syscallarg(int) fd;
sys/sys/syscallargs.h
1262
syscallarg(int) fd;
sys/sys/syscallargs.h
1276
syscallarg(int) fd;
sys/sys/syscallargs.h
1291
syscallarg(int) fd;
sys/sys/syscallargs.h
1306
syscallarg(int) fd;
sys/sys/syscallargs.h
1346
syscallarg(int) fd;
sys/sys/syscallargs.h
1557
syscallarg(int) fd;
sys/sys/syscallargs.h
163
syscallarg(int) fd;
sys/sys/syscallargs.h
1764
syscallarg(int) fd;
sys/sys/syscallargs.h
1818
syscallarg(int) fd;
sys/sys/syscallargs.h
1848
syscallarg(int) fd;
sys/sys/syscallargs.h
1875
syscallarg(int) fd;
sys/sys/syscallargs.h
1883
syscallarg(int) fd;
sys/sys/syscallargs.h
1892
syscallarg(int) fd;
sys/sys/syscallargs.h
1946
syscallarg(int) fd;
sys/sys/syscallargs.h
2194
syscallarg(int) fd;
sys/sys/syscallargs.h
2251
syscallarg(int) fd;
sys/sys/syscallargs.h
2286
syscallarg(int) fd;
sys/sys/syscallargs.h
2337
syscallarg(int) fd;
sys/sys/syscallargs.h
2346
syscallarg(int) fd;
sys/sys/syscallargs.h
2355
syscallarg(int) fd;
sys/sys/syscallargs.h
2387
syscallarg(int) fd;
sys/sys/syscallargs.h
2447
syscallarg(int) fd;
sys/sys/syscallargs.h
2472
syscallarg(int) fd;
sys/sys/syscallargs.h
2494
syscallarg(int) fd;
sys/sys/syscallargs.h
2513
syscallarg(int) fd;
sys/sys/syscallargs.h
2525
syscallarg(int) fd;
sys/sys/syscallargs.h
2537
syscallarg(int) fd;
sys/sys/syscallargs.h
259
syscallarg(int) fd;
sys/sys/syscallargs.h
2700
syscallarg(int) fd;
sys/sys/syscallargs.h
2750
syscallarg(int) fd;
sys/sys/syscallargs.h
2840
syscallarg(int) fd;
sys/sys/syscallargs.h
2881
syscallarg(int) fd;
sys/sys/syscallargs.h
289
syscallarg(int) fd;
sys/sys/syscallargs.h
3021
syscallarg(int) fd;
sys/sys/syscallargs.h
3028
syscallarg(int) fd;
sys/sys/syscallargs.h
3037
syscallarg(int) fd;
sys/sys/syscallargs.h
3044
syscallarg(int) fd;
sys/sys/syscallargs.h
3052
syscallarg(int) fd;
sys/sys/syscallargs.h
3060
syscallarg(int) fd;
sys/sys/syscallargs.h
3070
syscallarg(int) fd;
sys/sys/syscallargs.h
3078
syscallarg(int) fd;
sys/sys/syscallargs.h
3086
syscallarg(int) fd;
sys/sys/syscallargs.h
3094
syscallarg(int) fd;
sys/sys/syscallargs.h
3102
syscallarg(int) fd;
sys/sys/syscallargs.h
3111
syscallarg(int) fd;
sys/sys/syscallargs.h
3117
syscallarg(int) fd;
sys/sys/syscallargs.h
3124
syscallarg(int) fd;
sys/sys/syscallargs.h
3185
syscallarg(int) fd;
sys/sys/syscallargs.h
3193
syscallarg(int) fd;
sys/sys/syscallargs.h
3234
syscallarg(int) fd;
sys/sys/syscallargs.h
3368
syscallarg(int) fd;
sys/sys/syscallargs.h
3388
syscallarg(int) fd;
sys/sys/syscallargs.h
355
syscallarg(int) fd;
sys/sys/syscallargs.h
407
syscallarg(int) fd;
sys/sys/syscallargs.h
437
syscallarg(int) fd;
sys/sys/syscallargs.h
557
syscallarg(int) fd;
sys/sys/syscallargs.h
573
syscallarg(int) fd;
sys/sys/syscallargs.h
61
syscallarg(int) fd;
sys/sys/syscallargs.h
68
syscallarg(int) fd;
sys/sys/syscallargs.h
750
syscallarg(int) fd;
sys/sys/syscallargs.h
757
syscallarg(int) fd;
sys/sys/syscallargs.h
772
syscallarg(int) fd;
sys/sys/syscallargs.h
779
syscallarg(int) fd;
sys/sys/syscallargs.h
82
syscallarg(int) fd;
sys/sys/syscallargs.h
824
syscallarg(int) fd;
sys/sys/syscallargs.h
831
syscallarg(int) fd;
sys/sys/syscallargs.h
958
syscallarg(int) fd;
sys/sys/syscallargs.h
976
syscallarg(int) fd;
sys/sys/videoio.h
1869
int32_t fd;
sys/sys/videoio.h
1921
int32_t fd;
sys/sys/videoio.h
2007
int32_t fd;
sys/ufs/chfs/chfs_build.c
115
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_build.c
140
TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) {
sys/ufs/chfs/chfs_build.c
143
dbg(" ->vno: %llu\n", (unsigned long long)fd->vno);
sys/ufs/chfs/chfs_build.c
144
dbg(" ->version: %llu\n", (unsigned long long)fd->version);
sys/ufs/chfs/chfs_build.c
145
dbg(" ->nhash: 0x%x\n", fd->nhash);
sys/ufs/chfs/chfs_build.c
146
dbg(" ->nsize: %d\n", fd->nsize);
sys/ufs/chfs/chfs_build.c
147
dbg(" ->name: %s\n", fd->name);
sys/ufs/chfs/chfs_build.c
148
dbg(" ->type: %d\n", fd->type);
sys/ufs/chfs/chfs_build.c
149
TAILQ_REMOVE(&vc->scan_dirents, fd, fds);
sys/ufs/chfs/chfs_build.c
151
if (!fd->vno) {
sys/ufs/chfs/chfs_build.c
152
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_build.c
156
child_vc = chfs_vnode_cache_get(chmp, fd->vno);
sys/ufs/chfs/chfs_build.c
159
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_build.c
172
TAILQ_INSERT_TAIL(unlinked, fd, fds);
sys/ufs/chfs/chfs_build.c
174
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_build.c
212
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_build.c
322
TAILQ_FOREACH_SAFE(fd, &unlinked, fds, tmpfd) {
sys/ufs/chfs/chfs_build.c
323
TAILQ_REMOVE(&unlinked, fd, fds);
sys/ufs/chfs/chfs_build.c
325
vc = chfs_vnode_cache_get(chmp, fd->vno);
sys/ufs/chfs/chfs_build.c
331
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_build.c
340
TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) {
sys/ufs/chfs/chfs_build.c
341
TAILQ_REMOVE(&vc->scan_dirents, fd, fds);
sys/ufs/chfs/chfs_build.c
342
if (fd->vno == 0) {
sys/ufs/chfs/chfs_build.c
343
nref = &fd->nref;
sys/ufs/chfs/chfs_build.c
344
*nref = fd->nref->nref_next;
sys/ufs/chfs/chfs_build.c
345
} else if (fd->type == CHT_DIR) {
sys/ufs/chfs/chfs_build.c
348
notregvc = chfs_vnode_cache_get(chmp, fd->vno);
sys/ufs/chfs/chfs_build.c
352
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_build.c
72
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_build.c
74
TAILQ_FOREACH_SAFE(fd, &vc->scan_dirents, fds, tmpfd) {
sys/ufs/chfs/chfs_build.c
77
if (!fd->vno)
sys/ufs/chfs/chfs_build.c
81
child_vc = chfs_vnode_cache_get(chmp, fd->vno);
sys/ufs/chfs/chfs_build.c
84
chfs_mark_node_obsolete(chmp, fd->nref);
sys/ufs/chfs/chfs_build.c
85
TAILQ_REMOVE(&vc->scan_dirents, fd, fds);
sys/ufs/chfs/chfs_build.c
88
if (fd->type == CHT_DIR) {
sys/ufs/chfs/chfs_build.c
95
fd->name, (unsigned long long)fd->vno,
sys/ufs/chfs/chfs_gc.c
1001
name_len = strlen(fd->name);
sys/ufs/chfs/chfs_gc.c
1002
name_crc = crc32(0, fd->name, name_len);
sys/ufs/chfs/chfs_gc.c
1004
nref_len = chfs_nref_len(chmp, cheb, fd->nref);
sys/ufs/chfs/chfs_gc.c
1021
CHFS_GET_OFS(fd->nref->nref_offset)) {
sys/ufs/chfs/chfs_gc.c
1056
if (memcmp(chfdn.name, fd->name, name_len))
sys/ufs/chfs/chfs_gc.c
1060
chfs_remove_and_obsolete(chmp, parent->chvc, fd->nref,
sys/ufs/chfs/chfs_gc.c
1064
parent, NULL, fd, fd->vno, ALLOC_GC);
sys/ufs/chfs/chfs_gc.c
1068
TAILQ_REMOVE(&parent->dents, fd, fds);
sys/ufs/chfs/chfs_gc.c
1069
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_gc.c
306
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_gc.c
330
TAILQ_FOREACH_SAFE(fd, &ip->dents, fds, tmpfd) {
sys/ufs/chfs/chfs_gc.c
331
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_gc.c
854
struct chfs_dirent *fd = NULL;
sys/ufs/chfs/chfs_gc.c
908
TAILQ_FOREACH(fd, &ip->dents, fds) {
sys/ufs/chfs/chfs_gc.c
909
if (fd->nref == nref) {
sys/ufs/chfs/chfs_gc.c
915
if (is_dirent && fd->vno) {
sys/ufs/chfs/chfs_gc.c
917
ret = chfs_gcollect_dirent(chmp, cheb, ip, fd);
sys/ufs/chfs/chfs_gc.c
920
ret = chfs_gcollect_deletion_dirent(chmp, cheb, ip, fd);
sys/ufs/chfs/chfs_gc.c
954
struct chfs_dirent *fd)
sys/ufs/chfs/chfs_gc.c
961
vnode = chfs_vnode_lookup(chmp, fd->vno);
sys/ufs/chfs/chfs_gc.c
973
chfs_remove_and_obsolete(chmp, parent->chvc, fd->nref,
sys/ufs/chfs/chfs_gc.c
979
parent, ip, fd, fd->vno, ALLOC_GC);
sys/ufs/chfs/chfs_gc.c
989
struct chfs_dirent *fd)
sys/ufs/chfs/chfs_inode.h
91
struct chfs_dirent *fd; /* full dirent of this node */
sys/ufs/chfs/chfs_malloc.c
307
chfs_free_full_dnode(struct chfs_full_dnode *fd)
sys/ufs/chfs/chfs_malloc.c
309
kmem_free(fd,(sizeof(struct chfs_full_dnode)));
sys/ufs/chfs/chfs_nodeops.c
176
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_nodeops.c
183
TAILQ_FOREACH_SAFE(fd, &parent->dents, fds, tmpfd) {
sys/ufs/chfs/chfs_nodeops.c
184
if (fd->nhash > new->nhash) {
sys/ufs/chfs/chfs_nodeops.c
186
TAILQ_INSERT_BEFORE(fd, new, fds);
sys/ufs/chfs/chfs_nodeops.c
188
} else if (fd->nhash == new->nhash &&
sys/ufs/chfs/chfs_nodeops.c
189
!strcmp(fd->name, new->name)) {
sys/ufs/chfs/chfs_nodeops.c
190
if (new->version > fd->version) {
sys/ufs/chfs/chfs_nodeops.c
192
TAILQ_INSERT_BEFORE(fd, new, fds);
sys/ufs/chfs/chfs_nodeops.c
193
TAILQ_REMOVE(&parent->dents, fd, fds);
sys/ufs/chfs/chfs_nodeops.c
194
if (fd->nref) {
sys/ufs/chfs/chfs_nodeops.c
196
chfs_remove_and_obsolete(chmp, parent->chvc, fd->nref,
sys/ufs/chfs/chfs_nodeops.c
200
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_readinode.c
740
struct chfs_full_dnode *fd)
sys/ufs/chfs/chfs_readinode.c
746
if (unlikely(!fd->size))
sys/ufs/chfs/chfs_readinode.c
750
newfrag = new_fragment(fd, fd->ofs, fd->size);
sys/ufs/chfs/chfs_readinode.c
762
CHFS_MARK_REF_NORMAL(fd->nref);
sys/ufs/chfs/chfs_readinode.c
772
CHFS_MARK_REF_NORMAL(fd->nref);
sys/ufs/chfs/chfs_scan.c
180
struct chfs_vnode_cache *vc, struct chfs_dirent *fd)
sys/ufs/chfs/chfs_scan.c
185
nref = fd->nref;
sys/ufs/chfs/chfs_scan.c
186
cheb = &chmp->chm_blocks[fd->nref->nref_lnr];
sys/ufs/chfs/chfs_scan.c
216
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_scan.c
229
TAILQ_FOREACH_SAFE(fd, &pvc->scan_dirents, fds, tmpfd) {
sys/ufs/chfs/chfs_scan.c
230
if (fd->nhash > new->nhash) {
sys/ufs/chfs/chfs_scan.c
232
TAILQ_INSERT_BEFORE(fd, new, fds);
sys/ufs/chfs/chfs_scan.c
234
} else if (fd->nhash == new->nhash &&
sys/ufs/chfs/chfs_scan.c
235
!strcmp(fd->name, new->name)) {
sys/ufs/chfs/chfs_scan.c
236
if (new->version > fd->version) {
sys/ufs/chfs/chfs_scan.c
238
TAILQ_INSERT_BEFORE(fd, new, fds);
sys/ufs/chfs/chfs_scan.c
242
TAILQ_REMOVE(&pvc->scan_dirents, fd, fds);
sys/ufs/chfs/chfs_scan.c
243
if (fd->nref) {
sys/ufs/chfs/chfs_scan.c
244
size = CHFS_PAD(sizeof(struct chfs_flash_dirent_node) + fd->nsize);
sys/ufs/chfs/chfs_scan.c
245
chfs_scan_mark_dirent_obsolete(chmp, pvc, fd);
sys/ufs/chfs/chfs_scan.c
246
oldcheb = &chmp->chm_blocks[fd->nref->nref_lnr];
sys/ufs/chfs/chfs_scan.c
250
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_scan.c
283
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_scan.c
299
fd = chfs_alloc_dirent(namelen + 1);
sys/ufs/chfs/chfs_scan.c
300
if (!fd)
sys/ufs/chfs/chfs_scan.c
304
fd->nref = chfs_alloc_node_ref(cheb);
sys/ufs/chfs/chfs_scan.c
305
if (!fd->nref)
sys/ufs/chfs/chfs_scan.c
308
KASSERT(fd->nref->nref_lnr == cheb->lnr);
sys/ufs/chfs/chfs_scan.c
310
memcpy(&fd->name, dirent->name, namelen);
sys/ufs/chfs/chfs_scan.c
311
fd->nsize = namelen;
sys/ufs/chfs/chfs_scan.c
312
fd->name[namelen] = 0;
sys/ufs/chfs/chfs_scan.c
313
crc = crc32(0, fd->name, dirent->nsize);
sys/ufs/chfs/chfs_scan.c
317
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_scan.c
328
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_scan.c
333
fd->nref->nref_offset = ofs;
sys/ufs/chfs/chfs_scan.c
336
chfs_add_node_to_list(chmp, parentvc, fd->nref, &parentvc->dirents);
sys/ufs/chfs/chfs_scan.c
339
fd->vno = le64toh(dirent->vno);
sys/ufs/chfs/chfs_scan.c
340
fd->version = le64toh(dirent->version);
sys/ufs/chfs/chfs_scan.c
341
fd->nhash = hash32_buf(fd->name, namelen, HASH32_BUF_INIT);
sys/ufs/chfs/chfs_scan.c
342
fd->type = dirent->dtype;
sys/ufs/chfs/chfs_scan.c
344
chfs_add_fd_to_list(chmp, fd, parentvc);
sys/ufs/chfs/chfs_subr.c
107
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_subr.c
115
TAILQ_FOREACH(fd, &ip->dents, fds) {
sys/ufs/chfs/chfs_subr.c
117
if (fd->vno == 0)
sys/ufs/chfs/chfs_subr.c
119
if (fd->nsize == (uint16_t)cnp->cn_namelen &&
sys/ufs/chfs/chfs_subr.c
120
memcmp(fd->name, cnp->cn_nameptr, fd->nsize) == 0) {
sys/ufs/chfs/chfs_subr.c
126
return found ? fd : NULL;
sys/ufs/chfs/chfs_vnode.c
146
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_vnode.c
164
fd = chfs_alloc_dirent(chfdn.nsize + 1);
sys/ufs/chfs/chfs_vnode.c
165
fd->version = chfdn.version;
sys/ufs/chfs/chfs_vnode.c
166
fd->vno = chfdn.vno;
sys/ufs/chfs/chfs_vnode.c
167
fd->type = chfdn.dtype;
sys/ufs/chfs/chfs_vnode.c
168
fd->nsize = chfdn.nsize;
sys/ufs/chfs/chfs_vnode.c
171
err = chfs_read_leb(chmp, chnr->nref_lnr, fd->name,
sys/ufs/chfs/chfs_vnode.c
183
fd->name[fd->nsize] = 0;
sys/ufs/chfs/chfs_vnode.c
184
fd->nref = chnr;
sys/ufs/chfs/chfs_vnode.c
187
chfs_add_fd_to_inode(chmp, pdir, fd);
sys/ufs/chfs/chfs_vnops.c
1140
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_vnops.c
1155
TAILQ_FOREACH(fd, &ip->dents, fds) {
sys/ufs/chfs/chfs_vnops.c
1156
if (fd->vno) {
sys/ufs/chfs/chfs_vnops.c
121
fd = chfs_dir_lookup(ip, cnp);
sys/ufs/chfs/chfs_vnops.c
123
if (fd == NULL) {
sys/ufs/chfs/chfs_vnops.c
1230
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_vnops.c
1240
TAILQ_FOREACH(fd, &ip->dents, fds) {
sys/ufs/chfs/chfs_vnops.c
1241
if (fd->vno) {
sys/ufs/chfs/chfs_vnops.c
1272
struct chfs_full_dnode *fd;
sys/ufs/chfs/chfs_vnops.c
1299
fd = chfs_alloc_full_dnode();
sys/ufs/chfs/chfs_vnops.c
1304
err = chfs_write_flash_dnode(chmp, vp, bp, fd);
sys/ufs/chfs/chfs_vnops.c
1311
err = chfs_add_full_dnode_to_inode(chmp, ip, fd);
sys/ufs/chfs/chfs_vnops.c
1347
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_vnops.c
1409
TAILQ_FOREACH(fd, &ip->dents, fds) {
sys/ufs/chfs/chfs_vnops.c
1417
if (fd->vno != 0) {
sys/ufs/chfs/chfs_vnops.c
1418
error = chfs_filldir(uio, fd->vno,
sys/ufs/chfs/chfs_vnops.c
1419
fd->name, fd->nsize, fd->type);
sys/ufs/chfs/chfs_vnops.c
147
if ((fd->type != CHT_DIR && fd->type != CHT_LNK) && !(cnp->cn_flags
sys/ufs/chfs/chfs_vnops.c
1503
struct chfs_dirent *fd;
sys/ufs/chfs/chfs_vnops.c
1519
fd = TAILQ_FIRST(&ip->dents);
sys/ufs/chfs/chfs_vnops.c
1520
while (fd) {
sys/ufs/chfs/chfs_vnops.c
1521
TAILQ_REMOVE(&ip->dents, fd, fds);
sys/ufs/chfs/chfs_vnops.c
1522
chfs_free_dirent(fd);
sys/ufs/chfs/chfs_vnops.c
1523
fd = TAILQ_FIRST(&ip->dents);
sys/ufs/chfs/chfs_vnops.c
154
(unsigned long long)fd->vno);
sys/ufs/chfs/chfs_vnops.c
155
error = VFS_VGET(dvp->v_mount, fd->vno, LK_EXCLUSIVE,
sys/ufs/chfs/chfs_vnops.c
1558
struct chfs_full_dnode *fd;
sys/ufs/chfs/chfs_vnops.c
1571
fd = chfs_alloc_full_dnode();
sys/ufs/chfs/chfs_vnops.c
1573
err = chfs_write_flash_dnode(chmp, vp, bp, fd);
sys/ufs/chfs/chfs_vnops.c
1580
err = chfs_add_full_dnode_to_inode(chmp, ip, fd);
sys/ufs/chfs/chfs_vnops.c
227
struct chfs_full_dnode *fd;
sys/ufs/chfs/chfs_vnops.c
285
fd = chfs_alloc_full_dnode();
sys/ufs/chfs/chfs_vnops.c
289
err = chfs_write_flash_dnode(chmp, vp, bp, fd);
sys/ufs/chfs/chfs_vnops.c
297
err = chfs_add_full_dnode_to_inode(chmp, ip, fd);
sys/ufs/chfs/chfs_vnops.c
64
struct chfs_dirent* fd;
sys/ufs/chfs/chfs_write.c
158
struct chfs_inode *ip, struct chfs_dirent *fd,
sys/ufs/chfs/chfs_write.c
171
KASSERT(fd->vno != CHFS_ROOTINO);
sys/ufs/chfs/chfs_write.c
178
size = sizeof(*fdirent) + fd->nsize;
sys/ufs/chfs/chfs_write.c
182
memcpy(name, fd->name, fd->nsize);
sys/ufs/chfs/chfs_write.c
193
fdirent->nsize = fd->nsize;
sys/ufs/chfs/chfs_write.c
194
fdirent->dtype = fd->type;
sys/ufs/chfs/chfs_write.c
195
fdirent->name_crc = crc32(0, (uint8_t *)&(fd->name), fd->nsize);
sys/ufs/chfs/chfs_write.c
264
fd->nref = nref;
sys/ufs/chfs/chfs_write.c
279
struct buf *bp, struct chfs_full_dnode *fd)
sys/ufs/chfs/chfs_write.c
334
fd->ofs = ofs;
sys/ufs/chfs/chfs_write.c
335
fd->size = len;
sys/ufs/chfs/chfs_write.c
385
ip->write_size += fd->size;
sys/ufs/chfs/chfs_write.c
391
if (fd->nref != NULL) {
sys/ufs/chfs/chfs_write.c
392
chfs_remove_frags_of_node(chmp, &ip->fragtree, fd->nref);
sys/ufs/chfs/chfs_write.c
393
chfs_remove_and_obsolete(chmp, ip->chvc, fd->nref, &ip->chvc->dnode);
sys/ufs/chfs/chfs_write.c
398
fd->nref = nref;
sys/ufs/chfs/chfs_write.c
469
struct chfs_dirent *fd, *tmpfd;
sys/ufs/chfs/chfs_write.c
481
TAILQ_FOREACH_SAFE(fd, &parent->dents, fds, tmpfd) {
sys/ufs/chfs/chfs_write.c
482
if (fd->vno == ip->ino &&
sys/ufs/chfs/chfs_write.c
483
fd->nsize == namelen &&
sys/ufs/chfs/chfs_write.c
484
!memcmp(fd->name, name, fd->nsize)) {
sys/ufs/chfs/chfs_write.c
490
if (fd->type == CHT_DIR && ip->chvc->nlink == 2)
sys/ufs/chfs/chfs_write.c
495
fd->type = CHT_BLANK;
sys/ufs/chfs/chfs_write.c
498
TAILQ_REMOVE(&parent->dents, fd, fds);
sys/ufs/chfs/chfs_write.c
503
fd->vno, fd->nref->nref_lnr, fd->nref->nref_offset);
sys/ufs/chfs/chfs_write.c
504
chfs_remove_and_obsolete(chmp, parent->chvc, fd->nref,
sys/ufs/chfs/chfs_write.c
508
parent, ip, fd, 0, ALLOC_DELETION);
sys/ufs/chfs/chfs_write.c
511
fd->vno, fd->nref->nref_lnr, fd->nref->nref_offset);
sys/ufs/chfs/chfs_write.c
513
chfs_add_node_to_list(chmp, parent->chvc, fd->nref,
sys/ufs/chfs/chfs_write.c
516
chfs_remove_and_obsolete(chmp, parent->chvc, fd->nref,
sys/uvm/uvm_mmap.c
304
int flags, fd, advice;
sys/uvm/uvm_mmap.c
321
fd = SCARG(uap, fd);
sys/uvm/uvm_mmap.c
394
if ((fp = fd_getfile(fd)) == NULL)
sys/uvm/uvm_mmap.c
408
fd_putfile(fd);
sys/uvm/uvm_mmap.c
416
if (fd != -1)
sys/uvm/uvm_mmap.c
466
fd_putfile(fd);
tests/compat/linux/h_inotify_directory.c
65
int fd, wd, targetfd;
tests/compat/linux/h_inotify_directory.c
71
RS(fd = syscall(LINUX_SYS_inotify_init));
tests/compat/linux/h_inotify_directory.c
72
RS(wd = syscall(LINUX_SYS_inotify_add_watch, fd, (register_t)"test",
tests/compat/linux/h_inotify_directory.c
85
RS(read(fd, buf, sizeof(buf)));
tests/compat/linux/h_inotify_init.c
44
int fd;
tests/compat/linux/h_inotify_init.c
47
RS(fd = syscall(LINUX_SYS_inotify_init));
tests/compat/linux/h_inotify_init.c
48
REQUIRE(fcntl(fd, LINUX_F_GETFD) == 0);
tests/compat/linux/h_inotify_init.c
49
REQUIRE((fcntl(fd, LINUX_F_GETFL) & LINUX_O_NONBLOCK) == 0);
tests/compat/linux/h_inotify_init.c
50
RS(close(fd));
tests/compat/linux/h_inotify_init.c
53
RS(fd = syscall(LINUX_SYS_inotify_init1, LINUX_IN_NONBLOCK));
tests/compat/linux/h_inotify_init.c
54
REQUIRE(fcntl(fd, LINUX_F_GETFD) == 0);
tests/compat/linux/h_inotify_init.c
55
REQUIRE((fcntl(fd, LINUX_F_GETFL) & LINUX_O_NONBLOCK) != 0);
tests/compat/linux/h_inotify_init.c
56
RS(close(fd));
tests/compat/linux/h_inotify_init.c
59
RS(fd = syscall(LINUX_SYS_inotify_init1, LINUX_IN_CLOEXEC));
tests/compat/linux/h_inotify_init.c
60
REQUIRE(fcntl(fd, LINUX_F_GETFD) != 0);
tests/compat/linux/h_inotify_init.c
61
REQUIRE((fcntl(fd, LINUX_F_GETFL) & LINUX_O_NONBLOCK) == 0);
tests/compat/linux/h_inotify_init.c
62
RS(close(fd));
tests/compat/linux/h_inotify_single_file.c
49
int fd, wd, targetfd, buf;
tests/compat/linux/h_inotify_single_file.c
54
RS(fd = syscall(LINUX_SYS_inotify_init));
tests/compat/linux/h_inotify_single_file.c
55
RS(wd = syscall(LINUX_SYS_inotify_add_watch, fd, (register_t)"test",
tests/compat/linux/h_inotify_single_file.c
69
RS(read(fd, events, sizeof(events)));
tests/compat/linux/h_inotify_watch_change.c
44
int fd, wd, targetfd;
tests/compat/linux/h_inotify_watch_change.c
50
RS(fd = syscall(LINUX_SYS_inotify_init));
tests/compat/linux/h_inotify_watch_change.c
51
RS(wd = syscall(LINUX_SYS_inotify_add_watch, fd, (register_t)"test",
tests/compat/linux/h_inotify_watch_change.c
58
RS(nread = read(fd, events, sizeof(events)));
tests/compat/linux/h_inotify_watch_change.c
63
RS(wd = syscall(LINUX_SYS_inotify_add_watch, fd, (register_t)"test",
tests/compat/linux/h_inotify_watch_change.c
70
RS(nread = read(fd, events, sizeof(events)));
tests/compat/linux/h_inotify_watch_change.c
75
RS(wd = syscall(LINUX_SYS_inotify_add_watch, fd, (register_t)"test",
tests/compat/linux/h_inotify_watch_change.c
82
RS(nread = read(fd, events, sizeof(events)));
tests/compat/linux/h_linux.h
45
#define close(fd) (int)syscall(LINUX_SYS_close, fd)
tests/compat/linux/h_linux.h
47
#define fcntl(fd, cmd, ...) (int)syscall(LINUX_SYS_fcntl, fd, cmd, \
tests/compat/linux/h_linux.h
49
#define lseek(fd, off, whence) (off_t)syscall(LINUX_SYS_lseek, fd, \
tests/compat/linux/h_linux.h
56
#define read(fd, buf, count) (ssize_t)syscall(LINUX_SYS_read, fd, \
tests/compat/linux/h_linux.h
64
#define write(fd, buf, count) (ssize_t)syscall(LINUX_SYS_write, fd, \
tests/crypto/opencrypto/h_aescbc.c
123
int fd, res;
tests/crypto/opencrypto/h_aescbc.c
130
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_aescbc.c
131
if (fd < 0)
tests/crypto/opencrypto/h_aescbc.c
137
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_aescbc.c
149
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_aescbc.c
160
close(fd);
tests/crypto/opencrypto/h_aesctr1.c
209
int fd, res;
tests/crypto/opencrypto/h_aesctr1.c
216
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_aesctr1.c
217
if (fd < 0)
tests/crypto/opencrypto/h_aesctr1.c
223
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_aesctr1.c
235
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_aesctr1.c
247
close(fd);
tests/crypto/opencrypto/h_aesctr2.c
52
int fd, res;
tests/crypto/opencrypto/h_aesctr2.c
58
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_aesctr2.c
59
if (fd < 0)
tests/crypto/opencrypto/h_aesctr2.c
65
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_aesctr2.c
78
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_aesctr2.c
89
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_arc4.c
49
int fd, res;
tests/crypto/opencrypto/h_arc4.c
54
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_arc4.c
55
if (fd < 0)
tests/crypto/opencrypto/h_arc4.c
61
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_arc4.c
72
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_camellia.c
55
int fd, res;
tests/crypto/opencrypto/h_camellia.c
60
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_camellia.c
61
if (fd < 0)
tests/crypto/opencrypto/h_camellia.c
67
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_camellia.c
79
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_cbc3des.c
54
int fd, res;
tests/crypto/opencrypto/h_cbc3des.c
59
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_cbc3des.c
60
if (fd < 0)
tests/crypto/opencrypto/h_cbc3des.c
66
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_cbc3des.c
79
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_cbc3des.c
95
res = ioctl(fd, CIOCCRYPT, &co2);
tests/crypto/opencrypto/h_cbcdes.c
50
int fd, res;
tests/crypto/opencrypto/h_cbcdes.c
55
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_cbcdes.c
56
if (fd < 0)
tests/crypto/opencrypto/h_cbcdes.c
62
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_cbcdes.c
74
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_comp.c
45
int fd, res;
tests/crypto/opencrypto/h_comp.c
50
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_comp.c
51
if (fd < 0)
tests/crypto/opencrypto/h_comp.c
55
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_comp.c
66
res = ioctl(fd, CIOCCRYPT, &co1);
tests/crypto/opencrypto/h_comp.c
82
res = ioctl(fd, CIOCCRYPT, &co2);
tests/crypto/opencrypto/h_comp_zlib.c
44
int fd, res;
tests/crypto/opencrypto/h_comp_zlib.c
50
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_comp_zlib.c
51
if (fd < 0)
tests/crypto/opencrypto/h_comp_zlib.c
55
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_comp_zlib.c
67
res = ioctl(fd, CIOCCRYPT, &co1);
tests/crypto/opencrypto/h_comp_zlib_rnd.c
46
int fd, res;
tests/crypto/opencrypto/h_comp_zlib_rnd.c
55
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_comp_zlib_rnd.c
56
if (fd < 0)
tests/crypto/opencrypto/h_comp_zlib_rnd.c
60
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_comp_zlib_rnd.c
71
res = ioctl(fd, CIOCCRYPT, &co1);
tests/crypto/opencrypto/h_gcm.c
116
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_gcm.c
54
int fd, res;
tests/crypto/opencrypto/h_gcm.c
61
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_gcm.c
62
if (fd < 0)
tests/crypto/opencrypto/h_gcm.c
71
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_gcm.c
85
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_ioctl.c
115
ret = ioctl(fd, CIOCNGSESSION, &sg);
tests/crypto/opencrypto/h_ioctl.c
127
test_nfsession(int fd)
tests/crypto/opencrypto/h_ioctl.c
138
ret = ioctl(fd, CIOCNFSESSION, &sf);
tests/crypto/opencrypto/h_ioctl.c
150
test_ncryptm(int fd)
tests/crypto/opencrypto/h_ioctl.c
170
ret = ioctl(fd, CIOCNCRYPTM, &mop);
tests/crypto/opencrypto/h_ioctl.c
182
test_ncryptretm(int fd)
tests/crypto/opencrypto/h_ioctl.c
197
ret = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_ioctl.c
218
ret = ioctl(fd, CIOCNCRYPTM, &mop);
tests/crypto/opencrypto/h_ioctl.c
234
ret = ioctl(fd, CIOCNCRYPTRETM, &cret);
tests/crypto/opencrypto/h_ioctl.c
241
ret = wait_for_read(fd);
tests/crypto/opencrypto/h_ioctl.c
247
ret = ioctl(fd, CIOCNCRYPTRETM, &cret);
tests/crypto/opencrypto/h_ioctl.c
263
test_ncryptret_noent(int fd)
tests/crypto/opencrypto/h_ioctl.c
270
ret = ioctl(fd, CIOCNCRYPTRET, &cr);
tests/crypto/opencrypto/h_ioctl.c
283
test_ncryptret_ent(int fd)
tests/crypto/opencrypto/h_ioctl.c
298
ret = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_ioctl.c
315
ret = ioctl(fd, CIOCNCRYPTM, &mop);
tests/crypto/opencrypto/h_ioctl.c
324
ret = ioctl(fd, CIOCNCRYPTRET, &cr);
tests/crypto/opencrypto/h_ioctl.c
331
ret = wait_for_read(fd);
tests/crypto/opencrypto/h_ioctl.c
334
ret = ioctl(fd, CIOCNCRYPTRET, &cr);
tests/crypto/opencrypto/h_ioctl.c
346
test_ncryptret(int fd)
tests/crypto/opencrypto/h_ioctl.c
350
ret = test_ncryptret_noent(fd);
tests/crypto/opencrypto/h_ioctl.c
354
ret = test_ncryptret_ent(fd);
tests/crypto/opencrypto/h_ioctl.c
382
test_asymfeat_each(int fd, u_int32_t *asymfeat, int userasym)
tests/crypto/opencrypto/h_ioctl.c
386
ret = ioctl(fd, CIOCASYMFEAT, asymfeat);
tests/crypto/opencrypto/h_ioctl.c
394
test_asymfeat(int fd)
tests/crypto/opencrypto/h_ioctl.c
404
ret = test_asymfeat_each(fd, &asymfeat, new);
tests/crypto/opencrypto/h_ioctl.c
413
ret = test_asymfeat_each(fd, &asymfeat, new);
tests/crypto/opencrypto/h_ioctl.c
428
int fd, ret;
tests/crypto/opencrypto/h_ioctl.c
430
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_ioctl.c
431
if (fd < 0)
tests/crypto/opencrypto/h_ioctl.c
434
ret = test_ngsession(fd);
tests/crypto/opencrypto/h_ioctl.c
438
ret = test_nfsession(fd);
tests/crypto/opencrypto/h_ioctl.c
442
ret = test_ncryptm(fd);
tests/crypto/opencrypto/h_ioctl.c
446
test_ncryptretm(fd);
tests/crypto/opencrypto/h_ioctl.c
450
ret = test_ncryptret(fd);
tests/crypto/opencrypto/h_ioctl.c
455
ret = test_asymfeat(fd);
tests/crypto/opencrypto/h_ioctl.c
65
wait_for_read(int fd)
tests/crypto/opencrypto/h_ioctl.c
67
struct pollfd pfd = { .fd = fd, .events = POLLIN };
tests/crypto/opencrypto/h_ioctl.c
97
test_ngsession(int fd)
tests/crypto/opencrypto/h_md5.c
104
res = ioctl(fd, CIOCFSESSION, &cs.ses);
tests/crypto/opencrypto/h_md5.c
73
int fd, res;
tests/crypto/opencrypto/h_md5.c
79
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_md5.c
80
if (fd < 0)
tests/crypto/opencrypto/h_md5.c
86
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_md5.c
97
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_md5hmac.c
142
int fd, res;
tests/crypto/opencrypto/h_md5hmac.c
147
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_md5hmac.c
148
if (fd < 0)
tests/crypto/opencrypto/h_md5hmac.c
158
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_md5hmac.c
169
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_md5hmac.c
176
res = ioctl(fd, CIOCFSESSION, &cs.ses);
tests/crypto/opencrypto/h_null.c
45
int fd, res;
tests/crypto/opencrypto/h_null.c
50
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_null.c
51
if (fd < 0)
tests/crypto/opencrypto/h_null.c
57
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_null.c
68
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_sha1hmac.c
152
int fd, res;
tests/crypto/opencrypto/h_sha1hmac.c
157
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_sha1hmac.c
158
if (fd < 0)
tests/crypto/opencrypto/h_sha1hmac.c
168
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_sha1hmac.c
179
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_sha1hmac.c
186
res = ioctl(fd, CIOCFSESSION, &cs.ses);
tests/crypto/opencrypto/h_sha2hmac.c
231
int fd, res;
tests/crypto/opencrypto/h_sha2hmac.c
236
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_sha2hmac.c
237
if (fd < 0)
tests/crypto/opencrypto/h_sha2hmac.c
244
res = ioctl(fd, CIOCGSESSION, &cs);
tests/crypto/opencrypto/h_sha2hmac.c
255
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_sha2hmac.c
263
res = ioctl(fd, CIOCFSESSION, &cs.ses);
tests/crypto/opencrypto/h_thread.c
103
if (ioctl(fd, CIOCGSESSION, &cs) == -1)
tests/crypto/opencrypto/h_thread.c
110
while (ioctl(fd, CIOCFSESSION, &cs.ses) == -1) {
tests/crypto/opencrypto/h_thread.c
141
if (ioctl(fd, CIOCCRYPT, &co) == -1) {
tests/crypto/opencrypto/h_thread.c
179
if ((fd = open("/dev/crypto", O_RDWR, 0)) == -1)
tests/crypto/opencrypto/h_thread.c
212
if (ioctl(fd, CIOCFSESSION, &ses) != -1)
tests/crypto/opencrypto/h_thread.c
88
static int fd;
tests/crypto/opencrypto/h_xcbcmac.c
102
res = ioctl(fd, CIOCCRYPT, &co);
tests/crypto/opencrypto/h_xcbcmac.c
75
int fd, res;
tests/crypto/opencrypto/h_xcbcmac.c
81
fd = open("/dev/crypto", O_RDWR, 0);
tests/crypto/opencrypto/h_xcbcmac.c
82
if (fd < 0)
tests/crypto/opencrypto/h_xcbcmac.c
88
res = ioctl(fd, CIOCGSESSION, &cs);
tests/dev/audio/audiotest.c
1000
debug_read(__LINE__, fd, addr, len)
tests/dev/audio/audiotest.c
1001
int debug_read(int line, int fd, void *addr, size_t len)
tests/dev/audio/audiotest.c
1003
DPRINTFF(line, "read(%d, %p, %zd)", fd, addr, len);
tests/dev/audio/audiotest.c
1004
int r = rump_or_read(fd, addr, len);
tests/dev/audio/audiotest.c
1013
#define IOCTL(fd, name, addr, addrfmt...) \
tests/dev/audio/audiotest.c
1014
debug_ioctl(__LINE__, fd, name, #name, addr, addrfmt)
tests/dev/audio/audiotest.c
1015
int debug_ioctl(int line, int fd, u_long name, const char *namestr,
tests/dev/audio/audiotest.c
1024
DPRINTFF(line, "ioctl(%d, %s, %s)", fd, namestr, addrbuf);
tests/dev/audio/audiotest.c
1025
int r = rump_or_ioctl(fd, name, addr);
tests/dev/audio/audiotest.c
1029
#define FCNTL(fd, name...) \
tests/dev/audio/audiotest.c
1030
debug_fcntl(__LINE__, fd, name, #name)
tests/dev/audio/audiotest.c
1031
int debug_fcntl(int line, int fd, int name, const char *namestr, ...)
tests/dev/audio/audiotest.c
1037
DPRINTFF(line, "fcntl(%d, %s)", fd, namestr);
tests/dev/audio/audiotest.c
1038
r = rump_or_fcntl(fd, name);
tests/dev/audio/audiotest.c
1047
#define CLOSE(fd) \
tests/dev/audio/audiotest.c
1048
debug_close(__LINE__, fd)
tests/dev/audio/audiotest.c
1049
int debug_close(int line, int fd)
tests/dev/audio/audiotest.c
1051
DPRINTFF(line, "close(%d)", fd);
tests/dev/audio/audiotest.c
1052
int r = rump_or_close(fd);
tests/dev/audio/audiotest.c
1056
#define MMAP(ptr, len, prot, flags, fd, offset) \
tests/dev/audio/audiotest.c
1057
debug_mmap(__LINE__, ptr, len, prot, flags, fd, offset)
tests/dev/audio/audiotest.c
1058
void *debug_mmap(int line, void *ptr, size_t len, int prot, int flags, int fd,
tests/dev/audio/audiotest.c
1105
ptr, len, protbuf + 1, flagbuf + 1, fd, offset);
tests/dev/audio/audiotest.c
1106
void *r = mmap(ptr, len, prot, flags, fd, offset);
tests/dev/audio/audiotest.c
1146
pfd[i].fd, event_tostr(pfd[i].events));
tests/dev/audio/audiotest.c
1328
int fd;
tests/dev/audio/audiotest.c
1331
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
1332
if (fd != -1)
tests/dev/audio/audiotest.c
1333
CLOSE(fd);
tests/dev/audio/audiotest.c
1423
int fd;
tests/dev/audio/audiotest.c
1428
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
1430
XP_SYS_OK(fd);
tests/dev/audio/audiotest.c
1432
XP_SYS_NG(ENXIO, fd);
tests/dev/audio/audiotest.c
1435
if (fd >= 0) {
tests/dev/audio/audiotest.c
1436
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1458
int fd;
tests/dev/audio/audiotest.c
1479
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
1480
XP_SYS_NG(ENXIO, fd);
tests/dev/audio/audiotest.c
1517
fd = OPEN(devaudio, openable_mode());
tests/dev/audio/audiotest.c
1518
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1519
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1526
fd = OPEN(devfile, mode);
tests/dev/audio/audiotest.c
1527
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1529
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
1597
r = IOCTL(fd, AUDIO_SETINFO, &ai, "ai");
tests/dev/audio/audiotest.c
1599
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1605
fd = OPEN(devfile, mode);
tests/dev/audio/audiotest.c
1606
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1608
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
1668
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1690
int fd;
tests/dev/audio/audiotest.c
1699
fd = OPEN(devsound, openmode);
tests/dev/audio/audiotest.c
1700
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1704
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
1706
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1710
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
1711
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1712
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1716
fd = OPEN(devsound, openmode);
tests/dev/audio/audiotest.c
1717
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1719
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
1723
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1733
int fd;
tests/dev/audio/audiotest.c
1742
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
1743
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1749
r = IOCTL(fd, AUDIO_SETINFO, &ai, "SLINEAR_LE");
tests/dev/audio/audiotest.c
1751
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1755
fd = OPEN(devaudioctl, openmode);
tests/dev/audio/audiotest.c
1756
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1758
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
1771
r = IOCTL(fd, AUDIO_SETINFO, &ai, "ULAW");
tests/dev/audio/audiotest.c
1773
r = CLOSE(fd);
tests/dev/audio/audiotest.c
1777
fd = OPEN(devsound, openmode);
tests/dev/audio/audiotest.c
1778
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
1780
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
1786
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2042
int fd;
tests/dev/audio/audiotest.c
2047
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2049
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2051
XP_SYS_NG(ENXIO, fd);
tests/dev/audio/audiotest.c
2057
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
2060
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2074
int fd;
tests/dev/audio/audiotest.c
2079
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2081
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2083
XP_SYS_NG(ENXIO, fd);
tests/dev/audio/audiotest.c
2090
r = IOCTL(fd, AUDIO_SETINFO, &ai, "mode");
tests/dev/audio/audiotest.c
2094
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
2105
r = WRITE(fd, wav, wavsize);
tests/dev/audio/audiotest.c
2114
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
2119
r = IOCTL(fd, AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
2122
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2135
int fd;
tests/dev/audio/audiotest.c
2140
fd = OPEN(devaudio, O_RDONLY);
tests/dev/audio/audiotest.c
2142
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2144
XP_SYS_NG(ENXIO, fd);
tests/dev/audio/audiotest.c
2149
r = READ(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
2152
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2164
int fd;
tests/dev/audio/audiotest.c
2183
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2184
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2186
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
2189
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2210
int fd;
tests/dev/audio/audiotest.c
2228
fd = OPEN(devaudio, O_RDONLY);
tests/dev/audio/audiotest.c
2229
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2231
r = READ(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
2234
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2257
int fd;
tests/dev/audio/audiotest.c
2271
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
2272
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2275
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause");
tests/dev/audio/audiotest.c
2279
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
2286
r = READ(fd, buf, 0);
tests/dev/audio/audiotest.c
2293
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2496
int fd;
tests/dev/audio/audiotest.c
2505
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2506
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2513
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
2516
r = WRITE(fd, &r, 1);
tests/dev/audio/audiotest.c
2518
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2529
int fd;
tests/dev/audio/audiotest.c
2538
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2539
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2544
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
2547
r = WRITE(fd, &r, 4);
tests/dev/audio/audiotest.c
2549
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2558
int fd;
tests/dev/audio/audiotest.c
2568
fd = OPEN(devaudio, O_RDONLY);
tests/dev/audio/audiotest.c
2569
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2571
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
2574
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2588
int fd;
tests/dev/audio/audiotest.c
2629
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
2630
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2632
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "get");
tests/dev/audio/audiotest.c
2640
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause");
tests/dev/audio/audiotest.c
2643
ptr = MMAP(NULL, len, prot, MAP_FILE, fd, 0);
tests/dev/audio/audiotest.c
2648
r = READ(fd, buf, 0);
tests/dev/audio/audiotest.c
2654
r = WRITE(fd, buf, 0);
tests/dev/audio/audiotest.c
2669
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
2674
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2705
int fd;
tests/dev/audio/audiotest.c
2729
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2733
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
2755
ptr = MMAP(NULL, len, PROT_WRITE, MAP_FILE, fd, offset);
tests/dev/audio/audiotest.c
2770
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2797
int fd;
tests/dev/audio/audiotest.c
2815
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
2816
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2818
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "get");
tests/dev/audio/audiotest.c
2822
ptr1 = MMAP(NULL, len, PROT_WRITE, MAP_FILE, fd, 0);
tests/dev/audio/audiotest.c
2826
ptr2 = MMAP(NULL, len, PROT_WRITE, MAP_FILE, fd, 0);
tests/dev/audio/audiotest.c
2838
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2918
int fd;
tests/dev/audio/audiotest.c
2939
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
2940
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
2946
pfd.fd = fd;
tests/dev/audio/audiotest.c
2969
r = CLOSE(fd);
tests/dev/audio/audiotest.c
2996
int fd;
tests/dev/audio/audiotest.c
3001
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
3002
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3005
pfd.fd = fd;
tests/dev/audio/audiotest.c
3013
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3024
int fd;
tests/dev/audio/audiotest.c
3031
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3032
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3037
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
3041
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3050
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3058
pfd.fd = fd;
tests/dev/audio/audiotest.c
3064
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3076
int fd;
tests/dev/audio/audiotest.c
3084
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3085
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3088
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3097
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=1;hiwat");
tests/dev/audio/audiotest.c
3101
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3110
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3118
pfd.fd = fd;
tests/dev/audio/audiotest.c
3124
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3137
int fd;
tests/dev/audio/audiotest.c
3152
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3153
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3170
r = IOCTL(fd, AUDIO_SETINFO, &ai, "blocksize=%d", blocksize);
tests/dev/audio/audiotest.c
3172
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3188
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
3192
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3201
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3209
pfd.fd = fd;
tests/dev/audio/audiotest.c
3218
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=0");
tests/dev/audio/audiotest.c
3239
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3243
r = IOCTL(fd, AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
3246
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3258
int fd[2];
tests/dev/audio/audiotest.c
3278
fd[0] = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3279
REQUIRED_SYS_OK(fd[0]);
tests/dev/audio/audiotest.c
3280
fd[1] = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3281
REQUIRED_SYS_OK(fd[1]);
tests/dev/audio/audiotest.c
3294
r = IOCTL(fd[0], AUDIO_SETINFO, &ai, "blocksize=1000");
tests/dev/audio/audiotest.c
3296
r = IOCTL(fd[0], AUDIO_GETBUFINFO, &ai, "read back blocksize");
tests/dev/audio/audiotest.c
3313
r = IOCTL(fd[a], AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
3317
r = IOCTL(fd[b], AUDIO_SETINFO, &ai, "pause=0");
tests/dev/audio/audiotest.c
3321
r = IOCTL(fd[0], AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3336
r = WRITE(fd[a], buf, buflen);
tests/dev/audio/audiotest.c
3344
pfd[0].fd = fd[a];
tests/dev/audio/audiotest.c
3351
r = WRITE(fd[b], buf, buflen);
tests/dev/audio/audiotest.c
3353
r = WRITE(fd[b], buf, buflen);
tests/dev/audio/audiotest.c
3360
pfd[0].fd = fd[0];
tests/dev/audio/audiotest.c
3362
pfd[1].fd = fd[1];
tests/dev/audio/audiotest.c
3372
r = IOCTL(fd[0], AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
3374
r = IOCTL(fd[1], AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
3377
r = CLOSE(fd[0]);
tests/dev/audio/audiotest.c
3379
r = CLOSE(fd[1]);
tests/dev/audio/audiotest.c
3398
int fd;
tests/dev/audio/audiotest.c
3411
fd = OPEN(devfile, O_RDONLY);
tests/dev/audio/audiotest.c
3412
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3414
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3429
pfd.fd = fd;
tests/dev/audio/audiotest.c
3450
r = READ(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
3455
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3471
int fd[2];
tests/dev/audio/audiotest.c
3489
fd[play] = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3490
REQUIRED_SYS_OK(fd[play]);
tests/dev/audio/audiotest.c
3491
fd[rec] = OPEN(devaudio, O_RDONLY);
tests/dev/audio/audiotest.c
3492
REQUIRED_SYS_OK(fd[rec]);
tests/dev/audio/audiotest.c
3495
r = IOCTL(fd[rec], AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3506
pfd.fd = fd[play];
tests/dev/audio/audiotest.c
3518
r = READ(fd[rec], buf, blocksize);
tests/dev/audio/audiotest.c
3527
pfd.fd = fd[rec];
tests/dev/audio/audiotest.c
3533
r = CLOSE(fd[play]);
tests/dev/audio/audiotest.c
3535
r = CLOSE(fd[rec]);
tests/dev/audio/audiotest.c
3548
int fd;
tests/dev/audio/audiotest.c
3566
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
3567
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3576
EV_SET(&kev, fd, filt, EV_ADD, 0, 0, 0);
tests/dev/audio/audiotest.c
3586
EV_SET(&kev, fd, filt, EV_DELETE, 0, 0, 0);
tests/dev/audio/audiotest.c
3591
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3632
int fd;
tests/dev/audio/audiotest.c
3637
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
3638
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3640
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3646
EV_SET(&kev, fd, EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
3654
XP_EQ(fd, kev.ident);
tests/dev/audio/audiotest.c
3663
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3678
int fd;
tests/dev/audio/audiotest.c
3685
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3686
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3691
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
3695
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3704
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3713
EV_SET(&kev, fd, EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
3723
XP_EQ(fd, kev.ident);
tests/dev/audio/audiotest.c
3727
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3743
int fd;
tests/dev/audio/audiotest.c
3751
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3752
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3755
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "hiwat");
tests/dev/audio/audiotest.c
3764
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=1;hiwat");
tests/dev/audio/audiotest.c
3768
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3779
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3788
EV_SET(&kev, fd, EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
3800
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3815
int fd;
tests/dev/audio/audiotest.c
3827
fd = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3828
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
3845
r = IOCTL(fd, AUDIO_SETINFO, &ai, "blocksize=%d", blocksize);
tests/dev/audio/audiotest.c
3847
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3863
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
3867
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
3878
r = WRITE(fd, buf, buflen);
tests/dev/audio/audiotest.c
3887
EV_SET(&kev, fd, EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
3894
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=0");
tests/dev/audio/audiotest.c
3914
r = IOCTL(fd, AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
3917
r = CLOSE(fd);
tests/dev/audio/audiotest.c
3933
int fd[2];
tests/dev/audio/audiotest.c
3955
fd[0] = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3956
REQUIRED_SYS_OK(fd[0]);
tests/dev/audio/audiotest.c
3957
fd[1] = OPEN(devaudio, O_WRONLY | O_NONBLOCK);
tests/dev/audio/audiotest.c
3958
REQUIRED_SYS_OK(fd[1]);
tests/dev/audio/audiotest.c
3971
r = IOCTL(fd[0], AUDIO_SETINFO, &ai, "blocksize=1000");
tests/dev/audio/audiotest.c
3973
r = IOCTL(fd[0], AUDIO_GETBUFINFO, &ai, "read back blocksize");
tests/dev/audio/audiotest.c
3989
r = IOCTL(fd[a], AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
3991
r = IOCTL(fd[b], AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
4001
r = WRITE(fd[a], buf, buflen);
tests/dev/audio/audiotest.c
4008
r = WRITE(fd[b], buf, buflen);
tests/dev/audio/audiotest.c
4015
r = IOCTL(fd[b], AUDIO_GETBUFINFO, &ai2, "");
tests/dev/audio/audiotest.c
4022
EV_SET(&kev[0], fd[a], EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
4023
EV_SET(&kev[1], fd[b], EV_ADD, EVFILT_WRITE, 0, 0, 0);
tests/dev/audio/audiotest.c
4030
r = IOCTL(fd[a], AUDIO_SETINFO, &ai, "pause=0");
tests/dev/audio/audiotest.c
4041
XP_EQ(fd[a], kev[0].ident);
tests/dev/audio/audiotest.c
4044
r = IOCTL(fd[b], AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4048
r = IOCTL(fd[0], AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
4050
r = IOCTL(fd[1], AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
4053
r = CLOSE(fd[0]);
tests/dev/audio/audiotest.c
4055
r = CLOSE(fd[1]);
tests/dev/audio/audiotest.c
4067
int fd;
tests/dev/audio/audiotest.c
4090
r = IOCTL(data->fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4107
r = IOCTL(data->fd, AUDIO_SETINFO, &ai, "pause=0");
tests/dev/audio/audiotest.c
4130
data->fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
4131
REQUIRED_SYS_OK(data->fd);
tests/dev/audio/audiotest.c
4136
r = IOCTL(data->fd, AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
4145
r = WRITE(data->fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
4157
r = IOCTL(data->fd, AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
4159
r = CLOSE(data->fd);
tests/dev/audio/audiotest.c
4221
int fd;
tests/dev/audio/audiotest.c
423
rump_or_write(int fd, const void *buf, size_t len)
tests/dev/audio/audiotest.c
4235
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
4236
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4238
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4246
r = IOCTL(fd, FIOASYNC, &val, "on");
tests/dev/audio/audiotest.c
4249
r = WRITE(fd, data, ai.blocksize);
tests/dev/audio/audiotest.c
4259
r = CLOSE(fd);
tests/dev/audio/audiotest.c
4274
int fd;
tests/dev/audio/audiotest.c
4287
fd = OPEN(devaudio, O_RDONLY);
tests/dev/audio/audiotest.c
4288
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
429
r = rump_sys_write(fd, buf, len);
tests/dev/audio/audiotest.c
4291
r = IOCTL(fd, FIOASYNC, &val, "on");
tests/dev/audio/audiotest.c
4294
r = READ(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
4304
r = CLOSE(fd);
tests/dev/audio/audiotest.c
432
r = write(fd, buf, len);
tests/dev/audio/audiotest.c
438
rump_or_read(int fd, void *buf, size_t len)
tests/dev/audio/audiotest.c
444
r = rump_sys_read(fd, buf, len);
tests/dev/audio/audiotest.c
4444
int fd;
tests/dev/audio/audiotest.c
4449
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
4450
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4455
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause=1");
tests/dev/audio/audiotest.c
4460
r = IOCTL(fd, AUDIO_WSEEK, &n, "");
tests/dev/audio/audiotest.c
4466
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
4468
r = IOCTL(fd, AUDIO_WSEEK, &n, "");
tests/dev/audio/audiotest.c
447
r = read(fd, buf, len);
tests/dev/audio/audiotest.c
4482
r = CLOSE(fd);
tests/dev/audio/audiotest.c
4497
int fd;
tests/dev/audio/audiotest.c
4510
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
4511
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4519
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
453
rump_or_ioctl(int fd, u_long cmd, void *arg)
tests/dev/audio/audiotest.c
4534
r = IOCTL(fd, AUDIO_SETFD, &n, "on");
tests/dev/audio/audiotest.c
4555
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
4566
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4578
r = IOCTL(fd, AUDIO_SETFD, &n, "off");
tests/dev/audio/audiotest.c
4588
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
459
r = rump_sys_ioctl(fd, cmd, arg);
tests/dev/audio/audiotest.c
4597
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4602
r = CLOSE(fd);
tests/dev/audio/audiotest.c
4615
int fd;
tests/dev/audio/audiotest.c
462
r = ioctl(fd, cmd, arg);
tests/dev/audio/audiotest.c
4624
fd = OPEN(devaudio, O_RDWR);
tests/dev/audio/audiotest.c
4625
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4636
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
4647
r = IOCTL(fd, AUDIO_SETFD, &n, "on");
tests/dev/audio/audiotest.c
4660
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
4665
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4677
r = IOCTL(fd, AUDIO_SETFD, &n, "off");
tests/dev/audio/audiotest.c
468
rump_or_close(int fd)
tests/dev/audio/audiotest.c
4694
r = IOCTL(fd, AUDIO_GETFD, &n, "");
tests/dev/audio/audiotest.c
4705
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4710
r = CLOSE(fd);
tests/dev/audio/audiotest.c
4722
int fd, fd1;
tests/dev/audio/audiotest.c
4730
fd = OPEN(devaudio, O_RDWR);
tests/dev/audio/audiotest.c
4731
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4736
r = IOCTL(fd, AUDIO_SETINFO, &ai, "pause");
tests/dev/audio/audiotest.c
474
r = rump_sys_close(fd);
tests/dev/audio/audiotest.c
4740
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4746
r = WRITE(fd, &r, 0);
tests/dev/audio/audiotest.c
4748
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4755
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
4758
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4764
r = WRITE(fd, buf, 0);
tests/dev/audio/audiotest.c
4767
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
477
r = close(fd);
tests/dev/audio/audiotest.c
4774
r = READ(fd, buf, 0);
tests/dev/audio/audiotest.c
4777
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4796
r = CLOSE(fd);
tests/dev/audio/audiotest.c
480
if (fd == maxfd)
tests/dev/audio/audiotest.c
4802
fd = OPEN(devaudio, O_RDWR);
tests/dev/audio/audiotest.c
4803
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4805
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
4810
r = CLOSE(fd);
tests/dev/audio/audiotest.c
4824
int fd;
tests/dev/audio/audiotest.c
4837
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
4838
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
4842
r = IOCTL(fd, AUDIO_GETINFO, &ai, "");
tests/dev/audio/audiotest.c
4854
r = IOCTL(fd, AUDIO_SETINFO, &ai, "mode");
tests/dev/audio/audiotest.c
4857
r = IOCTL(fd, AUDIO_GETINFO, &ai, "");
tests/dev/audio/audiotest.c
4878
r = WRITE(fd, buf, 0);
tests/dev/audio/audiotest.c
488
rump_or_fcntl(int fd, int cmd, ...)
tests/dev/audio/audiotest.c
4895
r = READ(fd, buf, 0);
tests/dev/audio/audiotest.c
4902
r = CLOSE(fd);
tests/dev/audio/audiotest.c
494
r = rump_sys_fcntl(fd, cmd);
tests/dev/audio/audiotest.c
497
r = fcntl(fd, cmd);
tests/dev/audio/audiotest.c
5036
int fd;
tests/dev/audio/audiotest.c
5056
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
5057
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5073
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
5076
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5087
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5197
int fd;
tests/dev/audio/audiotest.c
5220
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
5221
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5236
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=%d", ch);
tests/dev/audio/audiotest.c
5241
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5257
r = IOCTL(fd, AUDIO_GETFORMAT, &hwinfo, "");
tests/dev/audio/audiotest.c
5266
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=%d", ch);
tests/dev/audio/audiotest.c
5269
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5276
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=%d", ch);
tests/dev/audio/audiotest.c
5285
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=%d", ch);
tests/dev/audio/audiotest.c
5288
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5295
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=%d", ch);
tests/dev/audio/audiotest.c
5299
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5311
int fd;
tests/dev/audio/audiotest.c
5335
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
5336
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5347
r = IOCTL(fd, AUDIO_SETINFO, &ai, "sample_rate=%d", freq);
tests/dev/audio/audiotest.c
5352
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5364
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5376
int fd;
tests/dev/audio/audiotest.c
5389
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
5390
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5395
r = IOCTL(fd, AUDIO_SETINFO, &ai, "sample_rate=0");
tests/dev/audio/audiotest.c
5399
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5411
int fd;
tests/dev/audio/audiotest.c
5432
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
5433
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5446
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
5449
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5471
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
5474
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
5484
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5515
int fd;
tests/dev/audio/audiotest.c
5548
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
5549
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5552
r = IOCTL(fd, AUDIO_GETINFO, &ai, "");
tests/dev/audio/audiotest.c
5563
r = IOCTL(fd, AUDIO_SETINFO, &ai, "play.gain=%d", ai.play.gain);
tests/dev/audio/audiotest.c
5567
r = IOCTL(fd, AUDIO_GETINFO, &ai, "play.gain");
tests/dev/audio/audiotest.c
5579
r = IOCTL(fd, AUDIO_SETINFO, &ai, "play.gain=%d", ai.play.gain);
tests/dev/audio/audiotest.c
5582
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5595
get_changeable_gain(int fd, int *gain, const char *dir, int offset)
tests/dev/audio/audiotest.c
5609
r = IOCTL(fd, AUDIO_SETINFO, &ai, "%s.gain=%d", dir, *ai_gain);
tests/dev/audio/audiotest.c
5613
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5621
r = IOCTL(fd, AUDIO_SETINFO, &ai, "%s.gain=%d", dir, *ai_gain);
tests/dev/audio/audiotest.c
5624
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5665
get_changeable_balance(int fd, int *balance, const char *dir, int offset)
tests/dev/audio/audiotest.c
5679
r = IOCTL(fd, AUDIO_SETINFO, &ai, "%s.balance=%d", dir, *ai_balance);
tests/dev/audio/audiotest.c
5682
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5689
r = IOCTL(fd, AUDIO_SETINFO, &ai, "%s.balance=%d", dir, *ai_balance);
tests/dev/audio/audiotest.c
5692
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5722
int fd;
tests/dev/audio/audiotest.c
5734
fd = OPEN(devaudio, mode);
tests/dev/audio/audiotest.c
5735
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5738
r = IOCTL(fd, AUDIO_GETINFO, &oai, "&oai");
tests/dev/audio/audiotest.c
5765
get_changeable_gain(fd, pgain, "play",
tests/dev/audio/audiotest.c
5767
get_changeable_balance(fd, pbalance, "play",
tests/dev/audio/audiotest.c
5771
get_changeable_gain(fd, rgain, "record",
tests/dev/audio/audiotest.c
5773
get_changeable_balance(fd, rbalance, "record",
tests/dev/audio/audiotest.c
5799
r = IOCTL(fd, AUDIO_SETINFO, &ai, "restore all");
tests/dev/audio/audiotest.c
5802
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5815
r = IOCTL(fd, AUDIO_SETINFO, &ai, "play.gain=%d/balance=%d",
tests/dev/audio/audiotest.c
5820
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5837
r = IOCTL(fd, AUDIO_SETINFO, &ai, "record.gain=%d/balance=%d",
tests/dev/audio/audiotest.c
5842
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5861
r = IOCTL(fd, AUDIO_SETINFO, &ai, "restore all");
tests/dev/audio/audiotest.c
5865
r = IOCTL(fd, AUDIO_GETINFO, &ai, "&ai");
tests/dev/audio/audiotest.c
5872
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5883
int fd;
tests/dev/audio/audiotest.c
5895
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
5896
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5898
ptr = MMAP(NULL, 1, PROT_WRITE, MAP_FILE, fd, 0);
tests/dev/audio/audiotest.c
5907
r = IOCTL(fd, AUDIO_SETINFO, &ai, "channels=2");
tests/dev/audio/audiotest.c
5914
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5927
int fd;
tests/dev/audio/audiotest.c
5939
fd = OPEN(devaudio, O_WRONLY);
tests/dev/audio/audiotest.c
5940
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
5942
ptr = MMAP(NULL, 1, PROT_WRITE, MAP_FILE, fd, 0);
tests/dev/audio/audiotest.c
5948
r = IOCTL(fd, AUDIO_SETINFO, &ai, "set pause");
tests/dev/audio/audiotest.c
5952
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "get pause");
tests/dev/audio/audiotest.c
5963
r = IOCTL(fd, AUDIO_SETINFO, &ai, "reset pause");
tests/dev/audio/audiotest.c
5966
r = CLOSE(fd);
tests/dev/audio/audiotest.c
5980
getenc_make_table(int fd, int expected[][5])
tests/dev/audio/audiotest.c
6004
r = IOCTL(fd, AUDIO_GETENC, &ae, "index=%d", idx);
tests/dev/audio/audiotest.c
6130
int fd;
tests/dev/audio/audiotest.c
6134
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6135
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6152
r = IOCTL(fd, AUDIO_SETINFO, &ai, "%s:%d",
tests/dev/audio/audiotest.c
6160
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6170
int fd;
tests/dev/audio/audiotest.c
6177
fd = OPEN(devaudio, openable_mode());
tests/dev/audio/audiotest.c
6178
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6181
i = getenc_make_table(fd, expected);
tests/dev/audio/audiotest.c
6185
r = IOCTL(fd, AUDIO_GETENC, &ae, "index=%d", ae.index);
tests/dev/audio/audiotest.c
6188
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6228
int fd;
tests/dev/audio/audiotest.c
623
int fd;
tests/dev/audio/audiotest.c
6233
fd = OPEN(devaudio, openable_mode());
tests/dev/audio/audiotest.c
6234
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6238
r = IOCTL(fd, AUDIO_GETENC, &e, "index=-1");
tests/dev/audio/audiotest.c
6242
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6253
int fd;
tests/dev/audio/audiotest.c
6263
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6264
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6268
r = IOCTL(fd, AUDIO_PERROR, &errors, "");
tests/dev/audio/audiotest.c
6274
r = IOCTL(fd, AUDIO_RERROR, &errors, "");
tests/dev/audio/audiotest.c
6278
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6293
int fd;
tests/dev/audio/audiotest.c
6304
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6305
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6320
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
6325
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
6346
r = IOCTL(fd, AUDIO_GETIOFFS, &o, "");
tests/dev/audio/audiotest.c
6365
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6381
int fd;
tests/dev/audio/audiotest.c
6393
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6394
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6409
r = IOCTL(fd, AUDIO_SETINFO, &ai, "slinear16/2ch/48000");
tests/dev/audio/audiotest.c
6414
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
6444
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6452
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6459
r = WRITE(fd, buf, blocksize);
tests/dev/audio/audiotest.c
6465
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
6468
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6485
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6503
int fd;
tests/dev/audio/audiotest.c
6516
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6517
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6526
r = IOCTL(fd, AUDIO_SETINFO, &ai, "slinear16/2/48000");
tests/dev/audio/audiotest.c
6539
r = IOCTL(fd, AUDIO_SETINFO, &ai, "ulaw/1/8000");
tests/dev/audio/audiotest.c
6544
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
6567
r = WRITE(fd, buf, buffer_size);
tests/dev/audio/audiotest.c
6572
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
6582
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6609
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6627
int fd;
tests/dev/audio/audiotest.c
6638
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6639
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6648
r = IOCTL(fd, AUDIO_SETINFO, &ai, "");
tests/dev/audio/audiotest.c
6653
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
6671
r = WRITE(fd, buf, ai.blocksize);
tests/dev/audio/audiotest.c
6677
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
6681
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6698
r = WRITE(fd, buf, ai.blocksize);
tests/dev/audio/audiotest.c
6704
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
6711
r = IOCTL(fd, AUDIO_FLUSH, NULL, "");
tests/dev/audio/audiotest.c
6715
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6736
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6754
int fd;
tests/dev/audio/audiotest.c
6764
fd = OPEN(devaudio, openmode);
tests/dev/audio/audiotest.c
6765
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6768
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
678
fd = rump_or_open(devaudioctl, O_RDONLY);
tests/dev/audio/audiotest.c
6786
r = WRITE(fd, buf, ai.blocksize);
tests/dev/audio/audiotest.c
679
if (fd == -1)
tests/dev/audio/audiotest.c
6792
r = IOCTL(fd, AUDIO_DRAIN, NULL, "");
tests/dev/audio/audiotest.c
6805
r = IOCTL(fd, AUDIO_SETINFO, &ai, "slinear16/2ch/48000");
tests/dev/audio/audiotest.c
6808
r = IOCTL(fd, AUDIO_GETBUFINFO, &ai, "");
tests/dev/audio/audiotest.c
681
r = rump_or_ioctl(fd, AUDIO_GETPROPS, &props);
tests/dev/audio/audiotest.c
6817
r = IOCTL(fd, AUDIO_GETOOFFS, &o, "");
tests/dev/audio/audiotest.c
6823
r = CLOSE(fd);
tests/dev/audio/audiotest.c
6838
int fd;
tests/dev/audio/audiotest.c
684
r = rump_or_ioctl(fd, AUDIO_GETDEV, &devinfo);
tests/dev/audio/audiotest.c
6853
fd = OPEN(devaudio, fmode);
tests/dev/audio/audiotest.c
6854
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
6862
r = CLOSE(fd);
tests/dev/audio/audiotest.c
687
rump_or_close(fd);
tests/dev/audio/audiotest.c
6881
int fd;
tests/dev/audio/audiotest.c
6899
fd = OPEN(devaudio, fmode);
tests/dev/audio/audiotest.c
6900
XP_SYS_OK(fd);
tests/dev/audio/audiotest.c
6902
r = CLOSE(fd);
tests/dev/audio/audiotest.c
7065
int fd;
tests/dev/audio/audiotest.c
7070
fd = OPEN(devaudioctl, openmode);
tests/dev/audio/audiotest.c
7071
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
7074
r = WRITE(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
7079
r = READ(fd, buf, sizeof(buf));
tests/dev/audio/audiotest.c
7083
r = CLOSE(fd);
tests/dev/audio/audiotest.c
7099
int fd;
tests/dev/audio/audiotest.c
7104
fd = OPEN(devaudioctl, O_WRONLY);
tests/dev/audio/audiotest.c
7105
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
7107
pfd.fd = fd;
tests/dev/audio/audiotest.c
7113
r = CLOSE(fd);
tests/dev/audio/audiotest.c
7126
int fd;
tests/dev/audio/audiotest.c
7132
fd = OPEN(devaudioctl, O_WRONLY);
tests/dev/audio/audiotest.c
7133
REQUIRED_SYS_OK(fd);
tests/dev/audio/audiotest.c
7138
EV_SET(&kev, fd, EVFILT_WRITE, EV_ADD, 0, 0, 0);
tests/dev/audio/audiotest.c
7151
r = CLOSE(fd);
tests/dev/audio/audiotest.c
732
int fd;
tests/dev/audio/audiotest.c
734
for (fd = 3; fd <= maxfd; fd++) {
tests/dev/audio/audiotest.c
735
if (fd != padfd)
tests/dev/audio/audiotest.c
736
close(fd);
tests/dev/audio/audiotest.c
990
#define WRITE(fd, addr, len) \
tests/dev/audio/audiotest.c
991
debug_write(__LINE__, fd, addr, len)
tests/dev/audio/audiotest.c
992
int debug_write(int line, int fd, const void *addr, size_t len)
tests/dev/audio/audiotest.c
994
DPRINTFF(line, "write(%d, %p, %zd)", fd, addr, len);
tests/dev/audio/audiotest.c
995
int r = rump_or_write(fd, addr, len);
tests/dev/audio/audiotest.c
999
#define READ(fd, addr, len) \
tests/dev/cgd/t_cgd_3des.c
698
int fd;
tests/dev/cgd/t_cgd_3des.c
700
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/dev/cgd/t_cgd_3des.c
701
if (fd < 0)
tests/dev/cgd/t_cgd_3des.c
704
if (ftruncate(fd, size) < 0)
tests/dev/cgd/t_cgd_3des.c
713
return fd;
tests/dev/cgd/t_cgd_3des.c
715
close(fd);
tests/dev/cgd/t_cgd_3des.c
731
configure_cgd(int fd, const char *dkpath, const char *alg,
tests/dev/cgd/t_cgd_3des.c
744
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
tests/dev/cgd/t_cgd_3des.c
748
unconfigure_cgd(int fd)
tests/dev/cgd/t_cgd_3des.c
752
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
tests/dev/cgd/t_cgd_adiantum.c
296
configure_cgd(int fd, const char *dkpath, const char *alg,
tests/dev/cgd/t_cgd_adiantum.c
309
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
tests/dev/cgd/t_cgd_adiantum.c
313
unconfigure_cgd(int fd)
tests/dev/cgd/t_cgd_adiantum.c
317
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
tests/dev/cgd/t_cgd_aes.c
3099
int fd;
tests/dev/cgd/t_cgd_aes.c
3101
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/dev/cgd/t_cgd_aes.c
3102
if (fd < 0)
tests/dev/cgd/t_cgd_aes.c
3105
if (ftruncate(fd, size) < 0)
tests/dev/cgd/t_cgd_aes.c
3114
return fd;
tests/dev/cgd/t_cgd_aes.c
3116
close(fd);
tests/dev/cgd/t_cgd_aes.c
3132
configure_cgd(int fd, const char *dkpath, const char *alg,
tests/dev/cgd/t_cgd_aes.c
3145
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
tests/dev/cgd/t_cgd_aes.c
3149
unconfigure_cgd(int fd)
tests/dev/cgd/t_cgd_aes.c
3153
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
tests/dev/cgd/t_cgd_blowfish.c
1934
int fd;
tests/dev/cgd/t_cgd_blowfish.c
1936
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
tests/dev/cgd/t_cgd_blowfish.c
1937
if (fd < 0)
tests/dev/cgd/t_cgd_blowfish.c
1940
if (ftruncate(fd, size) < 0)
tests/dev/cgd/t_cgd_blowfish.c
1949
return fd;
tests/dev/cgd/t_cgd_blowfish.c
1951
close(fd);
tests/dev/cgd/t_cgd_blowfish.c
1967
configure_cgd(int fd, const char *dkpath, const char *alg,
tests/dev/cgd/t_cgd_blowfish.c
1980
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
tests/dev/cgd/t_cgd_blowfish.c
1984
unconfigure_cgd(int fd)
tests/dev/cgd/t_cgd_blowfish.c
1988
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
tests/dev/dm/h_dm.c
110
fd = rump_sys_open("/dev/mapper/control", O_RDWR, 0);
tests/dev/dm/h_dm.c
111
if (fd == -1)
tests/dev/dm/h_dm.c
119
error = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
tests/dev/dm/h_dm.c
128
rump_sys_close(fd);
tests/dev/dm/h_dm.c
58
int fd;
tests/dev/dm/h_dm.c
70
fd = rump_sys_open("/dev/mapper/control", O_RDWR, 0);
tests/dev/dm/h_dm.c
71
if (fd == -1)
tests/dev/dm/h_dm.c
79
error = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
tests/dev/dm/h_dm.c
88
rump_sys_close(fd);
tests/dev/dm/h_dm.c
98
int fd;
tests/dev/md/h_mdserv.c
103
if (rump_sys_ioctl(fd, MD_SETCONF, &md) == -1) {
tests/dev/md/h_mdserv.c
27
int fd, error;
tests/dev/md/h_mdserv.c
31
fd = rump_sys_open(arg, O_RDONLY);
tests/dev/md/h_mdserv.c
33
n = rump_sys_read(fd, buf, sizeof(buf));
tests/dev/md/h_mdserv.c
68
int fd, error;
tests/dev/md/h_mdserv.c
86
if ((fd = rump_sys_open(argv[1], O_RDWR)) == -1)
tests/dev/scsipi/t_cd.c
55
int part, fd, arg = 0;
tests/dev/scsipi/t_cd.c
66
RL(fd = rump_sys_open(fname, O_RDWR));
tests/dev/scsipi/t_cd.c
67
RL(rump_sys_ioctl(fd, DIOCEJECT, &arg));
tests/dev/scsipi/t_cd.c
70
RL(rump_sys_close(fd));
tests/dev/sysmon/t_swwdog.c
106
if (rump_sys_ioctl(fd, WDOGIOC_SMODE, &wm) == -1)
tests/dev/sysmon/t_swwdog.c
111
rump_sys_ioctl(fd, WDOGIOC_TICKLE);
tests/dev/sysmon/t_swwdog.c
114
rump_sys_ioctl(fd, WDOGIOC_SMODE, &wm);
tests/dev/sysmon/t_swwdog.c
71
int fd;
tests/dev/sysmon/t_swwdog.c
90
fd = rump_sys_open("/dev/watchdog", O_RDWR);
tests/dev/sysmon/t_swwdog.c
91
if (fd == -1)
tests/dev/sysmon/t_swwdog.c
97
if (rump_sys_ioctl(fd, WDOGIOC_GWDOGS, &wc) == -1)
tests/fs/common/fstest_lfs.c
176
int fd;
tests/fs/common/fstest_lfs.c
191
fd = rump_sys_open(path, O_RDONLY);
tests/fs/common/fstest_lfs.c
196
res = rump_sys_fcntl(fd, LFCNAUTOCLEAN, &autoclean);
tests/fs/common/fstest_lfs.c
201
res = rump_sys_close(fd);
tests/fs/common/fstest_puffs.c
383
int fd;
tests/fs/common/fstest_puffs.c
386
fd = rump_sys_open("/dev/puffs", O_RDWR);
tests/fs/common/fstest_puffs.c
387
if (fd == -1)
tests/fs/common/fstest_puffs.c
388
return fd;
tests/fs/common/fstest_puffs.c
400
pargs->pta_rumpfd = fd;
tests/fs/common/fstest_puffs.c
60
xread(int fd, void *vp, size_t n)
tests/fs/common/fstest_puffs.c
68
ssz = read(fd, vp, left);
tests/fs/common/fstest_puffs.c
79
xwrite(int fd, const void *vp, size_t n)
tests/fs/common/fstest_puffs.c
87
ssz = write(fd, vp, left);
tests/fs/common/fstest_zfs.c
56
int fd;
tests/fs/common/fstest_zfs.c
68
if ((fd = open(image, O_RDWR | O_CREAT, 0777)) == -1)
tests/fs/common/fstest_zfs.c
70
if (ftruncate(fd, size) == -1) {
tests/fs/common/fstest_zfs.c
71
close(fd);
tests/fs/common/fstest_zfs.c
74
close(fd);
tests/fs/common/snapshot.c
27
int fd;
tests/fs/common/snapshot.c
29
fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
tests/fs/common/snapshot.c
30
if (fd == -1)
tests/fs/common/snapshot.c
32
rump_sys_close(fd);
tests/fs/common/snapshot.c
40
int fd, fd2, i;
tests/fs/common/snapshot.c
62
fd = rump_sys_open("/mnt/myfile", O_RDWR | O_CREAT, 0777);
tests/fs/common/snapshot.c
63
if (fd == -1)
tests/fs/common/snapshot.c
65
if (rump_sys_write(fd, TESTSTR1, TESTSZ1) != TESTSZ1)
tests/fs/common/snapshot.c
80
if (rump_sys_write(fd, TESTSTR2, TESTSZ2) != TESTSZ2)
tests/fs/ffs/h_quota2_tests.c
107
error = rump_sys_write(fd, buf, sizeof(buf));
tests/fs/ffs/h_quota2_tests.c
113
if (rump_sys_write(fd, buf, sizeof(buf)) != sizeof(buf))
tests/fs/ffs/h_quota2_tests.c
118
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
128
int fd;
tests/fs/ffs/h_quota2_tests.c
146
fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
147
if (fd < 0)
tests/fs/ffs/h_quota2_tests.c
150
rump_sys_write(fd, buf, strlen(buf));
tests/fs/ffs/h_quota2_tests.c
151
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
155
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
165
int fd;
tests/fs/ffs/h_quota2_tests.c
187
fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
188
if (fd < 0)
tests/fs/ffs/h_quota2_tests.c
191
rump_sys_write(fd, buf, strlen(buf));
tests/fs/ffs/h_quota2_tests.c
192
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
197
fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
198
if (fd < 0)
tests/fs/ffs/h_quota2_tests.c
203
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
213
int fd, fssfd;
tests/fs/ffs/h_quota2_tests.c
241
fd = rump_sys_open(FSTEST_MNTNAME "/le_snap", O_CREAT | O_RDWR, 0777);
tests/fs/ffs/h_quota2_tests.c
242
if (fd == -1)
tests/fs/ffs/h_quota2_tests.c
244
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
263
fd = rump_sys_open(buf, O_EXCL| O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
264
if (fd < 0)
tests/fs/ffs/h_quota2_tests.c
267
rump_sys_write(fd, buf, strlen(buf));
tests/fs/ffs/h_quota2_tests.c
268
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
280
int fd;
tests/fs/ffs/h_quota2_tests.c
316
fd = rump_sys_open("unlinked_file",
tests/fs/ffs/h_quota2_tests.c
318
if (fd < 0)
tests/fs/ffs/h_quota2_tests.c
321
rump_sys_write(fd, buf, strlen(buf));
tests/fs/ffs/h_quota2_tests.c
324
if (rump_sys_fsync(fd) == -1)
tests/fs/ffs/h_quota2_tests.c
35
int fd;
tests/fs/ffs/h_quota2_tests.c
61
fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
62
if (fd < 0) {
tests/fs/ffs/h_quota2_tests.c
66
while (rump_sys_write(fd, buf, sizeof(buf)) == sizeof(buf))
tests/fs/ffs/h_quota2_tests.c
70
rump_sys_close(fd);
tests/fs/ffs/h_quota2_tests.c
80
int fd;
tests/fs/ffs/h_quota2_tests.c
94
fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
tests/fs/ffs/h_quota2_tests.c
95
if (fd < 0) {
tests/fs/ffs/t_extattr.c
127
int fd;
tests/fs/ffs/t_extattr.c
132
if ((fd = rump_sys_open(M, O_RDWR | O_CREAT, 0600)) == -1)
tests/fs/ffs/t_extattr.c
134
if (rump_sys_write(fd, "hi mom\n", 7) != 7)
tests/fs/ffs/t_extattr.c
137
if (rump_sys_extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, E, C, 11) == -1)
tests/fs/ffs/t_extattr.c
147
if ((nr = rump_sys_extattr_get_fd(fd, EXTATTR_NAMESPACE_USER,
tests/fs/ffs/t_extattr.c
153
if ((nr = rump_sys_extattr_list_fd(fd, EXTATTR_NAMESPACE_USER,
tests/fs/ffs/t_extattr.c
163
if (rump_sys_extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, T) == -1)
tests/fs/ffs/t_extattr.c
165
if ((nr = rump_sys_extattr_list_fd(fd, EXTATTR_NAMESPACE_USER,
tests/fs/ffs/t_extattr.c
172
if ((nr = rump_sys_extattr_list_fd(fd, EXTATTR_NAMESPACE_USER,
tests/fs/ffs/t_extattr.c
176
if (rump_sys_close(fd) == -1)
tests/fs/ffs/t_extattr.c
200
int fd;
tests/fs/ffs/t_extattr.c
203
if ((fd = rump_sys_open(M, O_RDWR | O_CREAT, 0600)) == -1)
tests/fs/ffs/t_extattr.c
206
if (rump_sys_close(fd) == -1)
tests/fs/ffs/t_fifos.c
35
int fd;
tests/fs/ffs/t_fifos.c
37
fd = rump_sys_open("sheep", O_WRONLY);
tests/fs/ffs/t_fifos.c
38
if (fd == -1)
tests/fs/ffs/t_fifos.c
40
if (rump_sys_write(fd, teststr1, sizeof(teststr1)) != sizeof(teststr1))
tests/fs/ffs/t_fifos.c
42
rump_sys_close(fd);
tests/fs/ffs/t_fifos.c
50
int fd;
tests/fs/ffs/t_fifos.c
52
fd = rump_sys_open("pigs", O_WRONLY);
tests/fs/ffs/t_fifos.c
53
if (fd == -1)
tests/fs/ffs/t_fifos.c
55
if (rump_sys_write(fd, teststr2, sizeof(teststr2)) != sizeof(teststr2))
tests/fs/ffs/t_fifos.c
57
rump_sys_close(fd);
tests/fs/ffs/t_fifos.c
66
int fd;
tests/fs/ffs/t_fifos.c
68
fd = rump_sys_open("sheep", O_RDONLY);
tests/fs/ffs/t_fifos.c
69
if (fd == -1)
tests/fs/ffs/t_fifos.c
71
if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(teststr1))
tests/fs/ffs/t_fifos.c
73
rump_sys_close(fd);
tests/fs/ffs/t_fifos.c
85
int fd;
tests/fs/ffs/t_fifos.c
87
fd = rump_sys_open("pigs", O_RDONLY);
tests/fs/ffs/t_fifos.c
88
if (fd == -1)
tests/fs/ffs/t_fifos.c
90
if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(teststr2))
tests/fs/ffs/t_fifos.c
92
rump_sys_close(fd);
tests/fs/ffs/t_quota2_1.c
29
int fd;
tests/fs/ffs/t_quota2_1.c
53
RL(fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0755));
tests/fs/ffs/t_quota2_1.c
55
RL(rump_sys_write(fd, buf, strlen(buf)));
tests/fs/ffs/t_quota2_1.c
56
RL(rump_sys_fchown(fd, i, i+80000));
tests/fs/ffs/t_quota2_1.c
57
rump_sys_close(fd);
tests/fs/ffs/t_quota2_remount.c
30
int fd;
tests/fs/ffs/t_quota2_remount.c
85
RL(fd = rump_sys_open(buf, O_CREAT | O_RDWR, 0755));
tests/fs/ffs/t_quota2_remount.c
87
RL(rump_sys_write(fd, buf, strlen(buf)));
tests/fs/ffs/t_quota2_remount.c
88
RL(rump_sys_fchown(fd, i, i+80000));
tests/fs/ffs/t_quota2_remount.c
89
rump_sys_close(fd);
tests/fs/ffs/t_update_log.c
107
int n = 10, fd;
tests/fs/ffs/t_update_log.c
130
RL(fd = rump_sys_open("dummy", O_CREAT | O_RDWR, 0755));
tests/fs/ffs/t_update_log.c
132
RL(rump_sys_write(fd, buf, strlen(buf)));
tests/fs/ffs/t_update_log.c
133
rump_sys_close(fd);
tests/fs/ffs/t_update_log.c
49
int n = 10, fd;
tests/fs/ffs/t_update_log.c
77
RL(fd = rump_sys_open("dummy", O_CREAT | O_RDWR, 0755));
tests/fs/ffs/t_update_log.c
78
RL(rump_sys_write(fd, teststring, strlen(teststring)));
tests/fs/ffs/t_update_log.c
79
rump_sys_close(fd);
tests/fs/ffs/t_update_log.c
85
RL(fd = rump_sys_open("dummy", O_APPEND | O_RDWR, 0755));
tests/fs/ffs/t_update_log.c
86
RL(rump_sys_write(fd, teststring, strlen(teststring)));
tests/fs/ffs/t_update_log.c
87
rump_sys_close(fd);
tests/fs/fifofs/t_fifo.c
122
if ((fd = open(FIFO_FILE_PATH, O_WRONLY, 0)) == -1)
tests/fs/fifofs/t_fifo.c
140
if ((fd = open(FIFO_FILE_PATH, O_RDONLY, 0)) == -1) {
tests/fs/fifofs/t_fifo.c
158
rv = read(fd, buf, buf_size);
tests/fs/fifofs/t_fifo.c
189
close(fd);
tests/fs/fifofs/t_fifo.c
38
int fd;
tests/fs/fifofs/t_fifo.c
45
fd = open(FIFO_FILE_PATH, O_WRONLY, 0);
tests/fs/fifofs/t_fifo.c
46
if (fd == -1) {
tests/fs/fifofs/t_fifo.c
55
rv = write(fd, message, MSG_SIZE);
tests/fs/fifofs/t_fifo.c
65
close(fd);
tests/fs/fifofs/t_fifo.c
96
int fd, status;
tests/fs/hfs/t_pathconvert.c
36
int dirfd, fd;
tests/fs/hfs/t_pathconvert.c
74
RL(fd = rump_sys_open("/mp/" FUNNY_FILENAME, O_RDONLY));
tests/fs/hfs/t_pathconvert.c
75
RL(rump_sys_close(fd));
tests/fs/kernfs/t_basic.c
102
if ((fd = rump_sys_open("/kern/hostname", O_RDWR)) == -1)
tests/fs/kernfs/t_basic.c
108
if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
tests/fs/kernfs/t_basic.c
116
if (rump_sys_pwrite(fd, NEWHOSTNAME, strlen(NEWHOSTNAME), 0)
tests/fs/kernfs/t_basic.c
99
int fd;
tests/fs/lfs/t_fcntl.c
128
int fd;
tests/fs/lfs/t_fcntl.c
156
fd = rump_sys_open(MP, O_RDONLY);
tests/fs/lfs/t_fcntl.c
157
if (fd < 0)
tests/fs/lfs/t_fcntl.c
160
return fd;
tests/fs/lfs/t_fcntl.c
163
void teardown(int fd, struct ufs_args *argsp, off_t filesize)
tests/fs/lfs/t_fcntl.c
166
rump_sys_close(fd);
tests/fs/lfs/t_fcntl.c
206
int fd;
tests/fs/lfs/t_fcntl.c
209
fd = setup(width, &args, A_FEW_BLOCKS);
tests/fs/lfs/t_fcntl.c
226
if (rump_sys_fcntl(fd, LFCNFILESTATS, &fsr) < 0)
tests/fs/lfs/t_fcntl.c
237
if (rump_sys_fcntl(fd, LFCNSCRAMBLE, &inotbl) < 0)
tests/fs/lfs/t_fcntl.c
240
if (rump_sys_fcntl(fd, LFCNFILESTATS, &fsr) < 0)
tests/fs/lfs/t_fcntl.c
252
if (rump_sys_fcntl(fd, LFCNREWRITEFILE, &inotbl) < 0)
tests/fs/lfs/t_fcntl.c
255
if (rump_sys_fcntl(fd, LFCNFILESTATS, &fsr) < 0)
tests/fs/lfs/t_fcntl.c
266
teardown(fd, &args, A_FEW_BLOCKS);
tests/fs/lfs/t_fcntl.c
274
int fd, sn;
tests/fs/lfs/t_fcntl.c
276
fd = setup(width, &args, MORE_THAN_A_SEGMENT);
tests/fs/lfs/t_fcntl.c
282
if (rump_sys_fcntl(fd, LFCNSEGUSE, &sua) < 0)
tests/fs/lfs/t_fcntl.c
301
if (rump_sys_fcntl(fd, LFCNREWRITESEGS, &sna) < 0)
tests/fs/lfs/t_fcntl.c
311
if (rump_sys_fcntl(fd, LFCNSEGUSE, &sua) < 0)
tests/fs/lfs/t_fcntl.c
318
teardown(fd, &args, MORE_THAN_A_SEGMENT);
tests/fs/lfs/t_fcntl.c
325
int i, fd;
tests/fs/lfs/t_fcntl.c
331
fd = setup(width, &args, CHUNKSIZE);
tests/fs/lfs/t_fcntl.c
333
rump_sys_fstatvfs1(fd, &statbuf, ST_WAIT);
tests/fs/lfs/t_fcntl.c
342
rump_sys_fstatvfs1(fd, &statbuf, ST_WAIT);
tests/fs/lfs/t_fcntl.c
353
if (rump_sys_fcntl(fd, LFCNCLEANERINFO, &ci_before) < 0)
tests/fs/lfs/t_fcntl.c
361
if (rump_sys_fcntl(fd, LFCNAUTOCLEAN, &autoclean) < 0)
tests/fs/lfs/t_fcntl.c
387
if (rump_sys_fcntl(fd, LFCNCLEANERINFO, &ci_after) < 0)
tests/fs/lfs/t_fcntl.c
394
teardown(fd, &args, CHUNKSIZE);
tests/fs/lfs/t_orphan.c
104
fd = write_file(UNCHANGED_CONTROL, FILE_SIZE, 0, 0);
tests/fs/lfs/t_orphan.c
111
rump_sys_fstat(fd, &statbuf);
tests/fs/lfs/t_orphan.c
71
int fd, status;
tests/fs/lfs/t_resize.c
108
fd = rump_sys_open(MP, O_RDONLY);
tests/fs/lfs/t_resize.c
109
if (fd < 0)
tests/fs/lfs/t_resize.c
114
resize(fd, BIGSIZE);
tests/fs/lfs/t_resize.c
117
rump_sys_close(fd);
tests/fs/lfs/t_resize.c
128
fd = rump_sys_open(MP, O_RDONLY);
tests/fs/lfs/t_resize.c
129
if (fd < 0)
tests/fs/lfs/t_resize.c
134
resize(fd, SMALLSIZE);
tests/fs/lfs/t_resize.c
137
rump_sys_close(fd);
tests/fs/lfs/t_resize.c
174
resize(int fd, size_t size)
tests/fs/lfs/t_resize.c
178
if (rump_sys_fcntl(fd, LFCNRESIZE, &newnseg) != 0)
tests/fs/lfs/t_resize.c
71
int fd;
tests/fs/lfs/util.c
100
int fd, i, j, res;
tests/fs/lfs/util.c
114
fd = rump_sys_open(filename, O_RDONLY);
tests/fs/lfs/util.c
119
rump_sys_read(fd, buf, res);
tests/fs/lfs/util.c
127
rump_sys_close(fd);
tests/fs/lfs/util.c
132
rump_sys_close(fd);
tests/fs/lfs/util.c
62
int fd;
tests/fs/lfs/util.c
81
fd = rump_sys_open(filename, flags);
tests/fs/lfs/util.c
86
rump_sys_write(fd, buf, MIN(len - i, (off_t)sizeof(buf)));
tests/fs/lfs/util.c
90
rump_sys_close(fd);
tests/fs/lfs/util.c
91
fd = -1;
tests/fs/lfs/util.c
94
return fd;
tests/fs/nfs/t_mountd.c
60
int fd, fail;
tests/fs/nfs/t_mountd.c
66
fd = rump_sys_open("file", O_RDWR | O_CREAT, 0600);
tests/fs/nfs/t_mountd.c
67
if (fd == -1) {
tests/fs/nfs/t_mountd.c
73
rump_sys_close(fd);
tests/fs/nullfs/t_basic.c
34
int fd;
tests/fs/nullfs/t_basic.c
36
fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
tests/fs/nullfs/t_basic.c
37
if (fd == -1)
tests/fs/nullfs/t_basic.c
39
if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR))
tests/fs/nullfs/t_basic.c
41
rump_sys_close(fd);
tests/fs/nullfs/t_basic.c
48
int fd;
tests/fs/nullfs/t_basic.c
50
fd = rump_sys_open(path, O_RDONLY);
tests/fs/nullfs/t_basic.c
51
if (fd == -1)
tests/fs/nullfs/t_basic.c
53
if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
tests/fs/nullfs/t_basic.c
55
rump_sys_close(fd);
tests/fs/psshfs/h_have_puffs.c
37
int exitcode, fd;
tests/fs/psshfs/h_have_puffs.c
39
fd = open("/dev/puffs", O_RDWR);
tests/fs/psshfs/h_have_puffs.c
40
if (fd != -1) {
tests/fs/psshfs/h_have_puffs.c
42
close(fd);
tests/fs/puffs/t_basic.c
102
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
147
int fd = (int)(uintptr_t)arg;
tests/fs/puffs/t_basic.c
152
if (rump_sys_write(fd, buf, strlen(buf)+1) != strlen(buf)+1)
tests/fs/puffs/t_basic.c
164
int fd;
tests/fs/puffs/t_basic.c
168
fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
tests/fs/puffs/t_basic.c
169
if (fd == -1)
tests/fs/puffs/t_basic.c
172
pthread_create(&pt, NULL, dofifow, (void *)(uintptr_t)fd);
tests/fs/puffs/t_basic.c
175
if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
tests/fs/puffs/t_basic.c
179
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
197
int fd;
tests/fs/puffs/t_basic.c
201
fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
tests/fs/puffs/t_basic.c
202
if (fd == -1)
tests/fs/puffs/t_basic.c
205
rv = rump_sys_write(fd, buf, sizeof(buf));
tests/fs/puffs/t_basic.c
208
rv = rump_sys_read(fd, buf, sizeof(buf));
tests/fs/puffs/t_basic.c
211
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
231
int fd;
tests/fs/puffs/t_basic.c
237
fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
tests/fs/puffs/t_basic.c
238
if (fd == -1)
tests/fs/puffs/t_basic.c
244
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
268
int fd;
tests/fs/puffs/t_basic.c
274
fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
tests/fs/puffs/t_basic.c
275
if (fd == -1)
tests/fs/puffs/t_basic.c
286
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
308
int fd;
tests/fs/puffs/t_basic.c
315
fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
tests/fs/puffs/t_basic.c
316
if (fd == -1)
tests/fs/puffs/t_basic.c
321
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
359
int fd, ianow;
tests/fs/puffs/t_basic.c
367
fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777);
tests/fs/puffs/t_basic.c
368
if (fd == -1)
tests/fs/puffs/t_basic.c
371
if (rump_sys_write(fd, MAGICSTR, sizeof(MAGICSTR)) != sizeof(MAGICSTR))
tests/fs/puffs/t_basic.c
379
if (rump_sys_pread(fd, buf, sizeof(buf), 0) == -1)
tests/fs/puffs/t_basic.c
381
rump_sys_close(fd);
tests/fs/puffs/t_basic.c
90
int fd, rv;
tests/fs/puffs/t_basic.c
94
fd = rump_sys_open(FSTEST_MNTNAME, O_RDWR);
tests/fs/puffs/t_basic.c
95
if (fd == -1)
tests/fs/puffs/t_basic.c
97
if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
tests/fs/puffs/t_fuzz.c
187
pfd.fd = dafd;
tests/fs/puffs/t_io.c
41
int fd;
tests/fs/puffs/t_io.c
46
RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755));
tests/fs/puffs/t_io.c
47
RL(rump_sys_write(fd, data, sizeof(data)));
tests/fs/puffs/t_io.c
48
rump_sys_close(fd);
tests/fs/tmpfs/h_tools.c
133
int fd;
tests/fs/tmpfs/h_tools.c
135
fd = open(argv[i], O_RDONLY);
tests/fs/tmpfs/h_tools.c
136
if (fd == -1)
tests/fs/tmpfs/h_tools.c
139
EV_SET(&changes[i], fd, EVFILT_VNODE,
tests/fs/tmpfs/h_tools.c
222
int error, fd;
tests/fs/tmpfs/h_tools.c
228
fd = socket(PF_LOCAL, SOCK_STREAM, 0);
tests/fs/tmpfs/h_tools.c
229
if (fd == -1) {
tests/fs/tmpfs/h_tools.c
237
error = bind(fd, (struct sockaddr *)&addr, SUN_LEN(&addr));
tests/fs/tmpfs/h_tools.c
240
(void)close(fd);
tests/fs/tmpfs/h_tools.c
244
close(fd);
tests/fs/tmpfs/t_renamerace.c
41
int fd;
tests/fs/tmpfs/t_renamerace.c
45
fd = rump_sys_open("/file", O_CREAT | O_RDWR, 0777);
tests/fs/tmpfs/t_renamerace.c
46
if (fd == -1)
tests/fs/tmpfs/t_renamerace.c
48
rump_sys_close(fd);
tests/fs/tmpfs/t_renamerace.c
63
int fd;
tests/fs/tmpfs/t_renamerace.c
68
fd = rump_sys_open("/dir/file1", O_RDWR);
tests/fs/tmpfs/t_renamerace.c
69
if (fd != -1)
tests/fs/tmpfs/t_renamerace.c
70
rump_sys_close(fd);
tests/fs/umapfs/t_basic.c
34
int fd;
tests/fs/umapfs/t_basic.c
36
fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777);
tests/fs/umapfs/t_basic.c
37
if (fd == -1)
tests/fs/umapfs/t_basic.c
39
rump_sys_close(fd);
tests/fs/union/t_pr.c
175
int fd, res;
tests/fs/union/t_pr.c
189
fd = rump_sys_open("/mp/null", O_WRONLY | O_CREAT | O_TRUNC, 0600);
tests/fs/union/t_pr.c
191
if (fd == -1)
tests/fs/union/t_pr.c
194
res = rump_sys_write(fd, &fd, sizeof(fd));
tests/fs/union/t_pr.c
195
if (res != sizeof(fd))
tests/fs/union/t_pr.c
209
int fd, res;
tests/fs/union/t_pr.c
223
fd = rump_sys_open("/mp/null", O_WRONLY | O_CREAT | O_APPEND, 0600);
tests/fs/union/t_pr.c
224
if (fd == -1)
tests/fs/union/t_pr.c
227
res = rump_sys_write(fd, &fd, sizeof(fd));
tests/fs/union/t_pr.c
228
if (res != sizeof(fd))
tests/fs/vfs/t_full.c
57
int fd, i = 0;
tests/fs/vfs/t_full.c
71
fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0600);
tests/fs/vfs/t_full.c
72
if (fd == -1)
tests/fs/vfs/t_full.c
77
n = rump_sys_write(fd, buf, sizeof(buf));
tests/fs/vfs/t_full.c
88
rump_sys_close(fd);
tests/fs/vfs/t_io.c
121
int fd;
tests/fs/vfs/t_io.c
125
RL(fd = rump_sys_open("testi", O_CREAT | O_RDWR, 0666));
tests/fs/vfs/t_io.c
126
ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);
tests/fs/vfs/t_io.c
127
RL(rump_sys_close(fd));
tests/fs/vfs/t_io.c
129
RL(fd = rump_sys_open("testi", O_RDWR));
tests/fs/vfs/t_io.c
131
RL(rump_sys_ftruncate(fd, 0));
tests/fs/vfs/t_io.c
132
ATF_REQUIRE_EQ(rump_sys_write(fd, buf, count), count);
tests/fs/vfs/t_io.c
133
RL(rump_sys_close(fd));
tests/fs/vfs/t_io.c
161
int fd;
tests/fs/vfs/t_io.c
164
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
tests/fs/vfs/t_io.c
165
RL(rump_sys_ftruncate(fd, 2));
tests/fs/vfs/t_io.c
166
RL(rump_sys_ftruncate(fd, 1));
tests/fs/vfs/t_io.c
167
rump_sys_close(fd);
tests/fs/vfs/t_io.c
176
int fd;
tests/fs/vfs/t_io.c
181
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT, 0666));
tests/fs/vfs/t_io.c
183
ATF_REQUIRE_EQ(rump_sys_write(fd, buf, TBSIZE), TBSIZE);
tests/fs/vfs/t_io.c
184
rump_sys_close(fd);
tests/fs/vfs/t_io.c
189
RL(fd = rump_sys_open("file", O_RDWR));
tests/fs/vfs/t_io.c
192
ATF_REQUIRE_EQ(rump_sys_read(fd, buf2, TBSIZE), TBSIZE);
tests/fs/vfs/t_io.c
194
rump_sys_close(fd);
tests/fs/vfs/t_io.c
204
int fd;
tests/fs/vfs/t_io.c
208
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT, 0666));
tests/fs/vfs/t_io.c
211
RL(rump_sys_pwrite(fd, &value, sizeof(value), 654321));
tests/fs/vfs/t_io.c
217
RL(rump_sys_fsync(fd));
tests/fs/vfs/t_io.c
218
RL(rump_sys_pread(fd, &v2, sizeof(v2), 654321));
tests/fs/vfs/t_io.c
219
rump_sys_close(fd);
tests/fs/vfs/t_io.c
229
int fd;
tests/fs/vfs/t_io.c
232
RL(fd = rump_sys_open("file", O_CREAT | O_RDWR, 0777));
tests/fs/vfs/t_io.c
233
ATF_REQUIRE_EQ(rump_sys_write(fd, &ch, 1), 1);
tests/fs/vfs/t_io.c
234
RL(rump_sys_close(fd));
tests/fs/vfs/t_io.c
235
RL(fd = rump_sys_open("file", O_RDONLY | O_SYNC | O_RSYNC));
tests/fs/vfs/t_io.c
236
ATF_REQUIRE_ERRNO(EFAULT, rump_sys_read(fd, NULL, 1) == -1);
tests/fs/vfs/t_io.c
237
RL(rump_sys_close(fd));
tests/fs/vfs/t_io.c
53
int fd;
tests/fs/vfs/t_io.c
57
RL(fd = rump_sys_open("file", O_RDWR|O_CREAT|O_TRUNC, 0666));
tests/fs/vfs/t_io.c
60
RL(rump_sys_pwrite(fd, buf, 1, getpagesize()));
tests/fs/vfs/t_io.c
63
RL(rump_sys_pwrite(fd, buf, 2, getpagesize()-1));
tests/fs/vfs/t_io.c
68
RL(rump_sys_pread(fd, b2, therange, 0));
tests/fs/vfs/t_io.c
75
rump_sys_close(fd);
tests/fs/vfs/t_io.c
84
int fd;
tests/fs/vfs/t_io.c
87
RL(fd = rump_sys_open("testfile",
tests/fs/vfs/t_io.c
89
RL(rump_sys_ftruncate(fd, seekcnt));
tests/fs/vfs/t_io.c
90
RL(rump_sys_fstat(fd, &sb));
tests/fs/vfs/t_io.c
93
ATF_REQUIRE_EQ(rump_sys_write(fd, TESTSTR, TESTSZ), TESTSZ);
tests/fs/vfs/t_io.c
94
ATF_REQUIRE_EQ(rump_sys_pread(fd, buf, TESTSZ, seekcnt), TESTSZ);
tests/fs/vfs/t_io.c
97
RL(rump_sys_fstat(fd, &sb));
tests/fs/vfs/t_io.c
99
RL(rump_sys_close(fd));
tests/fs/vfs/t_link.c
64
int one = 1, fd;
tests/fs/vfs/t_link.c
83
if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
tests/fs/vfs/t_link.c
85
if (rump_sys_close(fd) == -1)
tests/fs/vfs/t_renamerace.c
45
int fd;
tests/fs/vfs/t_renamerace.c
50
fd = rump_sys_open("rename.test1",
tests/fs/vfs/t_renamerace.c
52
if (fd == -1 && errno != EEXIST)
tests/fs/vfs/t_renamerace.c
55
rump_sys_close(fd);
tests/fs/vfs/t_rmdirrace.c
101
res = rump_sys_fchdir(fd);
tests/fs/vfs/t_rmdirrace.c
68
int res, fd, quit;
tests/fs/vfs/t_rmdirrace.c
74
fd = rump_sys_open(".", O_RDONLY, 0666);
tests/fs/vfs/t_rmdirrace.c
75
if (fd == -1)
tests/fs/vfs/t_ro.c
109
RL(fd = rump_sys_open(AFILE, O_RDONLY));
tests/fs/vfs/t_ro.c
110
ATF_REQUIRE_EQ(rump_sys_read(fd, buf, FUNSIZE), FUNSIZE);
tests/fs/vfs/t_ro.c
113
RL(rump_sys_close(fd));
tests/fs/vfs/t_ro.c
125
int fd;
tests/fs/vfs/t_ro.c
136
RL(fd = rump_sys_open(AFILE, O_RDONLY));
tests/fs/vfs/t_ro.c
137
ATF_REQUIRE_ERRNO(EROFS, rump_sys_fchmod(fd, 0775) == -1);
tests/fs/vfs/t_ro.c
139
ATF_REQUIRE_ERRNO(EROFS, rump_sys_fchown(fd, 1, 1) == -1);
tests/fs/vfs/t_ro.c
140
ATF_REQUIRE_ERRNO(EROFS, rump_sys_futimes(fd, sometvs) == -1);
tests/fs/vfs/t_ro.c
141
RL(rump_sys_close(fd));
tests/fs/vfs/t_ro.c
62
int fd;
tests/fs/vfs/t_ro.c
65
RL(fd = rump_sys_open(AFILE, O_CREAT | O_RDWR, 0777));
tests/fs/vfs/t_ro.c
66
ATF_REQUIRE_EQ(rump_sys_write(fd, FUNTEXT, FUNSIZE), FUNSIZE);
tests/fs/vfs/t_ro.c
67
RL(rump_sys_close(fd));
tests/fs/vfs/t_ro.c
99
int fd;
tests/fs/vfs/t_union.c
115
int error, fd, dsize;
tests/fs/vfs/t_union.c
141
RL(fd = rump_sys_open(mp, O_RDONLY));
tests/fs/vfs/t_union.c
142
RL(dsize = rump_sys_getdents(fd, dbuf, sizeof(dbuf)));
tests/fs/vfs/t_union.c
149
RL(rump_sys_close(fd));
tests/fs/vfs/t_union.c
29
int fd;
tests/fs/vfs/t_union.c
35
RL(fd = rump_sys_open(pathb, O_CREAT | O_RDWR, 0777));
tests/fs/vfs/t_union.c
36
if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR))
tests/fs/vfs/t_union.c
38
RL(rump_sys_close(fd));
tests/fs/vfs/t_union.c
46
int fd;
tests/fs/vfs/t_union.c
52
fd = rump_sys_open(pathb, O_RDONLY);
tests/fs/vfs/t_union.c
53
if (fd == -1)
tests/fs/vfs/t_union.c
55
if (rump_sys_read(fd, buf, sizeof(buf)) == -1)
tests/fs/vfs/t_union.c
57
RL(rump_sys_close(fd));
tests/fs/vfs/t_unpriv.c
101
if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
tests/fs/vfs/t_unpriv.c
103
if (rump_sys_close(fd) == -1)
tests/fs/vfs/t_unpriv.c
126
int fd;
tests/fs/vfs/t_unpriv.c
137
if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
tests/fs/vfs/t_unpriv.c
139
if (rump_sys_close(fd) == -1)
tests/fs/vfs/t_unpriv.c
178
int fd, fflags;
tests/fs/vfs/t_unpriv.c
183
if ((fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666)) == -1)
tests/fs/vfs/t_unpriv.c
185
if (rump_sys_close(fd) == -1)
tests/fs/vfs/t_unpriv.c
84
int fd;
tests/fs/vfs/t_vfsops.c
110
fd = rump_sys_fhopen(fhp, fhsize, O_RDONLY);
tests/fs/vfs/t_vfsops.c
111
if (fd == -1) {
tests/fs/vfs/t_vfsops.c
116
if (rump_sys_read(fd, buf, sizeof(buf)) != sizeof(MAGICSTR))
tests/fs/vfs/t_vfsops.c
121
rump_sys_close(fd);
tests/fs/vfs/t_vfsops.c
130
int fd;
tests/fs/vfs/t_vfsops.c
133
RL(fd = rump_sys_open(FNAME, O_RDWR | O_CREAT, 0777));
tests/fs/vfs/t_vfsops.c
134
RL(rump_sys_close(fd));
tests/fs/vfs/t_vfsops.c
166
int fd;
tests/fs/vfs/t_vfsops.c
183
fd = rump_sys_fhopen(fhp, fhsize, O_RDWR);
tests/fs/vfs/t_vfsops.c
184
if (fd != -1)
tests/fs/vfs/t_vfsops.c
185
rump_sys_close(fd);
tests/fs/vfs/t_vfsops.c
81
int fd;
tests/fs/vfs/t_vfsops.c
84
fd = rump_sys_open(fpath, O_RDWR | O_CREAT, 0777);
tests/fs/vfs/t_vfsops.c
85
if (fd == -1)
tests/fs/vfs/t_vfsops.c
88
if (rump_sys_write(fd, MAGICSTR, sizeof(MAGICSTR)) != sizeof(MAGICSTR))
tests/fs/vfs/t_vfsops.c
90
rump_sys_close(fd);
tests/fs/vfs/t_vnops.c
1002
RL(fd = rump_sys_open("tfile", O_CREAT | O_RDWR, 0777));
tests/fs/vfs/t_vnops.c
1003
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
1023
int fd, res;
tests/fs/vfs/t_vnops.c
1027
fd = rump_sys_open(".", O_DIRECTORY | O_RDONLY, 0777);
tests/fs/vfs/t_vnops.c
1028
ATF_REQUIRE(fd != -1);
tests/fs/vfs/t_vnops.c
1030
size = rump_sys_pread(fd, buf, sizeof(buf), 0);
tests/fs/vfs/t_vnops.c
1032
size = rump_sys_read(fd, buf, sizeof(buf));
tests/fs/vfs/t_vnops.c
1035
res = rump_sys_close(fd);
tests/fs/vfs/t_vnops.c
220
int fd, rv;
tests/fs/vfs/t_vnops.c
230
fd = rump_sys_open(pb2, O_RDWR | O_CREAT, 0777);
tests/fs/vfs/t_vnops.c
231
if (fd == -1)
tests/fs/vfs/t_vnops.c
233
rump_sys_close(fd);
tests/fs/vfs/t_vnops.c
521
int fd;
tests/fs/vfs/t_vnops.c
524
RL(fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666));
tests/fs/vfs/t_vnops.c
525
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
554
int fd;
tests/fs/vfs/t_vnops.c
556
fd = rump_sys_open(buf, O_RDWR|O_CREAT|O_EXCL, 0666);
tests/fs/vfs/t_vnops.c
557
if (fd == -1)
tests/fs/vfs/t_vnops.c
559
RLF(rump_sys_close(fd), "%d", fd);
tests/fs/vfs/t_vnops.c
571
int fd;
tests/fs/vfs/t_vnops.c
594
fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666);
tests/fs/vfs/t_vnops.c
595
if (val != 0 && (fd != -1 || errno != ENAMETOOLONG))
tests/fs/vfs/t_vnops.c
598
if (val == 0 && rump_sys_close(fd) == -1)
tests/fs/vfs/t_vnops.c
612
int fd;
tests/fs/vfs/t_vnops.c
615
RL(fd = rump_sys_open(name, O_RDWR|O_CREAT|O_EXCL, 0666));
tests/fs/vfs/t_vnops.c
616
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
618
RL(fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666));
tests/fs/vfs/t_vnops.c
619
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
620
RL(fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666));
tests/fs/vfs/t_vnops.c
621
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
623
(fd = rump_sys_open(name, O_RDWR|O_CREAT|O_EXCL, 0666)));
tests/fs/vfs/t_vnops.c
632
int res, fd;
tests/fs/vfs/t_vnops.c
654
fd = rump_sys_open("dummy", O_RDWR|O_CREAT, 0666);
tests/fs/vfs/t_vnops.c
655
if (fd == -1)
tests/fs/vfs/t_vnops.c
657
if (rump_sys_close(fd) == -1)
tests/fs/vfs/t_vnops.c
743
int fd;
tests/fs/vfs/t_vnops.c
746
RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0755));
tests/fs/vfs/t_vnops.c
747
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
793
int fd, fd2;
tests/fs/vfs/t_vnops.c
804
RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0755));
tests/fs/vfs/t_vnops.c
805
RL(rump_sys_ftruncate(fd, 8192));
tests/fs/vfs/t_vnops.c
807
RL(rump_sys_fcntl(fd, F_SETLK, &l));
tests/fs/vfs/t_vnops.c
818
RL(rump_sys_fcntl(fd, F_SETLK, &l));
tests/fs/vfs/t_vnops.c
828
RL(rump_sys_close(fd));
tests/fs/vfs/t_vnops.c
908
int fd[5];
tests/fs/vfs/t_vnops.c
934
RL(fd[i] = rump_sys_open(TESTFILE, oflags, omode));
tests/fs/vfs/t_vnops.c
938
RL(rump_sys_ftruncate(fd[i], sz));
tests/fs/vfs/t_vnops.c
941
RL(rump_sys_fcntl(fd[i], F_SETLK, &lock[i]));
tests/fs/vfs/t_vnops.c
960
nlocks = fcntl_getlocks(fd[i], 0, sz,
tests/fs/vfs/t_vnops.c
998
int fd;
tests/include/sys/t_socket.c
125
if (rump_sys_pipe(fd) == -1)
tests/include/sys/t_socket.c
128
if (rump_sys_write(fd[1], MAGICSTRING, sizeof(MAGICSTRING)) !=
tests/include/sys/t_socket.c
147
*(int *)CMSG_DATA(cmp) = fd[0];
tests/include/sys/t_socket.c
36
int fd;
tests/include/sys/t_socket.c
45
iov.iov_base = &fd;
tests/include/sys/t_socket.c
90
int rfd, fd[2], storage;
tests/include/t_paths.c
129
int fd;
tests/include/t_paths.c
141
fd = open(paths[i].path, O_RDONLY);
tests/include/t_paths.c
142
if (fd < 0) {
tests/include/t_paths.c
173
if (fstat(fd, &st) == -1) {
tests/include/t_paths.c
176
ATF_CHECK(close(fd) == 0);
tests/include/t_paths.c
200
ATF_CHECK(close(fd) == 0);
tests/kernel/arch/aarch64/execregs.c
130
spawnregschild(char *path, int fd)
tests/kernel/arch/aarch64/execregs.c
174
error = posix_spawn_file_actions_adddup2(&fileacts, fd, STDOUT_FILENO);
tests/kernel/arch/hppa/execregs.c
259
spawnregschild(char *path, int fd)
tests/kernel/arch/hppa/execregs.c
329
error = posix_spawn_file_actions_adddup2(&fileacts, fd, STDOUT_FILENO);
tests/kernel/arch/i386/execregs.c
101
error = posix_spawn_file_actions_adddup2(&fileacts, fd, STDOUT_FILENO);
tests/kernel/arch/i386/execregs.c
81
spawnregschild(char *path, int fd)
tests/kernel/arch/vax/execregs.c
128
error = posix_spawn_file_actions_adddup2(&fileacts, fd, STDOUT_FILENO);
tests/kernel/arch/vax/execregs.c
98
spawnregschild(char *path, int fd)
tests/kernel/arch/x86_64/execregs.c
123
error = posix_spawn_file_actions_adddup2(&fileacts, fd, STDOUT_FILENO);
tests/kernel/arch/x86_64/execregs.c
95
spawnregschild(char *path, int fd)
tests/kernel/h_cloexec.c
40
int fd = atoi(argv[1]);
tests/kernel/h_cloexec.c
43
if (fcntl(fd, F_GETFL, &flags) == 0)
tests/kernel/h_fexecve.c
43
int fd = open(args[0], O_RDONLY);
tests/kernel/h_fexecve.c
44
if (fd == -1)
tests/kernel/h_fexecve.c
46
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
tests/kernel/h_fexecve.c
48
if (fexecve(fd, args, NULL) == -1)
tests/kernel/kqueue/read/t_file.c
101
RL(lseek(fd, 0, SEEK_END));
tests/kernel/kqueue/read/t_file.c
106
EV_SET(&event[0], fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
tests/kernel/kqueue/read/t_file.c
119
RL(lseek(fd, 0, SEEK_END));
tests/kernel/kqueue/read/t_file.c
121
RL(lseek(fd, event[0].data, SEEK_END));
tests/kernel/kqueue/read/t_file.c
124
RL(n = read(fd, buffer, 128));
tests/kernel/kqueue/read/t_file.c
61
int i, n, fd;
tests/kernel/kqueue/read/t_file.c
66
fd = open(FILENAME, O_WRONLY|O_APPEND, 0644);
tests/kernel/kqueue/read/t_file.c
67
if (fd < 0)
tests/kernel/kqueue/read/t_file.c
70
n = write(fd, "foo\n", 4);
tests/kernel/kqueue/read/t_file.c
74
(void)close(fd);
tests/kernel/kqueue/read/t_file.c
90
int fd, kq, n, num, status;
tests/kernel/kqueue/read/t_file.c
98
RL(fd = open(FILENAME, O_RDONLY|O_CREAT, 0644));
tests/kernel/kqueue/read/t_ttypty.c
87
pfd.fd = acurrent;
tests/kernel/kqueue/t_vnode.c
525
int fd;
tests/kernel/kqueue/t_vnode.c
534
ATF_REQUIRE((fd = open(testfile,
tests/kernel/kqueue/t_vnode.c
536
EV_SET(&event[0], fd, EVFILT_VNODE, EV_ADD | EV_CLEAR,
tests/kernel/kqueue/t_vnode.c
548
ATF_REQUIRE((fd = open(testfile, O_RDWR)) != -1);
tests/kernel/kqueue/t_vnode.c
552
ATF_REQUIRE((pwrite(fd, testfile,
tests/kernel/kqueue/t_vnode.c
558
ATF_REQUIRE((pwrite(fd, testfile,
tests/kernel/kqueue/t_vnode.c
564
ATF_REQUIRE((pwrite(fd, testfile,
tests/kernel/kqueue/t_vnode.c
570
(void)close(fd);
tests/kernel/kqueue/t_vnode.c
580
ATF_REQUIRE((fd = open(testfile, O_RDONLY)) != -1);
tests/kernel/kqueue/t_vnode.c
584
ATF_REQUIRE((read(fd, buf, sizeof(buf))) == sizeof(buf));
tests/kernel/kqueue/t_vnode.c
588
(void)close(fd);
tests/kernel/kqueue/t_vnode.c
608
int fd;
tests/kernel/kqueue/t_vnode.c
61
int fd;
tests/kernel/kqueue/t_vnode.c
63
fd = open(file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
tests/kernel/kqueue/t_vnode.c
64
if (fd < 0) {
tests/kernel/kqueue/t_vnode.c
655
ATF_REQUIRE((fd = open(testfile, O_RDWR)) != -1);
tests/kernel/kqueue/t_vnode.c
659
ATF_REQUIRE((pwrite(fd, testfile,
tests/kernel/kqueue/t_vnode.c
663
(void)close(fd);
tests/kernel/kqueue/t_vnode.c
67
return close(fd);
tests/kernel/kqueue/write/t_ttypty.c
78
pfd.fd = acurrent;
tests/kernel/t_cloexec.c
100
return fd;
tests/kernel/t_cloexec.c
118
int fd;
tests/kernel/t_cloexec.c
120
RL(fd = fcntl(STDIN_FILENO, F_DUPFD_CLOEXEC, 0));
tests/kernel/t_cloexec.c
122
return fd;
tests/kernel/t_cloexec.c
128
int fd;
tests/kernel/t_cloexec.c
130
RL(fd = kqueue1(O_CLOEXEC));
tests/kernel/t_cloexec.c
132
return fd;
tests/kernel/t_cloexec.c
138
int fd;
tests/kernel/t_cloexec.c
140
RL(fd = open("file", O_RDWR|O_CREAT|O_CLOEXEC, 0644));
tests/kernel/t_cloexec.c
142
return fd;
tests/kernel/t_cloexec.c
148
int fd;
tests/kernel/t_cloexec.c
150
RL(fd = open("file", O_RDWR|O_CREAT, 0644));
tests/kernel/t_cloexec.c
151
RL(fcntl(fd, F_SETFD, FD_CLOEXEC));
tests/kernel/t_cloexec.c
153
return fd;
tests/kernel/t_cloexec.c
159
int fd;
tests/kernel/t_cloexec.c
161
RL(fd = open("file", O_RDWR|O_CREAT, 0644));
tests/kernel/t_cloexec.c
162
RL(ioctl(fd, FIOCLEX));
tests/kernel/t_cloexec.c
164
return fd;
tests/kernel/t_cloexec.c
170
int fd[2];
tests/kernel/t_cloexec.c
172
RL(pipe2(fd, O_CLOEXEC));
tests/kernel/t_cloexec.c
174
return fd[0];
tests/kernel/t_cloexec.c
180
int fd[2];
tests/kernel/t_cloexec.c
182
RL(pipe2(fd, O_CLOEXEC));
tests/kernel/t_cloexec.c
184
return fd[1];
tests/kernel/t_cloexec.c
229
int fd;
tests/kernel/t_cloexec.c
231
RL(fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0));
tests/kernel/t_cloexec.c
233
return fd;
tests/kernel/t_cloexec.c
239
int fd[2];
tests/kernel/t_cloexec.c
241
RL(socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0, fd));
tests/kernel/t_cloexec.c
243
return fd[0];
tests/kernel/t_cloexec.c
249
int fd[2];
tests/kernel/t_cloexec.c
251
RL(socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0, fd));
tests/kernel/t_cloexec.c
253
return fd[1];
tests/kernel/t_cloexec.c
270
check_cloexec(const struct atf_tc *tc, int fd,
tests/kernel/t_cloexec.c
286
snprintf(fdstr, sizeof(fdstr), "%d", fd);
tests/kernel/t_cloexec.c
96
int fd;
tests/kernel/t_cloexec.c
98
RL(fd = open("/dev/drvctl", O_RDONLY|O_CLOEXEC));
tests/kernel/t_clofork.c
101
return fd;
tests/kernel/t_clofork.c
119
int fd;
tests/kernel/t_clofork.c
121
RL(fd = fcntl(STDIN_FILENO, F_DUPFD_CLOFORK, 0));
tests/kernel/t_clofork.c
123
return fd;
tests/kernel/t_clofork.c
129
int fd;
tests/kernel/t_clofork.c
131
RL(fd = kqueue1(O_CLOFORK));
tests/kernel/t_clofork.c
133
return fd;
tests/kernel/t_clofork.c
139
int fd;
tests/kernel/t_clofork.c
141
RL(fd = open("file", O_RDWR|O_CREAT|O_CLOFORK, 0644));
tests/kernel/t_clofork.c
143
return fd;
tests/kernel/t_clofork.c
149
int fd;
tests/kernel/t_clofork.c
151
RL(fd = open("file", O_RDWR|O_CREAT, 0644));
tests/kernel/t_clofork.c
152
RL(fcntl(fd, F_SETFD, FD_CLOFORK));
tests/kernel/t_clofork.c
154
return fd;
tests/kernel/t_clofork.c
160
int fd[2];
tests/kernel/t_clofork.c
162
RL(pipe2(fd, O_CLOFORK));
tests/kernel/t_clofork.c
164
return fd[0];
tests/kernel/t_clofork.c
170
int fd[2];
tests/kernel/t_clofork.c
172
RL(pipe2(fd, O_CLOFORK));
tests/kernel/t_clofork.c
174
return fd[1];
tests/kernel/t_clofork.c
219
int fd;
tests/kernel/t_clofork.c
221
RL(fd = socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOFORK, 0));
tests/kernel/t_clofork.c
223
return fd;
tests/kernel/t_clofork.c
229
int fd[2];
tests/kernel/t_clofork.c
231
RL(socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOFORK, 0, fd));
tests/kernel/t_clofork.c
233
return fd[0];
tests/kernel/t_clofork.c
239
int fd[2];
tests/kernel/t_clofork.c
241
RL(socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOFORK, 0, fd));
tests/kernel/t_clofork.c
243
return fd[1];
tests/kernel/t_clofork.c
247
check_clofork(const struct atf_tc *tc, int fd,
tests/kernel/t_clofork.c
263
snprintf(fdstr, sizeof(fdstr), "%d", fd);
tests/kernel/t_clofork.c
97
int fd;
tests/kernel/t_clofork.c
99
RL(fd = open("/dev/drvctl", O_RDONLY|O_CLOFORK));
tests/kernel/t_epoll.c
133
int epfd, fd;
tests/kernel/t_epoll.c
137
RL(fd = epoll_create1(0));
tests/kernel/t_epoll.c
140
RL(epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &event));
tests/kernel/t_epoll.c
142
ATF_REQUIRE_EQ_MSG(epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &event), -1,
tests/kernel/t_epoll.c
156
int epfd, fd;
tests/kernel/t_epoll.c
160
RL(fd = epoll_create1(0));
tests/kernel/t_epoll.c
163
ATF_REQUIRE_EQ_MSG(epoll_ctl(epfd, EPOLL_CTL_MOD, fd, &event), -1,
tests/kernel/t_epoll.c
167
ATF_REQUIRE_EQ_MSG(epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL), -1,
tests/kernel/t_epoll.c
73
int fd;
tests/kernel/t_epoll.c
75
RL(fd = epoll_create1(0));
tests/kernel/t_epoll.c
76
ATF_REQUIRE_MSG((fcntl(fd, F_GETFD) & FD_CLOEXEC) == 0,
tests/kernel/t_epoll.c
79
RL(fd = epoll_create1(EPOLL_CLOEXEC));
tests/kernel/t_epoll.c
80
ATF_REQUIRE_MSG((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0,
tests/kernel/t_epoll.c
93
int fd;
tests/kernel/t_epoll.c
96
RL(fd = epoll_create1(0));
tests/kernel/t_epoll.c
99
ATF_REQUIRE_EQ_MSG(epoll_ctl(-1, EPOLL_CTL_ADD, fd, &event), -1,
tests/kernel/t_fcntl.c
107
int fd, rv;
tests/kernel/t_fcntl.c
110
fd = memfd_create(memfd_names[i].bare, 0);
tests/kernel/t_fcntl.c
111
ATF_CHECK_MSG(fd != -1, "Failed to create memfd (%s)",
tests/kernel/t_fcntl.c
113
if (fd == -1)
tests/kernel/t_fcntl.c
115
rv = fcntl(fd, F_GETPATH, path);
tests/kernel/t_fcntl.c
122
next: close(fd);
tests/kernel/t_fcntl.c
64
int fd, rv;
tests/kernel/t_fcntl.c
67
fd = open(files[i].name, O_RDONLY|O_NOFOLLOW);
tests/kernel/t_fcntl.c
68
ATF_REQUIRE_MSG(fd != -1, "Cannot open `%s'", files[i].name);
tests/kernel/t_fcntl.c
69
rv = fcntl(fd, F_GETPATH, path);
tests/kernel/t_fcntl.c
80
close(fd);
tests/kernel/t_fdrestart.c
116
RL(rump_sys_ioctl(F->fd, FIONSPACE, &nspace));
tests/kernel/t_fdrestart.c
120
RL(rump_sys_write(F->fd, buf, (size_t)nspace));
tests/kernel/t_fdrestart.c
132
nwrit = rump_sys_write(F->fd, buf, sizeof(buf));
tests/kernel/t_fdrestart.c
142
nwrit = rump_sys_write(F->fd, buf, sizeof(buf));
tests/kernel/t_fdrestart.c
179
RL(rump_sys_close(F->fd)); /* wake op in other thread */
tests/kernel/t_fdrestart.c
192
int fd[2];
tests/kernel/t_fdrestart.c
196
RL(rump_sys_pipe(fd));
tests/kernel/t_fdrestart.c
200
F->fd = fd[0];
tests/kernel/t_fdrestart.c
212
int fd[2];
tests/kernel/t_fdrestart.c
216
RL(rump_sys_pipe(fd));
tests/kernel/t_fdrestart.c
220
F->fd = fd[1];
tests/kernel/t_fdrestart.c
233
int fd[2];
tests/kernel/t_fdrestart.c
237
RL(rump_sys_socketpair(AF_LOCAL, SOCK_STREAM, 0, fd));
tests/kernel/t_fdrestart.c
241
F->fd = fd[0];
tests/kernel/t_fdrestart.c
253
int fd[2];
tests/kernel/t_fdrestart.c
257
RL(rump_sys_socketpair(AF_LOCAL, SOCK_STREAM, 0, fd));
tests/kernel/t_fdrestart.c
261
F->fd = fd[0];
tests/kernel/t_fdrestart.c
50
int fd;
tests/kernel/t_fdrestart.c
86
nread = rump_sys_read(F->fd, &c, sizeof(c));
tests/kernel/t_fdrestart.c
96
nread = rump_sys_read(F->fd, &c, sizeof(c));
tests/kernel/t_filedesc.c
53
static int fd;
tests/kernel/t_filedesc.c
62
rump_sys_write(fd, &fd, sizeof(fd));
tests/kernel/t_filedesc.c
83
fd = fd_wrk = rump_sys_open("/dev/null", O_RDWR, 0);
tests/kernel/t_filedesc.c
84
if (fd == -1)
tests/kernel/t_filedesc.c
96
assert(fd == fd_wrk);
tests/kernel/t_lockf.c
102
(void)fcntl(fd, F_SETLKW, &fl);
tests/kernel/t_lockf.c
108
close (fd);
tests/kernel/t_lockf.c
121
int i, j, fd;
tests/kernel/t_lockf.c
130
fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
tests/kernel/t_lockf.c
131
ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", lockfile, strerror(errno));
tests/kernel/t_lockf.c
133
ATF_REQUIRE_MSG(ftruncate(fd, filesize) >= 0,
tests/kernel/t_lockf.c
138
fsync(fd);
tests/kernel/t_lockf.c
139
close(fd);
tests/kernel/t_lockf.c
191
dolock(int fd, int op, off_t lk_off, off_t lk_size)
tests/kernel/t_lockf.c
196
result = lseek(fd, lk_off, SEEK_SET);
tests/kernel/t_lockf.c
201
ret = lockf(fd, op, lk_size);
tests/kernel/t_lockf.c
218
int fd;
tests/kernel/t_lockf.c
225
fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666);
tests/kernel/t_lockf.c
226
ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", lockfile, strerror(errno));
tests/kernel/t_lockf.c
228
ATF_REQUIRE_MSG(ftruncate(fd, filesize) >= 0,
tests/kernel/t_lockf.c
231
fsync(fd);
tests/kernel/t_lockf.c
233
error = dolock(fd, F_LOCK, 0, 1);
tests/kernel/t_lockf.c
239
error = dolock(fd, F_LOCK, 1, 1);
tests/kernel/t_lockf.c
242
dolock(fd, F_LOCK, 0, 1); /* will block */
tests/kernel/t_lockf.c
247
error = dolock(fd, F_LOCK, 1, 1);
tests/kernel/t_lockf.c
73
int i, fd;
tests/kernel/t_lockf.c
77
fd = open (lockfile, O_RDWR, 0);
tests/kernel/t_lockf.c
79
if (fd < 0)
tests/kernel/t_lua.c
108
int fd;
tests/kernel/t_lua.c
121
RL(fd = open(path, O_WRONLY|O_CREAT));
tests/kernel/t_lua.c
122
RL(close(fd));
tests/kernel/t_lua.c
128
RL(fd = open(_PATH_DEV_LUA, O_RDONLY));
tests/kernel/t_lua.c
129
RL(ioctl(fd, LUAINFO, &info));
tests/kernel/t_lua.c
130
ATF_REQUIRE_ERRNO(EACCES, ioctl(fd, LUACREATE, &cr) == -1);
tests/kernel/t_lua.c
131
ATF_REQUIRE_ERRNO(EACCES, ioctl(fd, LUALOAD, &ld) == -1);
tests/kernel/t_lua.c
132
ATF_REQUIRE_ERRNO(EACCES, ioctl(fd, LUAREQUIRE, &rq) == -1);
tests/kernel/t_lua.c
133
ATF_REQUIRE_ERRNO(EACCES, ioctl(fd, LUADESTROY, &cr) == -1);
tests/kernel/t_lua.c
134
RL(close(fd));
tests/kernel/t_lua.c
140
RL(fd = open(_PATH_DEV_LUA, O_WRONLY));
tests/kernel/t_lua.c
142
ATF_REQUIRE_ERRNO(EACCES, ioctl(fd, LUAINFO, &info) == -1);
tests/kernel/t_lua.c
146
ATF_REQUIRE_ERRNO(ENXIO, ioctl(fd, LUACREATE, &cr) == -1);
tests/kernel/t_lua.c
150
RL(ioctl(fd, LUACREATE, &cr));
tests/kernel/t_lua.c
154
ATF_REQUIRE_ERRNO(EBUSY, ioctl(fd, LUACREATE, &cr) == -1);
tests/kernel/t_lua.c
156
lua_fd = fd; /* for cleanup */
tests/kernel/t_lua.c
161
RL(ioctl(fd, LUALOAD, &ld));
tests/kernel/t_lua.c
165
RL(ioctl(fd, LUADESTROY, &cr));
tests/kernel/t_lua.c
167
RL(close(fd));
tests/kernel/t_memfd_create.c
110
int fd;
tests/kernel/t_memfd_create.c
115
RL(fd = memfd_create("", 0));
tests/kernel/t_memfd_create.c
119
RL(write(fd, write_buf, rwbuf_size));
tests/kernel/t_memfd_create.c
120
offset = lseek(fd, 0, SEEK_CUR);
tests/kernel/t_memfd_create.c
125
RL(lseek(fd, 0, SEEK_SET));
tests/kernel/t_memfd_create.c
127
RL(read(fd, read_buf, rwbuf_size));
tests/kernel/t_memfd_create.c
128
offset = lseek(fd, 0, SEEK_CUR);
tests/kernel/t_memfd_create.c
147
int fd;
tests/kernel/t_memfd_create.c
152
RL(fd = memfd_create("", 0));
tests/kernel/t_memfd_create.c
157
RL(write(fd, write_buf, rwbuf_size));
tests/kernel/t_memfd_create.c
159
RL(fstat(fd, &st));
tests/kernel/t_memfd_create.c
164
RL(ftruncate(fd, rwbuf_size/2));
tests/kernel/t_memfd_create.c
165
RL(fstat(fd, &st));
tests/kernel/t_memfd_create.c
170
RL(ftruncate(fd, rwbuf_size));
tests/kernel/t_memfd_create.c
171
RL(fstat(fd, &st));
tests/kernel/t_memfd_create.c
176
RL(lseek(fd, 0, SEEK_SET));
tests/kernel/t_memfd_create.c
177
RL(read(fd, read_buf, rwbuf_size));
tests/kernel/t_memfd_create.c
195
int fd;
tests/kernel/t_memfd_create.c
200
RL(fd = memfd_create("", 0));
tests/kernel/t_memfd_create.c
201
RL(ftruncate(fd, rwbuf_size));
tests/kernel/t_memfd_create.c
203
addr = mmap(NULL, rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/kernel/t_memfd_create.c
206
rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
tests/kernel/t_memfd_create.c
220
int fd;
tests/kernel/t_memfd_create.c
222
RL(fd = memfd_create("", 0));
tests/kernel/t_memfd_create.c
224
ATF_REQUIRE_EQ_MSG(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE), -1,
tests/kernel/t_memfd_create.c
238
int fd;
tests/kernel/t_memfd_create.c
240
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
241
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_SEAL));
tests/kernel/t_memfd_create.c
243
ATF_REQUIRE_EQ_MSG(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE), -1,
tests/kernel/t_memfd_create.c
255
test_all_seals_except(int fd, int except)
tests/kernel/t_memfd_create.c
263
RL(fstat(fd, &st));
tests/kernel/t_memfd_create.c
267
rv = fcntl(fd, F_ADD_SEALS, F_SEAL_SEAL);
tests/kernel/t_memfd_create.c
278
RL(lseek(fd, 0, SEEK_SET));
tests/kernel/t_memfd_create.c
279
rv = write(fd, write_buf, rwbuf_size);
tests/kernel/t_memfd_create.c
289
fd, 0);
tests/kernel/t_memfd_create.c
293
PROT_READ|PROT_WRITE, MAP_SHARED, fd,
tests/kernel/t_memfd_create.c
298
rv = ftruncate(fd, st.st_size - 1);
tests/kernel/t_memfd_create.c
309
rv = ftruncate(fd, st.st_size + 1);
tests/kernel/t_memfd_create.c
329
int fd;
tests/kernel/t_memfd_create.c
333
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
334
RL(ftruncate(fd, rwbuf_size));
tests/kernel/t_memfd_create.c
335
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK));
tests/kernel/t_memfd_create.c
337
ATF_REQUIRE_EQ_MSG(ftruncate(fd, rwbuf_size/2), -1,
tests/kernel/t_memfd_create.c
341
test_all_seals_except(fd, F_SEAL_SHRINK);
tests/kernel/t_memfd_create.c
353
int fd;
tests/kernel/t_memfd_create.c
357
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
358
RL(ftruncate(fd, rwbuf_size/2));
tests/kernel/t_memfd_create.c
359
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW));
tests/kernel/t_memfd_create.c
361
ATF_REQUIRE_EQ_MSG(ftruncate(fd, rwbuf_size), -1,
tests/kernel/t_memfd_create.c
365
test_all_seals_except(fd, F_SEAL_GROW);
tests/kernel/t_memfd_create.c
377
int fd;
tests/kernel/t_memfd_create.c
381
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
382
RL(ftruncate(fd, rwbuf_size/2));
tests/kernel/t_memfd_create.c
383
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE));
tests/kernel/t_memfd_create.c
385
ATF_REQUIRE_EQ_MSG(write(fd, write_buf, rwbuf_size), -1,
tests/kernel/t_memfd_create.c
389
test_all_seals_except(fd, F_SEAL_WRITE);
tests/kernel/t_memfd_create.c
401
int fd;
tests/kernel/t_memfd_create.c
406
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
407
RL(ftruncate(fd, rwbuf_size));
tests/kernel/t_memfd_create.c
409
addr = mmap(NULL, rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/kernel/t_memfd_create.c
412
rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
tests/kernel/t_memfd_create.c
415
ATF_REQUIRE_EQ_MSG(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE), -1,
tests/kernel/t_memfd_create.c
429
int fd;
tests/kernel/t_memfd_create.c
433
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
434
RL(ftruncate(fd, rwbuf_size/2));
tests/kernel/t_memfd_create.c
435
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE));
tests/kernel/t_memfd_create.c
437
ATF_REQUIRE_EQ_MSG(write(fd, write_buf, rwbuf_size), -1,
tests/kernel/t_memfd_create.c
441
test_all_seals_except(fd, F_SEAL_FUTURE_WRITE);
tests/kernel/t_memfd_create.c
454
int fd;
tests/kernel/t_memfd_create.c
459
RL(fd = memfd_create("", MFD_ALLOW_SEALING));
tests/kernel/t_memfd_create.c
460
RL(ftruncate(fd, rwbuf_size));
tests/kernel/t_memfd_create.c
461
addr = mmap(NULL, rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/kernel/t_memfd_create.c
464
rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
tests/kernel/t_memfd_create.c
467
RL(fcntl(fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE));
tests/kernel/t_memfd_create.c
470
MAP_SHARED, fd, 0), MAP_FAILED,
tests/kernel/t_memfd_create.c
472
rwbuf_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd);
tests/kernel/t_memfd_create.c
71
int fd;
tests/kernel/t_memfd_create.c
73
ATF_REQUIRE_EQ_MSG(fd = memfd_create(NULL, 0), -1,
tests/kernel/t_memfd_create.c
87
int fd;
tests/kernel/t_memfd_create.c
92
ATF_REQUIRE_EQ_MSG(fd = memfd_create(name_buf, 0), -1,
tests/kernel/t_memfd_create.c
98
RL(fd = memfd_create(name_buf, 0));
tests/kernel/t_open_pr_57260.c
71
int fd;
tests/kernel/t_open_pr_57260.c
86
fd = open("fifo", O_RDONLY);
tests/kernel/t_open_pr_57260.c
87
if (fd == -1)
tests/kernel/t_open_pr_57260.c
89
atf_tc_fail("open returned %d", fd);
tests/kernel/t_pty.c
111
condition(int fd)
tests/kernel/t_pty.c
117
if (ioctl(fd, TIOCSQSIZE, &opt) == -1)
tests/kernel/t_pty.c
119
if (ioctl(fd, TIOCGQSIZE, &opt) == -1)
tests/kernel/t_pty.c
124
if (tcgetattr(fd, &tios) == -1)
tests/kernel/t_pty.c
128
if (tcsetattr(fd, TCSANOW, &tios) == -1)
tests/kernel/t_pty.c
135
int fd;
tests/kernel/t_pty.c
137
if ((fd = posix_openpt(O_RDWR)) == -1)
tests/kernel/t_pty.c
139
condition(fd);
tests/kernel/t_pty.c
140
if (grantpt(fd) == -1)
tests/kernel/t_pty.c
145
condition(fd);
tests/kernel/t_pty.c
147
if (unlockpt(fd) == -1)
tests/kernel/t_pty.c
150
return fd;
tests/kernel/t_pty.c
156
int fd;
tests/kernel/t_pty.c
158
if ((fd = open(ttydev, O_RDWR, 0)) == -1)
tests/kernel/t_pty.c
164
if (ioctl(fd, TIOCSETD, &opt) == -1)
tests/kernel/t_pty.c
170
condition(fd);
tests/kernel/t_pty.c
172
return fd;
tests/kernel/t_pty.c
176
fd_nonblock(int fd)
tests/kernel/t_pty.c
180
if ((opt = fcntl(fd, F_GETFL, NULL)) == -1)
tests/kernel/t_pty.c
182
if (fcntl(fd, F_SETFL, opt | O_NONBLOCK) == -1)
tests/kernel/t_pty.c
207
pfd.fd = tty;
tests/kernel/t_rnd.c
101
int fd;
tests/kernel/t_rnd.c
107
RL(fd = rump_sys_open("/dev/random", RUMP_O_RDONLY));
tests/kernel/t_rnd.c
108
RL(rump_sys_read(fd, buf, sizeof(buf)));
tests/kernel/t_rnd.c
109
RL(rump_sys_close(fd));
tests/kernel/t_rnd.c
56
int fd;
tests/kernel/t_rnd.c
59
fd = rump_sys_open("/dev/random", O_RDWR, 0);
tests/kernel/t_rnd.c
60
if (fd == -1)
tests/kernel/t_rnd.c
65
if (rump_sys_ioctl(fd, RNDADDDATA, &rd) == -1)
tests/kernel/t_rnd.c
78
int fd;
tests/kernel/t_rnd.c
81
fd = rump_sys_open("/dev/random", O_RDWR, 0);
tests/kernel/t_rnd.c
82
if (fd == -1)
tests/kernel/t_rnd.c
87
ATF_REQUIRE_ERRNO(EINVAL, rump_sys_ioctl(fd, RNDADDDATA, &rd) == -1);
tests/kernel/t_signal_and_sp.c
106
RL(close(fd[1]));
tests/kernel/t_signal_and_sp.c
114
pollfd.fd = fd[0];
tests/kernel/t_signal_and_sp.c
125
RL(nread = read(fd[0], &execsp, sizeof(execsp)));
tests/kernel/t_signal_and_sp.c
71
int fd[2];
tests/kernel/t_signal_and_sp.c
88
RL(pipe(fd));
tests/kernel/t_signal_and_sp.c
93
if (dup2(fd[1], STDOUT_FILENO) == -1)
tests/kernel/t_sysv.c
141
int fd;
tests/kernel/t_sysv.c
156
fd = open(token_key, O_RDWR | O_CREAT | O_EXCL, 0600);
tests/kernel/t_sysv.c
157
if (fd == -1) {
tests/kernel/t_sysv.c
163
close(fd);
tests/kernel/tty/t_pr.c
163
int fd;
tests/kernel/tty/t_pr.c
166
fd = rump_sys_open("/dev/ptyp1", O_RDWR);
tests/kernel/tty/t_pr.c
167
ATF_CHECK(fd != -1);
tests/kernel/tty/t_pr.c
173
rump_sys_ioctl(fd, TIOCGETA, &tio);
tests/kernel/tty/t_pr.c
175
rump_sys_close(fd);
tests/lib/libc/c063/t_faccessat.c
124
int fd;
tests/lib/libc/c063/t_faccessat.c
128
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_faccessat.c
129
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_faccessat.c
143
int fd;
tests/lib/libc/c063/t_faccessat.c
146
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_faccessat.c
147
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_faccessat.c
182
int fd;
tests/lib/libc/c063/t_faccessat.c
187
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_faccessat.c
188
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_faccessat.c
60
int fd;
tests/lib/libc/c063/t_faccessat.c
63
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_faccessat.c
64
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_faccessat.c
79
int fd;
tests/lib/libc/c063/t_faccessat.c
82
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_faccessat.c
83
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchmodat.c
137
int fd;
tests/lib/libc/c063/t_fchmodat.c
141
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchmodat.c
142
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchmodat.c
156
int fd;
tests/lib/libc/c063/t_fchmodat.c
159
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchmodat.c
160
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchmodat.c
65
int fd;
tests/lib/libc/c063/t_fchmodat.c
69
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchmodat.c
70
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchmodat.c
88
int fd;
tests/lib/libc/c063/t_fchmodat.c
92
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchmodat.c
93
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchownat.c
106
int fd;
tests/lib/libc/c063/t_fchownat.c
113
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchownat.c
114
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchownat.c
169
int fd;
tests/lib/libc/c063/t_fchownat.c
176
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchownat.c
177
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchownat.c
192
int fd;
tests/lib/libc/c063/t_fchownat.c
198
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchownat.c
199
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fchownat.c
78
int fd;
tests/lib/libc/c063/t_fchownat.c
85
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fchownat.c
86
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fexecve.c
62
int fd;
tests/lib/libc/c063/t_fexecve.c
64
if ((fd = open("/usr/bin/touch", O_RDONLY, 0)) == -1)
tests/lib/libc/c063/t_fexecve.c
67
if (fexecve(fd, __UNCONST(argv), __UNCONST(envp)) == -1) {
tests/lib/libc/c063/t_fexecve.c
73
(void)close(fd);
tests/lib/libc/c063/t_fstatat.c
132
int fd;
tests/lib/libc/c063/t_fstatat.c
137
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fstatat.c
138
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fstatat.c
152
int fd;
tests/lib/libc/c063/t_fstatat.c
156
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fstatat.c
157
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fstatat.c
60
int fd;
tests/lib/libc/c063/t_fstatat.c
64
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fstatat.c
65
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_fstatat.c
83
int fd;
tests/lib/libc/c063/t_fstatat.c
87
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_fstatat.c
88
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_linkat.c
113
int fd;
tests/lib/libc/c063/t_linkat.c
117
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
118
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_linkat.c
130
int fd;
tests/lib/libc/c063/t_linkat.c
134
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
135
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_linkat.c
149
int ofd, nfd, fd;
tests/lib/libc/c063/t_linkat.c
154
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
155
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_linkat.c
182
int ofd, nfd, fd;
tests/lib/libc/c063/t_linkat.c
187
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
188
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_linkat.c
63
int ofd, nfd, fd;
tests/lib/libc/c063/t_linkat.c
68
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
69
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_linkat.c
90
int fd;
tests/lib/libc/c063/t_linkat.c
95
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_linkat.c
96
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_mkdirat.c
102
int fd;
tests/lib/libc/c063/t_mkdirat.c
106
ATF_REQUIRE((fd = open(SDIR, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_mkdirat.c
107
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_mkfifoat.c
102
int fd;
tests/lib/libc/c063/t_mkfifoat.c
106
ATF_REQUIRE((fd = open(FIFO, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_mkfifoat.c
107
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_mknodat.c
101
ATF_REQUIRE((fd = mknodat(AT_FDCWD, FILE, mode, dev)) != -1);
tests/lib/libc/c063/t_mknodat.c
102
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_mknodat.c
115
int fd;
tests/lib/libc/c063/t_mknodat.c
120
ATF_REQUIRE((fd = mknodat(AT_FDCWD, FILEERR, mode, dev)) == -1);
tests/lib/libc/c063/t_mknodat.c
131
int fd;
tests/lib/libc/c063/t_mknodat.c
137
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_mknodat.c
138
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_mknodat.c
139
ATF_REQUIRE((fd = mknodat(-1, FILE, mode, dev)) == -1);
tests/lib/libc/c063/t_mknodat.c
73
int fd;
tests/lib/libc/c063/t_mknodat.c
80
ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1);
tests/lib/libc/c063/t_mknodat.c
81
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_mknodat.c
95
int fd;
tests/lib/libc/c063/t_o_search.c
109
int fd;
tests/lib/libc/c063/t_o_search.c
112
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
113
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
117
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
118
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
122
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
123
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
127
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
141
int fd;
tests/lib/libc/c063/t_o_search.c
144
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
145
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
149
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
150
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
154
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
155
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
159
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
175
int fd;
tests/lib/libc/c063/t_o_search.c
177
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
178
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
203
int fd;
tests/lib/libc/c063/t_o_search.c
206
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
207
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
233
int fd;
tests/lib/libc/c063/t_o_search.c
236
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
237
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
265
int fd;
tests/lib/libc/c063/t_o_search.c
269
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
tests/lib/libc/c063/t_o_search.c
283
int dfd, fd;
tests/lib/libc/c063/t_o_search.c
286
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
287
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
323
int dfd, fd;
tests/lib/libc/c063/t_o_search.c
326
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
327
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
79
int fd;
tests/lib/libc/c063/t_o_search.c
82
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_o_search.c
83
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
87
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
tests/lib/libc/c063/t_o_search.c
88
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_o_search.c
92
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
tests/lib/libc/c063/t_openat.c
100
ATF_REQUIRE((fd = openat(AT_FDCWD, FILEERR, O_RDONLY, 0)) == -1);
tests/lib/libc/c063/t_openat.c
111
int fd;
tests/lib/libc/c063/t_openat.c
115
ATF_REQUIRE((fd = openat(dfd, FILEERR, O_RDONLY, 0)) == -1);
tests/lib/libc/c063/t_openat.c
127
int fd;
tests/lib/libc/c063/t_openat.c
131
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_openat.c
132
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
135
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDONLY, 0)) == -1);
tests/lib/libc/c063/t_openat.c
146
int fd;
tests/lib/libc/c063/t_openat.c
149
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_openat.c
150
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
152
ATF_REQUIRE((fd = openat(-1, FILE, O_RDONLY, 0)) == -1);
tests/lib/libc/c063/t_openat.c
58
int fd;
tests/lib/libc/c063/t_openat.c
61
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_openat.c
62
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
65
ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDONLY, 0)) != -1);
tests/lib/libc/c063/t_openat.c
67
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
78
int fd;
tests/lib/libc/c063/t_openat.c
81
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_openat.c
82
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
85
ATF_REQUIRE((fd = openat(AT_FDCWD, BASEFILE, O_RDONLY, 0)) != -1);
tests/lib/libc/c063/t_openat.c
86
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_openat.c
97
int fd;
tests/lib/libc/c063/t_readlinkat.c
137
int fd;
tests/lib/libc/c063/t_readlinkat.c
141
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_readlinkat.c
142
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_readlinkat.c
60
int fd;
tests/lib/libc/c063/t_readlinkat.c
65
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_readlinkat.c
66
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_readlinkat.c
86
int fd;
tests/lib/libc/c063/t_readlinkat.c
91
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_readlinkat.c
92
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_renameat.c
114
int fd;
tests/lib/libc/c063/t_renameat.c
118
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_renameat.c
119
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_renameat.c
131
int fd;
tests/lib/libc/c063/t_renameat.c
135
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_renameat.c
136
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_renameat.c
61
int ofd, nfd, fd;
tests/lib/libc/c063/t_renameat.c
66
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_renameat.c
67
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_renameat.c
90
int fd;
tests/lib/libc/c063/t_renameat.c
95
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_renameat.c
96
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_symlinkat.c
109
int fd;
tests/lib/libc/c063/t_symlinkat.c
114
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_symlinkat.c
115
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_symlinkat.c
131
int fd;
tests/lib/libc/c063/t_symlinkat.c
135
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_symlinkat.c
136
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_symlinkat.c
61
int dfd, fd;
tests/lib/libc/c063/t_symlinkat.c
66
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_symlinkat.c
67
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_symlinkat.c
86
int fd;
tests/lib/libc/c063/t_symlinkat.c
91
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_symlinkat.c
92
ATF_REQUIRE(close(fd) != -1);
tests/lib/libc/c063/t_unlinkat.c
122
int fd;
tests/lib/libc/c063/t_unlinkat.c
126
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_unlinkat.c
127
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_unlinkat.c
141
int fd;
tests/lib/libc/c063/t_unlinkat.c
144
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_unlinkat.c
145
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_unlinkat.c
58
int fd;
tests/lib/libc/c063/t_unlinkat.c
61
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_unlinkat.c
62
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_unlinkat.c
77
int fd;
tests/lib/libc/c063/t_unlinkat.c
80
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
tests/lib/libc/c063/t_unlinkat.c
81
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/c063/t_utimensat.c
117
int fd;
tests/lib/libc/c063/t_utimensat.c
122
RL(fd = open(FILE, O_CREAT|O_RDWR, 0644));
tests/lib/libc/c063/t_utimensat.c
123
RL(close(fd));
tests/lib/libc/c063/t_utimensat.c
170
int fd;
tests/lib/libc/c063/t_utimensat.c
174
RL(fd = open(FILE, O_CREAT|O_RDWR, 0644));
tests/lib/libc/c063/t_utimensat.c
175
RL(close(fd));
tests/lib/libc/c063/t_utimensat.c
190
int fd;
tests/lib/libc/c063/t_utimensat.c
193
RL(fd = open(FILE, O_CREAT|O_RDWR, 0644));
tests/lib/libc/c063/t_utimensat.c
194
RL(close(fd));
tests/lib/libc/c063/t_utimensat.c
92
int fd;
tests/lib/libc/c063/t_utimensat.c
97
RL(fd = open(FILE, O_CREAT|O_RDWR, 0644));
tests/lib/libc/c063/t_utimensat.c
98
RL(close(fd));
tests/lib/libc/db/h_db.c
711
int fd;
tests/lib/libc/db/h_db.c
718
if ((fd = open(name, O_RDONLY, 0)) == -1 || fstat(fd, &sb) == -1)
tests/lib/libc/db/h_db.c
728
if (read(fd, p, (ssize_t)sb.st_size) != (ssize_t)sb.st_size)
tests/lib/libc/db/h_db.c
731
(void)close(fd);
tests/lib/libc/gen/execve/t_execve.c
101
RL(close(fd[1]));
tests/lib/libc/gen/execve/t_execve.c
78
int fd[2];
tests/lib/libc/gen/execve/t_execve.c
83
RL(pipe(fd));
tests/lib/libc/gen/execve/t_execve.c
86
if (dup2(fd[0], STDIN_FILENO) == -1)
tests/lib/libc/gen/execve/t_execve.c
91
RL(close(fd[0]));
tests/lib/libc/gen/execve/t_execve.c
93
if (write(fd[1], (char[]){0}, 1) == -1 && errno != EPIPE)
tests/lib/libc/gen/isqemu.h
53
int fd = open(DRVCTLDEV, O_RDONLY, 0);
tests/lib/libc/gen/isqemu.h
54
if (fd == -1)
tests/lib/libc/gen/isqemu.h
56
if (ioctl(fd, DRVLISTDEV, &dla) == -1) {
tests/lib/libc/gen/isqemu.h
57
close(fd);
tests/lib/libc/gen/isqemu.h
60
close(fd);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
321
int status, fd;
tests/lib/libc/gen/posix_spawn/t_fileactions.c
327
fd = open("/dev/null", O_RDONLY);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
328
ATF_REQUIRE(fd >= 0);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
329
close(fd);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
333
RZ(posix_spawn_file_actions_addclose(&fa, fd));
tests/lib/libc/gen/posix_spawn/t_fileactions.c
335
RZ(posix_spawn_file_actions_addclose(&fa, fd+1));
tests/lib/libc/gen/posix_spawn/t_fileactions.c
364
int status, fd;
tests/lib/libc/gen/posix_spawn/t_fileactions.c
371
fd = open("/dev/null", O_RDONLY);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
372
ATF_REQUIRE(fd >= 0);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
373
close(fd);
tests/lib/libc/gen/posix_spawn/t_fileactions.c
376
RZ(posix_spawn_file_actions_addclose(&fa, fd));
tests/lib/libc/gen/posix_spawn/t_fileactions.c
378
RZ(posix_spawn_file_actions_addclose(&fa, fd+1));
tests/lib/libc/gen/posix_spawn/t_spawn.c
172
int fd;
tests/lib/libc/gen/posix_spawn/t_spawn.c
179
RL(fd = open(file, O_RDONLY));
tests/lib/libc/gen/posix_spawn/t_spawn.c
189
bytes_read = read(fd, contents, sizeof_file - 1);
tests/lib/libc/gen/posix_spawn/t_spawn.c
194
RL(close(fd));
tests/lib/libc/gen/posix_spawn/t_spawn.c
208
int error, fd = -1, status;
tests/lib/libc/gen/posix_spawn/t_spawn.c
225
RL(fd = open(dirpath, O_RDONLY));
tests/lib/libc/gen/posix_spawn/t_spawn.c
226
RZ(posix_spawn_file_actions_addfchdir(&fa, fd));
tests/lib/libc/gen/posix_spawn/t_spawn.c
272
if (fd != -1) {
tests/lib/libc/gen/posix_spawn/t_spawn.c
273
RL(close(fd));
tests/lib/libc/gen/posix_spawn/t_spawn.c
446
int fd;
tests/lib/libc/gen/posix_spawn/t_spawn.c
452
RL(fd = open(FILENAME, O_WRONLY | O_CREAT | O_TRUNC, 0644));
tests/lib/libc/gen/posix_spawn/t_spawn.c
453
RL(close(fd));
tests/lib/libc/gen/posix_spawn/t_spawn.c
468
int error, fd;
tests/lib/libc/gen/posix_spawn/t_spawn.c
471
fd = -1;
tests/lib/libc/gen/posix_spawn/t_spawn.c
475
error = posix_spawn_file_actions_addfchdir(&fa, fd);
tests/lib/libc/gen/posix_spawn/t_spawn.c
490
int error, fd;
tests/lib/libc/gen/posix_spawn/t_spawn.c
496
fd = 3;
tests/lib/libc/gen/posix_spawn/t_spawn.c
507
RZ(posix_spawn_file_actions_addfchdir(&fa, fd));
tests/lib/libc/gen/posix_spawn/t_spawn.c
532
int fd[2];
tests/lib/libc/gen/posix_spawn/t_spawn.c
538
RL(pipe2(fd, O_CLOEXEC));
tests/lib/libc/gen/posix_spawn/t_spawn.c
540
RZ(posix_spawn_file_actions_adddup2(&fa, fd[0], STDIN_FILENO));
tests/lib/libc/gen/posix_spawn/t_spawn.c
542
RL(close(fd[0]));
tests/lib/libc/gen/posix_spawn/t_spawn.c
544
if (write(fd[1], (char[]){0}, 1) == -1 && errno != EPIPE)
tests/lib/libc/gen/posix_spawn/t_spawn.c
552
RL(close(fd[1]));
tests/lib/libc/gen/t_arc4random.c
395
int fd[2];
tests/lib/libc/gen/t_arc4random.c
422
RL(pipe(fd));
tests/lib/libc/gen/t_arc4random.c
455
if ((size_t)write(fd[1], local, sizeof(*local)) !=
tests/lib/libc/gen/t_arc4random.c
474
RL(nread = read(fd[0], &childstate, sizeof(childstate)));
tests/lib/libc/gen/t_closefrom.c
52
int fd, cur1, cur2;
tests/lib/libc/gen/t_closefrom.c
56
fd = open(path, O_RDONLY | O_CREAT, 0400);
tests/lib/libc/gen/t_closefrom.c
57
ATF_REQUIRE(fd >= 0);
tests/lib/libc/gen/t_closefrom.c
67
ATF_REQUIRE(close(fd) == -1);
tests/lib/libc/gen/t_ftok.c
66
int fd;
tests/lib/libc/gen/t_ftok.c
68
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/gen/t_ftok.c
70
ATF_REQUIRE(fd >= 0);
tests/lib/libc/gen/t_ftok.c
71
(void)close(fd);
tests/lib/libc/gen/t_realpath.c
123
int fd;
tests/lib/libc/gen/t_realpath.c
131
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/gen/t_realpath.c
133
ATF_REQUIRE(fd >= 0);
tests/lib/libc/gen/t_realpath.c
135
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/gen/t_ttyname.c
114
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/gen/t_ttyname.c
116
if (fd >= 0) {
tests/lib/libc/gen/t_ttyname.c
117
rv = ttyname_r(fd, buf, ttymax);
tests/lib/libc/gen/t_ttyname.c
119
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/gen/t_ttyname.c
51
int fd;
tests/lib/libc/gen/t_ttyname.c
53
fd = open("XXX", O_RDONLY);
tests/lib/libc/gen/t_ttyname.c
55
if (fd < 0) {
tests/lib/libc/gen/t_ttyname.c
59
ATF_REQUIRE(isatty(fd) != -1);
tests/lib/libc/gen/t_ttyname.c
64
ATF_REQUIRE(ttyname(fd) == NULL);
tests/lib/libc/gen/t_ttyname.c
68
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/gen/t_ttyname.c
70
if (fd >= 0) {
tests/lib/libc/gen/t_ttyname.c
74
ATF_REQUIRE(isatty(fd) != -1);
tests/lib/libc/gen/t_ttyname.c
79
ATF_REQUIRE(ttyname(fd) == NULL);
tests/lib/libc/gen/t_ttyname.c
81
(void)close(fd);
tests/lib/libc/gen/t_ttyname.c
95
int fd;
tests/lib/libc/ssp/h_read.c
45
int fd, n;
tests/lib/libc/ssp/h_read.c
48
if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1)
tests/lib/libc/ssp/h_read.c
50
if ((n = read(fd, b, len)) == -1)
tests/lib/libc/stdio/t_fflush.c
103
fd = fileno(f);
tests/lib/libc/stdio/t_fflush.c
104
ATF_REQUIRE(fd != -1);
tests/lib/libc/stdio/t_fflush.c
115
ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == 3);
tests/lib/libc/stdio/t_fflush.c
79
int fd = -1;
tests/lib/libc/stdio/t_fopen.c
101
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/stdio/t_fopen.c
104
ATF_REQUIRE_ERRNO(EBADF, fdopen(fd, "r") == NULL);
tests/lib/libc/stdio/t_fopen.c
126
int fd;
tests/lib/libc/stdio/t_fopen.c
133
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/stdio/t_fopen.c
135
ATF_REQUIRE(fd >= 0);
tests/lib/libc/stdio/t_fopen.c
136
ATF_REQUIRE(write(fd, "garbage", 7) == 7);
tests/lib/libc/stdio/t_fopen.c
137
ATF_REQUIRE(lseek(fd, 3, SEEK_SET) == 3);
tests/lib/libc/stdio/t_fopen.c
139
f = fdopen(fd, "r+");
tests/lib/libc/stdio/t_fopen.c
58
int fd;
tests/lib/libc/stdio/t_fopen.c
65
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/stdio/t_fopen.c
67
ATF_REQUIRE(fd >= 0);
tests/lib/libc/stdio/t_fopen.c
69
f = fdopen(fd, "w+");
tests/lib/libc/stdio/t_fopen.c
73
ATF_REQUIRE(close(fd) == -1);
tests/lib/libc/stdio/t_fopen.c
90
int fd;
tests/lib/libc/stdio/t_fopen.c
92
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/stdio/t_fopen.c
93
ATF_REQUIRE(fd >= 0);
tests/lib/libc/stdio/t_fopen.c
96
ATF_REQUIRE_ERRNO(EINVAL, fdopen(fd, "w") == NULL);
tests/lib/libc/stdio/t_fopen.c
99
ATF_REQUIRE_ERRNO(EINVAL, fdopen(fd, "a") == NULL);
tests/lib/libc/stdlib/t_exit.c
146
int sta, fd = -1;
tests/lib/libc/stdlib/t_exit.c
158
fd = mkstemp(buf);
tests/lib/libc/stdlib/t_exit.c
160
if (fd < 0)
tests/lib/libc/stdlib/t_exit.c
171
f = fdopen(fd, "r");
tests/lib/libc/stdlib/t_mktemp.c
123
int fd;
tests/lib/libc/stdlib/t_mktemp.c
127
fd = mkstemp(template);
tests/lib/libc/stdlib/t_mktemp.c
129
ATF_REQUIRE(fd != -1);
tests/lib/libc/stdlib/t_mktemp.c
131
ATF_REQUIRE(write(fd, "X", 1) == 1);
tests/lib/libc/stdlib/t_mktemp.c
132
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/stdlib/t_mktemp.c
134
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/stdlib/t_mktemp.c
149
int fd;
tests/lib/libc/stdlib/t_mktemp.c
153
fd = mkstemps(template, 3);
tests/lib/libc/stdlib/t_mktemp.c
155
ATF_REQUIRE(fd != -1);
tests/lib/libc/stdlib/t_mktemp.c
158
ATF_REQUIRE(write(fd, "X", 1) == 1);
tests/lib/libc/stdlib/t_mktemp.c
159
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/stdlib/t_mktemp.c
161
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/stdlib/t_mktemp.c
203
int fd;
tests/lib/libc/stdlib/t_mktemp.c
209
fd = mkostemp(template, flags[i]);
tests/lib/libc/stdlib/t_mktemp.c
211
ATF_REQUIRE(fd != -1);
tests/lib/libc/stdlib/t_mktemp.c
213
ATF_REQUIRE(write(fd, "X", 1) == 1);
tests/lib/libc/stdlib/t_mktemp.c
214
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/stdlib/t_mktemp.c
216
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/stdlib/t_mktemp.c
239
int fd;
tests/lib/libc/stdlib/t_mktemp.c
245
fd = mkostemps(template, 3, flags[i]);
tests/lib/libc/stdlib/t_mktemp.c
247
ATF_REQUIRE(fd != -1);
tests/lib/libc/stdlib/t_mktemp.c
250
ATF_REQUIRE(write(fd, "X", 1) == 1);
tests/lib/libc/stdlib/t_mktemp.c
251
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/stdlib/t_mktemp.c
253
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/stdlib/t_system.c
51
int fd, i = 2;
tests/lib/libc/stdlib/t_system.c
60
fd = open(path, O_RDONLY);
tests/lib/libc/stdlib/t_system.c
61
ATF_REQUIRE(fd >= 0);
tests/lib/libc/stdlib/t_system.c
65
ATF_REQUIRE(read(fd, buf, 21) == 21);
tests/lib/libc/stdlib/t_system.c
68
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/msg.h
37
#define CLOSEFD(fd) do { \
tests/lib/libc/sys/msg.h
38
if (fd != -1) { \
tests/lib/libc/sys/msg.h
39
close(fd); \
tests/lib/libc/sys/msg.h
40
fd = -1; \
tests/lib/libc/sys/t_access.c
59
int fd;
tests/lib/libc/sys/t_access.c
61
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_access.c
63
if (fd < 0)
tests/lib/libc/sys/t_access.c
68
ATF_REQUIRE(fchmod(fd, perm[i]) == 0);
tests/lib/libc/sys/t_access.c
76
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_aio_cancel.c
109
int fd, rv, crv, err;
tests/lib/libc/sys/t_aio_cancel.c
115
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_cancel.c
122
cb.aio_fildes = fd;
tests/lib/libc/sys/t_aio_cancel.c
130
crv = aio_cancel(fd, &cb);
tests/lib/libc/sys/t_aio_cancel.c
153
rv = close(fd);
tests/lib/libc/sys/t_aio_cancel.c
165
int fd, rv, crv;
tests/lib/libc/sys/t_aio_cancel.c
171
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_cancel.c
178
cb.aio_fildes = fd;
tests/lib/libc/sys/t_aio_cancel.c
191
crv = aio_cancel(fd, &cb);
tests/lib/libc/sys/t_aio_cancel.c
194
rv = close(fd);
tests/lib/libc/sys/t_aio_cancel.c
52
int fd, n;
tests/lib/libc/sys/t_aio_cancel.c
57
fd = mkstemp(path);
tests/lib/libc/sys/t_aio_cancel.c
58
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_aio_cancel.c
60
return fd;
tests/lib/libc/sys/t_aio_lio.c
108
int fd, rv;
tests/lib/libc/sys/t_aio_lio.c
117
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_lio.c
127
cbs[i].aio_fildes = fd;
tests/lib/libc/sys/t_aio_lio.c
156
rv = close(fd);
tests/lib/libc/sys/t_aio_lio.c
166
int fd, rv;
tests/lib/libc/sys/t_aio_lio.c
181
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_lio.c
191
wcbs[i].aio_fildes = fd;
tests/lib/libc/sys/t_aio_lio.c
221
rcbs[i].aio_fildes = fd;
tests/lib/libc/sys/t_aio_lio.c
252
rv = close(fd);
tests/lib/libc/sys/t_aio_lio.c
51
int fd, n;
tests/lib/libc/sys/t_aio_lio.c
56
fd = mkstemp(path);
tests/lib/libc/sys/t_aio_lio.c
57
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_aio_lio.c
59
return fd;
tests/lib/libc/sys/t_aio_rw.c
111
int fd, rv;
tests/lib/libc/sys/t_aio_rw.c
117
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_rw.c
126
wcb.aio_fildes = fd;
tests/lib/libc/sys/t_aio_rw.c
140
rcb.aio_fildes = fd;
tests/lib/libc/sys/t_aio_rw.c
154
rv = close(fd);
tests/lib/libc/sys/t_aio_rw.c
52
int fd, n;
tests/lib/libc/sys/t_aio_rw.c
57
fd = mkstemp(path);
tests/lib/libc/sys/t_aio_rw.c
58
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_aio_rw.c
60
return fd;
tests/lib/libc/sys/t_aio_suspend.c
100
fd = mktemp_file(path, sizeof(path));
tests/lib/libc/sys/t_aio_suspend.c
109
cb0.aio_fildes = fd;
tests/lib/libc/sys/t_aio_suspend.c
115
cb1.aio_fildes = fd;
tests/lib/libc/sys/t_aio_suspend.c
157
rv = close(fd);
tests/lib/libc/sys/t_aio_suspend.c
52
int fd, n;
tests/lib/libc/sys/t_aio_suspend.c
57
fd = mkstemp(path);
tests/lib/libc/sys/t_aio_suspend.c
58
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_aio_suspend.c
60
return fd;
tests/lib/libc/sys/t_aio_suspend.c
93
int fd, rv;
tests/lib/libc/sys/t_chroot.c
101
fd = open(buf, O_RDONLY);
tests/lib/libc/sys/t_chroot.c
103
if (fd < 0)
tests/lib/libc/sys/t_chroot.c
106
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_chroot.c
181
int fd, sta;
tests/lib/libc/sys/t_chroot.c
191
fd = open(buf, O_RDONLY);
tests/lib/libc/sys/t_chroot.c
192
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_chroot.c
199
if (fchroot(fd) != 0)
tests/lib/libc/sys/t_chroot.c
202
if (close(fd) != 0)
tests/lib/libc/sys/t_chroot.c
205
fd = open("file", O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_chroot.c
207
if (fd < 0)
tests/lib/libc/sys/t_chroot.c
210
if (close(fd) != 0)
tests/lib/libc/sys/t_chroot.c
224
fd = open(buf, O_RDONLY);
tests/lib/libc/sys/t_chroot.c
226
if (fd < 0)
tests/lib/libc/sys/t_chroot.c
229
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_chroot.c
242
int fd;
tests/lib/libc/sys/t_chroot.c
244
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_chroot.c
245
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_chroot.c
251
ATF_REQUIRE_ERRNO(ENOTDIR, fchroot(fd) == -1);
tests/lib/libc/sys/t_chroot.c
253
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_chroot.c
267
int fd, sta;
tests/lib/libc/sys/t_chroot.c
274
fd = open(buf, O_RDONLY);
tests/lib/libc/sys/t_chroot.c
276
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_chroot.c
288
if (fchroot(fd) != -1)
tests/lib/libc/sys/t_chroot.c
56
int fd, sta;
tests/lib/libc/sys/t_chroot.c
82
fd = open("file", O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_chroot.c
84
if (fd < 0)
tests/lib/libc/sys/t_chroot.c
87
if (close(fd) != 0)
tests/lib/libc/sys/t_clock_gettime.c
223
int fd[2];
tests/lib/libc/sys/t_clock_gettime.c
226
RL(pipe2(fd, O_NONBLOCK));
tests/lib/libc/sys/t_clock_gettime.c
227
RL(n = ioctl(fd[1], FIONSPACE));
tests/lib/libc/sys/t_clock_gettime.c
230
RL(write(fd[1], buf, n));
tests/lib/libc/sys/t_clock_gettime.c
231
RL(read(fd[0], buf, n));
tests/lib/libc/sys/t_clock_gettime.c
233
RL(close(fd[0]));
tests/lib/libc/sys/t_clock_gettime.c
234
RL(close(fd[1]));
tests/lib/libc/sys/t_dup.c
112
int fd, fd1, fd2;
tests/lib/libc/sys/t_dup.c
120
fd = dup2(fd1, fd2);
tests/lib/libc/sys/t_dup.c
121
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_dup.c
123
if (fd != fd2)
tests/lib/libc/sys/t_dup.c
126
(void)close(fd);
tests/lib/libc/sys/t_dup.c
140
int fd;
tests/lib/libc/sys/t_dup.c
142
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_dup.c
143
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_dup.c
149
ATF_REQUIRE_ERRNO(EBADF, dup2(fd, -1) == -1);
tests/lib/libc/sys/t_dup.c
152
ATF_REQUIRE_ERRNO(EBADF, dup2(-1, fd) == -1);
tests/lib/libc/sys/t_dup.c
157
ATF_REQUIRE(dup2(fd, fd) != -1);
tests/lib/libc/sys/t_dup.c
159
(void)close(fd);
tests/lib/libc/sys/t_dup.c
205
int fd;
tests/lib/libc/sys/t_dup.c
207
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_dup.c
208
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_dup.c
211
ATF_REQUIRE_ERRNO(EINVAL, dup3(fd, fd, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
217
ATF_REQUIRE_ERRNO(EBADF, dup3(fd, -1, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
220
ATF_REQUIRE_ERRNO(EBADF, dup3(-1, fd, O_CLOEXEC) == -1);
tests/lib/libc/sys/t_dup.c
223
ATF_REQUIRE_ERRNO(EINVAL, dup3(fd, 1, O_NOFOLLOW) == -1);
tests/lib/libc/sys/t_dup.c
225
(void)close(fd);
tests/lib/libc/sys/t_dup.c
284
int *buf, fd, sta;
tests/lib/libc/sys/t_dup.c
326
fd = dup(buf[0]);
tests/lib/libc/sys/t_dup.c
328
if (fd != -1 || errno != EMFILE)
tests/lib/libc/sys/t_dup.c
58
int fd, fd1, fd2;
tests/lib/libc/sys/t_dup.c
76
fd = dup(fd1);
tests/lib/libc/sys/t_dup.c
78
fd = dup2(fd1, fd2);
tests/lib/libc/sys/t_dup.c
80
fd = dup3(fd1, fd2, O_CLOEXEC);
tests/lib/libc/sys/t_dup.c
82
fd = -1;
tests/lib/libc/sys/t_dup.c
85
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_dup.c
90
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/lib/libc/sys/t_dup.c
96
(void)close(fd);
tests/lib/libc/sys/t_eventfd.c
290
fds[0].fd = efd;
tests/lib/libc/sys/t_eventfd.c
331
fds[0].fd = efd;
tests/lib/libc/sys/t_eventfd.c
378
fds[0].fd = ctx->efd;
tests/lib/libc/sys/t_eventfd.c
398
fds[0].fd = ctx->efd;
tests/lib/libc/sys/t_fsync.c
102
fd = mkstemp(buf);
tests/lib/libc/sys/t_fsync.c
104
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_fsync.c
105
ATF_REQUIRE(write(fd, "0", 1) == 1);
tests/lib/libc/sys/t_fsync.c
106
ATF_REQUIRE(fsync(fd) == 0);
tests/lib/libc/sys/t_fsync.c
109
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_fsync.c
52
int i, fd[2];
tests/lib/libc/sys/t_fsync.c
71
ATF_REQUIRE(pipe(fd) == 0);
tests/lib/libc/sys/t_fsync.c
75
ATF_REQUIRE(fsync(fd[0]) == -1);
tests/lib/libc/sys/t_fsync.c
80
ATF_REQUIRE(fsync(fd[1]) == -1);
tests/lib/libc/sys/t_fsync.c
83
ATF_REQUIRE(close(fd[0]) == 0);
tests/lib/libc/sys/t_fsync.c
84
ATF_REQUIRE(close(fd[1]) == 0);
tests/lib/libc/sys/t_fsync.c
96
int fd, i;
tests/lib/libc/sys/t_getrusage.c
136
int i, fd;
tests/lib/libc/sys/t_getrusage.c
140
fd = open(DUMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0222);
tests/lib/libc/sys/t_getrusage.c
141
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_getrusage.c
151
write(fd, p, CHUNK);
tests/lib/libc/sys/t_getrusage.c
153
close(fd);
tests/lib/libc/sys/t_kevent.c
152
int fd, kq;
tests/lib/libc/sys/t_kevent.c
155
fd = open(DRVCTLDEV, O_RDONLY);
tests/lib/libc/sys/t_kevent.c
156
if (fd == -1) {
tests/lib/libc/sys/t_kevent.c
164
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_kevent.c
167
EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
tests/lib/libc/sys/t_kevent.c
174
(void)close(fd);
tests/lib/libc/sys/t_link.c
112
int fd;
tests/lib/libc/sys/t_link.c
117
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_link.c
119
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_link.c
144
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_link.c
186
int fd;
tests/lib/libc/sys/t_link.c
192
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_link.c
194
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_link.c
210
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_link.c
74
int fd;
tests/lib/libc/sys/t_link.c
80
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_link.c
82
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_link.c
92
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mincore.c
157
int fd, rv;
tests/lib/libc/sys/t_mincore.c
171
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_mincore.c
174
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_mincore.c
177
rv = write(fd, buf, page * 5);
tests/lib/libc/sys/t_mincore.c
180
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_mincore.c
181
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/lib/libc/sys/t_mincore.c
184
MAP_FILE | MAP_SHARED, fd, (off_t) 0);
tests/lib/libc/sys/t_mincore.c
188
(void)close(fd);
tests/lib/libc/sys/t_mkdir.c
59
int fd;
tests/lib/libc/sys/t_mkdir.c
63
fd = open("/etc", O_RDONLY);
tests/lib/libc/sys/t_mkdir.c
65
if (fd >= 0) {
tests/lib/libc/sys/t_mkdir.c
67
(void)close(fd);
tests/lib/libc/sys/t_mkfifo.c
106
(void)close(fd);
tests/lib/libc/sys/t_mkfifo.c
161
int fd, sta;
tests/lib/libc/sys/t_mkfifo.c
166
fd = -1;
tests/lib/libc/sys/t_mkfifo.c
179
fd = open(path, O_RDONLY | O_NONBLOCK);
tests/lib/libc/sys/t_mkfifo.c
181
if (fd >= 0)
tests/lib/libc/sys/t_mkfifo.c
198
(void)close(fd);
tests/lib/libc/sys/t_mkfifo.c
75
int sta, fd = -1;
tests/lib/libc/sys/t_mkfifo.c
92
fd = open(path, O_RDONLY);
tests/lib/libc/sys/t_mknod.c
88
int fd;
tests/lib/libc/sys/t_mknod.c
90
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_mknod.c
92
if (fd >= 0) {
tests/lib/libc/sys/t_mknod.c
94
(void)close(fd);
tests/lib/libc/sys/t_mmap.c
173
int fd = -1;
tests/lib/libc/sys/t_mmap.c
190
if ((fd = open(dev, O_RDONLY)) >= 0) {
tests/lib/libc/sys/t_mmap.c
198
if (fd < 0)
tests/lib/libc/sys/t_mmap.c
201
map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0);
tests/lib/libc/sys/t_mmap.c
205
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mmap.c
251
int fd;
tests/lib/libc/sys/t_mmap.c
253
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_mmap.c
254
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_mmap.c
257
(void)write(fd, buf, sizeof(buf));
tests/lib/libc/sys/t_mmap.c
260
MAP_FILE | MAP_PRIVATE, fd, 0);
tests/lib/libc/sys/t_mmap.c
272
MAP_FILE | MAP_SHARED, fd, 0);
tests/lib/libc/sys/t_mmap.c
275
MAP_FILE | MAP_SHARED, fd, 0);
tests/lib/libc/sys/t_mmap.c
300
int fd;
tests/lib/libc/sys/t_mmap.c
306
fd = open(path, O_WRONLY | O_CREAT, 0700);
tests/lib/libc/sys/t_mmap.c
308
if (fd < 0)
tests/lib/libc/sys/t_mmap.c
311
ATF_REQUIRE(write(fd, "XXX", 3) == 3);
tests/lib/libc/sys/t_mmap.c
313
map = mmap(NULL, 3, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
tests/lib/libc/sys/t_mmap.c
316
map = mmap(NULL, 3, PROT_WRITE, MAP_FILE|MAP_PRIVATE, fd, 0);
tests/lib/libc/sys/t_mmap.c
319
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mmap.c
371
int fd, sta;
tests/lib/libc/sys/t_mmap.c
381
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_mmap.c
383
if (fd < 0)
tests/lib/libc/sys/t_mmap.c
386
ATF_REQUIRE(write(fd, "XXX", 3) == 3);
tests/lib/libc/sys/t_mmap.c
387
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mmap.c
390
fd = open(path, O_RDONLY);
tests/lib/libc/sys/t_mmap.c
391
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_mmap.c
393
map = mmap(NULL, 3, PROT_NONE, MAP_FILE | MAP_SHARED, fd, 0);
tests/lib/libc/sys/t_mmap.c
486
int fd;
tests/lib/libc/sys/t_mmap.c
488
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_mmap.c
490
if (fd < 0)
tests/lib/libc/sys/t_mmap.c
497
ATF_REQUIRE(ftruncate(fd, page) == 0);
tests/lib/libc/sys/t_mmap.c
500
fd, 0);
tests/lib/libc/sys/t_mmap.c
506
ATF_REQUIRE(ftruncate(fd, 0) == 0);
tests/lib/libc/sys/t_mmap.c
507
ATF_REQUIRE(ftruncate(fd, page / 8) == 0);
tests/lib/libc/sys/t_mmap.c
508
ATF_REQUIRE(ftruncate(fd, page / 4) == 0);
tests/lib/libc/sys/t_mmap.c
509
ATF_REQUIRE(ftruncate(fd, page / 2) == 0);
tests/lib/libc/sys/t_mmap.c
510
ATF_REQUIRE(ftruncate(fd, page / 12) == 0);
tests/lib/libc/sys/t_mmap.c
511
ATF_REQUIRE(ftruncate(fd, page / 64) == 0);
tests/lib/libc/sys/t_mmap.c
514
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mmap.c
533
int fd, sta;
tests/lib/libc/sys/t_mmap.c
536
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_mmap.c
538
if (fd < 0)
tests/lib/libc/sys/t_mmap.c
541
ATF_REQUIRE(write(fd, "foo\n", 5) == 5);
tests/lib/libc/sys/t_mmap.c
543
map = mmap(NULL, page, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
tests/lib/libc/sys/t_mmap.c
551
ATF_REQUIRE(ftruncate(fd, 0) == 0);
tests/lib/libc/sys/t_mmap.c
567
(void)close(fd);
tests/lib/libc/sys/t_mmap.c
578
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mprotect.c
100
map = mmap(NULL, page, prot[i], MAP_SHARED, fd, 0);
tests/lib/libc/sys/t_mprotect.c
112
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_mprotect.c
89
int fd;
tests/lib/libc/sys/t_mprotect.c
91
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_mprotect.c
92
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_msync.c
121
(void)close(fd);
tests/lib/libc/sys/t_msync.c
56
int fd, rv;
tests/lib/libc/sys/t_msync.c
69
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_msync.c
71
if (fd < 0) {
tests/lib/libc/sys/t_msync.c
76
ATF_REQUIRE_MSG(write(fd, buf, page) != -1, "write(2) failed: %s",
tests/lib/libc/sys/t_msync.c
80
fd, 0);
tests/lib/libc/sys/t_msync.c
91
if (lseek(fd, off, SEEK_SET) != off) {
tests/lib/libc/sys/t_msync.c
97
rv = write(fd, garbage, len);
tests/lib/libc/sys/t_pipe2.c
100
ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) == 0);
tests/lib/libc/sys/t_pipe2.c
103
ATF_REQUIRE(close(fd[0]) != -1);
tests/lib/libc/sys/t_pipe2.c
104
ATF_REQUIRE(close(fd[1]) != -1);
tests/lib/libc/sys/t_pipe2.c
208
int fd[2];
tests/lib/libc/sys/t_pipe2.c
209
ATF_REQUIRE_ERRNO(EINVAL, pipe2(fd, O_ASYNC) == -1);
tests/lib/libc/sys/t_pipe2.c
58
int fd[2], i;
tests/lib/libc/sys/t_pipe2.c
66
ATF_REQUIRE(pipe2(fd, flags) == 0);
tests/lib/libc/sys/t_pipe2.c
68
ATF_REQUIRE(fd[0] == 3);
tests/lib/libc/sys/t_pipe2.c
69
ATF_REQUIRE(fd[1] == 4);
tests/lib/libc/sys/t_pipe2.c
72
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
tests/lib/libc/sys/t_pipe2.c
73
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
tests/lib/libc/sys/t_pipe2.c
75
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
tests/lib/libc/sys/t_pipe2.c
76
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
tests/lib/libc/sys/t_pipe2.c
80
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOFORK) != 0);
tests/lib/libc/sys/t_pipe2.c
81
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOFORK) != 0);
tests/lib/libc/sys/t_pipe2.c
83
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOFORK) == 0);
tests/lib/libc/sys/t_pipe2.c
84
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOFORK) == 0);
tests/lib/libc/sys/t_pipe2.c
88
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
tests/lib/libc/sys/t_pipe2.c
89
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
tests/lib/libc/sys/t_pipe2.c
91
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
tests/lib/libc/sys/t_pipe2.c
92
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
tests/lib/libc/sys/t_pipe2.c
96
ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0);
tests/lib/libc/sys/t_pipe2.c
97
ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0);
tests/lib/libc/sys/t_pipe2.c
99
ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) == 0);
tests/lib/libc/sys/t_poll.c
172
pfds[0].fd = fds[0];
tests/lib/libc/sys/t_poll.c
174
pfds[1].fd = fds[1];
tests/lib/libc/sys/t_poll.c
233
int fd = 0;
tests/lib/libc/sys/t_poll.c
235
pfd.fd = fd;
tests/lib/libc/sys/t_poll.c
293
pfd[0].fd = rfd;
tests/lib/libc/sys/t_poll.c
295
pfd[1].fd = wfd;
tests/lib/libc/sys/t_poll.c
414
pfd.fd = rfd;
tests/lib/libc/sys/t_poll.c
431
pfd.fd = rfd;
tests/lib/libc/sys/t_poll.c
466
pfd.fd = rfd;
tests/lib/libc/sys/t_poll.c
557
struct pollfd pfd = { .fd = writefd, .events = POLLOUT };
tests/lib/libc/sys/t_poll.c
588
ATF_CHECK_EQ_MSG(pfd.fd, writefd, "pfd.fd=%d writefd=%d",
tests/lib/libc/sys/t_poll.c
589
pfd.fd, writefd);
tests/lib/libc/sys/t_poll.c
59
pfd.fd = desc;
tests/lib/libc/sys/t_poll.c
641
pfd = (struct pollfd) { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_poll.c
658
ATF_CHECK_EQ_MSG(pfd.fd, readfd, "pfd.fd=%d readfd=%d writefd=%d",
tests/lib/libc/sys/t_poll.c
659
pfd.fd, readfd, writefd);
tests/lib/libc/sys/t_poll.c
683
pfd = (struct pollfd) { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_poll.c
686
ATF_CHECK_EQ_MSG(pfd.fd, readfd, "pfd.fd=%d readfd=%d writefd=%d",
tests/lib/libc/sys/t_poll.c
687
pfd.fd, readfd, writefd);
tests/lib/libc/sys/t_poll.c
71
pfd.fd = desc;
tests/lib/libc/sys/t_poll.c
785
struct pollfd pfd = { .fd = writefd, .events = POLLOUT };
tests/lib/libc/sys/t_poll.c
803
ATF_CHECK_EQ_MSG(pfd.fd, writefd, "pfd.fd=%d writefd=%d",
tests/lib/libc/sys/t_poll.c
804
pfd.fd, writefd);
tests/lib/libc/sys/t_poll.c
821
struct pollfd pfd = { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_poll.c
86
pfd.fd = desc;
tests/lib/libc/sys/t_poll.c
873
pfd = (struct pollfd) { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_poll.c
900
pfd = (struct pollfd) { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_poll.c
919
pfd = (struct pollfd) { .fd = readfd, .events = POLLIN };
tests/lib/libc/sys/t_pollts.c
130
int fd = 0;
tests/lib/libc/sys/t_pollts.c
132
pfd.fd = fd;
tests/lib/libc/sys/t_pollts.c
158
int fd;
tests/lib/libc/sys/t_pollts.c
164
fd = open(_PATH_DEVNULL, O_RDONLY);
tests/lib/libc/sys/t_pollts.c
165
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_pollts.c
167
pfd.fd = fd;
tests/lib/libc/sys/t_pollts.c
190
ATF_REQUIRE_EQ(close(fd), 0);
tests/lib/libc/sys/t_pollts.c
65
pfds[0].fd = fds[0];
tests/lib/libc/sys/t_pollts.c
67
pfds[1].fd = fds[1];
tests/lib/libc/sys/t_posix_fadvise.c
114
CE(posix_fadvise(fd, 0, 0, -1), EINVAL);
tests/lib/libc/sys/t_posix_fadvise.c
117
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NORMAL), 0);
tests/lib/libc/sys/t_posix_fadvise.c
118
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL), 0);
tests/lib/libc/sys/t_posix_fadvise.c
119
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM), 0);
tests/lib/libc/sys/t_posix_fadvise.c
120
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0);
tests/lib/libc/sys/t_posix_fadvise.c
121
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0);
tests/lib/libc/sys/t_posix_fadvise.c
122
CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0);
tests/lib/libc/sys/t_posix_fadvise.c
91
int fd;
tests/lib/libc/sys/t_posix_fadvise.c
96
RL(fd = open("/dev/null", O_RDWR));
tests/lib/libc/sys/t_recvmmsg.c
131
cnt = recvmmsg(fd[1], mmsghdr, min(mmsgcnt, n),
tests/lib/libc/sys/t_recvmmsg.c
169
error = send(fd[0], DGRAM, sizeof(DGRAM), 0);
tests/lib/libc/sys/t_recvmmsg.c
78
int fd[2], error, i, cnt;
tests/lib/libc/sys/t_recvmmsg.c
89
error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
tests/lib/libc/sys/t_revoke.c
133
int fd, sta;
tests/lib/libc/sys/t_revoke.c
137
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_revoke.c
139
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_revoke.c
159
if (close(fd) != 0)
tests/lib/libc/sys/t_revoke.c
170
(void)close(fd);
tests/lib/libc/sys/t_select.c
115
FD_SET(fd, &rset);
tests/lib/libc/sys/t_select.c
221
int fd;
tests/lib/libc/sys/t_select.c
223
for (fd = 0; fd < FD_SETSIZE; fd++) {
tests/lib/libc/sys/t_select.c
227
if (fcntl(fd, F_GETFL) != -1 || errno != EBADF)
tests/lib/libc/sys/t_select.c
231
FD_SET(fd, &readfds);
tests/lib/libc/sys/t_select.c
234
ret = select(fd + 1, &readfds, NULL, NULL, NULL);
tests/lib/libc/sys/t_select.c
93
int fd;
tests/lib/libc/sys/t_select.c
97
if ((fd = open("/dev/null", O_RDONLY)) == -1)
tests/lib/libc/sys/t_sendmmsg.c
100
setsock(fd[1], SO_SNDBUF);
tests/lib/libc/sys/t_sendmmsg.c
147
ATF_REQUIRE(ioctl(fd[1], FIONSPACE, &a) != -1);
tests/lib/libc/sys/t_sendmmsg.c
149
ATF_REQUIRE(ioctl(fd[0], FIONSPACE, &a) != -1);
tests/lib/libc/sys/t_sendmmsg.c
152
cnt = sendmmsg(fd[1], mmsghdr + n, npkt, 0);
tests/lib/libc/sys/t_sendmmsg.c
186
cnt = recv(fd[0], rgram, sizeof(rgram), 0);
tests/lib/libc/sys/t_sendmmsg.c
70
setsock(int fd, int type)
tests/lib/libc/sys/t_sendmmsg.c
75
ATF_REQUIRE_MSG(setsockopt(fd, SOL_SOCKET, type,
tests/lib/libc/sys/t_sendmmsg.c
82
int fd[2], error, cnt;
tests/lib/libc/sys/t_sendmmsg.c
94
error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
tests/lib/libc/sys/t_sendrecv.c
114
int fd[2], sd[2], error;
tests/lib/libc/sys/t_sendrecv.c
120
error = pipe(fd);
tests/lib/libc/sys/t_sendrecv.c
145
read(fd[1], &c, sizeof(c));
tests/lib/libc/sys/t_sendrecv.c
151
write(fd[0], &c, sizeof(c));
tests/lib/libc/sys/t_setrlimit.c
184
int fd, sta;
tests/lib/libc/sys/t_setrlimit.c
187
fd = open(path, O_RDWR | O_CREAT, 0700);
tests/lib/libc/sys/t_setrlimit.c
189
if (fd < 0)
tests/lib/libc/sys/t_setrlimit.c
209
(void)write(fd, "X", 1);
tests/lib/libc/sys/t_setrlimit.c
210
(void)write(fd, "X", 1);
tests/lib/libc/sys/t_setrlimit.c
211
(void)write(fd, "X", 1);
tests/lib/libc/sys/t_setrlimit.c
216
(void)close(fd);
tests/lib/libc/sys/t_setrlimit.c
305
int fd, i, rv, sta;
tests/lib/libc/sys/t_setrlimit.c
330
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_setrlimit.c
332
if (fd >= 0 || errno != EMFILE)
tests/lib/libc/sys/t_setrlimit.c
354
int fd, i, rv, sta;
tests/lib/libc/sys/t_setrlimit.c
379
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_setrlimit.c
381
if (fd < 0)
tests/lib/libc/sys/t_setrlimit.c
389
fd = open("/etc/passwd", O_RDONLY);
tests/lib/libc/sys/t_setrlimit.c
391
if (fd >= 0 || errno != EMFILE)
tests/lib/libc/sys/t_socketpair.c
100
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) != 0);
tests/lib/libc/sys/t_socketpair.c
101
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) != 0);
tests/lib/libc/sys/t_socketpair.c
103
ATF_REQUIRE((fcntl(fd[0], F_GETFL) & O_NONBLOCK) == 0);
tests/lib/libc/sys/t_socketpair.c
104
ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0);
tests/lib/libc/sys/t_socketpair.c
107
ATF_REQUIRE(close(fd[0]) != -1);
tests/lib/libc/sys/t_socketpair.c
108
ATF_REQUIRE(close(fd[1]) != -1);
tests/lib/libc/sys/t_socketpair.c
57
connected(int fd)
tests/lib/libc/sys/t_socketpair.c
61
ATF_REQUIRE(getpeername(fd, (struct sockaddr*)(void *)&addr,
tests/lib/libc/sys/t_socketpair.c
68
int fd[2], i;
tests/lib/libc/sys/t_socketpair.c
75
ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);
tests/lib/libc/sys/t_socketpair.c
77
ATF_REQUIRE(fd[0] == 3);
tests/lib/libc/sys/t_socketpair.c
78
ATF_REQUIRE(fd[1] == 4);
tests/lib/libc/sys/t_socketpair.c
80
connected(fd[0]);
tests/lib/libc/sys/t_socketpair.c
81
connected(fd[1]);
tests/lib/libc/sys/t_socketpair.c
84
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) != 0);
tests/lib/libc/sys/t_socketpair.c
85
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) != 0);
tests/lib/libc/sys/t_socketpair.c
87
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOEXEC) == 0);
tests/lib/libc/sys/t_socketpair.c
88
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOEXEC) == 0);
tests/lib/libc/sys/t_socketpair.c
92
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOFORK) != 0);
tests/lib/libc/sys/t_socketpair.c
93
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOFORK) != 0);
tests/lib/libc/sys/t_socketpair.c
95
ATF_REQUIRE((fcntl(fd[0], F_GETFD) & FD_CLOFORK) == 0);
tests/lib/libc/sys/t_socketpair.c
96
ATF_REQUIRE((fcntl(fd[1], F_GETFD) & FD_CLOFORK) == 0);
tests/lib/libc/sys/t_stat.c
205
int fd[3];
tests/lib/libc/sys/t_stat.c
208
for (i = 0; i < __arraycount(fd); i++) {
tests/lib/libc/sys/t_stat.c
213
fd[i] = open(path, O_WRONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_stat.c
215
ATF_REQUIRE(fd[i] != -1);
tests/lib/libc/sys/t_stat.c
216
ATF_REQUIRE(write(fd[i], "X", 1) == 1);
tests/lib/libc/sys/t_stat.c
221
ATF_REQUIRE(write(fd[i], "X", 1) == 1);
tests/lib/libc/sys/t_stat.c
224
ATF_REQUIRE(close(fd[i]) == 0);
tests/lib/libc/sys/t_stat.c
249
int fd;
tests/lib/libc/sys/t_stat.c
257
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_stat.c
259
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_stat.c
260
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/sys/t_stat.c
269
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_stat.c
289
int fd;
tests/lib/libc/sys/t_stat.c
291
fd = open(path, O_WRONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_stat.c
292
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_stat.c
300
ATF_REQUIRE(fstat(fd, &sa) == 0);
tests/lib/libc/sys/t_stat.c
301
ATF_REQUIRE(write(fd, "X", 1) == 1);
tests/lib/libc/sys/t_stat.c
302
ATF_REQUIRE(fstat(fd, &sb) == 0);
tests/lib/libc/sys/t_stat.c
312
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_stat.c
333
int fd, flags;
tests/lib/libc/sys/t_stat.c
338
fd = socket(AF_INET, SOCK_STREAM, 0);
tests/lib/libc/sys/t_stat.c
339
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_stat.c
341
flags = fcntl(fd, F_GETFL);
tests/lib/libc/sys/t_stat.c
344
ATF_REQUIRE(fcntl(fd, F_SETFL, flags | O_NONBLOCK) != -1);
tests/lib/libc/sys/t_stat.c
354
connect(fd, (struct sockaddr *)&addr,
tests/lib/libc/sys/t_stat.c
359
if (fstat(fd, &st) != 0 || errno != 0)
tests/lib/libc/sys/t_stat.c
362
(void)close(fd);
tests/lib/libc/sys/t_stat.c
375
int fd;
tests/lib/libc/sys/t_stat.c
380
fd = open(path, O_WRONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_stat.c
382
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_stat.c
396
(void)close(fd);
tests/lib/libc/sys/t_stat.c
62
int fd;
tests/lib/libc/sys/t_stat.c
67
fd = open(path, O_RDONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_stat.c
69
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_stat.c
77
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_syscall.c
102
0, sizeof(secrect_data), PROT_READ, MAP_PRIVATE, fd,
tests/lib/libc/sys/t_syscall.c
68
int fd;
tests/lib/libc/sys/t_syscall.c
71
fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/lib/libc/sys/t_syscall.c
72
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_syscall.c
74
write(fd, secrect_data, sizeof(secrect_data));
tests/lib/libc/sys/t_syscall.c
77
0, sizeof(secrect_data), PROT_READ, MAP_PRIVATE, fd, 0, 0, 0);
tests/lib/libc/sys/t_syscall.c
93
int fd;
tests/lib/libc/sys/t_syscall.c
96
fd = open(FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/lib/libc/sys/t_syscall.c
97
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_syscall.c
99
write(fd, secrect_data, sizeof(secrect_data));
tests/lib/libc/sys/t_timerfd.c
102
timerfd_read(int fd, uint64_t *valp)
tests/lib/libc/sys/t_timerfd.c
106
switch (read(fd, &val, sizeof(val))) {
tests/lib/libc/sys/t_timerfd.c
130
int fd;
tests/lib/libc/sys/t_timerfd.c
132
ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
133
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
135
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
136
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
139
(fd = timerfd_create(CLOCK_VIRTUAL, 0)) == -1);
tests/lib/libc/sys/t_timerfd.c
142
(fd = timerfd_create(CLOCK_PROF, 0)) == -1);
tests/lib/libc/sys/t_timerfd.c
145
(fd = timerfd_create(CLOCK_REALTIME,
tests/lib/libc/sys/t_timerfd.c
159
int fd;
tests/lib/libc/sys/t_timerfd.c
162
RL(fd = timerfd_create(CLOCK_REALTIME, 0));
tests/lib/libc/sys/t_timerfd.c
163
ATF_CHECK_ERRNO(EBADF, write(fd, &c, 1) == -1);
tests/lib/libc/sys/t_timerfd.c
164
RL(close(fd));
tests/lib/libc/sys/t_timerfd.c
178
int fd;
tests/lib/libc/sys/t_timerfd.c
180
ATF_REQUIRE((fd = kqueue()) >= 0); /* arbitrary fd type */
tests/lib/libc/sys/t_timerfd.c
183
timerfd_gettime(fd, &its) == -1);
tests/lib/libc/sys/t_timerfd.c
187
timerfd_settime(fd, 0, &its, NULL) == -1);
tests/lib/libc/sys/t_timerfd.c
189
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
214
int fd;
tests/lib/libc/sys/t_timerfd.c
217
RL(fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK));
tests/lib/libc/sys/t_timerfd.c
225
timerfd_settime(fd, 0, &einval_its[i], NULL) == -1);
tests/lib/libc/sys/t_timerfd.c
237
timerfd_settime(fd, TFD_TIMER_ABSTIME, &its, NULL) == -1);
tests/lib/libc/sys/t_timerfd.c
242
FD_SET(fd, &readfds);
tests/lib/libc/sys/t_timerfd.c
243
RL(select(fd + 1, &readfds, NULL, NULL, &(struct timeval){2, 0}));
tests/lib/libc/sys/t_timerfd.c
244
ATF_CHECK(!FD_ISSET(fd, &readfds));
tests/lib/libc/sys/t_timerfd.c
245
ATF_CHECK_ERRNO(EAGAIN, timerfd_read(fd, &val) == -1);
tests/lib/libc/sys/t_timerfd.c
247
RL(close(fd));
tests/lib/libc/sys/t_timerfd.c
262
int fd;
tests/lib/libc/sys/t_timerfd.c
264
RL(fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK));
tests/lib/libc/sys/t_timerfd.c
268
RL(timerfd_settime(fd, TFD_TIMER_ABSTIME, &its, NULL));
tests/lib/libc/sys/t_timerfd.c
278
RL(timerfd_read(fd, &val));
tests/lib/libc/sys/t_timerfd.c
289
RL(close(fd));
tests/lib/libc/sys/t_timerfd.c
303
int fd;
tests/lib/libc/sys/t_timerfd.c
305
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
314
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
315
ATF_REQUIRE(timerfd_settime(fd, 0, &its, &oits) == 0);
tests/lib/libc/sys/t_timerfd.c
321
ATF_REQUIRE(timerfd_read(fd, &val) == 0);
tests/lib/libc/sys/t_timerfd.c
332
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
346
int fd;
tests/lib/libc/sys/t_timerfd.c
348
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC,
tests/lib/libc/sys/t_timerfd.c
357
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
360
ATF_REQUIRE(timerfd_read(fd, &val) == 0);
tests/lib/libc/sys/t_timerfd.c
371
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
385
int fd;
tests/lib/libc/sys/t_timerfd.c
387
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
397
ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_ABSTIME, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
398
ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_ABSTIME, &its, &oits) == 0);
tests/lib/libc/sys/t_timerfd.c
406
ATF_REQUIRE(timerfd_read(fd, &val) == 0);
tests/lib/libc/sys/t_timerfd.c
417
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
432
int fd;
tests/lib/libc/sys/t_timerfd.c
434
ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
442
ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_CANCEL_ON_SET,
tests/lib/libc/sys/t_timerfd.c
445
ATF_REQUIRE_ERRNO(ECANCELED, timerfd_read(fd, &val) == -1);
tests/lib/libc/sys/t_timerfd.c
447
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
479
int fd;
tests/lib/libc/sys/t_timerfd.c
481
ATF_REQUIRE((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
490
ATF_REQUIRE(timerfd_settime(fd, TFD_TIMER_CANCEL_ON_SET,
tests/lib/libc/sys/t_timerfd.c
495
ATF_REQUIRE_ERRNO(ECANCELED, timerfd_read(fd, &val) == -1);
tests/lib/libc/sys/t_timerfd.c
499
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
519
int fd;
tests/lib/libc/sys/t_timerfd.c
523
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK)) >= 0);
tests/lib/libc/sys/t_timerfd.c
526
EV_SET(&kev[0], fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
tests/lib/libc/sys/t_timerfd.c
528
EV_SET(&kev[0], fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
tests/lib/libc/sys/t_timerfd.c
535
fds[0].fd = fd;
tests/lib/libc/sys/t_timerfd.c
550
FD_SET(fd, &readfds);
tests/lib/libc/sys/t_timerfd.c
551
FD_SET(fd, &writefds);
tests/lib/libc/sys/t_timerfd.c
552
FD_SET(fd, &exceptfds);
tests/lib/libc/sys/t_timerfd.c
553
ATF_REQUIRE(select(fd + 1, &readfds, &writefds, &exceptfds, &tv) == 0);
tests/lib/libc/sys/t_timerfd.c
554
ATF_REQUIRE(!FD_ISSET(fd, &readfds));
tests/lib/libc/sys/t_timerfd.c
555
ATF_REQUIRE(!FD_ISSET(fd, &writefds));
tests/lib/libc/sys/t_timerfd.c
556
ATF_REQUIRE(!FD_ISSET(fd, &exceptfds));
tests/lib/libc/sys/t_timerfd.c
565
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
569
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/lib/libc/sys/t_timerfd.c
57
int fd;
tests/lib/libc/sys/t_timerfd.c
572
fds[0].fd = fd;
tests/lib/libc/sys/t_timerfd.c
584
FD_SET(fd, &readfds);
tests/lib/libc/sys/t_timerfd.c
585
FD_SET(fd, &writefds);
tests/lib/libc/sys/t_timerfd.c
586
FD_SET(fd, &exceptfds);
tests/lib/libc/sys/t_timerfd.c
587
ATF_REQUIRE(select(fd + 1, &readfds, &writefds, &exceptfds, &tv) == 1);
tests/lib/libc/sys/t_timerfd.c
588
ATF_REQUIRE(FD_ISSET(fd, &readfds));
tests/lib/libc/sys/t_timerfd.c
589
ATF_REQUIRE(!FD_ISSET(fd, &writefds));
tests/lib/libc/sys/t_timerfd.c
590
ATF_REQUIRE(!FD_ISSET(fd, &exceptfds));
tests/lib/libc/sys/t_timerfd.c
597
ATF_REQUIRE(kev[0].ident == (uintptr_t)fd);
tests/lib/libc/sys/t_timerfd.c
606
ATF_REQUIRE(timerfd_read(fd, &val) == 0);
tests/lib/libc/sys/t_timerfd.c
610
ATF_REQUIRE_ERRNO(EAGAIN, timerfd_read(fd, &val) == -1);
tests/lib/libc/sys/t_timerfd.c
613
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
630
int fd;
tests/lib/libc/sys/t_timerfd.c
634
ATF_REQUIRE((fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK)) >= 0);
tests/lib/libc/sys/t_timerfd.c
637
EV_SET(&kev[0], fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
tests/lib/libc/sys/t_timerfd.c
656
fds[0].fd = fd;
tests/lib/libc/sys/t_timerfd.c
661
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
669
FD_SET(fd, &readfds);
tests/lib/libc/sys/t_timerfd.c
672
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
673
ATF_REQUIRE(select(fd + 1, &readfds, NULL, NULL, NULL) == 1);
tests/lib/libc/sys/t_timerfd.c
675
ATF_REQUIRE(FD_ISSET(fd, &readfds));
tests/lib/libc/sys/t_timerfd.c
681
ATF_REQUIRE(timerfd_settime(fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
684
ATF_REQUIRE(kev[0].ident == (uintptr_t)fd);
tests/lib/libc/sys/t_timerfd.c
690
(void) close(fd);
tests/lib/libc/sys/t_timerfd.c
707
ATF_REQUIRE(close(ctx->fd) == 0);
tests/lib/libc/sys/t_timerfd.c
728
ATF_REQUIRE((ctx.fd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0);
tests/lib/libc/sys/t_timerfd.c
734
ATF_REQUIRE(timerfd_settime(ctx.fd, 0, &its, NULL) == 0);
tests/lib/libc/sys/t_timerfd.c
747
ATF_REQUIRE_ERRNO(EBADF, timerfd_read(ctx.fd, &val) == -1);
tests/lib/libc/sys/t_truncate.c
102
ATF_REQUIRE_ERRNO(EINVAL, ftruncate(fd, 999) == -1);
tests/lib/libc/sys/t_truncate.c
104
(void)close(fd);
tests/lib/libc/sys/t_truncate.c
117
int fd;
tests/lib/libc/sys/t_truncate.c
119
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_truncate.c
120
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_truncate.c
127
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/lib/libc/sys/t_truncate.c
135
(void)close(fd);
tests/lib/libc/sys/t_truncate.c
57
int fd;
tests/lib/libc/sys/t_truncate.c
59
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_truncate.c
60
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_truncate.c
66
ATF_REQUIRE(ftruncate(fd, sizes[i]) == 0);
tests/lib/libc/sys/t_truncate.c
67
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/lib/libc/sys/t_truncate.c
75
(void)close(fd);
tests/lib/libc/sys/t_truncate.c
93
int fd;
tests/lib/libc/sys/t_truncate.c
95
fd = open("/etc/passwd", O_RDONLY, 0400);
tests/lib/libc/sys/t_truncate.c
96
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_umask.c
121
int fd;
tests/lib/libc/sys/t_umask.c
127
fd = open(path, O_RDWR | O_CREAT, 0777);
tests/lib/libc/sys/t_umask.c
129
if (fd < 0)
tests/lib/libc/sys/t_umask.c
132
(void)close(fd);
tests/lib/libc/sys/t_unlink.c
55
int fd;
tests/lib/libc/sys/t_unlink.c
59
fd = open(path, O_RDWR | O_CREAT, 0666);
tests/lib/libc/sys/t_unlink.c
61
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_unlink.c
62
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_write.c
144
int fd;
tests/lib/libc/sys/t_write.c
146
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_write.c
147
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_write.c
150
ATF_REQUIRE(write(fd, "x", 1) == 1);
tests/lib/libc/sys/t_write.c
151
ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == (off_t)(i + 1));
tests/lib/libc/sys/t_write.c
154
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/sys/t_write.c
174
int fd;
tests/lib/libc/sys/t_write.c
176
fd = open(path, O_WRONLY | O_CREAT, 0600);
tests/lib/libc/sys/t_write.c
177
ATF_REQUIRE(fd >= 0);
tests/lib/libc/sys/t_write.c
182
j += write(fd, buf, sizeof(buf));
tests/lib/libc/sys/t_write.c
187
(void)close(fd);
tests/lib/libc/sys/t_write.c
230
int fd[2];
tests/lib/libc/sys/t_write.c
231
ATF_REQUIRE(pipe(fd) != -1);
tests/lib/libc/sys/t_write.c
237
ssize_t retval = write(fd[1], map, SIZE);
tests/lib/libc/sys/t_write.c
243
close(fd[0]);
tests/lib/libc/sys/t_write.c
244
close(fd[1]);
tests/lib/libc/sys/t_write.c
257
int fd = open(_PATH_DEVZERO, O_RDONLY);
tests/lib/libc/sys/t_write.c
258
ATF_REQUIRE(fd != -1);
tests/lib/libc/sys/t_write.c
263
ssize_t retval = read(fd, map, SIZE);
tests/lib/libc/sys/t_write.c
269
close(fd);
tests/lib/libc/sys/t_write.c
69
int fd;
tests/lib/libc/sys/t_write.c
74
fd = open(path, O_RDWR | O_CREAT, 0600);
tests/lib/libc/sys/t_write.c
76
if (fd >= 0) {
tests/lib/libc/sys/t_write.c
79
ATF_REQUIRE_ERRNO(0, write(fd, wbuf, 3) == 3);
tests/lib/libc/sys/t_write.c
82
ATF_REQUIRE_ERRNO(EINVAL, write(fd, wbuf, SIZE_MAX) == -1);
tests/lib/libc/sys/t_write.c
85
ATF_REQUIRE_ERRNO(EFAULT, write(fd, (void *)-1, 1) == -1);
tests/lib/libc/sys/t_write.c
91
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
tests/lib/libc/sys/t_write.c
92
ATF_REQUIRE(read(fd, rbuf, 3) == 3);
tests/lib/libc/sys/t_write.c
95
(void)close(fd);
tests/lib/libc/t_cdb.c
103
ATF_REQUIRE(cdbw_output(db, fd, "test database", arc4random) == 0);
tests/lib/libc/t_cdb.c
105
ATF_REQUIRE(close(fd) == 0);
tests/lib/libc/t_cdb.c
91
int fd;
tests/lib/libc/t_cdb.c
96
ATF_REQUIRE((fd = creat(database_name, S_IRUSR|S_IWUSR)) != -1);
tests/lib/libcurses/director/director.c
220
int fd;
tests/lib/libcurses/director/director.c
222
if ((fd = open(termpath, O_RDONLY)) == -1)
tests/lib/libcurses/director/director.c
225
fd, 0)) == MAP_FAILED)
tests/lib/libcurses/director/director.c
229
close(fd);
tests/lib/libcurses/director/testlang_parse.y
1114
fds[0].fd = from_slave;
tests/lib/libcurses/director/testlang_parse.y
1116
fds[1].fd = master;
tests/lib/libcurses/director/testlang_parse.y
1157
fds[0].fd = to_slave;
tests/lib/libcurses/director/testlang_parse.y
1160
fds[1].fd = from_slave;
tests/lib/libcurses/director/testlang_parse.y
1163
fds[2].fd = master;
tests/lib/libcurses/director/testlang_parse.y
1460
slave_pty.fd = master;
tests/lib/libcurses/director/testlang_parse.y
2020
rfd[0].fd = from_slave;
tests/lib/libcurses/director/testlang_parse.y
2022
rfd[1].fd = master;
tests/lib/libcurses/director/testlang_parse.y
944
fds[0].fd = check_fd;
tests/lib/libcurses/director/testlang_parse.y
946
fds[1].fd = master;
tests/lib/libossaudio/t_ossaudio.c
102
if (ioctl(fd, SNDCTL_DSP_STEREO, &channels) < 0)
tests/lib/libossaudio/t_ossaudio.c
106
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
114
if (ioctl(fd, SNDCTL_DSP_STEREO, &channels) < 0)
tests/lib/libossaudio/t_ossaudio.c
118
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
125
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
129
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
135
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
139
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
145
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
149
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
155
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
159
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
165
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
169
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
175
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
179
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
185
if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
tests/lib/libossaudio/t_ossaudio.c
189
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
197
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
200
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
205
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
208
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
214
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
217
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
223
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
226
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
232
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
235
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
241
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
244
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
255
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
257
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
264
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
266
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
274
if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0)
tests/lib/libossaudio/t_ossaudio.c
276
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
280
close(fd);
tests/lib/libossaudio/t_ossaudio.c
293
int fd, bits;
tests/lib/libossaudio/t_ossaudio.c
299
if ((fd = open("/dev/audio", O_RDONLY)) == -1)
tests/lib/libossaudio/t_ossaudio.c
305
if (ioctl(fd, SNDCTL_DSP_SETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
308
if (ioctl(fd, SNDCTL_DSP_GETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
312
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
320
if (ioctl(fd, SNDCTL_DSP_SETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
324
if (ioctl(fd, SNDCTL_DSP_GETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
328
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
333
close(fd);
tests/lib/libossaudio/t_ossaudio.c
346
int fd, bits;
tests/lib/libossaudio/t_ossaudio.c
348
if ((fd = open("/dev/audio", O_WRONLY)) == -1)
tests/lib/libossaudio/t_ossaudio.c
354
if (ioctl(fd, SNDCTL_DSP_SETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
357
if (ioctl(fd, SNDCTL_DSP_GETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
361
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
369
if (ioctl(fd, SNDCTL_DSP_SETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
373
if (ioctl(fd, SNDCTL_DSP_GETTRIGGER, &bits) < 0)
tests/lib/libossaudio/t_ossaudio.c
377
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
382
close(fd);
tests/lib/libossaudio/t_ossaudio.c
397
int fd;
tests/lib/libossaudio/t_ossaudio.c
403
if ((fd = open(dev, O_WRONLY)) == -1) {
tests/lib/libossaudio/t_ossaudio.c
404
if ((fd = open(dev, O_RDONLY)) == -1)
tests/lib/libossaudio/t_ossaudio.c
408
if (ioctl(fd, SNDCTL_DSP_GETCAPS, &caps) < 0)
tests/lib/libossaudio/t_ossaudio.c
411
if (ioctl(fd, AUDIO_GETPROPS, &props) < 0)
tests/lib/libossaudio/t_ossaudio.c
429
if (ioctl(fd, SNDCTL_DSP_GETFMTS, &fmts) < 0)
tests/lib/libossaudio/t_ossaudio.c
447
close(fd);
tests/lib/libossaudio/t_ossaudio.c
48
int fd, channels, fmt, rate;
tests/lib/libossaudio/t_ossaudio.c
50
if ((fd = open("/dev/audio", O_WRONLY)) == -1)
tests/lib/libossaudio/t_ossaudio.c
53
if (ioctl(fd, AUDIO_GETFORMAT, &hwinfo) < 0) {
tests/lib/libossaudio/t_ossaudio.c
55
close(fd);
tests/lib/libossaudio/t_ossaudio.c
61
if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
tests/lib/libossaudio/t_ossaudio.c
65
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
72
if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
tests/lib/libossaudio/t_ossaudio.c
76
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libossaudio/t_ossaudio.c
86
if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
tests/lib/libossaudio/t_ossaudio.c
90
if (ioctl(fd, AUDIO_GETBUFINFO, &info) < 0)
tests/lib/libpthread/t_cancellation.c
172
int fd[2];
tests/lib/libpthread/t_cancellation.c
182
RL(pipe(fd));
tests/lib/libpthread/t_cancellation.c
183
aio.aio_fildes = fd[0];
tests/lib/libpthread/t_cancellation.c
202
int fd;
tests/lib/libpthread/t_cancellation.c
204
RL(fd = open("/dev/null", O_RDWR));
tests/lib/libpthread/t_cancellation.c
206
RL(close(fd));
tests/lib/libpthread/t_cancellation.c
261
int fd;
tests/lib/libpthread/t_cancellation.c
269
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
271
RL(fcntl(fd, F_SETLKW, &fl));
tests/lib/libpthread/t_cancellation.c
278
int fd;
tests/lib/libpthread/t_cancellation.c
286
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
288
RL(fcntl(fd, F_OFD_SETLKW, &fl));
tests/lib/libpthread/t_cancellation.c
299
int fd;
tests/lib/libpthread/t_cancellation.c
301
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
303
RL(fdatasync(fd));
tests/lib/libpthread/t_cancellation.c
309
int fd;
tests/lib/libpthread/t_cancellation.c
311
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
313
RL(fsync(fd));
tests/lib/libpthread/t_cancellation.c
334
int fd;
tests/lib/libpthread/t_cancellation.c
336
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
338
RL(lockf(fd, F_LOCK, 0));
tests/lib/libpthread/t_cancellation.c
417
int fd;
tests/lib/libpthread/t_cancellation.c
420
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
421
RL(ftruncate(fd, pagesize));
tests/lib/libpthread/t_cancellation.c
423
MAP_SHARED, fd, 0),
tests/lib/libpthread/t_cancellation.c
466
int fd[2];
tests/lib/libpthread/t_cancellation.c
469
RL(pipe(fd));
tests/lib/libpthread/t_cancellation.c
470
pfd.fd = fd[0];
tests/lib/libpthread/t_cancellation.c
480
int fd;
tests/lib/libpthread/t_cancellation.c
482
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
484
RL(posix_close(fd, POSIX_CLOSE_RESTART));
tests/lib/libpthread/t_cancellation.c
495
int fd[2];
tests/lib/libpthread/t_cancellation.c
499
RL(pipe(fd));
tests/lib/libpthread/t_cancellation.c
500
pfd.fd = fd[0];
tests/lib/libpthread/t_cancellation.c
509
int fd;
tests/lib/libpthread/t_cancellation.c
512
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
514
RL(pread(fd, buf, sizeof(buf), 1));
tests/lib/libpthread/t_cancellation.c
521
int fd[2];
tests/lib/libpthread/t_cancellation.c
527
RL(pipe(fd));
tests/lib/libpthread/t_cancellation.c
528
FD_SET(fd[0], &readfd);
tests/lib/libpthread/t_cancellation.c
530
RL(pselect(fd[0] + 1, &readfd, NULL, NULL, &t, NULL));
tests/lib/libpthread/t_cancellation.c
606
int fd;
tests/lib/libpthread/t_cancellation.c
609
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
611
RL(pwrite(fd, buf, sizeof(buf), 1));
tests/lib/libpthread/t_cancellation.c
617
int fd;
tests/lib/libpthread/t_cancellation.c
620
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
622
RL(read(fd, buf, sizeof(buf)));
tests/lib/libpthread/t_cancellation.c
628
int fd;
tests/lib/libpthread/t_cancellation.c
632
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
634
RL(readv(fd, &iov, 1));
tests/lib/libpthread/t_cancellation.c
689
int fd[2];
tests/lib/libpthread/t_cancellation.c
695
RL(pipe(fd));
tests/lib/libpthread/t_cancellation.c
696
FD_SET(fd[0], &readfd);
tests/lib/libpthread/t_cancellation.c
698
RL(select(fd[0] + 1, &readfd, NULL, NULL, &t));
tests/lib/libpthread/t_cancellation.c
868
int fd;
tests/lib/libpthread/t_cancellation.c
871
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
873
RL(write(fd, buf, sizeof(buf)));
tests/lib/libpthread/t_cancellation.c
879
int fd;
tests/lib/libpthread/t_cancellation.c
883
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_cancellation.c
885
RL(writev(fd, &iov, 1));
tests/lib/libpthread/t_compat_cancel.c
111
int fd[2];
tests/lib/libpthread/t_compat_cancel.c
121
RL(pipe(fd));
tests/lib/libpthread/t_compat_cancel.c
122
aio.aio_fildes = fd[0];
tests/lib/libpthread/t_compat_cancel.c
184
int fd[2];
tests/lib/libpthread/t_compat_cancel.c
188
RL(pipe(fd));
tests/lib/libpthread/t_compat_cancel.c
189
pfd.fd = fd[0];
tests/lib/libpthread/t_compat_cancel.c
198
int fd[2];
tests/lib/libpthread/t_compat_cancel.c
204
RL(pipe(fd));
tests/lib/libpthread/t_compat_cancel.c
205
FD_SET(fd[0], &readfd);
tests/lib/libpthread/t_compat_cancel.c
207
RL(pselect(fd[0] + 1, &readfd, NULL, NULL, &t, NULL));
tests/lib/libpthread/t_compat_cancel.c
213
int fd[2];
tests/lib/libpthread/t_compat_cancel.c
219
RL(pipe(fd));
tests/lib/libpthread/t_compat_cancel.c
220
FD_SET(fd[0], &readfd);
tests/lib/libpthread/t_compat_cancel.c
222
RL(select(fd[0] + 1, &readfd, NULL, NULL, &t));
tests/lib/libpthread/t_compat_cancel.c
83
int fd;
tests/lib/libpthread/t_compat_cancel.c
86
RL(fd = open("file", O_RDWR|O_CREAT, 0666));
tests/lib/libpthread/t_compat_cancel.c
87
RL(ftruncate(fd, pagesize));
tests/lib/libpthread/t_compat_cancel.c
89
MAP_SHARED, fd, 0),
tests/lib/libpthread/t_preempt.c
114
rv = read(fd, mem, HUGE_BUFFER);
tests/lib/libpthread/t_preempt.c
115
close(fd);
tests/lib/libpthread/t_preempt.c
84
int fd;
tests/lib/libpthread/t_preempt.c
89
fd = open("/dev/urandom", O_RDONLY, 0);
tests/lib/libpthread/t_preempt.c
90
ATF_REQUIRE_MSG(fd != -1, "%s", strerror(errno));
tests/lib/librt/t_sem.c
192
int fd = shm_open("/shm_semtest_a", o_flags, 0644);
tests/lib/librt/t_sem.c
193
ATF_REQUIRE(fd != -1);
tests/lib/librt/t_sem.c
195
ATF_REQUIRE_EQ(ftruncate(fd, sizeof(struct shared_region)), 0);
tests/lib/librt/t_sem.c
198
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/lib/librt/t_sem.c
201
(void)close(fd);
tests/lib/librumpclient/h_execthr.c
70
int fd = (uintptr_t)arg;
tests/lib/librumpclient/h_execthr.c
72
rump_sys_read(fd, &fd, sizeof(fd));
tests/lib/librumpclient/h_execthr.c
75
if (fd != 37)
tests/lib/librumphijack/h_client.c
100
int fd, rv;
tests/lib/librumphijack/h_client.c
102
fd = open("/rump/dev/null", O_RDWR);
tests/lib/librumphijack/h_client.c
103
if (fd == -1)
tests/lib/librumphijack/h_client.c
105
close(fd);
tests/lib/librumphijack/h_client.c
107
pfd[0].fd = STDIN_FILENO;
tests/lib/librumphijack/h_client.c
109
pfd[1].fd = fd;
tests/lib/librumphijack/h_client.c
123
int fd;
tests/lib/librumphijack/h_client.c
126
if ((fd = open("/dev/null", O_RDWR)) == -1)
tests/lib/librumphijack/h_client.c
128
} while (fd < 7);
tests/lib/librumphijack/h_client.c
129
fd = open("/dev/null", O_RDWR);
tests/lib/librumphijack/h_client.c
130
if (fd != -1 || errno != ENFILE)
tests/lib/librumphijack/h_client.c
131
errx(EXIT_FAILURE, "unexpected fd8 %d %d", fd, errno);
tests/lib/librumphijack/h_client.c
134
if ((fd = open("/rump/dev/null", O_RDWR)) != 8)
tests/lib/librumphijack/h_client.c
135
errx(EXIT_FAILURE, "rump open %d %d", fd, errno);
tests/lib/librumphijack/h_cwd.c
68
int fd;
tests/lib/librumphijack/h_cwd.c
70
fd = open(path, O_RDONLY);
tests/lib/librumphijack/h_cwd.c
71
if (fd == -1)
tests/lib/librumphijack/h_cwd.c
73
if (fchdir(fd) == -1)
tests/lib/librumphijack/h_cwd.c
75
close(fd);
tests/lib/librumphijack/h_netget.c
58
int s, fd;
tests/lib/librumphijack/h_netget.c
77
fd = open(argv[3], O_CREAT | O_RDWR, 0644);
tests/lib/librumphijack/h_netget.c
78
if (fd == -1)
tests/lib/librumphijack/h_netget.c
80
if (ftruncate(fd, 0) == -1)
tests/lib/librumphijack/h_netget.c
96
if (write(fd, buf, n) != n)
tests/modules/t_builtin.c
54
int fd;
tests/modules/t_builtin.c
56
fd = rump_sys_open(HZFILE, O_RDONLY);
tests/modules/t_builtin.c
57
if (fd == -1)
tests/modules/t_builtin.c
59
if (rump_sys_read(fd, buf, sizeof(buf)) < 1)
tests/modules/t_builtin.c
61
RL(rump_sys_close(fd));
tests/modules/t_kcov.c
104
int fd;
tests/modules/t_kcov.c
106
fd = open_kcov();
tests/modules/t_kcov.c
107
close(fd);
tests/modules/t_kcov.c
108
fd = open("/dev/kcov", O_RDWR);
tests/modules/t_kcov.c
109
ATF_REQUIRE(fd != -1);
tests/modules/t_kcov.c
111
close(fd);
tests/modules/t_kcov.c
117
int fd;
tests/modules/t_kcov.c
119
fd = open_kcov();
tests/modules/t_kcov.c
122
ATF_CHECK(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) == -1);
tests/modules/t_kcov.c
124
ATF_CHECK(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) == 0);
tests/modules/t_kcov.c
126
close(fd);
tests/modules/t_kcov.c
133
int fd;
tests/modules/t_kcov.c
136
fd = open_kcov();
tests/modules/t_kcov.c
139
fd, 0) == MAP_FAILED);
tests/modules/t_kcov.c
141
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) == 0);
tests/modules/t_kcov.c
144
MAP_SHARED, fd, 0)) != MAP_FAILED);
tests/modules/t_kcov.c
148
close(fd);
tests/modules/t_kcov.c
155
int fd;
tests/modules/t_kcov.c
158
fd = open_kcov();
tests/modules/t_kcov.c
160
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
163
fd, 0) != MAP_FAILED);
tests/modules/t_kcov.c
165
close(fd);
tests/modules/t_kcov.c
171
int fd;
tests/modules/t_kcov.c
174
fd = open_kcov();
tests/modules/t_kcov.c
176
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
179
fd, 0) != MAP_FAILED);
tests/modules/t_kcov.c
187
int fd;
tests/modules/t_kcov.c
191
fd = open_kcov();
tests/modules/t_kcov.c
192
*(int *)data = fd;
tests/modules/t_kcov.c
194
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
196
fd, 0) != MAP_FAILED);
tests/modules/t_kcov.c
198
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
210
int fd;
tests/modules/t_kcov.c
215
kcov_mmap_enable_thread, &fd);
tests/modules/t_kcov.c
217
close(fd);
tests/modules/t_kcov.c
225
int fd;
tests/modules/t_kcov.c
229
fd = open_kcov();
tests/modules/t_kcov.c
232
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == -1);
tests/modules/t_kcov.c
234
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
237
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == -1);
tests/modules/t_kcov.c
240
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
241
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == -1);
tests/modules/t_kcov.c
244
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == 0);
tests/modules/t_kcov.c
245
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == -1);
tests/modules/t_kcov.c
249
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
250
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == 0);
tests/modules/t_kcov.c
252
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
253
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == 0);
tests/modules/t_kcov.c
255
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
256
ATF_CHECK(ioctl(fd, KCOV_IOC_DISABLE) == 0);
tests/modules/t_kcov.c
258
close(fd);
tests/modules/t_kcov.c
264
int fd;
tests/modules/t_kcov.c
268
fd = open_kcov();
tests/modules/t_kcov.c
269
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
271
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
272
close(fd);
tests/modules/t_kcov.c
278
int fd;
tests/modules/t_kcov.c
282
fd = open_kcov();
tests/modules/t_kcov.c
283
ATF_REQUIRE(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) ==0);
tests/modules/t_kcov.c
285
ATF_CHECK(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0);
tests/modules/t_kcov.c
292
int fd, fd2;
tests/modules/t_kcov.c
295
fd = open_kcov();
tests/modules/t_kcov.c
299
fd2 = pick_unassigned_fd(fd);
tests/modules/t_kcov.c
300
ATF_REQUIRE_EQ(dup2(fd, fd2), fd2);
tests/modules/t_kcov.c
301
close(fd);
tests/modules/t_kcov.c
302
fd = fd2;
tests/modules/t_kcov.c
305
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_SETBUFSIZE, &size) == 0,
tests/modules/t_kcov.c
308
data = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/modules/t_kcov.c
311
*fdp = fd;
tests/modules/t_kcov.c
323
common_tail(int fd, kcov_int_t *data)
tests/modules/t_kcov.c
329
close(fd);
tests/modules/t_kcov.c
336
int fd;
tests/modules/t_kcov.c
338
buf = common_head_raw(fd_dup, &fd);
tests/modules/t_kcov.c
339
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
tests/modules/t_kcov.c
347
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
tests/modules/t_kcov.c
350
common_tail(fd, buf);
tests/modules/t_kcov.c
422
int fd;
tests/modules/t_kcov.c
425
buf = common_head(&fd);
tests/modules/t_kcov.c
428
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
tests/modules/t_kcov.c
435
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
tests/modules/t_kcov.c
438
common_tail(fd, buf);
tests/modules/t_kcov.c
460
int fd;
tests/modules/t_kcov.c
464
buf = common_head(&fd);
tests/modules/t_kcov.c
467
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
tests/modules/t_kcov.c
481
ATF_REQUIRE_EQ_MSG(ioctl(fd, KCOV_IOC_DISABLE), 0,
tests/modules/t_kcov.c
484
common_tail(fd, buf);
tests/modules/t_kcov.c
491
int fd;
tests/modules/t_kcov.c
494
buf = common_head(&fd);
tests/modules/t_kcov.c
496
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
tests/modules/t_kcov.c
504
ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
tests/modules/t_kcov.c
507
common_tail(fd, buf);
tests/modules/t_kcov.c
51
int fd;
tests/modules/t_kcov.c
517
int fd;
tests/modules/t_kcov.c
523
fd = open_kcov();
tests/modules/t_kcov.c
524
ATF_REQUIRE(close(fd) == 0);
tests/modules/t_kcov.c
53
fd = open("/dev/kcov", O_RDWR);
tests/modules/t_kcov.c
54
if (fd == -1)
tests/modules/t_kcov.c
57
return fd;
tests/net/bpf/t_div-by-zero.c
23
int fd;
tests/net/bpf/t_div-by-zero.c
41
fd = rump_sys_open("/dev/bpf", O_RDWR);
tests/net/bpf/t_div-by-zero.c
42
ATF_CHECK(fd != -1);
tests/net/bpf/t_div-by-zero.c
43
ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(fd, BIOCSETF, &bp), -1,
tests/net/fdpass/fdpass.c
110
int fd;
tests/net/fdpass/fdpass.c
125
pfd.fd = sock;
tests/net/fdpass/fdpass.c
148
fd = (*(int *)CMSG_DATA(cmsg));
tests/net/fdpass/fdpass.c
150
fprintf(stderr, "%d: recv fd %d\n", getpid(), fd);
tests/net/fdpass/fdpass.c
151
return fd;
tests/net/fdpass/fdpass.c
167
int s[2], fd, status, c, verbose;
tests/net/fdpass/fdpass.c
205
fd = open("foo", O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/net/fdpass/fdpass.c
206
if (fd == -1)
tests/net/fdpass/fdpass.c
208
send_fd(s[0], fd);
tests/net/fdpass/fdpass.c
220
fd = recv_fd(s[1]);
tests/net/fdpass/fdpass.c
226
if (write(fd, "foo\n", 4) == -1)
tests/net/fdpass/fdpass.c
228
close(fd);
tests/net/fdpass/fdpass.c
47
send_fd(int sock, int fd)
tests/net/fdpass/fdpass.c
71
*(int *)CMSG_DATA(cmsg) = fd;
tests/net/fdpass/fdpass.c
79
pfd.fd = sock;
tests/net/fdpass/fdpass.c
87
err(1, "%s: sendmsg(%d)", __func__, fd);
tests/net/fdpass/fdpass.c
90
fprintf(stderr, "%d: send fd %d\n", getpid(), fd);
tests/net/if/ifconf.c
102
r = ioctl(fd, SIOCGIFCONF, &ifc);
tests/net/if/ifconf.c
105
close(fd);
tests/net/if/ifconf.c
53
int fd, r;
tests/net/if/ifconf.c
56
fd = socket(AF_INET, SOCK_DGRAM, 0);
tests/net/if/ifconf.c
57
if (fd == -1)
tests/net/if/ifconf.c
63
r = ioctl(fd, SIOCGIFCONF, &ifc);
tests/net/if/ifconf.c
67
close(fd);
tests/net/if/ifconf.c
81
int i, fd, r;
tests/net/if/ifconf.c
95
fd = socket(AF_INET, SOCK_DGRAM, 0);
tests/net/if/ifconf.c
96
if (fd == -1)
tests/net/if/t_compat.c
52
int fd, ifnum;
tests/net/if/t_compat.c
71
RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
tests/net/if/t_compat.c
72
RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, &ifreq));
tests/net/if/t_compat.c
77
rump_sys_close(fd);
tests/net/if_tap/rump_open_tap.c
45
int fd;
tests/net/if_tap/rump_open_tap.c
52
fd = rump_sys_open(argv[1], O_RDWR);
tests/net/if_tap/rump_open_tap.c
53
if (fd == -1)
tests/net/if_vlan/bpfopen.c
239
pfd[PFD_BPF].fd = bpfd;
tests/net/if_vlan/bpfopen.c
251
n = read(pfd[PFD_BPF].fd, buf, bufsiz);
tests/net/if_vlan/siocXmulti.c
107
fd = socket(AF_INET, SOCK_DGRAM, 0);
tests/net/if_vlan/siocXmulti.c
108
if (fd < 0)
tests/net/if_vlan/siocXmulti.c
111
if (ioctl(fd, req, (caddr_t)&ifr) < 0) {
tests/net/if_vlan/siocXmulti.c
116
close(fd);
tests/net/if_vlan/siocXmulti.c
66
int fd, rv;
tests/net/mcast/mcast.c
173
connector(int fd, const struct sockaddr *sa, socklen_t slen)
tests/net/mcast/mcast.c
239
synchronize(const int fd, bool waiter)
tests/net/mcast/mcast.c
246
pfd.fd = fd;
tests/net/mcast/mcast.c
257
if (read(fd, &syncmsg, sizeof(syncmsg)) == -1)
tests/net/mcast/mcast.c
260
if (write(fd, &syncmsg, sizeof(syncmsg)) == -1)
tests/net/mcast/mcast.c
268
sender(const int fd, const char *host, const char *port, size_t n, bool conn,
tests/net/mcast/mcast.c
280
if (synchronize(fd, true) == -1)
tests/net/mcast/mcast.c
304
if (synchronize(fd, true) == -1)
tests/net/mcast/mcast.c
311
receiver(const int fd, const char *host, const char *port, size_t n, bool conn,
tests/net/mcast/mcast.c
322
pfd.fd = s;
tests/net/mcast/mcast.c
326
synchronize(fd, false);
tests/net/mcast/mcast.c
345
synchronize(fd, false);
tests/net/net/t_bind.c
76
int fd = socket(sfam, SOCK_STREAM, 0);
tests/net/net/t_bind.c
77
if (fd == -1)
tests/net/net/t_bind.c
80
if (setsockopt(fd, p, o, &f, sizeof(f)) == -1) {
tests/net/net/t_bind.c
81
close(fd);
tests/net/net/t_bind.c
84
return fd;
tests/net/net/t_ip_reass.c
167
int error, fd;
tests/net/net/t_ip_reass.c
171
RL(fd = rump_sys_open("/dev/bpf", O_RDWR));
tests/net/net/t_ip_reass.c
173
fd = open("/dev/bpf0", O_RDWR);
tests/net/net/t_ip_reass.c
174
if (fd < 0 && errno == ENOENT)
tests/net/net/t_ip_reass.c
176
ATF_REQUIRE_MSG(fd >= 0, "open(/dev/bpf0): %s", strerror(errno));
tests/net/net/t_ip_reass.c
190
error = ioctl(fd, BIOCSETIF, &ifr);
tests/net/net/t_ip_reass.c
197
return (fd);
tests/net/net/t_ip_reass.c
246
int error, fd;
tests/net/net/t_ip_reass.c
249
fd = open_lobpf(&addr);
tests/net/net/t_ip_reass.c
276
write_lopacket(fd, packet1);
tests/net/net/t_ip_reass.c
280
write_lopacket(fd, packet2);
tests/net/net/t_ip_reass.c
288
write_lopacket(fd, packet2);
tests/net/net/t_ip_reass.c
294
write_lopacket(fd, packet3);
tests/net/net/t_ip_reass.c
300
write_lopacket(fd, packet4);
tests/net/net/t_ip_reass.c
304
error = close(fd);
tests/net/net/t_ip_reass.c
326
int error, fd;
tests/net/net/t_ip_reass.c
329
fd = open_lobpf(&addr);
tests/net/net/t_ip_reass.c
348
write_lopacket(fd, packet1);
tests/net/net/t_ip_reass.c
358
write_lopacket(fd, packet2);
tests/net/net/t_ip_reass.c
366
error = close(fd);
tests/net/net/t_ip_reass.c
383
int error, fd;
tests/net/net/t_ip_reass.c
386
fd = open_lobpf(&addr);
tests/net/net/t_ip_reass.c
407
write_lopacket(fd, packet1);
tests/net/net/t_ip_reass.c
415
write_lopacket(fd, packet2);
tests/net/net/t_ip_reass.c
422
error = close(fd);
tests/net/net/t_mapped.c
73
int fd = socket(sfam, SOCK_STREAM, 0);
tests/net/net/t_mapped.c
74
if (fd == -1)
tests/net/net/t_mapped.c
77
return fd;
tests/net/net/t_mapped.c
81
if (setsockopt(fd, IPPROTO_IPV6, 24 /* IPV6_2292RTHDR */,
tests/net/net/t_mapped.c
85
if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &f, sizeof(f)) == -1)
tests/net/net/t_mapped.c
87
return fd;
tests/net/net/t_socket_afinet.c
164
pfd.fd = ss2;
tests/net/net/t_socket_afinet.c
179
pfd.fd = ss2;
tests/net/net/t_socket_afinet.c
226
pfd.fd = ss2;
tests/net/net/t_socket_afinet.c
239
pfd.fd = ss2;
tests/net/net/t_socket_afinet.c
260
pfd.fd = ss2;
tests/net/net/t_unix.c
176
check_cred(int fd, bool statit, pid_t checkpid, pid_t otherpid, const char *s)
tests/net/net/t_unix.c
184
if (fstat(fd, &st) == -1)
tests/net/net/t_unix.c
190
if (peercred(fd, &euid, &egid, &pid) == -1)
tests/net/net/t_unix.c
513
pfd = (struct pollfd){.fd = conn, .events = POLLOUT};
tests/net/tcp/t_tcp_connect_port.c
112
fd = open(SYSCTLBAKFILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,
tests/net/tcp/t_tcp_connect_port.c
114
if (fd < 0) {
tests/net/tcp/t_tcp_connect_port.c
118
error = write(fd, &random_save, sizeof(random_save));
tests/net/tcp/t_tcp_connect_port.c
129
error = close(fd);
tests/net/tcp/t_tcp_connect_port.c
133
(void)close(fd);
tests/net/tcp/t_tcp_connect_port.c
150
int error, fd, random_save;
tests/net/tcp/t_tcp_connect_port.c
153
fd = open(SYSCTLBAKFILE, O_RDONLY);
tests/net/tcp/t_tcp_connect_port.c
154
if (fd < 0) {
tests/net/tcp/t_tcp_connect_port.c
158
error = read(fd, &random_save, sizeof(random_save));
tests/net/tcp/t_tcp_connect_port.c
169
error = close(fd);
tests/net/tcp/t_tcp_connect_port.c
82
int error, fd, random_new, random_save;
tests/rump/modautoload/t_modautoload.c
72
int fd;
tests/rump/modautoload/t_modautoload.c
76
if ((fd = rump_sys_open("/kern/hz", O_RDONLY)) == -1)
tests/rump/modautoload/t_modautoload.c
78
if (rump_sys_read(fd, buf, sizeof(buf)) <= 0)
tests/rump/rumpkern/h_client/h_forkcli.c
22
int fd, status;
tests/rump/rumpkern/h_client/h_forkcli.c
27
fd = rump_sys_open("/dev/null", O_CREAT | O_RDWR, 0600);
tests/rump/rumpkern/h_client/h_forkcli.c
28
if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
tests/rump/rumpkern/h_client/h_forkcli.c
48
if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
tests/rump/rumpkern/h_client/h_forkcli.c
50
rump_sys_close(fd);
tests/rump/rumpkern/h_client/h_forkcli.c
57
if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
tests/rump/rumpkern/h_client/h_forkcli.c
63
if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd))
tests/rump/rumpkern/h_client/h_stresscli.c
109
if (rump_sys_write(fd, buf, 16) != 16)
tests/rump/rumpkern/h_client/h_stresscli.c
114
rump_sys_close(fd);
tests/rump/rumpkern/h_client/h_stresscli.c
47
int s, fd, x;
tests/rump/rumpkern/h_client/h_stresscli.c
62
fd = rump_sys_open("/dev/null", O_RDWR);
tests/rump/rumpkern/t_lwproc.c
257
int fd;
tests/rump/rumpkern/t_lwproc.c
266
RL(fd = rump_sys_open("/file", O_RDWR | O_CREAT, 0777));
tests/rump/rumpkern/t_lwproc.c
270
ATF_REQUIRE_ERRNO(EBADF, rump_sys_write(fd, &fd, sizeof(fd)) == -1);
tests/rump/rumpkern/t_lwproc.c
275
ATF_REQUIRE_EQ(rump_sys_write(fd, &fd, sizeof(fd)), sizeof(fd));
tests/rump/rumpkern/t_lwproc.c
276
RL(rump_sys_fstat(fd, &sb));
tests/rump/rumpkern/t_lwproc.c
284
RL(rump_sys_close(fd));
tests/rump/rumpkern/t_lwproc.c
286
ATF_REQUIRE_ERRNO(EBADF, rump_sys_fstat(fd, &sb) == -1);
tests/rump/rumpkern/t_lwproc.c
291
RL(fd = rump_sys_open("/file", O_RDWR, 0777));
tests/rump/rumpkern/t_lwproc.c
293
ATF_REQUIRE_EQ(rump_sys_write(fd, &fd, sizeof(fd)), sizeof(fd));
tests/rump/rumpkern/t_lwproc.c
294
RL(rump_sys_fstat(fd, &sb));
tests/rump/rumpkern/t_lwproc.c
299
RL(rump_sys_close(fd));
tests/rump/rumpkern/t_lwproc.c
301
RL(rump_sys_fstat(fd, &sb));
tests/rump/rumpkern/t_lwproc.c
302
ATF_REQUIRE_EQ(sb.st_size, sizeof(fd));
tests/rump/rumpvfs/t_basic.c
60
int fd;
tests/rump/rumpvfs/t_basic.c
63
RL(fd = rump_sys_open(TESTFILE, O_RDWR | O_CREAT, 0777));
tests/rump/rumpvfs/t_basic.c
68
rv = rump_sys_lseek(fd, FIVE_MEGS, SEEK_SET);
tests/rump/rumpvfs/t_basic.c
71
rv = rump_sys_lseek(fd, FIVE_GIGS, SEEK_SET);
tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c
300
int fd;
tests/usr.sbin/inetd/t_inetd.c
246
int error, fd;
tests/usr.sbin/inetd/t_inetd.c
253
CHECK_ERROR(fd = socket(res->ai_family,
tests/usr.sbin/inetd/t_inetd.c
256
CHECK_ERROR(setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout,
tests/usr.sbin/inetd/t_inetd.c
260
return fd;
tests/usr.sbin/inetd/test_server.c
109
int fd;
tests/usr.sbin/inetd/test_server.c
113
CHECK(fd = accept(0, (struct sockaddr*)&addr, &addr_len));
tests/usr.sbin/inetd/test_server.c
114
CHECK(count = recv(fd, buffer, sizeof(buffer), 0));
tests/usr.sbin/inetd/test_server.c
117
CHECK(send(fd, buffer, (size_t)count, 0));
tests/usr.sbin/inetd/test_server.c
118
CHECK(shutdown(fd, SHUT_RDWR));
tests/usr.sbin/inetd/test_server.c
119
CHECK(close(fd));
tools/compat/dprintf.c
46
dprintf(int fd, const char *fmt, ...)
tools/compat/dprintf.c
52
if ((e = dup(fd)) == -1)
tools/compat/flock.c
43
int flock(int fd, int op) {
tools/compat/flock.c
68
rc = fcntl(fd, op & LOCK_NB ? F_SETLK : F_SETLKW, &fl);
usr.bin/aiomixer/app.h
60
int fd;
usr.bin/aiomixer/draw.c
51
int fd;
usr.bin/aiomixer/draw.c
58
fd = open(mixer_path, O_RDWR);
usr.bin/aiomixer/draw.c
59
if (fd == -1)
usr.bin/aiomixer/draw.c
61
if (ioctl(fd, AUDIO_GETDEV, &dev) < 0) {
usr.bin/aiomixer/draw.c
62
close(fd);
usr.bin/aiomixer/draw.c
65
close(fd);
usr.bin/aiomixer/draw.c
90
if (ioctl(aio->fd, AUDIO_MIXER_READ, &value) < 0)
usr.bin/aiomixer/main.c
146
if (ioctl(aio->fd, AUDIO_MIXER_READ, &value) < 0)
usr.bin/aiomixer/main.c
205
if (ioctl(aio->fd, AUDIO_MIXER_WRITE, &value) < 0)
usr.bin/aiomixer/main.c
225
if (ioctl(aio->fd, AUDIO_MIXER_READ, &ctrl) < 0)
usr.bin/aiomixer/main.c
230
if (ioctl(aio->fd, AUDIO_MIXER_WRITE, &ctrl) < 0)
usr.bin/aiomixer/main.c
469
if ((aio->fd = open(device, O_RDWR)) < 0)
usr.bin/aiomixer/main.c
472
if (ioctl(aio->fd, AUDIO_GETDEV, &aio->mixerdev) < 0)
usr.bin/aiomixer/main.c
505
int i, fd;
usr.bin/aiomixer/main.c
567
fd = open(mixer_path, O_RDWR);
usr.bin/aiomixer/main.c
568
if (fd == -1)
usr.bin/aiomixer/main.c
570
close(fd);
usr.bin/aiomixer/main.c
582
close(aio->fd);
usr.bin/aiomixer/parse.c
103
ioctl(aio->fd, AUDIO_MIXER_DEVINFO, &info) != -1; ++info.index) {
usr.bin/aiomixer/parse.c
114
ioctl(aio->fd, AUDIO_MIXER_DEVINFO, &info) != -1; ++info.index) {
usr.bin/audio/ctl/ctl.c
289
getinfo(int fd)
usr.bin/audio/ctl/ctl.c
293
if (ioctl(fd, AUDIO_GETDEV, &adev) < 0)
usr.bin/audio/ctl/ctl.c
298
if (ioctl(fd, AUDIO_GETENC, &enc) < 0)
usr.bin/audio/ctl/ctl.c
310
if (ioctl(fd, AUDIO_GETFD, &fullduplex) < 0)
usr.bin/audio/ctl/ctl.c
312
if (ioctl(fd, AUDIO_GETPROPS, &properties) < 0)
usr.bin/audio/ctl/ctl.c
314
if (ioctl(fd, AUDIO_RERROR, &rerror) < 0)
usr.bin/audio/ctl/ctl.c
316
if (ioctl(fd, AUDIO_GETINFO, &info) < 0)
usr.bin/audio/ctl/ctl.c
334
int fd, i, ch;
usr.bin/audio/ctl/ctl.c
367
fd = open(file, O_WRONLY);
usr.bin/audio/ctl/ctl.c
368
if (fd < 0)
usr.bin/audio/ctl/ctl.c
369
fd = open(file, O_RDONLY);
usr.bin/audio/ctl/ctl.c
370
if (fd < 0 && file == deffile) {
usr.bin/audio/ctl/ctl.c
372
fd = open(file, O_WRONLY);
usr.bin/audio/ctl/ctl.c
373
if (fd < 0)
usr.bin/audio/ctl/ctl.c
374
fd = open(file, O_RDONLY);
usr.bin/audio/ctl/ctl.c
377
if (fd < 0)
usr.bin/audio/ctl/ctl.c
381
getinfo(fd);
usr.bin/audio/ctl/ctl.c
392
audioctl_write(fd, argc, argv);
usr.bin/audio/ctl/ctl.c
394
getinfo(fd);
usr.bin/audio/ctl/ctl.c
429
audioctl_write(int fd, int argc, char *argv[])
usr.bin/audio/ctl/ctl.c
449
if (ioctl(fd, AUDIO_SETFD,
usr.bin/audio/ctl/ctl.c
458
if (ioctl(fd, AUDIO_SETINFO, &info) < 0)
usr.bin/audio/ctl/ctl.c
57
static void getinfo(int fd);
usr.bin/audio/play/play.c
288
audio_write(int fd, void *buf, size_t len, convert conv)
usr.bin/audio/play/play.c
297
return write(fd, buf, len);
usr.bin/audio/play/play.c
307
return write(fd, convert_buffer, len);
usr.bin/audio/play/play.c
320
int fd;
usr.bin/audio/play/play.c
328
fd = open(file, O_RDONLY);
usr.bin/audio/play/play.c
329
if (fd < 0) {
usr.bin/audio/play/play.c
335
if (fstat(fd, &sb) < 0)
usr.bin/audio/play/play.c
348
MAP_SHARED, fd, 0)) == MAP_FAILED) {
usr.bin/audio/play/play.c
349
play_fd(file, fd);
usr.bin/audio/play/play.c
350
close(fd);
usr.bin/audio/play/play.c
402
close(fd);
usr.bin/audio/play/play.c
409
play_fd(const char *file, int fd)
usr.bin/audio/play/play.c
421
nr = read(fd, buffer, bufsize);
usr.bin/audio/play/play.c
453
nr = read(fd, buffer, bufsize);
usr.bin/audio/play/play.c
474
audioctl_write_fromhdr(void *hdr, size_t fsz, int fd, off_t *datasize, const char *file, convert *conv)
usr.bin/audio/play/play.c
585
if (!nflag && ioctl(fd, AUDIO_SETINFO, &info) < 0)
usr.bin/audiocfg/audiodev.c
153
int fd, error;
usr.bin/audiocfg/audiodev.c
155
fd = open(DRVCTLDEV, O_RDONLY);
usr.bin/audiocfg/audiodev.c
156
if (fd == -1) {
usr.bin/audiocfg/audiodev.c
169
error = drvctl_foreach(fd, "audio", audiodev_cb, NULL);
usr.bin/audiocfg/audiodev.c
175
close(fd);
usr.bin/audiocfg/audiodev.c
305
adev->fd = open(adev->path, O_WRONLY);
usr.bin/audiocfg/audiodev.c
306
if (adev->fd == -1) {
usr.bin/audiocfg/audiodev.c
317
if (ioctl(adev->fd, AUDIO_SETINFO, &info) == -1) {
usr.bin/audiocfg/audiodev.c
321
if (ioctl(adev->fd, AUDIO_GETBUFINFO, &info) == -1) {
usr.bin/audiocfg/audiodev.c
336
close(adev->fd);
usr.bin/audiocfg/audiodev.c
371
ret = write(adev->fd, (char *)buf + off, wlen);
usr.bin/audiocfg/audiodev.c
381
if (ioctl(adev->fd, AUDIO_DRAIN) == -1) {
usr.bin/audiocfg/audiodev.h
49
int fd;
usr.bin/audiocfg/drvctl.c
108
if (drvctl_list(fd, curnode, &laa) == -1)
usr.bin/audiocfg/drvctl.c
115
rv = drvctl_get_properties(fd, laa.l_childname[i], &props);
usr.bin/audiocfg/drvctl.c
129
if (drvctl_search(fd, laa.l_childname[i], dvname,
usr.bin/audiocfg/drvctl.c
138
drvctl_foreach(int fd, const char *dvname,
usr.bin/audiocfg/drvctl.c
142
return drvctl_search(fd, "", dvname, callback, args);
usr.bin/audiocfg/drvctl.c
37
drvctl_list(int fd, const char *name, struct devlistargs *laa)
usr.bin/audiocfg/drvctl.c
43
if (ioctl(fd, DRVLISTDEV, laa) == -1)
usr.bin/audiocfg/drvctl.c
49
if (ioctl(fd, DRVLISTDEV, laa) == -1)
usr.bin/audiocfg/drvctl.c
55
drvctl_get_properties(int fd, const char *devnode, prop_dictionary_t *props)
usr.bin/audiocfg/drvctl.c
73
error = prop_dictionary_sendrecv_ioctl(command_dict, fd,
usr.bin/audiocfg/drvctl.c
99
drvctl_search(int fd, const char *curnode, const char *dvname,
usr.bin/bthset/bthset.c
328
do_rfcomm(int fd, short ev, void *arg)
usr.bin/bthset/bthset.c
395
do_server(int fd, short ev, void *arg)
usr.bin/bthset/bthset.c
405
s = accept(fd, (struct sockaddr *)&addr, &len);
usr.bin/bthset/bthset.c
577
int fd, len;
usr.bin/bthset/bthset.c
582
fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
usr.bin/bthset/bthset.c
583
if (fd < 0)
usr.bin/bthset/bthset.c
588
write(fd, buf, len);
usr.bin/bthset/bthset.c
593
close (fd);
usr.bin/btkey/device.c
125
if (fd >= 0) close(fd);
usr.bin/btkey/device.c
69
int fd, rv;
usr.bin/btkey/device.c
89
if ((fd = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI)) < 0
usr.bin/btkey/device.c
90
|| setsockopt(fd, BTPROTO_HCI, SO_HCI_EVT_FILTER, &f, sizeof(f)) < 0
usr.bin/btkey/device.c
91
|| bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0
usr.bin/btkey/device.c
92
|| connect(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0
usr.bin/btkey/device.c
93
|| send(fd, buf, sizeof(hci_cmd_hdr_t) + clen, 0) < 0)
usr.bin/btkey/device.c
98
if (recv(fd, buf, sizeof(buf), 0) < 0)
usr.bin/calendar/calendar.c
407
int fd = -1;
usr.bin/calendar/calendar.c
413
if ((fd = tryopen(*name, O_RDONLY)) == -1)
usr.bin/calendar/calendar.c
418
if (fd == -1) {
usr.bin/calendar/calendar.c
423
} else if ((fd = tryopen(fname, O_RDONLY)) == -1) {
usr.bin/calendar/calendar.c
443
if (fd != STDIN_FILENO) {
usr.bin/calendar/calendar.c
444
(void)dup2(fd, STDIN_FILENO);
usr.bin/calendar/calendar.c
445
(void)close(fd);
usr.bin/calendar/calendar.c
472
close(fd);
usr.bin/calendar/calendar.c
483
if ((fd = mkstemp(path)) == -1) {
usr.bin/calendar/calendar.c
487
return fdopen(fd, "w+");
usr.bin/calendar/calendar.c
495
int fd, serrno, zero;
usr.bin/calendar/calendar.c
512
fd = open(pathname, flags | O_NONBLOCK);
usr.bin/calendar/calendar.c
513
if (fd == -1) {
usr.bin/calendar/calendar.c
516
if (fstat(fd, &st) == -1) {
usr.bin/calendar/calendar.c
518
close(fd);
usr.bin/calendar/calendar.c
525
close(fd);
usr.bin/calendar/calendar.c
536
close(fd);
usr.bin/calendar/calendar.c
542
close(fd);
usr.bin/calendar/calendar.c
547
if (ioctl(fd, FIONBIO, &zero) == -1) {
usr.bin/calendar/calendar.c
550
close(fd);
usr.bin/calendar/calendar.c
554
return fd;
usr.bin/cdplay/cdplay.c
1010
if (!digital && ioctl(fd, CDIOCREADSUBCHANNEL, &ss) >= 0) {
usr.bin/cdplay/cdplay.c
1023
if (ioctl(fd, CDIOCGETVOL, &v) >= 0) {
usr.bin/cdplay/cdplay.c
1040
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
usr.bin/cdplay/cdplay.c
1146
if ((rv = ioctl(fd, CDIOCPLAYTRACKS, &t)) < 0) {
usr.bin/cdplay/cdplay.c
1165
if ((rv = ioctl(fd, CDIOCPLAYBLOCKS, &t)) < 0)
usr.bin/cdplay/cdplay.c
1193
if ((rv = ioctl(fd, CDIOCSETVOL, &v)) < 0)
usr.bin/cdplay/cdplay.c
1209
if ((rv = ioctl(fd, CDIOREADTOCENTRYS, &t)) < 0)
usr.bin/cdplay/cdplay.c
1232
if ((rv = ioctl(fd, CDIOCPLAYMSF, &a)) < 0)
usr.bin/cdplay/cdplay.c
1249
if ((rc = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
usr.bin/cdplay/cdplay.c
126
#define IOCTL_SIMPLE(fd, ctl) \
usr.bin/cdplay/cdplay.c
128
if (ioctl((fd), (ctl)) >= 0) { \
usr.bin/cdplay/cdplay.c
1283
if ((rv = ioctl(fd, CDIOCREADSUBCHANNEL, &s)) < 0) {
usr.bin/cdplay/cdplay.c
129
close(fd); \
usr.bin/cdplay/cdplay.c
130
fd = -1; \
usr.bin/cdplay/cdplay.c
1374
if (fd > -1)
usr.bin/cdplay/cdplay.c
1377
fd = opendisk(cdname, O_RDONLY, devbuf, sizeof(devbuf), 0);
usr.bin/cdplay/cdplay.c
1378
if (fd < 0) {
usr.bin/cdplay/cdplay.c
142
static int fd = -1;
usr.bin/cdplay/cdplay.c
316
if (fd != -1)
usr.bin/cdplay/cdplay.c
317
close(fd);
usr.bin/cdplay/cdplay.c
318
fd = -1;
usr.bin/cdplay/cdplay.c
434
close(fd);
usr.bin/cdplay/cdplay.c
439
if (fd < 0 && !opencd())
usr.bin/cdplay/cdplay.c
455
} else if ((rv = ioctl(fd, CDIOCPAUSE)) < 0)
usr.bin/cdplay/cdplay.c
463
} else if ((rv = ioctl(fd, CDIOCRESUME)) < 0)
usr.bin/cdplay/cdplay.c
472
if ((rv = ioctl(fd, CDIOCSTOP)) < 0)
usr.bin/cdplay/cdplay.c
474
if (ioctl(fd, CDIOCALLOW) < 0)
usr.bin/cdplay/cdplay.c
481
IOCTL_SIMPLE(fd, CDIOCRESET);
usr.bin/cdplay/cdplay.c
490
if (ioctl(fd, CDIOCALLOW) < 0)
usr.bin/cdplay/cdplay.c
492
IOCTL_SIMPLE(fd, CDIOCEJECT);
usr.bin/cdplay/cdplay.c
496
if (ioctl(fd, CDIOCALLOW) < 0)
usr.bin/cdplay/cdplay.c
498
IOCTL_SIMPLE(fd, CDIOCCLOSE);
usr.bin/cdplay/cdplay.c
499
if (interactive && fd == -1)
usr.bin/cdplay/cdplay.c
607
rv = ioctl(fd, CDIOCSETLEFT);
usr.bin/cdplay/cdplay.c
609
rv = ioctl(fd, CDIOCSETRIGHT);
usr.bin/cdplay/cdplay.c
611
rv = ioctl(fd, CDIOCSETMONO);
usr.bin/cdplay/cdplay.c
613
rv = ioctl(fd, CDIOCSETSTEREO);
usr.bin/cdplay/cdplay.c
615
rv = ioctl(fd, CDIOCSETMUTE);
usr.bin/cdplay/cdplay.c
653
if ((rv = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
usr.bin/cdplay/cdplay.c
886
aulen = readaudio(fd, da.lba_current, fpw, da.aubuf);
usr.bin/cdplay/cdplay.c
910
if ((rv = ioctl(fd, CDIOREADTOCHEADER, &h)) < 0) {
usr.bin/chpass/edit.c
140
(void)fchown(fd, getuid(), getgid());
usr.bin/chpass/edit.c
152
int len, fd;
usr.bin/chpass/edit.c
155
if ((fd = open(tempname, O_RDONLY|O_NOFOLLOW)) == -1 ||
usr.bin/chpass/edit.c
156
(fp = fdopen(fd, "r")) == NULL)
usr.bin/chpass/edit.c
158
if (fstat(fd, &sb))
usr.bin/chpass/edit.c
90
display(char *tempname, int fd, struct passwd *pw)
usr.bin/chpass/edit.c
96
if (!(fp = fdopen(fd, "w")))
usr.bin/cksum/cksum.c
156
int ch, fd, rval, pflag, nohashstdin;
usr.bin/cksum/cksum.c
444
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
usr.bin/cksum/cksum.c
450
if (cfncn(fd, &val, &len))
usr.bin/cksum/cksum.c
462
close(fd);
usr.bin/cksum/cksum.c
485
fd = STDIN_FILENO;
usr.bin/cksum/cksum.c
498
if ((fd = open(fn, O_RDONLY, 0)) < 0) {
usr.bin/cksum/cksum.c
508
if (cfncn(fd, &val, &len)) {
usr.bin/cksum/cksum.c
513
(void)close(fd);
usr.bin/cksum/crc.c
117
crc(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/crc.c
126
while ((nr = read(fd, buf, sizeof(buf))) > 0) {
usr.bin/cksum/sum1.c
51
csum1(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/sum1.c
64
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/cksum/sum2.c
51
csum2(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/sum2.c
68
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/config/main.c
1636
int fd;
usr.bin/config/main.c
1646
if ((fd = mkstemp(line)) == -1 ||
usr.bin/config/main.c
1647
(cfg = fdopen(fd, "r+")) == NULL) {
usr.bin/config/main.c
1648
if (fd != -1) {
usr.bin/config/main.c
1650
(void)close(fd);
usr.bin/crunch/crunchgen/crunchgen.c
676
int fd;
usr.bin/crunch/crunchgen/crunchgen.c
683
if ((fd = mkstemp(tempfname)) < 0) {
usr.bin/crunch/crunchgen/crunchgen.c
688
if ((f = fdopen(fd, "w")) == NULL) {
usr.bin/crunch/crunchide/crunchide.c
238
int fd, i, n, rv;
usr.bin/crunch/crunchide/crunchide.c
240
fd = open(filename, O_RDWR, 0);
usr.bin/crunch/crunchide/crunchide.c
241
if (fd == -1) {
usr.bin/crunch/crunchide/crunchide.c
250
if (lseek(fd, 0, SEEK_SET) != 0) {
usr.bin/crunch/crunchide/crunchide.c
254
if ((*exec_formats[i].check)(fd, filename) != 0)
usr.bin/crunch/crunchide/crunchide.c
266
if (lseek(fd, 0, SEEK_SET) != 0) {
usr.bin/crunch/crunchide/crunchide.c
270
rv = (*exec_formats[i].hide)(fd, filename);
usr.bin/crunch/crunchide/crunchide.c
273
close(fd);
usr.bin/crunch/crunchide/exec_coff.c
58
check_coff(int fd, const char *filename)
usr.bin/crunch/crunchide/exec_coff.c
67
if (fstat(fd, &sb) == -1)
usr.bin/crunch/crunchide/exec_coff.c
71
if (read(fd, &fh, sizeof fh) != sizeof fh)
usr.bin/crunch/crunchide/exec_coff.c
81
hide_coff(int fd, const char *filename)
usr.bin/crunch/crunchide/exec_ecoff.c
56
check_ecoff(int fd, const char *filename)
usr.bin/crunch/crunchide/exec_ecoff.c
65
if (fstat(fd, &sb) == -1)
usr.bin/crunch/crunchide/exec_ecoff.c
69
if (read(fd, &eh, sizeof eh) != sizeof eh)
usr.bin/crunch/crunchide/exec_ecoff.c
79
hide_ecoff(int fd, const char *filename)
usr.bin/crunch/crunchide/exec_elf32.c
130
ELFNAMEEND(check)(int fd, const char *fn)
usr.bin/crunch/crunchide/exec_elf32.c
139
if (fstat(fd, &sb) == -1)
usr.bin/crunch/crunchide/exec_elf32.c
143
if (read(fd, &eh, sizeof eh) != sizeof eh)
usr.bin/crunch/crunchide/exec_elf32.c
176
ELFNAMEEND(hide)(int fd, const char *fn)
usr.bin/crunch/crunchide/exec_elf32.c
191
if (xreadatoff(fd, &ehdr, 0, sizeof ehdr, fn) != sizeof ehdr)
usr.bin/crunch/crunchide/exec_elf32.c
197
if (xreadatoff(fd, shdrp, ehdr.e_shoff, shdrsize, fn) != shdrsize)
usr.bin/crunch/crunchide/exec_elf32.c
248
if ((size_t)xreadatoff(fd, symtabp, shdrp[symtabsnum].sh_offset,
usr.bin/crunch/crunchide/exec_elf32.c
256
if ((size_t)xreadatoff(fd, strtabp, shdrp[strtabsnum].sh_offset,
usr.bin/crunch/crunchide/exec_elf32.c
309
if (xwriteatoff(fd, shdrp, ehdr.e_shoff, shdrsize, fn) != shdrsize)
usr.bin/crunch/crunchide/exec_elf32.c
311
if ((size_t)xwriteatoff(fd, symtabp, shdrp[symtabsnum].sh_offset,
usr.bin/crunch/crunchide/exec_elf32.c
314
if ((size_t)xwriteatoff(fd, nstrtabp, shdrp[strtabsnum].sh_offset,
usr.bin/crunch/crunchide/exec_elf32.c
70
xreadatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
usr.bin/crunch/crunchide/exec_elf32.c
74
if (lseek(fd, off, SEEK_SET) != off) {
usr.bin/crunch/crunchide/exec_elf32.c
78
if ((size_t)(rv = read(fd, buf, size)) != size) {
usr.bin/crunch/crunchide/exec_elf32.c
87
xwriteatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
usr.bin/crunch/crunchide/exec_elf32.c
91
if (lseek(fd, off, SEEK_SET) != off) {
usr.bin/crunch/crunchide/exec_elf32.c
95
if ((size_t)(rv = write(fd, buf, size)) != size) {
usr.bin/deroff/deroff.c
389
FILE *fd;
usr.bin/deroff/deroff.c
391
if ((fd = fopen(p, "r")) == NULL)
usr.bin/deroff/deroff.c
394
return fd;
usr.bin/diff/diffreg.c
498
prepare(int i, FILE *fd, size_t filesize, int flags)
usr.bin/diff/diffreg.c
505
rewind(fd);
usr.bin/diff/diffreg.c
512
while ((r = readhash(fd, flags, &h)) != RH_EOF) {
usr.bin/diff/diffreg.c
967
preadline(int fd, size_t rlen, off_t off)
usr.bin/diff/diffreg.c
973
if ((nr = pread(fd, line, rlen, off)) == -1)
usr.bin/diff3/diff3.c
148
static int readin(int fd, struct diff **);
usr.bin/diff3/diff3.c
198
readin(int fd, struct diff **dd)
usr.bin/diff3/diff3.c
205
f = fdopen(fd, "r");
usr.bin/diff3/diff3.c
246
diffexec(const char *diffprog, char **diffargv, int fd[])
usr.bin/diff3/diff3.c
253
close(fd[0]);
usr.bin/diff3/diff3.c
254
if (dup2(fd[1], STDOUT_FILENO) == -1)
usr.bin/diff3/diff3.c
256
close(fd[1]);
usr.bin/diff3/diff3.c
264
close(fd[1]);
usr.bin/eject/eject.c
373
int fd;
usr.bin/eject/eject.c
379
fd = open(dn, O_RDONLY);
usr.bin/eject/eject.c
380
if (fd == -1)
usr.bin/eject/eject.c
389
if (ioctl(fd, MTIOCTOP, &m) == -1)
usr.bin/eject/eject.c
402
(void)close(fd);
usr.bin/eject/eject.c
409
int fd;
usr.bin/eject/eject.c
416
fd = open(dn, O_RDONLY);
usr.bin/eject/eject.c
417
if (fd == -1)
usr.bin/eject/eject.c
424
if (ioctl(fd, CDIOCCLOSE, NULL) == -1)
usr.bin/eject/eject.c
434
if (ioctl(fd, DIOCLOCK, &arg) == -1)
usr.bin/eject/eject.c
438
if (ioctl(fd, DIOCEJECT, &arg) == -1)
usr.bin/eject/eject.c
446
if (ioctl(fd, DIOCLOCK, &arg) == -1)
usr.bin/eject/eject.c
454
if (ioctl(fd, DIOCLOCK, &arg) == -1)
usr.bin/eject/eject.c
459
(void)close(fd);
usr.bin/elf2ecoff/elf2ecoff.c
838
pad16(int fd, int size, const char *msg)
usr.bin/elf2ecoff/elf2ecoff.c
841
safewrite(fd, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0", size, msg);
usr.bin/error/touch.c
576
int fd;
usr.bin/error/touch.c
587
fd = -1;
usr.bin/error/touch.c
588
if ((fd = mkstemp(n_name)) == -1 ||
usr.bin/error/touch.c
589
(n_touchedfile = fdopen(fd, "w")) == NULL) {
usr.bin/error/touch.c
591
if (fd != -1)
usr.bin/error/touch.c
592
close(fd);
usr.bin/extattr/getextattr.c
290
int fd;
usr.bin/extattr/getextattr.c
294
if ((fd = open(filename, O_RDONLY, 0)) == -1)
usr.bin/extattr/getextattr.c
298
if (fstat(fd, &st) != 0)
usr.bin/extattr/getextattr.c
306
if ((readen = read(fd, buf, remain)) == -1)
usr.bin/extattr/getextattr.c
311
(void)close(fd);
usr.bin/fdformat/fdformat.c
103
if (lseek(fd, offset, SEEK_SET) == (off_t) -1) {
usr.bin/fdformat/fdformat.c
107
if ((size_t)read(fd, buf, tracksize) != tracksize) {
usr.bin/fdformat/fdformat.c
168
int fd;
usr.bin/fdformat/fdformat.c
241
fd = open(filename, O_RDWR);
usr.bin/fdformat/fdformat.c
242
if (fd == -1)
usr.bin/fdformat/fdformat.c
244
if (ioctl(fd, FDIOCGETFORMAT, &fetchparms) == -1) {
usr.bin/fdformat/fdformat.c
266
if (ioctl(fd, FDIOCSETOPTS, &tmpint) == -1 ||
usr.bin/fdformat/fdformat.c
267
ioctl(fd, FDIOCSETFORMAT, &parms) == -1) {
usr.bin/fdformat/fdformat.c
293
if (ioctl(fd, FDIOCFORMAT_TRACK, &cmd) == 0) {
usr.bin/fdformat/fdformat.c
295
errcnt += verify_track(fd, cyl, trk,
usr.bin/fdformat/fdformat.c
95
verify_track(int fd, int cyl, int trk, struct fdformat_parms *parms, char *buf)
usr.bin/fincore/fincore.c
120
int fd;
usr.bin/fincore/fincore.c
123
fd = open(name, O_RDONLY);
usr.bin/fincore/fincore.c
124
if (fd == -1) {
usr.bin/fincore/fincore.c
127
if (fstat(fd, &st)) {
usr.bin/fincore/fincore.c
136
if (fincore(fd, off, off + chunk_size, vec)) {
usr.bin/fincore/fincore.c
155
close(fd);
usr.bin/fincore/fincore.c
82
fincore(int fd, off_t startoff, off_t endoff, unsigned char *vec)
usr.bin/fincore/fincore.c
93
fd, off);
usr.bin/finger/lprint.c
335
int fd, nr;
usr.bin/finger/lprint.c
339
if ((fd = open(tbuf, O_RDONLY)) < 0 || fstat(fd, &sb) ||
usr.bin/finger/lprint.c
345
nr = read(fd, tbuf, sizeof(tbuf));
usr.bin/finger/lprint.c
347
(void)close(fd);
usr.bin/finger/lprint.c
359
(void)close(fd);
usr.bin/finger/lprint.c
363
(void)lseek(fd, 0L, SEEK_SET);
usr.bin/finger/lprint.c
365
if ((fp = fdopen(fd, "r")) == NULL)
usr.bin/finger/util.c
171
static int fd;
usr.bin/finger/util.c
183
fd = open(_PATH_LASTLOG, O_RDONLY, 0);
usr.bin/finger/util.c
196
if (fd == -1 ||
usr.bin/finger/util.c
197
lseek(fd, (off_t)pn->uid * sizeof(ll), SEEK_SET) !=
usr.bin/finger/util.c
199
read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) {
usr.bin/flock/flock.c
156
int fd = -1;
usr.bin/flock/flock.c
226
fd = (int)l;
usr.bin/flock/flock.c
246
if ((fd = open(argv[0], O_RDONLY)) == -1) {
usr.bin/flock/flock.c
248
(fd = open(argv[0], O_RDWR|O_CREAT, 0600)) == -1)
usr.bin/flock/flock.c
290
while (flock(fd, lock) == -1) {
usr.bin/flock/flock.c
294
err(EXIT_FAILURE, "flock(%d, %s)", fd, lock2name(lock));
usr.bin/flock/flock.c
303
(void)close(fd);
usr.bin/ftp/fetch.c
155
int fd = fileno(fp);
usr.bin/ftp/fetch.c
160
if ((n = write(fd, p, size)) == -1) {
usr.bin/ftp/ftp.c
1753
pfd[0].fd = data;
usr.bin/ftp/ftp.c
559
pfd[nfd].fd = fileno(ecin);
usr.bin/ftp/ftp.c
564
pfd[nfd].fd = fileno(din);
usr.bin/ftp/ssl.c
101
int fd = conn->sd;
usr.bin/ftp/ssl.c
105
pfd[0].fd = fd;
usr.bin/ftp/ssl.c
136
len = writev(fd, iov, iovcnt);
usr.bin/ftp/ssl.c
223
int fd = conn->sd;
usr.bin/ftp/ssl.c
227
setsockopt(fd, IPPROTO_TCP, TCP_NOPUSH, &v, sizeof(v));
usr.bin/ftp/ssl.c
230
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &v, sizeof(v));
usr.bin/ftp/ssl.c
240
int fd;
usr.bin/ftp/ssl.c
242
fd = open(fname, O_RDONLY); /* XXX: fmode */
usr.bin/ftp/ssl.c
243
if (fd < 0)
usr.bin/ftp/ssl.c
247
close(fd);
usr.bin/ftp/ssl.c
251
conn->sd = fd;
usr.bin/ftp/ssl.c
363
int fd = conn->sd;
usr.bin/ftp/ssl.c
367
pfd[0].fd = fd;
usr.bin/ftp/ssl.c
672
pfd[0].fd = sock;
usr.bin/ftp/util.c
1394
pfd[0].fd = sock;
usr.bin/ftp/util.c
545
int oldverbose, oldhash, oldprogress, fd;
usr.bin/ftp/util.c
573
if ((fd = mkstemp(temp)) < 0) {
usr.bin/ftp/util.c
577
close(fd);
usr.bin/gencat/gencat.c
128
static void MCParse(int fd);
usr.bin/gencat/gencat.c
129
static void MCReadCat(int fd);
usr.bin/gencat/gencat.c
130
static void MCWriteCat(int fd);
usr.bin/gencat/gencat.c
277
get_line(int fd)
usr.bin/gencat/gencat.c
305
buflen = read(fd, buf, BUFSIZ);
usr.bin/gencat/gencat.c
344
getmsg(int fd, char *cptr, char quote)
usr.bin/gencat/gencat.c
397
cptr = get_line(fd);
usr.bin/gencat/gencat.c
467
MCParse(int fd)
usr.bin/gencat/gencat.c
474
while ((cptr = get_line(fd))) {
usr.bin/gencat/gencat.c
548
str = getmsg(fd, cptr, quote);
usr.bin/gencat/gencat.c
556
MCReadCat(int fd)
usr.bin/gencat/gencat.c
567
n = read(fd, &cat_hdr, sizeof(cat_hdr));
usr.bin/gencat/gencat.c
594
n = read(fd, msgcat, cat_hdr.__mem);
usr.bin/gencat/gencat.c
652
MCWriteCat(int fd)
usr.bin/gencat/gencat.c
749
write(fd, msgcat, msgcat_size);
usr.bin/grep/file.c
110
if (lseek(f->fd, 0, SEEK_SET) == -1)
usr.bin/grep/file.c
112
nr = read(f->fd, buffer, MAXBUFSIZ);
usr.bin/grep/file.c
123
nr = read(f->fd, buffer, MAXBUFSIZ);
usr.bin/grep/file.c
217
(gzbufdesc = gzdopen(f->fd, "r")) == NULL)
usr.bin/grep/file.c
223
(bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL)
usr.bin/grep/file.c
238
close(f->fd);
usr.bin/grep/file.c
256
f->fd = STDIN_FILENO;
usr.bin/grep/file.c
257
} else if ((f->fd = open(path, O_RDONLY)) == -1) {
usr.bin/grep/file.c
272
close(f->fd);
usr.bin/grep/grep.h
85
int fd;
usr.bin/gzip/gzip.c
1117
copymodes(int fd, const struct stat *sbp, const char *file)
usr.bin/gzip/gzip.c
1129
(void)fchmod(fd, DEFFILEMODE & ~mask);
usr.bin/gzip/gzip.c
1136
if (fchown(fd, sb.st_uid, sb.st_gid) < 0) {
usr.bin/gzip/gzip.c
1144
if (fchmod(fd, sb.st_mode) < 0)
usr.bin/gzip/gzip.c
1150
if (futimes(fd, times) < 0)
usr.bin/gzip/gzip.c
1154
if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
usr.bin/gzip/gzip.c
1446
int fd, ofd, zfd = -1;
usr.bin/gzip/gzip.c
1456
fd = open(file, O_RDONLY);
usr.bin/gzip/gzip.c
1457
if (fd < 0) {
usr.bin/gzip/gzip.c
1461
if (fstat(fd, &isb) != 0) {
usr.bin/gzip/gzip.c
1462
close(fd);
usr.bin/gzip/gzip.c
1478
rbytes = read(fd, fourbytes, sizeof fourbytes);
usr.bin/gzip/gzip.c
1506
rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
usr.bin/gzip/gzip.c
1518
rbytes = pread(fd, name, sizeof(name) - 1, GZIP_ORIGNAME);
usr.bin/gzip/gzip.c
1549
lseek(fd, 0, SEEK_SET);
usr.bin/gzip/gzip.c
1591
size = unbzip2(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1605
if ((in = zdopen(fd)) == NULL) {
usr.bin/gzip/gzip.c
1640
size = unpack(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1647
size = unxz_len(fd);
usr.bin/gzip/gzip.c
1651
size = unxz(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1661
size = unzstd(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1671
size = unlz(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1680
size = cat_fd(NULL, 0, NULL, fd);
usr.bin/gzip/gzip.c
1685
print_list(fd, in_size, outfile, isb.st_mtime);
usr.bin/gzip/gzip.c
1686
close(fd);
usr.bin/gzip/gzip.c
1690
size = gz_uncompress(fd, zfd, NULL, 0, NULL, file);
usr.bin/gzip/gzip.c
1694
if (close(fd) != 0)
usr.bin/gzip/gzip.c
1752
if (fd != -1)
usr.bin/gzip/gzip.c
1753
close(fd);
usr.bin/gzip/gzip.c
1755
close(fd);
usr.bin/gzip/gzip.c
1801
cat_fd(unsigned char * prepend, size_t count, off_t *gsizep, int fd)
usr.bin/gzip/gzip.c
1816
rv = read(fd, buf, sizeof buf);
usr.bin/gzip/gzip.c
1820
maybe_warn("read from fd %d", fd);
usr.bin/gzip/gzip.c
1838
handle_fd_decomp(int fd)
usr.bin/gzip/gzip.c
1853
if (fflag == 0 && lflag == 0 && isatty(fd)) {
usr.bin/gzip/gzip.c
1859
if (fstat(fd, &isb) < 0) {
usr.bin/gzip/gzip.c
1878
print_list(fd, in_size, infile, isb.st_mtime);
usr.bin/gzip/gzip.c
1882
bytes_read = read_retry(fd, prebuf, prebuf_len);
usr.bin/gzip/gzip.c
1899
usize = cat_fd(prebuf, bytes_read, &gsize, fd);
usr.bin/gzip/gzip.c
1903
usize = gz_uncompress(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
1908
usize = unbzip2(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
1914
if ((in = zdopen(fd)) == NULL) {
usr.bin/gzip/gzip.c
1926
usize = unpack(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
1932
usize = unxz(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
1938
usize = unzstd(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
1944
usize = unlz(fd, STDOUT_FILENO,
usr.bin/gzip/gzip.c
2062
int fd;
usr.bin/gzip/gzip.c
2064
fd = open(path, O_RDONLY);
usr.bin/gzip/gzip.c
2065
if (fd < 0) {
usr.bin/gzip/gzip.c
2068
handle_fd_decomp(fd);
usr.bin/gzip/gzip.c
2069
close(fd);
usr.bin/gzip/gzip.c
2220
print_list(int fd, off_t out, const char *outfile, time_t ts)
usr.bin/gzip/gzip.c
2242
if (fd == -1) {
usr.bin/gzip/gzip.c
2249
rv = lseek(fd, (off_t)(-8), SEEK_END);
usr.bin/gzip/gzip.c
2254
rv = read(fd, (char *)buf, sizeof(buf));
usr.bin/gzip/gzip.c
2277
if (vflag && fd == -1)
usr.bin/gzip/gzip.c
236
static void handle_fd_decomp(int fd);
usr.bin/gzip/gzip.c
2388
read_retry(int fd, void *buf, size_t sz)
usr.bin/gzip/gzip.c
239
static void print_list(int fd, off_t, const char *, time_t);
usr.bin/gzip/gzip.c
2396
ret = read(fd, cp, left);
usr.bin/gzip/gzip.c
2410
write_retry(int fd, const void *buf, size_t sz)
usr.bin/gzip/gzip.c
2418
ret = write(fd, cp, left);
usr.bin/gzip/gzip.c
267
static off_t cat_fd(unsigned char *, size_t, off_t *, int fd);
usr.bin/gzip/gzip.c
272
static void copymodes(int fd, const struct stat *, const char *file);
usr.bin/gzip/unxz.c
179
io_pread(int fd, io_buf *buf, size_t size, off_t pos)
usr.bin/gzip/unxz.c
183
if (lseek(fd, pos, SEEK_SET) != pos) {
usr.bin/gzip/unxz.c
187
const size_t amount = read(fd, buf, size);
usr.bin/gzip/unxz.c
459
unxz_len(int fd)
usr.bin/gzip/unxz.c
462
if (!parse_indexes(&xfi, fd)) {
usr.bin/gzip/zuncompress.c
172
zdopen(int fd)
usr.bin/gzip/zuncompress.c
197
if ((zs->zs_fp = fdopen(fd, "r")) == NULL) {
usr.bin/ktrace/ktrace.c
232
if ((fd = open(outfile, O_CREAT | O_WRONLY |
usr.bin/ktrace/ktrace.c
236
(void)close(fd);
usr.bin/ktrace/ktrace.c
272
fclear(int fd, int flag)
usr.bin/ktrace/ktrace.c
274
int oflag = fcntl(fd, F_GETFL, 0);
usr.bin/ktrace/ktrace.c
278
if (fcntl(fd, F_SETFL, oflag & ~flag) == -1)
usr.bin/ktrace/ktrace.c
73
static void fclear(int fd, int flag);
usr.bin/ktrace/ktrace.c
83
int block, append, ch, fd, trset, ops, pid, pidset, synclog, trpoints;
usr.bin/ktruss/dump.c
309
dumpfile(const char *file, int fd, int trpoints)
usr.bin/ktruss/dump.c
314
if ((fp = fdopen(fd, "r")) == NULL)
usr.bin/ktruss/dump.c
315
err(EXIT_FAILURE, "fdopen(%d)", fd);
usr.bin/ldd/ldd.c
168
int fd;
usr.bin/ldd/ldd.c
178
fd = open(*argv, O_RDONLY);
usr.bin/ldd/ldd.c
179
if (fd == -1) {
usr.bin/ldd/ldd.c
184
if (elf_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
usr.bin/ldd/ldd.c
192
if (elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
usr.bin/ldd/ldd.c
200
if (elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1) {
usr.bin/ldd/ldd.c
214
close(fd);
usr.bin/ldd/ldd_elfxx.c
100
if (lseek(fd, 0, SEEK_SET) < 0 ||
usr.bin/ldd/ldd_elfxx.c
101
fstat(fd, &st) < 0) {
usr.bin/ldd/ldd_elfxx.c
120
_rtld_objmain = _rtld_map_object(xstrdup(path), fd, &st);
usr.bin/ldd/ldd_elfxx.c
96
ELFNAME(ldd)(int fd, char *prog, char *path, const char *fmt1, const char *fmt2)
usr.bin/login/common.c
135
int fd, nchars;
usr.bin/login/common.c
139
if ((fd = open(fname ? fname : _PATH_MOTDFILE, O_RDONLY, 0)) < 0)
usr.bin/login/common.c
143
while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0)
usr.bin/login/common.c
146
(void)close(fd);
usr.bin/login/common.c
317
int fd;
usr.bin/login/common.c
319
if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
usr.bin/login/common.c
320
(void)lseek(fd, (off_t)(pwd->pw_uid * sizeof(ll)), SEEK_SET);
usr.bin/login/common.c
322
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&
usr.bin/login/common.c
333
(void)lseek(fd, (off_t)(pwd->pw_uid * sizeof(ll)),
usr.bin/login/common.c
341
(void)write(fd, (char *)&ll, sizeof(ll));
usr.bin/login/common.c
342
(void)close(fd);
usr.bin/login/login.c
770
int fd, nchars;
usr.bin/login/login.c
773
if ((fd = open(fname ? fname : _PATH_NOLOGIN, O_RDONLY, 0)) >= 0) {
usr.bin/login/login.c
774
while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0)
usr.bin/look/look.c
100
int ch, fd, termchar;
usr.bin/look/look.c
142
if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
usr.bin/look/look.c
150
PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED)
usr.bin/m4/eval.c
402
int fd;
usr.bin/m4/eval.c
407
fd = mkstemp(temp);
usr.bin/m4/eval.c
408
if (fd == -1)
usr.bin/m4/eval.c
412
close(fd);
usr.bin/m4/eval.c
837
int fd;
usr.bin/m4/eval.c
852
if ((fd = mkstemp(fname)) == -1 ||
usr.bin/m4/eval.c
854
(outfile[n] = fdopen(fd, "w+")) == NULL)
usr.bin/mail/cmd3.c
494
int fd;
usr.bin/mail/cmd3.c
503
if ((fd = mkstemp(mailtempname)) == -1 ||
usr.bin/mail/cmd3.c
504
(obuf = Fdopen(fd, "wef+")) == NULL) {
usr.bin/mail/cmd3.c
505
if (fd != -1)
usr.bin/mail/cmd3.c
506
(void)close(fd);
usr.bin/mail/collect.c
159
int fd;
usr.bin/mail/collect.c
167
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
168
(nf = Fdopen(fd, "wef+")) == NULL) {
usr.bin/mail/collect.c
169
if (fd != -1)
usr.bin/mail/collect.c
170
(void)close(fd);
usr.bin/mail/collect.c
371
int c, fd, t;
usr.bin/mail/collect.c
405
if ((fd = mkstemp(mailtempname)) == -1 ||
usr.bin/mail/collect.c
406
(collf = Fdopen(fd, "wef+")) == NULL) {
usr.bin/mail/collect.c
407
if (fd != -1)
usr.bin/mail/collect.c
408
(void)close(fd);
usr.bin/mail/collect.c
636
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
637
(fbuf = Fdopen(fd, "wef+")) == NULL) {
usr.bin/mail/collect.c
638
if (fd != -1)
usr.bin/mail/collect.c
639
(void)close(fd);
usr.bin/mail/dotlock.c
59
int fd, serrno;
usr.bin/mail/dotlock.c
84
fd = open(path,
usr.bin/mail/dotlock.c
86
if (fd != -1) {
usr.bin/mail/dotlock.c
87
(void)close(fd);
usr.bin/mail/lex.c
107
for (fd = 0; fd <= maxfd; fd++) {
usr.bin/mail/lex.c
110
if (fstat(fd, &sb) != -1)
usr.bin/mail/lex.c
117
warn("fstat(%d): errno=%d", fd, errno);
usr.bin/mail/lex.c
208
int i, fd;
usr.bin/mail/lex.c
281
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/lex.c
282
(otf = fdopen(fd, "wef")) == NULL)
usr.bin/mail/lex.c
98
int fd;
usr.bin/mail/list.c
623
int fd;
usr.bin/mail/list.c
627
if ((fd = mkstemp(tempname)) != -1) {
usr.bin/mail/list.c
629
if ((fp = Fdopen(fd, "wef+")) == NULL)
usr.bin/mail/list.c
630
(void)close(fd);
usr.bin/mail/mime_attach.c
287
content_encoding_by_fileno(int fd, const char *ctype)
usr.bin/mail/mime_attach.c
294
cur_pos = lseek(fd, (off_t)0, SEEK_CUR);
usr.bin/mail/mime_attach.c
295
if ((fd2 = dup(fd)) == -1 ||
usr.bin/mail/mime_attach.c
304
(void)lseek(fd, cur_pos, SEEK_SET);
usr.bin/mail/mime_attach.c
394
content_type_by_fileno(int fd)
usr.bin/mail/mime_attach.c
400
cur_pos = lseek(fd, (off_t)0, SEEK_CUR);
usr.bin/mail/mime_attach.c
403
if (dup2(fd, 0) == -1) /* become stdin */
usr.bin/mail/mime_attach.c
412
(void)lseek(fd, cur_pos, SEEK_SET);
usr.bin/mail/mime_attach.c
566
int fd;
usr.bin/mail/mime_attach.c
571
if ((fd = mkstemp(mailtempname)) == -1 ||
usr.bin/mail/mime_attach.c
572
(fi = Fdopen(fd, "wef+")) == NULL) {
usr.bin/mail/mime_attach.c
573
if (fd != -1)
usr.bin/mail/mime_attach.c
574
(void)close(fd);
usr.bin/mail/mime_attach.c
613
int fd, fd2;
usr.bin/mail/mime_attach.c
616
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/mime_attach.c
617
(*nfo = Fdopen(fd, "wef")) == NULL) {
usr.bin/mail/mime_attach.c
618
if (fd != -1)
usr.bin/mail/mime_attach.c
619
(void)close(fd);
usr.bin/mail/mime_attach.c
624
if ((fd2 = dup(fd)) == -1 ||
usr.bin/mail/mime_attach.c
709
int fd;
usr.bin/mail/mime_attach.c
726
fd = open(canon_name, O_RDONLY, 0);
usr.bin/mail/mime_attach.c
727
if (fd == -1) {
usr.bin/mail/mime_attach.c
732
if (fstat(fd, &sb) == -1) {
usr.bin/mail/mime_attach.c
743
(void)close(fd);
usr.bin/mail/mime_detach.c
124
int fd;
usr.bin/mail/mime_detach.c
128
if ((fd = open(fname, flags | O_CLOEXEC, 0600)) != -1 &&
usr.bin/mail/mime_detach.c
129
Fdopen(fd, "wef") != NULL)
usr.bin/mail/mime_detach.c
132
if (detach_ctl.ask && fd == -1 && errno == EEXIST) {
usr.bin/mail/mime_detach.c
170
if (fd != -1)
usr.bin/mail/mime_detach.c
171
(void)close(fd);
usr.bin/mail/names.c
248
int c, fd;
usr.bin/mail/names.c
291
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/names.c
292
(fout = Fdopen(fd, "aef")) == NULL) {
usr.bin/mail/names.c
293
if (fd != -1)
usr.bin/mail/names.c
294
(void)close(fd);
usr.bin/mail/popen.c
135
Fdopen(int fd, const char *mode)
usr.bin/mail/popen.c
139
if ((fp = fdopen(fd, mode)) != NULL)
usr.bin/mail/quit.c
145
int fd;
usr.bin/mail/quit.c
178
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
179
(obuf = Fdopen(fd, "wef")) == NULL) {
usr.bin/mail/quit.c
181
if (fd != -1)
usr.bin/mail/quit.c
182
(void)close(fd);
usr.bin/mail/quit.c
271
int c, fd;
usr.bin/mail/quit.c
326
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
327
(rbuf = Fdopen(fd, "wef")) == NULL) {
usr.bin/mail/quit.c
328
if (fd != -1)
usr.bin/mail/quit.c
329
(void)close(fd);
usr.bin/mail/quit.c
432
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
433
(obuf = Fdopen(fd, "wef")) == NULL) {
usr.bin/mail/quit.c
435
if (fd != -1)
usr.bin/mail/quit.c
436
(void)close(fd);
usr.bin/mail/quit.c
464
if ((fd = creat(mbox, 0600)) != -1)
usr.bin/mail/quit.c
465
(void)close(fd);
usr.bin/mail/send.c
484
int c, fd;
usr.bin/mail/send.c
489
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/send.c
490
(nfo = Fdopen(fd, "wef")) == NULL) {
usr.bin/mail/send.c
491
if (fd != -1)
usr.bin/mail/send.c
492
(void)close(fd);
usr.bin/mail/v7.local.c
74
int fd;
usr.bin/mail/v7.local.c
81
if ((fd = creat(mailname, 0600)) != -1)
usr.bin/mail/v7.local.c
82
(void)close(fd);
usr.bin/make/arch.c
968
int fd;
usr.bin/make/arch.c
971
if ((fd = open(gn->path, O_RDONLY)) == -1)
usr.bin/make/arch.c
973
isLib = read(fd, buf, sizeof buf) == sizeof buf
usr.bin/make/arch.c
975
(void)close(fd);
usr.bin/make/filemon/filemon_dev.c
101
(void)close(fd);
usr.bin/make/filemon/filemon_dev.c
118
return ioctl(F->fd, FILEMON_SET_PID, &pid);
usr.bin/make/filemon/filemon_dev.c
136
(void)ioctl(F->fd, FILEMON_FLUSH_IOCTL);
usr.bin/make/filemon/filemon_dev.c
140
if (close(F->fd) == -1 && error == 0)
usr.bin/make/filemon/filemon_dev.c
54
int fd;
usr.bin/make/filemon/filemon_dev.c
77
for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR|O_CLOEXEC)) == -1; i++) {
usr.bin/make/filemon/filemon_dev.c
93
filemon_setfd(struct filemon *F, int fd)
usr.bin/make/filemon/filemon_dev.c
97
if (ioctl(F->fd, FILEMON_SET_FD, &fd) == -1)
usr.bin/make/filemon/filemon_ktrace.c
282
filemon_setfd(struct filemon *F, int fd)
usr.bin/make/filemon/filemon_ktrace.c
294
if ((F->out = fdopen(fd, "a")) == NULL)
usr.bin/make/filemon/filemon_ktrace.c
834
int flags, fd;
usr.bin/make/filemon/filemon_ktrace.c
843
fd = (int)args[0];
usr.bin/make/filemon/filemon_ktrace.c
846
if (fd == AT_CWD) {
usr.bin/make/job.c
1372
int fd;
usr.bin/make/job.c
1380
fd = open(file, O_RDWR | O_CREAT, 0666);
usr.bin/make/job.c
1381
if (fd < 0) {
usr.bin/make/job.c
1393
if (read(fd, &c, 1) == 1) {
usr.bin/make/job.c
1394
(void)lseek(fd, 0, SEEK_SET);
usr.bin/make/job.c
1395
while (write(fd, &c, 1) == -1 && errno == EAGAIN)
usr.bin/make/job.c
1398
(void)close(fd); /* XXX: What about propagating the error? */
usr.bin/make/job.c
140
int fd;
usr.bin/make/job.c
1706
int fd;
usr.bin/make/job.c
1708
fd = Job_TempFile(NULL, fname, sizeof fname);
usr.bin/make/job.c
1710
job->cmdFILE = fdopen(fd, "w+");
usr.bin/make/job.c
1714
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
usr.bin/make/job.c
2553
fds[fdsLen].fd = job->inPipe;
usr.bin/make/job.c
2560
fds[fdsLen].fd = meta_job_fd(job);
usr.bin/make/job.c
2561
fds[fdsLen].events = fds[fdsLen].fd == -1 ? 0 : POLLIN;
usr.bin/make/job.c
2602
int fd;
usr.bin/make/job.c
2606
fd = mkTempFile(pattern, tfile, tfile_sz);
usr.bin/make/job.c
2611
return fd;
usr.bin/make/job.c
2769
emul_poll(struct pollfd *fd, int nfd, int timeout)
usr.bin/make/job.c
2781
fd[i].revents = 0;
usr.bin/make/job.c
2783
if (fd[i].events & POLLIN)
usr.bin/make/job.c
2784
FD_SET(fd[i].fd, &rfds);
usr.bin/make/job.c
2786
if (fd[i].events & POLLOUT)
usr.bin/make/job.c
2787
FD_SET(fd[i].fd, &wfds);
usr.bin/make/job.c
2789
if (fd[i].fd > maxfd)
usr.bin/make/job.c
2790
maxfd = fd[i].fd;
usr.bin/make/job.c
2814
if (FD_ISSET(fd[i].fd, &rfds))
usr.bin/make/job.c
2815
fd[i].revents |= POLLIN;
usr.bin/make/job.c
2817
if (FD_ISSET(fd[i].fd, &wfds))
usr.bin/make/job.c
2818
fd[i].revents |= POLLOUT;
usr.bin/make/job.c
2820
if (fd[i].revents)
usr.bin/make/job.c
626
SetNonblocking(int fd)
usr.bin/make/job.c
628
int flags = fcntl(fd, F_GETFL, 0);
usr.bin/make/job.c
632
if (fcntl(fd, F_SETFL, flags) == -1)
usr.bin/make/job.c
637
SetCloseOnExec(int fd)
usr.bin/make/job.c
639
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
usr.bin/make/job.c
654
int fd = fcntl(pipe_fds[i], F_DUPFD, minfd);
usr.bin/make/job.c
655
if (fd != -1) {
usr.bin/make/job.c
657
pipe_fds[i] = fd;
usr.bin/make/job.c
694
WriteOrDie(int fd, char ch)
usr.bin/make/job.c
696
if (write(fd, &ch, 1) != 1)
usr.bin/make/main.c
1634
int fd;
usr.bin/make/main.c
1648
fd = open(path, O_RDONLY);
usr.bin/make/main.c
1649
if (fd != -1) {
usr.bin/make/main.c
1658
fd = open(path, O_RDONLY);
usr.bin/make/main.c
1659
if (fd != -1) {
usr.bin/make/main.c
1667
fd = open(path, O_RDONLY);
usr.bin/make/main.c
1668
if (fd != -1) {
usr.bin/make/main.c
1673
fd = open(fname, O_RDONLY);
usr.bin/make/main.c
1674
if (fd != -1)
usr.bin/make/main.c
1684
if (name == NULL || (fd = open(name, O_RDONLY)) == -1) {
usr.bin/make/main.c
1698
Parse_File(fname, fd);
usr.bin/make/main.c
1959
write_all(int fd, const void *data, size_t n)
usr.bin/make/main.c
1964
ssize_t written = write(fd, mem, n);
usr.bin/make/main.c
2195
int fd;
usr.bin/make/main.c
2211
if ((fd = mkstemp(tfile)) < 0)
usr.bin/make/main.c
2216
return fd;
usr.bin/make/meta.c
160
filemon_read(FILE *mfp, int fd)
usr.bin/make/meta.c
167
if (fd >= 0)
usr.bin/make/meta.c
168
close(fd); /* not interested */
usr.bin/make/meta.c
172
if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
usr.bin/make/meta.c
182
while ((n = read(fd, buf, sizeof buf)) > 0) {
usr.bin/make/meta.c
190
if (close(fd) < 0)
usr.bin/make/parse.c
1303
int fd;
usr.bin/make/parse.c
1325
if ((fd = open(fullname, O_RDONLY)) == -1) {
usr.bin/make/parse.c
1331
buf = LoadFile(fullname, fd);
usr.bin/make/parse.c
1332
(void)close(fd);
usr.bin/make/parse.c
2917
Parse_File(const char *name, int fd)
usr.bin/make/parse.c
2922
buf = LoadFile(name, fd != -1 ? fd : STDIN_FILENO);
usr.bin/make/parse.c
2923
if (fd != -1)
usr.bin/make/parse.c
2924
(void)close(fd);
usr.bin/make/parse.c
347
LoadFile(const char *path, int fd)
usr.bin/make/parse.c
354
bufSize = fstat(fd, &st) == 0 && S_ISREG(st.st_mode) &&
usr.bin/make/parse.c
368
n = read(fd, buf.data + buf.len, buf.cap - buf.len);
usr.bin/man/man.c
753
int olddir, fd, n;
usr.bin/man/man.c
813
if ((fd = mkstemp(tpath)) == -1) {
usr.bin/man/man.c
821
(void)close(fd);
usr.bin/man/man.c
897
int fd;
usr.bin/man/man.c
901
if ((fd = open(fname, O_RDONLY, 0)) < 0) {
usr.bin/man/man.c
906
while ((n = read(fd, buf, sizeof(buf))) > 0)
usr.bin/man/man.c
917
(void)close(fd);
usr.bin/midiplay/midiplay.c
172
static int fd = -1;
usr.bin/midiplay/midiplay.c
186
write(fd, ev, sizeof *ev);
usr.bin/midiplay/midiplay.c
414
if (play && ioctl(fd, SEQUENCER_INFO, &info) < 0)
usr.bin/midiplay/midiplay.c
505
if (ioctl(fd, SEQUENCER_TMR_TIMEBASE, &(int){ticks}) < 0)
usr.bin/midiplay/midiplay.c
518
if (ioctl(fd, SEQUENCER_TMR_TIMEBASE, &(int){5*ticks}) < 0)
usr.bin/midiplay/midiplay.c
697
if (play && ioctl(fd, SEQUENCER_SYNC, 0) < 0)
usr.bin/midiplay/midiplay.c
783
fd = open(file, O_WRONLY);
usr.bin/midiplay/midiplay.c
784
if (fd < 0)
usr.bin/midiplay/midiplay.c
786
if (ioctl(fd, SEQUENCER_NRMIDIS, &nmidi) < 0)
usr.bin/midiplay/midiplay.c
792
if (ioctl(fd, SEQUENCER_INFO, &info) < 0)
usr.bin/mixerctl/mixerctl.c
257
wrarg(int fd, char *arg, const char *sep)
usr.bin/mixerctl/mixerctl.c
301
if (ioctl(fd, AUDIO_MIXER_WRITE, p->valp) == -1)
usr.bin/mixerctl/mixerctl.c
306
if (ioctl(fd, AUDIO_MIXER_READ, p->valp) == -1)
usr.bin/mixerctl/mixerctl.c
316
prarg(int fd, char *arg, const char *sep)
usr.bin/mixerctl/mixerctl.c
341
int fd, i, j, ch, pos;
usr.bin/mixerctl/mixerctl.c
382
fd = open(file, O_RDWR);
usr.bin/mixerctl/mixerctl.c
384
if (fd == -1 && file == mixer_path) {
usr.bin/mixerctl/mixerctl.c
386
fd = open(file, O_RDWR);
usr.bin/mixerctl/mixerctl.c
389
if (fd == -1)
usr.bin/mixerctl/mixerctl.c
394
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) == -1)
usr.bin/mixerctl/mixerctl.c
404
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &infos[i]) == -1)
usr.bin/mixerctl/mixerctl.c
419
if (ioctl(fd, AUDIO_MIXER_READ, &values[i]) == -1) {
usr.bin/mixerctl/mixerctl.c
421
if (ioctl(fd, AUDIO_MIXER_READ, &values[i])
usr.bin/mixerctl/mixerctl.c
458
wrarg(fd, *argv, sep);
usr.bin/mixerctl/mixerctl.c
460
prarg(fd, *argv, sep);
usr.bin/mkdep/mkdep.c
220
int fd;
usr.bin/mkdep/mkdep.c
331
fd = open(fname, O_RDONLY, 0);
usr.bin/mkdep/mkdep.c
332
if (fd == -1) {
usr.bin/mkdep/mkdep.c
338
fd = run_cc(argc, argv, &fname);
usr.bin/mkdep/mkdep.c
343
sz = lseek(fd, 0, SEEK_END);
usr.bin/mkdep/mkdep.c
345
close(fd);
usr.bin/mkdep/mkdep.c
348
buf = mmap(NULL, sz, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
usr.bin/mkdep/mkdep.c
349
close(fd);
usr.bin/mkdep/mkdep.c
529
write_optional(int fd, opt_t *node, size_t depth)
usr.bin/mkdep/mkdep.c
534
d1 = write_optional(fd, node->left, d1);
usr.bin/mkdep/mkdep.c
536
if (write(fd, " \\\n ", 4) < 0)
usr.bin/mkdep/mkdep.c
541
if (write(fd, node->name, 1 + node->len) < 0)
usr.bin/mkdep/mkdep.c
544
depth = write_optional(fd, node->right, depth);
usr.bin/mktemp/mktemp.c
148
fd = mkstemp(name);
usr.bin/mktemp/mktemp.c
149
if (fd < 0) {
usr.bin/mktemp/mktemp.c
154
(void)close(fd);
usr.bin/mktemp/mktemp.c
61
int c, fd, ret;
usr.bin/msgs/msgs.c
787
int fd;
usr.bin/msgs/msgs.c
790
fd = mkstemp(fname);
usr.bin/msgs/msgs.c
791
if (fd == -1)
usr.bin/msgs/msgs.c
793
close(fd);
usr.bin/nc/atomicio.c
41
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
usr.bin/nc/atomicio.c
48
pfd.fd = fd;
usr.bin/nc/atomicio.c
51
res = (f) (fd, s + pos, n - pos);
usr.bin/nc/netcat.c
1019
pfd.fd = s;
usr.bin/nc/netcat.c
1116
pfd[POLL_STDIN].fd = stdin_fd;
usr.bin/nc/netcat.c
1120
pfd[POLL_NETOUT].fd = net_fd;
usr.bin/nc/netcat.c
1124
pfd[POLL_NETIN].fd = net_fd;
usr.bin/nc/netcat.c
1128
pfd[POLL_STDOUT].fd = stdout_fd;
usr.bin/nc/netcat.c
1133
if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 &&
usr.bin/nc/netcat.c
1139
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
1172
pfd[n].fd = -1;
usr.bin/nc/netcat.c
1179
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1184
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1188
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
usr.bin/nc/netcat.c
1189
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1193
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1195
if (pfd[POLL_NETOUT].fd == -1)
usr.bin/nc/netcat.c
1196
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1198
if (pfd[POLL_STDOUT].fd == -1) {
usr.bin/nc/netcat.c
1199
if (pfd[POLL_NETIN].fd != -1)
usr.bin/nc/netcat.c
1200
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
usr.bin/nc/netcat.c
1201
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1207
ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf,
usr.bin/nc/netcat.c
1214
pfd[POLL_STDIN].fd = -1;
usr.bin/nc/netcat.c
1225
ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf,
usr.bin/nc/netcat.c
1232
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1246
ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf,
usr.bin/nc/netcat.c
1253
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1256
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
usr.bin/nc/netcat.c
1257
pfd[POLL_NETIN].fd = -1;
usr.bin/nc/netcat.c
1267
atelnet(pfd[POLL_NETIN].fd, netinbuf,
usr.bin/nc/netcat.c
1274
ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf,
usr.bin/nc/netcat.c
1281
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1291
if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) {
usr.bin/nc/netcat.c
1292
if (pfd[POLL_NETOUT].fd != -1 && Nflag)
usr.bin/nc/netcat.c
1293
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
usr.bin/nc/netcat.c
1294
pfd[POLL_NETOUT].fd = -1;
usr.bin/nc/netcat.c
1297
if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) {
usr.bin/nc/netcat.c
1298
pfd[POLL_STDOUT].fd = -1;
usr.bin/nc/netcat.c
1302
if (pfd[POLL_NETOUT].fd != -1 && Nflag)
usr.bin/nc/netcat.c
1303
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
usr.bin/nc/netcat.c
1308
drainbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls)
usr.bin/nc/netcat.c
1319
n = write(fd, buf, *bufpos);
usr.bin/nc/netcat.c
1335
fillbuf(int fd, unsigned char *buf, size_t *bufpos, struct tls *tls)
usr.bin/nc/netcat.c
1347
n = read(fd, buf + *bufpos, num);
usr.bin/nc/netcat.c
1398
pfd.fd = STDOUT_FILENO;
usr.bin/nc/netcat.c
472
int fd;
usr.bin/nc/netcat.c
477
if ((fd = mkstemp(unix_dg_tmp_socket_buf)) == -1)
usr.bin/nc/netcat.c
479
close(fd);
usr.bin/nc/socks.c
102
if (atomicio(read, fd, buf + off, 1) != 1)
usr.bin/nc/socks.c
95
proxy_read_line(int fd, char *buf, size_t bufsz)
usr.bin/newsyslog/newsyslog.c
161
FILE *fd;
usr.bin/newsyslog/newsyslog.c
210
fd = stdin;
usr.bin/newsyslog/newsyslog.c
211
else if ((fd = fopen(cfile, "rt")) == NULL)
usr.bin/newsyslog/newsyslog.c
214
for (lineno = 0; !parse_cfgline(&log, fd, &lineno);) {
usr.bin/newsyslog/newsyslog.c
229
if (fd != stdin)
usr.bin/newsyslog/newsyslog.c
230
(void)fclose(fd);
usr.bin/newsyslog/newsyslog.c
240
parse_cfgline(struct conf_entry *log, FILE *fd, size_t *_lineno)
usr.bin/newsyslog/newsyslog.c
255
if ((line = fparseln(fd, NULL, _lineno, NULL, 0)) == NULL)
usr.bin/newsyslog/newsyslog.c
656
FILE *fd;
usr.bin/newsyslog/newsyslog.c
666
if ((fd = fopen(log->logfile, "r")) == NULL)
usr.bin/newsyslog/newsyslog.c
670
line = fgetln(fd, &linelen);
usr.bin/newsyslog/newsyslog.c
671
if ((line = fgetln(fd, &linelen)) != NULL
usr.bin/newsyslog/newsyslog.c
674
(void)fclose(fd);
usr.bin/newsyslog/newsyslog.c
683
FILE *fd;
usr.bin/newsyslog/newsyslog.c
694
if ((fd = fopen(log->logfile, "at")) == NULL)
usr.bin/newsyslog/newsyslog.c
710
(void)fprintf(fd, "%s %s newsyslog[%lu]: %s\n",
usr.bin/newsyslog/newsyslog.c
741
(void)fprintf(fd, "%s %s newsyslog %lu - - %s\n",
usr.bin/newsyslog/newsyslog.c
745
(void)fclose(fd);
usr.bin/newsyslog/newsyslog.c
754
int fd;
usr.bin/newsyslog/newsyslog.c
759
if ((fd = creat(log->logfile, log->mode)) < 0)
usr.bin/newsyslog/newsyslog.c
761
if (fchown(fd, log->uid, log->gid) < 0)
usr.bin/newsyslog/newsyslog.c
763
(void)close(fd);
usr.bin/newsyslog/newsyslog.c
858
FILE *fd;
usr.bin/newsyslog/newsyslog.c
869
if ((fd = fopen(file, "r")) == NULL) {
usr.bin/newsyslog/newsyslog.c
874
if (fgets(line, sizeof(line) - 1, fd) != NULL) {
usr.bin/newsyslog/newsyslog.c
882
(void)fclose(fd);
usr.bin/nohup/nohup.c
102
int fd;
usr.bin/nohup/nohup.c
117
if ((fd = open(p, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0)
usr.bin/nohup/nohup.c
123
if ((fd = open(p = path, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0)
usr.bin/nohup/nohup.c
129
dupit: (void)lseek(fd, 0L, SEEK_END);
usr.bin/nohup/nohup.c
130
if (dup2(fd, STDOUT_FILENO) == -1) {
usr.bin/patch/patch.c
156
int error = 0, hunk, failed, i, fd;
usr.bin/patch/patch.c
178
if ((fd = mkstemp(TMPOUTNAME)) < 0)
usr.bin/patch/patch.c
180
close(fd);
usr.bin/patch/patch.c
184
if ((fd = mkstemp(TMPINNAME)) < 0)
usr.bin/patch/patch.c
186
close(fd);
usr.bin/patch/patch.c
190
if ((fd = mkstemp(TMPREJNAME)) < 0)
usr.bin/patch/patch.c
192
close(fd);
usr.bin/patch/patch.c
196
if ((fd = mkstemp(TMPPATNAME)) < 0)
usr.bin/patch/patch.c
198
close(fd);
usr.bin/pmap/main.c
362
check_fd(int fd)
usr.bin/pmap/main.c
367
if (fstat(fd, &st) == -1) {
usr.bin/pmap/main.c
368
(void)close(fd);
usr.bin/pmap/main.c
370
if (n == fd || n == -1)
usr.bin/pmap/main.c
374
(void)dup2(n, fd);
usr.bin/progress/progress.c
134
if (infile && (fd = open(infile, O_RDONLY, 0)) < 0)
usr.bin/progress/progress.c
138
if (!zflag && !lflag && (fstat(fd, &statb) == 0)) {
usr.bin/progress/progress.c
184
dup2(gzippipe[0], fd);
usr.bin/progress/progress.c
189
dup2(fd, STDIN_FILENO);
usr.bin/progress/progress.c
232
nr = read(fd, fb_buf, buffersize);
usr.bin/progress/progress.c
84
int ch, fd, outpipe[2];
usr.bin/progress/progress.c
95
fd = STDIN_FILENO;
usr.bin/qsubst/qsubst.c
543
int fd;
usr.bin/qsubst/qsubst.c
544
fd = mkstemp(&tmp[0]);
usr.bin/qsubst/qsubst.c
545
if (fd < 0) {
usr.bin/qsubst/qsubst.c
550
tempf = fdopen(fd, "w+");
usr.bin/radioctl/radioctl.c
208
do_ioctls(int fd, struct opt_t *o, int silent)
usr.bin/radioctl/radioctl.c
212
if (fd < 0 || o == NULL)
usr.bin/radioctl/radioctl.c
229
if (ioctl(fd, RIOCSSRCH, &o->value) < 0) {
usr.bin/radioctl/radioctl.c
237
if (ioctl(fd, RIOCSINFO, &ri) < 0) {
usr.bin/radioctl/radioctl.c
244
if (ioctl(fd, RIOCGINFO, &ri) < 0) {
usr.bin/rdist/docmd.c
527
int fd, len;
usr.bin/rdist/docmd.c
548
if ((fd = open(file, 0)) < 0) {
usr.bin/rdist/docmd.c
552
if (fstat(fd, &stb) < 0) {
usr.bin/rdist/docmd.c
554
(void) close(fd);
usr.bin/rdist/docmd.c
558
(void) close(fd);
usr.bin/rdist/docmd.c
568
(void) close(fd);
usr.bin/rdist/docmd.c
596
while ((len = read(fd, buf, BUFSIZ)) > 0)
usr.bin/rdist/docmd.c
599
(void) close(fd);
usr.bin/rdist/main.c
201
fd = mkstemp(tempfile);
usr.bin/rdist/main.c
202
if (fd == -1)
usr.bin/rdist/main.c
204
close (fd);
usr.bin/rdist/main.c
92
int fd;
usr.bin/rdist/server.c
1076
fchtogm(int fd, char *file, time_t mtime, char *owner, char *group, __mode_t mode)
usr.bin/rdist/server.c
1129
if (fd != -1 ? futimes(fd, tv) < 0 : utimes(file, tv) < 0)
usr.bin/rdist/server.c
1131
if (fd != -1 ? fchown(fd, uid, gid) < 0 : chown(file, uid, gid) < 0)
usr.bin/rdist/server.c
1134
(fd != -1 ? fchmod(fd, mode) < 0 : chmod(file, mode) < 0))
usr.bin/rdist/server.c
1369
int fd[2], status, pid, i;
usr.bin/rdist/server.c
1373
if (pipe(fd) < 0) {
usr.bin/rdist/server.c
1385
(void) dup(fd[1]);
usr.bin/rdist/server.c
1386
(void) dup(fd[1]);
usr.bin/rdist/server.c
1387
(void) close(fd[0]);
usr.bin/rdist/server.c
1388
(void) close(fd[1]);
usr.bin/rdist/server.c
1394
(void) close(fd[1]);
usr.bin/rdist/server.c
1397
while ((i = read(fd[0], buf, sizeof(buf))) > 0) {
usr.bin/rdist/server.c
1425
(void) close(fd[0]);
usr.bin/resize/resize.h
61
#define SET_TTYSIZE(fd, ws) ioctl((fd), TIOCSWINSZ, &(ws))
usr.bin/rfcomm_sppd/rfcomm_sppd.c
266
pfd[0].fd = tty_in;
usr.bin/rfcomm_sppd/rfcomm_sppd.c
267
pfd[1].fd = rfcomm;
usr.bin/rfcomm_sppd/rfcomm_sppd.c
343
int fd;
usr.bin/rfcomm_sppd/rfcomm_sppd.c
380
fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
usr.bin/rfcomm_sppd/rfcomm_sppd.c
381
if (fd == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
384
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
390
if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
393
if (setsockopt(fd, BTPROTO_RFCOMM, SO_RFCOMM_LM, &lm, sizeof(lm)) == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
400
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
404
return fd;
usr.bin/rfcomm_sppd/rfcomm_sppd.c
418
int sv, fd;
usr.bin/rfcomm_sppd/rfcomm_sppd.c
528
fd = accept(sv, (struct sockaddr *)&sa, &len);
usr.bin/rfcomm_sppd/rfcomm_sppd.c
529
if (fd == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
535
if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) == -1)
usr.bin/rfcomm_sppd/rfcomm_sppd.c
539
return fd;
usr.bin/rlogin/rlogin.c
102
#define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp)
usr.bin/rlogin/rlogin.c
782
get_window_size(int fd, struct winsize *wp)
usr.bin/rpcinfo/rpcinfo.c
1258
static int fd = RPC_ANYFD;
usr.bin/rpcinfo/rpcinfo.c
1260
if (fd == RPC_ANYFD) {
usr.bin/rpcinfo/rpcinfo.c
1261
if ((fd = __rpc_nconf2fd(nconf)) == -1) {
usr.bin/rpcinfo/rpcinfo.c
1271
client = clnt_tli_create(fd, nconf, nbuf, prog, vers, 0, 0);
usr.bin/rpcinfo/rpcinfo.c
1295
int fd;
usr.bin/rpcinfo/rpcinfo.c
1328
(void)CLNT_CONTROL(client, CLGET_FD, (char *)(void *)&fd);
usr.bin/rpcinfo/rpcinfo.c
1372
(void)close(fd);
usr.bin/rpcinfo/rpcinfo.c
375
int fd = RPC_ANYFD;
usr.bin/rpcinfo/rpcinfo.c
399
client = clnt_com_create(&addr, prognum, vers, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
423
MAX_VERS, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
450
client = clnt_com_create(&addr, prognum, vers, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
459
(void)close(fd);
usr.bin/rsh/rsh.c
315
nr = read(fdp->fd, buf, sizeof buf);
usr.bin/rsh/rsh.c
346
fdp->fd = rem;
usr.bin/rsh/rsh.c
403
fds[0].fd = 2;
usr.bin/rsh/rsh.c
408
fds[1].fd = remerr;
usr.bin/rsh/rsh.c
409
fds[2].fd = rem;
usr.bin/rump_allserver/rump_allserver.c
431
int fd, oflags;
usr.bin/rump_allserver/rump_allserver.c
434
fd = open(etfs[i].hostpath, O_RDWR | oflags, 0644);
usr.bin/rump_allserver/rump_allserver.c
435
if (fd == -1)
usr.bin/rump_allserver/rump_allserver.c
439
processlabel(sflag, fd, etfs[i].partition - 'a',
usr.bin/rump_allserver/rump_allserver.c
446
if (fstat(fd, &sb) == -1)
usr.bin/rump_allserver/rump_allserver.c
456
if (ftruncate(fd, fendoff) == -1)
usr.bin/rump_allserver/rump_allserver.c
459
close(fd);
usr.bin/rump_allserver/rump_allserver.c
765
processlabel(int sflag, int fd, int partition, off_t *foffp, off_t *flenp)
usr.bin/rump_allserver/rump_allserver.c
772
if (pread(fd, buf, sizeof(buf), 0) == -1)
usr.bin/rump_dhcpclient/bpf.c
106
if (rump_sys_ioctl(fd, BIOCIMMEDIATE, &flags) == -1)
usr.bin/rump_dhcpclient/bpf.c
120
if (rump_sys_ioctl(fd, BIOCSETF, &pf) == -1)
usr.bin/rump_dhcpclient/bpf.c
125
*fdp = fd;
usr.bin/rump_dhcpclient/bpf.c
127
return fd;
usr.bin/rump_dhcpclient/bpf.c
132
rump_sys_close(fd);
usr.bin/rump_dhcpclient/bpf.c
142
int fd;
usr.bin/rump_dhcpclient/bpf.c
152
fd = iface->arp_fd;
usr.bin/rump_dhcpclient/bpf.c
154
fd = iface->raw_fd;
usr.bin/rump_dhcpclient/bpf.c
155
return rump_sys_writev(fd, iov, 2);
usr.bin/rump_dhcpclient/bpf.c
164
int fd = -1;
usr.bin/rump_dhcpclient/bpf.c
170
fd = iface->arp_fd;
usr.bin/rump_dhcpclient/bpf.c
172
fd = iface->raw_fd;
usr.bin/rump_dhcpclient/bpf.c
176
bytes = rump_sys_read(fd, iface->buffer, iface->buffer_size);
usr.bin/rump_dhcpclient/bpf.c
55
int fd = -1;
usr.bin/rump_dhcpclient/bpf.c
65
fd = rump_sys_open(_PATH_BPF, O_RDWR | O_NONBLOCK);
usr.bin/rump_dhcpclient/bpf.c
73
fd = rump_sys_open(device, O_RDWR | O_NONBLOCK);
usr.bin/rump_dhcpclient/bpf.c
74
} while (fd == -1 && errno == EBUSY);
usr.bin/rump_dhcpclient/bpf.c
78
if (fd == -1)
usr.bin/rump_dhcpclient/bpf.c
81
if (rump_sys_ioctl(fd, BIOCVERSION, &pv) == -1)
usr.bin/rump_dhcpclient/bpf.c
91
if (rump_sys_ioctl(fd, BIOCSETIF, &ifr) == -1)
usr.bin/rump_dhcpclient/bpf.c
95
if (rump_sys_ioctl(fd, BIOCGBLEN, &buf_len) == -1)
usr.bin/rump_dhcpclient/main.c
136
pfd.fd = ifp->raw_fd;
usr.bin/ruptime/ruptime.c
127
if ((fd = open(dp->d_name, O_RDONLY, 0)) < 0) {
usr.bin/ruptime/ruptime.c
131
cc = read(fd, buf, sizeof(struct whod));
usr.bin/ruptime/ruptime.c
132
(void)close(fd);
usr.bin/ruptime/ruptime.c
87
int aflg, cc, ch, fd, maxloadav;
usr.bin/rwall/rwall.c
159
int fd;
usr.bin/rwall/rwall.c
165
if ((fd = mkstemp(tmpname)) == -1 || (fp = fdopen(fd, "r+")) == NULL)
usr.bin/rwall/rwall.c
199
if (fstat(fd, &sbuf) == -1)
usr.bin/rwall/rwall.c
206
(void)close(fd);
usr.bin/scmdctl/common.c
113
common_get_motor(struct function_block *fb, int fd, bool debug, int a_module, struct scmd_motor_response *r)
usr.bin/scmdctl/common.c
122
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
124
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_DRIVER_ENABLE, SCMD_REG_DRIVER_ENABLE, &b);
usr.bin/scmdctl/common.c
134
err = (*(fb->func_phy_read))(fd, debug, 0, n, n, &b);
usr.bin/scmdctl/common.c
143
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_MOTOR_A_INVERT, SCMD_REG_MOTOR_A_INVERT, &b);
usr.bin/scmdctl/common.c
146
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_MOTOR_B_INVERT, SCMD_REG_MOTOR_B_INVERT, &b);
usr.bin/scmdctl/common.c
154
err = (*(fb->func_phy_read))(fd, debug, 0, n, n, &b);
usr.bin/scmdctl/common.c
166
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_BRIDGE, SCMD_REG_BRIDGE, &b);
usr.bin/scmdctl/common.c
174
err = (*(fb->func_phy_read))(fd, debug, 0, n, n, &b);
usr.bin/scmdctl/common.c
189
common_set_motor(struct function_block *fb, int fd, bool debug, int a_module, char a_motor, int8_t reg_v)
usr.bin/scmdctl/common.c
201
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
210
err = (*(fb->func_phy_write))(fd, debug, 0, reg, reg_v);
usr.bin/scmdctl/common.c
217
common_invert_motor(struct function_block *fb, int fd, bool debug, int a_module, char a_motor)
usr.bin/scmdctl/common.c
224
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
232
err = (*(fb->func_phy_read))(fd, debug, 0, reg, reg, &b);
usr.bin/scmdctl/common.c
235
err = (*(fb->func_phy_write))(fd, debug, 0, reg, b);
usr.bin/scmdctl/common.c
247
err = (*(fb->func_phy_read))(fd, debug, 0, reg, reg, &b);
usr.bin/scmdctl/common.c
250
err = (*(fb->func_phy_write))(fd, debug, 0, reg, b);
usr.bin/scmdctl/common.c
259
common_bridge_motor(struct function_block *fb, int fd, bool debug, int a_module)
usr.bin/scmdctl/common.c
266
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
269
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_BRIDGE, SCMD_REG_BRIDGE, &b);
usr.bin/scmdctl/common.c
272
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_BRIDGE, b);
usr.bin/scmdctl/common.c
282
err = (*(fb->func_phy_read))(fd, debug, 0, reg, reg, &b);
usr.bin/scmdctl/common.c
285
err = (*(fb->func_phy_write))(fd, debug, 0, reg, b);
usr.bin/scmdctl/common.c
294
common_enable_disable(struct function_block *fb, int fd, bool debug, int subcmd)
usr.bin/scmdctl/common.c
302
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
314
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_DRIVER_ENABLE, reg_v);
usr.bin/scmdctl/common.c
324
common_control_1(struct function_block *fb, int fd, bool debug, int subcmd)
usr.bin/scmdctl/common.c
332
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
344
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_CONTROL_1, reg_v);
usr.bin/scmdctl/common.c
351
common_get_update_rate(struct function_block *fb, int fd, bool debug, uint8_t *rate)
usr.bin/scmdctl/common.c
356
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
358
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_UPDATE_RATE, SCMD_REG_UPDATE_RATE, &b);
usr.bin/scmdctl/common.c
367
common_set_update_rate(struct function_block *fb, int fd, bool debug, uint8_t rate)
usr.bin/scmdctl/common.c
371
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
373
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_UPDATE_RATE, rate);
usr.bin/scmdctl/common.c
380
common_force_update(struct function_block *fb, int fd, bool debug)
usr.bin/scmdctl/common.c
384
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
386
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_FORCE_UPDATE, 0x01);
usr.bin/scmdctl/common.c
393
common_get_ebus_speed(struct function_block *fb, int fd, bool debug, uint8_t *speed)
usr.bin/scmdctl/common.c
398
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
400
err = (*(fb->func_phy_read))(fd, debug, 0, SCMD_REG_E_BUS_SPEED, SCMD_REG_E_BUS_SPEED, &b);
usr.bin/scmdctl/common.c
409
common_set_ebus_speed(struct function_block *fb, int fd, bool debug, uint8_t speed)
usr.bin/scmdctl/common.c
416
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
418
err = (*(fb->func_phy_write))(fd, debug, 0, SCMD_REG_E_BUS_SPEED, speed);
usr.bin/scmdctl/common.c
425
common_get_lock_state(struct function_block *fb, int fd, bool debug, int ltype, uint8_t *lstate)
usr.bin/scmdctl/common.c
448
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
450
err = (*(fb->func_phy_read))(fd, debug, 0, reg, reg, &b);
usr.bin/scmdctl/common.c
459
common_set_lock_state(struct function_block *fb, int fd, bool debug, int ltype, uint8_t lstate)
usr.bin/scmdctl/common.c
496
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
498
err = (*(fb->func_phy_write))(fd, debug, 0, reg, state);
usr.bin/scmdctl/common.c
59
int common_clear(struct function_block *fb, int fd, bool debug)
usr.bin/scmdctl/common.c
61
return (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
65
common_identify(struct function_block *fb, int fd, bool debug, int a_module, struct scmd_identify_response *r)
usr.bin/scmdctl/common.c
70
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
72
err = (*(fb->func_phy_read))(fd, debug, a_module, SCMD_REG_ID, SCMD_REG_ID, &b);
usr.bin/scmdctl/common.c
75
err = (*(fb->func_phy_read))(fd, debug, a_module, SCMD_REG_FID, SCMD_REG_FID, &b);
usr.bin/scmdctl/common.c
78
err = (*(fb->func_phy_read))(fd, debug, a_module, SCMD_REG_CONFIG_BITS, SCMD_REG_CONFIG_BITS, &b);
usr.bin/scmdctl/common.c
81
err = (*(fb->func_phy_read))(fd, debug, a_module, SCMD_REG_SLAVE_ADDR, SCMD_REG_SLAVE_ADDR, &b);
usr.bin/scmdctl/common.c
89
int common_diag(struct function_block *fb, int fd, bool debug, int a_module, struct scmd_diag_response *r)
usr.bin/scmdctl/common.c
94
err = (*(fb->func_clear))(fd, debug);
usr.bin/scmdctl/common.c
98
err = (*(fb->func_phy_read))(fd, debug, a_module, n, n, &b);
usr.bin/scmdctl/i2cspi.c
100
i2cspi_clear(int fd, bool debug)
usr.bin/scmdctl/i2cspi.c
106
i2cspi_read_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_end, uint8_t *r)
usr.bin/scmdctl/i2cspi.c
118
return i2cspi_phy_read_register(fd, debug, reg + (SCMD_REG_SIZE * a_module), reg_end - reg + 1, r);
usr.bin/scmdctl/i2cspi.c
122
i2cspi_write_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_v)
usr.bin/scmdctl/i2cspi.c
129
err = i2cspi_phy_write_register(fd, debug, reg + (SCMD_REG_SIZE * a_module), reg_v);
usr.bin/scmdctl/i2cspi.c
53
i2cspi_phy_read_register(int fd, bool debug, uint8_t reg, int rlen, uint8_t *buf)
usr.bin/scmdctl/i2cspi.c
60
err = lseek(fd, reg, SEEK_SET);
usr.bin/scmdctl/i2cspi.c
62
err = read(fd, buf, rlen);
usr.bin/scmdctl/i2cspi.c
78
i2cspi_phy_write_register(int fd, bool debug, uint8_t reg, uint8_t buf)
usr.bin/scmdctl/i2cspi.c
82
err = lseek(fd, reg, SEEK_SET);
usr.bin/scmdctl/i2cspi.c
84
err = write(fd, &buf, 1);
usr.bin/scmdctl/scmdctl.c
101
ttysetup(int fd, speed_t spd)
usr.bin/scmdctl/scmdctl.c
105
(void)tcgetattr(fd, &cntrl);
usr.bin/scmdctl/scmdctl.c
117
return tcsetattr(fd, TCSAFLUSH, &cntrl);
usr.bin/scmdctl/scmdctl.c
124
ul_spisetup(int fd, int slave_addr)
usr.bin/scmdctl/scmdctl.c
138
e = ioctl(fd,SPI_IOCTL_CONFIGURE,&spi_c);
usr.bin/scmdctl/scmdctl.c
153
int fd = -1, error, ttyerror = 0, ul_spierror = 0, valid, validsub = -1;
usr.bin/scmdctl/scmdctl.c
217
fd = open(argv[0], O_RDWR, 0);
usr.bin/scmdctl/scmdctl.c
218
if (fd == -1) {
usr.bin/scmdctl/scmdctl.c
226
ttyerror = ttysetup(fd,(speed_t)baud_rate);
usr.bin/scmdctl/scmdctl.c
229
ul_spierror = ul_spisetup(fd, slave_a);
usr.bin/scmdctl/scmdctl.c
268
error = common_identify(&func_block, fd, debug, module, &ir);
usr.bin/scmdctl/scmdctl.c
278
error = common_diag(&func_block, fd, debug, module, &diag);
usr.bin/scmdctl/scmdctl.c
293
error = common_get_motor(&func_block, fd, debug, (int)module, &motors);
usr.bin/scmdctl/scmdctl.c
310
error = common_set_motor(&func_block, fd, debug, (int)module, motor, reg_value);
usr.bin/scmdctl/scmdctl.c
324
error = common_invert_motor(&func_block, fd, debug, (int)module, motor);
usr.bin/scmdctl/scmdctl.c
337
error = common_bridge_motor(&func_block, fd, debug, (int)module);
usr.bin/scmdctl/scmdctl.c
340
error = common_enable_disable(&func_block, fd, debug, SCMD_DISABLE);
usr.bin/scmdctl/scmdctl.c
343
error = common_enable_disable(&func_block, fd, debug, SCMD_ENABLE);
usr.bin/scmdctl/scmdctl.c
399
error = uart_read_register(fd,debug,module,reg,reg_e,&register_shadow[reg]);
usr.bin/scmdctl/scmdctl.c
401
error = i2cspi_read_register(fd,debug,module,reg,reg_e,&register_shadow[reg]);
usr.bin/scmdctl/scmdctl.c
430
error = uart_write_register(fd,debug,module,reg,reg_value);
usr.bin/scmdctl/scmdctl.c
432
error = i2cspi_write_register(fd,debug,module,reg,reg_value);
usr.bin/scmdctl/scmdctl.c
442
error = common_control_1(&func_block, fd, debug, scmdcmds[valid].id);
usr.bin/scmdctl/scmdctl.c
450
error = common_get_update_rate(&func_block, fd, debug, &ur);
usr.bin/scmdctl/scmdctl.c
457
error = common_set_update_rate(&func_block, fd, debug, ur);
usr.bin/scmdctl/scmdctl.c
465
error = common_force_update(&func_block, fd, debug);
usr.bin/scmdctl/scmdctl.c
489
error = common_get_ebus_speed(&func_block, fd, debug, &ebus_s);
usr.bin/scmdctl/scmdctl.c
500
error = common_set_ebus_speed(&func_block, fd, debug, ebus_s);
usr.bin/scmdctl/scmdctl.c
540
error = common_get_lock_state(&func_block, fd, debug, lock_type, &lock_state);
usr.bin/scmdctl/scmdctl.c
543
error = common_set_lock_state(&func_block, fd, debug, lock_type, SCMD_LOCK_LOCKED);
usr.bin/scmdctl/scmdctl.c
546
error = common_set_lock_state(&func_block, fd, debug, lock_type, SCMD_LOCK_UNLOCK);
usr.bin/scmdctl/scmdctl.c
568
error = uart_ul_spi_read_one(fd,debug);
usr.bin/scmdctl/scmdctl.c
633
close(fd);
usr.bin/scmdctl/uart.c
111
uart_get_response(int fd, bool debug, char *obuf, int len)
usr.bin/scmdctl/uart.c
118
i = read(fd,&c,1);
usr.bin/scmdctl/uart.c
126
i = read(fd,&c,1);
usr.bin/scmdctl/uart.c
130
i = read(fd,&c,1);
usr.bin/scmdctl/uart.c
136
i = read(fd,&c,1);
usr.bin/scmdctl/uart.c
150
uart_phy_read_register(int fd, bool debug, uint8_t reg, uint8_t *buf)
usr.bin/scmdctl/uart.c
167
err = pure_uart_send_cmd(fd, cmdbuf, qbuf, 5);
usr.bin/scmdctl/uart.c
169
err = uart_get_response(fd, debug, qbuf, 5);
usr.bin/scmdctl/uart.c
181
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
200
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
222
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
245
uart_phy_write_register(int fd, bool debug, uint8_t reg, uint8_t buf)
usr.bin/scmdctl/uart.c
260
err = pure_uart_send_cmd(fd, cmdbuf, qbuf, 7);
usr.bin/scmdctl/uart.c
262
err = uart_get_response(fd, debug, qbuf, 10);
usr.bin/scmdctl/uart.c
273
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
287
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
309
uart_local_read_register(int fd, bool debug, uint8_t reg, uint8_t reg_end, uint8_t *r)
usr.bin/scmdctl/uart.c
315
err = uart_phy_read_register(fd, debug, q, &b);
usr.bin/scmdctl/uart.c
328
uart_set_view_port(int fd, bool debug, int a_module, uint8_t vpi2creg)
usr.bin/scmdctl/uart.c
337
err = uart_phy_write_register(fd, debug, SCMD_REG_REM_ADDR, vpi2caddr);
usr.bin/scmdctl/uart.c
339
err = uart_phy_write_register(fd, debug, SCMD_REG_REM_OFFSET, vpi2creg);
usr.bin/scmdctl/uart.c
345
uart_remote_read_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_end, uint8_t *r)
usr.bin/scmdctl/uart.c
352
err = uart_set_view_port(fd, debug, a_module, q);
usr.bin/scmdctl/uart.c
357
err = uart_phy_write_register(fd, debug, SCMD_REG_REM_READ, b);
usr.bin/scmdctl/uart.c
370
err = uart_phy_read_register(fd, debug, SCMD_REG_REM_READ, &b);
usr.bin/scmdctl/uart.c
377
err = uart_phy_read_register(fd, debug, SCMD_REG_REM_DATA_RD, &b);
usr.bin/scmdctl/uart.c
399
uart_read_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_end, uint8_t *r)
usr.bin/scmdctl/uart.c
410
err = uart_clear(fd, debug);
usr.bin/scmdctl/uart.c
413
err = uart_local_read_register(fd, debug, reg, reg_end, r);
usr.bin/scmdctl/uart.c
415
err = uart_remote_read_register(fd, debug, a_module, reg, reg_end, r);
usr.bin/scmdctl/uart.c
423
uart_remote_write_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_v)
usr.bin/scmdctl/uart.c
429
err = uart_set_view_port(fd, debug, a_module, reg);
usr.bin/scmdctl/uart.c
435
err = uart_phy_write_register(fd, debug, SCMD_REG_REM_DATA_WR, reg_v);
usr.bin/scmdctl/uart.c
438
err = uart_phy_write_register(fd, debug, SCMD_REG_REM_WRITE, b);
usr.bin/scmdctl/uart.c
443
err = uart_phy_read_register(fd, debug, SCMD_REG_REM_WRITE, &b);
usr.bin/scmdctl/uart.c
457
uart_write_register(int fd, bool debug, int a_module, uint8_t reg, uint8_t reg_v)
usr.bin/scmdctl/uart.c
464
err = uart_clear(fd, debug);
usr.bin/scmdctl/uart.c
467
err = uart_phy_write_register(fd, debug, reg, reg_v);
usr.bin/scmdctl/uart.c
469
err = uart_remote_write_register(fd, debug, a_module, reg, reg_v);
usr.bin/scmdctl/uart.c
482
uart_ul_spi_read_one(int fd, bool debug)
usr.bin/scmdctl/uart.c
497
err = ioctl(fd,SPI_IOCTL_TRANSFER,&spi_t);
usr.bin/scmdctl/uart.c
64
uart_clear(int fd, bool debug)
usr.bin/scmdctl/uart.c
71
i = write(fd,jcmd,4);
usr.bin/scmdctl/uart.c
73
i = read(fd,&input,1);
usr.bin/scmdctl/uart.c
77
i = read(fd,&input,1);
usr.bin/scmdctl/uart.c
91
pure_uart_send_cmd(int fd, const char *s, char *ibuf, int len)
usr.bin/scmdctl/uart.c
95
i = write(fd,s,len);
usr.bin/scmdctl/uart.c
97
i = read(fd,ibuf,len);
usr.bin/sdiff/edit.c
129
if ((fd = mkstemp(filename)) == -1)
usr.bin/sdiff/edit.c
135
if ((size_t)write(fd, text, len) != len) {
usr.bin/sdiff/edit.c
140
close(fd);
usr.bin/sdiff/edit.c
74
int fd;
usr.bin/sdiff/sdiff.c
159
int ch, fd[2], status;
usr.bin/sdiff/sdiff.c
290
if (pipe(fd))
usr.bin/sdiff/sdiff.c
297
close(fd[0]);
usr.bin/sdiff/sdiff.c
298
if (dup2(fd[1], STDOUT_FILENO) == -1)
usr.bin/sdiff/sdiff.c
301
close(fd[1]);
usr.bin/sdiff/sdiff.c
311
close(fd[1]);
usr.bin/sdiff/sdiff.c
314
if ((diffpipe = fdopen(fd[0], "r")) == NULL)
usr.bin/sed/compile.c
292
cmd->u.fd = -1;
usr.bin/sed/compile.c
293
else if ((cmd->u.fd = open(p,
usr.bin/sed/defs.h
103
int fd; /* File descriptor for w */
usr.bin/sed/process.c
245
if (cp->u.fd == -1 && (cp->u.fd = open(cp->t,
usr.bin/sed/process.c
249
if (write(cp->u.fd, ps, psl) != (ssize_t)psl ||
usr.bin/sed/process.c
250
write(cp->u.fd, "\n", 1) != 1)
usr.bin/sed/process.c
801
if (cp->u.fd != -1 && close(cp->u.fd))
usr.bin/sed/process.c
803
cp->u.fd = -1;
usr.bin/shlock/shlock.c
125
int fd;
usr.bin/shlock/shlock.c
140
while ((fd = open(tempname, O_RDWR|O_CREAT|O_TRUNC|O_SYNC|O_EXCL, 0644))
usr.bin/shlock/shlock.c
162
(write(fd, &pid, sizeof(pid)) != sizeof(pid)) :
usr.bin/shlock/shlock.c
163
(write(fd, buf, len) != (ssize_t)len))
usr.bin/shlock/shlock.c
166
(void) close(fd);
usr.bin/shlock/shlock.c
172
(void) close(fd);
usr.bin/shlock/shlock.c
223
int fd = open(file, O_RDONLY);
usr.bin/shlock/shlock.c
229
if (fd == -1) {
usr.bin/shlock/shlock.c
235
if (st != NULL && fstat(fd, st) == -1) {
usr.bin/shlock/shlock.c
237
close(fd);
usr.bin/shlock/shlock.c
242
((len = read(fd, &pid, sizeof(pid))) != sizeof(pid)) :
usr.bin/shlock/shlock.c
243
((len = read(fd, buf, sizeof(buf))) <= 0))
usr.bin/shlock/shlock.c
245
close(fd);
usr.bin/shlock/shlock.c
249
close(fd);
usr.bin/shmif_dumpbus/shmif_dumpbus.c
124
int fd, i, ch;
usr.bin/shmif_dumpbus/shmif_dumpbus.c
156
fd = open(argv[0], O_RDONLY);
usr.bin/shmif_dumpbus/shmif_dumpbus.c
157
if (fd == -1)
usr.bin/shmif_dumpbus/shmif_dumpbus.c
160
if (fstat(fd, &sb) == -1)
usr.bin/shmif_dumpbus/shmif_dumpbus.c
164
fd, 0);
usr.bin/shmif_pcapin/shmif_pcapin.c
132
int fd;
usr.bin/shmif_pcapin/shmif_pcapin.c
149
fd = open(argv[1], O_RDWR);
usr.bin/shmif_pcapin/shmif_pcapin.c
150
if (fd == -1)
usr.bin/shmif_pcapin/shmif_pcapin.c
153
if (fstat(fd, &sb) == -1)
usr.bin/shmif_pcapin/shmif_pcapin.c
157
MAP_FILE|MAP_SHARED, fd, 0);
usr.bin/shmif_pcapin/shmif_pcapin.c
208
if (dowakeup(fd) == -1)
usr.bin/sort/tmp.c
89
int fd;
usr.bin/sort/tmp.c
97
if ((fd = mkstemp(path)) < 0)
usr.bin/sort/tmp.c
99
if (!(fp = fdopen(fd, "w+")))
usr.bin/spell/spellprog/spellprog.c
280
int fd;
usr.bin/spell/spellprog/spellprog.c
357
wlists[i].fd = open(argv[i], O_RDONLY, 0);
usr.bin/spell/spellprog/spellprog.c
358
if (wlists[i].fd == -1 || fstat(wlists[i].fd, &sb) != 0)
usr.bin/spell/spellprog/spellprog.c
363
MAP_PRIVATE, wlists[i].fd, (off_t)0);
usr.bin/spell/spellprog/spellprog.c
368
wlists[i].fd = -1;
usr.bin/spell/spellprog/spellprog.c
854
for (i = rval = 0; wlists[i].fd != -1; i++) {
usr.bin/split/split.c
372
bigwrite(int fd, const void *buf, size_t len)
usr.bin/split/split.c
379
if ((w = write(fd, ptr, len)) == -1)
usr.bin/talk/ctl_transact.c
64
set[0].fd = ctl_sockt;
usr.bin/talk/io.c
74
set[0].fd = sockt;
usr.bin/talk/io.c
76
set[1].fd = fileno(stdin);
usr.bin/tcopy/tcopy.c
316
writeop(int fd, int type)
usr.bin/tcopy/tcopy.c
322
if (ioctl(fd, MTIOCTOP, (char *)&op) < 0)
usr.bin/tee/tee.c
101
if ((fd = open(*argv, append ? O_WRONLY|O_CREAT|O_APPEND :
usr.bin/tee/tee.c
106
add(fd, *argv);
usr.bin/tee/tee.c
115
if ((wval = write(p->fd, bp, n)) == -1) {
usr.bin/tee/tee.c
129
if (close(p->fd) == -1) {
usr.bin/tee/tee.c
139
add(int fd, const char *name)
usr.bin/tee/tee.c
145
p->fd = fd;
usr.bin/tee/tee.c
59
int fd;
usr.bin/tee/tee.c
71
int fd;
usr.bin/telnet/network.c
86
set[0].fd = net;
usr.bin/telnet/sys_bsd.c
453
NetClose(int fd)
usr.bin/telnet/sys_bsd.c
455
return close(fd);
usr.bin/telnet/sys_bsd.c
564
set[0].fd = net;
usr.bin/telnet/sys_bsd.c
567
set[1].fd = tout;
usr.bin/telnet/sys_bsd.c
569
set[2].fd = tin;
usr.bin/telnet/telnet.c
683
setupterm(char *tname, int fd, int *errp)
usr.bin/telnet/utilities.c
840
set[0].fd = tout;
usr.bin/telnet/utilities.c
97
SetSockOpt(int fd, int level, int option, int yesno)
usr.bin/telnet/utilities.c
99
return setsockopt(fd, level, option, (char *)&yesno, sizeof yesno);
usr.bin/tftp/main.c
401
int fd;
usr.bin/tftp/main.c
438
fd = open(cp, O_RDONLY);
usr.bin/tftp/main.c
439
if (fd == -1) {
usr.bin/tftp/main.c
446
sendfile(fd, targ, mode);
usr.bin/tftp/main.c
455
fd = open(argv[n], O_RDONLY);
usr.bin/tftp/main.c
456
if (fd == -1) {
usr.bin/tftp/main.c
463
sendfile(fd, targ, mode);
usr.bin/tftp/main.c
480
int fd;
usr.bin/tftp/main.c
519
fd = creat(cp, 0644);
usr.bin/tftp/main.c
520
if (fd == -1) {
usr.bin/tftp/main.c
527
recvfile(fd, src, mode);
usr.bin/tftp/main.c
531
fd = creat(p, 0644);
usr.bin/tftp/main.c
532
if (fd == -1) {
usr.bin/tftp/main.c
539
recvfile(fd, src, mode);
usr.bin/tftp/tftp.c
164
int fd, rv;
usr.bin/tftp/tftp.c
170
fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
usr.bin/tftp/tftp.c
171
if (fd < 0) {
usr.bin/tftp/tftp.c
173
return fd;
usr.bin/tftp/tftp.c
180
rv = bind(fd, (struct sockaddr *)&s, sizeof(struct sockaddr_in));
usr.bin/tftp/tftp.c
183
close(fd);
usr.bin/tftp/tftp.c
187
rv = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &req,
usr.bin/tftp/tftp.c
191
close(fd);
usr.bin/tftp/tftp.c
195
return fd;
usr.bin/tftp/tftp.c
199
tftp_igmp_leave(int fd)
usr.bin/tftp/tftp.c
208
rv = setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &req,
usr.bin/tftp/tftp.c
213
close(fd);
usr.bin/tftp/tftp.c
222
sendfile(int fd, const char *name, const char *mode)
usr.bin/tftp/tftp.c
242
if (fstat(fd, &sbuf) == 0) {
usr.bin/tftp/tftp.c
248
file = fdopen(fd, "r");
usr.bin/tftp/tftp.c
372
recvfile(int fd, const char *name, const char *mode)
usr.bin/tftp/tftp.c
392
file = fdopen(fd, "w");
usr.bin/tic/tic.c
575
int fd;
usr.bin/tic/tic.c
586
fd = mkstemp(tmp_dbname);
usr.bin/tic/tic.c
587
if (fd == -1)
usr.bin/tic/tic.c
590
if (cdbw_output(db, fd, "NetBSD terminfo", cdbw_stable_seeder))
usr.bin/tic/tic.c
595
if (fchmod(fd, DEFFILEMODE & ~m))
usr.bin/tic/tic.c
597
if (close(fd))
usr.bin/tip/acu.c
117
if ((fd = fopen(PH, "r")) == NULL) {
usr.bin/tip/acu.c
121
while (fgets(string, sizeof(string), fd) != NULL) {
usr.bin/tip/acu.c
125
(void)fclose(fd);
usr.bin/tip/acu.c
134
(void)fclose(fd);
usr.bin/tip/acu.c
143
(void)fclose(fd);
usr.bin/tip/acu.c
150
(void)fclose(fd);
usr.bin/tip/acu.c
70
FILE *fd;
usr.bin/tip/aculib/biz31.c
210
bizsync(int fd)
usr.bin/tip/aculib/biz31.c
226
if (ioctl(fd, IOCTL, &b) >= 0 && chars(b) > 0)
usr.bin/tip/aculib/biz31.c
228
(void)write(fd, "\rp>\r", 4);
usr.bin/tip/aculib/biz31.c
230
if (ioctl(fd, IOCTL, &b) >= 0) {
usr.bin/tip/aculib/biz31.c
235
(void)write(fd, DISCONNECT_CMD, 4);
usr.bin/tip/aculib/biz31.c
240
(void)read(fd, buf, 10);
usr.bin/tip/aculib/courier.c
299
cour_write(int fd, const char *cp, int n)
usr.bin/tip/aculib/courier.c
306
(void)tcdrain(fd);
usr.bin/tip/aculib/courier.c
309
(void)write(fd, cp, 1);
usr.bin/tip/aculib/courier.c
310
(void)tcdrain(fd);
usr.bin/tip/aculib/t3000.c
310
t3000_write(int fd, const char *cp, int n)
usr.bin/tip/aculib/t3000.c
317
(void)tcdrain(fd);
usr.bin/tip/aculib/t3000.c
320
(void)write(fd, cp, 1);
usr.bin/tip/aculib/t3000.c
321
(void)tcdrain(fd);
usr.bin/tip/aculib/ventel.c
206
vensync(int fd)
usr.bin/tip/aculib/ventel.c
228
(void)write(fd, "\r", 1);
usr.bin/tip/aculib/ventel.c
230
(void)write(fd, "\r", 1);
usr.bin/tip/aculib/ventel.c
232
if (ioctl(fd, FIONREAD, &nread) < 0) {
usr.bin/tip/aculib/ventel.c
237
(void)read(fd, buf, min(nread, sizeof buf));
usr.bin/tip/cmds.c
103
int fd, argc;
usr.bin/tip/cmds.c
115
if ((fd = open(cp, O_RDWR|O_CREAT, 0666)) < 0) {
usr.bin/tip/cmds.c
120
transfer(line, fd, "\01");
usr.bin/tip/cmds.c
129
transfer(char *buf, int fd, const char *eofchars)
usr.bin/tip/cmds.c
174
if (write(fd, buffer, (size_t)cnt) != cnt) {
usr.bin/tip/cmds.c
182
if (write(fd, buffer, (size_t)cnt) != cnt)
usr.bin/tip/cmds.c
190
(void)close(fd);
usr.bin/tip/cmds.c
260
FILE *fd;
usr.bin/tip/cmds.c
274
if ((fd = fopen(fnamex, "r")) == NULL) {
usr.bin/tip/cmds.c
278
transmit(fd, value(EOFWRITE), NULL);
usr.bin/tip/cmds.c
288
transmit(FILE *fd, const char *eofchars, char *command)
usr.bin/tip/cmds.c
319
c = getc(fd);
usr.bin/tip/cmds.c
373
(void)fclose(fd);
usr.bin/tip/cmds.c
392
FILE *fd;
usr.bin/tip/cmds.c
406
if ((fd = fopen(copynamex, "r")) == NULL) {
usr.bin/tip/cmds.c
414
transmit(fd, "\04", line);
usr.bin/tip/tip.c
591
xpwrite(int fd, char *buf, size_t n)
usr.bin/tip/tip.c
602
if (write(fd, buf, n) < 0) {
usr.bin/tip/tipout.c
133
pfd[0].fd = attndes[0];
usr.bin/tip/tipout.c
135
pfd[1].fd = FD;
usr.bin/touch/touch.c
187
fd = open(*argv,
usr.bin/touch/touch.c
189
if (fd == -1 || fstat(fd, &sb) || close(fd)) {
usr.bin/touch/touch.c
94
int aflag, cflag, Dflag, hflag, mflag, ch, fd, len, rval, timeset;
usr.bin/tset/misc.c
47
register int fd, nr, nw;
usr.bin/tset/misc.c
50
if ((fd = open(file, O_RDONLY, 0)) < 0)
usr.bin/tset/misc.c
53
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/tset/misc.c
58
(void)close(fd);
usr.bin/unzip/unzip.c
511
extract2fd(struct archive *a, char *pathname, int fd)
usr.bin/unzip/unzip.c
523
if (fd != STDOUT_FILENO)
usr.bin/unzip/unzip.c
535
if (write(fd, "\r", 1) != 1)
usr.bin/unzip/unzip.c
562
if (write(fd, buffer, len) != len)
usr.bin/unzip/unzip.c
585
if (write(fd, p, q - p) != q - p)
usr.bin/unzip/unzip.c
603
int fd, check, text;
usr.bin/unzip/unzip.c
664
if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
usr.bin/unzip/unzip.c
669
text = extract2fd(a, *path, fd);
usr.bin/unzip/unzip.c
678
if (futimes(fd, tv) != 0)
usr.bin/unzip/unzip.c
680
if (close(fd) != 0)
usr.bin/usbhidaction/usbhidaction.c
152
fd = open(dev, O_RDWR | O_CLOEXEC);
usr.bin/usbhidaction/usbhidaction.c
153
if (fd < 0)
usr.bin/usbhidaction/usbhidaction.c
156
if (ioctl(fd, USB_GET_REPORT_ID, &reportid) < 0)
usr.bin/usbhidaction/usbhidaction.c
158
repd = hid_get_report_desc(fd);
usr.bin/usbhidaction/usbhidaction.c
181
n = read(fd, buf, (size_t)sz);
usr.bin/usbhidaction/usbhidaction.c
90
int fd, ch, sz, n, val, i;
usr.bin/vndcompress/offtab.c
207
int fd, off_t fdpos)
usr.bin/vndcompress/offtab.c
212
assert(0 <= fd);
usr.bin/vndcompress/offtab.c
228
offtab->ot_fd = fd;
usr.bin/vndcompress/utils.c
62
read_block(int fd, void *buf, size_t len)
usr.bin/vndcompress/utils.c
69
while (0 < n && (nread = read(fd, p, n)) != 0) {
usr.bin/vndcompress/utils.c
86
pread_block(int fd, void *buf, size_t len, off_t fdpos)
usr.bin/vndcompress/utils.c
97
while (0 < n && (nread = pread(fd, p, n, fdpos)) != 0) {
usr.bin/wall/wall.c
228
int fd;
usr.bin/wall/wall.c
234
if ((fd = mkstemp(tmpname)) == -1)
usr.bin/wall/wall.c
237
if (!(fp = fdopen(fd, "r+")))
usr.bin/wall/wall.c
263
if (fstat(fd, &sbuf) == -1)
usr.bin/wc/wc.c
187
int fd, len = 0;
usr.bin/wc/wc.c
191
if ((fd = open(file, O_RDONLY, 0)) < 0) {
usr.bin/wc/wc.c
198
fd = STDIN_FILENO;
usr.bin/wc/wc.c
212
while ((len = read(fd, buf, MAXBSIZE)) > 0) {
usr.bin/wc/wc.c
238
if (fstat(fd, &sb)) {
usr.bin/wc/wc.c
249
read(fd, buf, MAXBSIZE)) > 0)
usr.bin/wc/wc.c
261
while ((len = read(fd, buf, MAXBSIZE)) > 0) {
usr.bin/wc/wc.c
323
if (close(fd)) {
usr.bin/write/term_chk.c
100
if (fd != -1) {
usr.bin/write/term_chk.c
102
(void)close(fd);
usr.bin/write/term_chk.c
64
int i, fd, serrno;
usr.bin/write/term_chk.c
77
fd = open(path, O_WRONLY, 0);
usr.bin/write/term_chk.c
82
if (fd == -1)
usr.bin/write/term_chk.c
84
if (fstat(fd, &s) == -1)
usr.bin/write/term_chk.c
86
if (!isatty(fd))
usr.bin/write/term_chk.c
97
(void)close(fd);
usr.bin/write/term_chk.c
98
return ismytty ? 0 : fd;
usr.bin/write/write.c
159
int fd, nfd;
usr.bin/write/write.c
170
fd = -1;
usr.bin/write/write.c
184
if (fd == -1)
usr.bin/write/write.c
185
fd = nfd;
usr.bin/write/write.c
194
close(fd);
usr.bin/write/write.c
195
fd = nfd;
usr.bin/write/write.c
204
return fd;
usr.bin/write/write.c
209
return fd;
usr.bin/xargs/xargs.c
514
int fd;
usr.bin/xargs/xargs.c
555
if ((fd = open(_PATH_TTY, O_RDONLY)) == -1)
usr.bin/xargs/xargs.c
558
fd = open(_PATH_DEVNULL, O_RDONLY);
usr.bin/xargs/xargs.c
560
if (fd > STDIN_FILENO) {
usr.bin/xargs/xargs.c
561
if (dup2(fd, STDIN_FILENO) != 0)
usr.bin/xargs/xargs.c
563
(void)close(fd);
usr.bin/xlint/lint1/main1.c
106
int fd;
usr.bin/xlint/lint1/main1.c
108
if ((fd = mkstemp(template)) == -1)
usr.bin/xlint/lint1/main1.c
111
if ((fp = fdopen(fd, "r+")) == NULL) {
usr.bin/xlint/lint1/main1.c
112
(void)close(fd);
usr.bin/xlint/xlint/xlint.c
442
int fd = mkstemp(ofn);
usr.bin/xlint/xlint/xlint.c
443
if (fd == -1) {
usr.bin/xlint/xlint/xlint.c
447
(void)close(fd);
usr.bin/ypwhich/ypwhich.c
202
int fd = RPC_ANYSOCK;
usr.bin/ypwhich/ypwhich.c
205
return clnttcp_create(sin, prog, vers, &fd, 0, 0);
usr.bin/ypwhich/ypwhich.c
207
return clntudp_create(sin, prog, vers, tv, &fd);
usr.sbin/acpitools/acpidump/acpi.c
4604
write_dsdt(int fd, ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdt)
usr.sbin/acpitools/acpidump/acpi.c
4628
write(fd, &sdt, sizeof(ACPI_TABLE_HEADER));
usr.sbin/acpitools/acpidump/acpi.c
4629
write(fd, dsdt + 1, dsdt->Length - sizeof(ACPI_TABLE_HEADER));
usr.sbin/acpitools/acpidump/acpi.c
4635
write(fd, ssdt + 1, ssdt->Length -
usr.sbin/acpitools/acpidump/acpi.c
4646
int fd;
usr.sbin/acpitools/acpidump/acpi.c
4651
fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, mode);
usr.sbin/acpitools/acpidump/acpi.c
4652
if (fd == -1) {
usr.sbin/acpitools/acpidump/acpi.c
4656
write_dsdt(fd, rsdt, dsdp);
usr.sbin/acpitools/acpidump/acpi.c
4657
close(fd);
usr.sbin/acpitools/acpidump/acpi.c
4669
int fd, status;
usr.sbin/acpitools/acpidump/acpi.c
4695
fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
usr.sbin/acpitools/acpidump/acpi.c
4696
if (fd < 0) {
usr.sbin/acpitools/acpidump/acpi.c
4700
write_dsdt(fd, rsdt, dsdp);
usr.sbin/acpitools/acpidump/acpi.c
4701
close(fd);
usr.sbin/acpitools/amldb/amldb.c
81
int fd;
usr.sbin/acpitools/amldb/amldb.c
85
fd = open(dsdtfile, O_RDONLY, 0);
usr.sbin/acpitools/amldb/amldb.c
86
if (fd == -1) {
usr.sbin/acpitools/amldb/amldb.c
90
if (fstat(fd, &sb) == -1) {
usr.sbin/acpitools/amldb/amldb.c
94
if ((code = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) ==
usr.sbin/altq/altqd/altqd.c
117
int i, c, maxfd, rval, qpsock, fd;
usr.sbin/altq/altqd/altqd.c
219
fd = fileno(fp);
usr.sbin/altq/altqd/altqd.c
220
if (fd == -1)
usr.sbin/altq/altqd/altqd.c
223
fd = -1;
usr.sbin/altq/altqd/altqd.c
225
if (fd != -1) {
usr.sbin/altq/altqd/altqd.c
226
FD_SET(fd, &fds);
usr.sbin/altq/altqd/altqd.c
227
maxfd = MAX(maxfd, fd + 1);
usr.sbin/altq/altqd/altqd.c
262
if (fp && FD_ISSET(fd, &rfds)) {
usr.sbin/altq/altqstat/altqstat.h
29
typedef void (stat_loop_t)(int fd, const char *ifname,
usr.sbin/altq/altqstat/qdisc_blue.c
49
blue_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_blue.c
65
if (ioctl(fd, BLUE_GETSTATS, &blue_stats) < 0)
usr.sbin/altq/altqstat/qdisc_cbq.c
60
cbq_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_cbq.c
84
if (ioctl(fd, CBQ_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_cdnr.c
58
cdnr_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_cdnr.c
89
if (ioctl(fd, CDNR_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_conf.c
78
int fd, qtype = 0;
usr.sbin/altq/altqstat/qdisc_conf.c
88
if ((fd = open(ALTQ_DEVICE, O_RDONLY)) < 0) {
usr.sbin/altq/altqstat/qdisc_conf.c
92
if (ioctl(fd, ALTQGTYPE, &qtypereq) < 0) {
usr.sbin/altq/altqstat/qdisc_conf.c
94
close(fd);
usr.sbin/altq/altqstat/qdisc_conf.c
97
close(fd);
usr.sbin/altq/altqstat/qdisc_fifoq.c
49
fifoq_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_fifoq.c
66
if (ioctl(fd, FIFOQ_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_hfsc.c
53
hfsc_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_hfsc.c
83
if (ioctl(fd, HFSC_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_jobs.c
102
if (ioctl(fd, JOBS_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_jobs.c
78
jobs_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_priq.c
50
priq_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_priq.c
74
if (ioctl(fd, PRIQ_GETSTATS, &get_stats) < 0)
usr.sbin/altq/altqstat/qdisc_red.c
51
red_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_red.c
68
if (ioctl(fd, RED_GETSTATS, &red_stats) < 0)
usr.sbin/altq/altqstat/qdisc_rio.c
52
rio_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_rio.c
70
if (ioctl(fd, RIO_GETSTATS, &rio_stats) < 0)
usr.sbin/altq/altqstat/qdisc_wfq.c
106
if (ioctl(fd, WFQ_GET_STATS, &wfq_stats) < 0)
usr.sbin/altq/altqstat/qdisc_wfq.c
62
wfq_stat_loop(int fd, const char *ifname, int count, int interval)
usr.sbin/altq/altqstat/qdisc_wfq.c
80
if (ioctl(fd, WFQ_GET_STATS, &wfq_stats) < 0)
usr.sbin/altq/altqstat/quip_client.c
115
int fd;
usr.sbin/altq/altqstat/quip_client.c
117
if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0)
usr.sbin/altq/altqstat/quip_client.c
124
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
usr.sbin/altq/altqstat/quip_client.c
129
if ((server = fdopen(fd, "r+")) == NULL) {
usr.sbin/altq/libaltq/qop.c
1356
int fd;
usr.sbin/altq/libaltq/qop.c
1358
if ((fd = open(RED_DEVICE, O_RDWR)) < 0) {
usr.sbin/altq/libaltq/qop.c
1367
if (ioctl(fd, RED_SETDEFAULTS, &params) < 0) {
usr.sbin/altq/libaltq/qop.c
1369
(void)close(fd);
usr.sbin/altq/libaltq/qop.c
1373
(void)close(fd);
usr.sbin/altq/libaltq/qop.c
1380
int i, fd;
usr.sbin/altq/libaltq/qop.c
1389
if ((fd = open(RIO_DEVICE, O_RDWR)) < 0) {
usr.sbin/altq/libaltq/qop.c
1394
if (ioctl(fd, RIO_SETDEFAULTS, params) < 0) {
usr.sbin/altq/libaltq/qop.c
1396
(void)close(fd);
usr.sbin/altq/libaltq/qop.c
1400
(void)close(fd);
usr.sbin/altq/libaltq/qop.c
1413
int fd;
usr.sbin/altq/libaltq/qop.c
1444
fd = open(devname, flags);
usr.sbin/altq/libaltq/qop.c
1445
return (fd);
usr.sbin/altq/libaltq/qop.c
862
int fd;
usr.sbin/altq/libaltq/qop.c
873
if ((fd = open(ALTQ_DEVICE, O_RDWR)) < 0)
usr.sbin/altq/libaltq/qop.c
876
if (ioctl(fd, ALTQTBRGET, &req) < 0)
usr.sbin/altq/libaltq/qop.c
894
close (fd);
usr.sbin/altq/libaltq/qop.c
919
if (ioctl(fd, ALTQTBRSET, &req) < 0)
usr.sbin/altq/libaltq/qop.c
926
close(fd);
usr.sbin/altq/libaltq/qop.c
935
int fd;
usr.sbin/altq/libaltq/qop.c
948
if ((fd = open(ALTQ_DEVICE, O_RDWR)) < 0)
usr.sbin/altq/libaltq/qop.c
950
if (ioctl(fd, ALTQTBRSET, &req) < 0)
usr.sbin/altq/libaltq/qop.c
952
close(fd);
usr.sbin/altq/libaltq/qop_hfsc.c
145
u_int m1, d, m2, rm1, rd, rm2, fm1, fd, fm2, um1, ud, um2;
usr.sbin/altq/libaltq/qop_hfsc.c
150
rm1 = rd = rm2 = fm1 = fd = fm2 = um1 = ud = um2 = 0;
usr.sbin/altq/libaltq/qop_hfsc.c
163
fm1 = m1; fd = d; fm2 = m2;
usr.sbin/altq/libaltq/qop_hfsc.c
255
m1 = fm1; d = fd; m2 = fm2;
usr.sbin/altq/libaltq/qop_hfsc.c
260
if (error == 0 && (rm1 != fm1 || rd != fd || rm2 != fm2)) {
usr.sbin/altq/libaltq/qop_hfsc.c
262
m1 = fm1; d = fd; m2 = fm2; type = HFSC_LINKSHARINGSC;
usr.sbin/altq/tbrconfig/tbrconfig.c
115
if ((fd = open(ALTQ_DEVICE, O_RDWR)) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
118
if (ioctl(fd, ALTQTBRSET, &req) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
121
close(fd);
usr.sbin/altq/tbrconfig/tbrconfig.c
131
if ((fd = open(ALTQ_DEVICE, O_RDONLY)) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
133
if (ioctl(fd, ALTQTBRGET, &req) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
154
close(fd);
usr.sbin/altq/tbrconfig/tbrconfig.c
164
int fd, ntbr;
usr.sbin/altq/tbrconfig/tbrconfig.c
169
if ((fd = open(ALTQ_DEVICE, O_RDONLY)) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
176
if (ioctl(fd, ALTQTBRGET, &req) < 0)
usr.sbin/altq/tbrconfig/tbrconfig.c
199
close(fd);
usr.sbin/altq/tbrconfig/tbrconfig.c
70
int fd, ch, delete;
usr.sbin/apm/apm.c
104
int fd;
usr.sbin/apm/apm.c
118
fd = open_socket(pn);
usr.sbin/apm/apm.c
119
if (fd == -1)
usr.sbin/apm/apm.c
122
exit(send_command(fd, &command, &reply));
usr.sbin/apm/apm.c
155
int ch, doac, dobstate, domin, dopct, dostatus, fd, nodaemon,
usr.sbin/apm/apm.c
220
fd = -1;
usr.sbin/apm/apm.c
222
fd = open_socket(sockname);
usr.sbin/apm/apm.c
230
if (fd == -1) {
usr.sbin/apm/apm.c
232
fd = open(_PATH_APM_NORMAL, O_RDONLY);
usr.sbin/apm/apm.c
233
if (fd == -1) {
usr.sbin/apm/apm.c
239
if (ioctl(fd, APM_IOC_GETPOWER,
usr.sbin/apm/apm.c
247
if (nodaemon && fd == -1) {
usr.sbin/apm/apm.c
248
fd = open(_PATH_APM_CTLDEV, O_RDWR);
usr.sbin/apm/apm.c
249
if (fd == -1)
usr.sbin/apm/apm.c
255
if (ioctl(fd, action == SUSPEND ?
usr.sbin/apm/apm.c
262
} else if (fd == -1)
usr.sbin/apm/apm.c
271
if ((rval = send_command(fd, &command, &reply)) == 0) {
usr.sbin/apm/apm.c
79
send_command(int fd,
usr.sbin/apm/apm.c
87
if (send(fd, cmd, sizeof(*cmd), 0) == sizeof(*cmd)) {
usr.sbin/apm/apm.c
88
if (recv(fd, reply, sizeof(*reply), 0) != sizeof(*reply)) {
usr.sbin/apmd/apmd.c
103
if (ioctl(fd, APM_IOC_GETPOWER, &bstate) == 0) {
usr.sbin/apmd/apmd.c
421
set[0].fd = ctl_fd;
usr.sbin/apmd/apmd.c
423
set[1].fd = sock_fd;
usr.sbin/apmd/apmd.c
69
static int power_status (int fd, int force, struct apm_power_info *pinfo);
usr.sbin/apmd/apmd.c
95
power_status(int fd, int force, struct apm_power_info *pinfo)
usr.sbin/autofs/common.c
1173
int error, fd;
usr.sbin/autofs/common.c
1179
fd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/autofs/common.c
1180
if (fd < 0) {
usr.sbin/autofs/common.c
1185
error = dup2(fd, STDIN_FILENO);
usr.sbin/autofs/common.c
1189
error = close(fd);
usr.sbin/bad144/bad144.c
596
format(int fd, daddr_t blk)
usr.sbin/bad144/bad144.c
632
if (ioctl(fd, DIOCRFORMAT, &fop) < 0)
usr.sbin/bad144/bad144.c
648
if (ioctl(fd, DIOCWFORMAT, &fop) < 0)
usr.sbin/bootp/bootpd/bootpd.c
482
set[0].fd = s;
usr.sbin/bootp/bootpgw/bootpgw.c
424
set[0].fd = s;
usr.sbin/bootp/bootptest/bootptest.c
350
int fd = open(vendor_file, 0);
usr.sbin/bootp/bootptest/bootptest.c
351
if (fd < 0) {
usr.sbin/bootp/bootptest/bootptest.c
357
n = read(fd, bp->bp_vend, n);
usr.sbin/bootp/bootptest/bootptest.c
358
close(fd);
usr.sbin/bootp/bootptest/bootptest.c
381
set[0].fd = s;
usr.sbin/bootp/bootptest/getether.c
129
int fd, rc = -1;
usr.sbin/bootp/bootptest/getether.c
136
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/bootp/bootptest/getether.c
137
if (fd < 0) {
usr.sbin/bootp/bootptest/getether.c
139
return (fd);
usr.sbin/bootp/bootptest/getether.c
143
if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 ||
usr.sbin/bootp/bootptest/getether.c
168
close(fd);
usr.sbin/bootp/bootptest/getether.c
197
int fd, flags;
usr.sbin/bootp/bootptest/getether.c
203
fd = open(devname, 2);
usr.sbin/bootp/bootptest/getether.c
204
if (fd < 0) {
usr.sbin/bootp/bootptest/getether.c
213
fd = open(devname, 2);
usr.sbin/bootp/bootptest/getether.c
214
if (fd < 0) {
usr.sbin/bootp/bootptest/getether.c
234
if (putmsg(fd, &cbuf, NULL, 0) < 0) {
usr.sbin/bootp/bootptest/getether.c
242
if (getmsg(fd, &cbuf, NULL, &flags) < 0) {
usr.sbin/bootp/bootptest/getether.c
276
if (putmsg(fd, &cbuf, NULL, 0) < 0) {
usr.sbin/bootp/bootptest/getether.c
284
if (getmsg(fd, &cbuf, NULL, &flags) < 0) {
usr.sbin/bootp/bootptest/getether.c
317
close(fd);
usr.sbin/bootp/bootptest/getether.c
345
int fd;
usr.sbin/bootp/bootptest/getether.c
350
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/bootp/bootptest/getether.c
354
if (ioctl(fd, SIOCGIFHWADDR, &phys) < 0) {
usr.sbin/bootp/bootptest/getether.c
360
close(fd);
usr.sbin/bootp/bootptest/getether.c
49
int fd;
usr.sbin/bootp/bootptest/getether.c
54
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/bootp/bootptest/getether.c
58
if (ioctl(fd, SIOCRPHYSADDR, &phys) < 0) {
usr.sbin/bootp/bootptest/getether.c
64
close(fd);
usr.sbin/bootp/common/hwaddr.c
101
if ((fd=open("/dev/arp", O_RDWR)) < 0) {
usr.sbin/bootp/common/hwaddr.c
108
if (ioctl(fd, I_STR, (caddr_t)&iocb) < 0) {
usr.sbin/bootp/common/hwaddr.c
111
close (fd);
usr.sbin/bootp/common/hwaddr.c
77
int fd;
usr.sbin/bta2dpd/bta2dpd/avdtp.c
124
avdtpSendCapabilitiesResponseSBC(int fd, int recvfd, int trans, uint8_t mySep,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
157
write(fd, data, sizeof(data));
usr.sbin/bta2dpd/bta2dpd/avdtp.c
163
avdtpSendAccept(int fd, int recvfd, uint8_t trans, uint8_t myCommand)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
170
write(fd, data, sizeof(data));
usr.sbin/bta2dpd/bta2dpd/avdtp.c
176
avdtpSendReject(int fd, int recvfd, uint8_t trans, uint8_t myCommand)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
184
write(fd, data, sizeof(data));
usr.sbin/bta2dpd/bta2dpd/avdtp.c
190
avdtpSendDiscResponseAudio(int fd, int recvfd, uint8_t trans, uint8_t mySep,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
200
write(fd, data, sizeof(data));
usr.sbin/bta2dpd/bta2dpd/avdtp.c
233
avdtpGetCapabilities(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
237
avdtpSendCommand(fd, AVDTP_GET_CAPABILITIES, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
241
avdtpSetConfiguration(int fd, int recvfd, uint8_t sep, uint8_t *data,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
259
avdtpSendCommand(fd, AVDTP_SET_CONFIGURATION, 0,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
268
avdtpOpen(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
272
avdtpSendCommand(fd, AVDTP_OPEN, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
276
avdtpStart(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
280
avdtpSendCommand(fd, AVDTP_START, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
284
avdtpClose(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
288
avdtpSendCommand(fd, AVDTP_CLOSE, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
292
avdtpSuspend(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
296
avdtpSendCommand(fd, AVDTP_SUSPEND, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
300
avdtpAbort(int fd, int recvfd, uint8_t sep)
usr.sbin/bta2dpd/bta2dpd/avdtp.c
304
avdtpSendCommand(fd, AVDTP_ABORT, 0, &address, 1);
usr.sbin/bta2dpd/bta2dpd/avdtp.c
308
avdtpAutoConfigSBC(int fd, int recvfd, uint8_t *capabilities, size_t cap_len,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
373
if (avdtpSetConfiguration(fd, fd, sep, config, sizeof(config),
usr.sbin/bta2dpd/bta2dpd/avdtp.c
44
avdtpSendCommand(int fd, uint8_t command, uint8_t type, uint8_t *data,
usr.sbin/bta2dpd/bta2dpd/avdtp.c
71
write(fd, &header, extra_size + 2);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
118
int avdtpSendCommand(int fd, uint8_t command, uint8_t type,
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
125
void avdtpGetCapabilities(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
126
int avdtpAutoConfigSBC(int fd, int recvfd, uint8_t * capabilities, size_t
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
129
int avdtpSetConfiguration(int fd, int recvfd, uint8_t sep, uint8_t *data,
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
131
void avdtpOpen(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
132
void avdtpStart(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
133
void avdtpClose(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
134
void avdtpSuspend(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/avdtp_signal.h
135
void avdtpAbort(int fd, int recvfd, uint8_t sep);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
257
static void bt_exit(int fd);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
637
bt_exit(int fd)
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
640
close(fd);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
641
fd = -1;
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
648
do_ctlreq(int fd, short ev, void *arg)
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
660
if(avdtpCheckResponse(fd, &isCommand, &trans, &signal, NULL, buff,
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
663
close(fd);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
682
avdtpSendAccept(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
694
avdtpSendDiscResponseAudio(fd, fd, trans,
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
699
avdtpSendCapabilitiesResponseSBC(fd, fd, trans,
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
706
avdtpSendAccept(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
710
avdtpSendAccept(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
716
avdtpSendAccept(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
721
avdtpSendReject(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
732
avdtpGetCapabilities(fd, fd, mySepInfo.sep);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
735
result = avdtpAutoConfigSBC(fd, fd, buff, bufflen,
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
752
avdtpOpen(fd, fd, mySepInfo.sep);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
765
avdtpSendReject(fd, fd, trans, signal);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
809
avdtpStart(fd, fd, mySepInfo.sep);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
836
do_recv(int fd, short ev, void *arg)
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
840
len = recvstream(fd, audfile);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
847
bt_exit(fd);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
853
do_interrupt(int fd, short ev, void *arg)
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
861
len = stream(fd, sc, channel_mode, frequency, bands, blocks,
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
870
bt_exit(fd);
usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
872
close(fd);
usr.sbin/bta2dpd/bta2dpd/sbc_encode.c
819
readloop(int fd, void *buf, size_t nbytes)
usr.sbin/bta2dpd/bta2dpd/sbc_encode.c
826
ret = read(fd, ((char *)buf) + count, nbytes);
usr.sbin/btattach/btattach.c
170
int fd, ch, tflag, i;
usr.sbin/btattach/btattach.c
259
if ((fd = open(argv[0], O_RDWR | O_EXLOCK, 0)) < 0)
usr.sbin/btattach/btattach.c
263
if (tcgetattr(fd, &tio) < 0)
usr.sbin/btattach/btattach.c
271
|| tcsetattr(fd, TCSANOW, &tio) < 0
usr.sbin/btattach/btattach.c
272
|| tcflush(fd, TCIOFLUSH) < 0)
usr.sbin/btattach/btattach.c
277
(*type->init)(fd, speed);
usr.sbin/btattach/btattach.c
281
|| tcsetattr(fd, TCSANOW, &tio) < 0)
usr.sbin/btattach/btattach.c
286
if (ioctl(fd, TIOCSLINED, type->line) < 0)
usr.sbin/btattach/btattach.c
366
uart_send_cmd(int fd, uint16_t opcode, void *buf, size_t len)
usr.sbin/btattach/btattach.c
390
if (writev(fd, iov, __arraycount(iov)) < 0)
usr.sbin/btattach/btattach.c
399
r = tcdrain(fd);
usr.sbin/btattach/btattach.c
411
uart_getc(int fd, struct iovec *iov, int ioc, size_t *count)
usr.sbin/btattach/btattach.c
417
n = read(fd, &ch, sizeof(ch));
usr.sbin/btattach/btattach.c
448
uart_recv_pkt(int fd, struct iovec *iov, int ioc)
usr.sbin/btattach/btattach.c
457
type = uart_getc(fd, iov, ioc, &count);
usr.sbin/btattach/btattach.c
460
(void)uart_getc(fd, iov, ioc, &count); /* event */
usr.sbin/btattach/btattach.c
461
want = uart_getc(fd, iov, ioc, &count);
usr.sbin/btattach/btattach.c
465
(void)uart_getc(fd, iov, ioc, &count); /* handle LSB */
usr.sbin/btattach/btattach.c
466
(void)uart_getc(fd, iov, ioc, &count); /* handle MSB */
usr.sbin/btattach/btattach.c
467
want = uart_getc(fd, iov, ioc, &count) | /* LSB */
usr.sbin/btattach/btattach.c
468
uart_getc(fd, iov, ioc, &count) << 8; /* MSB */
usr.sbin/btattach/btattach.c
472
(void)uart_getc(fd, iov, ioc, &count); /* handle LSB */
usr.sbin/btattach/btattach.c
473
(void)uart_getc(fd, iov, ioc, &count); /* handle MSB */
usr.sbin/btattach/btattach.c
474
want = uart_getc(fd, iov, ioc, &count);
usr.sbin/btattach/btattach.c
482
(void)uart_getc(fd, iov, ioc, &count);
usr.sbin/btattach/btattach.c
494
uart_recv_ev(int fd, uint8_t event, void *buf, size_t len)
usr.sbin/btattach/btattach.c
506
n = uart_recv_pkt(fd, iov, __arraycount(iov));
usr.sbin/btattach/btattach.c
523
uart_recv_cc(int fd, uint16_t opcode, void *buf, size_t len)
usr.sbin/btattach/btattach.c
538
n = uart_recv_pkt(fd, iov, __arraycount(iov));
usr.sbin/btattach/btattach.c
560
int fd, guessed;
usr.sbin/btattach/btattach.c
598
if ((fd = open(tty, O_RDWR | O_NONBLOCK | O_EXLOCK, 0)) < 0)
usr.sbin/btattach/btattach.c
602
if (tcgetattr(fd, &tio) < 0)
usr.sbin/btattach/btattach.c
612
|| tcsetattr(fd, TCSANOW, &tio) < 0
usr.sbin/btattach/btattach.c
613
|| tcflush(fd, TCIOFLUSH) < 0) {
usr.sbin/btattach/btattach.c
625
n = read(fd, buf, sizeof(buf));
usr.sbin/btattach/btattach.c
668
close(fd);
usr.sbin/btattach/firmload.c
46
int fd;
usr.sbin/btattach/firmload.c
54
fd = open(f, O_RDONLY);
usr.sbin/btattach/firmload.c
56
if (fd != -1) {
usr.sbin/btattach/firmload.c
59
return fd;
usr.sbin/btattach/firmload.c
73
int fd;
usr.sbin/btattach/firmload.c
79
fd = firmware_search(paths, drvname, imgname);
usr.sbin/btattach/firmload.c
83
return fd;
usr.sbin/btattach/init_bcm2035.c
51
init_bcm2035(int fd, unsigned int speed)
usr.sbin/btattach/init_bcm2035.c
55
uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_bcm2035.c
57
uart_recv_cc(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_bcm2035.c
73
uart_send_cmd(fd, HCI_CMD_BCM2035_SET_UART_BAUD_RATE, &rate, sizeof(rate));
usr.sbin/btattach/init_bcm2035.c
74
uart_recv_cc(fd, HCI_CMD_BCM2035_SET_UART_BAUD_RATE, NULL, 0);
usr.sbin/btattach/init_bcm43xx.c
105
if (uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0))
usr.sbin/btattach/init_bcm43xx.c
107
uart_recv_cc(fd, HCI_CMD_RESET, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
110
if (bcm43xx_get_local_name(fd, local_name, sizeof(local_name)) != 0) {
usr.sbin/btattach/init_bcm43xx.c
123
uart_send_cmd(fd, HCI_CMD_43XXFWDN, NULL, 0);
usr.sbin/btattach/init_bcm43xx.c
124
uart_recv_cc(fd, HCI_CMD_43XXFWDN, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
133
uart_send_cmd(fd, fw_cmd, &fw_buf[4], fw_len);
usr.sbin/btattach/init_bcm43xx.c
134
uart_recv_cc(fd, fw_cmd, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
140
uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_bcm43xx.c
141
uart_recv_cc(fd, HCI_CMD_RESET, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
149
uart_send_cmd(fd, HCI_CMD_BCM43XX_SET_CLOCK, &clock, sizeof(clock));
usr.sbin/btattach/init_bcm43xx.c
150
uart_recv_cc(fd, HCI_CMD_BCM43XX_SET_CLOCK, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
157
uart_send_cmd(fd, HCI_CMD_BCM43XX_SET_UART_BAUD_RATE, &rate, sizeof(rate));
usr.sbin/btattach/init_bcm43xx.c
158
uart_recv_cc(fd, HCI_CMD_BCM43XX_SET_UART_BAUD_RATE, &resp, sizeof(resp));
usr.sbin/btattach/init_bcm43xx.c
71
bcm43xx_get_local_name(int fd, char *name, size_t namelen)
usr.sbin/btattach/init_bcm43xx.c
78
uart_send_cmd(fd, HCI_CMD_GET_LOCAL_NAME, NULL, 0);
usr.sbin/btattach/init_bcm43xx.c
79
len = uart_recv_cc(fd, HCI_CMD_GET_LOCAL_NAME, buf, sizeof(buf));
usr.sbin/btattach/init_bcm43xx.c
92
init_bcm43xx(int fd, unsigned int speed)
usr.sbin/btattach/init_bgb2xx.c
58
init_bgb2xx(int fd, unsigned int speed)
usr.sbin/btattach/init_bgb2xx.c
70
uart_send_cmd(fd, HCI_CMD_ST_STORE_IN_NVDS, &cp, sizeof(cp));
usr.sbin/btattach/init_bgb2xx.c
71
uart_recv_cc(fd, HCI_CMD_ST_STORE_IN_NVDS, NULL, 0);
usr.sbin/btattach/init_bgb2xx.c
74
uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_bgb2xx.c
75
uart_recv_cc(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_csr.c
101
uart_send_cmd(fd, HCI_CMD_CSR_EXTN, &cmd, sizeof(cmd));
usr.sbin/btattach/init_csr.c
102
uart_recv_cc(fd, HCI_CMD_CSR_EXTN, NULL, 0);
usr.sbin/btattach/init_csr.c
83
init_csr(int fd, unsigned int speed)
usr.sbin/btattach/init_digi.c
48
init_digi(int fd, unsigned int speed)
usr.sbin/btattach/init_digi.c
59
uart_send_cmd(fd, HCI_CMD_DIGIANSWER_SET_UART_BAUD_RATE, &rate, sizeof(rate));
usr.sbin/btattach/init_ericsson.c
45
init_ericsson(int fd, unsigned int speed)
usr.sbin/btattach/init_ericsson.c
84
uart_send_cmd(fd, HCI_CMD_ERICSSON_SET_UART_BAUD_RATE, &rate, sizeof(rate));
usr.sbin/btattach/init_st.c
48
init_st(int fd, unsigned int speed)
usr.sbin/btattach/init_st.c
65
uart_send_cmd(fd, HCI_CMD_ST_SET_UART_BAUD_RATE, &rate, sizeof(rate));
usr.sbin/btattach/init_stlc2500.c
106
init_stlc2500(int fd, unsigned int speed)
usr.sbin/btattach/init_stlc2500.c
114
init_ericsson(fd, speed);
usr.sbin/btattach/init_stlc2500.c
116
if (tcgetattr(fd, &tio) != 0 ||
usr.sbin/btattach/init_stlc2500.c
118
tcsetattr(fd, TCSANOW, &tio) != 0)
usr.sbin/btattach/init_stlc2500.c
121
uart_send_cmd(fd, HCI_CMD_READ_LOCAL_VER, NULL, 0);
usr.sbin/btattach/init_stlc2500.c
122
n = uart_recv_cc(fd, HCI_CMD_READ_LOCAL_VER, &rp, sizeof(rp));
usr.sbin/btattach/init_stlc2500.c
126
if (firmload_stlc2500(fd, rp.hci_revision, "ptc") < 0)
usr.sbin/btattach/init_stlc2500.c
129
if (firmload_stlc2500(fd, rp.hci_revision, "ssf") < 0)
usr.sbin/btattach/init_stlc2500.c
136
uart_send_cmd(fd, HCI_CMD_ST_STORE_IN_NVDS, &cp, sizeof(cp));
usr.sbin/btattach/init_stlc2500.c
137
uart_recv_cc(fd, HCI_CMD_ST_STORE_IN_NVDS, NULL, 0);
usr.sbin/btattach/init_stlc2500.c
141
uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_stlc2500.c
142
uart_recv_cc(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_stlc2500.c
64
firmload_stlc2500(int fd, uint16_t revision, const char *ext)
usr.sbin/btattach/init_stlc2500.c
92
uart_send_cmd(fd, HCI_CMD_ST_LOAD_FIRMWARE, buf, (size_t)(n + 1));
usr.sbin/btattach/init_stlc2500.c
93
n = uart_recv_cc(fd, HCI_CMD_ST_LOAD_FIRMWARE, buf, 1);
usr.sbin/btattach/init_swave.c
101
uart_send_cmd(fd, HCI_CMD_RESET, NULL, 0);
usr.sbin/btattach/init_swave.c
63
init_swave(int fd, unsigned int speed)
usr.sbin/btattach/init_swave.c
84
uart_send_cmd(fd, HCI_CMD_SWAVE_PARAM_ACCESS_SET, &cp, sizeof(cp));
usr.sbin/btattach/init_swave.c
92
n = uart_recv_ev(fd, HCI_EVENT_VENDOR, &rp, sizeof(rp));
usr.sbin/btattach/init_unistone.c
100
infineon_manufacturer_mode(fd, 1);
usr.sbin/btattach/init_unistone.c
102
uart_send_cmd(fd, HCI_CMD_INFINEON_SET_UART_BAUDRATE, &rate,
usr.sbin/btattach/init_unistone.c
105
n = uart_recv_ev(fd, HCI_EVENT_COMMAND_STATUS, &cs, sizeof(cs));
usr.sbin/btattach/init_unistone.c
112
tcsetattr(fd, TCSANOW, &tio) != 0)
usr.sbin/btattach/init_unistone.c
115
n = uart_recv_ev(fd, HCI_EVENT_VENDOR, &v, sizeof(v));
usr.sbin/btattach/init_unistone.c
121
infineon_manufacturer_mode(fd, 0);
usr.sbin/btattach/init_unistone.c
54
infineon_manufacturer_mode(int fd, int enable)
usr.sbin/btattach/init_unistone.c
63
uart_send_cmd(fd, 0xfc11, cmd, sizeof(cmd));
usr.sbin/btattach/init_unistone.c
64
n = uart_recv_cc(fd, 0xfc11, &rp, sizeof(rp));
usr.sbin/btattach/init_unistone.c
73
init_unistone(int fd, unsigned int speed)
usr.sbin/btattach/init_unistone.c
97
if (tcgetattr(fd, &tio) != 0)
usr.sbin/btdevctl/btdevctl.c
238
int fd;
usr.sbin/btdevctl/btdevctl.c
240
fd = open(BTHUB_PATH, O_WRONLY, 0);
usr.sbin/btdevctl/btdevctl.c
241
if (fd < 0)
usr.sbin/btdevctl/btdevctl.c
244
if (prop_dictionary_send_ioctl(dict, fd, cmd))
usr.sbin/btdevctl/btdevctl.c
247
close(fd);
usr.sbin/bthcid/client.c
142
int fd;
usr.sbin/bthcid/client.c
146
fd = accept(sock, (struct sockaddr *)&un, &n);
usr.sbin/bthcid/client.c
147
if (fd < 0) {
usr.sbin/bthcid/client.c
153
if (ioctl(fd, FIONBIO, &n) < 0) {
usr.sbin/bthcid/client.c
155
close(fd);
usr.sbin/bthcid/client.c
162
close(fd);
usr.sbin/bthcid/client.c
167
cl->fd = fd;
usr.sbin/bthcid/client.c
169
event_set(&cl->ev, fd, EV_READ | EV_PERSIST, process_client, cl);
usr.sbin/bthcid/client.c
173
close(fd);
usr.sbin/bthcid/client.c
271
if (send(cl->fd, &cp, sizeof(cp), MSG_NOSIGNAL) != sizeof(cp))
usr.sbin/bthcid/client.c
310
process_item(int fd, short ev, void *arg)
usr.sbin/bthcid/client.c
57
int fd; /* client descriptor */
usr.sbin/bthcid/config.c
128
int fd;
usr.sbin/bthcid/config.c
184
fd = open(new_key_file, O_WRONLY|O_TRUNC|O_CREAT|O_EXLOCK, 0600);
usr.sbin/bthcid/config.c
185
if (fd < 0) {
usr.sbin/bthcid/config.c
192
if ((size_t)write(fd, xml, len) != len) {
usr.sbin/bthcid/config.c
195
close(fd);
usr.sbin/bthcid/config.c
201
close(fd);
usr.sbin/bthcid/config.c
57
int fd;
usr.sbin/bthcid/config.c
59
fd = open(key_file, O_RDONLY, 0);
usr.sbin/bthcid/config.c
60
if (fd < 0)
usr.sbin/bthcid/config.c
63
len = lseek(fd, 0, SEEK_END);
usr.sbin/bthcid/config.c
65
close(fd);
usr.sbin/bthcid/config.c
71
close(fd);
usr.sbin/bthcid/config.c
75
(void)lseek(fd, 0, SEEK_SET);
usr.sbin/bthcid/config.c
76
if (read(fd, xml, len) != len) {
usr.sbin/bthcid/config.c
78
close(fd);
usr.sbin/bthcid/config.c
84
close(fd);
usr.sbin/btpand/bnep.c
732
nw = writev(chan->fd, iov, __arraycount(iov));
usr.sbin/btpand/btpand.c
259
int fd;
usr.sbin/btpand/btpand.c
267
fd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/btpand/btpand.c
268
if (fd == -1) {
usr.sbin/btpand/btpand.c
271
(void)dup2(fd, STDIN_FILENO);
usr.sbin/btpand/btpand.c
272
(void)dup2(fd, STDOUT_FILENO);
usr.sbin/btpand/btpand.c
273
(void)dup2(fd, STDERR_FILENO);
usr.sbin/btpand/btpand.c
274
close(fd);
usr.sbin/btpand/btpand.h
83
int fd;
usr.sbin/btpand/channel.c
102
event_set(&chan->wr_ev, fd, EV_WRITE, channel_start, chan);
usr.sbin/btpand/channel.c
105
chan->fd = fd;
usr.sbin/btpand/channel.c
107
log_debug("(fd#%d)", chan->fd);
usr.sbin/btpand/channel.c
119
log_debug("(fd#%d)", chan->fd);
usr.sbin/btpand/channel.c
124
close(chan->fd);
usr.sbin/btpand/channel.c
155
channel_start(int fd, short ev, void *arg)
usr.sbin/btpand/channel.c
184
channel_read(int fd, short ev, void *arg)
usr.sbin/btpand/channel.c
196
nr = read(fd, pkt->buf, chan->mru);
usr.sbin/btpand/channel.c
204
log_debug("(fd#%d) EOF", fd);
usr.sbin/btpand/channel.c
272
channel_start(chan->fd, EV_WRITE, chan);
usr.sbin/btpand/channel.c
296
channel_watchdog(int fd, short ev, void *arg)
usr.sbin/btpand/channel.c
72
channel_open(channel_t *chan, int fd)
usr.sbin/btpand/channel.c
91
if (ioctl(fd, FIONBIO, &n) == -1) {
usr.sbin/btpand/channel.c
96
event_set(&chan->rd_ev, fd, EV_READ | EV_PERSIST, channel_read, chan);
usr.sbin/btpand/client.c
106
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) {
usr.sbin/btpand/client.c
112
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1)
usr.sbin/btpand/client.c
117
if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) {
usr.sbin/btpand/client.c
127
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, &len) == -1) {
usr.sbin/btpand/client.c
129
close(fd);
usr.sbin/btpand/client.c
134
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) == -1) {
usr.sbin/btpand/client.c
136
close(fd);
usr.sbin/btpand/client.c
141
if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, &n, sizeof(n)) == -1) {
usr.sbin/btpand/client.c
143
close(fd);
usr.sbin/btpand/client.c
160
if (!channel_open(chan, fd))
usr.sbin/btpand/client.c
48
int fd, n;
usr.sbin/btpand/client.c
57
fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
usr.sbin/btpand/client.c
58
if (fd == -1) {
usr.sbin/btpand/client.c
67
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/btpand/client.c
72
if (setsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_LM,
usr.sbin/btpand/client.c
79
if (setsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_IMTU,
usr.sbin/btpand/client.c
90
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/btpand/client.c
96
if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_IMTU, &mru, &len) == -1) {
usr.sbin/btpand/server.c
105
getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_LM, &l2cap_mode, &len);
usr.sbin/btpand/server.c
108
if (setsockopt(fd, BTPROTO_L2CAP,
usr.sbin/btpand/server.c
114
if (listen(fd, 0) == -1) {
usr.sbin/btpand/server.c
119
event_set(&server_ev, fd, EV_READ | EV_PERSIST, server_read, NULL);
usr.sbin/btpand/server.c
137
int fd, n;
usr.sbin/btpand/server.c
143
fd = accept(s, (struct sockaddr *)&ra, &len);
usr.sbin/btpand/server.c
144
if (fd == -1)
usr.sbin/btpand/server.c
148
if (ioctl(fd, FIONBIO, &n) == -1) {
usr.sbin/btpand/server.c
150
close(fd);
usr.sbin/btpand/server.c
155
if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_IMTU, &mru, &len) == -1) {
usr.sbin/btpand/server.c
157
close(fd);
usr.sbin/btpand/server.c
162
close(fd);
usr.sbin/btpand/server.c
167
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) {
usr.sbin/btpand/server.c
169
close(fd);
usr.sbin/btpand/server.c
174
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1)
usr.sbin/btpand/server.c
179
if (getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) {
usr.sbin/btpand/server.c
181
close(fd);
usr.sbin/btpand/server.c
186
close(fd);
usr.sbin/btpand/server.c
191
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, &len) == -1) {
usr.sbin/btpand/server.c
193
close(fd);
usr.sbin/btpand/server.c
198
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) == -1) {
usr.sbin/btpand/server.c
200
close(fd);
usr.sbin/btpand/server.c
205
if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, &n, sizeof(n)) == -1) {
usr.sbin/btpand/server.c
207
close(fd);
usr.sbin/btpand/server.c
212
if (getsockname(fd, (struct sockaddr *)&la, &len) == -1) {
usr.sbin/btpand/server.c
214
close(fd);
usr.sbin/btpand/server.c
222
close(fd);
usr.sbin/btpand/server.c
235
if (!channel_open(chan, fd)) {
usr.sbin/btpand/server.c
238
close(fd);
usr.sbin/btpand/server.c
81
int fd;
usr.sbin/btpand/server.c
83
fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
usr.sbin/btpand/server.c
84
if (fd == -1) {
usr.sbin/btpand/server.c
94
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/btpand/server.c
99
if (setsockopt(fd, BTPROTO_L2CAP,
usr.sbin/btpand/tap.c
122
if (!channel_open(chan, fd))
usr.sbin/btpand/tap.c
174
nw = writev(chan->fd, iov, __arraycount(iov));
usr.sbin/btpand/tap.c
55
int fd, s;
usr.sbin/btpand/tap.c
57
fd = open(interface_name, O_RDWR);
usr.sbin/btpand/tap.c
58
if (fd == -1) {
usr.sbin/btpand/tap.c
64
if (ioctl(fd, TAPGIFNAME, &ifr) == -1) {
usr.sbin/cpuctl/arch/aarch64.c
1127
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/arch/aarch64.c
1220
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/arm.c
222
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/arch/arm.c
278
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/i386.c
1967
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/arch/i386.c
2397
if (ioctl(fd, IOC_CPU_UCODE_GET_VERSION, &ucode) < 0) {
usr.sbin/cpuctl/arch/i386.c
2406
if (ioctl(fd, IOC_CPU_UCODE_GET_VERSION_64, &ucode_64) < 0)
usr.sbin/cpuctl/arch/i386.c
2591
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/i386.c
2609
res = ioctl(fd, IOC_CPU_UCODE_GET_VERSION, &versreq);
usr.sbin/cpuctl/arch/noarch.c
42
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/arch/noarch.c
56
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/sparc.c
47
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/arch/sparc.c
94
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/sparc64.c
123
ucodeupdate_check(int fd, struct cpu_ucode *uc)
usr.sbin/cpuctl/arch/sparc64.c
47
identifycpu(int fd, const char *cpuname)
usr.sbin/cpuctl/cpuctl.c
107
if ((fd = open(_PATH_CPUCTL, O_RDWR)) < 0)
usr.sbin/cpuctl/cpuctl.c
125
close(fd);
usr.sbin/cpuctl/cpuctl.c
153
if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
156
if (ioctl(fd, IOC_CPU_SETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
168
if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
171
if (ioctl(fd, IOC_CPU_SETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
183
if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
186
if (ioctl(fd, IOC_CPU_SETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
198
if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
201
if (ioctl(fd, IOC_CPU_SETSTATE, &cs) < 0) {
usr.sbin/cpuctl/cpuctl.c
233
error = ucodeupdate_check(fd, &uc);
usr.sbin/cpuctl/cpuctl.c
249
error = ioctl(fd, IOC_CPU_UCODE_APPLY, &uc);
usr.sbin/cpuctl/cpuctl.c
289
identifycpu(fd, name);
usr.sbin/cpuctl/cpuctl.c
323
if (ioctl(fd, IOC_CPU_GETCOUNT, &cnt) < 0)
usr.sbin/cpuctl/cpuctl.c
332
if (ioctl(fd, IOC_CPU_GETSTATE, &cs) < 0)
usr.sbin/cpuctl/cpuctl.c
334
if (ioctl(fd, IOC_CPU_MAPID, &cs.cs_id) < 0)
usr.sbin/cpuctl/cpuctl.c
85
static int fd;
usr.sbin/crash/crash.c
353
int fd, ch, flags;
usr.sbin/crash/crash.c
396
fd = open(nlistf, O_RDONLY);
usr.sbin/crash/crash.c
397
if (fd == -1) {
usr.sbin/crash/crash.c
400
if (fstat(fd, &sb) == -1) {
usr.sbin/crash/crash.c
409
sz = read(fd, elf, sz);
usr.sbin/crash/crash.c
418
elf = mmap(NULL, sz, PROT_READ, MAP_PRIVATE|MAP_FILE, fd, 0);
usr.sbin/dev_mkdb/dev_mkdb.c
75
int fd;
usr.sbin/dev_mkdb/dev_mkdb.c
77
fd = open(db_name_tmp, O_CREAT|O_EXCL|O_WRONLY, FILE_PERMISSION);
usr.sbin/dev_mkdb/dev_mkdb.c
78
if (fd == -1)
usr.sbin/dev_mkdb/dev_mkdb.c
80
if (cdbw_output(db, fd, "NetBSD6 devdb", NULL))
usr.sbin/dev_mkdb/dev_mkdb.c
84
if (close(fd))
usr.sbin/dumpfs/dumpfs.c
175
int fd, i;
usr.sbin/dumpfs/dumpfs.c
179
fd = open(name, O_RDONLY);
usr.sbin/dumpfs/dumpfs.c
181
fd = openpartition(name, O_RDONLY, device, sizeof(device));
usr.sbin/dumpfs/dumpfs.c
184
if (fd == -1)
usr.sbin/dumpfs/dumpfs.c
192
if (lseek(fd, sblock_try[i], SEEK_SET) == (off_t)-1)
usr.sbin/dumpfs/dumpfs.c
194
if (read(fd, &afs, SBLOCKSIZE) != SBLOCKSIZE)
usr.sbin/dumpfs/dumpfs.c
234
rval = print_superblock(&afs, opostblsave, name, fd, sblock_try[i]);
usr.sbin/dumpfs/dumpfs.c
236
rval = print_cgsum(name, fd);
usr.sbin/dumpfs/dumpfs.c
238
rval = print_alt_super(name, fd);
usr.sbin/dumpfs/dumpfs.c
240
rval = print_journal(name, fd);
usr.sbin/dumpfs/dumpfs.c
242
rval = print_cginfo(name, fd);
usr.sbin/dumpfs/dumpfs.c
244
rval = print_inodes(name, fd, 0, afs.fs_ncg);
usr.sbin/dumpfs/dumpfs.c
247
if (fd != -1)
usr.sbin/dumpfs/dumpfs.c
248
(void)close(fd);
usr.sbin/dumpfs/dumpfs.c
295
const char *name, int fd, off_t sblock)
usr.sbin/dumpfs/dumpfs.c
499
print_cgsum(const char *name, int fd)
usr.sbin/dumpfs/dumpfs.c
510
if (lseek(fd,
usr.sbin/dumpfs/dumpfs.c
514
if (read(fd, ccsp, size) != size)
usr.sbin/dumpfs/dumpfs.c
542
print_alt_super(const char *name, int fd)
usr.sbin/dumpfs/dumpfs.c
553
if (pread(fd, &alt, sizeof alt, loc) != sizeof alt) {
usr.sbin/dumpfs/dumpfs.c
559
if (print_superblock(&alt.fs, alt_opostblsave, name, fd, loc)) {
usr.sbin/dumpfs/dumpfs.c
569
print_cginfo(const char *name, int fd)
usr.sbin/dumpfs/dumpfs.c
576
if (dumpcg(name, fd, i))
usr.sbin/dumpfs/dumpfs.c
578
if (ISOPT(opt_inodes) && print_inodes(name, fd, i, 1))
usr.sbin/dumpfs/dumpfs.c
585
print_inodes(const char *name, int fd, int c, int n)
usr.sbin/dumpfs/dumpfs.c
598
if (pread(fd, ino_buf, afs.fs_bsize,
usr.sbin/dumpfs/dumpfs.c
612
dumpcg(const char *name, int fd, int c)
usr.sbin/dumpfs/dumpfs.c
619
if ((cur = lseek(fd, (off_t)(FFS_FSBTODB(&afs, cgtod(&afs, c))) * dev_bsize,
usr.sbin/dumpfs/dumpfs.c
622
if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
usr.sbin/dumpfs/dumpfs.c
764
print_journal(const char *name, int fd)
usr.sbin/dumpfs/dumpfs.c
811
if (lseek(fd, (off_t)(off*blklen) + boff, SEEK_SET)
usr.sbin/dumpfs/dumpfs.c
814
if (read(fd, &jbuf, blklen) != (ssize_t)blklen) {
usr.sbin/dumpfs/dumpfs.c
958
int fd, oerrno;
usr.sbin/dumpfs/dumpfs.c
961
fd = opendisk(name, flags, device, devicelen, 0);
usr.sbin/dumpfs/dumpfs.c
962
if (fd == -1 && errno == ENOENT) {
usr.sbin/dumpfs/dumpfs.c
967
return (fd);
usr.sbin/dumplfs/dumplfs.c
193
int ch, do_allsb, do_ientries, do_segentries, fd, segnum;
usr.sbin/dumplfs/dumplfs.c
242
if ((fd = open(special, O_RDONLY, 0)) < 0)
usr.sbin/dumplfs/dumplfs.c
249
get(fd, LFS_LABELPAD, sbuf, LFS_SBPAD);
usr.sbin/dumplfs/dumplfs.c
256
get(fd, lfs_fsbtob(&lfs_sb1, lfs_sb_getsboff(&lfs_sb1, 0)),
usr.sbin/dumplfs/dumplfs.c
265
get(fd,
usr.sbin/dumplfs/dumplfs.c
287
get(fd, dbtob((off_t)sbdaddr), sbuf, LFS_SBPAD);
usr.sbin/dumplfs/dumplfs.c
311
dump_inoblk(fd, lfs_master, inoaddr, dumpino);
usr.sbin/dumplfs/dumplfs.c
328
dump_ifile(fd, lfs_master, do_ientries, do_segentries, idaddr);
usr.sbin/dumplfs/dumplfs.c
333
dump_segment(fd, seglist->num, seg_addr, lfs_master,
usr.sbin/dumplfs/dumplfs.c
340
dump_segment(fd, segnum, seg_addr, lfs_master,
usr.sbin/dumplfs/dumplfs.c
343
(void)close(fd);
usr.sbin/dumplfs/dumplfs.c
353
dump_ifile(int fd, struct lfs *lfsp, int do_ientries, int do_segentries, daddr_t addr)
usr.sbin/dumplfs/dumplfs.c
369
get(fd, fsbtobyte(lfsp, addr), dpage, psize);
usr.sbin/dumplfs/dumplfs.c
401
get(fd, fsbtobyte(lfsp, pdb), ipage, psize);
usr.sbin/dumplfs/dumplfs.c
430
get(fd, fsbtobyte(lfsp, lfs_dino_getib(lfsp, dip, 0)), indir, psize);
usr.sbin/dumplfs/dumplfs.c
436
get(fd, fsbtobyte(lfsp, thisblock), ipage, psize);
usr.sbin/dumplfs/dumplfs.c
463
get(fd, fsbtobyte(lfsp, lfs_dino_getib(lfsp, dip, 1)), dindir, psize);
usr.sbin/dumplfs/dumplfs.c
468
get(fd, fsbtobyte(lfsp, thisblock), indir, psize);
usr.sbin/dumplfs/dumplfs.c
474
get(fd, fsbtobyte(lfsp, thisblock), ipage, psize);
usr.sbin/dumplfs/dumplfs.c
588
dump_sum(int fd, struct lfs *lfsp, SEGSUM *sp, int segnum, daddr_t addr)
usr.sbin/dumplfs/dumplfs.c
658
get(fd, fsbtobyte(lfsp, lfs_ii_getblock(lfsp, iip)), diblock, lfs_sb_getibsize(lfsp));
usr.sbin/dumplfs/dumplfs.c
716
get(fd, fsbtobyte(lfsp, addr), buf, lfs_sb_getibsize(lfsp));
usr.sbin/dumplfs/dumplfs.c
723
get(fd, fsbtobyte(lfsp, addr), buf, lfs_sb_getfsize(lfsp));
usr.sbin/dumplfs/dumplfs.c
734
get(fd, fsbtobyte(lfsp, addr), buf, lfs_sb_getibsize(lfsp));
usr.sbin/dumplfs/dumplfs.c
753
dump_segment(int fd, int segnum, daddr_t addr, struct lfs *lfsp, int dump_sb)
usr.sbin/dumplfs/dumplfs.c
784
get(fd, sum_offset, sumblock, lfs_sb_getsumsize(lfsp));
usr.sbin/dumplfs/dumplfs.c
814
get(fd, sum_offset, &(lfs_sb.lfs_dlfs_u),
usr.sbin/dumplfs/dumplfs.c
830
nbytes = dump_sum(fd, lfsp, sump, segnum,
usr.sbin/dumplfs/dumplfs.c
970
dump_inoblk(int fd, struct lfs *lfsp, daddr_t daddr, ino_t ino)
usr.sbin/dumplfs/dumplfs.c
978
get(fd, lfs_fsbtob(lfsp, daddr), buf, lfs_sb_getfsize(lfsp));
usr.sbin/dumplfs/misc.c
53
get(int fd, off_t off, void *p, size_t len)
usr.sbin/dumplfs/misc.c
57
if (lseek(fd, off, SEEK_SET) < 0)
usr.sbin/dumplfs/misc.c
59
if ((rbytes = read(fd, p, len)) < 0)
usr.sbin/edquota/edquota.c
1080
fclose(fd);
usr.sbin/edquota/edquota.c
1109
fclose(fd);
usr.sbin/edquota/edquota.c
308
int fd;
usr.sbin/edquota/edquota.c
315
if ((fd = open(qup->qfname, O_WRONLY)) < 0) {
usr.sbin/edquota/edquota.c
318
(void)lseek(fd,
usr.sbin/edquota/edquota.c
321
if (write(fd, &dqblk, sizeof (struct dqblk)) !=
usr.sbin/edquota/edquota.c
324
close(fd);
usr.sbin/edquota/edquota.c
336
int fd;
usr.sbin/edquota/edquota.c
360
if ((fd = open(qfpathname, O_RDONLY)) < 0) {
usr.sbin/edquota/edquota.c
361
fd = open(qfpathname, O_RDWR|O_CREAT, 0640);
usr.sbin/edquota/edquota.c
362
if (fd < 0 && errno != ENOENT) {
usr.sbin/edquota/edquota.c
369
(void)fchown(fd, getuid(),
usr.sbin/edquota/edquota.c
371
(void)fchmod(fd, 0640);
usr.sbin/edquota/edquota.c
373
(void)lseek(fd, (off_t)(id * sizeof(struct dqblk)),
usr.sbin/edquota/edquota.c
375
switch (read(fd, &dqblk, sizeof(struct dqblk))) {
usr.sbin/edquota/edquota.c
389
close(fd);
usr.sbin/edquota/edquota.c
393
close(fd);
usr.sbin/edquota/edquota.c
780
FILE *fd;
usr.sbin/edquota/edquota.c
786
if ((fd = fdopen(dup(outfd), "w")) == NULL)
usr.sbin/edquota/edquota.c
789
fprintf(fd, "Default %s quotas:\n", idtypename);
usr.sbin/edquota/edquota.c
791
fprintf(fd, "Quotas for %s %s:\n", idtypename, name);
usr.sbin/edquota/edquota.c
796
fprintf(fd, "%s (%s):\n", qup->fsname, qup->implementation);
usr.sbin/edquota/edquota.c
799
fprintf(fd, "\tblocks:%s\n",
usr.sbin/edquota/edquota.c
801
fprintf(fd, "\t\t%susage: %s\n", comm,
usr.sbin/edquota/edquota.c
804
fprintf(fd, "\t\t%slimits: soft %s, hard %s\n", comm,
usr.sbin/edquota/edquota.c
810
fprintf(fd, "\t\t%sgrace: %s\n", comm,
usr.sbin/edquota/edquota.c
815
fprintf(fd, "\tinodes:\n");
usr.sbin/edquota/edquota.c
816
fprintf(fd, "\t\t%susage: %s\n", comm,
usr.sbin/edquota/edquota.c
819
fprintf(fd, "\t\t%slimits: soft %s, hard %s\n", comm,
usr.sbin/edquota/edquota.c
825
fprintf(fd, "\t\t%sgrace: %s\n", comm,
usr.sbin/edquota/edquota.c
829
fclose(fd);
usr.sbin/edquota/edquota.c
839
FILE *fd; /* file */
usr.sbin/edquota/edquota.c
863
fd = fdopen(dup(infd), "r");
usr.sbin/edquota/edquota.c
864
if (fd == NULL) {
usr.sbin/edquota/edquota.c
873
while (fgets(line, sizeof(line), fd)) {
usr.sbin/eeprom/eehandlers.c
528
int fd, rval = 0;
usr.sbin/eeprom/eehandlers.c
537
fd = open(path_eeprom, wr == IO_WRITE ? O_RDWR : O_RDONLY, 0640);
usr.sbin/eeprom/eehandlers.c
538
if (fd < 0) {
usr.sbin/eeprom/eehandlers.c
545
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
usr.sbin/eeprom/eehandlers.c
552
if (read(fd, buf2, len) != len) {
usr.sbin/eeprom/eehandlers.c
562
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
usr.sbin/eeprom/eehandlers.c
570
if (write(fd, buf, len) < 0) {
usr.sbin/eeprom/eehandlers.c
581
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
107
if (ioctl(fd, OFIOCGETOPTNODE, (char *)&optnode) < 0) {
usr.sbin/eeprom/ofhandlers.c
108
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
124
if (ioctl(fd, OFIOCGET, (char *)&ofio) < 0) {
usr.sbin/eeprom/ofhandlers.c
125
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
147
if (ioctl(fd, OFIOCSET, (char *)&ofio) < 0) {
usr.sbin/eeprom/ofhandlers.c
148
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
162
if (ioctl(fd, OFIOCGET, (char *)&ofio) < 0) {
usr.sbin/eeprom/ofhandlers.c
163
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
179
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
215
int fd, optnode;
usr.sbin/eeprom/ofhandlers.c
217
if ((fd = open(path_openfirm, O_RDONLY, 0640)) < 0)
usr.sbin/eeprom/ofhandlers.c
220
if (ioctl(fd, OFIOCGETOPTNODE, (char *)&optnode) < 0)
usr.sbin/eeprom/ofhandlers.c
252
if (ioctl(fd, OFIOCNEXTPROP, (char *)&ofio1) < 0) {
usr.sbin/eeprom/ofhandlers.c
253
close(fd);
usr.sbin/eeprom/ofhandlers.c
268
(void)close(fd);
usr.sbin/eeprom/ofhandlers.c
275
if (ioctl(fd, OFIOCGET, (char *)&ofio2) < 0)
usr.sbin/eeprom/ofhandlers.c
97
int fd, optnode;
usr.sbin/eeprom/ofhandlers.c
99
if ((fd = open(path_openfirm, arg ? O_RDWR : O_RDONLY, 0640)) < 0)
usr.sbin/eeprom/ophandlers.c
103
int fd, optnode;
usr.sbin/eeprom/ophandlers.c
105
if ((fd = open(path_openprom, arg ? O_RDWR : O_RDONLY, 0640)) < 0)
usr.sbin/eeprom/ophandlers.c
113
if (ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode) < 0) {
usr.sbin/eeprom/ophandlers.c
114
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
130
if (ioctl(fd, OPIOCGET, (char *)&opio) < 0) {
usr.sbin/eeprom/ophandlers.c
131
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
153
if (ioctl(fd, OPIOCSET, (char *)&opio) < 0) {
usr.sbin/eeprom/ophandlers.c
154
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
168
if (ioctl(fd, OPIOCGET, (char *)&opio) < 0) {
usr.sbin/eeprom/ophandlers.c
169
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
185
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
207
int fd, optnode;
usr.sbin/eeprom/ophandlers.c
209
if ((fd = open(path_openprom, O_RDONLY, 0640)) < 0)
usr.sbin/eeprom/ophandlers.c
212
if (ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode) < 0)
usr.sbin/eeprom/ophandlers.c
244
if (ioctl(fd, OPIOCNEXTPROP, (char *)&opio1) < 0)
usr.sbin/eeprom/ophandlers.c
257
(void)close(fd);
usr.sbin/eeprom/ophandlers.c
264
if (ioctl(fd, OPIOCGET, (char *)&opio2) < 0)
usr.sbin/eeprom/ophandlers.c
84
int fd, rv, optnode;
usr.sbin/eeprom/ophandlers.c
87
if ((fd = open(path_openprom, O_RDONLY)) < 0)
usr.sbin/eeprom/ophandlers.c
91
rv = ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode);
usr.sbin/eeprom/ophandlers.c
92
close (fd);
usr.sbin/eeprom/prephandlers.c
114
if (ioctl(fd, PNVIOCGET, (char *) &nvio) < 0) {
usr.sbin/eeprom/prephandlers.c
115
(void)close(fd);
usr.sbin/eeprom/prephandlers.c
136
if (ioctl(fd, PNVIOCSET, (char *) &nvio) < 0) {
usr.sbin/eeprom/prephandlers.c
137
(void)close(fd);
usr.sbin/eeprom/prephandlers.c
151
if (ioctl(fd, PNVIOCGET, (char *) &nvio) < 0) {
usr.sbin/eeprom/prephandlers.c
152
(void)close(fd);
usr.sbin/eeprom/prephandlers.c
167
(void) close(fd);
usr.sbin/eeprom/prephandlers.c
187
int fd, optnode, nrofvars;
usr.sbin/eeprom/prephandlers.c
189
if ((fd = open(path_prepnvram, O_RDONLY, 0640)) < 0)
usr.sbin/eeprom/prephandlers.c
194
if (ioctl(fd, PNVIOCGETNUMGE, (char *) &nvio1) < 0)
usr.sbin/eeprom/prephandlers.c
213
if (ioctl(fd, PNVIOCGETNEXTNAME, (char *) &nvio1) < 0)
usr.sbin/eeprom/prephandlers.c
224
(void) close(fd);
usr.sbin/eeprom/prephandlers.c
230
if (ioctl(fd, PNVIOCGET, (char *) &nvio2) < 0)
usr.sbin/eeprom/prephandlers.c
242
close(fd);
usr.sbin/eeprom/prephandlers.c
93
int fd;
usr.sbin/eeprom/prephandlers.c
95
if ((fd = open(path_prepnvram, arg ? O_RDWR : O_RDONLY, 0640)) < 0)
usr.sbin/emcfanctl/emcfanctl.c
213
int fd = -1, valid, error = 0, validsub = -1, validsubsub = -1;
usr.sbin/emcfanctl/emcfanctl.c
247
fd = open(argv[0], O_RDWR, 0);
usr.sbin/emcfanctl/emcfanctl.c
248
if (fd == -1) {
usr.sbin/emcfanctl/emcfanctl.c
252
error = emcfan_read_register(fd, EMCFAN_PRODUCT_ID, &product_id, debug);
usr.sbin/emcfanctl/emcfanctl.c
272
error = output_emcfan_info(fd, product_id, product_family, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
286
error = output_emcfan_apd(fd, product_id, product_family, EMCFAN_CHIP_CONFIG, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
299
error = emcfan_rmw_register(fd, EMCFAN_CHIP_CONFIG, 0, apd, __arraycount(apd), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
340
error = output_emcfan_smbusto(fd, product_id, product_family, start_reg, instance, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
353
error = emcfan_rmw_register(fd, start_reg, 0, smbus_timeout, __arraycount(smbus_timeout), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
412
error = output_emcfan_register_read(fd, product_id, product_family, start_reg, end_reg, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
445
error = emcfan_write_register(fd, start_reg, value, debug);
usr.sbin/emcfanctl/emcfanctl.c
584
error = output_emcfan_fan_status(fd, product_id, product_family, start_reg, end_reg, the_fan, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
596
error = output_emcfan_drive(fd, product_id, product_family, start_reg, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
598
error = output_emcfan_divider(fd, product_id, product_family, start_reg, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
611
error = emcfan_write_register(fd, start_reg, value, debug);
usr.sbin/emcfanctl/emcfanctl.c
632
error = output_emcfan_minexpected_rpm(fd, product_id, product_family, start_reg, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
650
error = emcfan_rmw_register(fd, start_reg, value, fan_minexpectedrpm, __arraycount(fan_minexpectedrpm), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
671
error = output_emcfan_edges(fd, product_id, product_family, start_reg, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
689
error = emcfan_rmw_register(fd, start_reg, value, fan_numedges, __arraycount(fan_numedges), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
710
error = output_emcfan_polarity(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
728
error = emcfan_rmw_register(fd, start_reg, 0, fan_polarity, __arraycount(fan_polarity), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
753
error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
756
error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
758
error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg,
usr.sbin/emcfanctl/emcfanctl.c
784
error = emcfan_rmw_register(fd, start_reg, value, fan_pwm_basefreq, __arraycount(fan_pwm_basefreq), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
806
error = output_emcfan_pwm_output_type(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
usr.sbin/emcfanctl/emcfanctl.c
819
error = emcfan_rmw_register(fd, start_reg, 0, fan_pwm_output_type, __arraycount(fan_pwm_output_type), tvalue, debug);
usr.sbin/emcfanctl/emcfanctl.c
849
close(fd);
usr.sbin/emcfanctl/emcfanctloutputs.c
167
output_emcfan_230x_read_reg(int fd, uint8_t product_id, int product_family, uint8_t start, uint8_t end, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
193
err = emcfan_read_register(fd, i, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
223
output_emcfan_register_read(int fd, uint8_t product_id, int product_family, uint8_t start, uint8_t end, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
232
err = output_emcfan_230x_read_reg(fd, product_id, product_family, start, end, jsonify, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
235
err = output_emcfan_230x_read_reg(fd, product_id, product_family, start, end, jsonify, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
243
output_emcfan_minexpected_rpm(int fd, uint8_t product_id, int product_family, uint8_t config_reg, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
252
err = emcfan_read_register(fd, config_reg, &raw_res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
284
output_emcfan_edges(int fd, uint8_t product_id, int product_family, uint8_t config_reg, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
293
err = emcfan_read_register(fd, config_reg, &raw_res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
325
output_emcfan_simple_int(int fd, uint8_t product_id, int product_family, uint8_t reg, const char *what, const char *whatj, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
332
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
355
output_emcfan_drive(int fd, uint8_t product_id, int product_family, uint8_t reg, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
357
return(output_emcfan_simple_int(fd, product_id, product_family, reg, "Drive", "drive_level", jsonify, debug));
usr.sbin/emcfanctl/emcfanctloutputs.c
361
output_emcfan_divider(int fd, uint8_t product_id, int product_family, uint8_t reg, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
363
return(output_emcfan_simple_int(fd, product_id, product_family, reg, "Divider", "frequency_divider", jsonify, debug));
usr.sbin/emcfanctl/emcfanctloutputs.c
367
output_emcfan_pwm_basefreq(int fd, uint8_t product_id, int product_family, uint8_t reg, int the_fan, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
375
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
404
output_emcfan_polarity(int fd, uint8_t product_id, int product_family, uint8_t reg, int the_fan, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
413
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
447
output_emcfan_pwm_output_type(int fd, uint8_t product_id, int product_family, uint8_t reg, int the_fan, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
45
output_emcfan_info(int fd, uint8_t product_id, int product_family, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
456
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
485
output_emcfan_fan_status(int fd, uint8_t product_id, int product_family, uint8_t start_reg, uint8_t end_reg, int the_fan, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
501
err = emcfan_read_register(fd, start_reg, &res[0], debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
504
err = emcfan_read_register(fd, start_reg, &res[0], debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
532
err = emcfan_read_register(fd, i, &res[j], debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
538
err = emcfan_read_register(fd, i, &res[j], debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
54
err = emcfan_read_register(fd, EMCFAN_REVISION, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
581
output_emcfan_apd(int fd, uint8_t product_id, int product_family, uint8_t reg, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
589
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctloutputs.c
615
output_emcfan_smbusto(int fd, uint8_t product_id, int product_family, uint8_t reg, int instance, bool jsonify, bool debug)
usr.sbin/emcfanctl/emcfanctloutputs.c
624
err = emcfan_read_register(fd, reg, &res, debug);
usr.sbin/emcfanctl/emcfanctlutil.c
113
err = emcfan_write_register(fd, reg, current, debug);
usr.sbin/emcfanctl/emcfanctlutil.c
43
emcfan_read_register(int fd, uint8_t reg, uint8_t *res, bool debug)
usr.sbin/emcfanctl/emcfanctlutil.c
47
err = lseek(fd, reg, SEEK_SET);
usr.sbin/emcfanctl/emcfanctlutil.c
49
err = read(fd, res, 1);
usr.sbin/emcfanctl/emcfanctlutil.c
65
emcfan_write_register(int fd, uint8_t reg, uint8_t value, bool debug)
usr.sbin/emcfanctl/emcfanctlutil.c
69
err = lseek(fd, reg, SEEK_SET);
usr.sbin/emcfanctl/emcfanctlutil.c
71
err = write(fd, &value, 1);
usr.sbin/emcfanctl/emcfanctlutil.c
87
emcfan_rmw_register(int fd, uint8_t reg, uint8_t value,
usr.sbin/emcfanctl/emcfanctlutil.c
96
err = emcfan_read_register(fd, reg, &oldcurrent, debug);
usr.sbin/envstat/envstat.c
515
parse_dictionary(int fd)
usr.sbin/envstat/envstat.c
527
rval = prop_dictionary_recv_ioctl(fd, ENVSYS_GETDICTIONARY, &dict);
usr.sbin/extattrctl/extattrctl.c
168
int i, fd;
usr.sbin/extattrctl/extattrctl.c
174
fd = open(argv[0], O_RDONLY);
usr.sbin/extattrctl/extattrctl.c
175
if (fd == -1) {
usr.sbin/extattrctl/extattrctl.c
180
i = read(fd, &uef, sizeof(uef));
usr.sbin/extattrctl/extattrctl.c
183
(void)close(fd);
usr.sbin/extattrctl/extattrctl.c
191
(void)close(fd);
usr.sbin/extattrctl/extattrctl.c
205
close(fd);
usr.sbin/faithd/faithd.c
357
pfd[0].fd = s_wld;
usr.sbin/faithd/faithd.c
359
pfd[1].fd = -1;
usr.sbin/faithd/faithd.c
363
pfd[1].fd = sockfd;
usr.sbin/faithd/ftp.c
101
pfd[4].fd = -1;
usr.sbin/faithd/ftp.c
103
pfd[5].fd = wport4;
usr.sbin/faithd/ftp.c
106
pfd[5].fd = -1;
usr.sbin/faithd/ftp.c
108
pfd[4].fd = pfd[5].fd = -1;
usr.sbin/faithd/ftp.c
242
pfd[0].fd = wport4;
usr.sbin/faithd/ftp.c
288
pfd[0].fd = wport6;
usr.sbin/faithd/ftp.c
82
pfd[0].fd = ctl4;
usr.sbin/faithd/ftp.c
84
pfd[1].fd = ctl6;
usr.sbin/faithd/ftp.c
87
pfd[2].fd = port4;
usr.sbin/faithd/ftp.c
90
pfd[2].fd = -1;
usr.sbin/faithd/ftp.c
92
pfd[3].fd = port6;
usr.sbin/faithd/ftp.c
95
pfd[3].fd = -1;
usr.sbin/faithd/ftp.c
98
pfd[4].fd = wport4;
usr.sbin/flashctl/flashctl.c
115
error = ioctl(fd, FLASH_ERASE_BLOCK, &ep);
usr.sbin/flashctl/flashctl.c
123
error = ioctl(fd, FLASH_GET_INFO, &ip);
usr.sbin/flashctl/flashctl.c
159
error = ioctl(fd, FLASH_GET_INFO, &ip);
usr.sbin/flashctl/flashctl.c
171
error = ioctl(fd, FLASH_BLOCK_ISBAD, &bbp);
usr.sbin/flashctl/flashctl.c
213
error = ioctl(fd, FLASH_BLOCK_MARKBAD, &address);
usr.sbin/flashctl/flashctl.c
225
close(fd);
usr.sbin/flashctl/flashctl.c
58
int fd, error = 0;
usr.sbin/flashctl/flashctl.c
73
fd = open(device, O_RDWR, 0);
usr.sbin/flashctl/flashctl.c
74
if (fd == -1) {
usr.sbin/flashctl/flashctl.c
82
error = ioctl(fd, FLASH_GET_INFO, &ip);
usr.sbin/fssconfig/fssconfig.c
113
int fd, isreg, istmp, ispersistent;
usr.sbin/fssconfig/fssconfig.c
166
fd = mkstemp(fss.fss_bstore);
usr.sbin/fssconfig/fssconfig.c
168
fd = prog_open(fss.fss_bstore, O_CREAT|O_TRUNC|O_WRONLY, 0600);
usr.sbin/fssconfig/fssconfig.c
170
if (fd < 0) {
usr.sbin/fssconfig/fssconfig.c
173
if (prog_fstat(fd, &sbuf) < 0)
usr.sbin/fssconfig/fssconfig.c
178
if (!ispersistent && isreg && ftruncate(fd, bssize) < 0)
usr.sbin/fssconfig/fssconfig.c
180
prog_close(fd);
usr.sbin/fssconfig/fssconfig.c
183
fd = opendisk1(argv[0], O_RDWR, full, sizeof(full), 0, prog_open);
usr.sbin/fssconfig/fssconfig.c
184
if (fd < 0) {
usr.sbin/fssconfig/fssconfig.c
194
if (prog_ioctl(fd, FSSIOCSET, &fss) < 0) {
usr.sbin/fssconfig/fssconfig.c
207
int fd;
usr.sbin/fssconfig/fssconfig.c
216
fd = opendisk1(argv[0], O_RDWR, full, sizeof(full), 0, prog_open);
usr.sbin/fssconfig/fssconfig.c
217
if (fd < 0)
usr.sbin/fssconfig/fssconfig.c
220
if (prog_ioctl(fd, FSSIOCCLR) < 0)
usr.sbin/fssconfig/fssconfig.c
227
int n, fd, flags;
usr.sbin/fssconfig/fssconfig.c
244
fd = opendisk1(dev, O_RDONLY, full, sizeof(full), 0, prog_open);
usr.sbin/fssconfig/fssconfig.c
245
if (fd < 0) {
usr.sbin/fssconfig/fssconfig.c
251
if (prog_ioctl(fd, FSSIOFGET, &flags) < 0)
usr.sbin/fssconfig/fssconfig.c
254
if (prog_ioctl(fd, FSSIOCGET, &fsg) < 0) {
usr.sbin/fssconfig/fssconfig.c
282
prog_close(fd);
usr.sbin/fstyp/fstyp.c
165
int error, fd;
usr.sbin/fstyp/fstyp.c
170
fd = fileno(fp);
usr.sbin/fstyp/fstyp.c
172
error = fstat(fd, &sb);
usr.sbin/fstyp/fstyp.c
179
error = ioctl(fd, DIOCGDINFO, &dl);
usr.sbin/fstyp/fstyp.c
181
error = ioctl(fd, DIOCGWEDGEINFO, &dkw);
usr.sbin/fwctl/fwcontrol.c
1003
send_phy_config(fd, set_root_node, -1);
usr.sbin/fwctl/fwcontrol.c
1009
send_phy_config(fd, -1, set_gap_count);
usr.sbin/fwctl/fwcontrol.c
102
get_dev(int fd, struct fw_devlstreq *data)
usr.sbin/fwctl/fwcontrol.c
1033
link_on(fd, send_link_on);
usr.sbin/fwctl/fwcontrol.c
1039
reset_start(fd, send_reset_start);
usr.sbin/fwctl/fwcontrol.c
1045
show_topology_map(fd);
usr.sbin/fwctl/fwcontrol.c
1054
recvfn = detect_recv_fn(fd, TAG | CHANNEL);
usr.sbin/fwctl/fwcontrol.c
1055
close(fd);
usr.sbin/fwctl/fwcontrol.c
1056
fd = -1;
usr.sbin/fwctl/fwcontrol.c
1060
if (open_dev(&fd, devbase) < 0)
usr.sbin/fwctl/fwcontrol.c
1064
(*recvfn)(fd, recv_data, TAG | CHANNEL, -1);
usr.sbin/fwctl/fwcontrol.c
107
if (ioctl(fd, FW_GDEVLST, data) < 0)
usr.sbin/fwctl/fwcontrol.c
1072
dvsend(fd, send_data, TAG | CHANNEL, -1);
usr.sbin/fwctl/fwcontrol.c
1076
if (fd > 0) {
usr.sbin/fwctl/fwcontrol.c
1077
close(fd);
usr.sbin/fwctl/fwcontrol.c
1078
fd = -1;
usr.sbin/fwctl/fwcontrol.c
112
str2node(int fd, const char *nodestr)
usr.sbin/fwctl/fwcontrol.c
139
get_dev(fd, data);
usr.sbin/fwctl/fwcontrol.c
163
list_dev(int fd)
usr.sbin/fwctl/fwcontrol.c
174
get_dev(fd, data);
usr.sbin/fwctl/fwcontrol.c
191
read_write_quad(int fd, struct fw_eui64 eui, uint32_t addr_lo, int readmode,
usr.sbin/fwctl/fwcontrol.c
221
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwctl/fwcontrol.c
247
send_phy_config(int fd, int root_node, int gap_count)
usr.sbin/fwctl/fwcontrol.c
268
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwctl/fwcontrol.c
274
link_on(int fd, int node)
usr.sbin/fwctl/fwcontrol.c
287
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwctl/fwcontrol.c
293
reset_start(int fd, int node)
usr.sbin/fwctl/fwcontrol.c
311
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwctl/fwcontrol.c
317
set_pri_req(int fd, uint32_t pri_req)
usr.sbin/fwctl/fwcontrol.c
329
get_dev(fd, data);
usr.sbin/fwctl/fwcontrol.c
335
reg = read_write_quad(fd, devinfo->eui, BUGET_REG, 1, 0);
usr.sbin/fwctl/fwcontrol.c
346
read_write_quad(fd, devinfo->eui, BUGET_REG, 0, pri_req);
usr.sbin/fwctl/fwcontrol.c
377
get_crom(int fd, int node, void *crom_buf, int len)
usr.sbin/fwctl/fwcontrol.c
386
get_dev(fd, data);
usr.sbin/fwctl/fwcontrol.c
400
if ((error = ioctl(fd, FW_GCROM, &buf)) < 0)
usr.sbin/fwctl/fwcontrol.c
503
show_topology_map(int fd)
usr.sbin/fwctl/fwcontrol.c
516
if (ioctl(fd, FW_GTPMAP, tmap) < 0)
usr.sbin/fwctl/fwcontrol.c
548
read_phy_registers(int fd, uint8_t *buf, int offset, int len)
usr.sbin/fwctl/fwcontrol.c
555
if (ioctl(fd, FWOHCI_RDPHYREG, &reg) < 0)
usr.sbin/fwctl/fwcontrol.c
564
read_phy_page(int fd, uint8_t *buf, int page, int port)
usr.sbin/fwctl/fwcontrol.c
570
if (ioctl(fd, FWOHCI_WRPHYREG, &reg) < 0)
usr.sbin/fwctl/fwcontrol.c
572
read_phy_registers(fd, buf, 8, 8);
usr.sbin/fwctl/fwcontrol.c
576
dump_phy_registers(int fd)
usr.sbin/fwctl/fwcontrol.c
584
read_phy_registers(fd, (uint8_t *)&b, 0, 8);
usr.sbin/fwctl/fwcontrol.c
606
read_phy_page(fd, (uint8_t *)&p, 0, i);
usr.sbin/fwctl/fwcontrol.c
623
read_phy_page(fd, (uint8_t *)&v, 1, 0);
usr.sbin/fwctl/fwcontrol.c
635
open_dev(int *fd, const char *_devname)
usr.sbin/fwctl/fwcontrol.c
638
if (*fd < 0) {
usr.sbin/fwctl/fwcontrol.c
639
*fd = open(_devname, O_RDWR);
usr.sbin/fwctl/fwcontrol.c
640
if (*fd < 0)
usr.sbin/fwctl/fwcontrol.c
654
detect_recv_fn(int fd, char ich)
usr.sbin/fwctl/fwcontrol.c
673
if (ioctl(fd, FW_SSTBUF, &bufreq) < 0)
usr.sbin/fwctl/fwcontrol.c
679
if (ioctl(fd, FW_SRSTREAM, &isoreq) < 0)
usr.sbin/fwctl/fwcontrol.c
694
len = read(fd, buf, RECV_NUM_PACKET * RECV_PACKET_SZ);
usr.sbin/fwctl/fwcontrol.c
726
int fd = -1, ch, len=1024;
usr.sbin/fwctl/fwcontrol.c
766
if (open_dev(&fd, devbase) < 0) {
usr.sbin/fwctl/fwcontrol.c
771
list_dev(fd);
usr.sbin/fwctl/fwcontrol.c
772
close(fd);
usr.sbin/fwctl/fwcontrol.c
773
fd = -1;
usr.sbin/fwctl/fwcontrol.c
851
send_link_on = str2node(fd, optarg);
usr.sbin/fwctl/fwcontrol.c
872
send_reset_start = str2node(fd, optarg);
usr.sbin/fwctl/fwcontrol.c
950
if (open_dev(&fd, devbase) < 0) {
usr.sbin/fwctl/fwcontrol.c
960
list_dev(fd);
usr.sbin/fwctl/fwcontrol.c
966
dump_phy_registers(fd);
usr.sbin/fwctl/fwcontrol.c
972
if (ioctl(fd, FW_IBUSRST, &tmp) < 0)
usr.sbin/fwctl/fwcontrol.c
979
tmp = str2node(fd, crom_string);
usr.sbin/fwctl/fwcontrol.c
980
get_crom(fd, tmp, crom_buf, len);
usr.sbin/fwctl/fwcontrol.c
988
tmp = str2node(fd, crom_string_hex);
usr.sbin/fwctl/fwcontrol.c
989
get_crom(fd, tmp, crom_buf_hex, len);
usr.sbin/fwctl/fwcontrol.c
997
set_pri_req(fd, priority_budget);
usr.sbin/fwctl/fwdv.c
102
int len, tlen, npad, fd, k, m, vec, lsystem = -1, nb;
usr.sbin/fwctl/fwdv.c
107
fd = STDOUT_FILENO;
usr.sbin/fwctl/fwdv.c
109
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/fwctl/fwdv.c
110
if (fd == -1)
usr.sbin/fwctl/fwdv.c
229
writev(fd, wbuf, vec);
usr.sbin/fwctl/fwdv.c
244
writev(fd, wbuf, vec);
usr.sbin/fwctl/fwdv.c
253
writev(fd, wbuf, vec);
usr.sbin/fwctl/fwdv.c
255
if (fd != STDOUT_FILENO)
usr.sbin/fwctl/fwdv.c
256
close(fd);
usr.sbin/fwctl/fwdv.c
268
int len, tlen, header, fd, frames, packets, vec, offset, nhdr, i;
usr.sbin/fwctl/fwdv.c
287
fd = open(filename, O_RDONLY);
usr.sbin/fwctl/fwdv.c
288
if (fd == -1)
usr.sbin/fwctl/fwdv.c
342
len = read(fd, pbuf + tlen, DSIZE * TNBUF - tlen);
usr.sbin/fwctl/fwdv.c
427
close(fd);
usr.sbin/fwctl/fwmpegts.c
149
int fd, k, len, m, pkt_size, startwr, tlen;
usr.sbin/fwctl/fwmpegts.c
155
fd = STDOUT_FILENO;
usr.sbin/fwctl/fwmpegts.c
157
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/fwctl/fwmpegts.c
158
if (fd == -1)
usr.sbin/fwctl/fwmpegts.c
247
write(fd, pld->payload,
usr.sbin/fwctl/fwmpegts.c
263
if (fd != STDOUT_FILENO)
usr.sbin/fwctl/fwmpegts.c
264
close(fd);
usr.sbin/hdaudioctl/graph.c
173
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/graph.c
196
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/graph.c
49
hdaudioctl_graph(int fd, int argc, char *argv[])
usr.sbin/hdaudioctl/graph.c
78
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/graph.c
94
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/hdaudioctl.c
108
hdaudioctl_list(int fd)
usr.sbin/hdaudioctl/hdaudioctl.c
127
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/hdaudioctl.c
160
hdaudioctl_get(int fd, int argc, char *argv[])
usr.sbin/hdaudioctl/hdaudioctl.c
183
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/hdaudioctl.c
202
hdaudioctl_set(int fd, int argc, char *argv[])
usr.sbin/hdaudioctl/hdaudioctl.c
234
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/hdaudioctl.c
260
hdaudioctl_show(int fd, int argc, char *argv[])
usr.sbin/hdaudioctl/hdaudioctl.c
285
error = prop_dictionary_sendrecv_ioctl(request, fd,
usr.sbin/hdaudioctl/hdaudioctl.c
323
int fd, error;
usr.sbin/hdaudioctl/hdaudioctl.c
344
fd = open(devpath, O_RDWR);
usr.sbin/hdaudioctl/hdaudioctl.c
345
if (fd < 0) {
usr.sbin/hdaudioctl/hdaudioctl.c
353
error = hdaudioctl_list(fd);
usr.sbin/hdaudioctl/hdaudioctl.c
355
error = hdaudioctl_get(fd, argc - 1, argv + 1);
usr.sbin/hdaudioctl/hdaudioctl.c
357
error = hdaudioctl_set(fd, argc - 1, argv + 1);
usr.sbin/hdaudioctl/hdaudioctl.c
359
error = hdaudioctl_graph(fd, argc - 1, argv + 1);
usr.sbin/hdaudioctl/hdaudioctl.c
361
error = hdaudioctl_show(fd, argc - 1, argv + 1);
usr.sbin/hdaudioctl/hdaudioctl.c
365
close(fd);
usr.sbin/hdaudioctl/hdaudioctl.h
1
extern int hdaudioctl_graph(int fd, int argc, char *argv[]);
usr.sbin/i2cscan/i2cscan.c
143
error = iic_smbus_receive_byte(fd, addr, &val, 0);
usr.sbin/i2cscan/i2cscan.c
145
error = iic_smbus_quick_write(fd, addr, 0);
usr.sbin/i2cscan/i2cscan.c
161
int fd;
usr.sbin/i2cscan/i2cscan.c
196
fd = open(dev, O_RDWR);
usr.sbin/i2cscan/i2cscan.c
197
if (fd == -1)
usr.sbin/i2cscan/i2cscan.c
200
do_i2c_scan(*argv, fd, mode);
usr.sbin/i2cscan/i2cscan.c
202
close(fd);
usr.sbin/i2cscan/i2cscan.c
60
iic_smbus_quick_write(int fd, i2c_addr_t addr, int flags)
usr.sbin/i2cscan/i2cscan.c
71
if (ioctl(fd, I2C_IOCTL_EXEC, &iie) == -1)
usr.sbin/i2cscan/i2cscan.c
77
iic_smbus_receive_byte(int fd, i2c_addr_t addr, uint8_t *valp, int flags)
usr.sbin/i2cscan/i2cscan.c
88
if (ioctl(fd, I2C_IOCTL_EXEC, &iie) == -1)
usr.sbin/i2cscan/i2cscan.c
95
do_i2c_scan(const char *dname, int fd, int mode)
usr.sbin/inetd/inetd.c
1530
get_line(int fd, char *buf, int len)
usr.sbin/inetd/inetd.c
1536
n = read(fd, buf, (size_t)(len - count));
usr.sbin/inetd/inetd.c
1553
#define strwrite(fd, buf) (void) write(fd, buf, sizeof(buf)-1)
usr.sbin/inetd/inetd.c
801
#define turnon(fd, opt) \
usr.sbin/inetd/inetd.c
802
setsockopt(fd, SOL_SOCKET, opt, &on, (socklen_t)sizeof(on))
usr.sbin/inetd/ipsec.c
126
ipsecsetup0(int af, int fd, const char *policy, int commit)
usr.sbin/inetd/ipsec.c
151
if (commit && setsockopt(fd, level, opt,
usr.sbin/inetd/ipsec.c
57
ipsecsetup(int af, int fd, const char *policy)
usr.sbin/inetd/ipsec.c
78
error = ipsecsetup0(af, fd, p, true);
usr.sbin/inetd/parse.c
863
nextline(FILE *fd)
usr.sbin/inetd/parse.c
867
if (fgets(line, (int)sizeof(line), fd) == NULL) {
usr.sbin/inetd/parse.c
868
if (ferror(fd) != 0) {
usr.sbin/installboot/arch/i386.c
111
pwrite_validate(int fd, const void *buf, size_t n_bytes, off_t offset)
usr.sbin/installboot/arch/i386.c
119
rv = pwrite(fd, buf, n_bytes, offset);
usr.sbin/installboot/arch/i386.c
124
fsync(fd);
usr.sbin/installboot/arch/i386.c
125
if (pread(fd, r_buf, rv, offset) == rv && memcmp(r_buf, buf, rv) == 0) {
usr.sbin/installboot/evboards.c
1007
int fd = ofw_fd();
usr.sbin/installboot/evboards.c
1009
if (fd == -1)
usr.sbin/installboot/evboards.c
1014
if (ioctl(fd, OFIOCGET, &ofio) < 0) {
usr.sbin/installboot/evboards.c
1022
(void) close(fd);
usr.sbin/installboot/evboards.c
1114
int fd;
usr.sbin/installboot/evboards.c
1124
if ((fd = open(params->dtb, O_RDONLY)) < 0) {
usr.sbin/installboot/evboards.c
1130
if (read(fd, buf, (size_t)sb.st_size) != (ssize_t)sb.st_size) {
usr.sbin/installboot/evboards.c
1135
(void) close(fd);
usr.sbin/installboot/evboards.c
982
int fd = ofw_fd();
usr.sbin/installboot/evboards.c
984
if (fd == -1)
usr.sbin/installboot/evboards.c
987
if (ioctl(fd, OFIOCFINDDEVICE, &ofio) < 0) {
usr.sbin/installboot/evboards.c
992
(void) close(fd);
usr.sbin/iopctl/iopctl.c
102
static int fd;
usr.sbin/iopctl/iopctl.c
130
if ((fd = open(dv, O_RDWR)) < 0)
usr.sbin/iopctl/iopctl.c
135
if (ioctl(fd, IOPIOCGSTATUS, &iov) < 0)
usr.sbin/iopctl/iopctl.c
150
close(fd);
usr.sbin/iopctl/iopctl.c
228
if (ioctl(fd, IOPIOCPT, &pt) < 0)
usr.sbin/iopctl/iopctl.c
252
if (ioctl(fd, IOPIOCGLCT, &iov) < 0)
usr.sbin/iopctl/iopctl.c
398
if (ioctl(fd, IOPIOCRECONFIG))
usr.sbin/iopctl/iopctl.c
412
if (ioctl(fd, IOPIOCGTIDMAP, &iov) < 0)
usr.sbin/irdaattach/irdaattach.c
110
if ((fd = open(dev, O_RDWR | O_NDELAY)) < 0)
usr.sbin/irdaattach/irdaattach.c
119
if (tcsetattr(fd, TCSADRAIN, &tty) < 0)
usr.sbin/irdaattach/irdaattach.c
121
if (ioctl(fd, TIOCSDTR, 0) < 0)
usr.sbin/irdaattach/irdaattach.c
123
if (ioctl(fd, TIOCSLINED, "irframe") < 0)
usr.sbin/irdaattach/irdaattach.c
126
if (ioctl(fd, IRFRAMETTY_GET_DEVICE, &frdev) < 0)
usr.sbin/irdaattach/irdaattach.c
146
if (ioctl(fd, IRFRAMETTY_SET_DONGLE, &dongle) < 0)
usr.sbin/irdaattach/irdaattach.c
54
int fd;
usr.sbin/isibootd/isibootd.c
183
pollfd.fd = station.fd;
usr.sbin/isibootd/isibootd.c
187
read(pollfd.fd, iobuf, iolen); /* returns 1468 */
usr.sbin/isibootd/isibootd.c
272
write(pollfd.fd, fp, ISIBOOT_FRAMELEN);
usr.sbin/isibootd/isibootd.c
365
int fd;
usr.sbin/isibootd/isibootd.c
378
fd = open(_PATH_BPF, O_RDWR, 0);
usr.sbin/isibootd/isibootd.c
383
fd = open(devbpf, O_RDWR, 0);
usr.sbin/isibootd/isibootd.c
384
} while (fd == -1 && errno == EBUSY);
usr.sbin/isibootd/isibootd.c
386
if (fd == -1)
usr.sbin/isibootd/isibootd.c
395
ioctl(fd, BIOCSETIF, &ifr);
usr.sbin/isibootd/isibootd.c
396
ioctl(fd, BIOCGDLT, &type); /* XXX - should check whether EN10MB */
usr.sbin/isibootd/isibootd.c
399
ioctl(fd, BIOCIMMEDIATE, &flag);
usr.sbin/isibootd/isibootd.c
401
ioctl(fd, BIOCGBLEN, &buflen);
usr.sbin/isibootd/isibootd.c
402
ioctl(fd, BIOCSETF, &bpf_pgm);
usr.sbin/isibootd/isibootd.c
409
st->fd = fd;
usr.sbin/isibootd/isibootd.c
81
int fd;
usr.sbin/iteconfig/iteconfig.c
104
if (fd != -1)
usr.sbin/iteconfig/iteconfig.c
105
close(fd);
usr.sbin/iteconfig/iteconfig.c
107
fd = initialize(optarg, &is, &ib, &newis, &newib);
usr.sbin/iteconfig/iteconfig.c
147
if(fd == -1)
usr.sbin/iteconfig/iteconfig.c
151
xioctl(fd, ITEIOCSWINSZ, &newis);
usr.sbin/iteconfig/iteconfig.c
152
xioctl(fd, ITEIOCGWINSZ, &is);
usr.sbin/iteconfig/iteconfig.c
155
xioctl(fd, ITEIOCSBELL, &newib);
usr.sbin/iteconfig/iteconfig.c
156
xioctl(fd, ITEIOCGBELL, &ib);
usr.sbin/iteconfig/iteconfig.c
164
cm = xgetcmap(fd, max_colors);
usr.sbin/iteconfig/iteconfig.c
174
xioctl(fd, VIOCSCMAP, cm);
usr.sbin/iteconfig/iteconfig.c
176
cm = xgetcmap(fd, max_colors);
usr.sbin/iteconfig/iteconfig.c
179
xioctl(fd, TIOCGWINSZ, &ws);
usr.sbin/iteconfig/iteconfig.c
189
close(fd);
usr.sbin/iteconfig/iteconfig.c
194
xioctl(int fd, int cmd, void *addr)
usr.sbin/iteconfig/iteconfig.c
196
if (ioctl(fd, cmd, addr) == -1)
usr.sbin/iteconfig/iteconfig.c
213
xgetcmap(int fd, int ncolors)
usr.sbin/iteconfig/iteconfig.c
223
xioctl(fd, VIOCGCMAP, cm);
usr.sbin/iteconfig/iteconfig.c
262
int fd;
usr.sbin/iteconfig/iteconfig.c
264
fd = open(file, O_RDONLY | O_NONBLOCK);
usr.sbin/iteconfig/iteconfig.c
265
if (fd == -1)
usr.sbin/iteconfig/iteconfig.c
268
xioctl(fd, ITEIOCGWINSZ, is);
usr.sbin/iteconfig/iteconfig.c
269
xioctl(fd, ITEIOCGBELL, ib);
usr.sbin/iteconfig/iteconfig.c
273
return(fd);
usr.sbin/iteconfig/iteconfig.c
86
int ch, fd, i, iflag, max_colors, did_reset;
usr.sbin/iteconfig/iteconfig.c
92
fd = initialize(_PATH_CONSOLE, &is, &ib, &newis, &newib);
usr.sbin/kvm_mkdb/kvm_mkdb.c
114
int fd;
usr.sbin/kvm_mkdb/kvm_mkdb.c
153
if ((fd = open(_PATH_KSYMS, O_RDONLY)) >= 0) {
usr.sbin/kvm_mkdb/kvm_mkdb.c
154
close(fd);
usr.sbin/kvm_mkdb/nlist_aout.c
114
int fd, nr, strsize;
usr.sbin/kvm_mkdb/nlist_aout.c
119
if ((fd = open(name, O_RDONLY, 0)) < 0) {
usr.sbin/kvm_mkdb/nlist_aout.c
125
nr = read(fd, &ebuf, sizeof(struct exec));
usr.sbin/kvm_mkdb/nlist_aout.c
127
(void)close(fd);
usr.sbin/kvm_mkdb/nlist_aout.c
133
(void)close(fd);
usr.sbin/kvm_mkdb/nlist_aout.c
147
if (lseek(fd, N_STROFF(ebuf), SEEK_SET) == -1)
usr.sbin/kvm_mkdb/nlist_aout.c
151
nr = read(fd, (char *)&strsize, sizeof(strsize));
usr.sbin/kvm_mkdb/nlist_aout.c
161
if ((nr = read(fd, strtab, strsize)) != strsize)
usr.sbin/kvm_mkdb/nlist_aout.c
165
if (!(fp = fdopen(fd, "r"))) {
usr.sbin/kvm_mkdb/nlist_coff.c
106
if ((fd = open(name, O_RDONLY, 0)) < 0) {
usr.sbin/kvm_mkdb/nlist_coff.c
110
if (fstat(fd, &st) < 0) {
usr.sbin/kvm_mkdb/nlist_coff.c
122
fd, 0);
usr.sbin/kvm_mkdb/nlist_coff.c
93
int fd, rv;
usr.sbin/kvm_mkdb/nlist_ecoff.c
103
if ((fd = open(name, O_RDONLY, 0)) < 0) {
usr.sbin/kvm_mkdb/nlist_ecoff.c
107
if (fstat(fd, &st) < 0) {
usr.sbin/kvm_mkdb/nlist_ecoff.c
119
fd, 0);
usr.sbin/kvm_mkdb/nlist_ecoff.c
94
int fd, rv;
usr.sbin/kvm_mkdb/nlist_elf32.c
113
int fd, rv, malloced = 0, isksyms;
usr.sbin/kvm_mkdb/nlist_elf32.c
127
if ((fd = open(name, O_RDONLY, 0)) < 0) {
usr.sbin/kvm_mkdb/nlist_elf32.c
131
if (fstat(fd, &st) < 0) {
usr.sbin/kvm_mkdb/nlist_elf32.c
153
MAP_PRIVATE|MAP_FILE, fd, 0);
usr.sbin/kvm_mkdb/nlist_elf32.c
163
if (ioctl(fd, KIOCGSIZE, &allocsiz) < 0)
usr.sbin/kvm_mkdb/nlist_elf32.c
172
if ((readsz = read(fd, mappedfile, mappedsize)) < 0)
usr.sbin/ldpd/mpls_routes.c
112
pfd.fd = route_socket;
usr.sbin/ldpd/socketops.c
861
pfd[0].fd = ls;
usr.sbin/ldpd/socketops.c
865
pfd[1].fd = route_socket;
usr.sbin/ldpd/socketops.c
869
pfd[2].fd = command_socket;
usr.sbin/ldpd/socketops.c
876
pfd[pollsum].fd = hs->socket;
usr.sbin/ldpd/socketops.c
887
pfd[pollsum].fd = csockets[i].socket;
usr.sbin/ldpd/socketops.c
902
pfd[pollsum].fd = p->socket;
usr.sbin/ldpd/socketops.c
910
pfd[pollsum].fd = p->socket;
usr.sbin/ldpd/socketops.c
931
if(pfd[i].fd == ls)
usr.sbin/ldpd/socketops.c
933
else if (pfd[i].fd == route_socket) {
usr.sbin/ldpd/socketops.c
951
} else if (is_hello_socket(pfd[i].fd) == 1) {
usr.sbin/ldpd/socketops.c
953
recv_pdu(pfd[i].fd);
usr.sbin/ldpd/socketops.c
954
} else if (pfd[i].fd == command_socket) {
usr.sbin/ldpd/socketops.c
956
} else if ((cs = is_command_socket(pfd[i].fd))
usr.sbin/ldpd/socketops.c
961
p = get_ldp_peer_by_socket(pfd[i].fd);
usr.sbin/ldpd/socketops.c
966
p = get_ldp_peer_by_socket(pfd[i].fd);
usr.sbin/ldpd/socketops.c
970
if (getsockopt(pfd[i].fd, SOL_SOCKET, SO_ERROR,
usr.sbin/lockstat/elf32.c
100
NAME(loadsym)(int fd)
usr.sbin/lockstat/elf32.c
111
if (pread(fd, &ehdr, sizeof(ehdr), 0) != sizeof(ehdr))
usr.sbin/lockstat/elf32.c
130
sz = pread(fd, &symhdr, sizeof(symhdr), off);
usr.sbin/lockstat/elf32.c
146
if (pread(fd, &strhdr, sizeof(strhdr), off) != sizeof(strhdr))
usr.sbin/lockstat/elf32.c
151
sz = pread(fd, symp, symhdr.sh_size, symhdr.sh_offset);
usr.sbin/lockstat/elf32.c
157
sz = pread(fd, strp, strhdr.sh_size, strhdr.sh_offset);
usr.sbin/lockstat/main.c
169
int eventtype, locktype, ch, nlfd, fd;
usr.sbin/lockstat/main.c
259
fd = open(outf, O_WRONLY | O_CREAT | O_TRUNC, 0600);
usr.sbin/lockstat/main.c
260
if (fd == -1)
usr.sbin/lockstat/main.c
262
outfp = fdopen(fd, "w");
usr.sbin/lpr/common_source/displayq.c
127
fd = open(ST, O_RDONLY);
usr.sbin/lpr/common_source/displayq.c
129
if (fd >= 0) {
usr.sbin/lpr/common_source/displayq.c
130
(void)flock(fd, LOCK_SH);
usr.sbin/lpr/common_source/displayq.c
131
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
133
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
184
fd = open(ST, O_RDONLY);
usr.sbin/lpr/common_source/displayq.c
186
if (fd >= 0) {
usr.sbin/lpr/common_source/displayq.c
187
(void)flock(fd, LOCK_SH);
usr.sbin/lpr/common_source/displayq.c
188
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
190
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
240
fd = getport(RM);
usr.sbin/lpr/common_source/displayq.c
241
if (fd < 0) {
usr.sbin/lpr/common_source/displayq.c
250
if (write(fd, line, (size_t)i) != i)
usr.sbin/lpr/common_source/displayq.c
258
while ((i = read(fd, line, sizeof(line))) > 0) {
usr.sbin/lpr/common_source/displayq.c
264
(void)close(fd);
usr.sbin/lpr/common_source/displayq.c
97
int i, nitems, fd, ret;
usr.sbin/lpr/lpc/cmds.c
126
int pid, fd;
usr.sbin/lpr/lpc/cmds.c
144
if ((fd = open(line, O_WRONLY|O_CREAT, 0760)) < 0)
usr.sbin/lpr/lpc/cmds.c
147
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
188
int fd;
usr.sbin/lpr/lpc/cmds.c
194
fd = open(statfile, O_WRONLY|O_CREAT, 0664);
usr.sbin/lpr/lpc/cmds.c
195
if (fd < 0 || flock(fd, LOCK_EX) < 0) {
usr.sbin/lpr/lpc/cmds.c
197
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
198
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
201
(void)ftruncate(fd, 0);
usr.sbin/lpr/lpc/cmds.c
203
(void)write(fd, "\n", 1);
usr.sbin/lpr/lpc/cmds.c
205
(void)write(fd, msg, strlen(msg));
usr.sbin/lpr/lpc/cmds.c
206
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
455
int fd;
usr.sbin/lpr/lpc/cmds.c
470
if ((fd = open(line, O_WRONLY|O_CREAT, 0670)) < 0)
usr.sbin/lpr/lpc/cmds.c
473
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
528
int fd;
usr.sbin/lpr/lpc/cmds.c
545
if ((fd = open(line, O_WRONLY|O_CREAT, 0770)) < 0)
usr.sbin/lpr/lpc/cmds.c
548
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
559
fd = open(line, O_WRONLY|O_CREAT, 0664);
usr.sbin/lpr/lpc/cmds.c
560
if (fd < 0 || flock(fd, LOCK_EX) < 0) {
usr.sbin/lpr/lpc/cmds.c
563
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
564
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
568
(void)ftruncate(fd, 0);
usr.sbin/lpr/lpc/cmds.c
570
(void)write(fd, "\n", 1);
usr.sbin/lpr/lpc/cmds.c
571
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
583
(void)write(fd, buf, strlen(buf));
usr.sbin/lpr/lpc/cmds.c
584
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
731
int fd, i;
usr.sbin/lpr/lpc/cmds.c
762
fd = open(line, O_RDONLY);
usr.sbin/lpr/lpc/cmds.c
763
if (fd < 0 || flock(fd, LOCK_SH|LOCK_NB) == 0) {
usr.sbin/lpr/lpc/cmds.c
764
if (fd >= 0)
usr.sbin/lpr/lpc/cmds.c
765
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
769
(void)close(fd);
usr.sbin/lpr/lpc/cmds.c
771
fd = open(line, O_RDONLY);
usr.sbin/lpr/lpc/cmds.c
772
if (fd >= 0) {
usr.sbin/lpr/lpc/cmds.c
773
(void)flock(fd, LOCK_SH);
usr.sbin/lpr/lpc/cmds.c
774
(void)fstat(fd, &stbuf);
usr.sbin/lpr/lpc/cmds.c
777
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/lpc/cmds.c
780
(void)close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
823
int fd;
usr.sbin/lpr/lpc/cmds.c
841
if ((fd = open(line, O_WRONLY|O_CREAT, 0760)) < 0)
usr.sbin/lpr/lpc/cmds.c
844
(void)close(fd);
usr.sbin/lpr/lpd/extern.h
43
int fd; /* file descriptor */
usr.sbin/lpr/lpd/key.c
175
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpr/lpd/key.c
178
(void)ioctl(ip->fd, TIOCEXT, &tmp);
usr.sbin/lpr/lpd/lpd.c
325
s = accept(socks[i].fd,
usr.sbin/lpr/lpd/lpd.c
343
(void)close(socks[i].fd);
usr.sbin/lpr/lpd/lpd.c
739
socks[*nfds].fd = s;
usr.sbin/lpr/lpd/lpd.c
807
socks[*nfds].fd = s;
usr.sbin/lpr/lpd/printjob.c
150
int i, nitems, fd;
usr.sbin/lpr/lpd/printjob.c
1537
i.fd = pfd;
usr.sbin/lpr/lpd/printjob.c
1539
if (ioctl(i.fd, TIOCEXCL, (char *)0) < 0) {
usr.sbin/lpr/lpd/printjob.c
1543
if (tcgetattr(i.fd, &i.t) < 0) {
usr.sbin/lpr/lpd/printjob.c
1564
if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0) {
usr.sbin/lpr/lpd/printjob.c
1568
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
usr.sbin/lpr/lpd/printjob.c
158
if ((fd = open(LF, O_WRONLY|O_APPEND, 0664)) < 0) {
usr.sbin/lpr/lpd/printjob.c
160
fd = open(_PATH_DEVNULL, O_WRONLY);
usr.sbin/lpr/lpd/printjob.c
1610
if (i.set && tcsetattr(i.fd, TCSANOW, &i.t) < 0) {
usr.sbin/lpr/lpd/printjob.c
1614
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
usr.sbin/lpr/lpd/printjob.c
162
if (fd > 0) {
usr.sbin/lpr/lpd/printjob.c
1624
int fd;
usr.sbin/lpr/lpd/printjob.c
163
(void) dup2(fd, STDERR_FILENO);
usr.sbin/lpr/lpd/printjob.c
1630
fd = open(ST, O_WRONLY|O_CREAT, 0664);
usr.sbin/lpr/lpd/printjob.c
1631
if (fd < 0 || flock(fd, LOCK_EX) < 0) {
usr.sbin/lpr/lpd/printjob.c
1635
ftruncate(fd, 0);
usr.sbin/lpr/lpd/printjob.c
164
(void) close(fd);
usr.sbin/lpr/lpd/printjob.c
1644
(void)writev(fd, iov, 2);
usr.sbin/lpr/lpd/printjob.c
1645
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
211
if ((fd = mkstemp(tempfile)) != -1) {
usr.sbin/lpr/lpd/printjob.c
212
(void)close(fd);
usr.sbin/lpr/lpd/printjob.c
215
if ((fd = mkstemp(tempremote)) != -1) {
usr.sbin/lpr/lpd/printjob.c
216
(void)close(fd);
usr.sbin/lpr/lpd/recvjob.c
217
int fd, err;
usr.sbin/lpr/lpd/recvjob.c
219
fd = open(file, O_CREAT|O_EXCL|O_WRONLY, FILMOD);
usr.sbin/lpr/lpd/recvjob.c
220
if (fd < 0)
usr.sbin/lpr/lpd/recvjob.c
239
if (write(fd, buf, amt) != amt) {
usr.sbin/lpr/lpd/recvjob.c
244
(void)close(fd);
usr.sbin/lpr/lpd/recvjob.c
89
int fd;
usr.sbin/lpr/lpd/recvjob.c
93
if ((fd = open(LF, O_WRONLY|O_APPEND, 0664)) < 0) {
usr.sbin/lpr/lpd/recvjob.c
95
fd = open(_PATH_DEVNULL, O_WRONLY);
usr.sbin/lpr/lpd/recvjob.c
97
if (fd > 0) {
usr.sbin/lpr/lpd/recvjob.c
98
(void) dup2(fd, STDERR_FILENO);
usr.sbin/lpr/lpd/recvjob.c
99
(void) close(fd);
usr.sbin/lpr/lpr/lpr.c
431
int fd, i, nr;
usr.sbin/lpr/lpr/lpr.c
441
fd = nfile(dfname);
usr.sbin/lpr/lpr/lpr.c
444
if (write(fd, buf, i) != i) {
usr.sbin/lpr/lpr/lpr.c
459
(void)close(fd);
usr.sbin/lpr/lpr/lpr.c
606
int fd;
usr.sbin/lpr/lpr/lpr.c
626
if ((fd = open(file, O_RDONLY)) < 0) {
usr.sbin/lpr/lpr/lpr.c
630
(void)close(fd);
usr.sbin/lpr/lpr/lpr.c
637
fd = access("/", 2);
usr.sbin/lpr/lpr/lpr.c
640
fd = access(file, 2);
usr.sbin/lpr/lpr/lpr.c
643
if (fd == 0)
usr.sbin/lpr/lpr/lpr.c
695
int len, fd, n;
usr.sbin/lpr/lpr/lpr.c
701
if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0)
usr.sbin/lpr/lpr/lpr.c
703
if (flock(fd, LOCK_EX))
usr.sbin/lpr/lpr/lpr.c
707
if ((len = read(fd, buf, sizeof(buf))) > 0) {
usr.sbin/lpr/lpr/lpr.c
721
(void)lseek(fd, (off_t)0, 0);
usr.sbin/lpr/lpr/lpr.c
723
(void)write(fd, buf, strlen(buf));
usr.sbin/lpr/lpr/lpr.c
724
(void)close(fd); /* unlocks as well */
usr.sbin/lptctl/lptctl.c
145
if (ioctl(fd, LPTSFLAGS, &flags) == -1)
usr.sbin/lptctl/lptctl.c
149
if (ioctl(fd, LPTSMODE, &mode) == -1)
usr.sbin/lptctl/lptctl.c
52
int fd, i;
usr.sbin/lptctl/lptctl.c
62
if ((fd = open(argv[1], O_RDONLY, 0)) == -1)
usr.sbin/lptctl/lptctl.c
66
if (ioctl(fd, LPTGFLAGS, &flags) == -1)
usr.sbin/lptctl/lptctl.c
70
if (ioctl(fd, LPTGMODE, &mode) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
203
debug_dump_to_xml_path_table(FILE *fd, off_t sector, int size, int mode)
usr.sbin/makefs/cd9660/cd9660_debug.c
209
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
214
fread(&pttemp, 1, 8, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
217
fread(((unsigned char*)&pttemp) + 8, 1, pttemp.length[0], fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
232
debug_dump_to_xml(FILE *fd)
usr.sbin/makefs/cd9660/cd9660_debug.c
246
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
248
fread(buf, 1, CD9660_SECTOR_SIZE, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
267
debug_dump_to_xml_path_table(fd, t, t2, 721);
usr.sbin/makefs/cd9660/cd9660_debug.c
271
debug_dump_to_xml_path_table(fd, t, t2, 722);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
542
cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
548
if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
552
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
555
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
556
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
557
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
560
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
563
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
564
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
565
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
569
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
571
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
577
cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
595
if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
600
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
602
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
606
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
609
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
611
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
613
fwrite(part_name, strlen(part_name) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
614
fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
615
fwrite(part_type, strlen(part_type) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
616
fseek(fd, 32 - strlen(part_type) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
620
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
623
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
626
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
632
cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
640
if (fseeko(fd, (off_t)diskStructure->boot_catalog_sector *
usr.sbin/makefs/cd9660/cd9660_eltorito.c
657
fwrite(&(e->entry_data.VE), 1, 32, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
668
cd9660_copy_file(diskStructure, fd, t->sector, t->filename);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
680
fseek(fd, 0x1fe, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
682
fwrite(&sig, sizeof(sig), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
688
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
696
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
709
fseek(fd, 0, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
711
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
714
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
718
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
721
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
722
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
728
cd9660_write_apm_partition_entry(fd, 0, total_parts, 1,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
737
cd9660_write_apm_partition_entry(fd,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
745
cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
usr.sbin/makefs/cd9660/cd9660_write.c
102
status = cd9660_write_path_tables(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
112
status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode);
usr.sbin/makefs/cd9660/cd9660_write.c
119
cd9660_write_boot(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
124
cd9660_write_filedata(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
129
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
136
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
145
cd9660_write_volume_descriptors(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
149
cd9660_write_filedata(diskStructure, fd, vd_temp->sector,
usr.sbin/makefs/cd9660/cd9660_write.c
165
cd9660_write_path_table(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
214
return cd9660_write_filedata(diskStructure, fd, sector, buffer_head,
usr.sbin/makefs/cd9660/cd9660_write.c
234
cd9660_write_path_tables(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
236
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
240
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
260
cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode)
usr.sbin/makefs/cd9660/cd9660_write.c
288
ret = cd9660_copy_file(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
306
if (fseeko(fd, working_sector * diskStructure->sectorSize,
usr.sbin/makefs/cd9660/cd9660_write.c
331
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
337
temp->isoDirRecord->length[0], fd);
usr.sbin/makefs/cd9660/cd9660_write.c
339
cd9660_write_rr(diskStructure, fd, temp,
usr.sbin/makefs/cd9660/cd9660_write.c
342
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
349
temp->su_tail_size, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
350
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
362
if ((ret = cd9660_write_file(diskStructure, fd, temp))
usr.sbin/makefs/cd9660/cd9660_write.c
388
cd9660_write_filedata(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
394
curpos = ftello(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
396
if (fseeko(fd, sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
399
success = fwrite(buf, diskStructure->sectorSize * numsecs, 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
401
if (fseeko(fd, curpos, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
411
cd9660_write_buffered(FILE *fd, off_t offset, int buff_len,
usr.sbin/makefs/cd9660/cd9660_write.c
422
cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd, off_t start_sector,
usr.sbin/makefs/cd9660/cd9660_write.c
441
if (fseeko(fd, start_sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
453
fwrite(buf,1,bytes_read,fd);
usr.sbin/makefs/cd9660/cd9660_write.c
454
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
469
cd9660_write_rr(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode,
usr.sbin/makefs/cd9660/cd9660_write.c
476
if (fseeko(fd, sector * diskStructure->sectorSize + offset, SEEK_SET) ==
usr.sbin/makefs/cd9660/cd9660_write.c
481
fwrite(&(myattr->attr), CD9660_SUSP_ENTRY_SIZE(myattr), 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
490
if (fseeko(fd, ((off_t)diskStructure->
usr.sbin/makefs/cd9660/cd9660_write.c
506
if (fseeko(fd, sector * diskStructure->sectorSize + offset,
usr.sbin/makefs/cd9660/cd9660_write.c
65
FILE *fd;
usr.sbin/makefs/cd9660/cd9660_write.c
69
if ((fd = fopen(image, "w+")) == NULL) {
usr.sbin/makefs/cd9660/cd9660_write.c
78
status = cd9660_copy_file(diskStructure, fd, 0,
usr.sbin/makefs/cd9660/cd9660_write.c
88
status = cd9660_write_volume_descriptors(diskStructure, fd);
usr.sbin/makefs/chfs.c
131
if (close(fsopts->fd) == -1) {
usr.sbin/makefs/chfs.c
134
fsopts->fd = -1;
usr.sbin/makefs/chfs.c
166
if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/makefs/chfs.c
171
return fsopts->fd;
usr.sbin/makefs/chfs/chfs_mkfs.c
231
int fd;
usr.sbin/makefs/chfs/chfs_mkfs.c
245
fd = open(longname, O_RDONLY, 0444);
usr.sbin/makefs/chfs/chfs_mkfs.c
246
if (fd == -1)
usr.sbin/makefs/chfs/chfs_mkfs.c
249
while ((len = read(fd, buf, opts->pagesize))) {
usr.sbin/makefs/chfs/chfs_mkfs.c
254
close(fd);
usr.sbin/makefs/chfs/chfs_mkfs.c
262
close(fd);
usr.sbin/makefs/chfs/chfs_mkfs.c
76
retval = write(fsopts->fd, charbuf, len);
usr.sbin/makefs/ffs.c
316
if (close(fsopts->fd) == -1)
usr.sbin/makefs/ffs.c
318
fsopts->fd = -1;
usr.sbin/makefs/ffs.c
490
if ((fsopts->fd = open(image, oflags, 0666)) == -1) {
usr.sbin/makefs/ffs.c
497
if (fstatvfs(fsopts->fd, &sfs) == -1) {
usr.sbin/makefs/ffs.c
509
if (ftruncate(fsopts->fd, bufrem) == -1) {
usr.sbin/makefs/ffs.c
519
if (lseek(fsopts->fd, fsopts->offset, SEEK_SET) == -1) {
usr.sbin/makefs/ffs.c
531
i = write(fsopts->fd, buf, MIN(bufsize, bufrem));
usr.sbin/makefs/ffs.c
577
return (fsopts->fd);
usr.sbin/makefs/ffs/buf.c
161
if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/buf.c
163
rv = write(bp->b_fs->fd, bp->b_data, bytes);
usr.sbin/makefs/ffs/buf.c
82
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1) {
usr.sbin/makefs/ffs/buf.c
88
rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
usr.sbin/makefs/ffs/mkfs.c
838
if (lseek(fsopts->fd, offset, SEEK_SET) < 0)
usr.sbin/makefs/ffs/mkfs.c
841
n = read(fsopts->fd, bf, size);
usr.sbin/makefs/ffs/mkfs.c
861
if (lseek(fsopts->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/mkfs.c
864
n = write(fsopts->fd, bf, size);
usr.sbin/makefs/makefs.c
117
fsoptions.fd = -1;
usr.sbin/makefs/makefs.h
162
int fd; /* file descriptor of image */
usr.sbin/makefs/msdos.c
183
fsopts->fd = open(image, O_RDWR);
usr.sbin/makefs/msdos/msdosfs_vnops.c
432
int error, fd;
usr.sbin/makefs/msdos/msdosfs_vnops.c
460
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/makefs/msdos/msdosfs_vnops.c
466
if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
usr.sbin/makefs/msdos/msdosfs_vnops.c
471
close(fd);
usr.sbin/makefs/msdos/msdosfs_vnops.c
474
close(fd);
usr.sbin/makefs/udf.c
1194
fsopts->fd = dev_fd;
usr.sbin/makefs/v7fs.c
115
if ((fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) {
usr.sbin/makefs/v7fs.c
118
if (lseek(fd, fsopts->size - 1, SEEK_SET) == -1) {
usr.sbin/makefs/v7fs.c
121
if (write(fd, &fd, 1) != 1) {
usr.sbin/makefs/v7fs.c
124
if (lseek(fd, 0, SEEK_SET) == -1) {
usr.sbin/makefs/v7fs.c
127
fsopts->fd = fd;
usr.sbin/makefs/v7fs.c
128
v7fs_mount.device.fd = fd;
usr.sbin/makefs/v7fs.c
159
close(fd);
usr.sbin/makefs/v7fs.c
163
close(fd);
usr.sbin/makefs/v7fs.c
98
int fd, endian, error = 1;
usr.sbin/makefs/v7fs/v7fs_estimate.c
199
(long long)fsopts->size, (long long)fsopts->inodes, fsopts->fd,
usr.sbin/makefs/v7fs/v7fs_populate.c
110
int fd;
usr.sbin/makefs/v7fs/v7fs_populate.c
119
if (read(p->fd, p->buf, sz) != (ssize_t)sz) {
usr.sbin/makefs/v7fs/v7fs_populate.c
140
int fd;
usr.sbin/makefs/v7fs/v7fs_populate.c
167
if ((fd = open(filepath, O_RDONLY)) == -1) {
usr.sbin/makefs/v7fs/v7fs_populate.c
174
&(struct copy_arg){ .fd = fd });
usr.sbin/makefs/v7fs/v7fs_populate.c
177
close(fd);
usr.sbin/makefs/v7fs/v7fs_populate.c
182
close(fd);
usr.sbin/makemandb/apropos-utils.c
1073
term_init(int fd, const char *sa[5])
usr.sbin/makemandb/apropos-utils.c
1079
if (ti_setupterm(&ti, NULL, fd, &error) == -1) {
usr.sbin/makemandb/makemandb.c
758
int fd;
usr.sbin/makemandb/makemandb.c
775
if ((fd = mparse_open(mp, file)) == -1) {
usr.sbin/makemandb/makemandb.c
787
close(fd);
usr.sbin/makemandb/makemandb.c
799
close(fd);
usr.sbin/makemandb/makemandb.c
815
close(fd);
usr.sbin/makemandb/makemandb.c
824
begin_parse(file, mp, rec, fd);
usr.sbin/makemandb/makemandb.c
833
close(fd);
usr.sbin/makemandb/makemandb.c
874
begin_parse(const char *file, struct mparse *mp, mandb_rec *rec, int fd)
usr.sbin/makemandb/makemandb.c
881
mparse_readfd(mp, fd, file);
usr.sbin/map-mbone/mapper.c
909
set[0].fd = igmp_socket;
usr.sbin/mdconfig/mdconfig.c
63
int fd;
usr.sbin/mdconfig/mdconfig.c
83
fd = opendisk(argv[1], O_RDWR, fname, sizeof(fname), 0);
usr.sbin/mdconfig/mdconfig.c
84
if (fd == -1)
usr.sbin/mdconfig/mdconfig.c
94
if (ioctl(fd, MD_SETCONF, &md) == -1)
usr.sbin/memswitch/memswitch.c
314
int fd;
usr.sbin/memswitch/memswitch.c
321
fd = open(PATH_RAMFILE, O_RDONLY);
usr.sbin/memswitch/memswitch.c
322
if (fd < 0 && errno == ENOENT) {
usr.sbin/memswitch/memswitch.c
333
fd = creat(PATH_RAMFILE, 0666);
usr.sbin/memswitch/memswitch.c
334
if (fd < 0)
usr.sbin/memswitch/memswitch.c
336
if (write(fd, modified_values, 256) != 256)
usr.sbin/memswitch/memswitch.c
338
close(fd);
usr.sbin/memswitch/memswitch.c
342
fd = open(PATH_RAMFILE, O_RDONLY);
usr.sbin/memswitch/memswitch.c
344
if (fd < 0)
usr.sbin/memswitch/memswitch.c
346
if (fstat(fd, &st) < 0)
usr.sbin/memswitch/memswitch.c
350
if (read(fd, current_values, 256) != 256)
usr.sbin/memswitch/memswitch.c
352
close(fd);
usr.sbin/memswitch/memswitch.c
415
int fd;
usr.sbin/memswitch/memswitch.c
420
fd = 1; /* standard output */
usr.sbin/memswitch/memswitch.c
422
fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0666);
usr.sbin/memswitch/memswitch.c
423
if (fd < 0)
usr.sbin/memswitch/memswitch.c
427
if (write(fd, current_values, 256) != 256)
usr.sbin/memswitch/memswitch.c
430
if (fd != 1)
usr.sbin/memswitch/memswitch.c
431
close(fd);
usr.sbin/memswitch/memswitch.c
443
int sramfd, fd, i;
usr.sbin/memswitch/memswitch.c
451
fd = 0; /* standard input */
usr.sbin/memswitch/memswitch.c
453
fd = open(name, O_RDONLY);
usr.sbin/memswitch/memswitch.c
454
if (fd < 0)
usr.sbin/memswitch/memswitch.c
458
if (read(fd, modified_values, 256) != 256)
usr.sbin/memswitch/memswitch.c
461
if (fd != 0)
usr.sbin/memswitch/memswitch.c
462
close(fd);
usr.sbin/mld6query/mld6.c
144
set[0].fd = sock;
usr.sbin/mopd/common/common.h
52
int fd; /* File Descriptor */
usr.sbin/mopd/common/device.c
103
tmp.fd = mopOpenDL(&tmp, trans);
usr.sbin/mopd/common/device.c
109
if (tmp.fd != -1) {
usr.sbin/mopd/common/device.c
122
p->fd = tmp.fd;
usr.sbin/mopd/common/device.c
51
int fd;
usr.sbin/mopd/common/device.c
55
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
usr.sbin/mopd/common/device.c
59
if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1)
usr.sbin/mopd/common/device.c
62
close(fd);
usr.sbin/mopd/common/device.c
94
tmp.fd = -1;
usr.sbin/mopd/common/device.c
99
tmp.fd = mopOpenRC(&tmp, trans);
usr.sbin/mopd/common/dl.c
110
(void)fprintf(fd,"Load Number : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
113
(void)fprintf(fd,"Load Address : %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
120
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
124
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
128
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/dl.c
131
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
135
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
150
(void)fprintf(fd,"Mem Address : %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
153
(void)fprintf(fd,"Count : %04x (%d)\n",tmps,tmps);
usr.sbin/mopd/common/dl.c
159
(void)fprintf(fd, "Device Type : %02x ",tmpc);
usr.sbin/mopd/common/dl.c
160
mopPrintDevice(fd, tmpc); (void)fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
163
(void)fprintf(fd,"Format : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
166
(void)fprintf(fd,"Program Type : %02x ",tmpc);
usr.sbin/mopd/common/dl.c
167
mopPrintPGTY(fd, tmpc); (void)fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
176
(void)fprintf(fd,"Software : %02x '%s'\n",tmpc,program);
usr.sbin/mopd/common/dl.c
179
(void)fprintf(fd,"Processor : %02x ",tmpc);
usr.sbin/mopd/common/dl.c
180
mopPrintBPTY(fd, tmpc); (void)fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
182
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/dl.c
188
(void)fprintf(fd,"Load Number : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
191
(void)fprintf(fd,"Error : %02x (",tmpc);
usr.sbin/mopd/common/dl.c
193
(void)fprintf(fd,"no error)\n");
usr.sbin/mopd/common/dl.c
195
(void)fprintf(fd,"error)\n");
usr.sbin/mopd/common/dl.c
202
(void)fprintf(fd, "Device Type : %02x ",tmpc);
usr.sbin/mopd/common/dl.c
203
mopPrintDevice(fd, tmpc); (void)fprintf(fd, "\n");
usr.sbin/mopd/common/dl.c
206
(void)fprintf(fd,"Format : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
209
(void)fprintf(fd,"Memory Size : %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
212
(void)fprintf(fd,"Bits : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
214
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/dl.c
220
(void)fprintf(fd,"Mem Address : %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
227
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
231
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
235
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/dl.c
238
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
241
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
251
(void)fprintf(fd,"Load Number : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
258
(void)fprintf(fd,"Target Name : %02x '",
usr.sbin/mopd/common/dl.c
261
(void)fprintf(fd,"%c",
usr.sbin/mopd/common/dl.c
264
(void)fprintf(fd,"'\n");
usr.sbin/mopd/common/dl.c
267
(void)fprintf(fd,"Target Addr : %02x ",c);
usr.sbin/mopd/common/dl.c
269
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/dl.c
272
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
275
(void)fprintf(fd,"Host Name : %02x '",
usr.sbin/mopd/common/dl.c
278
(void)fprintf(fd,"%c",
usr.sbin/mopd/common/dl.c
281
(void)fprintf(fd,"'\n");
usr.sbin/mopd/common/dl.c
284
(void)fprintf(fd,"Host Addr : %02x ",c);
usr.sbin/mopd/common/dl.c
286
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/dl.c
289
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
293
(void)fprintf(fd,"Host Time : ");
usr.sbin/mopd/common/dl.c
294
mopPrintTime(fd, ucp);
usr.sbin/mopd/common/dl.c
295
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
304
(void)fprintf(fd,"Transfer Addr: %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
39
mopDumpDL(FILE *fd, const u_char *pkt, int trans)
usr.sbin/mopd/common/dl.c
64
(void)fprintf(fd,"Load Number : %02x\n",tmpc);
usr.sbin/mopd/common/dl.c
68
(void)fprintf(fd,"Load Address : %08x\n", tmpl);
usr.sbin/mopd/common/dl.c
76
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
80
(void)fprintf(fd,
usr.sbin/mopd/common/dl.c
85
(void)fprintf(fd, "%02x ",
usr.sbin/mopd/common/dl.c
88
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
92
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/dl.c
99
(void)fprintf(fd,"Xfer Address : %08x\n", tmpl);
usr.sbin/mopd/common/file.c
158
CheckMopFile(int fd)
usr.sbin/mopd/common/file.c
163
if (read(fd, header, 512) != 512)
usr.sbin/mopd/common/file.c
166
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
425
CheckElfFile(int fd)
usr.sbin/mopd/common/file.c
432
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
434
if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
usr.sbin/mopd/common/file.c
635
CheckAOutFile(int fd)
usr.sbin/mopd/common/file.c
643
if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex))
usr.sbin/mopd/common/file.c
646
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/file.c
648
if (read(fd, (char *)&ex_swap, sizeof(ex_swap)) != sizeof(ex_swap))
usr.sbin/mopd/common/file.c
651
(void)lseek(fd, (off_t) 0, SEEK_SET);
usr.sbin/mopd/common/loop-bsd.c
109
if (iflist->fd != -1) {
usr.sbin/mopd/common/loop-bsd.c
110
if (ioctl(iflist->fd, BIOCGBLEN, (caddr_t) & bufsize) < 0)
usr.sbin/mopd/common/loop-bsd.c
125
assert(ii->fd != -1);
usr.sbin/mopd/common/loop-bsd.c
126
set[m].fd = ii->fd;
usr.sbin/mopd/common/loop-bsd.c
136
cc = read(ii->fd, (char *) buf, bufsize);
usr.sbin/mopd/common/loop-bsd.c
145
(lseek(ii->fd, 0, SEEK_CUR) + bufsize) < 0) {
usr.sbin/mopd/common/loop-bsd.c
146
(void) lseek(ii->fd, 0, 0);
usr.sbin/mopd/common/loop-linux2.c
120
if (ii->fd != -1) {
usr.sbin/mopd/common/loop-linux2.c
121
FD_SET(ii->fd, &fds);
usr.sbin/mopd/common/loop-linux2.c
122
if (ii->fd > maxfd)
usr.sbin/mopd/common/loop-linux2.c
123
maxfd = ii->fd;
usr.sbin/mopd/common/loop-linux2.c
134
if (ii->fd != -1) {
usr.sbin/mopd/common/loop-linux2.c
135
if (!FD_ISSET(ii->fd, &listeners))
usr.sbin/mopd/common/loop-linux2.c
139
cc = read(ii->fd, (char *) buf, bufsize);
usr.sbin/mopd/common/pf-linux2.c
255
pfRead(int fd, u_char *buf, int len)
usr.sbin/mopd/common/pf-linux2.c
265
if ((cc = recvfrom(fd, (char *)buf, len, 0, &sa, &fromlen)) <= 0)
usr.sbin/mopd/common/pf-linux2.c
269
for (i = socklist[fd].iflen-1; i >= 0; i--)
usr.sbin/mopd/common/pf-linux2.c
270
if (sa.sa_data[i] != socklist[fd].sa.sa_data[i])
usr.sbin/mopd/common/pf-linux2.c
286
pfWrite(int fd, u_char *buf, int len)
usr.sbin/mopd/common/pf-linux2.c
289
if (sendto(fd, buf, len, 0, &socklist[fd].sa, sizeof(struct sockaddr)) == len)
usr.sbin/mopd/common/pf.c
103
if (ioctl(fd, BIOCIMMEDIATE, &immediate) < 0) {
usr.sbin/mopd/common/pf.c
108
if (ioctl(fd, BIOCSBLEN, &bufsize) < 0) {
usr.sbin/mopd/common/pf.c
112
if (ioctl(fd, BIOCSETIF, (caddr_t) & ifr) < 0) {
usr.sbin/mopd/common/pf.c
118
if (ioctl(fd, BIOCGDLT, (caddr_t) & dlt) < 0) {
usr.sbin/mopd/common/pf.c
128
if (ioctl(fd, BIOCPROMISC, (caddr_t)0) < 0) {
usr.sbin/mopd/common/pf.c
137
if (ioctl(fd, BIOCSETF, (caddr_t) & filter) < 0) {
usr.sbin/mopd/common/pf.c
141
return(fd);
usr.sbin/mopd/common/pf.c
152
int fd;
usr.sbin/mopd/common/pf.c
163
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/common/pf.c
167
if (ioctl(fd, SIOCADDMULTI, (caddr_t)&ifr) < 0) {
usr.sbin/mopd/common/pf.c
169
close(fd);
usr.sbin/mopd/common/pf.c
172
close(fd);
usr.sbin/mopd/common/pf.c
185
int fd;
usr.sbin/mopd/common/pf.c
196
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/mopd/common/pf.c
200
if (ioctl(fd, SIOCDELMULTI, (caddr_t)&ifr) < 0) {
usr.sbin/mopd/common/pf.c
202
close(fd);
usr.sbin/mopd/common/pf.c
205
close(fd);
usr.sbin/mopd/common/pf.c
215
pfRead(int fd, u_char *buf, int len)
usr.sbin/mopd/common/pf.c
217
return(read(fd, buf, len));
usr.sbin/mopd/common/pf.c
225
pfWrite(int fd, const u_char *buf, int len, int trans)
usr.sbin/mopd/common/pf.c
245
if (writev(fd, iov, 2) == len)
usr.sbin/mopd/common/pf.c
73
int fd;
usr.sbin/mopd/common/pf.c
95
fd = open(device, mode);
usr.sbin/mopd/common/pf.c
96
if (fd < 0) {
usr.sbin/mopd/common/print.c
111
(void)fprintf(fd, "MOP DL ");
usr.sbin/mopd/common/print.c
114
(void)fprintf(fd, "MOP RC ");
usr.sbin/mopd/common/print.c
117
(void)fprintf(fd, "MOP LP ");
usr.sbin/mopd/common/print.c
122
(void)fprintf(fd, "MOP DL ");
usr.sbin/mopd/common/print.c
126
(void)fprintf(fd, "MOP RC ");
usr.sbin/mopd/common/print.c
130
(void)fprintf(fd, "MOP LP ");
usr.sbin/mopd/common/print.c
134
(void)fprintf(fd, "MOP ?? ");
usr.sbin/mopd/common/print.c
140
(void)fprintf(fd, "802.3 ");
usr.sbin/mopd/common/print.c
143
mopPrintHWA(fd, src); (void)fprintf(fd," > ");
usr.sbin/mopd/common/print.c
144
mopPrintHWA(fd, dst);
usr.sbin/mopd/common/print.c
146
(void)fprintf(fd, " len %4d code %02x ",len,code);
usr.sbin/mopd/common/print.c
148
(void)fprintf(fd, " len %4d code %02x ",
usr.sbin/mopd/common/print.c
156
(void)fprintf(fd, "MLT ");
usr.sbin/mopd/common/print.c
159
(void)fprintf(fd, "DCM ");
usr.sbin/mopd/common/print.c
162
(void)fprintf(fd, "MLD ");
usr.sbin/mopd/common/print.c
165
(void)fprintf(fd, "ASV ");
usr.sbin/mopd/common/print.c
168
(void)fprintf(fd, "RMD ");
usr.sbin/mopd/common/print.c
171
(void)fprintf(fd, "RPR ");
usr.sbin/mopd/common/print.c
174
(void)fprintf(fd, "RML ");
usr.sbin/mopd/common/print.c
177
(void)fprintf(fd, "RDS ");
usr.sbin/mopd/common/print.c
180
(void)fprintf(fd, "MDD ");
usr.sbin/mopd/common/print.c
183
(void)fprintf(fd, "PLT ");
usr.sbin/mopd/common/print.c
186
(void)fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
193
(void)fprintf(fd, "RID ");
usr.sbin/mopd/common/print.c
196
(void)fprintf(fd, "BOT ");
usr.sbin/mopd/common/print.c
199
(void)fprintf(fd, "SID ");
usr.sbin/mopd/common/print.c
202
(void)fprintf(fd, "RQC ");
usr.sbin/mopd/common/print.c
205
(void)fprintf(fd, "CNT ");
usr.sbin/mopd/common/print.c
208
(void)fprintf(fd, "RVC ");
usr.sbin/mopd/common/print.c
211
(void)fprintf(fd, "RLC ");
usr.sbin/mopd/common/print.c
214
(void)fprintf(fd, "CCP ");
usr.sbin/mopd/common/print.c
217
(void)fprintf(fd, "CRA ");
usr.sbin/mopd/common/print.c
220
(void)fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
227
(void)fprintf(fd, "ALD ");
usr.sbin/mopd/common/print.c
230
(void)fprintf(fd, "PLD ");
usr.sbin/mopd/common/print.c
233
(void)fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
238
(void)fprintf(fd, "??? ");
usr.sbin/mopd/common/print.c
241
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
245
mopPrintHeader(FILE *fd, const u_char *pkt, int trans)
usr.sbin/mopd/common/print.c
254
(void)fprintf(fd,"\nDst : ");
usr.sbin/mopd/common/print.c
255
mopPrintHWA(fd, dst);
usr.sbin/mopd/common/print.c
257
(void)fprintf(fd," MOP Dump/Load Multicast");
usr.sbin/mopd/common/print.c
260
(void)fprintf(fd," MOP Remote Console Multicast");
usr.sbin/mopd/common/print.c
262
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/print.c
264
(void)fprintf(fd,"Src : ");
usr.sbin/mopd/common/print.c
265
mopPrintHWA(fd, src);
usr.sbin/mopd/common/print.c
266
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/print.c
267
(void)fprintf(fd,"Proto : %04x ",proto);
usr.sbin/mopd/common/print.c
272
(void)fprintf(fd, "MOP Dump/Load (802.3)\n");
usr.sbin/mopd/common/print.c
275
(void)fprintf(fd, "MOP Dump/Load\n");
usr.sbin/mopd/common/print.c
281
(void)fprintf(fd, "MOP Remote Console (802.3)\n");
usr.sbin/mopd/common/print.c
284
(void)fprintf(fd, "MOP Remote Console\n");
usr.sbin/mopd/common/print.c
290
(void)fprintf(fd, "MOP Loopback (802.3)\n");
usr.sbin/mopd/common/print.c
293
(void)fprintf(fd, "MOP Loopback\n");
usr.sbin/mopd/common/print.c
297
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
302
(void)fprintf(fd,"Length : %04x (%d)\n",len,len);
usr.sbin/mopd/common/print.c
306
mopPrintMopHeader(FILE *fd, const u_char *pkt, int trans)
usr.sbin/mopd/common/print.c
318
(void)fprintf(fd, "Code : %02x ",code);
usr.sbin/mopd/common/print.c
324
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
328
(void)fprintf(fd, "Dump Complete\n");
usr.sbin/mopd/common/print.c
331
(void)fprintf(fd, "Memory Load\n");
usr.sbin/mopd/common/print.c
334
(void)fprintf(fd, "Assistance volunteer\n");
usr.sbin/mopd/common/print.c
337
(void)fprintf(fd, "Request memory dump\n");
usr.sbin/mopd/common/print.c
340
(void)fprintf(fd, "Request program\n");
usr.sbin/mopd/common/print.c
343
(void)fprintf(fd, "Request memory load\n");
usr.sbin/mopd/common/print.c
346
(void)fprintf(fd, "Request Dump Service\n");
usr.sbin/mopd/common/print.c
349
(void)fprintf(fd, "Memory dump data\n");
usr.sbin/mopd/common/print.c
352
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
356
(void)fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
363
(void)fprintf(fd, "Request ID\n");
usr.sbin/mopd/common/print.c
366
(void)fprintf(fd, "Boot\n");
usr.sbin/mopd/common/print.c
369
(void)fprintf(fd, "System ID\n");
usr.sbin/mopd/common/print.c
372
(void)fprintf(fd, "Request Counters\n");
usr.sbin/mopd/common/print.c
375
(void)fprintf(fd, "Counters\n");
usr.sbin/mopd/common/print.c
378
(void)fprintf(fd, "Reserve Console\n");
usr.sbin/mopd/common/print.c
381
(void)fprintf(fd, "Release Console\n");
usr.sbin/mopd/common/print.c
384
(void)fprintf(fd, "Console Command and Poll\n");
usr.sbin/mopd/common/print.c
387
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
391
(void)fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
398
(void)fprintf(fd, "Active loop data\n");
usr.sbin/mopd/common/print.c
401
(void)fprintf(fd, "Passive looped data\n");
usr.sbin/mopd/common/print.c
404
(void)fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
409
(void)fprintf(fd, "(unknown)\n");
usr.sbin/mopd/common/print.c
415
mopPrintDevice(FILE *fd, u_char device)
usr.sbin/mopd/common/print.c
422
(void)fprintf(fd, "%s '%s'",sname,name);
usr.sbin/mopd/common/print.c
426
mopPrintTime(FILE *fd, const u_char *ap)
usr.sbin/mopd/common/print.c
428
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
435
mopPrintInfo(FILE *fd, const u_char *pkt, int *idx,
usr.sbin/mopd/common/print.c
46
mopPrintHWA(FILE *fd, const u_char *ap)
usr.sbin/mopd/common/print.c
468
(void)fprintf(fd,"Maint Version: %d.%d.%d\n",
usr.sbin/mopd/common/print.c
473
(void)fprintf(fd,"Maint Function: %04x ( ",tmps);
usr.sbin/mopd/common/print.c
474
if (tmps & 1) (void)fprintf(fd, "Loop ");
usr.sbin/mopd/common/print.c
475
if (tmps & 2) (void)fprintf(fd, "Dump ");
usr.sbin/mopd/common/print.c
476
if (tmps & 4) (void)fprintf(fd, "Pldr ");
usr.sbin/mopd/common/print.c
477
if (tmps & 8) (void)fprintf(fd, "MLdr ");
usr.sbin/mopd/common/print.c
478
if (tmps & 16) (void)fprintf(fd, "Boot ");
usr.sbin/mopd/common/print.c
479
if (tmps & 32) (void)fprintf(fd, "CC ");
usr.sbin/mopd/common/print.c
48
(void)fprintf(fd, "%x:%x:%x:%x:%x:%x",
usr.sbin/mopd/common/print.c
480
if (tmps & 64) (void)fprintf(fd, "DLC ");
usr.sbin/mopd/common/print.c
481
if (tmps & 128) (void)fprintf(fd, "CCR ");
usr.sbin/mopd/common/print.c
482
(void)fprintf(fd, ")\n");
usr.sbin/mopd/common/print.c
486
(void)fprintf(fd,"Console User : ");
usr.sbin/mopd/common/print.c
487
mopPrintHWA(fd, ucp);
usr.sbin/mopd/common/print.c
488
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
492
(void)fprintf(fd,"Reserv Timer : %04x (%d)\n",
usr.sbin/mopd/common/print.c
497
(void)fprintf(fd,"Cons Cmd Size: %04x (%d)\n",
usr.sbin/mopd/common/print.c
50
if (ap[0] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
502
(void)fprintf(fd,"Cons Res Size: %04x (%d)\n",
usr.sbin/mopd/common/print.c
507
(void)fprintf(fd,"Hardware Addr: ");
usr.sbin/mopd/common/print.c
508
mopPrintHWA(fd, ucp);
usr.sbin/mopd/common/print.c
509
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
51
if (ap[1] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
513
(void)fprintf(fd,"System Time: ");
usr.sbin/mopd/common/print.c
514
mopPrintTime(fd, ucp);
usr.sbin/mopd/common/print.c
515
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/print.c
519
(void)fprintf(fd,"Comm Device : %02x ",device);
usr.sbin/mopd/common/print.c
52
if (ap[2] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
520
mopPrintDevice(fd, device);
usr.sbin/mopd/common/print.c
521
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
525
(void)fprintf(fd,"Software ID : %02x ",tmpc);
usr.sbin/mopd/common/print.c
527
(void)fprintf(fd,"No software id");
usr.sbin/mopd/common/print.c
53
if (ap[3] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
530
(void)fprintf(fd,"Maintenance system");
usr.sbin/mopd/common/print.c
534
(void)fprintf(fd,"Standard operating system");
usr.sbin/mopd/common/print.c
538
(void)fprintf(fd,"'");
usr.sbin/mopd/common/print.c
54
if (ap[4] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
540
(void)fprintf(fd,"%c",
usr.sbin/mopd/common/print.c
543
(void)fprintf(fd,"'");
usr.sbin/mopd/common/print.c
545
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/print.c
549
(void)fprintf(fd,"System Proc : %02x ",tmpc);
usr.sbin/mopd/common/print.c
55
if (ap[5] < 10) (void)fprintf(fd, " ");
usr.sbin/mopd/common/print.c
552
(void)fprintf(fd, "PDP-11\n");
usr.sbin/mopd/common/print.c
555
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
559
(void)fprintf(fd, "Professional\n");
usr.sbin/mopd/common/print.c
562
(void)fprintf(fd, "Scorpio\n");
usr.sbin/mopd/common/print.c
565
(void)fprintf(fd, "Amber\n");
usr.sbin/mopd/common/print.c
568
(void)fprintf(fd, "XLII Bridge\n");
usr.sbin/mopd/common/print.c
571
(void)fprintf(fd, "Unknown\n");
usr.sbin/mopd/common/print.c
577
(void)fprintf(fd,"Data Link Typ: %02x ",tmpc);
usr.sbin/mopd/common/print.c
580
(void)fprintf(fd, "Ethernet\n");
usr.sbin/mopd/common/print.c
583
(void)fprintf(fd, "DDCMP\n");
usr.sbin/mopd/common/print.c
586
(void)fprintf(fd, "LAPB (X.25)\n");
usr.sbin/mopd/common/print.c
589
(void)fprintf(fd, "Unknown\n");
usr.sbin/mopd/common/print.c
59
mopPrintBPTY(FILE *fd, u_char bpty)
usr.sbin/mopd/common/print.c
595
(void)fprintf(fd,"DL Buff Size : %04x (%d)\n",
usr.sbin/mopd/common/print.c
609
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
613
(void)fprintf(fd,"%c",ucp[i]);
usr.sbin/mopd/common/print.c
615
(void)fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
620
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
624
(void)fprintf(fd, "%c",ucp[i]);
usr.sbin/mopd/common/print.c
626
(void)fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
63
(void)fprintf(fd, "System Processor");
usr.sbin/mopd/common/print.c
630
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
639
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
643
(void)fprintf(fd, "%c",ucp[i]);
usr.sbin/mopd/common/print.c
645
(void)fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
650
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
654
(void)fprintf(fd, "%c",ucp[i]);
usr.sbin/mopd/common/print.c
656
(void)fprintf(fd, "'\n");
usr.sbin/mopd/common/print.c
66
(void)fprintf(fd, "Communication Processor");
usr.sbin/mopd/common/print.c
661
(void)fprintf(fd, "Info Type : %04x (%d)\n",
usr.sbin/mopd/common/print.c
664
(void)fprintf(fd, "Info Data : %02x ",
usr.sbin/mopd/common/print.c
670
(void)fprintf(fd,
usr.sbin/mopd/common/print.c
674
(void)fprintf(fd, "%02x ",ucp[i]);
usr.sbin/mopd/common/print.c
676
(void)fprintf(fd, "\n");
usr.sbin/mopd/common/print.c
69
(void)fprintf(fd, "Unknown");
usr.sbin/mopd/common/print.c
75
mopPrintPGTY(FILE *fd, u_char pgty)
usr.sbin/mopd/common/print.c
79
(void)fprintf(fd, "Secondary Loader");
usr.sbin/mopd/common/print.c
82
(void)fprintf(fd, "Tertiary Loader");
usr.sbin/mopd/common/print.c
85
(void)fprintf(fd, "Operating System");
usr.sbin/mopd/common/print.c
88
(void)fprintf(fd, "Management File");
usr.sbin/mopd/common/print.c
91
(void)fprintf(fd, "Unknown");
usr.sbin/mopd/common/print.c
97
mopPrintOneline(FILE *fd, const u_char *pkt, int trans)
usr.sbin/mopd/common/rc.c
103
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
106
(void)fprintf(fd,"%c",
usr.sbin/mopd/common/rc.c
109
(void)fprintf(fd,"'\n");
usr.sbin/mopd/common/rc.c
113
(void)fprintf(fd,"Software ID : %02x ",tmpc);
usr.sbin/mopd/common/rc.c
115
(void)fprintf(fd,"No software id");
usr.sbin/mopd/common/rc.c
118
(void)fprintf(fd,"Maintenance system");
usr.sbin/mopd/common/rc.c
122
(void)fprintf(fd,"Standard operating system");
usr.sbin/mopd/common/rc.c
126
(void)fprintf(fd,"'");
usr.sbin/mopd/common/rc.c
128
(void)fprintf(fd,"%c",
usr.sbin/mopd/common/rc.c
131
(void)fprintf(fd,"'");
usr.sbin/mopd/common/rc.c
133
(void)fprintf(fd,"'\n");
usr.sbin/mopd/common/rc.c
140
(void)fprintf(fd, "Reserved : %02x\n",tmpc);
usr.sbin/mopd/common/rc.c
143
(void)fprintf(fd, "Receipt Nbr : %04x\n",tmpc);
usr.sbin/mopd/common/rc.c
145
mopPrintInfo(fd, pkt, &idx, moplen, code, trans);
usr.sbin/mopd/common/rc.c
151
(void)fprintf(fd,"Receipt Nbr : %04x\n",tmps);
usr.sbin/mopd/common/rc.c
157
(void)fprintf(fd,"Receipt Nbr : %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
160
(void)fprintf(fd,"Last Zeroed : %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
163
(void)fprintf(fd,"Bytes rec : %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
166
(void)fprintf(fd,"Bytes snd : %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
169
(void)fprintf(fd,"Frames rec : %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
172
(void)fprintf(fd,"Frames snd : %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
175
(void)fprintf(fd,"Mcst Bytes re: %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
178
(void)fprintf(fd,"Mcst Frame re: %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
181
(void)fprintf(fd,"Frame snd,def: %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
184
(void)fprintf(fd,"Frame snd,col: %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
187
(void)fprintf(fd,"Frame snd,mcl: %08x %d\n",tmpl,tmpl);
usr.sbin/mopd/common/rc.c
190
(void)fprintf(fd,"Snd failure : %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
193
(void)fprintf(fd,"Snd fail reas: %04x ",tmps);
usr.sbin/mopd/common/rc.c
194
if ((tmps & 1)) (void)fprintf(fd,"Excess col ");
usr.sbin/mopd/common/rc.c
195
if ((tmps & 2)) (void)fprintf(fd,"Carrier chk fail ");
usr.sbin/mopd/common/rc.c
196
if ((tmps & 4)) (void)fprintf(fd,"Short circ ");
usr.sbin/mopd/common/rc.c
197
if ((tmps & 8)) (void)fprintf(fd,"Open circ ");
usr.sbin/mopd/common/rc.c
198
if ((tmps & 16)) (void)fprintf(fd,"Frm to long ");
usr.sbin/mopd/common/rc.c
199
if ((tmps & 32)) (void)fprintf(fd,"Rem fail to defer ");
usr.sbin/mopd/common/rc.c
200
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
203
(void)fprintf(fd,"Rec failure : %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
206
(void)fprintf(fd,"Rec fail reas: %04x ",tmps);
usr.sbin/mopd/common/rc.c
207
if ((tmps & 1)) (void)fprintf(fd,"Block chk err ");
usr.sbin/mopd/common/rc.c
208
if ((tmps & 2)) (void)fprintf(fd,"Framing err ");
usr.sbin/mopd/common/rc.c
209
if ((tmps & 4)) (void)fprintf(fd,"Frm to long ");
usr.sbin/mopd/common/rc.c
210
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
213
(void)fprintf(fd,"Unrec frm dst: %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
216
(void)fprintf(fd,"Data overrun : %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
219
(void)fprintf(fd,"Sys Buf Unava: %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
222
(void)fprintf(fd,"Usr Buf Unava: %04x %d\n",tmps,tmps);
usr.sbin/mopd/common/rc.c
228
(void)fprintf(fd,"Verification : %08x\n",tmpl);
usr.sbin/mopd/common/rc.c
239
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
242
(void)fprintf(fd,"Break");
usr.sbin/mopd/common/rc.c
243
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
250
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
254
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
258
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/rc.c
261
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
264
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
274
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
277
(void)fprintf(fd,"Cmd Data Lost ");
usr.sbin/mopd/common/rc.c
279
(void)fprintf(fd,"Resp Data Lost ");
usr.sbin/mopd/common/rc.c
280
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
287
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
291
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
295
(void)fprintf(fd,"%02x ",
usr.sbin/mopd/common/rc.c
298
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
301
(void)fprintf(fd,"\n");
usr.sbin/mopd/common/rc.c
39
mopDumpRC(FILE *fd, const u_char *pkt, int trans)
usr.sbin/mopd/common/rc.c
63
(void)fprintf(fd,"Reserved : %02x\n",tmpc);
usr.sbin/mopd/common/rc.c
66
(void)fprintf(fd,"Receipt Nbr : %04x\n",tmps);
usr.sbin/mopd/common/rc.c
73
(void)fprintf(fd,"Verification : %04x\n",tmps);
usr.sbin/mopd/common/rc.c
77
(void)fprintf(fd,"Verification : %08x\n",tmpl);
usr.sbin/mopd/common/rc.c
80
(void)fprintf(fd,"Processor : %02x ",tmpc);
usr.sbin/mopd/common/rc.c
81
mopPrintBPTY(fd, tmpc); (void)fprintf(fd, "\n");
usr.sbin/mopd/common/rc.c
84
(void)fprintf(fd,"Control : %02x ",control);
usr.sbin/mopd/common/rc.c
86
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
89
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
93
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
96
(void)fprintf(fd,
usr.sbin/mopd/common/rc.c
99
(void)fprintf(fd,"\n");
usr.sbin/mopd/mopd/process.c
197
if (pfWrite(ii->fd, pkt, idx, trans) != idx) {
usr.sbin/mopd/mopd/process.c
301
if (pfWrite(dle->ii->fd, pkt, idx, trans) != idx) {
usr.sbin/mopd/mopd/process.c
419
if (pfWrite(dle->ii->fd, pkt, idx, trans) != idx) {
usr.sbin/mopd/mopd/process.c
427
mopProcessDL(FILE *fd, struct if_info *ii, const u_char *pkt, int *idx,
usr.sbin/mopd/mopd/process.c
564
mopProcessRC(FILE *fd, struct if_info *ii, const u_char *pkt, int *idx,
usr.sbin/mountd/mountd.c
290
int fd, oflags;
usr.sbin/mountd/mountd.c
293
fd = rump_sys_open(path, oflags, 0777);
usr.sbin/mountd/mountd.c
294
if (fd == -1)
usr.sbin/mountd/mountd.c
297
return funopen((void *)(uintptr_t)fd,
usr.sbin/moused/moused.c
1333
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
1387
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
2387
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
2440
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
2492
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
896
set[0].fd = rodent.mfd;
usr.sbin/moused/moused.c
898
set[1].fd = rodent.mremsfd;
usr.sbin/moused/moused.c
900
set[2].fd = rodent.mremcfd;
usr.sbin/mrinfo/mrinfo.c
438
set[0].fd = igmp_socket;
usr.sbin/mrouted/defs.h
148
extern int register_input_handler(int fd, ihfunc_t func);
usr.sbin/mrouted/main.c
260
if (ihandlers[i].fd >= FD_SETSIZE)
usr.sbin/mrouted/main.c
262
FD_SET(ihandlers[i].fd, &readers);
usr.sbin/mrouted/main.c
263
if (ihandlers[i].fd >= nfds)
usr.sbin/mrouted/main.c
264
nfds = ihandlers[i].fd + 1;
usr.sbin/mrouted/main.c
345
if (FD_ISSET(ihandlers[i].fd, &rfds)) {
usr.sbin/mrouted/main.c
346
(*ihandlers[i].func)(ihandlers[i].fd, &rfds);
usr.sbin/mrouted/main.c
59
int fd; /* File descriptor */
usr.sbin/mrouted/main.c
83
register_input_handler(int fd, ihfunc_t func)
usr.sbin/mrouted/main.c
88
ihandlers[nhandlers].fd = fd;
usr.sbin/mscdlabel/iso9660.c
38
check_primary_vd(int fd, int start, int len)
usr.sbin/mscdlabel/iso9660.c
47
res = pread(fd, vd, BLKSIZ, (start + i) * BLKSIZ);
usr.sbin/mscdlabel/main.c
127
int fd, res, i, j, rawpart;
usr.sbin/mscdlabel/main.c
137
fd = opendisk(disk, O_RDWR, fullname, MAXPATHLEN, 0);
usr.sbin/mscdlabel/main.c
138
if (fd < 0) {
usr.sbin/mscdlabel/main.c
140
fd = opendisk(disk, O_RDONLY, fullname, MAXPATHLEN, 0);
usr.sbin/mscdlabel/main.c
141
if (fd < 0)
usr.sbin/mscdlabel/main.c
151
if (getcdtoc(fd) < 0 && getfaketoc(fd) < 0)
usr.sbin/mscdlabel/main.c
159
res = ioctl(fd, DIOCGDINFO, &label);
usr.sbin/mscdlabel/main.c
181
&& check_primary_vd(fd, track->addr.lba,
usr.sbin/mscdlabel/main.c
203
res = ioctl(fd, DIOCSDINFO, &label);
usr.sbin/mscdlabel/main.c
210
close(fd);
usr.sbin/mscdlabel/main.c
62
getcdtoc(int fd)
usr.sbin/mscdlabel/main.c
70
res = ioctl(fd, CDIOREADTOCHEADER, &th);
usr.sbin/mscdlabel/main.c
87
res = ioctl(fd, CDIOREADTOCENTRIES, &te);
usr.sbin/mscdlabel/main.c
94
getfaketoc(int fd)
usr.sbin/mscdlabel/main.c
99
res = fstat(fd, &st);
usr.sbin/mtrace/mtrace.c
459
set[0].fd = igmp_socket;
usr.sbin/mtree/compare.c
139
int fd, label;
usr.sbin/mtree/compare.c
409
if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0) {
usr.sbin/mtree/compare.c
414
} else if (crc(fd, &val, &len)) {
usr.sbin/mtree/compare.c
415
close(fd);
usr.sbin/mtree/compare.c
421
close(fd);
usr.sbin/mtree/crc.c
120
crc(int fd, uint32_t *cval, uint32_t *clen)
usr.sbin/mtree/crc.c
133
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.sbin/mtree/create.c
205
int fd, e;
usr.sbin/mtree/create.c
207
if ((fd = open(fname, O_RDONLY)) == -1)
usr.sbin/mtree/create.c
210
e = crc(fd, &val, &len);
usr.sbin/mtree/create.c
211
close(fd);
usr.sbin/ndbootd/config/ndbootd-bpf.c
217
set[0].fd = interface->ndbootd_interface_fd;
usr.sbin/ndbootd/ndbootd.c
337
int fd;
usr.sbin/ndbootd/ndbootd.c
480
fd = getdtablesize();
usr.sbin/ndbootd/ndbootd.c
482
fd = -1;
usr.sbin/ndbootd/ndbootd.c
484
for (; fd >= 0; fd--) {
usr.sbin/ndbootd/ndbootd.c
485
if (fd != interface->ndbootd_interface_fd) {
usr.sbin/ndbootd/ndbootd.c
486
close(fd);
usr.sbin/ndbootd/ndbootd.c
496
if ((fd = open(NDBOOTD_PID_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644)) >= 0) {
usr.sbin/ndbootd/ndbootd.c
498
write(fd, pid_buffer, strlen(pid_buffer));
usr.sbin/ndbootd/ndbootd.c
499
close(fd);
usr.sbin/nfsd/nfsd.c
260
set->fd = sock;
usr.sbin/nfsd/nfsd.c
298
int fd;
usr.sbin/nfsd/nfsd.c
314
(fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
usr.sbin/nfsd/nfsd.c
315
(void)dup2(fd, detach_msg_pipe[0]);
usr.sbin/nfsd/nfsd.c
316
(void)dup2(fd, detach_msg_pipe[1]);
usr.sbin/nfsd/nfsd.c
317
if (fd > STDERR_FILENO)
usr.sbin/nfsd/nfsd.c
318
(void)close(fd);
usr.sbin/nfsd/nfsd.c
358
int fd;
usr.sbin/nfsd/nfsd.c
366
if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
usr.sbin/nfsd/nfsd.c
367
(void)dup2(fd, STDIN_FILENO);
usr.sbin/nfsd/nfsd.c
368
(void)dup2(fd, STDOUT_FILENO);
usr.sbin/nfsd/nfsd.c
369
(void)dup2(fd, STDERR_FILENO);
usr.sbin/nfsd/nfsd.c
370
if (fd > STDERR_FILENO)
usr.sbin/nfsd/nfsd.c
371
(void)close(fd);
usr.sbin/nfsd/nfsd.c
540
set[i].fd = -1;
usr.sbin/nfsd/nfsd.c
548
if (set[i].fd != -1)
usr.sbin/nfsd/nfsd.c
588
if ((msgsock = accept(set[i].fd,
usr.sbin/npf/npfctl/npf_build.c
126
npfctl_config_send(int fd)
usr.sbin/npf/npfctl/npf_build.c
132
error = npf_config_submit(npf_conf, fd, &errinfo);
usr.sbin/npf/npfctl/npf_build.c
145
int fd;
usr.sbin/npf/npfctl/npf_build.c
151
if ((fd = open(outfile, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1) {
usr.sbin/npf/npfctl/npf_build.c
154
if (write(fd, blob, len) != (ssize_t)len) {
usr.sbin/npf/npfctl/npf_build.c
158
close(fd);
usr.sbin/npf/npfctl/npf_cmd.c
108
npfctl_rule(int fd, int argc, char **argv)
usr.sbin/npf/npfctl/npf_cmd.c
158
error = npf_ruleset_add(fd, ruleset_name, rl, &rule_id);
usr.sbin/npf/npfctl/npf_cmd.c
163
error = npf_ruleset_remkey(fd, ruleset_name, key, sizeof(key));
usr.sbin/npf/npfctl/npf_cmd.c
167
error = npf_ruleset_remove(fd, ruleset_name, rule_id);
usr.sbin/npf/npfctl/npf_cmd.c
170
error = npfctl_ruleset_show(fd, ruleset_name);
usr.sbin/npf/npfctl/npf_cmd.c
173
error = npf_ruleset_flush(fd, ruleset_name);
usr.sbin/npf/npfctl/npf_cmd.c
222
npfctl_table_replace(int fd, int argc, char **argv)
usr.sbin/npf/npfctl/npf_cmd.c
268
if ((ncf = npf_config_retrieve(fd)) == NULL) {
usr.sbin/npf/npfctl/npf_cmd.c
285
if (npf_table_replace(fd, t, NULL)) {
usr.sbin/npf/npfctl/npf_cmd.c
291
npfctl_table(int fd, int argc, char **argv)
usr.sbin/npf/npfctl/npf_cmd.c
356
if (ioctl(fd, IOC_NPF_TABLE, &nct) != -1) {
usr.sbin/npf/npfctl/npf_cmd.c
470
npf_conn_list_v(int fd, unsigned alen, npf_conn_filter_t *f)
usr.sbin/npf/npfctl/npf_cmd.c
475
if (npf_conn_list(fd, npfctl_conn_print, f) != 0) {
usr.sbin/npf/npfctl/npf_cmd.c
481
npfctl_conn_list(int fd, int argc, char **argv)
usr.sbin/npf/npfctl/npf_cmd.c
533
npf_conn_list_v(fd, sizeof(struct in_addr), &f);
usr.sbin/npf/npfctl/npf_cmd.c
536
npf_conn_list_v(fd, sizeof(struct in6_addr), &f);
usr.sbin/npf/npfctl/npf_show.c
826
npfctl_config_show(int fd)
usr.sbin/npf/npfctl/npf_show.c
832
if (fd) {
usr.sbin/npf/npfctl/npf_show.c
833
ncf = npf_config_retrieve(fd);
usr.sbin/npf/npfctl/npf_show.c
894
npfctl_ruleset_show(int fd, const char *ruleset_name)
usr.sbin/npf/npfctl/npf_show.c
906
if ((error = _npf_ruleset_list(fd, ruleset_name, ncf)) != 0) {
usr.sbin/npf/npfctl/npfctl.c
134
npfctl_print_stats(int fd)
usr.sbin/npf/npfctl/npfctl.c
187
if (ioctl(fd, IOC_NPF_STATS, &st) != 0) {
usr.sbin/npf/npfctl/npfctl.c
304
int fd;
usr.sbin/npf/npfctl/npfctl.c
310
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/npf/npfctl/npfctl.c
313
if (fstat(fd, &sb) == -1) {
usr.sbin/npf/npfctl/npfctl.c
320
blob = mmap(NULL, blen, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
usr.sbin/npf/npfctl/npfctl.c
330
npfctl_load(int fd)
usr.sbin/npf/npfctl/npfctl.c
342
if ((errno = npf_config_submit(ncf, fd, &errinfo)) != 0) {
usr.sbin/npf/npfctl/npfctl.c
353
int fd;
usr.sbin/npf/npfctl/npfctl.c
361
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
usr.sbin/npf/npfctl/npfctl.c
368
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
usr.sbin/npf/npfctl/npfctl.c
372
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/npf/npfctl/npfctl.c
376
return fd;
usr.sbin/npf/npfctl/npfctl.c
385
int fd, c, optcount;
usr.sbin/npf/npfctl/npfctl.c
425
fd = npfctl_open_dev(NPF_DEV_PATH);
usr.sbin/npf/npfctl/npfctl.c
426
if ((ncf = npf_config_retrieve(fd)) == NULL) {
usr.sbin/npf/npfctl/npfctl.c
456
int fd, boolval, ret = 0;
usr.sbin/npf/npfctl/npfctl.c
463
fd = 0;
usr.sbin/npf/npfctl/npfctl.c
466
fd = npfctl_open_dev(NPF_DEV_PATH);
usr.sbin/npf/npfctl/npfctl.c
472
ret = ioctl(fd, IOC_NPF_SWITCH, &boolval);
usr.sbin/npf/npfctl/npfctl.c
477
ret = ioctl(fd, IOC_NPF_SWITCH, &boolval);
usr.sbin/npf/npfctl/npfctl.c
484
errno = ret = npfctl_config_send(fd);
usr.sbin/npf/npfctl/npfctl.c
488
ret = npfctl_config_show(fd);
usr.sbin/npf/npfctl/npfctl.c
492
ret = npf_config_flush(fd);
usr.sbin/npf/npfctl/npfctl.c
501
npfctl_table_replace(fd, argc, argv);
usr.sbin/npf/npfctl/npfctl.c
503
npfctl_table(fd, argc, argv);
usr.sbin/npf/npfctl/npfctl.c
511
npfctl_rule(fd, argc, argv);
usr.sbin/npf/npfctl/npfctl.c
515
ret = npfctl_load(fd);
usr.sbin/npf/npfctl/npfctl.c
519
ncf = npf_config_retrieve(fd);
usr.sbin/npf/npfctl/npfctl.c
530
ret = npfctl_print_stats(fd);
usr.sbin/npf/npfctl/npfctl.c
534
ret = npfctl_conn_list(fd, argc, argv);
usr.sbin/npf/npfctl/npfctl.c
550
if (fd) {
usr.sbin/npf/npfctl/npfctl.c
551
close(fd);
usr.sbin/npf/npfd/npfd.c
185
int fd = npfd_getctl();
usr.sbin/npf/npfd/npfd.c
186
(void)close(fd);
usr.sbin/npf/npfd/npfd.c
57
int fd, ver;
usr.sbin/npf/npfd/npfd.c
59
fd = open(NPF_DEV_PATH, O_RDONLY);
usr.sbin/npf/npfd/npfd.c
60
if (fd == -1) {
usr.sbin/npf/npfd/npfd.c
63
if (ioctl(fd, IOC_NPF_VERSION, &ver) == -1) {
usr.sbin/npf/npfd/npfd.c
71
return fd;
usr.sbin/npf/npfd/npfd.c
80
pfd.fd = npfd_log_getsock(log);
usr.sbin/npf/npfd/npfd_log.c
196
int fd;
usr.sbin/npf/npfd/npfd_log.c
197
if ((fd = mkstemp(tmp)) == -1) {
usr.sbin/npf/npfd/npfd_log.c
201
close(fd);
usr.sbin/npf/npftest/npftest.c
101
if ((fd = open(fpath, O_RDONLY)) == -1) {
usr.sbin/npf/npftest/npftest.c
104
if (fstat(fd, &sb) == -1) {
usr.sbin/npf/npftest/npftest.c
108
buf = mmap(NULL, len, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
usr.sbin/npf/npftest/npftest.c
112
close(fd);
usr.sbin/npf/npftest/npftest.c
135
int alen, fd;
usr.sbin/npf/npftest/npftest.c
142
if ((fd = mkstemp(sfn)) == -1) {
usr.sbin/npf/npftest/npftest.c
155
if (cdbw_output(cdbw, fd, "npf-table-cdb", NULL) == -1) {
usr.sbin/npf/npftest/npftest.c
160
if (fstat(fd, &sb) == -1) {
usr.sbin/npf/npftest/npftest.c
164
MAP_FILE | MAP_PRIVATE, fd, 0)) == MAP_FAILED) {
usr.sbin/npf/npftest/npftest.c
167
close(fd);
usr.sbin/npf/npftest/npftest.c
94
int error, fd;
usr.sbin/ofctl/ofctl.c
203
of_proplib_mkprop(int fd, int nodeid, char *name)
usr.sbin/ofctl/ofctl.c
220
if (ioctl(fd, OFIOCGET, &ofio) < 0) {
usr.sbin/ofctl/ofctl.c
225
warn("OFIOCGET(%d, \"%s\")", fd, name);
usr.sbin/ofctl/ofctl.c
235
of_proplib_tree_fill(int fd, int nodeid)
usr.sbin/ofctl/ofctl.c
260
if (ioctl(fd, OFIOCNEXTPROP, &ofio) < 0) {
usr.sbin/ofctl/ofctl.c
263
err(1, "OFIOCNEXTPROP(%d, %#x, \"%s\")", fd,
usr.sbin/ofctl/ofctl.c
272
obj = of_proplib_mkprop(fd, nodeid, namebuf);
usr.sbin/ofctl/ofctl.c
278
if (ioctl(fd, OFIOCGETCHILD, &childid) < 0)
usr.sbin/ofctl/ofctl.c
279
err(1, "OFIOCGETCHILD(%d, %#x)", fd, childid);
usr.sbin/ofctl/ofctl.c
285
prop_array_add(children, of_proplib_tree_fill(fd, childid));
usr.sbin/ofctl/ofctl.c
286
if (ioctl(fd, OFIOCGETNEXT, &childid) < 0)
usr.sbin/ofctl/ofctl.c
287
err(1, "OFIOCGETNEXT(%d, %#x)", fd, childid);
usr.sbin/ofctl/ofctl.c
302
int fd;
usr.sbin/ofctl/ofctl.c
304
fd = open(file, O_RDONLY);
usr.sbin/ofctl/ofctl.c
305
if (fd < 0)
usr.sbin/ofctl/ofctl.c
308
if (ioctl(fd, OFIOCGETNEXT, &rootid) < 0)
usr.sbin/ofctl/ofctl.c
309
err(1, "OFIOCGETNEXT(%d, %#x)", fd, rootid);
usr.sbin/ofctl/ofctl.c
311
dict = of_proplib_tree_fill(fd, rootid);
usr.sbin/ofctl/ofctl.c
314
of_fd = fd;
usr.sbin/paxctl/paxctl.c
200
int fd, size, ok = 0, flagged = 0, swap, error = 1;
usr.sbin/paxctl/paxctl.c
203
fd = open(name, list ? O_RDONLY: O_RDWR, 0);
usr.sbin/paxctl/paxctl.c
204
if (fd == -1) {
usr.sbin/paxctl/paxctl.c
209
if (read(fd, &e, sizeof(e)) != sizeof(e)) {
usr.sbin/paxctl/paxctl.c
238
if ((size_t)pread(fd, &s, SHSIZE,
usr.sbin/paxctl/paxctl.c
247
if (pread(fd, &n, NHSIZE, (off_t)SH(sh_offset)) != NHSIZE) {
usr.sbin/paxctl/paxctl.c
255
if (pread(fd, &pax_tag, sizeof(pax_tag), SH(sh_offset) + NHSIZE)
usr.sbin/paxctl/paxctl.c
299
if (pwrite(fd, &pax_tag, sizeof(pax_tag),
usr.sbin/paxctl/paxctl.c
318
(void)close(fd);
usr.sbin/perfused/msg.c
111
perfused_recv_early(int fd, struct sockcred *sockcred, size_t sockcred_len)
usr.sbin/perfused/msg.c
137
if (recvmsg(fd, &msg, MSG_NOSIGNAL|MSG_PEEK) != (ssize_t)len) {
usr.sbin/perfused/msg.c
156
if (recv(fd, buf, len, MSG_NOSIGNAL) != (ssize_t)len) {
usr.sbin/perfused/msg.c
232
xchg_pb_early(struct puffs_usermount *pu, struct puffs_framebuf *pb, int fd,
usr.sbin/perfused/msg.c
240
if ((error = perfused_writeframe(pu, pb, fd, &done)) != 0)
usr.sbin/perfused/msg.c
253
if ((error = perfused_readframe(pu, pb, fd, &done)) != 0)
usr.sbin/perfused/msg.c
261
xchg_pb_inloop(struct puffs_usermount *pu, struct puffs_framebuf *pb, int fd,
usr.sbin/perfused/msg.c
268
error = puffs_framev_enqueue_justsend(pu, fd, pb, 0, 0);
usr.sbin/perfused/msg.c
271
error = puffs_framev_enqueue_cc(pcc, fd, pb, 0);
usr.sbin/perfused/msg.c
282
int fd;
usr.sbin/perfused/msg.c
307
fd = (int)(intptr_t)perfuse_getspecific(pu);
usr.sbin/perfused/msg.c
310
error = xchg_pb_inloop(pu, pb, fd, reply);
usr.sbin/perfused/msg.c
312
error = xchg_pb_early(pu, pb, fd, reply);
usr.sbin/perfused/msg.c
479
int fd, int *done)
usr.sbin/perfused/msg.c
492
switch (readen = recv(fd, data, len, MSG_NOSIGNAL|MSG_PEEK)) {
usr.sbin/perfused/msg.c
539
switch (readen = recv(fd, data, len, MSG_NOSIGNAL)) {
usr.sbin/perfused/msg.c
565
int fd, int *done)
usr.sbin/perfused/msg.c
574
switch (written = send(fd, data, len, MSG_NOSIGNAL)) {
usr.sbin/perfused/msg.c
657
perfused_fdnotify(struct puffs_usermount *pu, int fd, int what)
usr.sbin/perfused/msg.c
659
if (fd != (int)(intptr_t)perfuse_getspecific(pu))
usr.sbin/perfused/msg.c
661
__func__, fd);
usr.sbin/perfused/msg.c
670
if (shutdown(fd, SHUT_RDWR) != 0)
usr.sbin/perfused/msg.c
682
int fd;
usr.sbin/perfused/msg.c
684
fd = (int)(intptr_t)perfuse_getspecific(pu);
usr.sbin/perfused/msg.c
686
if (shutdown(fd, SHUT_RDWR) != 0)
usr.sbin/perfused/perfused.c
102
get_mount_info(int fd, struct perfuse_mount_info *pmi, int sock_type)
usr.sbin/perfused/perfused.c
116
perfused_recv_early(fd, &cred, sizeof(cred));
usr.sbin/perfused/perfused.c
119
if (shutdown(fd, SHUT_RDWR) != 0)
usr.sbin/perfused/perfused.c
128
if (setsockopt(fd, SOL_LOCAL, LOCAL_CREDS, &opt, sizeof(opt)) != 0)
usr.sbin/perfused/perfused.c
195
if (connect(fd, sa, sun.sun_len) != 0)
usr.sbin/perfused/perfused.c
203
new_mount(int fd, int pmnt_flags)
usr.sbin/perfused/perfused.c
234
get_mount_info(fd, &pmi, sock_type);
usr.sbin/perfused/perfused.c
264
if (puffs_framev_addfd(pu, fd, PUFFS_FBIO_READ|PUFFS_FBIO_WRITE) == -1)
usr.sbin/perfused/perfused.c
267
perfuse_setspecific(pu, (void *)(intptr_t)fd);
usr.sbin/perfused/perfused.c
278
if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
usr.sbin/perfused/perfused.c
280
if (fcntl(fd, F_SETFL, flags|O_NONBLOCK) != 0)
usr.sbin/perfused/perfused.c
465
int fd;
usr.sbin/perfused/perfused.c
471
if ((fd = accept(s, sa, &len)) == -1)
usr.sbin/perfused/perfused.c
474
new_mount(fd, PMNT_DEVFUSE);
usr.sbin/pf/pfs/pfs.c
113
if (ioctl(fd, DIOCGETSTATES, ps) == -1) {
usr.sbin/pf/pfs/pfs.c
122
dump_states_binary(int fd, int verbose, const char* filename)
usr.sbin/pf/pfs/pfs.c
136
nb_states = get_states(fd, verbose, &ps);
usr.sbin/pf/pfs/pfs.c
174
restore_states_binary(int fd, int verbose __unused, const char* filename)
usr.sbin/pf/pfs/pfs.c
215
if (ioctl(fd, DIOCADDSTATES, &ps) == -1) {
usr.sbin/pf/pfs/pfs.c
347
print_states(int fd, int verbose, FILE* f)
usr.sbin/pf/pfs/pfs.c
352
nb_states = get_states(fd, verbose, &ps);
usr.sbin/pf/pfs/pfs.c
364
dump_states_ascii(int fd, int verbose, const char* filename)
usr.sbin/pf/pfs/pfs.c
376
print_states(fd, verbose, f);
usr.sbin/pf/pfs/pfs.c
385
restore_states_ascii(int fd, int verbose __unused, const char* filename)
usr.sbin/pf/pfs/pfs.c
397
if (ioctl(fd, DIOCADDSTATES, &ps) == -1) {
usr.sbin/pf/pfs/pfs.c
411
setlock(int fd, int verbose, int lock)
usr.sbin/pf/pfs/pfs.c
416
if (ioctl(fd, DIOCSETLCK, &lock) == -1)
usr.sbin/pf/pfs/pfs.c
466
int fd;
usr.sbin/pf/pfs/pfs.c
538
fd = open(pf_device, O_RDWR);
usr.sbin/pf/pfs/pfs.c
539
if (fd == -1)
usr.sbin/pf/pfs/pfs.c
543
error = setlock(fd, verbose, lock);
usr.sbin/pf/pfs/pfs.c
547
error = setlock(fd, verbose, 1);
usr.sbin/pf/pfs/pfs.c
550
error = dump_states_binary(fd, verbose, filename);
usr.sbin/pf/pfs/pfs.c
552
error = dump_states_ascii(fd, verbose, filename);
usr.sbin/pf/pfs/pfs.c
555
error = setlock(fd, verbose, 0);
usr.sbin/pf/pfs/pfs.c
560
error = setlock(fd, verbose, 1);
usr.sbin/pf/pfs/pfs.c
563
error = restore_states_binary(fd, verbose, filename);
usr.sbin/pf/pfs/pfs.c
565
error = restore_states_ascii(fd, verbose, filename);
usr.sbin/pf/pfs/pfs.c
568
error = setlock(fd, verbose, 0);
usr.sbin/pf/pfs/pfs.c
571
close(fd);
usr.sbin/pf/pfs/pfs.c
91
get_states(int fd, int verbose __unused, struct pfioc_states* ps)
usr.sbin/pf/pfs/pfs.c
98
if (ioctl(fd, DIOCGETSTATES, ps) == -1) {
usr.sbin/powerd/powerd.c
130
if ((fd = prog_open(_PATH_POWER, O_RDONLY|O_NONBLOCK, 0600)) == -1) {
usr.sbin/powerd/powerd.c
136
if (prog_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
usr.sbin/powerd/powerd.c
142
if (prog_ioctl(fd, POWER_IOC_GET_TYPE, &power_type) == -1) {
usr.sbin/powerd/powerd.c
157
EV_SET(ev, fd, EVFILT_READ, EV_ADD | EV_ENABLE,
usr.sbin/powerd/powerd.c
285
int fd = ev->ident;
usr.sbin/powerd/powerd.c
293
if (prog_read(fd, &pev, sizeof(pev)) != sizeof(pev)) {
usr.sbin/powerd/powerd.c
308
dispatch_power_event_state_change(fd, &pev);
usr.sbin/powerd/powerd.c
319
dispatch_power_event_state_change(int fd, power_event_t *pev)
usr.sbin/powerd/powerd.c
326
error = prop_dictionary_recv_ioctl(fd, POWER_EVENT_RECVDICT, &dict);
usr.sbin/powerd/powerd.c
91
int ch, fd;
usr.sbin/pstat/pstat.c
368
getflags(const struct flagbit_desc *fd, char *p, u_int flags)
usr.sbin/pstat/pstat.c
378
for (; fd->fd_flags != 0; fd++)
usr.sbin/pstat/pstat.c
379
if ((flags & fd->fd_flags) != 0)
usr.sbin/pstat/pstat.c
380
*p++ = fd->fd_mark;
usr.sbin/puffs/mount_9p/ninebuf.c
124
int fd, int *done)
usr.sbin/puffs/mount_9p/ninebuf.c
142
n = write(fd, win, winlen);
usr.sbin/puffs/mount_9p/ninebuf.c
79
int fd, int *done)
usr.sbin/puffs/mount_9p/ninebuf.c
99
n = read(fd, win, winlen);
usr.sbin/puffs/mount_psshfs/fs.c
101
DO_IO(psbuf_write, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
104
DO_IO(psbuf_read, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
131
DO_IO(psbuf_write, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
134
DO_IO(psbuf_read, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
146
DO_IO(psbuf_write, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
149
DO_IO(psbuf_read, pu, pb, fd, &done, rv);
usr.sbin/puffs/mount_psshfs/fs.c
85
psshfs_handshake(struct puffs_usermount *pu, int fd)
usr.sbin/puffs/mount_psshfs/psbuf.c
113
n = recv(fd, win, winlen, MSG_NOSIGNAL);
usr.sbin/puffs/mount_psshfs/psbuf.c
139
int fd, int *done)
usr.sbin/puffs/mount_psshfs/psbuf.c
158
n = send(fd, win, winlen, MSG_NOSIGNAL);
usr.sbin/puffs/mount_psshfs/psbuf.c
93
int fd, int *done)
usr.sbin/puffs/mount_psshfs/psshfs.c
374
psshfs_notify(struct puffs_usermount *pu, int fd, int what)
usr.sbin/puffs/mount_psshfs/psshfs.c
379
if (fd == pctx->sshfd) {
usr.sbin/puffs/mount_psshfs/psshfs.c
382
assert(fd == pctx->sshfd_data);
usr.sbin/puffs/mount_psshfs/psshfs.c
390
puffs_framev_removefd(pu, fd, ECONNRESET);
usr.sbin/puffs/mount_psshfs/psshfs.c
393
close(fd);
usr.sbin/puffs/mount_psshfs/psshfs.h
68
#define GETRESPONSE(pb, fd) \
usr.sbin/puffs/mount_psshfs/psshfs.h
70
if (puffs_framev_enqueue_cc(pcc, fd, pb, 0) == -1) { \
usr.sbin/puffs/mount_psshfs/psshfs.h
76
#define JUSTSEND(pb,fd) \
usr.sbin/puffs/mount_psshfs/psshfs.h
78
if (puffs_framev_enqueue_justsend(pu, fd, pb, 1, 0) == -1) { \
usr.sbin/puffs/mount_psshfs/psshfs.h
84
#define SENDCB(pb, fd, f, a) \
usr.sbin/puffs/mount_psshfs/psshfs.h
86
if (puffs_framev_enqueue_cb(pu, fd, pb, f, a, 0) == -1) { \
usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
113
fd = open(mntfile, rdonly ? O_RDONLY: O_RDWR);
usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
114
if (fd == -1)
usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
118
MAP_FILE | (shared ? MAP_SHARED : MAP_PRIVATE), fd, 0);
usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
74
int ch, fd, rdonly, shared;
usr.sbin/quot/quot.c
108
get_inode(int fd, struct fs *super, ino_t ino)
usr.sbin/quot/quot.c
113
if (fd < 0) { /* flush cache */
usr.sbin/quot/quot.c
126
if (lseek(fd,
usr.sbin/quot/quot.c
129
read(fd, ipbuf, INOSZ(super)) != (ssize_t)INOSZ(super))
usr.sbin/quot/quot.c
342
dofsizes(int fd, struct fs *super, const char *name)
usr.sbin/quot/quot.c
357
if ((dp = get_inode(fd, super, inode))
usr.sbin/quot/quot.c
413
douser(int fd, struct fs *super, const char *name)
usr.sbin/quot/quot.c
423
if ((dp = get_inode(fd, super, inode))
usr.sbin/quot/quot.c
450
donames(int fd, struct fs *super, const char *name)
usr.sbin/quot/quot.c
477
if ((dp = get_inode(fd, super, inode))
usr.sbin/quot/quot.c
548
int fd, i;
usr.sbin/quot/quot.c
555
if ((fd = open(name, 0)) < 0) {
usr.sbin/quot/quot.c
564
close(fd);
usr.sbin/quot/quot.c
567
if (pread(fd, superblock, SBLOCKSIZE, sbloc) != SBLOCKSIZE)
usr.sbin/quot/quot.c
599
(*func)(fd, fs, name);
usr.sbin/quot/quot.c
600
close(fd);
usr.sbin/rarpd/rarpd.c
194
int fd;
usr.sbin/rarpd/rarpd.c
201
fd = rarp_open(ifname);
usr.sbin/rarpd/rarpd.c
202
if (fd < 0)
usr.sbin/rarpd/rarpd.c
205
fd = h->ii_fd;
usr.sbin/rarpd/rarpd.c
226
p->ii_fd = fd;
usr.sbin/rarpd/rarpd.c
279
int fd;
usr.sbin/rarpd/rarpd.c
281
fd = open(device, O_RDWR);
usr.sbin/rarpd/rarpd.c
283
if (fd < 0) {
usr.sbin/rarpd/rarpd.c
287
return fd;
usr.sbin/rarpd/rarpd.c
296
int fd;
usr.sbin/rarpd/rarpd.c
318
fd = bpf_open();
usr.sbin/rarpd/rarpd.c
322
if (ioctl(fd, BIOCIMMEDIATE, &immediate) < 0) {
usr.sbin/rarpd/rarpd.c
328
if (ioctl(fd, BIOCSBLEN, &bufsize) < 0) {
usr.sbin/rarpd/rarpd.c
332
if (ioctl(fd, BIOCSETIF, (caddr_t) & ifr) < 0) {
usr.sbin/rarpd/rarpd.c
334
close(fd);
usr.sbin/rarpd/rarpd.c
342
if (ioctl(fd, BIOCGDLT, (caddr_t) & dlt) < 0) {
usr.sbin/rarpd/rarpd.c
348
close(fd);
usr.sbin/rarpd/rarpd.c
355
if (ioctl(fd, BIOCSETF, (caddr_t) & filter) < 0) {
usr.sbin/rarpd/rarpd.c
359
return fd;
usr.sbin/rarpd/rarpd.c
438
int cc, fd;
usr.sbin/rarpd/rarpd.c
474
fd = ii->ii_fd;
usr.sbin/rarpd/rarpd.c
475
if (!FD_ISSET(fd, &listeners))
usr.sbin/rarpd/rarpd.c
478
cc = read(fd, (char *) buf, bufsize);
usr.sbin/rarpd/rarpd.c
487
(lseek(fd, 0, SEEK_CUR) + bufsize) < 0) {
usr.sbin/rarpd/rarpd.c
488
(void)lseek(fd, 0, 0);
usr.sbin/rarpd/rarpd.c
665
int fd;
usr.sbin/rarpd/rarpd.c
668
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
usr.sbin/rarpd/rarpd.c
676
if (ioctl(fd, SIOCGIFADDR, (char *) &ifr) < 0) {
usr.sbin/rarpd/rarpd.c
681
if (ioctl(fd, SIOCGIFNETMASK, (char *) &ifr) < 0) {
usr.sbin/rarpd/rarpd.c
692
if (ioctl(fd, SIOCGIFALIAS, (char *) &ifra) < 0) {
usr.sbin/rarpd/rarpd.c
704
(void)close(fd);
usr.sbin/rbootd/rbootd.c
195
fd = BpfOpen();
usr.sbin/rbootd/rbootd.c
203
set[0].fd = fd;
usr.sbin/rbootd/rbootd.c
77
int c, fd, omask;
usr.sbin/route6d/route6d.c
611
set[0].fd = ripsock;
usr.sbin/route6d/route6d.c
618
set[1].fd = rtsock;
usr.sbin/route6d/route6d.c
621
set[1].fd = -1;
usr.sbin/rpc.lockd/lockd_lock.c
105
int fd; /* file descriptor for this lock */
usr.sbin/rpc.lockd/lockd_lock.c
512
fl->fd = fhopen(fl->filehandle.fhdata, fl->filehandle.fhsize, O_RDWR);
usr.sbin/rpc.lockd/lockd_lock.c
513
if (fl->fd < 0) {
usr.sbin/rpc.lockd/lockd_lock.c
531
if (fstat(fl->fd, &st) < 0) {
usr.sbin/rpc.lockd/lockd_lock.c
546
error = flock(fl->fd, lflags);
usr.sbin/rpc.lockd/lockd_lock.c
552
(void)close(fl->fd);
usr.sbin/rpc.lockd/lockd_lock.c
563
if(flock(fl->fd, lflags) != 0) {
usr.sbin/rpc.lockd/lockd_lock.c
602
(void)close(fl->fd);
usr.sbin/rpc.lockd/lockd_lock.c
695
if (close(rfl->fd) == -1) {
usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
497
FILE *fd;
usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
505
if ((fd = fopen("/etc/pcnfsd.conf", "r")) == NULL)
usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
507
while (fgets(buff, 1024, fd)) {
usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
544
fclose(fd);
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1075
FILE *fd;
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1085
if ((fd = su_popen(user, cmdbuf, MAXTIME_FOR_CANCEL)) == NULL) {
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1089
if (fgets(resbuf, 255, fd) == NULL)
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1106
if (su_pclose(fd) == 255)
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1120
FILE *fd;
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1131
if ((fd = su_popen(user, cmdbuf, MAXTIME_FOR_CANCEL)) == NULL) {
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1135
while (fgets(resbuf, 255, fd) != NULL) {
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
1146
if (su_pclose(fd) == 255)
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
212
FILE *fd;
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
344
if ((fd = su_popen(user, xcmd, MAXTIME_FOR_PRINT)) == NULL) {
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
349
while (fgets(resbuf, 255, fd) != NULL) {
usr.sbin/rpc.pcnfsd/pcnfsd_print.c
361
if (su_pclose(fd) == 255)
usr.sbin/rpcbind/check_bound.c
100
fd = __rpc_nconf2fd(fdl->nconf);
usr.sbin/rpcbind/check_bound.c
101
if (fd < 0) {
usr.sbin/rpcbind/check_bound.c
107
ans = bind(fd, (struct sockaddr *)na->buf, na->len);
usr.sbin/rpcbind/check_bound.c
110
rump_sys_close(fd);
usr.sbin/rpcbind/check_bound.c
112
close(fd);
usr.sbin/rpcbind/check_bound.c
69
int fd;
usr.sbin/rpcbind/check_bound.c
89
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
1137
p->fd = n;
usr.sbin/rpcbind/rpcb_svc_com.c
1150
fprintf(stderr, "%d ", p->fd);
usr.sbin/rpcbind/rpcb_svc_com.c
1184
p->fd, p->revents);
usr.sbin/rpcbind/rpcb_svc_com.c
1220
if ((xprt = find_rmtcallxprt_by_fd(pfds[j].fd)) != NULL) {
usr.sbin/rpcbind/rpcb_svc_com.c
1227
__func__, pfds[j].fd, xprt->xp_netid);
usr.sbin/rpcbind/rpcb_svc_com.c
1229
handle_reply(pfds[j].fd, xprt);
usr.sbin/rpcbind/rpcb_svc_com.c
1264
handle_reply(int fd, SVCXPRT *xprt)
usr.sbin/rpcbind/rpcb_svc_com.c
1287
inlen = recvfrom(fd, buffer, RPC_BUF_MAX, 0,
usr.sbin/rpcbind/rpcb_svc_com.c
413
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
415
if ((fd = open("/dev/null", O_RDONLY)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
505
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
509
if ((fd = __rpc_nconf2fd(nconf)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
515
xprt = svc_tli_create(fd, 0, NULL, 0, 0);
usr.sbin/rpcbind/rpcb_svc_com.c
530
rmt->fd = fd;
usr.sbin/rpcbind/rpcb_svc_com.c
539
svc_fdset_set(fd);
usr.sbin/rpcbind/rpcb_svc_com.c
540
return (fd);
usr.sbin/rpcbind/rpcb_svc_com.c
550
return (rmt->fd);
usr.sbin/rpcbind/rpcb_svc_com.c
557
find_rmtcallxprt_by_fd(int fd)
usr.sbin/rpcbind/rpcb_svc_com.c
562
if (fd == rmt->fd) {
usr.sbin/rpcbind/rpcb_svc_com.c
625
int fd = -1;
usr.sbin/rpcbind/rpcb_svc_com.c
770
if ((fd = find_rmtcallfd_by_netid(nconf->nc_netid)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
776
switch (forward_register(*xidp, caller, fd, m_uaddr, reply_type,
usr.sbin/rpcbind/rpcb_svc_com.c
81
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
898
if (sendto(fd, outbufp, outlen, 0, (struct sockaddr *)na->buf, na->len)
usr.sbin/rpcbind/rpcbind.c
282
int fd;
usr.sbin/rpcbind/rpcbind.c
324
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpcbind/rpcbind.c
333
fd = -1;
usr.sbin/rpcbind/rpcbind.c
394
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpcbind/rpcbind.c
415
close(fd);
usr.sbin/rpcbind/rpcbind.c
430
close(fd);
usr.sbin/rpcbind/rpcbind.c
434
if (setsockopt(fd, IPPROTO_IPV6,
usr.sbin/rpcbind/rpcbind.c
466
if (bind(fd, sa, addrlen) != 0) {
usr.sbin/rpcbind/rpcbind.c
509
listen(fd, SOMAXCONN);
usr.sbin/rpcbind/rpcbind.c
511
my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
usr.sbin/rpcbind/rpcbind.c
526
if (bind(fd, sa, addrlen) < 0) {
usr.sbin/rpcbind/rpcbind.c
562
listen(fd, SOMAXCONN);
usr.sbin/rpcbind/rpcbind.c
564
my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
usr.sbin/rpcbind/rpcbind.c
729
(void)rump_sys_close(fd);
usr.sbin/rpcbind/rpcbind.c
731
(void)close(fd);
usr.sbin/rpcbind/warmstart.c
77
int fd;
usr.sbin/rpcbind/warmstart.c
81
fd = open(filename, O_WRONLY|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR);
usr.sbin/rpcbind/warmstart.c
82
if (fd == -1 || (fp = fdopen(fd, "w")) == NULL) {
usr.sbin/rtadvd/rtadvd.c
276
set[0].fd = sock;
usr.sbin/rtadvd/rtadvd.c
280
set[1].fd = rtsock;
usr.sbin/rtadvd/rtadvd.c
283
set[1].fd = -1;
usr.sbin/rwhod/rwhod.c
227
pfd[0].fd = s;
usr.sbin/sa/main.c
207
int fd;
usr.sbin/sa/main.c
213
fd = acct_load(argv[0], sflag);
usr.sbin/sa/main.c
214
if (fd < 0)
usr.sbin/sa/main.c
245
if (ftruncate(fd, 0) == -1) {
usr.sbin/sa/main.c
272
if (close(fd) == -1) {
usr.sbin/screenblank/screenblank.c
174
int fd;
usr.sbin/screenblank/screenblank.c
176
if ((fd = open(display, O_RDONLY, 0666)) == -1)
usr.sbin/screenblank/screenblank.c
179
(void) close(fd);
usr.sbin/screenblank/screenblank.c
303
int onoff, fd;
usr.sbin/screenblank/screenblank.c
305
if ((fd = open(path, O_RDWR, 0666)) == -1) {
usr.sbin/screenblank/screenblank.c
309
if ((ioctl(fd, FBIOGVIDEO, &onoff)) == 0)
usr.sbin/screenblank/screenblank.c
311
(void)close(fd);
usr.sbin/screenblank/screenblank.c
345
int fd;
usr.sbin/screenblank/screenblank.c
355
if ((fd = open(dsp->ds_path, O_RDWR, 0)) == -1) {
usr.sbin/screenblank/screenblank.c
360
if (ioctl(fd, WSDISPLAYIO_GMODE, &state) == -1) {
usr.sbin/screenblank/screenblank.c
367
(void)close(fd);
usr.sbin/screenblank/screenblank.c
376
int fd;
usr.sbin/screenblank/screenblank.c
383
if ((fd = open(dsp->ds_path, O_RDWR, 0)) == -1) {
usr.sbin/screenblank/screenblank.c
388
if (ioctl(fd, setvideo, &state) == -1)
usr.sbin/screenblank/screenblank.c
393
(void)close(fd);
usr.sbin/sdpd/compat.c
776
compat_register_request(server_t *srv, int fd)
usr.sbin/sdpd/compat.c
783
log_debug("compat RegisterRequest by client on fd#%d", fd);
usr.sbin/sdpd/compat.c
785
if (!srv->fdidx[fd].control
usr.sbin/sdpd/compat.c
786
|| !srv->fdidx[fd].priv)
usr.sbin/sdpd/compat.c
789
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/compat.c
790
db_unselect(srv, fd);
usr.sbin/sdpd/compat.c
816
if (!db_create(srv, fd, &bdaddr, srv->handle, &r))
usr.sbin/sdpd/compat.c
828
compat_change_request(server_t *srv, int fd)
usr.sbin/sdpd/compat.c
834
log_debug("compat ChangeRequest by client on fd#%d", fd);
usr.sbin/sdpd/compat.c
836
if (!srv->fdidx[fd].control
usr.sbin/sdpd/compat.c
837
|| !srv->fdidx[fd].priv)
usr.sbin/sdpd/compat.c
840
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/compat.c
841
db_unselect(srv, fd);
usr.sbin/sdpd/compat.c
848
db_select_handle(srv, fd, be32dec(d.next));
usr.sbin/sdpd/compat.c
852
db_next(srv, fd, &rec);
usr.sbin/sdpd/compat.c
853
if (rec == NULL || rec->fd != fd)
usr.sbin/sdpd/compat.c
880
if (!db_create(srv, fd, &rec->bdaddr, rec->handle, &r))
usr.sbin/sdpd/compat.c
883
db_unselect(srv, fd);
usr.sbin/sdpd/db.c
154
db_next(server_t *srv, int fd, record_t **rec)
usr.sbin/sdpd/db.c
163
while (r != NULL && !FD_ISSET(fd, &r->refset))
usr.sbin/sdpd/db.c
278
db_select_ssp(server_t *srv, int fd, sdp_data_t *ssp)
usr.sbin/sdpd/db.c
288
if (!srv->fdidx[fd].control
usr.sbin/sdpd/db.c
290
&& !bdaddr_same(&r->bdaddr, &srv->fdidx[fd].bdaddr))
usr.sbin/sdpd/db.c
297
FD_SET(fd, &r->refset);
usr.sbin/sdpd/db.c
314
db_select_handle(server_t *srv, int fd, uint32_t handle)
usr.sbin/sdpd/db.c
322
if (!srv->fdidx[fd].control
usr.sbin/sdpd/db.c
324
&& !bdaddr_same(&r->bdaddr, &srv->fdidx[fd].bdaddr))
usr.sbin/sdpd/db.c
328
FD_SET(fd, &r->refset);
usr.sbin/sdpd/db.c
341
db_create(server_t *srv, int fd, const bdaddr_t *bdaddr, uint32_t handle, sdp_data_t *data)
usr.sbin/sdpd/db.c
365
rec->fd = fd;
usr.sbin/sdpd/db.c
388
n->fd = -1;
usr.sbin/sdpd/db.c
404
db_unselect(server_t *srv, int fd)
usr.sbin/sdpd/db.c
413
if (FD_ISSET(fd, &r->refset)) {
usr.sbin/sdpd/db.c
418
FD_CLR(fd, &r->refset);
usr.sbin/sdpd/db.c
428
db_release(server_t *srv, int fd)
usr.sbin/sdpd/db.c
437
if (r->fd == fd) {
usr.sbin/sdpd/db.c
443
r->fd = -1;
usr.sbin/sdpd/record.c
104
record_update_request(server_t *srv, int fd)
usr.sbin/sdpd/record.c
109
log_debug("RecordUpdateRequest by client on fd#%d", fd);
usr.sbin/sdpd/record.c
114
if (!srv->fdidx[fd].control
usr.sbin/sdpd/record.c
115
|| !srv->fdidx[fd].priv)
usr.sbin/sdpd/record.c
118
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/record.c
119
db_unselect(srv, fd);
usr.sbin/sdpd/record.c
127
db_select_handle(srv, fd, be32dec(seq.next));
usr.sbin/sdpd/record.c
131
db_next(srv, fd, &rec);
usr.sbin/sdpd/record.c
132
if (rec == NULL || rec->fd != fd)
usr.sbin/sdpd/record.c
135
db_unselect(srv, fd);
usr.sbin/sdpd/record.c
146
if (!db_create(srv, fd, &rec->bdaddr, rec->handle, &seq))
usr.sbin/sdpd/record.c
163
record_remove_request(server_t *srv, int fd)
usr.sbin/sdpd/record.c
167
log_debug("RecordRemoveRequest by client on fd#%d", fd);
usr.sbin/sdpd/record.c
169
if (!srv->fdidx[fd].control
usr.sbin/sdpd/record.c
170
|| !srv->fdidx[fd].priv)
usr.sbin/sdpd/record.c
173
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/record.c
174
db_unselect(srv, fd);
usr.sbin/sdpd/record.c
182
db_select_handle(srv, fd, be32dec(srv->ibuf));
usr.sbin/sdpd/record.c
185
db_next(srv, fd, &rec);
usr.sbin/sdpd/record.c
186
if (rec == NULL || rec->fd != fd)
usr.sbin/sdpd/record.c
194
rec->fd = -1;
usr.sbin/sdpd/record.c
195
db_unselect(srv, fd);
usr.sbin/sdpd/record.c
50
record_insert_request(server_t *srv, int fd)
usr.sbin/sdpd/record.c
55
log_debug("RecordInsertRequest by client on fd#%d", fd);
usr.sbin/sdpd/record.c
60
if (!srv->fdidx[fd].control
usr.sbin/sdpd/record.c
61
|| !srv->fdidx[fd].priv)
usr.sbin/sdpd/record.c
64
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/record.c
65
db_unselect(srv, fd);
usr.sbin/sdpd/record.c
85
if (!db_create(srv, fd, &bdaddr, srv->handle, &seq))
usr.sbin/sdpd/sdpd.h
72
int fd; /* owner */
usr.sbin/sdpd/server.c
150
int opt, fd;
usr.sbin/sdpd/server.c
159
fd = socket(PF_LOCAL, SOCK_STREAM, 0);
usr.sbin/sdpd/server.c
160
if (fd == -1) {
usr.sbin/sdpd/server.c
168
if (setsockopt(fd, SOL_LOCAL, LOCAL_CREDS, &opt, sizeof(opt)) == -1)
usr.sbin/sdpd/server.c
176
if (bind(fd, (struct sockaddr *) &un, sizeof(un)) == -1) {
usr.sbin/sdpd/server.c
180
close(fd);
usr.sbin/sdpd/server.c
188
close(fd);
usr.sbin/sdpd/server.c
192
if (listen(fd, 5) == -1) {
usr.sbin/sdpd/server.c
196
close(fd);
usr.sbin/sdpd/server.c
201
if (fd > srv->fdmax)
usr.sbin/sdpd/server.c
202
srv->fdmax = fd;
usr.sbin/sdpd/server.c
204
FD_SET(fd, &srv->fdset);
usr.sbin/sdpd/server.c
205
srv->fdidx[fd].valid = true;
usr.sbin/sdpd/server.c
206
srv->fdidx[fd].server = true;
usr.sbin/sdpd/server.c
207
srv->fdidx[fd].control = true;
usr.sbin/sdpd/server.c
208
srv->fdidx[fd].priv = false;
usr.sbin/sdpd/server.c
219
int fd;
usr.sbin/sdpd/server.c
221
fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
usr.sbin/sdpd/server.c
222
if (fd == -1) {
usr.sbin/sdpd/server.c
229
if (setsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_IMTU,
usr.sbin/sdpd/server.c
234
close(fd);
usr.sbin/sdpd/server.c
244
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
usr.sbin/sdpd/server.c
248
close(fd);
usr.sbin/sdpd/server.c
252
if (listen(fd, 5) == -1) {
usr.sbin/sdpd/server.c
256
close(fd);
usr.sbin/sdpd/server.c
261
if (fd > srv->fdmax)
usr.sbin/sdpd/server.c
262
srv->fdmax = fd;
usr.sbin/sdpd/server.c
264
FD_SET(fd, &srv->fdset);
usr.sbin/sdpd/server.c
265
srv->fdidx[fd].valid = true;
usr.sbin/sdpd/server.c
266
srv->fdidx[fd].server = true;
usr.sbin/sdpd/server.c
267
srv->fdidx[fd].control = false;
usr.sbin/sdpd/server.c
268
srv->fdidx[fd].priv = false;
usr.sbin/sdpd/server.c
279
int fd;
usr.sbin/sdpd/server.c
288
for (fd = 0; fd < srv->fdmax + 1; fd ++) {
usr.sbin/sdpd/server.c
289
if (srv->fdidx[fd].valid)
usr.sbin/sdpd/server.c
290
server_close_fd(srv, fd);
usr.sbin/sdpd/server.c
308
int n, fd;
usr.sbin/sdpd/server.c
324
for (fd = 0; fd < srv->fdmax + 1 && n > 0; fd++) {
usr.sbin/sdpd/server.c
325
if (!FD_ISSET(fd, &fdset))
usr.sbin/sdpd/server.c
328
assert(srv->fdidx[fd].valid);
usr.sbin/sdpd/server.c
330
if (srv->fdidx[fd].server)
usr.sbin/sdpd/server.c
331
server_accept_client(srv, fd);
usr.sbin/sdpd/server.c
332
else if (!server_process_request(srv, fd))
usr.sbin/sdpd/server.c
333
server_close_fd(srv, fd);
usr.sbin/sdpd/server.c
346
server_accept_client(server_t *srv, int fd)
usr.sbin/sdpd/server.c
354
cfd = accept(fd, NULL, NULL);
usr.sbin/sdpd/server.c
359
srv->fdidx[fd].control ? "control" : "L2CAP",
usr.sbin/sdpd/server.c
377
if (!srv->fdidx[fd].control) {
usr.sbin/sdpd/server.c
396
srv->fdidx[cfd].control = srv->fdidx[fd].control;
usr.sbin/sdpd/server.c
410
server_process_request(server_t *srv, int fd)
usr.sbin/sdpd/server.c
418
assert(FD_ISSET(fd, &srv->fdset));
usr.sbin/sdpd/server.c
419
assert(srv->fdidx[fd].valid);
usr.sbin/sdpd/server.c
420
assert(!srv->fdidx[fd].server);
usr.sbin/sdpd/server.c
436
len = recvmsg(fd, &msg, 0);
usr.sbin/sdpd/server.c
441
srv->fdidx[fd].control ? "control" : "L2CAP",
usr.sbin/sdpd/server.c
449
srv->fdidx[fd].control ? "control" : "L2CAP");
usr.sbin/sdpd/server.c
456
srv->fdidx[fd].control ? "control" : "L2CAP");
usr.sbin/sdpd/server.c
462
srv->fdidx[fd].priv = server_auth_check(srv, CMSG_DATA(cmsg));
usr.sbin/sdpd/server.c
472
error = service_search_request(srv, fd);
usr.sbin/sdpd/server.c
476
error = service_attribute_request(srv, fd);
usr.sbin/sdpd/server.c
480
error = service_search_attribute_request(srv, fd);
usr.sbin/sdpd/server.c
485
error = compat_register_request(srv, fd);
usr.sbin/sdpd/server.c
489
error = compat_change_request(srv, fd);
usr.sbin/sdpd/server.c
494
error = record_insert_request(srv, fd);
usr.sbin/sdpd/server.c
498
error = record_update_request(srv, fd);
usr.sbin/sdpd/server.c
502
error = record_remove_request(srv, fd);
usr.sbin/sdpd/server.c
512
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/server.c
513
db_unselect(srv, fd);
usr.sbin/sdpd/server.c
536
len = sendmsg(fd, &msg, 0);
usr.sbin/sdpd/server.c
541
srv->fdidx[fd].control ? "control" : "L2CAP",
usr.sbin/sdpd/server.c
554
server_close_fd(server_t *srv, int fd)
usr.sbin/sdpd/server.c
557
assert(FD_ISSET(fd, &srv->fdset));
usr.sbin/sdpd/server.c
558
assert(srv->fdidx[fd].valid);
usr.sbin/sdpd/server.c
560
db_unselect(srv, fd); /* release selected records */
usr.sbin/sdpd/server.c
561
db_release(srv, fd); /* expire owned records */
usr.sbin/sdpd/server.c
563
close(fd);
usr.sbin/sdpd/server.c
564
FD_CLR(fd, &srv->fdset);
usr.sbin/sdpd/server.c
565
srv->fdidx[fd].valid = false;
usr.sbin/sdpd/server.c
567
log_debug("client on fd#%d closed", fd);
usr.sbin/sdpd/server.c
569
if (fd == srv->fdmax) {
usr.sbin/sdpd/server.c
570
while (fd > 0 && !srv->fdidx[fd].valid)
usr.sbin/sdpd/server.c
571
fd--;
usr.sbin/sdpd/server.c
573
srv->fdmax = fd;
usr.sbin/sdpd/service.c
100
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
101
db_select_ssp(srv, fd, &s);
usr.sbin/sdpd/service.c
102
} else if (srv->fdidx[fd].offset == 0
usr.sbin/sdpd/service.c
104
|| be16dec(d.next + 1) != srv->fdidx[fd].offset)
usr.sbin/sdpd/service.c
116
d.end = srv->obuf + srv->fdidx[fd].omtu - 1 - sizeof(uint16_t);
usr.sbin/sdpd/service.c
123
while (db_next(srv, fd, &r) && total < max) {
usr.sbin/sdpd/service.c
124
if (total >= srv->fdidx[fd].offset
usr.sbin/sdpd/service.c
145
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/service.c
146
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
150
srv->fdidx[fd].offset += count;
usr.sbin/sdpd/service.c
152
be16enc(d.next + 1, srv->fdidx[fd].offset);
usr.sbin/sdpd/service.c
165
service_attribute_request(server_t *srv, int fd)
usr.sbin/sdpd/service.c
174
log_debug("ServiceAttributeRequest by client on fd#%d", fd);
usr.sbin/sdpd/service.c
216
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/service.c
217
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
218
db_select_handle(srv, fd, handle);
usr.sbin/sdpd/service.c
219
} else if (srv->fdidx[fd].offset == 0
usr.sbin/sdpd/service.c
221
|| be16dec(d.next + 1) != srv->fdidx[fd].offset)
usr.sbin/sdpd/service.c
230
b.next = b.start - srv->fdidx[fd].offset;
usr.sbin/sdpd/service.c
231
b.end = srv->obuf + srv->fdidx[fd].omtu - 1;
usr.sbin/sdpd/service.c
240
db_next(srv, fd, &r);
usr.sbin/sdpd/service.c
256
b.next = srv->obuf + srv->fdidx[fd].omtu - 1 - sizeof(uint16_t);
usr.sbin/sdpd/service.c
267
srv->fdidx[fd].offset += (b.next - b.start);
usr.sbin/sdpd/service.c
269
be16enc(b.next + 1, srv->fdidx[fd].offset);
usr.sbin/sdpd/service.c
276
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/service.c
277
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
291
service_search_attribute_request(server_t *srv, int fd)
usr.sbin/sdpd/service.c
299
log_debug("ServiceSearchAttributeRequest by client on fd#%d", fd);
usr.sbin/sdpd/service.c
339
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/service.c
340
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
341
db_select_ssp(srv, fd, &s);
usr.sbin/sdpd/service.c
342
} else if (srv->fdidx[fd].offset == 0
usr.sbin/sdpd/service.c
344
|| be16dec(d.next + 1) != srv->fdidx[fd].offset)
usr.sbin/sdpd/service.c
353
b.end = srv->obuf + srv->fdidx[fd].omtu - 1;
usr.sbin/sdpd/service.c
354
b.next = b.start - srv->fdidx[fd].offset;
usr.sbin/sdpd/service.c
366
while (db_next(srv, fd, &r)) {
usr.sbin/sdpd/service.c
372
sdpd_close_seq(&b, b.start - srv->fdidx[fd].offset);
usr.sbin/sdpd/service.c
384
b.next = srv->obuf + srv->fdidx[fd].omtu - 1 - sizeof(uint16_t);
usr.sbin/sdpd/service.c
395
srv->fdidx[fd].offset += (b.next - b.start);
usr.sbin/sdpd/service.c
397
be16enc(b.next + 1, srv->fdidx[fd].offset);
usr.sbin/sdpd/service.c
404
srv->fdidx[fd].offset = 0;
usr.sbin/sdpd/service.c
405
db_unselect(srv, fd);
usr.sbin/sdpd/service.c
60
service_search_request(server_t *srv, int fd)
usr.sbin/sdpd/service.c
66
log_debug("ServiceSearchRequest by client on fd#%d", fd);
usr.sbin/sdpd/service.c
99
srv->fdidx[fd].offset = 0;
usr.sbin/sesd/srcs/chpmon.c
104
(void) close(fd);
usr.sbin/sesd/srcs/chpmon.c
119
if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
usr.sbin/sesd/srcs/chpmon.c
123
(void) close(fd);
usr.sbin/sesd/srcs/chpmon.c
54
int fd, delay, dev;
usr.sbin/sesd/srcs/chpmon.c
72
fd = open(v[dev], O_RDWR);
usr.sbin/sesd/srcs/chpmon.c
73
if (fd < 0) {
usr.sbin/sesd/srcs/chpmon.c
82
if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
usr.sbin/sesd/srcs/chpmon.c
85
(void) close(fd);
usr.sbin/sesd/srcs/chpmon.c
91
if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
usr.sbin/sesd/srcs/chpmon.c
94
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
122
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
125
if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) {
usr.sbin/sesd/srcs/getencstat.c
127
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
132
if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) {
usr.sbin/sesd/srcs/getencstat.c
134
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
153
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
53
int fd, nobj, f, i, verbose, quiet, errors;
usr.sbin/sesd/srcs/getencstat.c
74
fd = open(*v, O_RDONLY);
usr.sbin/sesd/srcs/getencstat.c
75
if (fd < 0) {
usr.sbin/sesd/srcs/getencstat.c
79
if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
usr.sbin/sesd/srcs/getencstat.c
81
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
84
if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) {
usr.sbin/sesd/srcs/getencstat.c
86
(void) close(fd);
usr.sbin/sesd/srcs/getencstat.c
92
(void) close(fd);
usr.sbin/sesd/srcs/getnobj.c
48
int fd;
usr.sbin/sesd/srcs/getnobj.c
52
fd = open(name, O_RDONLY);
usr.sbin/sesd/srcs/getnobj.c
53
if (fd < 0) {
usr.sbin/sesd/srcs/getnobj.c
57
if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
usr.sbin/sesd/srcs/getnobj.c
62
close (fd);
usr.sbin/sesd/srcs/getobjmap.c
50
int nobj, fd, i;
usr.sbin/sesd/srcs/getobjmap.c
53
fd = open(*v, O_RDONLY);
usr.sbin/sesd/srcs/getobjmap.c
54
if (fd < 0) {
usr.sbin/sesd/srcs/getobjmap.c
58
if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
usr.sbin/sesd/srcs/getobjmap.c
60
(void) close(fd);
usr.sbin/sesd/srcs/getobjmap.c
65
(void) close(fd);
usr.sbin/sesd/srcs/getobjmap.c
71
(void) close(fd);
usr.sbin/sesd/srcs/getobjmap.c
74
if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) {
usr.sbin/sesd/srcs/getobjmap.c
76
(void) close(fd);
usr.sbin/sesd/srcs/getobjmap.c
84
(void) close(fd);
usr.sbin/sesd/srcs/getobjstat.c
46
int fd;
usr.sbin/sesd/srcs/getobjstat.c
57
fd = open(v[1], O_RDONLY);
usr.sbin/sesd/srcs/getobjstat.c
58
if (fd < 0) {
usr.sbin/sesd/srcs/getobjstat.c
68
if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &obj) < 0) {
usr.sbin/sesd/srcs/getobjstat.c
74
(void) close(fd);
usr.sbin/sesd/srcs/inienc.c
47
int fd;
usr.sbin/sesd/srcs/inienc.c
50
fd = open(*v, O_RDWR);
usr.sbin/sesd/srcs/inienc.c
51
if (fd < 0) {
usr.sbin/sesd/srcs/inienc.c
55
if (ioctl(fd, SESIOC_INIT, NULL) < 0) {
usr.sbin/sesd/srcs/inienc.c
58
(void) close(fd);
usr.sbin/sesd/srcs/sesd.c
102
(void) close(fd);
usr.sbin/sesd/srcs/sesd.c
105
(void) close(fd);
usr.sbin/sesd/srcs/sesd.c
119
fd = open(v[dev], O_RDWR);
usr.sbin/sesd/srcs/sesd.c
120
if (fd < 0) {
usr.sbin/sesd/srcs/sesd.c
128
if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &sestat) < 0) {
usr.sbin/sesd/srcs/sesd.c
131
(void) close(fd);
usr.sbin/sesd/srcs/sesd.c
134
(void) close(fd);
usr.sbin/sesd/srcs/sesd.c
58
int c, fd, polltime, dev, nodaemon;
usr.sbin/sesd/srcs/sesd.c
94
fd = open(v[dev], O_RDWR);
usr.sbin/sesd/srcs/sesd.c
95
if (fd < 0) {
usr.sbin/sesd/srcs/sesd.c
99
if (ioctl(fd, SESIOC_INIT, NULL) < 0) {
usr.sbin/sesd/srcs/setencstat.c
47
int fd;
usr.sbin/sesd/srcs/setencstat.c
55
fd = open(v[1], O_RDWR);
usr.sbin/sesd/srcs/setencstat.c
56
if (fd < 0) {
usr.sbin/sesd/srcs/setencstat.c
63
if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &sestat) < 0) {
usr.sbin/sesd/srcs/setencstat.c
66
(void) close(fd);
usr.sbin/sesd/srcs/setobjstat.c
47
int fd;
usr.sbin/sesd/srcs/setobjstat.c
59
fd = open(v[1], O_RDWR);
usr.sbin/sesd/srcs/setobjstat.c
60
if (fd < 0) {
usr.sbin/sesd/srcs/setobjstat.c
78
if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) {
usr.sbin/sesd/srcs/setobjstat.c
81
(void) close(fd);
usr.sbin/sliplogin/sliplogin.c
210
int fd, s, ldisc, odisc;
usr.sbin/sliplogin/sliplogin.c
226
for (fd = 3 ; fd < s ; fd++)
usr.sbin/sliplogin/sliplogin.c
227
(void)close(fd);
usr.sbin/sliplogin/sliplogin.c
251
if ((fd = open("/dev/tty", O_RDONLY, 0)) >= 0) {
usr.sbin/sliplogin/sliplogin.c
254
(void)ioctl(fd, TIOCNOTTY, (caddr_t)0);
usr.sbin/sliplogin/sliplogin.c
255
(void)close(fd);
usr.sbin/sliplogin/sliplogin.c
257
fd = open(ttyname(0), O_RDWR, 0);
usr.sbin/sliplogin/sliplogin.c
258
if (fd >= 0)
usr.sbin/sliplogin/sliplogin.c
259
(void)close(fd);
usr.sbin/sliplogin/sliplogin.c
264
if ((fd = open(argv[2], O_RDWR)) == -1) {
usr.sbin/sliplogin/sliplogin.c
268
(void)dup2(fd, 0);
usr.sbin/sliplogin/sliplogin.c
269
if (fd > 2)
usr.sbin/sliplogin/sliplogin.c
270
close(fd);
usr.sbin/sliplogin/sliplogin.c
344
if ((fd = open(_PATH_DEVNULL, O_WRONLY)) != 1) {
usr.sbin/sliplogin/sliplogin.c
345
if (fd < 0) {
usr.sbin/sliplogin/sliplogin.c
349
(void)dup2(fd, 1);
usr.sbin/sliplogin/sliplogin.c
350
(void)close(fd);
usr.sbin/sti/sti.c
124
sti(int fd, int c)
usr.sbin/sti/sti.c
128
if (ioctl(fd, TIOCSTI, &ch) == -1)
usr.sbin/sti/sti.c
133
sendstr(int fd, const char *str)
usr.sbin/sti/sti.c
139
sti(fd, c);
usr.sbin/sti/sti.c
150
int fd;
usr.sbin/sti/sti.c
176
if ((fd = open(ttydev, O_RDWR)) == -1)
usr.sbin/sti/sti.c
187
sendstr(fd, line);
usr.sbin/sti/sti.c
192
sendstr(fd, line);
usr.sbin/sti/sti.c
198
sendstr(fd, *argv);
usr.sbin/sti/sti.c
200
sti(fd, ' ');
usr.sbin/sti/sti.c
204
(void)close(fd);
usr.sbin/sysinst/aout2elf.c
100
close(fd);
usr.sbin/sysinst/aout2elf.c
103
close(fd);
usr.sbin/sysinst/aout2elf.c
319
int fd, n, rootd, serrno, nlnk = 0;
usr.sbin/sysinst/aout2elf.c
327
if ((fd = open(".", O_RDONLY)) < 0) {
usr.sbin/sysinst/aout2elf.c
433
if (fchdir(fd) < 0) {
usr.sbin/sysinst/aout2elf.c
439
(void)close(fd);
usr.sbin/sysinst/aout2elf.c
443
(void)fchdir(fd);
usr.sbin/sysinst/aout2elf.c
444
err2: (void)close(fd);
usr.sbin/sysinst/aout2elf.c
88
int fd;
usr.sbin/sysinst/aout2elf.c
95
fd = open(name, O_RDONLY);
usr.sbin/sysinst/aout2elf.c
96
if (fd < 0) {
usr.sbin/sysinst/aout2elf.c
99
if (read(fd, &ex, sizeof ex) - sizeof ex != 0) {
usr.sbin/sysinst/arch/acorn32/md.c
123
if (lseek(fd, (off_t)offset * DEV_BSIZE, SEEK_SET) < 0
usr.sbin/sysinst/arch/acorn32/md.c
124
|| read(fd, bb, sizeof(bb)) - sizeof(bb) != 0) {
usr.sbin/sysinst/arch/acorn32/md.c
128
close(fd);
usr.sbin/sysinst/arch/acorn32/md.c
151
close(fd);
usr.sbin/sysinst/arch/acorn32/md.c
164
close(fd);
usr.sbin/sysinst/arch/acorn32/md.c
168
close(fd);
usr.sbin/sysinst/arch/acorn32/md.c
69
int fd;
usr.sbin/sysinst/arch/acorn32/md.c
77
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/acorn32/md.c
78
if (fd < 0) {
usr.sbin/sysinst/arch/acorn32/md.c
83
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/acorn32/md.c
86
close(fd);
usr.sbin/sysinst/arch/acorn32/md.c
90
if (lseek(fd, (off_t)FILECORE_BOOT_SECTOR * DEV_BSIZE, SEEK_SET) < 0
usr.sbin/sysinst/arch/acorn32/md.c
91
|| read(fd, bb, sizeof(bb)) - sizeof(bb) != 0) {
usr.sbin/sysinst/arch/acorn32/md.c
94
close(fd);
usr.sbin/sysinst/arch/alpha/md.c
66
int fd;
usr.sbin/sysinst/arch/alpha/md.c
71
fd = open (dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/alpha/md.c
72
if (fd < 0) {
usr.sbin/sysinst/arch/alpha/md.c
77
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/alpha/md.c
80
close(fd);
usr.sbin/sysinst/arch/alpha/md.c
83
close(fd);
usr.sbin/sysinst/arch/cats/md.c
66
int fd;
usr.sbin/sysinst/arch/cats/md.c
76
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/cats/md.c
77
if (fd < 0) {
usr.sbin/sysinst/arch/cats/md.c
82
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/cats/md.c
85
close(fd);
usr.sbin/sysinst/arch/cats/md.c
89
close(fd);
usr.sbin/sysinst/arch/emips/md.c
66
int fd;
usr.sbin/sysinst/arch/emips/md.c
71
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/emips/md.c
72
if (fd < 0) {
usr.sbin/sysinst/arch/emips/md.c
79
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/emips/md.c
85
close(fd);
usr.sbin/sysinst/arch/emips/md.c
88
close(fd);
usr.sbin/sysinst/arch/evbsh3/md.c
54
int fd;
usr.sbin/sysinst/arch/evbsh3/md.c
59
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/evbsh3/md.c
60
if (fd < 0) {
usr.sbin/sysinst/arch/evbsh3/md.c
65
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/evbsh3/md.c
68
close(fd);
usr.sbin/sysinst/arch/evbsh3/md.c
71
close(fd);
usr.sbin/sysinst/arch/ews4800mips/md.c
68
int fd;
usr.sbin/sysinst/arch/ews4800mips/md.c
73
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/ews4800mips/md.c
74
if (fd < 0) {
usr.sbin/sysinst/arch/ews4800mips/md.c
79
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/ews4800mips/md.c
82
close(fd);
usr.sbin/sysinst/arch/ews4800mips/md.c
85
close(fd);
usr.sbin/sysinst/arch/hp300/md.c
101
if (read(fd, buf, 1024) < 0) {
usr.sbin/sysinst/arch/hp300/md.c
104
close(fd);
usr.sbin/sysinst/arch/hp300/md.c
111
close(fd);
usr.sbin/sysinst/arch/hp300/md.c
64
int fd;
usr.sbin/sysinst/arch/hp300/md.c
70
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/hp300/md.c
71
if (fd < 0) {
usr.sbin/sysinst/arch/hp300/md.c
78
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/hp300/md.c
84
close(fd);
usr.sbin/sysinst/arch/hp300/md.c
90
close(fd);
usr.sbin/sysinst/arch/hpcarm/md.c
200
int fd = -1;
usr.sbin/sysinst/arch/hpcarm/md.c
203
fd = open(adevname, O_RDWR);
usr.sbin/sysinst/arch/hpcarm/md.c
204
if (fd < 0)
usr.sbin/sysinst/arch/hpcarm/md.c
208
sz = pread(fd, &pbr, sizeof(pbr), 0);
usr.sbin/sysinst/arch/hpcarm/md.c
224
(void)pwrite(fd, &pbr, sizeof(pbr), 0);
usr.sbin/sysinst/arch/hpcarm/md.c
227
if (fd >= 0)
usr.sbin/sysinst/arch/hpcarm/md.c
228
close(fd);
usr.sbin/sysinst/arch/hppa/md.c
69
int fd;
usr.sbin/sysinst/arch/hppa/md.c
74
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/hppa/md.c
75
if (fd < 0) {
usr.sbin/sysinst/arch/hppa/md.c
82
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/hppa/md.c
88
close(fd);
usr.sbin/sysinst/arch/hppa/md.c
91
close(fd);
usr.sbin/sysinst/arch/i386/md.c
840
int fd;
usr.sbin/sysinst/arch/i386/md.c
846
fd = open(path, O_RDONLY);
usr.sbin/sysinst/arch/i386/md.c
847
if (fd < 0)
usr.sbin/sysinst/arch/i386/md.c
850
if (fstat(fd, &st) < 0 || st.st_size != sizeof *mbrs) {
usr.sbin/sysinst/arch/i386/md.c
851
close(fd);
usr.sbin/sysinst/arch/i386/md.c
855
if (read(fd, &new_mbr, sizeof new_mbr) != sizeof new_mbr) {
usr.sbin/sysinst/arch/i386/md.c
856
close(fd);
usr.sbin/sysinst/arch/i386/md.c
859
close(fd);
usr.sbin/sysinst/arch/luna68k/md.c
72
int fd;
usr.sbin/sysinst/arch/luna68k/md.c
77
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/luna68k/md.c
78
if (fd < 0) {
usr.sbin/sysinst/arch/luna68k/md.c
83
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/luna68k/md.c
86
close(fd);
usr.sbin/sysinst/arch/luna68k/md.c
89
close(fd);
usr.sbin/sysinst/arch/mac68k/md.c
138
int fd, i;
usr.sbin/sysinst/arch/mac68k/md.c
148
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/mac68k/md.c
149
if (fd < 0) {
usr.sbin/sysinst/arch/mac68k/md.c
157
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/mac68k/md.c
160
close(fd);
usr.sbin/sysinst/arch/mac68k/md.c
215
if (lseek(fd, (off_t)0 * blk_size, SEEK_SET) < 0 ||
usr.sbin/sysinst/arch/mac68k/md.c
216
read(fd, &block, sizeof(block)) - sizeof(block) != 0 ||
usr.sbin/sysinst/arch/mac68k/md.c
227
lseek(fd, (off_t)(i+1) * blk_size, SEEK_SET);
usr.sbin/sysinst/arch/mac68k/md.c
228
read(fd, &block, sizeof(block));
usr.sbin/sysinst/arch/mac68k/md.c
236
lseek(fd, (off_t)1 * blk_size, SEEK_SET);
usr.sbin/sysinst/arch/mac68k/md.c
237
read(fd, map.blk, map.size * blk_size);
usr.sbin/sysinst/arch/mac68k/md.c
239
close(fd);
usr.sbin/sysinst/arch/mac68k/md.c
363
int fd;
usr.sbin/sysinst/arch/mac68k/md.c
379
if ((fd = open(dev_name, O_WRONLY, 0)) < 0) {
usr.sbin/sysinst/arch/mac68k/md.c
390
if (lseek (fd, (off_t)0 * blk_size, SEEK_SET) < 0) {
usr.sbin/sysinst/arch/mac68k/md.c
393
close (fd);
usr.sbin/sysinst/arch/mac68k/md.c
397
if (write (fd, &new_block0, blk_size) != blk_size) {
usr.sbin/sysinst/arch/mac68k/md.c
400
close (fd);
usr.sbin/sysinst/arch/mac68k/md.c
405
if (lseek (fd, (off_t)1 * blk_size, SEEK_SET) < 0) {
usr.sbin/sysinst/arch/mac68k/md.c
408
close (fd);
usr.sbin/sysinst/arch/mac68k/md.c
411
if (write (fd, map.blk, map.size * blk_size) != (map.size * blk_size)) {
usr.sbin/sysinst/arch/mac68k/md.c
414
close (fd);
usr.sbin/sysinst/arch/mac68k/md.c
417
fsync(fd);
usr.sbin/sysinst/arch/mac68k/md.c
440
ioctl(fd, DIOCGDINFO, &lp); /* Get the current disk label */
usr.sbin/sysinst/arch/mac68k/md.c
441
ioctl(fd, DIOCWDINFO, &lp); /* Write it out again */
usr.sbin/sysinst/arch/mac68k/md.c
443
close (fd);
usr.sbin/sysinst/arch/mac68k/md.c
456
int fd, i, no_match;
usr.sbin/sysinst/arch/mac68k/md.c
467
if ((fd = open(dev_name, O_RDONLY, 0)) < 0)
usr.sbin/sysinst/arch/mac68k/md.c
473
ioctl(fd, DIOCGDINFO, &updated_label);
usr.sbin/sysinst/arch/mac68k/md.c
474
close(fd);
usr.sbin/sysinst/arch/mac68k/md.c
743
int fd;
usr.sbin/sysinst/arch/mac68k/md.c
765
if ((fd = open(dev_name, O_RDONLY, 0)) >= 0) {
usr.sbin/sysinst/arch/mac68k/md.c
768
lseek(fd, seek, SEEK_SET);
usr.sbin/sysinst/arch/mac68k/md.c
769
read(fd, &macosblk, sizeof(macosblk));
usr.sbin/sysinst/arch/mac68k/md.c
775
close(fd);
usr.sbin/sysinst/arch/macppc/md.c
66
int fd;
usr.sbin/sysinst/arch/macppc/md.c
71
fd = open (dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/macppc/md.c
72
if (fd < 0) {
usr.sbin/sysinst/arch/macppc/md.c
77
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/macppc/md.c
80
close(fd);
usr.sbin/sysinst/arch/macppc/md.c
83
close(fd);
usr.sbin/sysinst/arch/mipsco/md.c
67
int fd;
usr.sbin/sysinst/arch/mipsco/md.c
72
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/mipsco/md.c
73
if (fd < 0) {
usr.sbin/sysinst/arch/mipsco/md.c
80
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/mipsco/md.c
86
close(fd);
usr.sbin/sysinst/arch/mipsco/md.c
89
close(fd);
usr.sbin/sysinst/arch/mvme68k/md.c
101
if (read(fd, buf, 1024) < 0) {
usr.sbin/sysinst/arch/mvme68k/md.c
104
close(fd);
usr.sbin/sysinst/arch/mvme68k/md.c
111
close(fd);
usr.sbin/sysinst/arch/mvme68k/md.c
64
int fd;
usr.sbin/sysinst/arch/mvme68k/md.c
70
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/mvme68k/md.c
71
if (fd < 0) {
usr.sbin/sysinst/arch/mvme68k/md.c
78
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/mvme68k/md.c
84
close(fd);
usr.sbin/sysinst/arch/mvme68k/md.c
90
close(fd);
usr.sbin/sysinst/arch/news68k/md.c
67
int fd;
usr.sbin/sysinst/arch/news68k/md.c
72
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/news68k/md.c
73
if (fd < 0) {
usr.sbin/sysinst/arch/news68k/md.c
78
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/news68k/md.c
81
close(fd);
usr.sbin/sysinst/arch/news68k/md.c
84
close(fd);
usr.sbin/sysinst/arch/newsmips/md.c
66
int fd;
usr.sbin/sysinst/arch/newsmips/md.c
71
fd = open (dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/newsmips/md.c
72
if (fd < 0) {
usr.sbin/sysinst/arch/newsmips/md.c
77
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/newsmips/md.c
80
close(fd);
usr.sbin/sysinst/arch/newsmips/md.c
83
close(fd);
usr.sbin/sysinst/arch/ofppc/md.c
645
int fd;
usr.sbin/sysinst/arch/ofppc/md.c
649
fd = opendisk(pm->diskdev, O_RDONLY, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/arch/ofppc/md.c
650
if (fd < 0)
usr.sbin/sysinst/arch/ofppc/md.c
653
if (pread(fd, rdb, 512, blk * 512) != 512)
usr.sbin/sysinst/arch/pmax/md.c
66
int fd;
usr.sbin/sysinst/arch/pmax/md.c
71
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/pmax/md.c
72
if (fd < 0) {
usr.sbin/sysinst/arch/pmax/md.c
79
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/pmax/md.c
85
close(fd);
usr.sbin/sysinst/arch/pmax/md.c
88
close(fd);
usr.sbin/sysinst/arch/sgimips/md.c
102
close(fd);
usr.sbin/sysinst/arch/sgimips/md.c
105
close(fd);
usr.sbin/sysinst/arch/sgimips/md.c
83
int fd;
usr.sbin/sysinst/arch/sgimips/md.c
88
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/sgimips/md.c
89
if (fd < 0) {
usr.sbin/sysinst/arch/sgimips/md.c
96
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/shark/md.c
209
int fd;
usr.sbin/sysinst/arch/shark/md.c
212
fd = opendisk(disk, O_WRONLY, diskpath, diskpathlen, 0);
usr.sbin/sysinst/arch/shark/md.c
213
if (fd < 0)
usr.sbin/sysinst/arch/shark/md.c
217
if (pwrite(fd, &sector, sizeof(sector), 0) < 0) {
usr.sbin/sysinst/arch/shark/md.c
218
close(fd);
usr.sbin/sysinst/arch/shark/md.c
222
close(fd);
usr.sbin/sysinst/arch/shark/md.c
69
int fd;
usr.sbin/sysinst/arch/shark/md.c
74
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/shark/md.c
75
if (fd < 0) {
usr.sbin/sysinst/arch/shark/md.c
80
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/shark/md.c
83
close(fd);
usr.sbin/sysinst/arch/shark/md.c
86
close(fd);
usr.sbin/sysinst/arch/vax/md.c
69
int fd;
usr.sbin/sysinst/arch/vax/md.c
74
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/vax/md.c
75
if (fd < 0) {
usr.sbin/sysinst/arch/vax/md.c
82
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/vax/md.c
88
close(fd);
usr.sbin/sysinst/arch/vax/md.c
91
close(fd);
usr.sbin/sysinst/arch/virt68k/md.c
101
if (read(fd, buf, 1024) < 0) {
usr.sbin/sysinst/arch/virt68k/md.c
104
close(fd);
usr.sbin/sysinst/arch/virt68k/md.c
111
close(fd);
usr.sbin/sysinst/arch/virt68k/md.c
64
int fd;
usr.sbin/sysinst/arch/virt68k/md.c
70
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/virt68k/md.c
71
if (fd < 0) {
usr.sbin/sysinst/arch/virt68k/md.c
78
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/virt68k/md.c
84
close(fd);
usr.sbin/sysinst/arch/virt68k/md.c
90
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
101
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
107
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
118
if (read(fd, buf, 1024) < 0) {
usr.sbin/sysinst/arch/x68k/md.c
121
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
128
if (read(fd, md_disklabel, sizeof(md_disklabel)) < 0) {
usr.sbin/sysinst/arch/x68k/md.c
131
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
140
close(fd);
usr.sbin/sysinst/arch/x68k/md.c
81
int fd;
usr.sbin/sysinst/arch/x68k/md.c
87
fd = open(dev_name, O_RDONLY, 0);
usr.sbin/sysinst/arch/x68k/md.c
88
if (fd < 0) {
usr.sbin/sysinst/arch/x68k/md.c
95
if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
usr.sbin/sysinst/arch/zaurus/md.c
174
int fd = -1;
usr.sbin/sysinst/arch/zaurus/md.c
177
fd = open(adevname, O_RDWR);
usr.sbin/sysinst/arch/zaurus/md.c
178
if (fd < 0)
usr.sbin/sysinst/arch/zaurus/md.c
182
sz = pread(fd, &pbr, sizeof(pbr), 0);
usr.sbin/sysinst/arch/zaurus/md.c
202
(void)pwrite(fd, &pbr, sizeof(pbr), 0);
usr.sbin/sysinst/arch/zaurus/md.c
205
if (fd >= 0)
usr.sbin/sysinst/arch/zaurus/md.c
206
close(fd);
usr.sbin/sysinst/defs.h
773
const char *get_last_mounted(int fd, daddr_t offset, uint *fs_type,
usr.sbin/sysinst/disklabel.c
198
int fd;
usr.sbin/sysinst/disklabel.c
210
fd = opendisk(disk, O_RDONLY, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/disklabel.c
211
if (fd == -1) {
usr.sbin/sysinst/disklabel.c
222
if (ioctl(fd, DIOCGDINFO, &parts->l) < 0) {
usr.sbin/sysinst/disklabel.c
224
close(fd);
usr.sbin/sysinst/disklabel.c
240
close(fd);
usr.sbin/sysinst/disklabel.c
276
const char *lm = get_last_mounted(fd,
usr.sbin/sysinst/disklabel.c
296
close(fd);
usr.sbin/sysinst/disks.c
1894
int fd;
usr.sbin/sysinst/disks.c
1902
fd = open(disk, O_RDONLY);
usr.sbin/sysinst/disks.c
1903
if (fd == -1)
usr.sbin/sysinst/disks.c
1907
rval = pread(fd, sblk.buf, sizeof sblk.buf, SBLOCK_UFS1);
usr.sbin/sysinst/disks.c
1908
close(fd);
usr.sbin/sysinst/disks.c
354
int error, fd;
usr.sbin/sysinst/disks.c
359
fd = open("/dev/drvctl", O_RDONLY);
usr.sbin/sysinst/disks.c
360
if (fd == -1)
usr.sbin/sysinst/disks.c
373
error = prop_dictionary_sendrecv_ioctl(command_dict, fd,
usr.sbin/sysinst/disks.c
376
close(fd);
usr.sbin/sysinst/geom.c
103
int fd, error;
usr.sbin/sysinst/geom.c
105
if ((fd = opendisk(disk, O_RDONLY, buf, sizeof(buf), 0)) == -1)
usr.sbin/sysinst/geom.c
108
error = getdiskinfo(disk, fd, NULL, d, NULL);
usr.sbin/sysinst/geom.c
109
close(fd);
usr.sbin/sysinst/geom.c
52
int fd;
usr.sbin/sysinst/geom.c
56
fd = opendisk(disk, O_RDONLY, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/geom.c
57
if (fd == -1)
usr.sbin/sysinst/geom.c
60
if (ioctl(fd, cmd, d) == -1) {
usr.sbin/sysinst/geom.c
62
(void)close(fd);
usr.sbin/sysinst/geom.c
66
(void)close(fd);
usr.sbin/sysinst/gpt.c
1439
int fd;
usr.sbin/sysinst/gpt.c
1459
fd = opendisk(disk, O_RDWR, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/gpt.c
1460
if (fd < 0)
usr.sbin/sysinst/gpt.c
1462
if (ioctl(fd, DIOCAWEDGE, &dkw) == -1) {
usr.sbin/sysinst/gpt.c
1465
gpt_sanitize(fd, parts, p);
usr.sbin/sysinst/gpt.c
1466
if (ioctl(fd, DIOCAWEDGE, &dkw) == 0)
usr.sbin/sysinst/gpt.c
1469
close(fd);
usr.sbin/sysinst/gpt.c
1473
close(fd);
usr.sbin/sysinst/gpt.c
1565
int fd, bits = 0;
usr.sbin/sysinst/gpt.c
1575
fd = opendisk(arg->disk, O_RDWR, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/gpt.c
1576
if (fd < 0)
usr.sbin/sysinst/gpt.c
1578
if (ioctl(fd, DIOCRMWEDGES, &bits) == -1)
usr.sbin/sysinst/gpt.c
1580
close(fd);
usr.sbin/sysinst/gpt.c
268
int fd;
usr.sbin/sysinst/gpt.c
422
fd = opendisk(parts->dp.disk, O_RDONLY, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/gpt.c
432
const char *lm = get_last_mounted(fd,
usr.sbin/sysinst/gpt.c
467
if (ioctl(fd, DIOCLWEDGES, &dkwl) == 0) {
usr.sbin/sysinst/gpt.c
473
if (dkw != NULL && ioctl(fd, DIOCLWEDGES, &dkwl) == 0) {
usr.sbin/sysinst/gpt.c
480
close(fd);
usr.sbin/sysinst/label.c
1968
get_last_mounted(int fd, daddr_t partstart, uint *fs_type, uint *fs_sub_type,
usr.sbin/sysinst/label.c
1978
if (fd == -1)
usr.sbin/sysinst/label.c
1988
if (pread(fd, sblk, sizeof sblk,
usr.sbin/sysinst/mbr.c
242
blockread(int fd, size_t secsize, void *buf, size_t nbytes, off_t offset)
usr.sbin/sysinst/mbr.c
254
return pread(fd, buf, nbytes, offset);
usr.sbin/sysinst/mbr.c
259
nr = pread(fd, iobuf, secsize, rnd);
usr.sbin/sysinst/mbr.c
2644
mbr_free_wedge(int *fd, const char *disk, const char *wedge)
usr.sbin/sysinst/mbr.c
2649
if (*fd == -1)
usr.sbin/sysinst/mbr.c
2650
*fd = opendisk(disk, O_RDWR, diskpath,
usr.sbin/sysinst/mbr.c
2652
if (*fd != -1) {
usr.sbin/sysinst/mbr.c
2656
ioctl(*fd, DIOCDWEDGE, &dkw);
usr.sbin/sysinst/mbr.c
2665
int i, fd;
usr.sbin/sysinst/mbr.c
2669
fd = -1;
usr.sbin/sysinst/mbr.c
2674
mbr_free_wedge(&fd, arg->disk, m->wedge[i]);
usr.sbin/sysinst/mbr.c
2678
if (fd != -1)
usr.sbin/sysinst/mbr.c
2679
close(fd);
usr.sbin/sysinst/mbr.c
2695
int fd;
usr.sbin/sysinst/mbr.c
2699
fd = opendisk(arg->disk, O_RDWR, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/mbr.c
2700
if (fd != -1) {
usr.sbin/sysinst/mbr.c
2705
write(fd, buf, arg->bytes_per_sector);
usr.sbin/sysinst/mbr.c
2708
close(fd);
usr.sbin/sysinst/mbr.c
271
blockwrite(int fd, size_t secsize, const void *buf, size_t nbytes,
usr.sbin/sysinst/mbr.c
284
return pwrite(fd, buf, nbytes, offset);
usr.sbin/sysinst/mbr.c
289
nr = pread(fd, iobuf, secsize, rnd);
usr.sbin/sysinst/mbr.c
292
nr = pwrite(fd, iobuf, secsize, rnd);
usr.sbin/sysinst/mbr.c
2999
int fd;
usr.sbin/sysinst/mbr.c
3009
fd = opendisk(disk, O_RDWR, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/mbr.c
3010
if (fd < 0)
usr.sbin/sysinst/mbr.c
3012
if (ioctl(fd, DIOCAWEDGE, &dkw) == -1) {
usr.sbin/sysinst/mbr.c
3013
close(fd);
usr.sbin/sysinst/mbr.c
3016
close(fd);
usr.sbin/sysinst/mbr.c
538
int fd, i;
usr.sbin/sysinst/mbr.c
549
fd = opendisk(disk, O_RDONLY, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/mbr.c
550
if (fd < 0)
usr.sbin/sysinst/mbr.c
554
if (blockread(fd, secsize, mbrs, sizeof *mbrs,
usr.sbin/sysinst/mbr.c
627
fd, mbri->sector + mbrp->mbrp_start,
usr.sbin/sysinst/mbr.c
658
if (fd >= 0)
usr.sbin/sysinst/mbr.c
659
close(fd);
usr.sbin/sysinst/mbr.c
673
int fd, i, ret = 0, bits = 0;
usr.sbin/sysinst/mbr.c
686
fd = opendisk(disk, secsize == 512 ? O_WRONLY : O_RDWR,
usr.sbin/sysinst/mbr.c
688
if (fd < 0)
usr.sbin/sysinst/mbr.c
692
if (ioctl(fd, DIOCRMWEDGES, &bits) == -1)
usr.sbin/sysinst/mbr.c
783
if (blockwrite(fd, secsize, &mbrsec, sizeof mbrsec,
usr.sbin/sysinst/mbr.c
790
(void)close(fd);
usr.sbin/sysinst/target.c
562
int fd, error;
usr.sbin/sysinst/target.c
564
fd = opendisk(disk, O_RDWR, diskpath, sizeof(diskpath), 0);
usr.sbin/sysinst/target.c
565
if (fd < 0)
usr.sbin/sysinst/target.c
569
error = ioctl(fd, DIOCDWEDGE, &dkw);
usr.sbin/sysinst/target.c
570
close(fd);
usr.sbin/sysinst/util.c
1217
int fd;
usr.sbin/sysinst/util.c
1219
fd = open(_PATH_RANDOM, O_RDWR, 0);
usr.sbin/sysinst/util.c
1220
if (fd >= 0) {
usr.sbin/sysinst/util.c
1221
write(fd, data, len);
usr.sbin/sysinst/util.c
1222
close(fd);
usr.sbin/sysinst/util.c
2041
int fd;
usr.sbin/sysinst/util.c
2058
if ((fd = mkstemp(bakname)) < 0) {
usr.sbin/sysinst/util.c
2063
close(fd);
usr.sbin/sysinst/util.c
2065
if (!(fp = fopen(rcconf, "r+")) || (fd = mkstemp(tempname)) < 0) {
usr.sbin/sysinst/util.c
2073
nfp = fdopen(fd, "w");
usr.sbin/sysinst/util.c
2076
close(fd);
usr.sbin/sysinst/util.c
2696
int fd, res;
usr.sbin/sysinst/util.c
2702
fd = open(DRVCTLDEV, O_RDONLY, 0);
usr.sbin/sysinst/util.c
2703
if (fd == -1)
usr.sbin/sysinst/util.c
2721
res = prop_dictionary_sendrecv_ioctl(command_dict, fd,
usr.sbin/sysinst/util.c
2724
close(fd);
usr.sbin/sysinst/wskbd.c
104
fd = open("/dev/wskbd0", O_WRONLY);
usr.sbin/sysinst/wskbd.c
105
if (fd < 0)
usr.sbin/sysinst/wskbd.c
107
if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) >= 0) {
usr.sbin/sysinst/wskbd.c
125
process_menu(kb_menu, &fd);
usr.sbin/sysinst/wskbd.c
129
close(fd);
usr.sbin/sysinst/wskbd.c
70
int fd = *(int *)arg;
usr.sbin/sysinst/wskbd.c
74
ioctl(fd, WSKBDIO_SETENCODING, &kbt->kb_encoding);
usr.sbin/sysinst/wskbd.c
89
int fd;
usr.sbin/syslogd/extern.h
68
extern void die(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
219
void init(int fd, short event, void *ev); /* SIGHUP kevent dispatch routine */
usr.sbin/syslogd/syslogd.c
230
void reapchild(int fd, short event, void *ev); /* SIGCHLD kevent dispatch routine */
usr.sbin/syslogd/syslogd.c
244
static void dispatch_read_klog(int fd, short event, void *ev);
usr.sbin/syslogd/syslogd.c
245
static void dispatch_read_finet(int fd, short event, void *ev);
usr.sbin/syslogd/syslogd.c
246
static void dispatch_read_funix(int fd, short event, void *ev);
usr.sbin/syslogd/syslogd.c
247
static void domark(int fd, short event, void *ev); /* timer kevent dispatch routine */
usr.sbin/syslogd/syslogd.c
2654
for (j = 0; j < finet->fd; j++) {
usr.sbin/syslogd/syslogd.c
2658
lsent = sendto(finet[j+1].fd, line, len, 0,
usr.sbin/syslogd/syslogd.c
2747
reapchild(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
2835
domark(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
2975
for (i = 0; i < TLS_Listen_Set->fd; i++) {
usr.sbin/syslogd/syslogd.c
2976
if (close(TLS_Listen_Set[i+1].fd) == -1)
usr.sbin/syslogd/syslogd.c
2995
die(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
3009
logerror("Exiting on signal %d", fd);
usr.sbin/syslogd/syslogd.c
3072
for (i = 0; i < finet->fd; i++) {
usr.sbin/syslogd/syslogd.c
3073
(void)close(finet[i+1].fd);
usr.sbin/syslogd/syslogd.c
3434
init(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
3512
for (i = 0; i < finet->fd; i++) {
usr.sbin/syslogd/syslogd.c
3513
if (close(finet[i+1].fd) < 0) {
usr.sbin/syslogd/syslogd.c
3668
for (i = 0; i < finet->fd; i++) {
usr.sbin/syslogd/syslogd.c
3669
if (shutdown(finet[i+1].fd, SHUT_RD) < 0) {
usr.sbin/syslogd/syslogd.c
4161
socks->fd = 0; /* num of sockets counter at start of array */
usr.sbin/syslogd/syslogd.c
4164
s->fd = socket(r->ai_family, r->ai_socktype, r->ai_protocol);
usr.sbin/syslogd/syslogd.c
4165
if (s->fd < 0) {
usr.sbin/syslogd/syslogd.c
4170
if (r->ai_family == AF_INET6 && setsockopt(s->fd, IPPROTO_IPV6,
usr.sbin/syslogd/syslogd.c
4173
close(s->fd);
usr.sbin/syslogd/syslogd.c
4178
if (bind(s->fd, r->ai_addr, r->ai_addrlen) < 0) {
usr.sbin/syslogd/syslogd.c
4180
close(s->fd);
usr.sbin/syslogd/syslogd.c
4184
event_set(s->ev, s->fd, EV_READ | EV_PERSIST,
usr.sbin/syslogd/syslogd.c
4196
socks->fd++; /* num counter */
usr.sbin/syslogd/syslogd.c
4202
if (socks->fd == 0) {
usr.sbin/syslogd/syslogd.c
4398
send_queue(int fd, short event, void *arg)
usr.sbin/syslogd/syslogd.c
4751
dispatch_force_tls_reconnect(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
4758
tls_reconnect(fd, event, f->f_un.f_tls.tls_conn);
usr.sbin/syslogd/syslogd.c
4897
writev1(int fd, struct iovec *iov, size_t count)
usr.sbin/syslogd/syslogd.c
4905
switch ((nw = writev(fd, iov, count))) {
usr.sbin/syslogd/syslogd.c
4909
pfd.fd = fd;
usr.sbin/syslogd/syslogd.c
733
setsockbuf(int fd, const char *name)
usr.sbin/syslogd/syslogd.c
738
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &curbuflen, &socklen) == -1) {
usr.sbin/syslogd/syslogd.c
744
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buflen, socklen) == -1) {
usr.sbin/syslogd/syslogd.c
760
dispatch_read_klog(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
766
" with linebuf@%p, length %zu)\n", fd, event, ev,
usr.sbin/syslogd/syslogd.c
769
rv = read(fd, &klog_linebuf[klog_linebufoff], resid - 1);
usr.sbin/syslogd/syslogd.c
790
dispatch_read_funix(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
797
if (getsockname(fd, (struct sockaddr *)&myname, &sunlen) != 0) {
usr.sbin/syslogd/syslogd.c
812
myname.sun_path, fd, event, ev, linebuf, linebufsize-1);
usr.sbin/syslogd/syslogd.c
815
rv = recvfrom(fd, linebuf, linebufsize-1, 0,
usr.sbin/syslogd/syslogd.c
833
dispatch_read_finet(int fd, short event, void *ev)
usr.sbin/syslogd/syslogd.c
845
fd, event, ev, linebuf, linebufsize-1);
usr.sbin/syslogd/syslogd.c
848
request_init(&req, RQ_DAEMON, appname, RQ_FILE, fd, NULL);
usr.sbin/syslogd/syslogd.c
856
rv = recvfrom(fd, linebuf, linebufsize-1, 0,
usr.sbin/syslogd/syslogd.h
126
#define FDMASK(fd) (1 << (fd))
usr.sbin/syslogd/syslogd.h
305
int fd;
usr.sbin/syslogd/tls.c
1244
tls_reconnect(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
1290
dispatch_tls_accept(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
1298
"dispatch_tls_accept(conn_info@%p, fd %d)\n", conn_info, fd);
usr.sbin/syslogd/tls.c
1310
event_set(conn_info->retryevent, fd, EV_READ,
usr.sbin/syslogd/tls.c
1315
event_set(conn_info->retryevent, fd, EV_WRITE,
usr.sbin/syslogd/tls.c
1358
dispatch_socket_accept(int fd, short event, void *ev)
usr.sbin/syslogd/tls.c
1380
if ((newsock = accept(fd, (struct sockaddr *)&frominet,
usr.sbin/syslogd/tls.c
1474
dispatch_tls_eof(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
1484
fd, event, arg);
usr.sbin/syslogd/tls.c
1523
int fd = c->socket;
usr.sbin/syslogd/tls.c
1530
DPRINTF((D_TLS|D_EVENT|D_CALL), "active TLS socket %d\n", fd);
usr.sbin/syslogd/tls.c
1547
event_set(c->tls_conn->retryevent, fd,
usr.sbin/syslogd/tls.c
1767
dispatch_tls_send(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
1800
event_set(conn_info->retryevent, fd, EV_READ,
usr.sbin/syslogd/tls.c
1805
event_set(conn_info->retryevent, fd, EV_WRITE,
usr.sbin/syslogd/tls.c
1886
dispatch_SSL_shutdown(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
1895
"dispatch_SSL_shutdown(conn_info@%p, fd %d)\n", conn_info, fd);
usr.sbin/syslogd/tls.c
1920
dispatch_SSL_shutdown(fd, 0, conn_info);
usr.sbin/syslogd/tls.c
1923
dispatch_SSL_shutdown(fd, 0, conn_info);
usr.sbin/syslogd/tls.c
1944
event_set(conn_info->retryevent, fd, EV_READ,
usr.sbin/syslogd/tls.c
1952
event_set(conn_info->retryevent, fd, EV_WRITE,
usr.sbin/syslogd/tls.c
866
socks->fd = 0; /* num of sockets counter at start of array */
usr.sbin/syslogd/tls.c
869
if ((s->fd = socket(r->ai_family, r->ai_socktype,
usr.sbin/syslogd/tls.c
876
&& setsockopt(s->fd, IPPROTO_IPV6, IPV6_V6ONLY,
usr.sbin/syslogd/tls.c
880
close(s->fd);
usr.sbin/syslogd/tls.c
883
if (setsockopt(s->fd, SOL_SOCKET, SO_REUSEADDR,
usr.sbin/syslogd/tls.c
888
if ((error = bind(s->fd, r->ai_addr, r->ai_addrlen)) == -1) {
usr.sbin/syslogd/tls.c
891
close(s->fd);
usr.sbin/syslogd/tls.c
894
if (listen(s->fd, TLSBACKLOG) == -1) {
usr.sbin/syslogd/tls.c
896
close(s->fd);
usr.sbin/syslogd/tls.c
900
event_set(s->ev, s->fd, EV_READ | EV_PERSIST,
usr.sbin/syslogd/tls.c
904
socks->fd = socks->fd + 1; /* num counter */
usr.sbin/syslogd/tls.c
908
if (socks->fd == 0) {
usr.sbin/syslogd/tls.c
928
dispatch_SSL_connect(int fd, short event, void *arg)
usr.sbin/syslogd/tls.c
938
conn_info, fd);
usr.sbin/syslogd/tls.c
949
event_set(conn_info->retryevent, fd, EV_READ,
usr.sbin/syslogd/tls.c
954
event_set(conn_info->retryevent, fd, EV_WRITE,
usr.sbin/syslogd/tls.c
977
event_set(conn_info->event, fd, EV_READ, dispatch_tls_eof, conn_info);
usr.sbin/timed/timed/acksend.c
121
fprintf(fd,"acksend: seq # %u!=%u\n",
usr.sbin/timed/timed/acksend.c
97
fprintf(fd, "acksend: to %s: ",
usr.sbin/timed/timed/candidate.c
153
fprintf(fd, "candidate: ");
usr.sbin/timed/timed/candidate.c
66
fprintf(fd, "election: discarded stale REFUSE\n");
usr.sbin/timed/timed/candidate.c
70
fprintf(fd, "election: discarded stale QUIT\n");
usr.sbin/timed/timed/candidate.c
76
fprintf(fd, "This machine is a candidate time master\n");
usr.sbin/timed/timed/correct.c
101
(void)fflush(fd);
usr.sbin/timed/timed/correct.c
151
fprintf(fd,
usr.sbin/timed/timed/correct.c
98
fprintf(fd,
usr.sbin/timed/timed/globals.h
149
extern FILE *fd;
usr.sbin/timed/timed/globals.h
157
#define trace_msg(msg) {if (trace) fprintf(fd, msg);}
usr.sbin/timed/timed/globals.h
163
fprintf(fd, "%s %d: sendto %s: %d", __FILE__, __LINE__, \
usr.sbin/timed/timed/master.c
320
fprintf(fd,
usr.sbin/timed/timed/master.c
331
fprintf(fd, "garbage message: ");
usr.sbin/timed/timed/master.c
390
fprintf(fd, "measurements starting at %s\n", date());
usr.sbin/timed/timed/master.c
409
fprintf(fd,
usr.sbin/timed/timed/master.c
412
(void)fflush(fd);
usr.sbin/timed/timed/master.c
423
(void)fflush(fd);
usr.sbin/timed/timed/master.c
436
fprintf(fd, "measurements finished at %s\n", date());
usr.sbin/timed/timed/master.c
446
fprintf(fd,"local correction of %ld ms.\n", mydelta);
usr.sbin/timed/timed/master.c
482
fprintf(fd,
usr.sbin/timed/timed/master.c
485
(void)fflush(fd);
usr.sbin/timed/timed/master.c
504
if (!fd) /* quit if tracing already off */
usr.sbin/timed/timed/master.c
512
fprintf(fd, "host table: %d entries at %s\n", slvcount, date());
usr.sbin/timed/timed/master.c
518
fprintf(fd, "\n");
usr.sbin/timed/timed/master.c
522
fprintf(fd, " %s", htp->name);
usr.sbin/timed/timed/master.c
524
fprintf(fd, "\n");
usr.sbin/timed/timed/master.c
567
fprintf(fd, "no more slots in host table\n");
usr.sbin/timed/timed/master.c
651
fprintf(fd, "remove %s\n", htp->name);
usr.sbin/timed/timed/master.c
804
if (!fd) {
usr.sbin/timed/timed/master.c
805
fd = fopen(_PATH_TIMEDLOG, "w");
usr.sbin/timed/timed/master.c
806
if (!fd) {
usr.sbin/timed/timed/master.c
810
fprintf(fd,"Tracing started at %s\n", date());
usr.sbin/timed/timed/master.c
826
fprintf(fd, "%s at %s\n", msg, date());
usr.sbin/timed/timed/master.c
827
(void)fclose(fd);
usr.sbin/timed/timed/master.c
828
fd = 0;
usr.sbin/timed/timed/master.c
88
fprintf(fd, "This machine is master\n");
usr.sbin/timed/timed/measure.c
105
set[0].fd = sock_raw;
usr.sbin/timed/timed/measure.c
280
fprintf(fd,
usr.sbin/timed/timed/measure.c
296
fprintf(fd,
usr.sbin/timed/timed/measure.c
299
(void)fflush(fd);
usr.sbin/timed/timed/networkdelta.c
106
fprintf(fd, "median of %d values starting at %ld is about ",
usr.sbin/timed/timed/networkdelta.c
132
fprintf(fd, "nothing close to median %ld\n", med);
usr.sbin/timed/timed/networkdelta.c
138
fprintf(fd, "only value near median is %ld\n", x[0]);
usr.sbin/timed/timed/networkdelta.c
143
fprintf(fd, "median of %ld values starting at %ld is ",
usr.sbin/timed/timed/networkdelta.c
209
fprintf(fd,
usr.sbin/timed/timed/networkdelta.c
234
fprintf(fd,
usr.sbin/timed/timed/networkdelta.c
260
fprintf(fd, "%ld in %d passes\n", (long)a, pass);
usr.sbin/timed/timed/readmsg.c
105
fprintf(fd, length > 1 ? "\t" : "queue:\t");
usr.sbin/timed/timed/readmsg.c
141
fprintf(fd, "readmsg: found ");
usr.sbin/timed/timed/readmsg.c
153
fprintf(fd, "\tdup ");
usr.sbin/timed/timed/readmsg.c
174
set[0].fd = sock;
usr.sbin/timed/timed/readmsg.c
186
fprintf(fd, "readmsg: wait %ld.%6ld at %s\n",
usr.sbin/timed/timed/readmsg.c
196
&& EOF == fflush(fd))
usr.sbin/timed/timed/readmsg.c
230
fprintf(fd,"readmsg: version mismatch\n");
usr.sbin/timed/timed/readmsg.c
265
fprintf(fd,"readmsg: discard null net ");
usr.sbin/timed/timed/readmsg.c
286
fprintf(fd, "readmsg: discard own ");
usr.sbin/timed/timed/readmsg.c
310
fprintf(fd, "readmsg: ");
usr.sbin/timed/timed/readmsg.c
321
fprintf(fd,
usr.sbin/timed/timed/readmsg.c
359
fprintf(fd, "Slaveack: ");
usr.sbin/timed/timed/readmsg.c
367
fprintf(fd, "Slaveack: no ack: ");
usr.sbin/timed/timed/readmsg.c
387
fprintf(fd, "Ignoreack: ");
usr.sbin/timed/timed/readmsg.c
395
fprintf(fd, "Ignoreack: no ack: ");
usr.sbin/timed/timed/readmsg.c
422
fprintf(fd, "Masterack: ");
usr.sbin/timed/timed/readmsg.c
431
fprintf(fd, "Masterack: ");
usr.sbin/timed/timed/readmsg.c
439
fprintf(fd,"Masterack: no ack: ");
usr.sbin/timed/timed/readmsg.c
456
fprintf(fd, "bad type (%u) on packet from %s\n",
usr.sbin/timed/timed/readmsg.c
464
fprintf(fd, "%s %d %-6u #%d %-15s %s\n",
usr.sbin/timed/timed/readmsg.c
479
fprintf(fd, "%s %d %-6u %s %-15s %s\n",
usr.sbin/timed/timed/readmsg.c
489
fprintf(fd, "%s %d %-6u (%ld,%ld) %-15s %s\n",
usr.sbin/timed/timed/readmsg.c
500
fprintf(fd, "%s %d %-6u %-15s %s\n",
usr.sbin/timed/timed/readmsg.c
90
fprintf(fd, "readmsg: looking for %s from %s, %s\n",
usr.sbin/timed/timed/readmsg.c
99
fprintf(fd,"\t ...%d skipped\n",
usr.sbin/timed/timed/slave.c
109
fprintf(fd, "election timer expired\n");
usr.sbin/timed/timed/slave.c
115
fprintf(fd, "Looking for nets to master\n");
usr.sbin/timed/timed/slave.c
140
fprintf(fd, "Looking for loops\n");
usr.sbin/timed/timed/slave.c
183
fprintf(fd, "slave ignored: ");
usr.sbin/timed/timed/slave.c
195
fprintf(fd, "slave ignored: ");
usr.sbin/timed/timed/slave.c
546
fprintf(fd,"discarding forwarded LOOP\n");
usr.sbin/timed/timed/slave.c
580
fprintf(fd, "garbage message: ");
usr.sbin/timed/timed/slave.c
607
fprintf(fd, "submaster to %s\n", master_name);
usr.sbin/timed/timed/slave.c
612
fprintf(fd, "slave to %s\n", master_name);
usr.sbin/timed/timed/timed.c
429
fprintf(fd, "suppress: %s\n", name);
usr.sbin/timed/timed/timed.c
435
fprintf(fd, "suppress:\tdiscarded packet from %s\n",
usr.sbin/timed/timed/timed.c
552
fprintf(fd, "Net status:\n");
usr.sbin/timed/timed/timed.c
567
fprintf(fd, "\t%-16s", inet_ntoa(ntp->net));
usr.sbin/timed/timed/timed.c
570
fprintf(fd, "NOMASTER\n");
usr.sbin/timed/timed/timed.c
573
fprintf(fd, "MASTER\n");
usr.sbin/timed/timed/timed.c
576
fprintf(fd, "SLAVE\n");
usr.sbin/timed/timed/timed.c
579
fprintf(fd, "IGNORE\n");
usr.sbin/timed/timed/timed.c
582
fprintf(fd, "invalid state %d\n",
usr.sbin/timed/timed/timed.c
592
fprintf(fd,
usr.sbin/timed/timed/timed.c
750
(void)fprintf(fd, "get_goodgroup: %s not in %s\n",
usr.sbin/timed/timed/timed.c
755
(void)fprintf(fd, "get_goodgroup: %s in %s\n",
usr.sbin/timed/timed/timed.c
76
FILE *fd; /* trace file FD */
usr.sbin/timed/timedc/cmds.c
142
set[0].fd = sock;
usr.sbin/timed/timedc/cmds.c
328
set[0].fd = sock;
usr.sbin/timed/timedc/cmds.c
477
set[0].fd = sock;
usr.sbin/timed/timedc/timedc.c
59
FILE *fd = 0;
usr.sbin/tpctl/data.c
257
int res, fd;
usr.sbin/tpctl/data.c
262
fd = 0; /* XXXGCC -Wuninitialized [hpcarm] */
usr.sbin/tpctl/data.c
278
if ((fd = open(tempfile, O_RDWR|O_CREAT|O_EXCL, 0644)) < 0) {
usr.sbin/tpctl/data.c
283
if ((fp = fdopen(fd, "w")) == NULL) {
usr.sbin/tpctl/data.c
306
close(fd);
usr.sbin/tpctl/fb.c
105
fb->baseaddr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd,0);
usr.sbin/tpctl/fb.c
61
if (ioctl(fb->fd, WSDISPLAYIO_SMODE, &dispmode) < 0)
usr.sbin/tpctl/fb.c
70
fb_init(struct fb *fb, int fd)
usr.sbin/tpctl/fb.c
77
fb->fd = fd;
usr.sbin/tpctl/fb.c
80
if (ioctl(fb->fd, WSDISPLAYIO_GMODE, &fb->dispmode) < 0)
usr.sbin/tpctl/fb.c
82
if (ioctl(fb->fd, HPCFBIO_GCONF, &fb->conf) < 0) {
usr.sbin/tpctl/fb.c
83
if (ioctl(fb->fd, WSDISPLAYIO_GINFO, &fbinfo) < 0 ||
usr.sbin/tpctl/fb.c
84
ioctl(fb->fd, WSDISPLAYIO_LINEBYTES, &linebytes) < 0)
usr.sbin/tpctl/main.c
383
int fd = (int)(intptr_t)data;
usr.sbin/tpctl/main.c
388
if (tcgetattr(fd, &tm) < 0)
usr.sbin/tpctl/main.c
392
if (tcsetattr(fd, TCSANOW, &raw) < 0)
usr.sbin/tpctl/main.c
394
if ((flg = fcntl(fd, F_GETFL)) == -1)
usr.sbin/tpctl/main.c
396
if (fcntl(fd, F_SETFL, flg | O_NONBLOCK) == -1)
usr.sbin/tpctl/main.c
398
n = read(fd, buf, 1);
usr.sbin/tpctl/main.c
400
fcntl(fd, F_SETFL, flg);
usr.sbin/tpctl/main.c
401
tcsetattr(fd, TCSANOW, &tm);
usr.sbin/tpctl/tp.c
103
return ioctl(tp->fd, WSMOUSEIO_SCALIBCOORDS, &raw);
usr.sbin/tpctl/tp.c
109
return ioctl(tp->fd, WSMOUSEIO_SCALIBCOORDS, calibcoords);
usr.sbin/tpctl/tp.c
119
while (read(tp->fd, &ev, sizeof(ev)) == sizeof(ev)) {
usr.sbin/tpctl/tp.c
150
if ((res = read(tp->fd, &ev, sizeof(ev))) < 0) {
usr.sbin/tpctl/tp.c
50
tp_init(struct tp *tp, int fd)
usr.sbin/tpctl/tp.c
58
if (ioctl(fd, WSMOUSEIO_SETVERSION, &version) == -1) {
usr.sbin/tpctl/tp.c
63
tp->fd = fd;
usr.sbin/tpctl/tp.c
66
if (ioctl(tp->fd, WSMOUSEIO_GTYPE, &type) < 0)
usr.sbin/tpctl/tp.c
73
if (ioctl(tp->fd, WSMOUSEIO_GCALIBCOORDS, &calibcoords) < 0)
usr.sbin/tpctl/tp.c
76
flags = fcntl(tp->fd, F_GETFL);
usr.sbin/tpctl/tp.c
80
if (fcntl(tp->fd, F_SETFL, flags) < 0)
usr.sbin/tpctl/tp.c
84
if (ioctl(tp->fd, WSMOUSEIO_GETID, &id) == 0) {
usr.sbin/tpctl/tpctl.h
73
int fd;
usr.sbin/tpctl/tpctl.h
79
int fd;
usr.sbin/tprof/ksyms.c
133
close(fd);
usr.sbin/tprof/ksyms.c
80
int fd;
usr.sbin/tprof/ksyms.c
83
fd = open(_PATH_KSYMS, O_RDONLY);
usr.sbin/tprof/ksyms.c
84
if (fd == -1) {
usr.sbin/tprof/ksyms.c
90
e = elf_begin(fd, ELF_C_READ, NULL);
usr.sbin/traceroute/traceroute.c
1078
set[0].fd = sock;
usr.sbin/traceroute6/traceroute6.c
753
pfd[0].fd = sock;
usr.sbin/umcpmioctl/putflash.c
158
mcp2210_parse_flash_gp_req(int fd, struct mcp2210_set_nvram_req *req, char *argv[], int start, int end, bool debug)
usr.sbin/umcpmioctl/putflash.c
165
error = ioctl(fd, UMCPMIO_GET_FLASH, &current_flash);
usr.sbin/umcpmioctl/putflash.c
330
mcp2210_parse_flash_spi_req(int fd, struct mcp2210_set_nvram_req *req, char *argv[], int start, int end, bool debug)
usr.sbin/umcpmioctl/putflash.c
336
error = ioctl(fd, UMCPMIO_GET_FLASH, &current_flash);
usr.sbin/umcpmioctl/putflash.c
401
mcp2210_parse_flash_usbkeyparams_req(int fd, struct mcp2210_set_nvram_req *req, char *argv[], int start, int end, bool debug)
usr.sbin/umcpmioctl/putflash.c
407
error = ioctl(fd, UMCPMIO_GET_FLASH, &current_flash);
usr.sbin/umcpmioctl/putflash.c
42
mcp2221_parse_flash_gp_req(int fd, struct mcp2221_put_flash_req *req, char *argv[], int start, int end, bool debug)
usr.sbin/umcpmioctl/putflash.c
49
error = ioctl(fd, UMCPMIO_GET_FLASH, &current_flash);
usr.sbin/umcpmioctl/umcpmioctl.c
119
int fd = -1, error = 0, valid, validsub = -1, validsubsub = -1;
usr.sbin/umcpmioctl/umcpmioctl.c
145
fd = open(argv[0], O_RDWR, 0);
usr.sbin/umcpmioctl/umcpmioctl.c
146
if (fd == -1) {
usr.sbin/umcpmioctl/umcpmioctl.c
149
error = ioctl(fd, UMCPMIO_CHIP_TYPE, &chip_type);
usr.sbin/umcpmioctl/umcpmioctl.c
210
error = ioctl(fd, MCP2210_GET_SRAM, &mcp2210_get_sram);
usr.sbin/umcpmioctl/umcpmioctl.c
213
error = ioctl(fd, MCP2221_GET_SRAM, &get_sram_res);
usr.sbin/umcpmioctl/umcpmioctl.c
217
error = ioctl(fd, MCP2221_GET_GP_CFG, &get_gpio_cfg_res);
usr.sbin/umcpmioctl/umcpmioctl.c
277
error = ioctl(fd, UMCPMIO_GET_FLASH, &ioctl_get_flash);
usr.sbin/umcpmioctl/umcpmioctl.c
313
error = mcp2210_parse_flash_gp_req(fd, &ioctl_put_flash.req.mcp2210_set_req, argv, 4, argc, debug);
usr.sbin/umcpmioctl/umcpmioctl.c
326
error = mcp2210_parse_flash_spi_req(fd, &ioctl_put_flash.req.mcp2210_set_req, argv, 4, argc, debug);
usr.sbin/umcpmioctl/umcpmioctl.c
339
error = mcp2210_parse_flash_usbkeyparams_req(fd, &ioctl_put_flash.req.mcp2210_set_req, argv, 4, argc, debug);
usr.sbin/umcpmioctl/umcpmioctl.c
359
error = mcp2221_parse_flash_gp_req(fd, &ioctl_put_flash.req.mcp2221_put_req, argv, 4, argc, debug);
usr.sbin/umcpmioctl/umcpmioctl.c
376
error = ioctl(fd, UMCPMIO_PUT_FLASH, &ioctl_put_flash);
usr.sbin/umcpmioctl/umcpmioctl.c
386
error = ioctl(fd, UMCPMIO_GET_STATUS, &status_res);
usr.sbin/umcpmioctl/umcpmioctl.c
403
error = ioctl(fd, MCP2210_CANCEL_SPI, &cancel_res);
usr.sbin/umcpmioctl/umcpmioctl.c
539
(void)close(fd);
usr.sbin/usbdevs/usbdevs.c
336
get_highest_usb_device_unit(int fd, const char *dev, int depth)
usr.sbin/usbdevs/usbdevs.c
364
if (ioctl(fd, DRVLISTDEV, &laa) == -1)
usr.sbin/usbdevs/usbdevs.c
371
if (ioctl(fd, DRVLISTDEV, &laa) == -1)
usr.sbin/usbdevs/usbdevs.c
379
new_high = get_highest_usb_device_unit(fd, laa.l_childname[i],
usr.sbin/usbdevs/usbdevs.c
426
int fd = open(DRVCTLDEV, O_RDONLY, 0);
usr.sbin/usbdevs/usbdevs.c
429
if (fd != -1)
usr.sbin/usbdevs/usbdevs.c
430
highbus = get_highest_usb_device_unit(fd, "", 0);
usr.sbin/usbdevs/usbdevs.c
433
close(fd);
usr.sbin/user/user.c
1313
int fd;
usr.sbin/user/user.c
1337
if ((fd = mkstemp(f)) < 0) {
usr.sbin/user/user.c
1343
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
1347
(void)close(fd);
usr.sbin/user/user.c
1368
(void)close(fd);
usr.sbin/user/user.c
1376
(void)close(fd);
usr.sbin/user/user.c
377
int fd;
usr.sbin/user/user.c
396
if ((fd = mkstemp(f)) < 0) {
usr.sbin/user/user.c
401
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
405
(void)close(fd);
usr.sbin/user/user.c
414
(void)close(fd);
usr.sbin/user/user.c
445
int fd;
usr.sbin/user/user.c
461
if ((fd = mkstemp(f)) < 0) {
usr.sbin/user/user.c
466
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
469
(void)close(fd);
usr.sbin/user/user.c
517
(void)close(fd);
usr.sbin/user/user.c
552
int fd;
usr.sbin/user/user.c
584
if ((fd = mkstemp(f)) < 0) {
usr.sbin/user/user.c
590
if ((to = fdopen(fd, "w")) == NULL) {
usr.sbin/user/user.c
594
(void)close(fd);
usr.sbin/user/user.c
624
(void)close(fd);
usr.sbin/user/user.c
740
int fd;
usr.sbin/user/user.c
747
if ((fd = mkstemp(template)) < 0) {
usr.sbin/user/user.c
752
if ((fp = fdopen(fd, "w")) == NULL) {
usr.sbin/vnconfig/vnconfig.c
292
int fd, rv;
usr.sbin/vnconfig/vnconfig.c
294
fd = opendisk(dev, O_RDWR, rdev, sizeof(rdev), 0);
usr.sbin/vnconfig/vnconfig.c
295
if (fd < 0) {
usr.sbin/vnconfig/vnconfig.c
337
rv = ioctl(fd, VNDIOCCLR, &vndio);
usr.sbin/vnconfig/vnconfig.c
340
rv = ioctl(fd, VNDIOOCCLR, &vndio);
usr.sbin/vnconfig/vnconfig.c
360
rv = ioctl(fd, VNDIOCSET, &vndio);
usr.sbin/vnconfig/vnconfig.c
363
rv = ioctl(fd, VNDIOOCSET, &vndio);
usr.sbin/vnconfig/vnconfig.c
383
(void) close(fd);
usr.sbin/wsmoused/wsmoused.c
311
fds[0].fd = Mouse.m_statfd;
usr.sbin/wsmoused/wsmoused.c
315
fds[1].fd = Mouse.m_devfd;
usr.sbin/wsmuxctl/wsmuxctl.c
80
listdevs(int fd, int rec, int ind)
usr.sbin/wsmuxctl/wsmuxctl.c
87
if (ioctl(fd, WSMUXIO_LIST_DEVICES, &devs) < 0)
usr.sbin/ypbind/ypbind.c
1168
int fd;
usr.sbin/ypbind/ypbind.c
1179
fd = open_locked(path, O_RDONLY, 0644);
usr.sbin/ypbind/ypbind.c
1180
if (fd == -1) {
usr.sbin/ypbind/ypbind.c
1191
bytes = readv(fd, iov, 2);
usr.sbin/ypbind/ypbind.c
1192
(void)close(fd);
usr.sbin/ypbind/ypbind.c
149
int fd;
usr.sbin/ypbind/ypbind.c
151
fd = open(path, flags|O_SHLOCK, mode);
usr.sbin/ypbind/ypbind.c
152
if (fd < 0) {
usr.sbin/ypbind/ypbind.c
157
(void)flock(fd, LOCK_SH);
usr.sbin/ypbind/ypbind.c
159
return fd;
usr.sbin/ypbind/ypbind.c
371
int fd;
usr.sbin/ypbind/ypbind.c
377
fd = open_locked(path, O_CREAT|O_RDWR|O_TRUNC, 0644);
usr.sbin/ypbind/ypbind.c
378
if (fd == -1) {
usr.sbin/ypbind/ypbind.c
380
fd = open_locked(path, O_CREAT|O_RDWR|O_TRUNC, 0644);
usr.sbin/ypbind/ypbind.c
381
if (fd == -1) {
usr.sbin/ypbind/ypbind.c
386
return fd;
usr.sbin/ypbind/ypbind.c
494
int fd;
usr.sbin/ypbind/ypbind.c
651
if ((fd = makelock(dom)) == -1)
usr.sbin/ypbind/ypbind.c
654
dom->dom_lockfd = fd;
usr.sbin/yppoll/yppoll.c
152
int fd = RPC_ANYSOCK;
usr.sbin/yppoll/yppoll.c
155
return clnttcp_create(sin, prog, vers, &fd, 0, 0);
usr.sbin/yppoll/yppoll.c
157
return clntudp_create(sin, prog, vers, tv, &fd);
usr.sbin/ypserv/common/ypdb.c
109
int fd = -1;
usr.sbin/ypserv/common/ypdb.c
114
if ((fd = mkstemp(file)) == -1)
usr.sbin/ypserv/common/ypdb.c
119
if (fchmod(fd, 0644 & ~myumask) == -1)
usr.sbin/ypserv/common/ypdb.c
122
(void) close(fd);
usr.sbin/ypserv/common/ypdb.c
123
fd = -1;
usr.sbin/ypserv/common/ypdb.c
132
if (fd != 1)
usr.sbin/ypserv/common/ypdb.c
133
(void) close(fd);