Symbol: fd
bin/cat/cat.c
234
int fd, i;
bin/cat/cat.c
241
fd = -1;
bin/cat/cat.c
245
fd = STDIN_FILENO;
bin/cat/cat.c
248
fd = fileargs_open(fa, path);
bin/cat/cat.c
250
if (fd < 0 && errno == EOPNOTSUPP)
bin/cat/cat.c
251
fd = udom_open(path, O_RDONLY);
bin/cat/cat.c
254
if (fd < 0) {
bin/cat/cat.c
259
if (fd == STDIN_FILENO)
bin/cat/cat.c
262
if ((fp = fdopen(fd, "r")) == NULL)
bin/cat/cat.c
270
if (in_kernel_copy(fd) != 0) {
bin/cat/cat.c
273
raw_cat(fd);
bin/cat/cat.c
278
raw_cat(fd);
bin/cat/cat.c
280
if (fd != STDIN_FILENO)
bin/cat/cat.c
281
close(fd);
bin/cat/cat.c
442
int error, fd, serrno;
bin/cat/cat.c
467
fd = socket(res->ai_family, res->ai_socktype,
bin/cat/cat.c
469
if (fd < 0) {
bin/cat/cat.c
475
if (caph_rights_limit(fd, &rights) != 0) {
bin/cat/cat.c
477
close(fd);
bin/cat/cat.c
482
error = cap_connect(capnet, fd, res->ai_addr, res->ai_addrlen);
bin/cat/cat.c
487
close(fd);
bin/cat/cat.c
504
if (shutdown(fd, SHUT_WR) != 0)
bin/cat/cat.c
509
if (shutdown(fd, SHUT_RD) != 0)
bin/cat/cat.c
517
if (caph_rights_limit(fd, &rights) != 0) {
bin/cat/cat.c
519
close(fd);
bin/cat/cat.c
523
return (fd);
bin/cp/cp.c
506
int fd = *to.path ? -1 : to.dir;
bin/cp/cp.c
507
if (setfile(curr_stat, fd, true))
bin/cp/utils.c
328
setfile(struct stat *fs, int fd, bool beneath)
bin/cp/utils.c
336
fdval = fd != -1;
bin/cp/utils.c
345
if (fdval ? futimens(fd, tspec) :
bin/cp/utils.c
350
if (fdval ? fstat(fd, &ts) :
bin/cp/utils.c
365
if (fdval ? fchown(fd, fs->st_uid, fs->st_gid) :
bin/cp/utils.c
376
if (fdval ? fchmod(fd, fs->st_mode) :
bin/cp/utils.c
384
if (fdval ? fchflags(fd, fs->st_flags) :
bin/dd/dd.c
116
if (close(out.fd) == -1 && errno != EINTR)
bin/dd/dd.c
141
in.fd = STDIN_FILENO;
bin/dd/dd.c
147
in.fd = open(in.name, O_RDONLY | iflags, 0);
bin/dd/dd.c
149
if (in.fd == -1)
bin/dd/dd.c
156
if (caph_rights_limit(in.fd, &rights) == -1)
bin/dd/dd.c
167
out.fd = STDOUT_FILENO;
bin/dd/dd.c
170
oflags = fcntl(out.fd, F_GETFL);
bin/dd/dd.c
174
if (fcntl(out.fd, F_SETFL, oflags) == -1)
bin/dd/dd.c
186
out.fd = open(out.name, O_RDWR | oflags, DEFFILEMODE);
bin/dd/dd.c
193
if (out.fd == -1) {
bin/dd/dd.c
195
out.fd = open(out.name, O_WRONLY | oflags, DEFFILEMODE);
bin/dd/dd.c
200
if (out.fd == -1)
bin/dd/dd.c
206
if (caph_rights_limit(out.fd, &rights) == -1)
bin/dd/dd.c
208
if (caph_ioctls_limit(out.fd, cmds, nitems(cmds)) == -1)
bin/dd/dd.c
211
if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) {
bin/dd/dd.c
216
if (in.fd != STDOUT_FILENO && out.fd != STDOUT_FILENO) {
bin/dd/dd.c
221
if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) {
bin/dd/dd.c
254
if (ftruncate(out.fd, out.offset * out.dbsz) == -1)
bin/dd/dd.c
316
if (fstat(io->fd, &sb) == -1)
bin/dd/dd.c
321
if (ioctl(io->fd, FIODTYPE, &type) == -1) {
bin/dd/dd.c
334
if (lseek(io->fd, (off_t)0, SEEK_CUR) == -1 && errno == ESPIPE)
bin/dd/dd.c
414
n = read(in.fd, in.dbp + in.dbrcnt, in.dbsz - in.dbrcnt);
bin/dd/dd.c
439
lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
bin/dd/dd.c
525
if (ftruncate(out.fd, out.seek_offset) == -1)
bin/dd/dd.c
530
if (fsync(out.fd) == -1)
bin/dd/dd.c
533
if (fdatasync(out.fd) == -1)
bin/dd/dd.c
589
out.seek_offset = lseek(out.fd, pending, SEEK_CUR);
bin/dd/dd.c
597
nw = write(out.fd, outp, cnt);
bin/dd/dd.h
53
int fd; /* file descriptor */
bin/dd/position.c
110
if ((nr = read(in.fd, in.db, bcnt)) > 0) {
bin/dd/position.c
164
if (lseek(out.fd, seek_offset(&out), SEEK_CUR) == -1 &&
bin/dd/position.c
179
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
bin/dd/position.c
187
n = read(out.fd, out.db, out.dbsz);
bin/dd/position.c
201
if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
bin/dd/position.c
206
n = write(out.fd, out.db, out.dbsz);
bin/dd/position.c
94
if (lseek(in.fd, seek_offset(&in), SEEK_CUR) == -1 &&
bin/ed/buf.c
194
int fd;
bin/ed/buf.c
200
if ((fd = mkstemp(sfn)) == -1 ||
bin/ed/buf.c
201
(sfp = fdopen(fd, "w+")) == NULL) {
bin/ed/buf.c
202
if (fd != -1)
bin/ed/buf.c
203
close(fd);
bin/pax/ar_io.c
1236
ar_start_gzip(int fd, const char *gzip_prog, int wr)
bin/pax/ar_io.c
1250
dup2(fds[1], fd);
bin/pax/ar_io.c
1252
dup2(fds[0], fd);
bin/pax/ar_io.c
1258
dup2(fd, STDOUT_FILENO);
bin/pax/ar_io.c
1262
dup2(fd, STDIN_FILENO);
bin/pax/ar_subs.c
151
int fd;
bin/pax/ar_subs.c
304
if ((fd = file_creat(arcn)) < 0) {
bin/pax/ar_subs.c
313
res = (*frmt->rd_data)(arcn, fd, &cnt);
bin/pax/ar_subs.c
314
file_close(arcn, fd);
bin/pax/ar_subs.c
357
int fd = -1;
bin/pax/ar_subs.c
400
fd = -1;
bin/pax/ar_subs.c
428
if ((fd = open(arcn->org_name, O_RDONLY, 0)) < 0) {
bin/pax/ar_subs.c
444
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
449
if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) {
bin/pax/ar_subs.c
454
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
474
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
487
rdfile_close(arcn, &fd);
bin/pax/ar_subs.c
499
res = (*frmt->wr_data)(arcn, fd, &cnt);
bin/pax/ar_subs.c
500
rdfile_close(arcn, &fd);
bin/pax/file_subs.c
105
if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
bin/pax/file_subs.c
114
return(fd);
bin/pax/file_subs.c
126
file_close(ARCHD *arcn, int fd)
bin/pax/file_subs.c
130
if (fd < 0)
bin/pax/file_subs.c
132
if (close(fd) < 0)
bin/pax/file_subs.c
71
int fd = -1;
bin/pax/file_subs.c
747
file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
bin/pax/file_subs.c
794
if (lseek(fd, (off_t)wcnt, SEEK_CUR) < 0) {
bin/pax/file_subs.c
811
if (write(fd, st, wcnt) != wcnt) {
bin/pax/file_subs.c
828
file_flush(int fd, char *fname, int isempt)
bin/pax/file_subs.c
842
if (lseek(fd, (off_t)-1, SEEK_CUR) < 0) {
bin/pax/file_subs.c
847
if (write(fd, blnk, 1) < 0)
bin/pax/file_subs.c
859
rdfile_close(ARCHD *arcn, int *fd)
bin/pax/file_subs.c
864
if (*fd < 0)
bin/pax/file_subs.c
867
(void)close(*fd);
bin/pax/file_subs.c
868
*fd = -1;
bin/pax/file_subs.c
87
if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
bin/pax/file_subs.c
889
set_crc(ARCHD *arcn, int fd)
bin/pax/file_subs.c
89
return(fd);
bin/pax/file_subs.c
899
if (fd < 0) {
bin/pax/file_subs.c
915
if ((res = read(fd, tbuf, size)) <= 0)
bin/pax/file_subs.c
928
else if (fstat(fd, &sb) < 0)
bin/pax/file_subs.c
932
else if (lseek(fd, (off_t)0L, SEEK_SET) < 0)
bin/pkill/tests/spin_helper.c
101
fd = open(argv[2], O_RDWR | O_CREAT, 0755);
bin/pkill/tests/spin_helper.c
102
if (fd < 0)
bin/pkill/tests/spin_helper.c
104
close(fd);
bin/pkill/tests/spin_helper.c
94
int fd;
bin/pwait/tests/pwait_reap.c
48
pfds[0].fd = pwout;
bin/pwait/tests/pwait_reap.c
50
pfds[1].fd = pwerr;
bin/pwait/tests/pwait_reap.c
82
pfds[0].fd = pwout;
bin/pwait/tests/pwait_reap.c
84
pfds[1].fd = pwerr;
bin/sh/eval.c
1215
backcmd->fd = pip[0];
bin/sh/eval.c
647
result->fd = -1;
bin/sh/eval.c
697
result->fd = pip[0];
bin/sh/eval.c
702
result->fd, result->buf, result->nleft, result->jp));
bin/sh/eval.h
42
int fd; /* file descriptor to read from */
bin/sh/expand.c
1508
int fd = -1;
bin/sh/expand.c
1514
fd = number(shoptarg);
bin/sh/expand.c
1523
if (fd < 0)
bin/sh/expand.c
1526
setinputfd(fd, 1);
bin/sh/expand.c
483
if (in.fd < 0)
bin/sh/expand.c
485
while ((i = read(in.fd, buf, sizeof buf)) < 0 && errno == EINTR)
bin/sh/expand.c
515
if (in.fd >= 0)
bin/sh/expand.c
516
close(in.fd);
bin/sh/histedit.c
104
int fd;
bin/sh/histedit.c
115
fd = mkstemp(histtmpname);
bin/sh/histedit.c
116
if (fd == -1 || (f = fdopen(fd, "w")) == NULL) {
bin/sh/histedit.c
382
int fd;
bin/sh/histedit.c
385
if ((fd = mkstemp(editfilestr)) < 0)
bin/sh/histedit.c
388
if ((efp = fdopen(fd, "w")) == NULL) {
bin/sh/histedit.c
389
close(fd);
bin/sh/input.c
135
if (parsefile->fd == 0 && el) {
bin/sh/input.c
161
nr = read(parsefile->fd, parsefile->buf, parsefile->bufsize - 1);
bin/sh/input.c
170
if (parsefile->fd != 0)
bin/sh/input.c
252
if (parsefile->fd == 0 && hist &&
bin/sh/input.c
364
int fd;
bin/sh/input.c
372
if ((fd = open(fname, oflags)) < 0) {
bin/sh/input.c
377
if (fd < 10) {
bin/sh/input.c
378
fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 10);
bin/sh/input.c
379
close(fd);
bin/sh/input.c
382
fd = fd2;
bin/sh/input.c
384
setinputfd(fd, push);
bin/sh/input.c
395
setinputfd(int fd, int push)
bin/sh/input.c
399
if (parsefile->fd > 0)
bin/sh/input.c
400
close(parsefile->fd);
bin/sh/input.c
401
parsefile->fd = fd;
bin/sh/input.c
439
*pf = (struct parsefile){ .prev = parsefile, .fd = -1 };
bin/sh/input.c
454
if (pf->fd >= 0)
bin/sh/input.c
455
close(pf->fd);
bin/sh/input.c
518
if (parsefile->fd > 0) {
bin/sh/input.c
519
close(parsefile->fd);
bin/sh/input.c
520
parsefile->fd = 0;
bin/sh/input.c
79
int fd; /* file descriptor (or -1 if string) */
bin/sh/jobs.c
1367
if (n->nfile.fd != deffd) {
bin/sh/jobs.c
1368
s[0] = n->nfile.fd + '0';
bin/sh/main.c
266
int fd;
bin/sh/main.c
277
if ((fd = open(expandedname, oflags)) >= 0)
bin/sh/main.c
278
setinputfd(fd, 1);
bin/sh/main.c
280
if (fd < 0)
bin/sh/miscbltin.c
100
nread = read(fdc->fd, fdc->buf, fdc->buflen);
bin/sh/miscbltin.c
133
(void) lseek(fdc->fd, -residue, SEEK_CUR);
bin/sh/miscbltin.c
230
pfd.fd = STDIN_FILENO;
bin/sh/miscbltin.c
66
int fd;
bin/sh/miscbltin.c
81
fdctx_init(int fd, struct fdctx *fdc)
bin/sh/miscbltin.c
86
cur = lseek(fd, 0, SEEK_CUR);
bin/sh/miscbltin.c
88
.fd = fd,
bin/sh/output.c
213
} else if (dest->fd == MEM_OUT) {
bin/sh/output.c
240
if (dest->buf == NULL || dest->nextc == dest->buf || dest->fd < 0)
bin/sh/output.c
242
if (xwrite(dest->fd, dest->buf, dest->nextc - dest->buf) < 0)
bin/sh/output.c
346
xwrite(int fd, const char *buf, int nbytes)
bin/sh/output.c
355
i = write(fd, buf, n);
bin/sh/output.h
46
short fd;
bin/sh/parser.c
1030
char fd = *out;
bin/sh/parser.c
1035
np->nfile.fd = 1;
bin/sh/parser.c
1048
np->nfile.fd = 0;
bin/sh/parser.c
1053
np->nfile.fd = 0;
bin/sh/parser.c
1073
if (fd != '\0')
bin/sh/parser.c
1074
np->nfile.fd = digit_val(fd);
bin/sh/redir.c
108
int fd;
bin/sh/redir.c
129
fd = n->nfile.fd;
bin/sh/redir.c
130
if (fd == 0)
bin/sh/redir.c
133
n->ndup.dupfd == fd)
bin/sh/redir.c
136
if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) {
bin/sh/redir.c
138
if ((i = fcntl(fd, F_DUPFD_CLOEXEC, 10)) == -1) {
bin/sh/redir.c
145
error("%d: %s", fd, strerror(errno));
bin/sh/redir.c
149
sv->renamed[fd] = i;
bin/sh/redir.c
168
int fd = redir->nfile.fd;
bin/sh/redir.c
173
memory[fd] = 0;
bin/sh/redir.c
219
memory[fd] = 1;
bin/sh/redir.c
221
if (dup2(redir->ndup.dupfd, fd) < 0)
bin/sh/redir.c
226
close(fd);
bin/sh/redir.c
236
if (f != fd) {
bin/sh/redir.c
237
if (dup2(f, fd) == -1) {
bin/sh/redir.c
240
error("%d: %s", fd, strerror(e));
bin/sh/show.c
145
if (np->nfile.fd != dftfd)
bin/sh/show.c
146
fprintf(fp, "%d", np->nfile.fd);
bin/stty/key.c
191
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/key.c
194
(void)ioctl(ip->fd, TIOCEXT, &tmp);
bin/stty/key.c
285
if (ioctl(ip->fd, TIOCSETD, &tmp) < 0)
bin/stty/stty.c
140
if (i.set && tcsetattr(i.fd, 0, &i.t) < 0)
bin/stty/stty.c
142
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
bin/stty/stty.c
55
i.fd = STDIN_FILENO;
bin/stty/stty.c
70
if ((i.fd = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
bin/stty/stty.c
85
if (tcgetattr(i.fd, &i.t) < 0)
bin/stty/stty.c
87
if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0)
bin/stty/stty.c
89
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
bin/stty/stty.h
36
int fd; /* file descriptor */
cddl/compat/opensolaris/include/devid.h
50
int devid_get(int fd, ddi_devid_t *retdevid);
cddl/compat/opensolaris/include/devid.h
51
int devid_get_minor_name(int fd, char **retminor_name);
cddl/usr.sbin/zfsd/case_file.cc
1042
CaseFile::SerializeEvList(const EventList events, int fd,
cddl/usr.sbin/zfsd/case_file.cc
1053
write(fd, prefix, strlen(prefix));
cddl/usr.sbin/zfsd/case_file.cc
1054
write(fd, eventString.c_str(), eventString.length());
cddl/usr.sbin/zfsd/case_file.cc
1074
int fd(open(saveFile.str().c_str(), O_CREAT|O_TRUNC|O_WRONLY, 0644));
cddl/usr.sbin/zfsd/case_file.cc
1075
if (fd == -1) {
cddl/usr.sbin/zfsd/case_file.cc
1080
SerializeEvList(m_events, fd);
cddl/usr.sbin/zfsd/case_file.cc
1081
SerializeEvList(m_tentativeEvents, fd, "tentative ");
cddl/usr.sbin/zfsd/case_file.cc
1082
close(fd);
cddl/usr.sbin/zfsd/case_file.h
329
void SerializeEvList(const DevdCtl::EventList events, int fd,
cddl/usr.sbin/zfsd/zfsd.cc
343
fds[0].fd = m_devdSockFD;
cddl/usr.sbin/zfsd/zfsd.cc
346
fds[1].fd = s_signalPipeFD[0];
crypto/heimdal/appl/ftp/common/sockbuf.c
45
set_buffer_size(int fd, int read)
crypto/heimdal/appl/ftp/common/sockbuf.c
56
if(getsockopt(fd, SOL_SOCKET, optname, (void *)&curr, &optlen) == 0) {
crypto/heimdal/appl/ftp/common/sockbuf.c
65
setsockopt(fd, SOL_SOCKET, optname, (void *)&size, sizeof(size)) < 0)
crypto/heimdal/appl/ftp/ftp/cmds.c
798
int fd;
crypto/heimdal/appl/ftp/ftp/cmds.c
800
fd = mkstemp(temp);
crypto/heimdal/appl/ftp/ftp/cmds.c
801
if(fd < 0){
crypto/heimdal/appl/ftp/ftp/cmds.c
805
close(fd);
crypto/heimdal/appl/ftp/ftp/security.c
127
block_read(int fd, void *buf, size_t len)
crypto/heimdal/appl/ftp/ftp/security.c
132
b = read(fd, p, len);
crypto/heimdal/appl/ftp/ftp/security.c
144
block_write(int fd, void *buf, size_t len)
crypto/heimdal/appl/ftp/ftp/security.c
149
b = write(fd, p, len);
crypto/heimdal/appl/ftp/ftp/security.c
159
sec_get_data(int fd, struct buffer *buf, int level)
crypto/heimdal/appl/ftp/ftp/security.c
165
b = block_read(fd, &len, sizeof(len));
crypto/heimdal/appl/ftp/ftp/security.c
175
b = block_read(fd, buf->data, len);
crypto/heimdal/appl/ftp/ftp/security.c
214
sec_read(int fd, void *dataptr, int length)
crypto/heimdal/appl/ftp/ftp/security.c
220
return read(fd, dataptr, length);
crypto/heimdal/appl/ftp/ftp/security.c
235
ret = sec_get_data(fd, &in_buffer, data_prot);
crypto/heimdal/appl/ftp/ftp/security.c
252
sec_send(int fd, char *from, int length)
crypto/heimdal/appl/ftp/ftp/security.c
258
block_write(fd, &bytes, sizeof(bytes));
crypto/heimdal/appl/ftp/ftp/security.c
259
block_write(fd, buf, ntohl(bytes));
crypto/heimdal/appl/ftp/ftp/security.c
279
sec_write(int fd, char *dataptr, int length)
crypto/heimdal/appl/ftp/ftp/security.c
285
return write(fd, dataptr, length);
crypto/heimdal/appl/ftp/ftp/security.c
291
sec_send(fd, dataptr, len);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
622
FILE *fd;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
626
if ((fd = fopen(fname, "r")) != NULL) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
627
while (fgets(line, sizeof(line), fd) != NULL)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
637
fclose(fd);
crypto/heimdal/appl/ftp/ftpd/ftpd.c
668
FILE *fd;
crypto/heimdal/appl/ftp/ftpd/ftpd.c
673
fd = fopen(_PATH_FTPUSERS, "r");
crypto/heimdal/appl/ftp/ftpd/ftpd.c
675
if(fd == NULL)
crypto/heimdal/appl/ftp/ftpd/ftpd.c
678
while (fgets(line, sizeof(line), fd) != NULL) {
crypto/heimdal/appl/ftp/ftpd/ftpd.c
692
fclose(fd);
crypto/heimdal/appl/ftp/ftpd/logwtmp.c
110
static int fd;
crypto/heimdal/appl/ftp/ftpd/logwtmp.c
172
fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0);
crypto/heimdal/appl/ftp/ftpd/logwtmp.c
179
if(fd >= 0) {
crypto/heimdal/appl/ftp/ftpd/logwtmp.c
181
write(fd, &ut, sizeof(struct utmp)); /* XXX */
crypto/heimdal/appl/ftp/ftpd/security.c
127
block_read(int fd, void *buf, size_t len)
crypto/heimdal/appl/ftp/ftpd/security.c
132
b = read(fd, p, len);
crypto/heimdal/appl/ftp/ftpd/security.c
144
block_write(int fd, void *buf, size_t len)
crypto/heimdal/appl/ftp/ftpd/security.c
149
b = write(fd, p, len);
crypto/heimdal/appl/ftp/ftpd/security.c
159
sec_get_data(int fd, struct buffer *buf, int level)
crypto/heimdal/appl/ftp/ftpd/security.c
165
b = block_read(fd, &len, sizeof(len));
crypto/heimdal/appl/ftp/ftpd/security.c
175
b = block_read(fd, buf->data, len);
crypto/heimdal/appl/ftp/ftpd/security.c
214
sec_read(int fd, void *dataptr, int length)
crypto/heimdal/appl/ftp/ftpd/security.c
220
return read(fd, dataptr, length);
crypto/heimdal/appl/ftp/ftpd/security.c
235
ret = sec_get_data(fd, &in_buffer, data_prot);
crypto/heimdal/appl/ftp/ftpd/security.c
252
sec_send(int fd, char *from, int length)
crypto/heimdal/appl/ftp/ftpd/security.c
258
block_write(fd, &bytes, sizeof(bytes));
crypto/heimdal/appl/ftp/ftpd/security.c
259
block_write(fd, buf, ntohl(bytes));
crypto/heimdal/appl/ftp/ftpd/security.c
279
sec_write(int fd, char *dataptr, int length)
crypto/heimdal/appl/ftp/ftpd/security.c
285
return write(fd, dataptr, length);
crypto/heimdal/appl/ftp/ftpd/security.c
291
sec_send(fd, dataptr, len);
crypto/heimdal/appl/gssmask/gssmaestro.c
273
int fd, fd2, ret;
crypto/heimdal/appl/gssmask/gssmaestro.c
279
fd = socket(c->sa->sa_family, SOCK_STREAM, 0);
crypto/heimdal/appl/gssmask/gssmaestro.c
280
if (fd < 0)
crypto/heimdal/appl/gssmask/gssmaestro.c
284
ret = bind(fd, (struct sockaddr *)&sast, c->salen);
crypto/heimdal/appl/gssmask/gssmaestro.c
288
if (listen(fd, SOMAXCONN) < 0)
crypto/heimdal/appl/gssmask/gssmaestro.c
292
ret = getsockname(fd, (struct sockaddr *)&sast, &salen);
crypto/heimdal/appl/gssmask/gssmaestro.c
302
fd2 = accept(fd, (struct sockaddr *)&sast, &salen);
crypto/heimdal/appl/gssmask/gssmaestro.c
305
close(fd);
crypto/heimdal/appl/gssmask/gssmaestro.c
613
int ret, fd;
crypto/heimdal/appl/gssmask/gssmaestro.c
631
for (res = res0, fd = -1; res; res = res->ai_next) {
crypto/heimdal/appl/gssmask/gssmaestro.c
632
fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
crypto/heimdal/appl/gssmask/gssmaestro.c
633
if (fd < 0)
crypto/heimdal/appl/gssmask/gssmaestro.c
635
if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
crypto/heimdal/appl/gssmask/gssmaestro.c
636
close(fd);
crypto/heimdal/appl/gssmask/gssmaestro.c
637
fd = -1;
crypto/heimdal/appl/gssmask/gssmaestro.c
645
if (fd < 0)
crypto/heimdal/appl/gssmask/gssmaestro.c
649
c->sock = krb5_storage_from_fd(fd);
crypto/heimdal/appl/gssmask/gssmaestro.c
650
close(fd);
crypto/heimdal/appl/gssmask/gssmaestro.c
670
int fd;
crypto/heimdal/appl/gssmask/gssmaestro.c
674
fd = wait_log(c);
crypto/heimdal/appl/gssmask/gssmaestro.c
676
c->logsock = krb5_storage_from_fd(fd);
crypto/heimdal/appl/gssmask/gssmaestro.c
677
close(fd);
crypto/heimdal/appl/gssmask/gssmask.c
1088
create_client(int fd, int port, const char *moniker)
crypto/heimdal/appl/gssmask/gssmask.c
1104
getpeername(fd, (struct sockaddr *)&c->sa, &c->salen);
crypto/heimdal/appl/gssmask/gssmask.c
1111
c->sock = krb5_storage_from_fd(fd);
crypto/heimdal/appl/gssmask/gssmask.c
1115
close(fd);
crypto/heimdal/appl/gssmask/gssmask.c
686
int fd, ret;
crypto/heimdal/appl/gssmask/gssmask.c
695
fd = socket(((struct sockaddr *)&c->sa)->sa_family, SOCK_STREAM, 0);
crypto/heimdal/appl/gssmask/gssmask.c
696
if (fd < 0)
crypto/heimdal/appl/gssmask/gssmask.c
699
ret = connect(fd, (struct sockaddr *)&c->sa, c->salen);
crypto/heimdal/appl/gssmask/gssmask.c
703
close(fd);
crypto/heimdal/appl/gssmask/gssmask.c
709
c->logging = krb5_storage_from_fd(fd);
crypto/heimdal/appl/gssmask/gssmask.c
710
close(fd);
crypto/heimdal/appl/gssmask/gssmask.c
858
int fd;
crypto/heimdal/appl/gssmask/gssmask.c
863
fd = mkstemp(fn + 5);
crypto/heimdal/appl/gssmask/gssmask.c
864
if (fd < 0)
crypto/heimdal/appl/gssmask/gssmask.c
867
net_write(fd, pfxdata.data, pfxdata.length);
crypto/heimdal/appl/gssmask/gssmask.c
869
close(fd);
crypto/heimdal/appl/login/utmp_login.c
136
int fd;
crypto/heimdal/appl/login/utmp_login.c
151
if (ttyno > 0 && (fd = open(_PATH_UTMP, O_WRONLY, 0)) >= 0) {
crypto/heimdal/appl/login/utmp_login.c
152
lseek(fd, (long)(ttyno * sizeof(struct utmp)), SEEK_SET);
crypto/heimdal/appl/login/utmp_login.c
153
write(fd, &utmp, sizeof(struct utmp));
crypto/heimdal/appl/login/utmp_login.c
154
close(fd);
crypto/heimdal/appl/login/utmp_login.c
160
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
crypto/heimdal/appl/login/utmp_login.c
161
write(fd, &utmp, sizeof(struct utmp));
crypto/heimdal/appl/login/utmp_login.c
162
close(fd);
crypto/heimdal/appl/login/utmpx_login.c
56
int fd;
crypto/heimdal/appl/login/utmpx_login.c
59
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
crypto/heimdal/appl/login/utmpx_login.c
60
write(fd, &utmp, sizeof(struct utmp));
crypto/heimdal/appl/login/utmpx_login.c
61
close(fd);
crypto/heimdal/appl/push/push.c
151
int fd;
crypto/heimdal/appl/push/push.c
155
write_state_init (struct write_state *w, int fd)
crypto/heimdal/appl/push/push.c
165
w->fd = fd;
crypto/heimdal/appl/push/push.c
173
if(writev (w->fd, w->iovecs, w->niovecs) < 0)
crypto/heimdal/appl/push/push.c
191
if (writev (w->fd, w->iovecs, w->niovecs) < 0)
crypto/heimdal/appl/rcp/rcp.c
284
int fd, haderr, indx, result;
crypto/heimdal/appl/rcp/rcp.c
289
if ((fd = open(name, O_RDONLY, 0)) < 0)
crypto/heimdal/appl/rcp/rcp.c
291
if (fstat(fd, &stb)) {
crypto/heimdal/appl/rcp/rcp.c
327
if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) {
crypto/heimdal/appl/rcp/rcp.c
328
next: close(fd);
crypto/heimdal/appl/rcp/rcp.c
338
result = read(fd, bp->buf, (size_t)amt);
crypto/heimdal/appl/rcp/rcp.c
350
if (close(fd) && !haderr)
crypto/heimdal/appl/rcp/util.c
146
allocbuf(bp, fd, blksize)
crypto/heimdal/appl/rcp/util.c
148
int fd, blksize;
crypto/heimdal/appl/rcp/util.c
154
if (fstat(fd, &stb) < 0) {
crypto/heimdal/appl/rsh/common.c
127
return read (fd, buf, sz);
crypto/heimdal/appl/rsh/common.c
131
do_write (int fd, void *buf, size_t sz, void *ivec)
crypto/heimdal/appl/rsh/common.c
158
ret = krb5_net_write (context, &fd, len, 4);
crypto/heimdal/appl/rsh/common.c
161
ret = krb5_net_write (context, &fd, data.data, data.length);
crypto/heimdal/appl/rsh/common.c
170
return write (fd, buf, sz);
crypto/heimdal/appl/rsh/common.c
74
do_read (int fd, void *buf, size_t sz, void *ivec)
crypto/heimdal/appl/rsh/common.c
85
ret = krb5_net_read (context, &fd, &len, 4);
crypto/heimdal/appl/rsh/common.c
99
ret = krb5_net_read (context, &fd, edata, outer_len);
crypto/heimdal/appl/rsh/rshd.c
496
pipe_a_like (int fd[2])
crypto/heimdal/appl/rsh/rshd.c
498
if (socketpair (AF_UNIX, SOCK_STREAM, 0, fd) < 0)
crypto/heimdal/appl/rsh/rshd.c
788
int fd;
crypto/heimdal/appl/rsh/rshd.c
795
fd = mkstemp(tkfile+5);
crypto/heimdal/appl/rsh/rshd.c
796
close(fd);
crypto/heimdal/appl/telnet/telnet/externs.h
266
int NetClose(int fd);
crypto/heimdal/appl/telnet/telnet/externs.h
267
void NetNonblockingIO(int fd, int onoff);
crypto/heimdal/appl/telnet/telnet/externs.h
357
int SetSockOpt(int fd, int level, int option, int yesno);
crypto/heimdal/appl/telnet/telnet/sys_bsd.c
622
NetClose(int fd)
crypto/heimdal/appl/telnet/telnet/sys_bsd.c
624
return close(fd);
crypto/heimdal/appl/telnet/telnet/sys_bsd.c
629
NetNonblockingIO(int fd, int onoff)
crypto/heimdal/appl/telnet/telnet/sys_bsd.c
631
ioctl(fd, FIONBIO, (char *)&onoff);
crypto/heimdal/appl/telnet/telnet/telnet.c
639
telnet_setupterm(const char *tname, int fd, int *errp)
crypto/heimdal/appl/telnet/telnet/utilities.c
52
SetSockOpt(int fd, int level, int option, int yesno)
crypto/heimdal/appl/telnet/telnet/utilities.c
56
return setsockopt(fd, level, option,
crypto/heimdal/appl/telnet/telnet/utilities.c
64
return setsockopt(fd, level, option, 0, 0);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
1549
int fd; /* for /etc/wtmp */
crypto/heimdal/appl/telnet/telnetd/sys_term.c
1561
if ((fd = open(wtmpf, O_WRONLY | O_APPEND)) >= 0) {
crypto/heimdal/appl/telnet/telnetd/sys_term.c
1562
write(fd, utptr, sizeof(utmp));
crypto/heimdal/appl/telnet/telnetd/sys_term.c
1563
close(fd);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
356
static char *ptsname(int fd)
crypto/heimdal/appl/telnet/telnetd/sys_term.c
359
return ttyname(fd);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
751
static int my_find(int fd, char *module)
crypto/heimdal/appl/telnet/telnetd/sys_term.c
760
n = ioctl(fd, I_LIST, 0);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
767
n = ioctl(fd, I_LIST, &sl);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
782
static void maybe_push_modules(int fd, char **modules)
crypto/heimdal/appl/telnet/telnetd/sys_term.c
788
err = my_find(fd, *p);
crypto/heimdal/appl/telnet/telnetd/sys_term.c
799
err = ioctl(fd, I_PUSH, *p);
crypto/heimdal/appl/test/gss_common.c
60
enet_read(int fd, void *buf, size_t len)
crypto/heimdal/appl/test/gss_common.c
64
ret = net_read (fd, buf, len);
crypto/heimdal/kadmin/server.c
464
krb5_socket_t fd)
crypto/heimdal/kadmin/server.c
473
ret = krb5_read_priv_message(contextp, ac, &fd, &in);
crypto/heimdal/kadmin/server.c
483
ret = krb5_write_priv_message(contextp, ac, &fd, &out);
crypto/heimdal/kadmin/server.c
503
krb5_socket_t fd)
crypto/heimdal/kadmin/server.c
516
ret = krb5_recvauth_match_version(contextp, &ac, &fd,
crypto/heimdal/kadmin/server.c
538
ret = krb5_read_priv_message(contextp, ac, &fd, &params);
crypto/heimdal/kadmin/server.c
560
v5_loop (contextp, ac, initial, kadm_handlep, fd);
crypto/heimdal/kdc/hprop.c
285
int fd;
crypto/heimdal/kdc/hprop.c
301
fd = open_socket(context, host, port);
crypto/heimdal/kdc/hprop.c
302
if(fd < 0) {
crypto/heimdal/kdc/hprop.c
313
close(fd);
crypto/heimdal/kdc/hprop.c
327
&fd,
crypto/heimdal/kdc/hprop.c
344
close(fd);
crypto/heimdal/kdc/hprop.c
350
pd.sock = fd;
crypto/heimdal/kdc/hprop.c
360
ret = krb5_write_priv_message(context, auth_context, &fd, &data);
crypto/heimdal/kdc/hprop.c
367
ret = krb5_read_priv_message(context, auth_context, &fd, &data);
crypto/heimdal/kdc/hprop.c
377
close(fd);
crypto/heimdal/kdc/kdc-replay.c
111
fd = open(argv[1], O_RDONLY);
crypto/heimdal/kdc/kdc-replay.c
112
if (fd < 0)
crypto/heimdal/kdc/kdc-replay.c
115
sp = krb5_storage_from_fd(fd);
crypto/heimdal/kdc/kdc-replay.c
60
int fd, optidx = 0;
crypto/heimdal/kdc/pkinit.c
1497
int fd;
crypto/heimdal/kdc/pkinit.c
1504
fd = open(config->pkinit_kdc_ocsp_file, O_RDONLY);
crypto/heimdal/kdc/pkinit.c
1505
if (fd < 0) {
crypto/heimdal/kdc/pkinit.c
1510
ret = fstat(fd, &sb);
crypto/heimdal/kdc/pkinit.c
1513
close(fd);
crypto/heimdal/kdc/pkinit.c
1521
close(fd);
crypto/heimdal/kdc/pkinit.c
1527
ret = read(fd, ocsp.data.data, sb.st_size);
crypto/heimdal/kdc/pkinit.c
1528
close(fd);
crypto/heimdal/kdc/process.c
266
int fd, ret;
crypto/heimdal/kdc/process.c
276
fd = open(fn, O_WRONLY|O_CREAT|O_APPEND, 0600);
crypto/heimdal/kdc/process.c
277
if (fd < 0) {
crypto/heimdal/kdc/process.c
283
sp = krb5_storage_from_fd(fd);
crypto/heimdal/kdc/process.c
284
close(fd);
crypto/heimdal/lib/asn1/asn1_print.c
294
int fd = open (filename, O_RDONLY);
crypto/heimdal/lib/asn1/asn1_print.c
300
if(fd < 0)
crypto/heimdal/lib/asn1/asn1_print.c
302
if (fstat (fd, &sb) < 0)
crypto/heimdal/lib/asn1/asn1_print.c
306
if (read (fd, buf, len) != len)
crypto/heimdal/lib/asn1/asn1_print.c
308
close (fd);
crypto/heimdal/lib/asn1/check-common.c
105
flags, fd, 0);
crypto/heimdal/lib/asn1/check-common.c
180
int fd;
crypto/heimdal/lib/asn1/check-common.c
183
fd = open("/dev/stdout", O_WRONLY, 0600);
crypto/heimdal/lib/asn1/check-common.c
184
if (fd >= 0) {
crypto/heimdal/lib/asn1/check-common.c
185
write(fd, msg, sizeof(msg));
crypto/heimdal/lib/asn1/check-common.c
186
write(fd, current_test, strlen(current_test));
crypto/heimdal/lib/asn1/check-common.c
187
write(fd, " ", 1);
crypto/heimdal/lib/asn1/check-common.c
188
write(fd, current_state, strlen(current_state));
crypto/heimdal/lib/asn1/check-common.c
189
write(fd, "\n", 1);
crypto/heimdal/lib/asn1/check-common.c
190
close(fd);
crypto/heimdal/lib/asn1/check-common.c
84
int flags, ret, fd;
crypto/heimdal/lib/asn1/check-common.c
93
fd = -1;
crypto/heimdal/lib/asn1/check-common.c
96
fd = open ("/dev/zero", O_RDONLY);
crypto/heimdal/lib/asn1/check-common.c
97
if(fd < 0)
crypto/heimdal/lib/hdb/db.c
67
int fd = (*d->fd)(d);
crypto/heimdal/lib/hdb/db.c
68
if(fd < 0) {
crypto/heimdal/lib/hdb/db.c
73
return hdb_lock(fd, operation);
crypto/heimdal/lib/hdb/db.c
80
int fd = (*d->fd)(d);
crypto/heimdal/lib/hdb/db.c
81
if(fd < 0) {
crypto/heimdal/lib/hdb/db.c
86
return hdb_unlock(fd);
crypto/heimdal/lib/hdb/db3.c
77
int fd;
crypto/heimdal/lib/hdb/db3.c
78
if ((*d->fd)(d, &fd))
crypto/heimdal/lib/hdb/db3.c
80
return hdb_lock(fd, operation);
crypto/heimdal/lib/hdb/db3.c
87
int fd;
crypto/heimdal/lib/hdb/db3.c
88
if ((*d->fd)(d, &fd))
crypto/heimdal/lib/hdb/db3.c
90
return hdb_unlock(fd);
crypto/heimdal/lib/hdb/hdb-mitdb.c
553
int fd = (*d->fd)(d);
crypto/heimdal/lib/hdb/hdb-mitdb.c
554
if(fd < 0) {
crypto/heimdal/lib/hdb/hdb-mitdb.c
559
return hdb_lock(fd, operation);
crypto/heimdal/lib/hdb/hdb-mitdb.c
566
int fd = (*d->fd)(d);
crypto/heimdal/lib/hdb/hdb-mitdb.c
567
if(fd < 0) {
crypto/heimdal/lib/hdb/hdb-mitdb.c
572
return hdb_unlock(fd);
crypto/heimdal/lib/hdb/hdb.c
141
hdb_lock(int fd, int operation)
crypto/heimdal/lib/hdb/hdb.c
146
code = flock(fd, (operation == HDB_RLOCK ? LOCK_SH : LOCK_EX) | LOCK_NB);
crypto/heimdal/lib/hdb/hdb.c
159
hdb_unlock(int fd)
crypto/heimdal/lib/hdb/hdb.c
162
code = flock(fd, LOCK_UN);
crypto/heimdal/lib/hdb/mkey.c
154
int fd;
crypto/heimdal/lib/hdb/mkey.c
160
fd = open(filename, O_RDONLY | O_BINARY);
crypto/heimdal/lib/hdb/mkey.c
161
if(fd < 0) {
crypto/heimdal/lib/hdb/mkey.c
167
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/hdb/mkey.c
169
close(fd);
crypto/heimdal/lib/hdb/mkey.c
191
close(fd);
crypto/heimdal/lib/hdb/mkey.c
200
int fd;
crypto/heimdal/lib/hdb/mkey.c
207
fd = open(filename, O_RDONLY | O_BINARY);
crypto/heimdal/lib/hdb/mkey.c
208
if(fd < 0) {
crypto/heimdal/lib/hdb/mkey.c
215
len = read(fd, buf, sizeof(buf));
crypto/heimdal/lib/hdb/mkey.c
216
close(fd);
crypto/heimdal/lib/hdb/mkey.c
247
int fd;
crypto/heimdal/lib/hdb/mkey.c
253
fd = open(filename, O_RDONLY | O_BINARY);
crypto/heimdal/lib/hdb/mkey.c
254
if(fd < 0) {
crypto/heimdal/lib/hdb/mkey.c
261
len = read(fd, buf, sizeof(buf));
crypto/heimdal/lib/hdb/mkey.c
262
close(fd);
crypto/heimdal/lib/hdb/ndbm.c
136
open_lock_file(krb5_context context, const char *db_name, int *fd)
crypto/heimdal/lib/hdb/ndbm.c
147
*fd = open(lock_file, O_RDWR | O_CREAT, 0600);
crypto/heimdal/lib/hdb/ndbm.c
149
if(*fd < 0) {
crypto/heimdal/lib/ipc/client.c
317
int fd;
crypto/heimdal/lib/ipc/client.c
330
s->fd = socket(AF_UNIX, SOCK_STREAM, 0);
crypto/heimdal/lib/ipc/client.c
331
if (s->fd < 0)
crypto/heimdal/lib/ipc/client.c
333
rk_cloexec(s->fd);
crypto/heimdal/lib/ipc/client.c
335
if (connect(s->fd, (struct sockaddr *)&addr, sizeof(addr)) != 0)
crypto/heimdal/lib/ipc/client.c
351
s->fd = -1;
crypto/heimdal/lib/ipc/client.c
392
if (net_write(s->fd, &len, sizeof(len)) != sizeof(len))
crypto/heimdal/lib/ipc/client.c
394
if (net_write(s->fd, req->data, req->length) != (ssize_t)req->length)
crypto/heimdal/lib/ipc/client.c
397
if (net_read(s->fd, &len, sizeof(len)) != sizeof(len))
crypto/heimdal/lib/ipc/client.c
399
if (net_read(s->fd, &rv, sizeof(rv)) != sizeof(rv))
crypto/heimdal/lib/ipc/client.c
408
if (net_read(s->fd, rep->data, rep->length) != (ssize_t)rep->length)
crypto/heimdal/lib/ipc/client.c
420
if (s->fd >= 0)
crypto/heimdal/lib/ipc/client.c
421
close(s->fd);
crypto/heimdal/lib/ipc/client.c
457
ret = door_call(fd, &arg);
crypto/heimdal/lib/ipc/client.c
458
close(fd);
crypto/heimdal/lib/ipc/server.c
1044
heim_sipc_stream_listener(int fd, int type,
crypto/heimdal/lib/ipc/server.c
1056
c = add_new_socket(fd, LISTEN_SOCKET|WAITING_READ|INCLUDE_ERROR_CODE, callback, user);
crypto/heimdal/lib/ipc/server.c
1059
c = add_new_socket(fd, LISTEN_SOCKET|WAITING_READ, callback, user);
crypto/heimdal/lib/ipc/server.c
1063
c = add_new_socket(fd, LISTEN_SOCKET|WAITING_READ|ALLOW_HTTP, callback, user);
crypto/heimdal/lib/ipc/server.c
1087
int fd, ret;
crypto/heimdal/lib/ipc/server.c
1093
fd = socket(AF_UNIX, SOCK_STREAM, 0);
crypto/heimdal/lib/ipc/server.c
1094
if (fd < 0)
crypto/heimdal/lib/ipc/server.c
1097
socket_set_reuseaddr(fd, 1);
crypto/heimdal/lib/ipc/server.c
1101
setsockopt(fd, 0, LOCAL_CREDS, (void *)&one, sizeof(one));
crypto/heimdal/lib/ipc/server.c
1107
if (bind(fd, (struct sockaddr *)&un, sizeof(un)) < 0) {
crypto/heimdal/lib/ipc/server.c
1108
close(fd);
crypto/heimdal/lib/ipc/server.c
1112
if (listen(fd, SOMAXCONN) < 0) {
crypto/heimdal/lib/ipc/server.c
1113
close(fd);
crypto/heimdal/lib/ipc/server.c
1119
ret = heim_sipc_stream_listener(fd, HEIM_SIPC_TYPE_IPC,
crypto/heimdal/lib/ipc/server.c
449
int fd;
crypto/heimdal/lib/ipc/server.c
505
if (getpeerucred(c->fd, &peercred) != 0) {
crypto/heimdal/lib/ipc/server.c
520
if (getpeereid(c->fd, &uid, &gid) == 0) {
crypto/heimdal/lib/ipc/server.c
534
if (getsockopt(c->fd, SOL_SOCKET, SO_PEERCRED, (void *)&pc, &pclen) == 0) {
crypto/heimdal/lib/ipc/server.c
547
if (getsockopt(c->fd, LOCAL_PEERCRED, 1,
crypto/heimdal/lib/ipc/server.c
581
if (recvmsg(c->fd, &msg, 0) < 0) {
crypto/heimdal/lib/ipc/server.c
616
add_new_socket(int fd,
crypto/heimdal/lib/ipc/server.c
629
c->fd = fd;
crypto/heimdal/lib/ipc/server.c
631
c->fd = accept(fd, NULL, NULL);
crypto/heimdal/lib/ipc/server.c
632
if(c->fd < 0) {
crypto/heimdal/lib/ipc/server.c
642
fileflags = fcntl(c->fd, F_GETFL, 0);
crypto/heimdal/lib/ipc/server.c
643
fcntl(c->fd, F_SETFL, fileflags | O_NONBLOCK);
crypto/heimdal/lib/ipc/server.c
649
c->fd, 0, eventq);
crypto/heimdal/lib/ipc/server.c
651
c->fd, 0, eventq);
crypto/heimdal/lib/ipc/server.c
699
close(c->fd); /* ref count fd close */
crypto/heimdal/lib/ipc/server.c
873
add_new_socket(c->fd,
crypto/heimdal/lib/ipc/server.c
886
len = read(c->fd, c->inmsg + c->ptr, c->len - c->ptr);
crypto/heimdal/lib/ipc/server.c
958
len = write(c->fd, c->outmsg, c->olen);
crypto/heimdal/lib/ipc/server.c
992
fds[n].fd = clients[n]->fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
115
if(bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
117
if (listen(fd, SOMAXCONN) < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
119
return fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
125
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
129
fd = socket (AF_INET6, SOCK_STREAM, 0);
crypto/heimdal/lib/kadm5/ipropd_master.c
130
if (rk_IS_BAD_SOCKET(fd))
crypto/heimdal/lib/kadm5/ipropd_master.c
132
setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one));
crypto/heimdal/lib/kadm5/ipropd_master.c
153
if(bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
155
if (listen(fd, SOMAXCONN) < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
157
return fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
170
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
247
if (!rk_IS_BAD_SOCKET(s->fd)) {
crypto/heimdal/lib/kadm5/ipropd_master.c
248
rk_closesocket (s->fd);
crypto/heimdal/lib/kadm5/ipropd_master.c
249
s->fd = rk_INVALID_SOCKET;
crypto/heimdal/lib/kadm5/ipropd_master.c
260
if (!rk_IS_BAD_SOCKET(s->fd))
crypto/heimdal/lib/kadm5/ipropd_master.c
261
rk_closesocket (s->fd);
crypto/heimdal/lib/kadm5/ipropd_master.c
277
krb5_socket_t fd)
crypto/heimdal/lib/kadm5/ipropd_master.c
295
s->fd = accept (fd, (struct sockaddr *)&s->addr.sa, &addr_len);
crypto/heimdal/lib/kadm5/ipropd_master.c
296
if (rk_IS_BAD_SOCKET(s->fd)) {
crypto/heimdal/lib/kadm5/ipropd_master.c
312
ret = krb5_recvauth (context, &s->ac, &s->fd,
crypto/heimdal/lib/kadm5/ipropd_master.c
362
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
390
ret = krb5_write_priv_message (context, s->ac, &s->fd, &data);
crypto/heimdal/lib/kadm5/ipropd_master.c
421
ret = krb5_write_priv_message(context, s->ac, &s->fd, &data);
crypto/heimdal/lib/kadm5/ipropd_master.c
450
ret = krb5_write_priv_message(context, s->ac, &s->fd, &data);
crypto/heimdal/lib/kadm5/ipropd_master.c
489
ret = krb5_write_priv_message(context, s->ac, &s->fd, &data);
crypto/heimdal/lib/kadm5/ipropd_master.c
54
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
575
ret = krb5_write_priv_message(context, s->ac, &s->fd, &data);
crypto/heimdal/lib/kadm5/ipropd_master.c
58
fd = socket (AF_UNIX, SOCK_DGRAM, 0);
crypto/heimdal/lib/kadm5/ipropd_master.c
59
if (fd < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
599
ret = krb5_read_priv_message(context, s->ac, &s->fd, &out);
crypto/heimdal/lib/kadm5/ipropd_master.c
65
if (bind (fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
crypto/heimdal/lib/kadm5/ipropd_master.c
67
return fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
70
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
74
fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
crypto/heimdal/lib/kadm5/ipropd_master.c
75
if (rk_IS_BAD_SOCKET(fd))
crypto/heimdal/lib/kadm5/ipropd_master.c
78
if (rk_IS_SOCKET_ERROR( bind (fd, ai->ai_addr, ai->ai_addrlen) ))
crypto/heimdal/lib/kadm5/ipropd_master.c
80
return fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
87
krb5_socket_t fd;
crypto/heimdal/lib/kadm5/ipropd_master.c
91
fd = socket (AF_INET, SOCK_STREAM, 0);
crypto/heimdal/lib/kadm5/ipropd_master.c
92
if (rk_IS_BAD_SOCKET(fd))
crypto/heimdal/lib/kadm5/ipropd_master.c
929
FD_SET(p->fd, &readset);
crypto/heimdal/lib/kadm5/ipropd_master.c
930
max_fd = max(max_fd, p->fd);
crypto/heimdal/lib/kadm5/ipropd_master.c
94
setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one));
crypto/heimdal/lib/kadm5/ipropd_master.c
996
if (ret && FD_ISSET(p->fd, &readset)) {
crypto/heimdal/lib/kadm5/ipropd_slave.c
158
int fd, uint32_t version)
crypto/heimdal/lib/kadm5/ipropd_slave.c
172
ret = krb5_write_priv_message(context, auth_context, &fd, &data);
crypto/heimdal/lib/kadm5/ipropd_slave.c
318
send_im_here (krb5_context context, int fd,
crypto/heimdal/lib/kadm5/ipropd_slave.c
335
ret = krb5_write_priv_message(context, auth_context, &fd, &data);
crypto/heimdal/lib/kadm5/ipropd_slave.c
343
receive_everything (krb5_context context, int fd,
crypto/heimdal/lib/kadm5/ipropd_slave.c
377
ret = krb5_read_priv_message(context, auth_context, &fd, &data);
crypto/heimdal/lib/kadm5/log.c
100
fd = open (log_context->log_file, O_RDWR | O_CREAT, 0600);
crypto/heimdal/lib/kadm5/log.c
101
if (fd < 0) {
crypto/heimdal/lib/kadm5/log.c
107
if (flock (fd, LOCK_EX) < 0) {
crypto/heimdal/lib/kadm5/log.c
111
close (fd);
crypto/heimdal/lib/kadm5/log.c
115
ret = kadm5_log_get_version_fd (fd, &log_context->version);
crypto/heimdal/lib/kadm5/log.c
119
log_context->log_fd = fd;
crypto/heimdal/lib/kadm5/log.c
126
int fd;
crypto/heimdal/lib/kadm5/log.c
134
fd = open (log_context->log_file, O_RDWR | O_CREAT | O_TRUNC, 0600);
crypto/heimdal/lib/kadm5/log.c
135
if (fd < 0)
crypto/heimdal/lib/kadm5/log.c
137
if (flock (fd, LOCK_EX) < 0) {
crypto/heimdal/lib/kadm5/log.c
138
close (fd);
crypto/heimdal/lib/kadm5/log.c
143
log_context->log_fd = fd;
crypto/heimdal/lib/kadm5/log.c
152
int fd = log_context->log_fd;
crypto/heimdal/lib/kadm5/log.c
154
flock (fd, LOCK_UN);
crypto/heimdal/lib/kadm5/log.c
155
close(fd);
crypto/heimdal/lib/kadm5/log.c
53
kadm5_log_get_version_fd (int fd,
crypto/heimdal/lib/kadm5/log.c
60
ret = lseek (fd, 0, SEEK_END);
crypto/heimdal/lib/kadm5/log.c
67
sp = krb5_storage_from_fd (fd);
crypto/heimdal/lib/kadm5/log.c
72
lseek (fd, 0, SEEK_END);
crypto/heimdal/lib/kadm5/log.c
808
int fd = context->log_context.log_fd;
crypto/heimdal/lib/kadm5/log.c
811
lseek (fd, 0, SEEK_SET);
crypto/heimdal/lib/kadm5/log.c
812
sp = krb5_storage_from_fd (fd);
crypto/heimdal/lib/kadm5/log.c
838
kadm5_log_goto_end (int fd)
crypto/heimdal/lib/kadm5/log.c
842
sp = krb5_storage_from_fd (fd);
crypto/heimdal/lib/kadm5/log.c
94
int fd;
crypto/heimdal/lib/kadm5/private.h
67
int fd;
crypto/heimdal/lib/kafs/afssys.c
169
int fd, ret, saved_errno;
crypto/heimdal/lib/kafs/afssys.c
171
fd = open(path, O_RDWR);
crypto/heimdal/lib/kafs/afssys.c
172
if (fd < 0)
crypto/heimdal/lib/kafs/afssys.c
178
ret = ioctl(fd, ioctlnum, &data);
crypto/heimdal/lib/kafs/afssys.c
184
ret = ioctl(fd, ioctlnum, &data);
crypto/heimdal/lib/kafs/afssys.c
191
close(fd);
crypto/heimdal/lib/kafs/afssys.c
212
int fd, ret, saved_errno;
crypto/heimdal/lib/kafs/afssys.c
213
fd = open(afs_ioctlpath, O_RDWR);
crypto/heimdal/lib/kafs/afssys.c
214
if (fd < 0) {
crypto/heimdal/lib/kafs/afssys.c
218
ret = ioctl(fd, afs_ioctlnum, data);
crypto/heimdal/lib/kafs/afssys.c
220
close(fd);
crypto/heimdal/lib/krb5/auth_context.c
160
krb5_socket_t fd, int flags)
crypto/heimdal/lib/krb5/auth_context.c
173
if(rk_IS_SOCKET_ERROR(getsockname(fd, local, &len))) {
crypto/heimdal/lib/krb5/auth_context.c
191
if(rk_IS_SOCKET_ERROR(getpeername(fd, remote, &len))) {
crypto/heimdal/lib/krb5/auth_context.c
224
krb5_socket_t fd = *(krb5_socket_t *)p_fd;
crypto/heimdal/lib/krb5/auth_context.c
230
return krb5_auth_con_genaddrs(context, auth_context, fd, flags);
crypto/heimdal/lib/krb5/crypto-rand.c
48
int fd;
crypto/heimdal/lib/krb5/crypto-rand.c
49
fd = open(seedfile, O_RDONLY | O_BINARY | O_CLOEXEC);
crypto/heimdal/lib/krb5/crypto-rand.c
50
if (fd >= 0) {
crypto/heimdal/lib/krb5/crypto-rand.c
52
rk_cloexec(fd);
crypto/heimdal/lib/krb5/crypto-rand.c
53
ret = read(fd, buf, sizeof(buf));
crypto/heimdal/lib/krb5/crypto-rand.c
56
close(fd);
crypto/heimdal/lib/krb5/fcache.c
1026
int fd;
crypto/heimdal/lib/krb5/fcache.c
1027
if ((ret = init_fcc (context, to, &sp, &fd, NULL)) == 0) {
crypto/heimdal/lib/krb5/fcache.c
1030
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
1031
close(fd);
crypto/heimdal/lib/krb5/fcache.c
1053
int fd;
crypto/heimdal/lib/krb5/fcache.c
1055
ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
crypto/heimdal/lib/krb5/fcache.c
1058
ret = fstat(fd, &sb);
crypto/heimdal/lib/krb5/fcache.c
1059
close(fd);
crypto/heimdal/lib/krb5/fcache.c
1080
int fd;
crypto/heimdal/lib/krb5/fcache.c
1081
ret = init_fcc(context, id, &sp, &fd, kdc_offset);
crypto/heimdal/lib/krb5/fcache.c
1084
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
1085
close(fd);
crypto/heimdal/lib/krb5/fcache.c
116
_krb5_xunlock(krb5_context context, int fd)
crypto/heimdal/lib/krb5/fcache.c
125
ret = fcntl(fd, F_SETLKW, &l);
crypto/heimdal/lib/krb5/fcache.c
127
ret = flock(fd, LOCK_UN);
crypto/heimdal/lib/krb5/fcache.c
149
write_storage(krb5_context context, krb5_storage *sp, int fd)
crypto/heimdal/lib/krb5/fcache.c
160
sret = write(fd, data.data, data.length);
crypto/heimdal/lib/krb5/fcache.c
175
int fd, krb5_boolean exclusive)
crypto/heimdal/lib/krb5/fcache.c
177
return _krb5_xlock(context, fd, exclusive, fcc_get_name(context, id));
crypto/heimdal/lib/krb5/fcache.c
181
fcc_unlock(krb5_context context, int fd)
crypto/heimdal/lib/krb5/fcache.c
183
return _krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
214
scrub_file (int fd)
crypto/heimdal/lib/krb5/fcache.c
219
pos = lseek(fd, 0, SEEK_END);
crypto/heimdal/lib/krb5/fcache.c
222
if (lseek(fd, 0, SEEK_SET) < 0)
crypto/heimdal/lib/krb5/fcache.c
226
ssize_t tmp = write(fd, buf, min((off_t)sizeof(buf), pos));
crypto/heimdal/lib/krb5/fcache.c
233
_commit (fd);
crypto/heimdal/lib/krb5/fcache.c
235
fsync (fd);
crypto/heimdal/lib/krb5/fcache.c
250
int fd;
crypto/heimdal/lib/krb5/fcache.c
258
fd = open(filename, O_RDWR | O_BINARY);
crypto/heimdal/lib/krb5/fcache.c
259
if(fd < 0) {
crypto/heimdal/lib/krb5/fcache.c
265
rk_cloexec(fd);
crypto/heimdal/lib/krb5/fcache.c
266
ret = _krb5_xlock(context, fd, 1, filename);
crypto/heimdal/lib/krb5/fcache.c
268
close(fd);
crypto/heimdal/lib/krb5/fcache.c
272
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
273
close (fd);
crypto/heimdal/lib/krb5/fcache.c
276
ret = fstat (fd, &sb2);
crypto/heimdal/lib/krb5/fcache.c
278
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
279
close (fd);
crypto/heimdal/lib/krb5/fcache.c
286
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
287
close (fd);
crypto/heimdal/lib/krb5/fcache.c
294
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
295
close (fd);
crypto/heimdal/lib/krb5/fcache.c
299
ret = scrub_file (fd);
crypto/heimdal/lib/krb5/fcache.c
301
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
302
close(fd);
crypto/heimdal/lib/krb5/fcache.c
305
ret = _krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
306
close (fd);
crypto/heimdal/lib/krb5/fcache.c
316
int fd;
crypto/heimdal/lib/krb5/fcache.c
338
fd = mkstemp(exp_file);
crypto/heimdal/lib/krb5/fcache.c
339
if(fd < 0) {
crypto/heimdal/lib/krb5/fcache.c
346
close(fd);
crypto/heimdal/lib/krb5/fcache.c
390
int fd;
crypto/heimdal/lib/krb5/fcache.c
397
fd = open(filename, flags, mode);
crypto/heimdal/lib/krb5/fcache.c
398
if(fd < 0) {
crypto/heimdal/lib/krb5/fcache.c
406
rk_cloexec(fd);
crypto/heimdal/lib/krb5/fcache.c
408
if((ret = fcc_lock(context, id, fd, exclusive)) != 0) {
crypto/heimdal/lib/krb5/fcache.c
409
close(fd);
crypto/heimdal/lib/krb5/fcache.c
412
*fd_ret = fd;
crypto/heimdal/lib/krb5/fcache.c
423
int fd;
crypto/heimdal/lib/krb5/fcache.c
430
ret = fcc_open(context, id, &fd, O_RDWR | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
crypto/heimdal/lib/krb5/fcache.c
44
int fd;
crypto/heimdal/lib/krb5/fcache.c
458
ret |= write_storage(context, sp, fd);
crypto/heimdal/lib/krb5/fcache.c
462
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
463
if (close(fd) < 0)
crypto/heimdal/lib/krb5/fcache.c
503
int fd;
crypto/heimdal/lib/krb5/fcache.c
505
ret = fcc_open(context, id, &fd, O_WRONLY | O_APPEND | O_BINARY | O_CLOEXEC, 0);
crypto/heimdal/lib/krb5/fcache.c
521
ret = write_storage(context, sp, fd);
crypto/heimdal/lib/krb5/fcache.c
524
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
525
if (close(fd) < 0) {
crypto/heimdal/lib/krb5/fcache.c
544
int fd;
crypto/heimdal/lib/krb5/fcache.c
552
ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
crypto/heimdal/lib/krb5/fcache.c
556
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/fcache.c
676
*ret_fd = fd;
crypto/heimdal/lib/krb5/fcache.c
682
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
683
close(fd);
crypto/heimdal/lib/krb5/fcache.c
693
int fd;
crypto/heimdal/lib/krb5/fcache.c
696
ret = init_fcc (context, id, &sp, &fd, NULL);
crypto/heimdal/lib/krb5/fcache.c
703
fcc_unlock(context, fd);
crypto/heimdal/lib/krb5/fcache.c
704
close(fd);
crypto/heimdal/lib/krb5/fcache.c
72
_krb5_xlock(krb5_context context, int fd, krb5_boolean exclusive,
crypto/heimdal/lib/krb5/fcache.c
732
&FCC_CURSOR(*cursor)->fd, NULL);
crypto/heimdal/lib/krb5/fcache.c
745
fcc_unlock(context, FCC_CURSOR(*cursor)->fd);
crypto/heimdal/lib/krb5/fcache.c
763
if((ret = fcc_lock(context, id, FCC_CURSOR(*cursor)->fd, FALSE)) != 0)
crypto/heimdal/lib/krb5/fcache.c
770
fcc_unlock(context, FCC_CURSOR(*cursor)->fd);
crypto/heimdal/lib/krb5/fcache.c
787
close (FCC_CURSOR(*cursor)->fd);
crypto/heimdal/lib/krb5/fcache.c
802
int fd;
crypto/heimdal/lib/krb5/fcache.c
829
fd = mkstemp(&newname[5]);
crypto/heimdal/lib/krb5/fcache.c
83
ret = fcntl(fd, F_SETLKW, &l);
crypto/heimdal/lib/krb5/fcache.c
830
if (fd < 0) {
crypto/heimdal/lib/krb5/fcache.c
835
close(fd);
crypto/heimdal/lib/krb5/fcache.c
85
ret = flock(fd, exclusive ? LOCK_EX : LOCK_SH);
crypto/heimdal/lib/krb5/keytab_file.c
382
c->fd = open (d->filename, flags);
crypto/heimdal/lib/krb5/keytab_file.c
383
if (c->fd < 0) {
crypto/heimdal/lib/krb5/keytab_file.c
390
rk_cloexec(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
391
ret = _krb5_xlock(context, c->fd, exclusive, d->filename);
crypto/heimdal/lib/krb5/keytab_file.c
393
close(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
396
c->sp = krb5_storage_from_fd(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
398
_krb5_xunlock(context, c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
399
close(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
408
_krb5_xunlock(context, c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
409
close(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
415
_krb5_xunlock(context, c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
416
close(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
423
_krb5_xunlock(context, c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
424
close(c->fd);
crypto/heimdal/lib/krb5/keytab_file.c
521
_krb5_xunlock(context, cursor->fd);
crypto/heimdal/lib/krb5/keytab_file.c
522
close(cursor->fd);
crypto/heimdal/lib/krb5/keytab_file.c
546
int fd;
crypto/heimdal/lib/krb5/keytab_file.c
552
fd = open (d->filename, O_RDWR | O_BINARY | O_CLOEXEC);
crypto/heimdal/lib/krb5/keytab_file.c
553
if (fd < 0) {
crypto/heimdal/lib/krb5/keytab_file.c
554
fd = open (d->filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
crypto/heimdal/lib/krb5/keytab_file.c
555
if (fd < 0) {
crypto/heimdal/lib/krb5/keytab_file.c
562
rk_cloexec(fd);
crypto/heimdal/lib/krb5/keytab_file.c
564
ret = _krb5_xlock(context, fd, 1, d->filename);
crypto/heimdal/lib/krb5/keytab_file.c
566
close(fd);
crypto/heimdal/lib/krb5/keytab_file.c
569
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/keytab_file.c
579
rk_cloexec(fd);
crypto/heimdal/lib/krb5/keytab_file.c
581
ret = _krb5_xlock(context, fd, 1, d->filename);
crypto/heimdal/lib/krb5/keytab_file.c
583
close(fd);
crypto/heimdal/lib/krb5/keytab_file.c
586
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/keytab_file.c
721
_krb5_xunlock(context, fd);
crypto/heimdal/lib/krb5/keytab_file.c
722
close(fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
206
c->fd = open (d->filename, O_RDONLY | O_BINARY | O_CLOEXEC, 0600);
crypto/heimdal/lib/krb5/keytab_keyfile.c
207
if (c->fd < 0) {
crypto/heimdal/lib/krb5/keytab_keyfile.c
216
c->sp = krb5_storage_from_fd(c->fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
218
close(c->fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
227
close(c->fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
305
close(cursor->fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
316
int fd, created = 0;
crypto/heimdal/lib/krb5/keytab_keyfile.c
333
fd = open (d->filename, O_RDWR | O_BINARY | O_CLOEXEC);
crypto/heimdal/lib/krb5/keytab_keyfile.c
334
if (fd < 0) {
crypto/heimdal/lib/krb5/keytab_keyfile.c
335
fd = open (d->filename,
crypto/heimdal/lib/krb5/keytab_keyfile.c
337
if (fd < 0) {
crypto/heimdal/lib/krb5/keytab_keyfile.c
348
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
350
close(fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
361
close(fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
371
close(fd);
crypto/heimdal/lib/krb5/keytab_keyfile.c
450
close (fd);
crypto/heimdal/lib/krb5/keytab_memory.c
146
c->fd = 0;
crypto/heimdal/lib/krb5/keytab_memory.c
157
if(c->fd >= d->num_entries)
crypto/heimdal/lib/krb5/keytab_memory.c
159
return krb5_kt_copy_entry_contents(context, &d->entries[c->fd++], entry);
crypto/heimdal/lib/krb5/krb5.h
559
int fd;
crypto/heimdal/lib/krb5/kuserok.c
138
int fd;
crypto/heimdal/lib/krb5/kuserok.c
141
fd = dirfd(d);
crypto/heimdal/lib/krb5/kuserok.c
142
if(fstat(fd, &st2) < 0) {
crypto/heimdal/lib/krb5/log.c
214
FILE *fd;
crypto/heimdal/lib/krb5/log.c
227
f->fd = fopen(f->filename, f->mode);
crypto/heimdal/lib/krb5/log.c
228
if(f->fd == NULL)
crypto/heimdal/lib/krb5/log.c
235
fprintf(f->fd, "%s %s\n", timestr, msgclean);
crypto/heimdal/lib/krb5/log.c
239
fclose(f->fd);
crypto/heimdal/lib/krb5/log.c
240
f->fd = NULL;
crypto/heimdal/lib/krb5/log.c
249
fclose(f->fd);
crypto/heimdal/lib/krb5/log.c
257
struct file_data *fd = malloc(sizeof(*fd));
crypto/heimdal/lib/krb5/log.c
258
if(fd == NULL) {
crypto/heimdal/lib/krb5/log.c
263
fd->filename = filename;
crypto/heimdal/lib/krb5/log.c
264
fd->mode = mode;
crypto/heimdal/lib/krb5/log.c
265
fd->fd = f;
crypto/heimdal/lib/krb5/log.c
266
fd->keep_open = keep_open;
crypto/heimdal/lib/krb5/log.c
268
return krb5_addlog_func(context, fac, min, max, log_file, close_file, fd);
crypto/heimdal/lib/krb5/net_read.c
42
krb5_socket_t fd = *((krb5_socket_t *)p_fd);
crypto/heimdal/lib/krb5/net_read.c
43
return net_read(fd, buf, len);
crypto/heimdal/lib/krb5/net_write.c
101
count = write (fd, cbuf, rem);
crypto/heimdal/lib/krb5/net_write.c
42
krb5_socket_t fd = *((krb5_socket_t *)p_fd);
crypto/heimdal/lib/krb5/net_write.c
43
return net_write(fd, buf, len);
crypto/heimdal/lib/krb5/net_write.c
53
krb5_socket_t fd = *((krb5_socket_t *)p_fd);
crypto/heimdal/lib/krb5/net_write.c
63
FD_SET(fd, &wfds);
crypto/heimdal/lib/krb5/net_write.c
72
ret = select(fd + 1, NULL, &wfds, NULL, tvp);
crypto/heimdal/lib/krb5/net_write.c
85
count = send (fd, cbuf, rem, 0);
crypto/heimdal/lib/krb5/net_write.c
96
if (!FD_ISSET(fd, &wfds)) {
crypto/heimdal/lib/krb5/send_to_kdc.c
116
send_and_recv_udp(krb5_socket_t fd,
crypto/heimdal/lib/krb5/send_to_kdc.c
121
if (send (fd, req->data, req->length, 0) < 0)
crypto/heimdal/lib/krb5/send_to_kdc.c
124
return recv_loop(fd, tmout, 1, 0, rep);
crypto/heimdal/lib/krb5/send_to_kdc.c
135
send_and_recv_tcp(krb5_socket_t fd,
crypto/heimdal/lib/krb5/send_to_kdc.c
145
if(net_write (fd, len, sizeof(len)) < 0)
crypto/heimdal/lib/krb5/send_to_kdc.c
147
if(net_write (fd, req->data, req->length) < 0)
crypto/heimdal/lib/krb5/send_to_kdc.c
149
if (recv_loop (fd, tmout, 0, 4, &len_data) < 0)
crypto/heimdal/lib/krb5/send_to_kdc.c
157
if (recv_loop (fd, tmout, 0, rep_len, rep) < 0)
crypto/heimdal/lib/krb5/send_to_kdc.c
167
_krb5_send_and_recv_tcp(krb5_socket_t fd,
crypto/heimdal/lib/krb5/send_to_kdc.c
172
return send_and_recv_tcp(fd, tmout, req, rep);
crypto/heimdal/lib/krb5/send_to_kdc.c
180
send_and_recv_http(krb5_socket_t fd,
crypto/heimdal/lib/krb5/send_to_kdc.c
197
ret = net_write (fd, request, strlen(request));
crypto/heimdal/lib/krb5/send_to_kdc.c
201
ret = recv_loop(fd, tmout, 0, 0, rep);
crypto/heimdal/lib/krb5/send_to_kdc.c
373
krb5_socket_t fd;
crypto/heimdal/lib/krb5/send_to_kdc.c
418
fd = socket (a->ai_family, a->ai_socktype | SOCK_CLOEXEC, a->ai_protocol);
crypto/heimdal/lib/krb5/send_to_kdc.c
419
if (rk_IS_BAD_SOCKET(fd))
crypto/heimdal/lib/krb5/send_to_kdc.c
421
rk_cloexec(fd);
crypto/heimdal/lib/krb5/send_to_kdc.c
422
if (connect (fd, a->ai_addr, a->ai_addrlen) < 0) {
crypto/heimdal/lib/krb5/send_to_kdc.c
423
rk_closesocket (fd);
crypto/heimdal/lib/krb5/send_to_kdc.c
428
ret = send_and_recv_http(fd, context->kdc_timeout,
crypto/heimdal/lib/krb5/send_to_kdc.c
432
ret = send_and_recv_tcp (fd, context->kdc_timeout,
crypto/heimdal/lib/krb5/send_to_kdc.c
436
ret = send_and_recv_udp (fd, context->kdc_timeout,
crypto/heimdal/lib/krb5/send_to_kdc.c
440
rk_closesocket (fd);
crypto/heimdal/lib/krb5/send_to_kdc.c
50
recv_loop (krb5_socket_t fd,
crypto/heimdal/lib/krb5/send_to_kdc.c
62
if (fd >= FD_SETSIZE) {
crypto/heimdal/lib/krb5/send_to_kdc.c
70
FD_SET(fd, &fdset);
crypto/heimdal/lib/krb5/send_to_kdc.c
73
ret = select (fd + 1, &fdset, NULL, NULL, &timeout);
crypto/heimdal/lib/krb5/send_to_kdc.c
83
if (rk_SOCK_IOCTL (fd, FIONREAD, &nbytes) < 0) {
crypto/heimdal/lib/krb5/send_to_kdc.c
99
ret = recv (fd, (char*)tmp + rep->length, nbytes, 0);
crypto/heimdal/lib/krb5/store_fd.c
105
fd = dup(fd_in);
crypto/heimdal/lib/krb5/store_fd.c
108
if (fd < 0)
crypto/heimdal/lib/krb5/store_fd.c
113
close(fd);
crypto/heimdal/lib/krb5/store_fd.c
119
close(fd);
crypto/heimdal/lib/krb5/store_fd.c
125
FD(sp) = fd;
crypto/heimdal/lib/krb5/store_fd.c
38
int fd;
crypto/heimdal/lib/krb5/store_fd.c
41
#define FD(S) (((fd_storage*)(S)->data)->fd)
crypto/heimdal/lib/krb5/store_fd.c
92
int fd;
crypto/heimdal/lib/krb5/store_fd.c
97
fd = dup(fd_in);
crypto/heimdal/lib/krb5/store_fd.c
99
fd = _open_osfhandle(fd_in, 0);
crypto/heimdal/lib/krb5/test_store.c
200
test_truncate(krb5_context context, krb5_storage *sp, int fd)
crypto/heimdal/lib/krb5/test_store.c
207
if (fstat(fd, &sb) != 0)
crypto/heimdal/lib/krb5/test_store.c
214
if (fstat(fd, &sb) != 0)
crypto/heimdal/lib/krb5/test_store.c
267
int fd, optidx = 0;
crypto/heimdal/lib/krb5/test_store.c
304
fd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0600);
crypto/heimdal/lib/krb5/test_store.c
305
if (fd < 0)
crypto/heimdal/lib/krb5/test_store.c
308
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/test_store.c
309
close(fd);
crypto/heimdal/lib/krb5/test_store.c
321
fd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0600);
crypto/heimdal/lib/krb5/test_store.c
322
if (fd < 0)
crypto/heimdal/lib/krb5/test_store.c
325
sp = krb5_storage_from_fd(fd);
crypto/heimdal/lib/krb5/test_store.c
329
test_truncate(context, sp, fd);
crypto/heimdal/lib/krb5/test_store.c
331
close(fd);
crypto/heimdal/lib/roken/cloexec.c
39
rk_cloexec(int fd)
crypto/heimdal/lib/roken/cloexec.c
44
ret = fcntl(fd, F_GETFD);
crypto/heimdal/lib/roken/cloexec.c
47
if (fcntl(fd, F_SETFD, ret | FD_CLOEXEC) == -1)
crypto/heimdal/lib/roken/closefrom.c
46
closefrom(int fd)
crypto/heimdal/lib/roken/closefrom.c
53
for (; fd <= num; fd++)
crypto/heimdal/lib/roken/closefrom.c
54
close(fd);
crypto/heimdal/lib/roken/daemon.c
53
int fd;
crypto/heimdal/lib/roken/daemon.c
70
if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
crypto/heimdal/lib/roken/daemon.c
71
dup2(fd, STDIN_FILENO);
crypto/heimdal/lib/roken/daemon.c
72
dup2(fd, STDOUT_FILENO);
crypto/heimdal/lib/roken/daemon.c
73
dup2(fd, STDERR_FILENO);
crypto/heimdal/lib/roken/daemon.c
74
if (fd > 2)
crypto/heimdal/lib/roken/daemon.c
75
close (fd);
crypto/heimdal/lib/roken/dumpdata.c
45
int fd;
crypto/heimdal/lib/roken/dumpdata.c
47
fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0640);
crypto/heimdal/lib/roken/dumpdata.c
48
if (fd < 0)
crypto/heimdal/lib/roken/dumpdata.c
50
net_write(fd, buf, size);
crypto/heimdal/lib/roken/dumpdata.c
51
close(fd);
crypto/heimdal/lib/roken/dumpdata.c
62
int fd, ret;
crypto/heimdal/lib/roken/dumpdata.c
67
fd = open(filename, O_RDONLY, 0);
crypto/heimdal/lib/roken/dumpdata.c
68
if (fd < 0)
crypto/heimdal/lib/roken/dumpdata.c
70
if (fstat(fd, &sb) != 0){
crypto/heimdal/lib/roken/dumpdata.c
81
sret = net_read(fd, *buf, *size);
crypto/heimdal/lib/roken/dumpdata.c
92
close(fd);
crypto/heimdal/lib/roken/eread.c
43
eread (int fd, void *buf, size_t nbytes)
crypto/heimdal/lib/roken/eread.c
47
ret = net_read (fd, buf, nbytes);
crypto/heimdal/lib/roken/ewrite.c
43
ewrite (int fd, const void *buf, size_t nbytes)
crypto/heimdal/lib/roken/ewrite.c
47
ret = net_write (fd, buf, nbytes);
crypto/heimdal/lib/roken/fchown.c
39
fchown(int fd, uid_t owner, gid_t group)
crypto/heimdal/lib/roken/flock.c
44
rk_flock(int fd, int operation)
crypto/heimdal/lib/roken/flock.c
62
code = fcntl(fd, F_SETLK, &arg);
crypto/heimdal/lib/roken/flock.c
66
code = fcntl(fd, cmd, &arg);
crypto/heimdal/lib/roken/flock.c
70
code = fcntl(fd, cmd, &arg);
crypto/heimdal/lib/roken/flock.c
92
hFile = (HANDLE) _get_osfhandle(fd);
crypto/heimdal/lib/roken/get_window_size.c
107
fh = _get_osfhandle(fd);
crypto/heimdal/lib/roken/get_window_size.c
61
get_window_size(int fd, int *lines, int *columns)
crypto/heimdal/lib/roken/get_window_size.c
69
ret = ioctl(fd, TIOCGWINSZ, &ws);
crypto/heimdal/lib/roken/get_window_size.c
82
ret = ioctl(fd, TIOCGSIZE, &ts);
crypto/heimdal/lib/roken/getcap.c
234
getent(char **cap, size_t *len, char **db_array, int fd,
crypto/heimdal/lib/roken/getcap.c
284
if (fd >= 0) {
crypto/heimdal/lib/roken/getcap.c
285
(void)lseek(fd, (off_t)0, SEEK_SET);
crypto/heimdal/lib/roken/getcap.c
320
fd = open(*db_p, O_RDONLY, 0);
crypto/heimdal/lib/roken/getcap.c
321
if (fd < 0) {
crypto/heimdal/lib/roken/getcap.c
360
n = read(fd, buf, sizeof(buf));
crypto/heimdal/lib/roken/getcap.c
363
(void)close(fd);
crypto/heimdal/lib/roken/getcap.c
368
fd = -1;
crypto/heimdal/lib/roken/getcap.c
427
(void)close(fd);
crypto/heimdal/lib/roken/getcap.c
511
iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
crypto/heimdal/lib/roken/getcap.c
519
(void)close(fd);
crypto/heimdal/lib/roken/getcap.c
569
(void)close(fd);
crypto/heimdal/lib/roken/getcap.c
601
(void)close(fd);
crypto/heimdal/lib/roken/getifaddrs.c
1004
close(fd);
crypto/heimdal/lib/roken/getifaddrs.c
1017
int fd;
crypto/heimdal/lib/roken/getifaddrs.c
1030
fd = socket(af, SOCK_DGRAM, 0);
crypto/heimdal/lib/roken/getifaddrs.c
1031
if (fd < 0)
crypto/heimdal/lib/roken/getifaddrs.c
1051
if (ioctl (fd, siocgifconf, &ifconf) < 0 && errno != EINVAL) {
crypto/heimdal/lib/roken/getifaddrs.c
1089
if (ioctl(fd, siocgifflags, &ifreq) < 0) {
crypto/heimdal/lib/roken/getifaddrs.c
1145
close(fd);
crypto/heimdal/lib/roken/getifaddrs.c
1150
close(fd);
crypto/heimdal/lib/roken/getifaddrs.c
133
#define __close(fd) (close(fd))
crypto/heimdal/lib/roken/getifaddrs.c
405
pfd.fd = sd;
crypto/heimdal/lib/roken/getifaddrs.c
875
int fd;
crypto/heimdal/lib/roken/getifaddrs.c
888
fd = socket(af, SOCK_DGRAM, 0);
crypto/heimdal/lib/roken/getifaddrs.c
889
if (fd < 0)
crypto/heimdal/lib/roken/getifaddrs.c
905
if (ioctl (fd, siocgifconf, &ifconf) < 0 && errno != EINVAL) {
crypto/heimdal/lib/roken/getifaddrs.c
943
if (ioctl(fd, siocgifflags, &ifreq) < 0) {
crypto/heimdal/lib/roken/getifaddrs.c
999
close(fd);
crypto/heimdal/lib/roken/mini_inetd.c
57
int fd = socket_to_fd(as, 0);
crypto/heimdal/lib/roken/mini_inetd.c
63
dup2(fd, STDIN_FILENO);
crypto/heimdal/lib/roken/mini_inetd.c
64
dup2(fd, STDOUT_FILENO);
crypto/heimdal/lib/roken/mkstemp.c
63
int fd;
crypto/heimdal/lib/roken/mkstemp.c
64
fd = open(template, O_RDWR | O_CREAT | O_EXCL, 0600);
crypto/heimdal/lib/roken/mkstemp.c
65
if(fd >= 0 || errno != EEXIST)
crypto/heimdal/lib/roken/mkstemp.c
66
return fd;
crypto/heimdal/lib/roken/net_read.c
45
net_read (rk_socket_t fd, void *buf, size_t nbytes)
crypto/heimdal/lib/roken/net_read.c
52
count = read (fd, cbuf, rem);
crypto/heimdal/lib/roken/net_write.c
45
net_write (rk_socket_t fd, const void *buf, size_t nbytes)
crypto/heimdal/lib/roken/net_write.c
52
count = write (fd, cbuf, rem);
crypto/heimdal/lib/roken/parse_reply-test.c
100
fd = -1;
crypto/heimdal/lib/roken/parse_reply-test.c
103
fd = open ("/dev/zero", O_RDONLY);
crypto/heimdal/lib/roken/parse_reply-test.c
104
if(fd < 0)
crypto/heimdal/lib/roken/parse_reply-test.c
110
flags, fd, 0);
crypto/heimdal/lib/roken/parse_reply-test.c
94
int fd;
crypto/heimdal/lib/roken/roken-common.h
348
eread (int fd, void *buf, size_t nbytes);
crypto/heimdal/lib/roken/roken-common.h
352
ewrite (int fd, const void *buf, size_t nbytes);
crypto/heimdal/lib/roken/socket_wrapper.c
1202
fd = swrap_get_pcap_fd(file_name);
crypto/heimdal/lib/roken/socket_wrapper.c
1203
if (fd != -1) {
crypto/heimdal/lib/roken/socket_wrapper.c
1204
write(fd, packet, packet_len);
crypto/heimdal/lib/roken/socket_wrapper.c
1213
int fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1252
fd = real_socket(AF_UNIX, type, 0);
crypto/heimdal/lib/roken/socket_wrapper.c
1254
if (fd == -1) return -1;
crypto/heimdal/lib/roken/socket_wrapper.c
1261
si->fd = fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1265
return si->fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1271
int fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1309
fd = ret;
crypto/heimdal/lib/roken/socket_wrapper.c
1316
close(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1323
child_si->fd = fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1340
ret = real_getsockname(fd, (struct sockaddr *)&un_my_addr, &un_my_addrlen);
crypto/heimdal/lib/roken/socket_wrapper.c
1343
close(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1353
close(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1367
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1460
ret = real_bind(si->fd, (struct sockaddr *)&un_addr, sizeof(un_addr));
crypto/heimdal/lib/roken/socket_wrapper.c
1804
_PUBLIC_ int swrap_close(int fd)
crypto/heimdal/lib/roken/socket_wrapper.c
1806
struct socket_info *si = find_socket_info(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1810
return real_close(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1819
ret = real_close(fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1839
dup_internal(const struct socket_info *si_oldd, int fd)
crypto/heimdal/lib/roken/socket_wrapper.c
1845
si_newd->fd = fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1867
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1874
int fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1880
fd = real_dup(si->fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1881
if (fd < 0)
crypto/heimdal/lib/roken/socket_wrapper.c
1882
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1884
return dup_internal(si, fd);
crypto/heimdal/lib/roken/socket_wrapper.c
1891
int fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1902
fd = real_dup2(si_oldd->fd, newd);
crypto/heimdal/lib/roken/socket_wrapper.c
1903
if (fd < 0)
crypto/heimdal/lib/roken/socket_wrapper.c
1904
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
1910
return dup_internal(si_oldd, fd);
crypto/heimdal/lib/roken/socket_wrapper.c
214
int fd;
crypto/heimdal/lib/roken/socket_wrapper.c
546
static struct socket_info *find_socket_info(int fd)
crypto/heimdal/lib/roken/socket_wrapper.c
550
if (i->fd == fd)
crypto/heimdal/lib/roken/socket_wrapper.c
906
static int fd = -1;
crypto/heimdal/lib/roken/socket_wrapper.c
908
if (fd != -1) return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
910
fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0644);
crypto/heimdal/lib/roken/socket_wrapper.c
911
if (fd != -1) {
crypto/heimdal/lib/roken/socket_wrapper.c
921
write(fd, &file_hdr, sizeof(file_hdr));
crypto/heimdal/lib/roken/socket_wrapper.c
922
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
925
fd = open(fname, O_WRONLY|O_APPEND, 0644);
crypto/heimdal/lib/roken/socket_wrapper.c
927
return fd;
crypto/heimdal/lib/roken/socket_wrapper.c
944
int fd;
crypto/heimdal/lib/roken/test-mem.c
113
int flags, ret, fd;
crypto/heimdal/lib/roken/test-mem.c
122
fd = -1;
crypto/heimdal/lib/roken/test-mem.c
125
fd = open ("/dev/zero", O_RDONLY);
crypto/heimdal/lib/roken/test-mem.c
126
if(fd < 0)
crypto/heimdal/lib/roken/test-mem.c
129
map.fd = fd;
crypto/heimdal/lib/roken/test-mem.c
135
flags, fd, 0);
crypto/heimdal/lib/roken/test-mem.c
201
if (map.fd > 0)
crypto/heimdal/lib/roken/test-mem.c
202
close(map.fd);
crypto/heimdal/lib/roken/test-mem.c
54
int fd;
crypto/heimdal/lib/roken/test-mem.c
72
int fd;
crypto/heimdal/lib/roken/test-mem.c
75
fd = open("/dev/stdout", O_WRONLY, 0600);
crypto/heimdal/lib/roken/test-mem.c
76
if (fd >= 0) {
crypto/heimdal/lib/roken/test-mem.c
77
(void)write(fd, msg, sizeof(msg) - 1);
crypto/heimdal/lib/roken/test-mem.c
78
(void)write(fd, testname, strlen(testname));
crypto/heimdal/lib/roken/test-mem.c
79
(void)write(fd, "\n", 1);
crypto/heimdal/lib/roken/test-mem.c
80
close(fd);
crypto/heimdal/lib/roken/test-readenv.c
51
int fd;
crypto/heimdal/lib/roken/test-readenv.c
53
fd = mkstemp(tmpl);
crypto/heimdal/lib/roken/test-readenv.c
54
if(fd < 0)
crypto/heimdal/lib/roken/test-readenv.c
56
close(fd);
crypto/krb5/src/appl/gss-sample/gss-client.c
332
int fd, count;
crypto/krb5/src/appl/gss-sample/gss-client.c
335
if ((fd = open(file_name, O_RDONLY, 0)) < 0) {
crypto/krb5/src/appl/gss-sample/gss-client.c
340
if (fstat(fd, &stat_buf) < 0) {
crypto/krb5/src/appl/gss-sample/gss-client.c
360
count = read(fd, in_buf->value, in_buf->length);
crypto/krb5/src/appl/sample/sclient/sclient.c
63
net_read(int fd, char *buf, int len)
crypto/krb5/src/appl/sample/sclient/sclient.c
68
cc = SOCKET_READ((SOCKET)fd, buf, len);
crypto/krb5/src/include/k5-tls.h
60
(*k5_tls_setup_fn)(krb5_context context, SOCKET fd, const char *servername,
crypto/krb5/src/include/port-sockets.h
225
socket_connect(int fd, const struct sockaddr *addr, socklen_t addrlen)
crypto/krb5/src/include/port-sockets.h
232
st = connect(fd, addr, addrlen);
crypto/krb5/src/include/port-sockets.h
237
st = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof(set));
crypto/krb5/src/include/port-sockets.h
250
socket_sendmsg(SOCKET fd, sg_buf *iov, int iovcnt)
crypto/krb5/src/include/port-sockets.h
263
return sendmsg(fd, &msg, flags);
crypto/krb5/src/include/port-sockets.h
29
#define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0))
crypto/krb5/src/include/port-sockets.h
30
#define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0))
crypto/krb5/src/kadmin/dbutil/dump.c
135
int fd = -1;
crypto/krb5/src/kadmin/dbutil/dump.c
142
fd = mkstemp(*tmpname);
crypto/krb5/src/kadmin/dbutil/dump.c
143
if (fd == -1)
crypto/krb5/src/kadmin/dbutil/dump.c
146
f = fdopen(fd, "w+");
crypto/krb5/src/kadmin/dbutil/dump.c
152
if (fd >= 0)
crypto/krb5/src/kadmin/dbutil/dump.c
176
int fd = -1;
crypto/krb5/src/kadmin/dbutil/dump.c
186
fd = open(file_ok, O_WRONLY | O_CREAT | O_TRUNC, 0600);
crypto/krb5/src/kadmin/dbutil/dump.c
187
if (fd == -1) {
crypto/krb5/src/kadmin/dbutil/dump.c
191
retval = krb5_lock_file(context, fd, KRB5_LOCKMODE_EXCLUSIVE);
crypto/krb5/src/kadmin/dbutil/dump.c
197
*fd_out = fd;
crypto/krb5/src/kadmin/dbutil/dump.c
198
fd = -1;
crypto/krb5/src/kadmin/dbutil/dump.c
203
if (fd != -1)
crypto/krb5/src/kadmin/dbutil/dump.c
204
close(fd);
crypto/krb5/src/kadmin/dbutil/dump.c
214
update_ok_file(krb5_context context, int fd)
crypto/krb5/src/kadmin/dbutil/dump.c
216
write(fd, "", 1);
crypto/krb5/src/kadmin/dbutil/dump.c
217
krb5_lock_file(context, fd, KRB5_LOCKMODE_UNLOCK);
crypto/krb5/src/kadmin/dbutil/dump.c
218
close(fd);
crypto/krb5/src/kdc/t_sockact.c
52
int fd, one = 1;
crypto/krb5/src/kdc/t_sockact.c
54
fd = socket(addr->sa_family, SOCK_STREAM, 0);
crypto/krb5/src/kdc/t_sockact.c
55
if (fd < 0)
crypto/krb5/src/kdc/t_sockact.c
57
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) != 0)
crypto/krb5/src/kdc/t_sockact.c
60
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) != 0)
crypto/krb5/src/kdc/t_sockact.c
65
if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one)) != 0)
crypto/krb5/src/kdc/t_sockact.c
69
if (bind(fd, addr, sa_socklen(addr)) != 0)
crypto/krb5/src/kdc/t_sockact.c
71
if (listen(fd, 5) != 0)
crypto/krb5/src/kdc/t_sockact.c
73
max_fd = fd;
crypto/krb5/src/kprop/kprop.c
110
open_connection(context, replica_host, &fd);
crypto/krb5/src/kprop/kprop.c
111
kerberos_authenticate(context, &auth_context, fd, my_principal, &my_creds);
crypto/krb5/src/kprop/kprop.c
112
xmit_database(context, auth_context, my_creds, fd, database_fd,
crypto/krb5/src/kprop/kprop.c
283
int fd, krb5_principal me, krb5_creds **new_creds)
crypto/krb5/src/kprop/kprop.c
302
retval = krb5_sendauth(context, auth_context, &fd, kprop_version,
crypto/krb5/src/kprop/kprop.c
342
int fd, err;
crypto/krb5/src/kprop/kprop.c
350
fd = open(dbpathname, O_RDONLY);
crypto/krb5/src/kprop/kprop.c
351
if (fd < 0) {
crypto/krb5/src/kprop/kprop.c
356
err = krb5_lock_file(context, fd,
crypto/krb5/src/kprop/kprop.c
365
if (fstat(fd, &stbuf)) {
crypto/krb5/src/kprop/kprop.c
385
return fd;
crypto/krb5/src/kprop/kprop.c
389
close_database(krb5_context context, int fd)
crypto/krb5/src/kprop/kprop.c
393
err = krb5_lock_file(context, fd, KRB5_LOCKMODE_UNLOCK);
crypto/krb5/src/kprop/kprop.c
397
close(fd);
crypto/krb5/src/kprop/kprop.c
411
krb5_creds *my_creds, int fd, int database_fd,
crypto/krb5/src/kprop/kprop.c
428
send_error(context, my_creds, fd, _("while encoding database size"),
crypto/krb5/src/kprop/kprop.c
433
retval = krb5_write_message(context, &fd, &outbuf);
crypto/krb5/src/kprop/kprop.c
444
send_error(context, my_creds, fd,
crypto/krb5/src/kprop/kprop.c
461
send_error(context, my_creds, fd, buf, retval);
crypto/krb5/src/kprop/kprop.c
465
retval = krb5_write_message(context, &fd, &outbuf);
crypto/krb5/src/kprop/kprop.c
480
send_error(context, my_creds, fd,
crypto/krb5/src/kprop/kprop.c
490
retval = krb5_read_message(context, &fd, &inbuf);
crypto/krb5/src/kprop/kprop.c
547
send_error(krb5_context context, krb5_creds *my_creds, int fd, char *err_text,
crypto/krb5/src/kprop/kprop.c
566
(void)krb5_write_message(context, &fd, &outbuf);
crypto/krb5/src/kprop/kprop.c
577
int fd;
crypto/krb5/src/kprop/kprop.c
586
fd = THREEPARAMOPEN(file_last_prop, O_WRONLY | O_CREAT | O_TRUNC, 0600);
crypto/krb5/src/kprop/kprop.c
587
if (fd < 0) {
crypto/krb5/src/kprop/kprop.c
593
write(fd, "", 1);
crypto/krb5/src/kprop/kprop.c
595
close(fd);
crypto/krb5/src/kprop/kprop.c
72
krb5_auth_context *auth_context, int fd,
crypto/krb5/src/kprop/kprop.c
75
static void close_database(krb5_context context, int fd);
crypto/krb5/src/kprop/kprop.c
78
int fd, int database_fd, off_t in_database_size);
crypto/krb5/src/kprop/kprop.c
79
static void send_error(krb5_context context, krb5_creds *my_creds, int fd,
crypto/krb5/src/kprop/kprop.c
93
int fd, database_fd;
crypto/krb5/src/kprop/kpropd.c
1185
kerberos_authenticate(krb5_context context, int fd, krb5_principal *clientp,
crypto/krb5/src/kprop/kpropd.c
1197
if (getsockname(fd, (struct sockaddr *)&r_sin, &sin_length)) {
crypto/krb5/src/kprop/kpropd.c
1216
fprintf(stderr, "krb5_recvauth(%d, %s, %s, ...)\n", fd, kprop_version,
crypto/krb5/src/kprop/kpropd.c
1258
retval = krb5_recvauth(context, &auth_context, &fd, kprop_version, server,
crypto/krb5/src/kprop/kpropd.c
1357
recv_database(krb5_context context, int fd, int database_fd,
crypto/krb5/src/kprop/kpropd.c
1368
retval = krb5_read_message(context, &fd, &inbuf);
crypto/krb5/src/kprop/kpropd.c
1370
send_error(context, fd, retval, "while reading database size");
crypto/krb5/src/kprop/kpropd.c
1379
send_error(context, fd, retval, "while decoding database size");
crypto/krb5/src/kprop/kpropd.c
1388
send_error(context, fd, retval, "malformed database size message");
crypto/krb5/src/kprop/kpropd.c
1400
send_error(context, fd, retval,
crypto/krb5/src/kprop/kpropd.c
1412
retval = krb5_read_message(context, &fd, &inbuf);
crypto/krb5/src/kprop/kpropd.c
1418
send_error(context, fd, retval, buf);
crypto/krb5/src/kprop/kpropd.c
1429
send_error(context, fd, retval, buf);
crypto/krb5/src/kprop/kpropd.c
1439
send_error(context, fd, errno, buf);
crypto/krb5/src/kprop/kpropd.c
1445
send_error(context, fd, KRB5KRB_ERR_GENERIC, buf);
crypto/krb5/src/kprop/kpropd.c
1457
send_error(context, fd, KRB5KRB_ERR_GENERIC, buf);
crypto/krb5/src/kprop/kpropd.c
147
static void doit(int fd);
crypto/krb5/src/kprop/kpropd.c
1470
send_error(context, fd, retval, "while encoding # of received bytes");
crypto/krb5/src/kprop/kpropd.c
1477
send_error(krb5_context context, int fd, krb5_error_code err_code,
crypto/krb5/src/kprop/kpropd.c
149
static void kerberos_authenticate(krb5_context context, int fd,
crypto/krb5/src/kprop/kpropd.c
1505
(void)krb5_write_message(context, &fd, &outbuf);
crypto/krb5/src/kprop/kpropd.c
155
static void recv_database(krb5_context context, int fd, int database_fd,
crypto/krb5/src/kprop/kpropd.c
159
static void send_error(krb5_context context, int fd, krb5_error_code err_code,
crypto/krb5/src/kprop/kpropd.c
480
doit(int fd)
crypto/krb5/src/kprop/kpropd.c
496
if (getpeername(fd, (struct sockaddr *)&from, &fromlen) < 0) {
crypto/krb5/src/kprop/kpropd.c
498
if (errno == ENOTSOCK && fd == 0 && !standalone) {
crypto/krb5/src/kprop/kpropd.c
511
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0) {
crypto/krb5/src/kprop/kpropd.c
526
kerberos_authenticate(kpropd_context, fd, &client, &etype, &from);
crypto/krb5/src/kprop/kpropd.c
563
recv_database(kpropd_context, fd, database_fd, &confmsg);
crypto/krb5/src/kprop/kpropd.c
587
retval = krb5_write_message(kpropd_context, &fd, &confmsg);
crypto/krb5/src/kprop/kpropd.c
594
if (close(fd) < 0) {
crypto/krb5/src/kprop/kproplog.c
405
int fd;
crypto/krb5/src/kprop/kproplog.c
411
fd = open(filename, O_RDONLY);
crypto/krb5/src/kprop/kproplog.c
412
if (fd == -1)
crypto/krb5/src/kprop/kproplog.c
414
if (fstat(fd, &st) < 0) {
crypto/krb5/src/kprop/kproplog.c
415
close(fd);
crypto/krb5/src/kprop/kproplog.c
418
ulog = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
crypto/krb5/src/kprop/kproplog.c
420
close(fd);
crypto/krb5/src/kprop/kproplog.c
423
*fd_out = fd;
crypto/krb5/src/lib/apputils/net-server.c
1196
int i, fd = -1;
crypto/krb5/src/lib/apputils/net-server.c
1224
return fd;
crypto/krb5/src/lib/apputils/net-server.c
1513
have_event_for_fd(int fd)
crypto/krb5/src/lib/apputils/net-server.c
1519
if (verto_get_fd(ev) == fd)
crypto/krb5/src/lib/apputils/net-server.c
509
int fd;
crypto/krb5/src/lib/apputils/net-server.c
513
fd = verto_get_fd(ev);
crypto/krb5/src/lib/apputils/net-server.c
517
krb5_klog_syslog(LOG_INFO, _("closing down fd %d"), fd);
crypto/krb5/src/lib/apputils/net-server.c
518
if (fd >= 0 && (!conn || conn->type != CONN_RPC || conn->rpc_force_close))
crypto/krb5/src/lib/apputils/net-server.c
519
close(fd);
crypto/krb5/src/lib/apputils/net-server.c
527
FD_SET(fd, &fds);
crypto/krb5/src/lib/apputils/net-server.c
529
if (FD_ISSET(fd, &svc_fdset)) {
crypto/krb5/src/lib/apputils/net-server.c
533
fd);
crypto/krb5/src/lib/apputils/net-server.c
720
int fd;
crypto/krb5/src/lib/apputils/net-server.c
750
fd = i + SOCKACT_START;
crypto/krb5/src/lib/apputils/net-server.c
751
set_cloexec_fd(fd);
crypto/krb5/src/lib/apputils/net-server.c
753
(void)getsockname(fd, ss2sa(&list->fds[i].addr), &slen);
crypto/krb5/src/lib/apputils/net-server.c
755
(void)getsockopt(fd, SOL_SOCKET, SO_TYPE, &list->fds[i].type, &slen);
crypto/krb5/src/lib/crypto/builtin/aes/aestab.c
149
#define v0(p) bytes2word(fe(p), f9(p), fd(p), fb(p))
crypto/krb5/src/lib/crypto/builtin/aes/aestab.c
150
#define v1(p) bytes2word(fb(p), fe(p), f9(p), fd(p))
crypto/krb5/src/lib/crypto/builtin/aes/aestab.c
151
#define v2(p) bytes2word(fd(p), fb(p), fe(p), f9(p))
crypto/krb5/src/lib/crypto/builtin/aes/aestab.c
152
#define v3(p) bytes2word(f9(p), fd(p), fb(p), fe(p))
crypto/krb5/src/lib/crypto/builtin/aes/aestab.c
350
w = bytes2word(fe(b), f9(b), fd(b), fb(b));
crypto/krb5/src/lib/crypto/krb/prng.c
72
int fd;
crypto/krb5/src/lib/crypto/krb/prng.c
78
fd = open(device, O_RDONLY);
crypto/krb5/src/lib/crypto/krb/prng.c
79
if (fd == -1)
crypto/krb5/src/lib/crypto/krb/prng.c
81
set_cloexec_fd(fd);
crypto/krb5/src/lib/crypto/krb/prng.c
82
if (fstat(fd, &sb) == -1 || S_ISREG(sb.st_mode))
crypto/krb5/src/lib/crypto/krb/prng.c
86
count = read(fd, bp, left);
crypto/krb5/src/lib/crypto/krb/prng.c
95
close(fd);
crypto/krb5/src/lib/kadm5/clnt/client_init.c
177
int fd = -1;
crypto/krb5/src/lib/kadm5/clnt/client_init.c
278
code = connect_to_server(handle->params.admin_server, port, &fd);
crypto/krb5/src/lib/kadm5/clnt/client_init.c
282
handle->clnt = clnttcp_create(NULL, rpc_prog, rpc_vers, &fd, 0, 0);
crypto/krb5/src/lib/kadm5/clnt/client_init.c
296
handle->client_socket = fd;
crypto/krb5/src/lib/kadm5/clnt/client_init.c
298
handle->lhandle->client_socket = fd;
crypto/krb5/src/lib/kadm5/clnt/client_init.c
521
connect_to_server(const char *hostname, int port, int *fd)
crypto/krb5/src/lib/kadm5/clnt/client_init.c
549
*fd = s;
crypto/krb5/src/lib/kadm5/clnt/client_init.c
73
connect_to_server(const char *hostname, int port, int *fd);
crypto/krb5/src/lib/kadm5/logger.c
237
int i, ngood, fd, append;
crypto/krb5/src/lib/kadm5/logger.c
313
fd = open(&cp[5], O_CREAT | O_WRONLY | append,
crypto/krb5/src/lib/kadm5/logger.c
315
if (fd != -1)
crypto/krb5/src/lib/kadm5/logger.c
316
f = fdopen(fd, append ? "a" : "w");
crypto/krb5/src/lib/kadm5/logger.c
317
if (fd == -1 || f == NULL) {
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
110
if ((fd = open(dict_file, O_RDONLY)) == -1) {
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
119
set_cloexec_fd(fd);
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
120
if (fstat(fd, &sb) == -1) {
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
121
close(fd);
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
126
(void)close(fd);
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
129
if (read(fd, dict->word_block, sb.st_size) != sb.st_size) {
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
130
(void)close(fd);
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
133
(void)close(fd);
crypto/krb5/src/lib/kadm5/srv/pwqual_dict.c
99
int fd;
crypto/krb5/src/lib/kdb/kdb_log.c
169
extend_file_to(int fd, unsigned int new_size)
crypto/krb5/src/lib/kdb/kdb_log.c
176
current_offset = lseek(fd, 0, SEEK_END);
crypto/krb5/src/lib/kdb/kdb_log.c
185
wrote_size = write(fd, zero, write_size);
crypto/krb5/src/lib/krad/remote.c
147
if (rr->fd >= 0)
crypto/krb5/src/lib/krad/remote.c
148
close(rr->fd);
crypto/krb5/src/lib/krad/remote.c
150
rr->fd = -1;
crypto/krb5/src/lib/krad/remote.c
167
if (remote->fd < 0) {
crypto/krb5/src/lib/krad/remote.c
171
remote->fd = socket(remote->info->ai_family, remote->info->ai_socktype,
crypto/krb5/src/lib/krad/remote.c
173
if (remote->fd < 0)
crypto/krb5/src/lib/krad/remote.c
176
i = connect(remote->fd, remote->info->ai_addr,
crypto/krb5/src/lib/krad/remote.c
187
on_io, remote->fd);
crypto/krb5/src/lib/krad/remote.c
399
tmp->fd = -1;
crypto/krb5/src/lib/krad/remote.c
62
int fd;
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
185
int fd = -1, status;
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
189
fd = mkstemp(newpath);
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
190
if (fd < 0)
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
195
fp = fdopen(fd, "w");
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
198
fd = -1;
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
211
if (fd >= 0)
crypto/krb5/src/lib/krb5/ccache/cc_dir.c
212
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1041
int fd = -1;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1079
fd = open(data->filename, O_RDWR | O_BINARY | O_CLOEXEC);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1080
if (fd == -1) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1093
if (lseek(fd, start_offset, SEEK_SET) == -1) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1100
rwret = read(fd, on_disk, expected.len);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1118
if (lseek(fd, start_offset, SEEK_SET) == -1) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1122
rwret = write(fd, overwrite.data, overwrite.len);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1129
if (fd >= 0)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1130
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1281
int i, st, fd = -1, version = context->fcc_default_format - FVNO_BASE;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1288
fd = mkstemp(tmpname);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1289
if (fd < 0)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1301
nwritten = write(fd, buf.data, buf.len);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1308
st = close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1309
fd = -1;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1328
if (fd != -1)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
1329
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
336
int fd, flags, lockmode;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
342
fd = open(filename, flags | O_BINARY | O_CLOEXEC, 0600);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
343
if (fd == -1)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
345
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
348
ret = krb5_lock_file(context, fd, lockmode);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
350
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
354
fp = fdopen(fd, writable ? "r+b" : "rb");
crypto/krb5/src/lib/krb5/ccache/cc_file.c
356
(void)krb5_unlock_file(context, fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
357
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
475
int st, flags, fd = -1;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
483
fd = open(data->filename, flags, 0600);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
484
if (fd == -1) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
488
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
492
st = fchmod(fd, S_IRUSR | S_IWUSR);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
502
ret = krb5_lock_file(context, fd, KRB5_LOCKMODE_EXCLUSIVE);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
515
nwritten = write(fd, buf.data, buf.len);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
524
krb5_unlock_file(context, fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
525
if (fd != -1)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
526
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
557
int st, fd;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
565
fd = open(data->filename, O_RDWR | O_BINARY | O_CLOEXEC, 0);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
566
if (fd < 0) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
570
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
580
st = fstat(fd, &buf);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
591
i = write(fd, zeros, wlen);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
600
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
613
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
617
st = fstat(fd, &buf);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
620
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
628
if (write(fd, zeros, BUFSIZ) < 0) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
630
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
636
if (write(fd, zeros, wlen) < 0) {
crypto/krb5/src/lib/krb5/ccache/cc_file.c
638
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
642
st = close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
831
int fd;
crypto/krb5/src/lib/krb5/ccache/cc_file.c
838
fd = mkstemp(template);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
839
if (fd == -1)
crypto/krb5/src/lib/krb5/ccache/cc_file.c
841
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
846
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
854
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
863
close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
875
fchmod(fd, S_IRUSR | S_IWUSR);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
878
cnt = write(fd, &fcc_fvno, 2);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
881
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
888
cnt = write(fd, &fcc_flen, sizeof(fcc_flen));
crypto/krb5/src/lib/krb5/ccache/cc_file.c
891
(void)close(fd);
crypto/krb5/src/lib/krb5/ccache/cc_file.c
897
if (close(fd) == -1) {
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
304
SOCKET fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
318
fd = socket(AF_UNIX, SOCK_STREAM, 0);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
319
if (fd == INVALID_SOCKET) {
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
327
if (SOCKET_CONNECT(fd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
332
io->fd = fd;
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
333
fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
336
if (fd != INVALID_SOCKET)
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
337
closesocket(fd);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
358
ret = krb5int_net_writev(context, io->fd, sg, 2);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
373
close(io->fd);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
395
st = krb5_net_read(context, io->fd, lenbytes, 4);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
402
st = krb5_net_read(context, io->fd, codebytes, 4);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
412
st = krb5_net_read(context, io->fd, reply, len);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
433
io->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
459
if (io->fd != INVALID_SOCKET) {
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
486
if (io->fd != INVALID_SOCKET)
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
487
closesocket(io->fd);
crypto/krb5/src/lib/krb5/ccache/cc_kcm.c
76
SOCKET fd;
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
275
int version, fd;
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
352
fd = open(filename, O_RDONLY);
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
353
if (fd == -1)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
355
if (read(fd, filebuf, t->headerlen) != (ssize_t)t->headerlen)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
358
if (read(fd, filebuf, t->princlen) != (ssize_t)t->princlen)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
361
if (read(fd, filebuf, t->cred1len) != (ssize_t)t->cred1len)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
364
if (read(fd, filebuf, t->cred2len) != (ssize_t)t->cred2len)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
367
close(fd);
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
374
fd = open(filename, O_CREAT|O_TRUNC|O_RDWR, 0700);
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
375
if (fd == -1)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
377
if (write(fd, t->header, t->headerlen) != (ssize_t)t->headerlen)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
379
if (write(fd, t->princ, t->princlen) != (ssize_t)t->princlen)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
381
if (write(fd, t->cred1, t->cred1len) != (ssize_t)t->cred1len)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
383
if (write(fd, t->cred2, t->cred2len) != (ssize_t)t->cred2len)
crypto/krb5/src/lib/krb5/ccache/t_marshal.c
385
close(fd);
crypto/krb5/src/lib/krb5/krb/recvauth.c
113
if ((krb5_net_write(context, *((int *)fd), (char *)&response, 1)) < 0) {
crypto/krb5/src/lib/krb5/krb/recvauth.c
124
if ((retval = krb5_read_message(context, fd, &inbuf)))
crypto/krb5/src/lib/krb5/krb/recvauth.c
188
retval = krb5_write_message(context, fd, &outbuf);
crypto/krb5/src/lib/krb5/krb/recvauth.c
203
retval = krb5_write_message(context, fd, &outbuf);
crypto/krb5/src/lib/krb5/krb/recvauth.c
220
krb5_recvauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointer fd, char *appl_version, krb5_principal server, krb5_int32 flags, krb5_keytab keytab, krb5_ticket **ticket)
crypto/krb5/src/lib/krb5/krb/recvauth.c
222
return recvauth_common (context, auth_context, fd, appl_version,
crypto/krb5/src/lib/krb5/krb/recvauth.c
230
krb5_pointer fd,
crypto/krb5/src/lib/krb5/krb/recvauth.c
238
return recvauth_common (context, auth_context, fd, 0,
crypto/krb5/src/lib/krb5/krb/recvauth.c
45
krb5_pointer fd,
crypto/krb5/src/lib/krb5/krb/recvauth.c
78
if ((retval = krb5_read_message(context, fd, &inbuf)))
crypto/krb5/src/lib/krb5/krb/recvauth.c
95
if ((retval = krb5_read_message(context, fd, &inbuf)))
crypto/krb5/src/lib/krb5/krb/sendauth.c
139
retval = krb5_write_message(context, fd, &outbuf[0]);
crypto/krb5/src/lib/krb5/krb/sendauth.c
150
if ((retval = krb5_read_message(context, fd, &inbuf)))
crypto/krb5/src/lib/krb5/krb/sendauth.c
172
if ((retval = krb5_read_message(context, fd, &inbuf)))
crypto/krb5/src/lib/krb5/krb/sendauth.c
39
krb5_pointer fd, char *appl_version, krb5_principal client,
crypto/krb5/src/lib/krb5/krb/sendauth.c
67
if ((retval = k5_write_messages(context, fd, outbuf, 2)))
crypto/krb5/src/lib/krb5/krb/sendauth.c
73
if ((len = krb5_net_read(context, *((int *) fd), (char *)&result, 1)) != 1)
crypto/krb5/src/lib/krb5/os/changepw.c
110
kpasswd_sendto_msg_callback(SOCKET fd, void *data, krb5_data *message)
crypto/krb5/src/lib/krb5/os/changepw.c
127
if (getsockname(fd, ss2sa(&local_addr), &addrlen) < 0) {
crypto/krb5/src/lib/krb5/os/genaddrs.c
102
retval = getpeername(fd, ss2sa(&rsaddr), &ssize);
crypto/krb5/src/lib/krb5/os/genaddrs.c
72
SOCKET fd = (SOCKET) infd;
crypto/krb5/src/lib/krb5/os/genaddrs.c
82
retval = getsockname(fd, ss2sa(&lsaddr), &ssize);
crypto/krb5/src/lib/krb5/os/krbfileio.c
54
int fd;
crypto/krb5/src/lib/krb5/os/krbfileio.c
59
fd = THREEPARAMOPEN(pathname, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
crypto/krb5/src/lib/krb5/os/krbfileio.c
67
if (fd > -1) {
crypto/krb5/src/lib/krb5/os/krbfileio.c
74
fchown(fd, uid, gid);
crypto/krb5/src/lib/krb5/os/krbfileio.c
76
fchmod(fd, 0600);
crypto/krb5/src/lib/krb5/os/krbfileio.c
80
if (fd > -1) {
crypto/krb5/src/lib/krb5/os/krbfileio.c
81
close(fd);
crypto/krb5/src/lib/krb5/os/lock_file.c
102
return fcntl(fd, cmd, lock_arg);
crypto/krb5/src/lib/krb5/os/lock_file.c
108
krb5_lock_file(krb5_context context, int fd, int mode)
crypto/krb5/src/lib/krb5/os/lock_file.c
154
if (ofdlock(fd, lock_cmd, &lock_arg) == -1) {
crypto/krb5/src/lib/krb5/os/lock_file.c
166
if (flock(fd, lock_flag) == -1)
crypto/krb5/src/lib/krb5/os/lock_file.c
175
krb5_lock_file(context, fd, mode)
crypto/krb5/src/lib/krb5/os/lock_file.c
177
int fd;
crypto/krb5/src/lib/krb5/os/lock_file.c
61
#define fcntl(fd, cmd, arg) syscall(SYS_fcntl64, fd, cmd, arg)
crypto/krb5/src/lib/krb5/os/lock_file.c
91
ofdlock(int fd, int cmd, fcntl_lock_st *lock_arg)
crypto/krb5/src/lib/krb5/os/lock_file.c
98
st = fcntl(fd, ofdcmd, lock_arg);
crypto/krb5/src/lib/krb5/os/net_read.c
40
krb5_net_read(krb5_context context, int fd, char *buf, int len)
crypto/krb5/src/lib/krb5/os/net_read.c
45
cc = SOCKET_READ((SOCKET)fd, buf, len);
crypto/krb5/src/lib/krb5/os/net_write.c
40
krb5_net_write(krb5_context context, int fd, const char *buf, int len)
crypto/krb5/src/lib/krb5/os/net_write.c
44
return krb5int_net_writev(context, fd, &sg, 1);
crypto/krb5/src/lib/krb5/os/net_write.c
48
krb5int_net_writev(krb5_context context, int fd, sg_buf *sgp, int nsg)
crypto/krb5/src/lib/krb5/os/net_write.c
59
cc = SOCKET_WRITEV((SOCKET)fd, sgp, nsg, tmp);
crypto/krb5/src/lib/krb5/os/os-proto.h
85
int (*pfn_callback)(SOCKET fd, void *data, krb5_data *message);
crypto/krb5/src/lib/krb5/os/prompter.c
121
else if (fd >= 0)
crypto/krb5/src/lib/krb5/os/prompter.c
122
close(fd);
crypto/krb5/src/lib/krb5/os/prompter.c
162
int fd;
crypto/krb5/src/lib/krb5/os/prompter.c
167
fd = fileno(fp);
crypto/krb5/src/lib/krb5/os/prompter.c
169
if (!isatty(fd)) {
crypto/krb5/src/lib/krb5/os/prompter.c
173
if (tcgetattr(fd, &tparm) < 0)
crypto/krb5/src/lib/krb5/os/prompter.c
194
int ret, fd;
crypto/krb5/src/lib/krb5/os/prompter.c
197
fd = fileno(fp);
crypto/krb5/src/lib/krb5/os/prompter.c
198
if (isatty(fd)) {
crypto/krb5/src/lib/krb5/os/prompter.c
199
ret = tcsetattr(fd, TCSANOW, saveparm);
crypto/krb5/src/lib/krb5/os/prompter.c
40
int fd, i, scratchchar;
crypto/krb5/src/lib/krb5/os/prompter.c
62
fd = dup(STDIN_FILENO);
crypto/krb5/src/lib/krb5/os/prompter.c
63
if (fd < 0)
crypto/krb5/src/lib/krb5/os/prompter.c
65
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/os/prompter.c
66
fp = fdopen(fd, "r");
crypto/krb5/src/lib/krb5/os/read_msg.c
36
int fd = *( (int *) fdp);
crypto/krb5/src/lib/krb5/os/read_msg.c
40
if ((len2 = krb5_net_read(context, fd, (char *)&len, 4)) != 4)
crypto/krb5/src/lib/krb5/os/read_msg.c
55
if ((len2 = krb5_net_read(context, fd, buf, ilen)) != ilen) {
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1024
ret = send(conn->fd, SG_BUF(sg), SG_LEN(sg), 0);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1046
cm_remove_fd(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1048
closesocket(conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1049
conn->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1055
get_so_error(int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1062
e = getsockopt(fd, SOL_SOCKET, SO_ERROR, &sockerr, &sockerrlen);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1104
int e = get_so_error(conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1125
nwritten = SOCKET_WRITEV(conn->fd, conn->out.sgp, conn->out.sg_count, tmp);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1144
cm_read(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1161
nread = SOCKET_READ(conn->fd, &in->buf[in->pos], in->n_left);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1174
nread = SOCKET_READ(conn->fd, in->bufsizebytes + in->bufsizebytes_read,
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1209
nread = recv(conn->fd, conn->in.buf, conn->in.bufsize, 0);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1245
if (context->tls->setup(context, conn->fd, conn->http.servername, anchors,
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
126
SOCKET fd;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1277
cm_read(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1280
cm_read(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1282
cm_write(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1331
cm_read(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1333
cm_write(selstate, conn->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1443
if (state->fd == INVALID_SOCKET)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1445
ssflags = cm_get_ssflags(seltemp, state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1613
(void)getpeername(winner->fd, remoteaddr, remoteaddrlen);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1619
if (state->fd != INVALID_SOCKET) {
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
1622
closesocket(state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
201
find_pollfd(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
206
if (selstate->fds[i].fd == fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
219
cm_add_fd(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
223
selstate->fds[selstate->nfds].fd = fd;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
230
cm_remove_fd(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
232
struct pollfd *pfd = find_pollfd(selstate, fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
240
cm_read(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
242
find_pollfd(selstate, fd)->events = POLLIN;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
247
cm_write(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
249
find_pollfd(selstate, fd)->events = POLLOUT;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
254
cm_get_ssflags(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
256
struct pollfd *pfd = find_pollfd(selstate, fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
285
cm_add_fd(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
288
if (fd >= FD_SETSIZE)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
291
FD_SET(fd, &selstate->xfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
292
if (selstate->max <= fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
293
selstate->max = fd + 1;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
299
cm_remove_fd(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
301
FD_CLR(fd, &selstate->rfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
302
FD_CLR(fd, &selstate->wfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
303
FD_CLR(fd, &selstate->xfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
304
if (selstate->max == fd + 1) {
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
316
cm_read(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
318
FD_SET(fd, &selstate->rfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
319
FD_CLR(fd, &selstate->wfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
324
cm_write(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
326
FD_CLR(fd, &selstate->rfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
327
FD_SET(fd, &selstate->wfds);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
332
cm_get_ssflags(struct select_state *selstate, int fd)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
334
return (FD_ISSET(fd, &selstate->rfds) ? SSF_READ : 0) |
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
335
(FD_ISSET(fd, &selstate->wfds) ? SSF_WRITE : 0) |
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
336
(FD_ISSET(fd, &selstate->xfds) ? SSF_EXCEPTION : 0);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
714
state->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
890
int fd, e, type;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
895
fd = socket(state->addr.family, type, 0);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
896
if (fd == INVALID_SOCKET)
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
898
set_cloexec_fd(fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
900
ioctlsocket(fd, FIONBIO, (const void *) &one);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
902
setsockopt(fd, SOL_SOCKET, SO_LINGER, &lopt, sizeof(lopt));
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
907
e = SOCKET_CONNECT(fd, (struct sockaddr *)&state->addr.saddr,
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
916
state->fd = fd;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
918
(void) closesocket(fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
929
state->fd = fd;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
938
e = callback_info->pfn_callback(state->fd, callback_info->data,
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
941
(void) closesocket(fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
942
state->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
953
(void) closesocket(state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
954
state->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
965
ret = send(state->fd, SG_BUF(sg), SG_LEN(sg), 0);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
969
(void) closesocket(state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
970
state->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
978
if (!cm_add_fd(selstate, state->fd)) {
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
979
(void) closesocket(state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
980
state->fd = INVALID_SOCKET;
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
985
cm_write(selstate, state->fd);
crypto/krb5/src/lib/krb5/os/sendto_kdc.c
987
cm_read(selstate, state->fd);
crypto/krb5/src/lib/krb5/os/trace.c
437
int *fd = data;
crypto/krb5/src/lib/krb5/os/trace.c
441
close(*fd);
crypto/krb5/src/lib/krb5/os/trace.c
442
free(fd);
crypto/krb5/src/lib/krb5/os/trace.c
446
(void) write(*fd, info->message, strlen(info->message));
crypto/krb5/src/lib/krb5/os/trace.c
452
int *fd;
crypto/krb5/src/lib/krb5/os/trace.c
455
fd = malloc(sizeof(*fd));
crypto/krb5/src/lib/krb5/os/trace.c
456
if (fd == NULL)
crypto/krb5/src/lib/krb5/os/trace.c
458
*fd = open(filename, O_WRONLY|O_CREAT|O_APPEND, 0600);
crypto/krb5/src/lib/krb5/os/trace.c
459
if (*fd == -1) {
crypto/krb5/src/lib/krb5/os/trace.c
460
free(fd);
crypto/krb5/src/lib/krb5/os/trace.c
464
return krb5_set_trace_callback(context, file_trace_cb, fd);
crypto/krb5/src/lib/krb5/os/unlck_file.c
31
krb5_unlock_file(krb5_context context, int fd)
crypto/krb5/src/lib/krb5/os/unlck_file.c
33
return krb5_lock_file(context, fd, KRB5_LOCKMODE_UNLOCK);
crypto/krb5/src/lib/krb5/os/write_msg.c
42
int fd = *( (int *) fdp);
crypto/krb5/src/lib/krb5/os/write_msg.c
63
if (krb5int_net_writev(context, fd, sg, nbufs1 * 2) < 0) {
crypto/krb5/src/lib/krb5/rcache/rc-int.h
54
krb5_error_code k5_rcfile2_store(krb5_context context, int fd,
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
103
fd = open(fname, O_CREAT | O_RDWR | O_NOFOLLOW, 0600);
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
104
if (fd < 0) {
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
111
if (fstat(fd, &statbuf) < 0 || statbuf.st_uid != euid) {
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
118
*fd_out = fd;
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
119
fd = -1;
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
123
if (fd != -1)
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
124
close(fd);
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
147
int fd;
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
149
ret = open_file(context, &fd);
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
153
ret = k5_rcfile2_store(context, fd, tag);
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
154
close(fd);
crypto/krb5/src/lib/krb5/rcache/rc_dfl.c
86
int fd = -1;
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
105
write_record(int fd, off_t offset, const uint8_t tag[TAG_LEN],
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
114
st = lseek(fd, offset, SEEK_SET);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
117
st = write(fd, record, RECORD_LEN);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
137
store(krb5_context context, int fd, const uint8_t tag[TAG_LEN], uint32_t now,
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
149
st = read(fd, seed, sizeof(seed));
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
157
st = write(fd, seed, sizeof(seed));
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
172
ret = read_records(fd, record_offset, r1tag, &r1stamp, r2tag, &r2stamp,
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
193
return write_record(fd, avail_offset, tag, now);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
201
k5_rcfile2_store(krb5_context context, int fd, const krb5_data *tag_data)
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
220
ret = krb5_lock_file(context, fd, KRB5_LOCKMODE_EXCLUSIVE);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
223
ret = store(context, fd, tag, now, context->clockskew);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
224
(void)krb5_unlock_file(NULL, fd);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
246
int fd;
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
248
fd = open(filename, O_CREAT | O_RDWR | O_BINARY, 0600);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
249
if (fd < 0) {
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
255
ret = k5_rcfile2_store(context, fd, tag);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
256
close(fd);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
74
read_records(int fd, off_t offset, uint8_t tag1_out[TAG_LEN],
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
83
st = lseek(fd, offset, SEEK_SET);
crypto/krb5/src/lib/krb5/rcache/rc_file2.c
86
st = read(fd, buf, RECORD_LEN * 2);
crypto/krb5/src/lib/rpc/svc_tcp.c
214
int fd,
crypto/krb5/src/lib/rpc/svc_tcp.c
219
return (makefd_xprt(fd, sendsize, recvsize));
crypto/krb5/src/lib/rpc/svc_tcp.c
224
int fd,
crypto/krb5/src/lib/rpc/svc_tcp.c
232
if (fd >= FD_SETSIZE) {
crypto/krb5/src/lib/rpc/svc_tcp.c
238
if (fd >= NOFILE) {
crypto/krb5/src/lib/rpc/svc_tcp.c
267
xprt->xp_sock = fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
111
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
114
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
120
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
134
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
137
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
143
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
157
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
160
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
166
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
180
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
183
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
189
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
203
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
206
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
212
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
226
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
229
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
235
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
49
int fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
57
int fd = 0;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
63
fd = audit_open();
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
64
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
67
auctx->fd = fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
77
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
79
audit_close(fd);
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
89
int fd = auctx->fd;
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
92
if (fd < 0)
crypto/krb5/src/plugins/audit/simple/au_simple_main.c
98
if (audit_log_user_message(fd, local_type, jout,
crypto/krb5/src/plugins/kdb/db2/adb_openclose.c
293
int ret, fd;
crypto/krb5/src/plugins/kdb/db2/adb_openclose.c
301
fd = THREEPARAMOPEN(db->lock->filename,O_RDWR | O_CREAT | O_EXCL,
crypto/krb5/src/plugins/kdb/db2/adb_openclose.c
303
if (fd < 0)
crypto/krb5/src/plugins/kdb/db2/adb_openclose.c
305
set_cloexec_fd(fd);
crypto/krb5/src/plugins/kdb/db2/adb_openclose.c
306
if ((db->lock->lockfile = fdopen(fd, "w+")) == NULL)
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
622
int dowrite, j, nb, fd, retval;
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
626
fd = open(filename, O_RDWR, 0);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
627
if (fd < 0)
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
629
set_cloexec_fd(fd);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
633
if (fstat(fd, &statb) == -1)
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
647
nb = read(fd, buf, BUFSIZ);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
659
lseek(fd, pos, SEEK_SET);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
660
nb = write(fd, zbuf, j);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
670
fsync(fd);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
672
close(fd);
crypto/krb5/src/plugins/kdb/db2/kdb_db2.c
680
close(fd);
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_close.c
102
fd = t->bt_fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_close.c
105
return (close(fd) ? RET_ERROR : RET_SUCCESS);
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_close.c
67
int fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
182
dbp->fd = __bt_fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
400
int fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
423
if ((fd = mkstemp(path)) != -1)
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
425
set_cloexec_fd(fd);
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
433
setmode(fd, O_BINARY);
crypto/krb5/src/plugins/kdb/db2/libdb2/btree/bt_open.c
436
return(fd);
crypto/krb5/src/plugins/kdb/db2/libdb2/db/db.c
90
dbp->fd = (int (*)(const struct __db *))__dberr;
crypto/krb5/src/plugins/kdb/db2/libdb2/hash/hash.c
216
dbp->fd = hash_fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
223
if (lseek(mp->fd, off, SEEK_SET) != off)
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
226
if ((nr = read(mp->fd, bp->page, mp->pagesize)) !=
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
324
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
409
if (lseek(mp->fd, off, SEEK_SET) != off)
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
411
if (write(mp->fd, bp->page, mp->pagesize) !=
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
59
mpool_open(void *key, int fd, db_pgno_t pagesize, db_pgno_t maxcache)
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
71
if (fstat(fd, &sb))
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.c
87
mp->fd = fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/mpool/mpool.h
69
int fd; /* file descriptor */
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_open.c
194
dbp->fd = __rec_fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
761
int fd;
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
767
if ((fd = open(name, O_RDONLY, 0)) < 0 ||
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
768
fstat(fd, &sb))
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
776
if (read(fd, p, (int)sb.st_size) == -1)
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
779
(void)close(fd);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
434
int fd;
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
436
fd = open(filename, O_RDWR | O_CLOEXEC, 0);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
437
if (fd < 0)
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
439
set_cloexec_fd(fd);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
440
if (fstat(fd, &st) == -1)
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
446
len = read(fd, buf, BUFSIZ);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
452
(void)lseek(fd, pos, SEEK_SET);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
453
len = write(fd, zbuf, len);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
459
close(fd);
crypto/krb5/src/plugins/kdb/lmdb/kdb_lmdb.c
467
close(fd);
crypto/krb5/src/plugins/pwqual/test/main.c
54
int fd;
crypto/krb5/src/plugins/pwqual/test/main.c
62
fd = open(dict_file, O_RDONLY);
crypto/krb5/src/plugins/pwqual/test/main.c
63
if (fd == -1)
crypto/krb5/src/plugins/pwqual/test/main.c
65
if (fstat(fd, &sb) == -1) {
crypto/krb5/src/plugins/pwqual/test/main.c
66
close(fd);
crypto/krb5/src/plugins/pwqual/test/main.c
72
if (read(fd, dict->word_block, sb.st_size) != sb.st_size)
crypto/krb5/src/plugins/pwqual/test/main.c
74
close(fd);
crypto/krb5/src/plugins/tls/k5tls/openssl.c
432
setup(krb5_context context, SOCKET fd, const char *servername,
crypto/krb5/src/plugins/tls/k5tls/openssl.c
475
if (!SSL_set_fd(ssl, fd))
crypto/krb5/src/util/ss/help.c
24
int fd, child;
crypto/krb5/src/util/ss/help.c
60
if ((fd = open(&buffer[0], O_RDONLY)) >= 0) goto got_it;
crypto/krb5/src/util/ss/help.c
62
if ((fd = open(&buffer[0], O_RDONLY)) < 0) {
crypto/krb5/src/util/ss/help.c
74
close(fd);
crypto/krb5/src/util/ss/help.c
77
(void) dup2(fd, 0); /* put file on stdin */
crypto/krb5/src/util/ss/help.c
80
(void) close(fd); /* what can we do if it fails? */
crypto/krb5/src/util/ss/list_rqs.c
34
int fd;
crypto/krb5/src/util/ss/list_rqs.c
65
fd = ss_pager_create(); /* FD_CLOEXEC set */
crypto/krb5/src/util/ss/list_rqs.c
66
output = fdopen(fd, "w");
crypto/krb5/src/util/ss/pager.c
61
int fd;
crypto/krb5/src/util/ss/pager.c
62
fd = open("/dev/tty", O_WRONLY, 0);
crypto/krb5/src/util/ss/pager.c
63
if (fd >= 0)
crypto/krb5/src/util/ss/pager.c
64
set_cloexec_fd(fd);
crypto/krb5/src/util/ss/pager.c
65
return fd;
crypto/krb5/src/util/support/mkstemp.c
70
int fd;
crypto/krb5/src/util/support/mkstemp.c
72
return (_gettemp(path, &fd) ? fd : -1);
crypto/krb5/src/util/verto/ev.c
1571
# define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd)
crypto/krb5/src/util/verto/ev.c
1577
# define EV_WIN32_CLOSE_FD(fd) close (fd)
crypto/krb5/src/util/verto/ev.c
2038
fd_event_nocheck (EV_P_ int fd, int revents)
crypto/krb5/src/util/verto/ev.c
2040
ANFD *anfd = anfds + fd;
crypto/krb5/src/util/verto/ev.c
2055
fd_event (EV_P_ int fd, int revents)
crypto/krb5/src/util/verto/ev.c
2057
ANFD *anfd = anfds + fd;
crypto/krb5/src/util/verto/ev.c
2060
fd_event_nocheck (EV_A_ fd, revents);
crypto/krb5/src/util/verto/ev.c
2064
ev_feed_fd_event (EV_P_ int fd, int revents) EV_THROW
crypto/krb5/src/util/verto/ev.c
2066
if (fd >= 0 && fd < anfdmax)
crypto/krb5/src/util/verto/ev.c
2067
fd_event_nocheck (EV_A_ fd, revents);
crypto/krb5/src/util/verto/ev.c
2080
int fd = fdchanges [i];
crypto/krb5/src/util/verto/ev.c
2081
ANFD *anfd = anfds + fd;
crypto/krb5/src/util/verto/ev.c
2085
SOCKET handle = EV_FD_TO_WIN32_HANDLE (fd);
crypto/krb5/src/util/verto/ev.c
2094
backend_modify (EV_A_ fd, anfd->events, 0);
crypto/krb5/src/util/verto/ev.c
2104
int fd = fdchanges [i];
crypto/krb5/src/util/verto/ev.c
2105
ANFD *anfd = anfds + fd;
crypto/krb5/src/util/verto/ev.c
2125
backend_modify (EV_A_ fd, o_events, anfd->events);
crypto/krb5/src/util/verto/ev.c
2133
fd_change (EV_P_ int fd, int flags)
crypto/krb5/src/util/verto/ev.c
2135
unsigned char reify = anfds [fd].reify;
crypto/krb5/src/util/verto/ev.c
2136
anfds [fd].reify |= flags;
crypto/krb5/src/util/verto/ev.c
2142
fdchanges [fdchangecnt - 1] = fd;
crypto/krb5/src/util/verto/ev.c
2148
fd_kill (EV_P_ int fd)
crypto/krb5/src/util/verto/ev.c
2152
while ((w = (ev_io *)anfds [fd].head))
crypto/krb5/src/util/verto/ev.c
2161
fd_valid (int fd)
crypto/krb5/src/util/verto/ev.c
2164
return EV_FD_TO_WIN32_HANDLE (fd) != -1;
crypto/krb5/src/util/verto/ev.c
2166
return fcntl (fd, F_GETFD) != -1;
crypto/krb5/src/util/verto/ev.c
2174
int fd;
crypto/krb5/src/util/verto/ev.c
2176
for (fd = 0; fd < anfdmax; ++fd)
crypto/krb5/src/util/verto/ev.c
2177
if (anfds [fd].events)
crypto/krb5/src/util/verto/ev.c
2178
if (!fd_valid (fd) && errno == EBADF)
crypto/krb5/src/util/verto/ev.c
2179
fd_kill (EV_A_ fd);
crypto/krb5/src/util/verto/ev.c
2186
int fd;
crypto/krb5/src/util/verto/ev.c
2188
for (fd = anfdmax; fd--; )
crypto/krb5/src/util/verto/ev.c
2189
if (anfds [fd].events)
crypto/krb5/src/util/verto/ev.c
2191
fd_kill (EV_A_ fd);
crypto/krb5/src/util/verto/ev.c
2200
int fd;
crypto/krb5/src/util/verto/ev.c
2202
for (fd = 0; fd < anfdmax; ++fd)
crypto/krb5/src/util/verto/ev.c
2203
if (anfds [fd].events)
crypto/krb5/src/util/verto/ev.c
2205
anfds [fd].events = 0;
crypto/krb5/src/util/verto/ev.c
2206
anfds [fd].emask = 0;
crypto/krb5/src/util/verto/ev.c
2207
fd_change (EV_A_ fd, EV__IOFDSET | EV_ANFD_REIFY);
crypto/krb5/src/util/verto/ev.c
2214
fd_intern (int fd)
crypto/krb5/src/util/verto/ev.c
2218
ioctlsocket (EV_FD_TO_WIN32_HANDLE (fd), FIONBIO, &arg);
crypto/krb5/src/util/verto/ev.c
2220
fcntl (fd, F_SETFD, FD_CLOEXEC);
crypto/krb5/src/util/verto/ev.c
2221
fcntl (fd, F_SETFL, O_NONBLOCK);
crypto/krb5/src/util/verto/ev.c
3165
assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i));
crypto/krb5/src/util/verto/ev.c
3838
int fd = w->fd;
crypto/krb5/src/util/verto/ev.c
3843
assert (("libev: ev_io_start called with negative fd", fd >= 0));
crypto/krb5/src/util/verto/ev.c
3849
array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero);
crypto/krb5/src/util/verto/ev.c
3850
wlist_add (&anfds[fd].head, (WL)w);
crypto/krb5/src/util/verto/ev.c
3855
fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY);
crypto/krb5/src/util/verto/ev.c
3868
assert (("libev: ev_io_stop called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax));
crypto/krb5/src/util/verto/ev.c
3872
wlist_del (&anfds[w->fd].head, (WL)w);
crypto/krb5/src/util/verto/ev.c
3875
fd_change (EV_A_ w->fd, EV_ANFD_REIFY);
crypto/krb5/src/util/verto/ev.c
4369
int fd = inotify_init1 (IN_CLOEXEC | IN_NONBLOCK);
crypto/krb5/src/util/verto/ev.c
4370
if (fd >= 0)
crypto/krb5/src/util/verto/ev.c
4371
return fd;
crypto/krb5/src/util/verto/ev.c
461
EV_CPP (extern "C") int signalfd (int fd, const sigset_t *mask, int flags);
crypto/krb5/src/util/verto/ev.c
4957
ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_THROW
crypto/krb5/src/util/verto/ev.c
4971
if (fd >= 0)
crypto/krb5/src/util/verto/ev.c
4973
ev_io_set (&once->io, fd, events);
crypto/krb5/src/util/verto/ev.h
321
int fd; /* ro */
crypto/krb5/src/util/verto/ev.h
654
EV_API_DECL void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_THROW;
crypto/krb5/src/util/verto/ev.h
693
#define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV__IOFDSET; } while (0)
crypto/krb5/src/util/verto/ev.h
707
#define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)
crypto/krb5/src/util/verto/ev.h
748
EV_API_DECL void ev_feed_fd_event (EV_P_ int fd, int revents) EV_THROW;
crypto/krb5/src/util/verto/ev_poll.c
117
fd_kill (EV_A_ p->fd);
crypto/krb5/src/util/verto/ev_poll.c
121
p->fd,
crypto/krb5/src/util/verto/ev_poll.c
52
poll_modify (EV_P_ int fd, int oev, int nev)
crypto/krb5/src/util/verto/ev_poll.c
59
array_needsize (int, pollidxs, pollidxmax, fd + 1, pollidx_init);
crypto/krb5/src/util/verto/ev_poll.c
61
idx = pollidxs [fd];
crypto/krb5/src/util/verto/ev_poll.c
65
pollidxs [fd] = idx = pollcnt++;
crypto/krb5/src/util/verto/ev_poll.c
67
polls [idx].fd = fd;
crypto/krb5/src/util/verto/ev_poll.c
70
assert (polls [idx].fd == fd);
crypto/krb5/src/util/verto/ev_poll.c
78
pollidxs [fd] = -1;
crypto/krb5/src/util/verto/ev_poll.c
83
pollidxs [polls [idx].fd] = idx;
crypto/krb5/src/util/verto/ev_select.c
108
int word = fd / NFDBITS;
crypto/krb5/src/util/verto/ev_select.c
109
fd_mask mask = 1UL << (fd % NFDBITS);
crypto/krb5/src/util/verto/ev_select.c
221
int fd;
crypto/krb5/src/util/verto/ev_select.c
223
for (fd = 0; fd < anfdmax; ++fd)
crypto/krb5/src/util/verto/ev_select.c
224
if (anfds [fd].events)
crypto/krb5/src/util/verto/ev_select.c
228
SOCKET handle = anfds [fd].handle;
crypto/krb5/src/util/verto/ev_select.c
230
int handle = fd;
crypto/krb5/src/util/verto/ev_select.c
240
fd_event (EV_A_ fd, events);
crypto/krb5/src/util/verto/ev_select.c
71
select_modify (EV_P_ int fd, int oev, int nev)
crypto/krb5/src/util/verto/ev_select.c
80
SOCKET handle = anfds [fd].handle;
crypto/krb5/src/util/verto/ev_select.c
82
int handle = fd;
crypto/krb5/src/util/verto/ev_select.c
85
assert (("libev: fd >= FD_SETSIZE passed to fd_set-based select backend", fd < FD_SETSIZE));
crypto/krb5/src/util/verto/ev_vars.h
66
VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev))
crypto/krb5/src/util/verto/verto.c
66
int fd;
crypto/krb5/src/util/verto/verto.c
707
verto_callback *callback, int fd)
crypto/krb5/src/util/verto/verto.c
711
if (fd < 0 || !(flags & (VERTO_EV_FLAG_IO_READ | VERTO_EV_FLAG_IO_WRITE)))
crypto/krb5/src/util/verto/verto.c
714
doadd(ev, ev->option.io.fd = fd, VERTO_EV_TYPE_IO);
crypto/krb5/src/util/verto/verto.c
835
return ev->option.io.fd;
crypto/krb5/src/util/verto/verto.c
903
close(ev->option.io.fd);
crypto/krb5/src/util/verto/verto.h
302
verto_callback *callback, int fd);
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
1216
if(fd != 0){
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
1217
close(fd);
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
1226
if(fd != 0){
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
1227
close(fd);
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
836
int read_string(int fd, char *buf, unsigned int *buflen);
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
837
int read_string(int fd, char *buf, unsigned int *buflen)
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
854
while ((len > 0) && ((ret = read(fd, &c, 1)) != 0) && (c != '\n')) {
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
896
int fd = 0, nn_local_cnt = 0, fp_local_cnt = 0, fp_ctx_local_cnt = 0;
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
954
fd = open(argv[1], O_RDONLY);
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
957
fd = STDIN_FILENO;
crypto/libecc/src/arithmetic_tests/arithmetic_tests.c
959
while (read_string(fd, ibuf, &len) == 0) {
crypto/libecc/src/external_deps/rand.c
40
int fd;
crypto/libecc/src/external_deps/rand.c
47
fd = open(path, O_RDONLY);
crypto/libecc/src/external_deps/rand.c
48
if (fd == -1) {
crypto/libecc/src/external_deps/rand.c
55
ret = (int)read(fd, buf + copied, rem);
crypto/libecc/src/external_deps/rand.c
64
if (close(fd)) {
crypto/openssh/atomicio.c
115
pfd.fd = fd;
crypto/openssh/atomicio.c
122
res = (f) (fd, iov, iovcnt);
crypto/openssh/atomicio.c
169
atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
crypto/openssh/atomicio.c
172
return atomiciov6(f, fd, _iov, iovcnt, NULL, NULL);
crypto/openssh/atomicio.c
45
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
crypto/openssh/atomicio.c
53
pfd.fd = fd;
crypto/openssh/atomicio.c
60
res = (f) (fd, s + pos, n - pos);
crypto/openssh/atomicio.c
90
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
crypto/openssh/atomicio.c
92
return atomicio6(f, fd, _s, n, NULL, NULL);
crypto/openssh/atomicio.c
99
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
crypto/openssh/atomicio.h
38
atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
crypto/openssh/atomicio.h
48
atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
crypto/openssh/auth-rhosts.c
62
int fd;
crypto/openssh/auth-rhosts.c
66
if ((fd = open(filename, O_RDONLY|O_NONBLOCK)) == -1)
crypto/openssh/auth-rhosts.c
68
if (fstat(fd, &st) == -1) {
crypto/openssh/auth-rhosts.c
69
close(fd);
crypto/openssh/auth-rhosts.c
75
close(fd);
crypto/openssh/auth-rhosts.c
78
unset_nonblock(fd);
crypto/openssh/auth-rhosts.c
79
if ((f = fdopen(fd, "r")) == NULL) {
crypto/openssh/auth-rhosts.c
80
close(fd);
crypto/openssh/auth2-pubkeyfile.c
460
int fd;
crypto/openssh/auth2-pubkeyfile.c
463
if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) {
crypto/openssh/auth2-pubkeyfile.c
474
if (fstat(fd, &st) == -1) {
crypto/openssh/auth2-pubkeyfile.c
475
close(fd);
crypto/openssh/auth2-pubkeyfile.c
481
close(fd);
crypto/openssh/auth2-pubkeyfile.c
484
unset_nonblock(fd);
crypto/openssh/auth2-pubkeyfile.c
485
if ((f = fdopen(fd, "r")) == NULL) {
crypto/openssh/auth2-pubkeyfile.c
486
close(fd);
crypto/openssh/auth2.c
111
int fd;
crypto/openssh/auth2.c
113
if ((fd = open(options.banner, O_RDONLY)) == -1)
crypto/openssh/auth2.c
115
if (fstat(fd, &st) == -1) {
crypto/openssh/auth2.c
116
close(fd);
crypto/openssh/auth2.c
120
close(fd);
crypto/openssh/auth2.c
126
n = atomicio(read, fd, banner, len);
crypto/openssh/auth2.c
127
close(fd);
crypto/openssh/authfile.c
113
int fd, r;
crypto/openssh/authfile.c
120
if ((fd = open(filename, O_RDONLY)) == -1)
crypto/openssh/authfile.c
123
r = sshkey_perm_ok(fd, filename);
crypto/openssh/authfile.c
127
r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp);
crypto/openssh/authfile.c
129
close(fd);
crypto/openssh/authfile.c
142
sshkey_load_private_type_fd(int fd, int type, const char *passphrase,
crypto/openssh/authfile.c
150
if ((r = sshbuf_load_fd(fd, &buffer)) != 0 ||
crypto/openssh/authfile.c
168
int r, fd;
crypto/openssh/authfile.c
173
if ((fd = open(filename, O_RDONLY)) == -1)
crypto/openssh/authfile.c
175
if ((r = sshbuf_load_fd(fd, &buffer)) != 0 ||
crypto/openssh/authfile.c
186
close(fd);
crypto/openssh/authfile.c
491
int fd, oerrno;
crypto/openssh/authfile.c
495
if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
crypto/openssh/authfile.c
497
if ((f = fdopen(fd, "w")) == NULL) {
crypto/openssh/authfile.c
499
close(fd);
crypto/openssh/authfile.c
82
sshkey_perm_ok(int fd, const char *filename)
crypto/openssh/authfile.c
86
if (fstat(fd, &st) == -1)
crypto/openssh/authfile.h
45
int sshkey_load_private_type_fd(int fd, int type, const char *passphrase,
crypto/openssh/canohost.c
136
get_local_name(int fd)
crypto/openssh/canohost.c
141
if ((host = get_socket_address(fd, 0, NI_NAMEREQD)) != NULL)
crypto/openssh/channels.c
2771
pollfd_offset, pfd->fd, pfd->events, pfd->revents);
crypto/openssh/channels.c
2823
pfd[p].fd = c->rfd;
crypto/openssh/channels.c
2837
pfd[p].fd = c->wfd;
crypto/openssh/channels.c
2853
pfd[p].fd = c->efd;
crypto/openssh/channels.c
2869
pfd[p].fd = c->sock;
crypto/openssh/channels.c
2921
fd_ready(Channel *c, int p, struct pollfd *pfds, u_int npfd, int fd,
crypto/openssh/channels.c
2926
if (fd == -1)
crypto/openssh/channels.c
2931
if (pfd->fd != fd) {
crypto/openssh/channels.c
2933
"r%d w%d e%d s%d", c->self, what, fd, p, pfd->fd,
crypto/openssh/channels.c
2938
c->self, what, p, pfd->fd, c->rfd, c->wfd, c->efd, c->sock);
crypto/openssh/channels.c
2961
p, pfd[p].fd, pfd[p].revents);
crypto/openssh/channels.c
577
int ret, fd = *fdp;
crypto/openssh/channels.c
579
if (fd == -1)
crypto/openssh/channels.c
618
ret = close(fd);
crypto/openssh/clientloop.c
1880
int r, fd;
crypto/openssh/clientloop.c
1889
if ((fd = tun_open(local_tun, tun_mode, &ifname)) == -1) {
crypto/openssh/clientloop.c
1895
c = channel_new(ssh, "tun-connection", SSH_CHANNEL_OPENING, fd, fd, -1,
crypto/openssh/clientloop.c
710
(*pfdp)[0].fd = connection_in;
crypto/openssh/clientloop.c
712
(*pfdp)[1].fd = connection_out;
crypto/openssh/hostfile.c
626
int r, fd, oerrno = 0;
crypto/openssh/hostfile.c
657
if ((fd = mkstemp(temp)) == -1) {
crypto/openssh/hostfile.c
663
if ((ctx.out = fdopen(fd, "w")) == NULL) {
crypto/openssh/hostfile.c
665
close(fd);
crypto/openssh/log.c
309
int fd;
crypto/openssh/log.c
319
if ((fd = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0600)) == -1) {
crypto/openssh/log.c
324
log_stderr_fd = fd;
crypto/openssh/loginrec.c
1085
int fd, ret = 1;
crypto/openssh/loginrec.c
1087
if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
crypto/openssh/loginrec.c
1092
if (fstat(fd, &buf) == 0)
crypto/openssh/loginrec.c
1093
if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
crypto/openssh/loginrec.c
1094
ftruncate(fd, buf.st_size);
crypto/openssh/loginrec.c
1099
close(fd);
crypto/openssh/loginrec.c
1176
int fd, found = 0;
crypto/openssh/loginrec.c
1181
if ((fd = open(WTMP_FILE, O_RDONLY)) < 0) {
crypto/openssh/loginrec.c
1186
if (fstat(fd, &st) != 0) {
crypto/openssh/loginrec.c
1189
close(fd);
crypto/openssh/loginrec.c
1194
if (lseek(fd, -(off_t)sizeof(struct utmp), SEEK_END) == -1) {
crypto/openssh/loginrec.c
1196
close(fd);
crypto/openssh/loginrec.c
1201
if (atomicio(read, fd, &ut, sizeof(ut)) != sizeof(ut)) {
crypto/openssh/loginrec.c
1204
close (fd);
crypto/openssh/loginrec.c
1229
if (lseek(fd, -(off_t)(2 * sizeof(struct utmp)), SEEK_CUR) == -1) {
crypto/openssh/loginrec.c
1231
close(fd);
crypto/openssh/loginrec.c
1237
close(fd);
crypto/openssh/loginrec.c
1257
int fd, ret = 1;
crypto/openssh/loginrec.c
1259
if ((fd = open(WTMPX_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
crypto/openssh/loginrec.c
1265
if (fstat(fd, &buf) == 0)
crypto/openssh/loginrec.c
1266
if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
crypto/openssh/loginrec.c
1267
ftruncate(fd, buf.st_size);
crypto/openssh/loginrec.c
1272
close(fd);
crypto/openssh/loginrec.c
1341
int fd, found=0;
crypto/openssh/loginrec.c
1346
if ((fd = open(WTMPX_FILE, O_RDONLY)) < 0) {
crypto/openssh/loginrec.c
1351
if (fstat(fd, &st) != 0) {
crypto/openssh/loginrec.c
1354
close(fd);
crypto/openssh/loginrec.c
1359
if (lseek(fd, -(off_t)sizeof(struct utmpx), SEEK_END) == -1 ) {
crypto/openssh/loginrec.c
1361
close(fd);
crypto/openssh/loginrec.c
1366
if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) {
crypto/openssh/loginrec.c
1369
close (fd);
crypto/openssh/loginrec.c
1390
if (lseek(fd, -(off_t)(2 * sizeof(struct utmpx)), SEEK_CUR) == -1) {
crypto/openssh/loginrec.c
1391
close(fd);
crypto/openssh/loginrec.c
1396
close(fd);
crypto/openssh/loginrec.c
1525
lastlog_openseek(struct logininfo *li, int *fd, int filemode)
crypto/openssh/loginrec.c
1547
*fd = open(lastlog_file, filemode, 0600);
crypto/openssh/loginrec.c
1548
if (*fd < 0) {
crypto/openssh/loginrec.c
1558
if (lseek(*fd, offset, SEEK_SET) != offset) {
crypto/openssh/loginrec.c
1561
close(*fd);
crypto/openssh/loginrec.c
1587
int fd;
crypto/openssh/loginrec.c
1598
if (!lastlog_openseek(li, &fd, O_RDWR|O_CREAT))
crypto/openssh/loginrec.c
1602
if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
crypto/openssh/loginrec.c
1603
close(fd);
crypto/openssh/loginrec.c
1609
close(fd);
crypto/openssh/loginrec.c
1640
int fd, ret;
crypto/openssh/loginrec.c
1642
if (!lastlog_openseek(li, &fd, O_RDONLY))
crypto/openssh/loginrec.c
1645
ret = atomicio(read, fd, &last, sizeof(last));
crypto/openssh/loginrec.c
1646
close(fd);
crypto/openssh/loginrec.c
1711
int fd;
crypto/openssh/loginrec.c
1720
if ((fd = open(_PATH_BTMP, O_WRONLY | O_APPEND)) < 0) {
crypto/openssh/loginrec.c
1725
if (fstat(fd, &fst) < 0) {
crypto/openssh/loginrec.c
1751
if (atomicio(vwrite, fd, &ut, sizeof(ut)) != sizeof(ut)) {
crypto/openssh/loginrec.c
1756
close(fd);
crypto/openssh/loginrec.c
835
register int fd;
crypto/openssh/loginrec.c
862
if (tty > 0 && (fd = open(UTMP_FILE, O_RDWR|O_CREAT, 0644)) >= 0) {
crypto/openssh/loginrec.c
866
if ((ret = lseek(fd, pos, SEEK_SET)) == -1) {
crypto/openssh/loginrec.c
868
close(fd);
crypto/openssh/loginrec.c
874
close(fd);
crypto/openssh/loginrec.c
882
if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) &&
crypto/openssh/loginrec.c
888
if ((ret = lseek(fd, pos, SEEK_SET)) == -1) {
crypto/openssh/loginrec.c
890
close(fd);
crypto/openssh/loginrec.c
896
close(fd);
crypto/openssh/loginrec.c
899
if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
crypto/openssh/loginrec.c
902
close(fd);
crypto/openssh/loginrec.c
906
close(fd);
crypto/openssh/misc-agent.c
228
int fd, r;
crypto/openssh/misc-agent.c
240
if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) {
crypto/openssh/misc-agent.c
244
set_nonblock(fd);
crypto/openssh/misc-agent.c
246
if (connect(fd, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) == -1) {
crypto/openssh/misc-agent.c
248
close(fd);
crypto/openssh/misc-agent.c
251
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &r, &l) == -1) {
crypto/openssh/misc-agent.c
253
close(fd);
crypto/openssh/misc-agent.c
258
close(fd);
crypto/openssh/misc-agent.c
261
close(fd);
crypto/openssh/misc.c
1524
int fd = -1, sock;
crypto/openssh/misc.c
153
set_nonblock(int fd)
crypto/openssh/misc.c
1536
fd = open(name, O_RDWR);
crypto/openssh/misc.c
1541
if ((fd = open(name, O_RDWR)) >= 0)
crypto/openssh/misc.c
1549
if (fd == -1) {
crypto/openssh/misc.c
1554
debug_f("%s mode %d fd %d", name, mode, fd);
crypto/openssh/misc.c
157
val = fcntl(fd, F_GETFL);
crypto/openssh/misc.c
1580
return fd;
crypto/openssh/misc.c
1583
if (fd >= 0)
crypto/openssh/misc.c
1584
close(fd);
crypto/openssh/misc.c
159
error("fcntl(%d, F_GETFL): %s", fd, strerror(errno));
crypto/openssh/misc.c
163
debug3("fd %d is O_NONBLOCK", fd);
crypto/openssh/misc.c
166
debug2("fd %d setting O_NONBLOCK", fd);
crypto/openssh/misc.c
168
if (fcntl(fd, F_SETFL, val) == -1) {
crypto/openssh/misc.c
169
debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd,
crypto/openssh/misc.c
177
unset_nonblock(int fd)
crypto/openssh/misc.c
181
val = fcntl(fd, F_GETFL);
crypto/openssh/misc.c
183
error("fcntl(%d, F_GETFL): %s", fd, strerror(errno));
crypto/openssh/misc.c
187
debug3("fd %d is not O_NONBLOCK", fd);
crypto/openssh/misc.c
190
debug("fd %d clearing O_NONBLOCK", fd);
crypto/openssh/misc.c
192
if (fcntl(fd, F_SETFL, val) == -1) {
crypto/openssh/misc.c
194
fd, strerror(errno));
crypto/openssh/misc.c
210
set_nodelay(int fd)
crypto/openssh/misc.c
2110
int fd;
crypto/openssh/misc.c
2112
if ((fd = open(_PATH_TTY, O_RDONLY | O_NOCTTY)) >= 0) {
crypto/openssh/misc.c
2113
close(fd);
crypto/openssh/misc.c
216
if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
crypto/openssh/misc.c
221
debug2("fd %d is TCP_NODELAY", fd);
crypto/openssh/misc.c
225
debug2("fd %d setting TCP_NODELAY", fd);
crypto/openssh/misc.c
226
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1)
crypto/openssh/misc.c
232
set_reuseaddr(int fd)
crypto/openssh/misc.c
236
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
crypto/openssh/misc.c
237
error("setsockopt SO_REUSEADDR fd %d: %s", fd, strerror(errno));
crypto/openssh/misc.c
2388
safe_path_fd(int fd, const char *file, struct passwd *pw,
crypto/openssh/misc.c
2394
if (fstat(fd, &st) == -1) {
crypto/openssh/misc.c
245
get_rdomain(int fd)
crypto/openssh/misc.c
248
return sys_get_rdomain(fd);
crypto/openssh/misc.c
254
if (getsockopt(fd, SOL_SOCKET, SO_RTABLE, &rtable, &len) == -1) {
crypto/openssh/misc.c
256
fd, strerror(errno));
crypto/openssh/misc.c
267
set_rdomain(int fd, const char *name)
crypto/openssh/misc.c
270
return sys_set_rdomain(fd, name);
crypto/openssh/misc.c
2837
int fd, devnull, p[2], i;
crypto/openssh/misc.c
284
if (setsockopt(fd, SOL_SOCKET, SO_RTABLE,
crypto/openssh/misc.c
287
rtable, fd, strerror(errno));
crypto/openssh/misc.c
2933
fd = -1;
crypto/openssh/misc.c
2935
fd = p[1];
crypto/openssh/misc.c
2937
fd = devnull;
crypto/openssh/misc.c
2938
if (fd != -1 && dup2(fd, STDOUT_FILENO) == -1) {
crypto/openssh/misc.c
298
get_sock_af(int fd)
crypto/openssh/misc.c
304
if (getsockname(fd, (struct sockaddr *)&to, &tolen) == -1)
crypto/openssh/misc.c
315
set_sock_tos(int fd, int tos)
crypto/openssh/misc.c
3156
int fd, ret = -1;
crypto/openssh/misc.c
3162
if ((fd = open(path, O_RDONLY)) < 0) {
crypto/openssh/misc.c
3166
if (fstat(fd, &st) != 0) {
crypto/openssh/misc.c
3181
if ((m = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED ||
crypto/openssh/misc.c
3195
close(fd);
crypto/openssh/misc.c
324
switch ((af = get_sock_af(fd))) {
crypto/openssh/misc.c
330
debug3_f("set socket %d IP_TOS 0x%02x", fd, tos);
crypto/openssh/misc.c
331
if (setsockopt(fd, IPPROTO_IP, IP_TOS,
crypto/openssh/misc.c
334
fd, tos, strerror(errno));
crypto/openssh/misc.c
340
debug3_f("set socket %d IPV6_TCLASS 0x%02x", fd, tos);
crypto/openssh/misc.c
341
if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS,
crypto/openssh/misc.c
344
fd, tos, strerror(errno));
crypto/openssh/misc.c
361
waitfd(int fd, int *timeoutp, short events, volatile sig_atomic_t *stop)
crypto/openssh/misc.c
370
pfd.fd = fd;
crypto/openssh/misc.c
412
waitrfd(int fd, int *timeoutp, volatile sig_atomic_t *stop) {
crypto/openssh/misc.c
413
return waitfd(fd, timeoutp, POLLIN, stop);
crypto/openssh/monitor.c
515
pfd[0].fd = pmonitor->m_sendfd;
crypto/openssh/monitor.c
517
pfd[1].fd = pmonitor->m_log_recvfd;
crypto/openssh/monitor.c
518
pfd[1].events = pfd[1].fd == -1 ? 0 : POLLIN;
crypto/openssh/monitor.c
519
if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, -1) == -1) {
crypto/openssh/monitor_fdpass.c
117
int fd;
crypto/openssh/monitor_fdpass.c
126
msg.msg_accrights = (caddr_t)&fd;
crypto/openssh/monitor_fdpass.c
127
msg.msg_accrightslen = sizeof(fd);
crypto/openssh/monitor_fdpass.c
134
pfd.fd = sock;
crypto/openssh/monitor_fdpass.c
152
if (msg.msg_accrightslen != sizeof(fd)) {
crypto/openssh/monitor_fdpass.c
169
fd = (*(int *)CMSG_DATA(cmsg));
crypto/openssh/monitor_fdpass.c
171
return fd;
crypto/openssh/monitor_fdpass.c
43
mm_send_fd(int sock, int fd)
crypto/openssh/monitor_fdpass.c
61
msg.msg_accrights = (caddr_t)&fd;
crypto/openssh/monitor_fdpass.c
62
msg.msg_accrightslen = sizeof(fd);
crypto/openssh/monitor_fdpass.c
71
*(int *)CMSG_DATA(cmsg) = fd;
crypto/openssh/monitor_fdpass.c
79
pfd.fd = sock;
crypto/openssh/monitor_fdpass.c
83
debug3_f("sendmsg(%d): %s", fd, strerror(errno));
crypto/openssh/monitor_fdpass.c
87
error_f("sendmsg(%d): %s", fd, strerror(errno));
crypto/openssh/msg.c
42
ssh_msg_send(int fd, u_char type, struct sshbuf *m)
crypto/openssh/msg.c
51
if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
crypto/openssh/msg.c
55
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) {
crypto/openssh/msg.c
64
ssh_msg_recv(int fd, struct sshbuf *m)
crypto/openssh/msg.c
72
if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) {
crypto/openssh/msg.c
87
if (atomicio(read, fd, p, msg_len) != msg_len) {
crypto/openssh/mux.c
1506
mux_client_read(int fd, struct sshbuf *b, size_t need, int timeout_ms)
crypto/openssh/mux.c
1520
len = read(fd, p + have, need - have);
crypto/openssh/mux.c
1527
if (waitrfd(fd, &timeout_ms,
crypto/openssh/mux.c
1548
mux_client_write_packet(int fd, struct sshbuf *m)
crypto/openssh/mux.c
1556
pfd.fd = fd;
crypto/openssh/mux.c
1572
len = write(fd, ptr + have, need - have);
crypto/openssh/mux.c
1602
mux_client_read_packet_timeout(int fd, struct sshbuf *m, int timeout_ms)
crypto/openssh/mux.c
1611
if (mux_client_read(fd, queue, 4, timeout_ms) != 0) {
crypto/openssh/mux.c
1620
if (mux_client_read(fd, queue, need, timeout_ms) != 0) {
crypto/openssh/mux.c
1635
mux_client_read_packet(int fd, struct sshbuf *m)
crypto/openssh/mux.c
1637
return mux_client_read_packet_timeout(fd, m, -1);
crypto/openssh/mux.c
1641
mux_client_hello_exchange(int fd, int timeout_ms)
crypto/openssh/mux.c
1654
if (mux_client_write_packet(fd, m) != 0) {
crypto/openssh/mux.c
1662
if (mux_client_read_packet_timeout(fd, m, timeout_ms) != 0) {
crypto/openssh/mux.c
1707
mux_client_request_alive(int fd)
crypto/openssh/mux.c
1722
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
1728
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
1758
mux_client_request_info(int fd, const char *name)
crypto/openssh/mux.c
1774
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
1780
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
1809
mux_client_request_terminate(int fd)
crypto/openssh/mux.c
1824
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
1830
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
1864
mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd)
crypto/openssh/mux.c
1905
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
1911
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
1960
mux_client_forwards(int fd, int cancel_flag)
crypto/openssh/mux.c
1970
if (mux_client_forward(fd, cancel_flag,
crypto/openssh/mux.c
1977
if (mux_client_forward(fd, cancel_flag, MUX_FWD_REMOTE,
crypto/openssh/mux.c
1985
mux_client_request_session(int fd)
crypto/openssh/mux.c
1996
if ((muxserver_pid = mux_client_request_alive(fd)) == 0) {
crypto/openssh/mux.c
2042
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
2046
if (mm_send_fd(fd, STDIN_FILENO) == -1 ||
crypto/openssh/mux.c
2047
mm_send_fd(fd, STDOUT_FILENO) == -1 ||
crypto/openssh/mux.c
2048
mm_send_fd(fd, STDERR_FILENO) == -1)
crypto/openssh/mux.c
2055
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
2121
if (mux_client_read_packet(fd, m) != 0)
crypto/openssh/mux.c
2155
close(fd);
crypto/openssh/mux.c
2175
mux_client_proxy(int fd)
crypto/openssh/mux.c
2187
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
2193
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
2216
mux_client_request_stdio_fwd(int fd)
crypto/openssh/mux.c
2225
if ((muxserver_pid = mux_client_request_alive(fd)) == 0) {
crypto/openssh/mux.c
2244
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
2248
if (mm_send_fd(fd, STDIN_FILENO) == -1 ||
crypto/openssh/mux.c
2249
mm_send_fd(fd, STDOUT_FILENO) == -1)
crypto/openssh/mux.c
2261
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
2305
if (mux_client_read_packet(fd, m) != 0) {
crypto/openssh/mux.c
2317
mux_client_request_stop_listening(int fd)
crypto/openssh/mux.c
2332
if (mux_client_write_packet(fd, m) != 0)
crypto/openssh/mux.c
2338
if (mux_client_read_packet(fd, m) != 0)
crypto/openssh/openbsd-compat/bsd-closefrom.c
125
long fd;
crypto/openssh/openbsd-compat/bsd-closefrom.c
140
fd = strtol(dent->d_name, &endp, 10);
crypto/openssh/openbsd-compat/bsd-closefrom.c
142
fd >= 0 && fd < INT_MAX && fd >= lowfd && fd != dirfd(dirp))
crypto/openssh/openbsd-compat/bsd-closefrom.c
143
(void) close((int) fd);
crypto/openssh/openbsd-compat/bsd-closefrom.c
66
long fd, maxfd;
crypto/openssh/openbsd-compat/bsd-closefrom.c
81
for (fd = lowfd; fd < maxfd; fd++)
crypto/openssh/openbsd-compat/bsd-closefrom.c
82
(void) close((int) fd);
crypto/openssh/openbsd-compat/bsd-flock.c
44
flock(int fd, int op)
crypto/openssh/openbsd-compat/bsd-flock.c
70
rc = fcntl(fd, op & LOCK_NB ? F_SETLK : F_SETLKW, &fl);
crypto/openssh/openbsd-compat/bsd-getentropy.c
49
int fd, save_errno;
crypto/openssh/openbsd-compat/bsd-getentropy.c
66
if ((fd = open(SSH_RANDOM_DEV, O_RDONLY)) == -1) {
crypto/openssh/openbsd-compat/bsd-getentropy.c
75
r = read(fd, (u_char *)s + o, len - o);
crypto/openssh/openbsd-compat/bsd-getentropy.c
84
close(fd);
crypto/openssh/openbsd-compat/bsd-misc.c
127
utimensat(int fd, const char *path, const struct timespec times[2],
crypto/openssh/openbsd-compat/bsd-misc.c
140
if (fd != AT_FDCWD) {
crypto/openssh/openbsd-compat/bsd-misc.c
151
if ((fd = open(path, oflags)) == -1)
crypto/openssh/openbsd-compat/bsd-misc.c
153
ret = futimes(fd, tv);
crypto/openssh/openbsd-compat/bsd-misc.c
154
close(fd);
crypto/openssh/openbsd-compat/bsd-misc.c
176
fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag)
crypto/openssh/openbsd-compat/bsd-misc.c
180
if (fd != AT_FDCWD) {
crypto/openssh/openbsd-compat/bsd-misc.c
191
if ((fd = open(path, oflags)) == -1)
crypto/openssh/openbsd-compat/bsd-misc.c
193
ret = fchown(fd, owner, group);
crypto/openssh/openbsd-compat/bsd-misc.c
194
close(fd);
crypto/openssh/openbsd-compat/bsd-misc.c
207
fchmodat(int fd, const char *path, mode_t mode, int flag)
crypto/openssh/openbsd-compat/bsd-misc.c
211
if (fd != AT_FDCWD) {
crypto/openssh/openbsd-compat/bsd-misc.c
222
if ((fd = open(path, oflags)) == -1)
crypto/openssh/openbsd-compat/bsd-misc.c
224
ret = fchmod(fd, mode);
crypto/openssh/openbsd-compat/bsd-misc.c
225
close(fd);
crypto/openssh/openbsd-compat/bsd-misc.c
274
int fd, ret, saverrno;
crypto/openssh/openbsd-compat/bsd-misc.c
276
fd = open(path, O_WRONLY);
crypto/openssh/openbsd-compat/bsd-misc.c
277
if (fd < 0)
crypto/openssh/openbsd-compat/bsd-misc.c
280
ret = ftruncate(fd, length);
crypto/openssh/openbsd-compat/bsd-misc.c
282
close(fd);
crypto/openssh/openbsd-compat/bsd-misc.c
334
tcgetpgrp(int fd)
crypto/openssh/openbsd-compat/bsd-misc.c
338
if (ioctl(fd, TIOCGPGRP, &ctty_pgrp) == -1)
crypto/openssh/openbsd-compat/bsd-misc.c
347
tcsendbreak(int fd, int duration)
crypto/openssh/openbsd-compat/bsd-misc.c
354
if (ioctl(fd, TIOCSBRK, 0) == -1)
crypto/openssh/openbsd-compat/bsd-misc.c
357
if (ioctl(fd, TIOCCBRK, 0) == -1)
crypto/openssh/openbsd-compat/bsd-nextstep.c
47
tcgetattr(int fd, struct termios *t)
crypto/openssh/openbsd-compat/bsd-nextstep.c
49
return (ioctl(fd, TIOCGETA, t));
crypto/openssh/openbsd-compat/bsd-nextstep.c
53
tcsetattr(int fd, int opt, const struct termios *t)
crypto/openssh/openbsd-compat/bsd-nextstep.c
64
return (ioctl(fd, TIOCSETA, t));
crypto/openssh/openbsd-compat/bsd-nextstep.c
66
return (ioctl(fd, TIOCSETAW, t));
crypto/openssh/openbsd-compat/bsd-nextstep.c
68
return (ioctl(fd, TIOCSETAF, t));
crypto/openssh/openbsd-compat/bsd-nextstep.c
75
int tcsetpgrp(int fd, pid_t pgrp)
crypto/openssh/openbsd-compat/bsd-nextstep.c
77
return (ioctl(fd, TIOCSPGRP, &pgrp));
crypto/openssh/openbsd-compat/bsd-openpty.c
162
int r, fd;
crypto/openssh/openbsd-compat/bsd-openpty.c
166
if (junk_ptyfd == -1 && (fd = open(_PATH_TTY, O_RDWR|O_NOCTTY)) >= 0) {
crypto/openssh/openbsd-compat/bsd-openpty.c
167
close(fd);
crypto/openssh/openbsd-compat/bsd-poll.c
50
int ret, fd, maxfd = 0;
crypto/openssh/openbsd-compat/bsd-poll.c
54
fd = fds[i].fd;
crypto/openssh/openbsd-compat/bsd-poll.c
55
if (fd != -1 && fd >= FD_SETSIZE) {
crypto/openssh/openbsd-compat/bsd-poll.c
59
maxfd = MAX(maxfd, fd);
crypto/openssh/openbsd-compat/bsd-poll.c
67
fd = fds[i].fd;
crypto/openssh/openbsd-compat/bsd-poll.c
68
if (fd == -1)
crypto/openssh/openbsd-compat/bsd-poll.c
71
FD_SET(fd, &readfds);
crypto/openssh/openbsd-compat/bsd-poll.c
73
FD_SET(fd, &writefds);
crypto/openssh/openbsd-compat/bsd-poll.c
75
FD_SET(fd, &exceptfds);
crypto/openssh/openbsd-compat/bsd-poll.c
82
fd = fds[i].fd;
crypto/openssh/openbsd-compat/bsd-poll.c
84
if (fd == -1)
crypto/openssh/openbsd-compat/bsd-poll.c
86
if ((fds[i].events & POLLIN) && FD_ISSET(fd, &readfds))
crypto/openssh/openbsd-compat/bsd-poll.c
88
if ((fds[i].events & POLLOUT) && FD_ISSET(fd, &writefds))
crypto/openssh/openbsd-compat/bsd-poll.c
90
if ((fds[i].events & POLLPRI) && FD_ISSET(fd, &exceptfds))
crypto/openssh/openbsd-compat/bsd-poll.h
38
int fd;
crypto/openssh/openbsd-compat/bsd-pselect.c
58
pselect_set_nonblock(int fd)
crypto/openssh/openbsd-compat/bsd-pselect.c
62
if ((val = fcntl(fd, F_GETFL)) == -1 ||
crypto/openssh/openbsd-compat/bsd-pselect.c
63
fcntl(fd, F_SETFL, val|O_NONBLOCK) == -1)
crypto/openssh/openbsd-compat/bsd-statvfs.c
76
int fstatvfs(int fd, struct statvfs *buf)
crypto/openssh/openbsd-compat/bsd-statvfs.c
82
if (fstatfs(fd, &fs) == -1)
crypto/openssh/openbsd-compat/daemon.c
52
int fd;
crypto/openssh/openbsd-compat/daemon.c
69
if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
crypto/openssh/openbsd-compat/daemon.c
70
(void)dup2(fd, STDIN_FILENO);
crypto/openssh/openbsd-compat/daemon.c
71
(void)dup2(fd, STDOUT_FILENO);
crypto/openssh/openbsd-compat/daemon.c
72
(void)dup2(fd, STDERR_FILENO);
crypto/openssh/openbsd-compat/daemon.c
73
if (fd > 2)
crypto/openssh/openbsd-compat/daemon.c
74
(void)close (fd);
crypto/openssh/openbsd-compat/mktemp.c
105
fd = open(path, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR);
crypto/openssh/openbsd-compat/mktemp.c
106
if (fd != -1 || errno != EEXIST)
crypto/openssh/openbsd-compat/mktemp.c
107
return(fd);
crypto/openssh/openbsd-compat/mktemp.c
77
int fd;
crypto/openssh/openbsd-compat/port-linux.c
347
int fd = -1;
crypto/openssh/openbsd-compat/port-linux.c
378
if ((fd = socket(PF_UNIX, SOCK_DGRAM, 0)) == -1) {
crypto/openssh/openbsd-compat/port-linux.c
382
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
crypto/openssh/openbsd-compat/port-linux.c
386
if (write(fd, s, strlen(s)) != (ssize_t)strlen(s)) {
crypto/openssh/openbsd-compat/port-linux.c
392
if (fd != -1)
crypto/openssh/openbsd-compat/port-linux.c
393
close(fd);
crypto/openssh/openbsd-compat/port-net.c
100
sys_get_rdomain(int fd)
crypto/openssh/openbsd-compat/port-net.c
106
sys_set_rdomain(int fd, const char *name)
crypto/openssh/openbsd-compat/port-net.c
147
int fd = -1;
crypto/openssh/openbsd-compat/port-net.c
152
if ((fd = open(TUN_CTRL_DEV, O_RDWR)) == -1) {
crypto/openssh/openbsd-compat/port-net.c
178
if (ioctl(fd, TUNSETIFF, &ifr) == -1) {
crypto/openssh/openbsd-compat/port-net.c
185
debug("%s: tunnel mode %d fd %d", __func__, mode, fd);
crypto/openssh/openbsd-compat/port-net.c
187
debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd);
crypto/openssh/openbsd-compat/port-net.c
192
return (fd);
crypto/openssh/openbsd-compat/port-net.c
195
close(fd);
crypto/openssh/openbsd-compat/port-net.c
213
int fd = -1, sock;
crypto/openssh/openbsd-compat/port-net.c
234
fd = open(name, O_RDWR);
crypto/openssh/openbsd-compat/port-net.c
239
if ((fd = open(name, O_RDWR)) >= 0)
crypto/openssh/openbsd-compat/port-net.c
247
if (fd < 0) {
crypto/openssh/openbsd-compat/port-net.c
257
ioctl(fd, TUNSIFHEAD, &flag) == -1) {
crypto/openssh/openbsd-compat/port-net.c
258
debug("%s: ioctl(%d, TUNSIFHEAD, 1): %s", __func__, fd,
crypto/openssh/openbsd-compat/port-net.c
260
close(fd);
crypto/openssh/openbsd-compat/port-net.c
264
debug("%s: %s mode %d fd %d", __func__, name, mode, fd);
crypto/openssh/openbsd-compat/port-net.c
283
return (fd);
crypto/openssh/openbsd-compat/port-net.c
286
if (fd >= 0)
crypto/openssh/openbsd-compat/port-net.c
287
close(fd);
crypto/openssh/openbsd-compat/port-net.c
51
sys_get_rdomain(int fd)
crypto/openssh/openbsd-compat/port-net.c
56
if (getsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, dev, &len) == -1) {
crypto/openssh/openbsd-compat/port-net.c
58
__func__, fd, strerror(errno));
crypto/openssh/openbsd-compat/port-net.c
66
sys_set_rdomain(int fd, const char *name)
crypto/openssh/openbsd-compat/port-net.c
68
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
crypto/openssh/openbsd-compat/port-net.c
71
__func__, fd, name, strerror(errno));
crypto/openssh/openbsd-compat/port-net.c
80
int fd;
crypto/openssh/openbsd-compat/port-net.c
87
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
crypto/openssh/openbsd-compat/port-net.c
89
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
crypto/openssh/openbsd-compat/port-net.c
91
close(fd);
crypto/openssh/openbsd-compat/port-net.c
94
close(fd);
crypto/openssh/openbsd-compat/port-net.h
38
char *sys_get_rdomain(int fd);
crypto/openssh/openbsd-compat/port-net.h
39
int sys_set_rdomain(int fd, const char *name);
crypto/openssh/openbsd-compat/port-prngd.c
102
if (connect(fd, (struct sockaddr*)&addr, addr_len) == -1) {
crypto/openssh/openbsd-compat/port-prngd.c
117
if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) {
crypto/openssh/openbsd-compat/port-prngd.c
119
close(fd);
crypto/openssh/openbsd-compat/port-prngd.c
128
if (atomicio(read, fd, buf, len) != (size_t)len) {
crypto/openssh/openbsd-compat/port-prngd.c
130
close(fd);
crypto/openssh/openbsd-compat/port-prngd.c
142
if (fd != -1)
crypto/openssh/openbsd-compat/port-prngd.c
143
close(fd);
crypto/openssh/openbsd-compat/port-prngd.c
60
int fd, addr_len, rval, errors;
crypto/openssh/openbsd-compat/port-prngd.c
96
fd = socket(addr.ss_family, SOCK_STREAM, 0);
crypto/openssh/openbsd-compat/port-prngd.c
97
if (fd == -1) {
crypto/openssh/openbsd-compat/port-uw.c
101
if ((fd = fopen (password_file, "r")) == NULL) {
crypto/openssh/openbsd-compat/port-uw.c
115
while (ent = fgetpwent(fd)) {
crypto/openssh/openbsd-compat/port-uw.c
118
fclose (fd);
crypto/openssh/openbsd-compat/port-uw.c
123
fclose (fd);
crypto/openssh/openbsd-compat/port-uw.c
98
FILE *fd;
crypto/openssh/openbsd-compat/regress/utimensattest.c
63
int fd;
crypto/openssh/openbsd-compat/regress/utimensattest.c
68
if ((fd = open(TMPFILE, O_CREAT, 0600)) == -1)
crypto/openssh/openbsd-compat/regress/utimensattest.c
70
close(fd);
crypto/openssh/packet.c
1523
pfd.fd = state->connection_in;
crypto/openssh/packet.c
1991
ssh_packet_process_read(struct ssh *ssh, int fd)
crypto/openssh/packet.c
1997
if ((r = sshbuf_read(fd, state->input, PACKET_MAX_SIZE, &rlen)) != 0)
crypto/openssh/packet.c
2217
pfd.fd = state->connection_out;
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
12
int fd;
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
137
int fd;
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
14
if ((fd = open("/dev/null", O_RDWR)) == -1) {
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
140
if ((fd = dup(devnull)) == -1) {
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
144
new_socket(AUTH_CONNECTION, fd);
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
146
assert(sockets[0].fd == fd);
crypto/openssh/regress/misc/fuzz-harness/agent_fuzz_helper.c
18
return fd;
crypto/openssh/regress/netcat.c
1038
pfd.fd = STDOUT_FILENO;
crypto/openssh/regress/netcat.c
1432
proxy_read_line(int fd, char *buf, size_t bufsz)
crypto/openssh/regress/netcat.c
1439
if (atomicio(read, fd, buf + off, 1) != 1)
crypto/openssh/regress/netcat.c
685
pfd.fd = s;
crypto/openssh/regress/netcat.c
795
pfd[POLL_STDIN].fd = stdin_fd;
crypto/openssh/regress/netcat.c
799
pfd[POLL_NETOUT].fd = net_fd;
crypto/openssh/regress/netcat.c
803
pfd[POLL_NETIN].fd = net_fd;
crypto/openssh/regress/netcat.c
807
pfd[POLL_STDOUT].fd = stdout_fd;
crypto/openssh/regress/netcat.c
812
if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1
crypto/openssh/regress/netcat.c
818
if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) {
crypto/openssh/regress/netcat.c
823
if (lflag && pfd[POLL_NETIN].fd == -1
crypto/openssh/regress/netcat.c
851
pfd[n].fd = -1;
crypto/openssh/regress/netcat.c
858
pfd[POLL_STDIN].fd = -1;
crypto/openssh/regress/netcat.c
863
pfd[POLL_NETIN].fd = -1;
crypto/openssh/regress/netcat.c
867
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
crypto/openssh/regress/netcat.c
868
pfd[POLL_NETOUT].fd = -1;
crypto/openssh/regress/netcat.c
872
pfd[POLL_STDOUT].fd = -1;
crypto/openssh/regress/netcat.c
874
if (pfd[POLL_NETOUT].fd == -1)
crypto/openssh/regress/netcat.c
875
pfd[POLL_STDIN].fd = -1;
crypto/openssh/regress/netcat.c
877
if (pfd[POLL_STDOUT].fd == -1) {
crypto/openssh/regress/netcat.c
878
if (pfd[POLL_NETIN].fd != -1)
crypto/openssh/regress/netcat.c
879
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
crypto/openssh/regress/netcat.c
880
pfd[POLL_NETIN].fd = -1;
crypto/openssh/regress/netcat.c
885
ret = fillbuf(pfd[POLL_STDIN].fd, stdinbuf,
crypto/openssh/regress/netcat.c
889
pfd[POLL_STDIN].fd = -1;
crypto/openssh/regress/netcat.c
899
ret = drainbuf(pfd[POLL_NETOUT].fd, stdinbuf,
crypto/openssh/regress/netcat.c
902
pfd[POLL_NETOUT].fd = -1;
crypto/openssh/regress/netcat.c
912
ret = fillbuf(pfd[POLL_NETIN].fd, netinbuf,
crypto/openssh/regress/netcat.c
915
pfd[POLL_NETIN].fd = -1;
crypto/openssh/regress/netcat.c
918
shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
crypto/openssh/regress/netcat.c
919
pfd[POLL_NETIN].fd = -1;
crypto/openssh/regress/netcat.c
929
atelnet(pfd[POLL_NETIN].fd, netinbuf,
crypto/openssh/regress/netcat.c
934
ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf,
crypto/openssh/regress/netcat.c
937
pfd[POLL_STDOUT].fd = -1;
crypto/openssh/regress/netcat.c
947
if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) {
crypto/openssh/regress/netcat.c
948
if (pfd[POLL_NETOUT].fd != -1 && Nflag)
crypto/openssh/regress/netcat.c
949
shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
crypto/openssh/regress/netcat.c
950
pfd[POLL_NETOUT].fd = -1;
crypto/openssh/regress/netcat.c
953
if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) {
crypto/openssh/regress/netcat.c
954
pfd[POLL_STDOUT].fd = -1;
crypto/openssh/regress/netcat.c
960
drainbuf(int fd, unsigned char *buf, size_t *bufpos)
crypto/openssh/regress/netcat.c
965
n = write(fd, buf, *bufpos);
crypto/openssh/regress/netcat.c
981
fillbuf(int fd, unsigned char *buf, size_t *bufpos)
crypto/openssh/regress/netcat.c
986
n = read(fd, buf + *bufpos, num);
crypto/openssh/scp.c
1388
int fd = -1, haderr, indx;
crypto/openssh/scp.c
1398
if ((fd = open(name, O_RDONLY|O_NONBLOCK)) == -1)
crypto/openssh/scp.c
1404
if (fstat(fd, &stb) == -1) {
crypto/openssh/scp.c
1412
unset_nonblock(fd);
crypto/openssh/scp.c
1444
if ((bp = allocbuf(&buffer, fd, COPY_BUFLEN)) == NULL) {
crypto/openssh/scp.c
1445
next: if (fd != -1) {
crypto/openssh/scp.c
1446
(void) close(fd);
crypto/openssh/scp.c
1447
fd = -1;
crypto/openssh/scp.c
1459
if ((nr = atomicio(read, fd,
crypto/openssh/scp.c
1477
if (fd != -1) {
crypto/openssh/scp.c
1478
if (close(fd) == -1 && !haderr)
crypto/openssh/scp.c
1480
fd = -1;
crypto/openssh/scp.c
2227
allocbuf(BUF *bp, int fd, int blksize)
crypto/openssh/scp.c
2233
if (fstat(fd, &stb) == -1) {
crypto/openssh/scp.c
716
do_times(int fd, int verb, const struct stat *sb)
crypto/openssh/scp.c
729
(void) atomicio(vwrite, fd, buf, strlen(buf));
crypto/openssh/serverloop.c
213
(*pfdp)[0].fd = connection_in;
crypto/openssh/serverloop.c
215
(*pfdp)[1].fd = connection_out;
crypto/openssh/session.c
241
int fd = -1, success = 0;
crypto/openssh/session.c
248
if ((fd = mkstemp(auth_info_file)) == -1) {
crypto/openssh/session.c
252
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(info),
crypto/openssh/session.c
257
if (close(fd) != 0) {
crypto/openssh/session.c
264
if (fd != -1)
crypto/openssh/session.c
265
close(fd);
crypto/openssh/sftp-client.c
2399
pfd.fd = to->fd_in;
crypto/openssh/sftp-server.c
1029
int handle, fd, r;
crypto/openssh/sftp-server.c
1037
fd = handle_to_fd(handle);
crypto/openssh/sftp-server.c
1038
if (fd < 0)
crypto/openssh/sftp-server.c
1046
r = ftruncate(fd, a.size);
crypto/openssh/sftp-server.c
1053
r = fchmod(fd, a.perm & 07777);
crypto/openssh/sftp-server.c
1068
r = futimes(fd, attrib_to_tv(&a));
crypto/openssh/sftp-server.c
1079
r = fchown(fd, a.uid, a.gid);
crypto/openssh/sftp-server.c
1406
int r, handle, fd;
crypto/openssh/sftp-server.c
1413
if ((fd = handle_to_fd(handle)) < 0) {
crypto/openssh/sftp-server.c
1417
if (fstatvfs(fd, &st) != 0)
crypto/openssh/sftp-server.c
1445
int handle, fd, r, status = SSH2_FX_OP_UNSUPPORTED;
crypto/openssh/sftp-server.c
1451
if ((fd = handle_to_fd(handle)) < 0)
crypto/openssh/sftp-server.c
1454
r = fsync(fd);
crypto/openssh/sftp-server.c
2057
pfd[0].fd = pfd[1].fd = -1;
crypto/openssh/sftp-server.c
2067
pfd[0].fd = in;
crypto/openssh/sftp-server.c
2075
pfd[1].fd = out;
crypto/openssh/sftp-server.c
305
int fd;
crypto/openssh/sftp-server.c
330
handle_new(int use, const char *name, int fd, int flags, DIR *dirp)
crypto/openssh/sftp-server.c
347
handles[i].fd = fd;
crypto/openssh/sftp-server.c
407
return handles[handle].fd;
crypto/openssh/sftp-server.c
455
ret = close(handles[handle].fd);
crypto/openssh/sftp-server.c
739
int r, handle, fd, flags, mode, status = SSH2_FX_FAILURE;
crypto/openssh/sftp-server.c
757
fd = open(name, flags, mode);
crypto/openssh/sftp-server.c
758
if (fd == -1) {
crypto/openssh/sftp-server.c
761
handle = handle_new(HANDLE_FILE, name, fd, flags, NULL);
crypto/openssh/sftp-server.c
763
close(fd);
crypto/openssh/sftp-server.c
796
int r, handle, fd, ret, status = SSH2_FX_FAILURE;
crypto/openssh/sftp-server.c
806
if ((fd = handle_to_fd(handle)) == -1)
crypto/openssh/sftp-server.c
818
if (lseek(fd, off, SEEK_SET) == -1) {
crypto/openssh/sftp-server.c
827
} else if ((ret = read(fd, buf, len)) == -1) {
crypto/openssh/sftp-server.c
850
int r, handle, fd, ret, status;
crypto/openssh/sftp-server.c
860
fd = handle_to_fd(handle);
crypto/openssh/sftp-server.c
862
if (fd < 0)
crypto/openssh/sftp-server.c
866
lseek(fd, off, SEEK_SET) == -1) {
crypto/openssh/sftp-server.c
872
ret = write(fd, data, len);
crypto/openssh/sftp-server.c
933
int fd, r, handle, status = SSH2_FX_FAILURE;
crypto/openssh/sftp-server.c
939
fd = handle_to_fd(handle);
crypto/openssh/sftp-server.c
940
if (fd >= 0) {
crypto/openssh/sftp-server.c
941
r = fstat(fd, &st);
crypto/openssh/ssh-add.c
284
int cert_lifetime, r, fd, ret = -1;
crypto/openssh/ssh-add.c
288
fd = STDIN_FILENO;
crypto/openssh/ssh-add.c
290
} else if ((fd = open(filename, O_RDONLY)) == -1) {
crypto/openssh/ssh-add.c
299
if (fd != STDIN_FILENO) {
crypto/openssh/ssh-add.c
300
if (sshkey_perm_ok(fd, filename) != 0) {
crypto/openssh/ssh-add.c
301
close(fd);
crypto/openssh/ssh-add.c
305
if ((r = sshbuf_load_fd(fd, &keyblob)) != 0) {
crypto/openssh/ssh-add.c
309
close(fd);
crypto/openssh/ssh-add.c
312
close(fd);
crypto/openssh/ssh-agent.c
122
int fd;
crypto/openssh/ssh-agent.c
1864
socknum, e->fd, msg_len, AGENT_MAX_LEN);
crypto/openssh/ssh-agent.c
1882
debug_f("socket %u (fd=%d) type %d", socknum, e->fd, type);
crypto/openssh/ssh-agent.c
1947
new_socket(sock_type type, int fd)
crypto/openssh/ssh-agent.c
1957
set_nonblock(fd);
crypto/openssh/ssh-agent.c
1959
if (fd > max_fd)
crypto/openssh/ssh-agent.c
1960
max_fd = fd;
crypto/openssh/ssh-agent.c
1964
sockets[i].fd = fd;
crypto/openssh/ssh-agent.c
1979
sockets[old_alloc].fd = fd;
crypto/openssh/ssh-agent.c
1994
int fd;
crypto/openssh/ssh-agent.c
1997
fd = accept(sockets[socknum].fd, (struct sockaddr *)&sunaddr, &slen);
crypto/openssh/ssh-agent.c
1998
if (fd == -1) {
crypto/openssh/ssh-agent.c
2002
if (getpeereid(fd, &euid, &egid) == -1) {
crypto/openssh/ssh-agent.c
2003
error("getpeereid %d failed: %s", fd, strerror(errno));
crypto/openssh/ssh-agent.c
2004
close(fd);
crypto/openssh/ssh-agent.c
2010
close(fd);
crypto/openssh/ssh-agent.c
2013
new_socket(AUTH_CONNECTION, fd);
crypto/openssh/ssh-agent.c
2024
if ((len = read(sockets[socknum].fd, buf, sizeof(buf))) <= 0) {
crypto/openssh/ssh-agent.c
2029
socknum, sockets[socknum].fd, strerror(errno));
crypto/openssh/ssh-agent.c
2053
if ((len = write(sockets[socknum].fd,
crypto/openssh/ssh-agent.c
2060
socknum, sockets[socknum].fd, strerror(errno));
crypto/openssh/ssh-agent.c
2083
if (pfd[i].fd == sockets[socknum].fd)
crypto/openssh/ssh-agent.c
2087
error_f("no socket for fd %d", pfd[i].fd);
crypto/openssh/ssh-agent.c
2159
pfd[j].fd = sockets[i].fd;
crypto/openssh/ssh-agent.c
2165
pfd[j].fd = sockets[i].fd;
crypto/openssh/ssh-agent.c
220
close(e->fd);
crypto/openssh/ssh-agent.c
230
e->fd = -1;
crypto/openssh/ssh-agent.c
526
e->fd, i, hks->forwarded ? "FORWARD" : "AUTH",
crypto/openssh/ssh-keygen.c
1034
int i, type, fd, r;
crypto/openssh/ssh-keygen.c
1071
if ((fd = mkstemp(prv_tmp)) == -1) {
crypto/openssh/ssh-keygen.c
1076
(void)close(fd); /* just using mkstemp() to reserve a name */
crypto/openssh/ssh-keygen.c
1093
if ((fd = mkstemp(pub_tmp)) == -1) {
crypto/openssh/ssh-keygen.c
1098
(void)fchmod(fd, 0644);
crypto/openssh/ssh-keygen.c
1099
(void)close(fd);
crypto/openssh/ssh-keygen.c
1266
int r, fd, oerrno, inplace = 0;
crypto/openssh/ssh-keygen.c
1300
if ((fd = mkstemp(tmp)) == -1)
crypto/openssh/ssh-keygen.c
1302
if ((ctx.out = fdopen(fd, "w")) == NULL) {
crypto/openssh/ssh-keygen.c
1307
(void)fchmod(fd, sb.st_mode & 0644);
crypto/openssh/ssh-keygen.c
2539
sign_one(struct sshkey *signkey, const char *filename, int fd,
crypto/openssh/ssh-keygen.c
2549
if (fd == STDIN_FILENO)
crypto/openssh/ssh-keygen.c
2572
fd, sig_namespace, &sigbuf, signer, signer_ctx)) != 0) {
crypto/openssh/ssh-keygen.c
2586
if (fd == STDIN_FILENO) {
crypto/openssh/ssh-keygen.c
2679
int i, fd = -1, r, ret = -1;
crypto/openssh/ssh-keygen.c
2732
fd = STDIN_FILENO;
crypto/openssh/ssh-keygen.c
2733
else if ((fd = open(argv[i], O_RDONLY)) == -1) {
crypto/openssh/ssh-keygen.c
2738
if ((r = sign_one(signkey, argv[i], fd, sig_namespace,
crypto/openssh/ssh-keygen.c
2741
if (fd != STDIN_FILENO)
crypto/openssh/ssh-keygen.c
2742
close(fd);
crypto/openssh/ssh-keygen.c
2743
fd = -1;
crypto/openssh/ssh-keygen.c
2749
if (fd != -1 && fd != STDIN_FILENO)
crypto/openssh/ssh-keygen.c
2750
close(fd);
crypto/openssh/ssh-keyscan.c
420
read_wait[s].fd = s;
crypto/openssh/ssh-keyscan.c
442
read_wait[s].fd = -1;
crypto/openssh/ssh-keyscan.c
791
read_wait[j].fd = -1;
crypto/openssh/ssh-keysign.c
183
int r, key_fd[NUM_KEYTYPES], i, found, version = 2, fd;
crypto/openssh/ssh-keysign.c
189
if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
crypto/openssh/ssh-keysign.c
192
if (fd > 2)
crypto/openssh/ssh-keysign.c
193
close(fd);
crypto/openssh/ssh-keysign.c
266
if ((r = sshbuf_get_u32(b, (u_int *)&fd)) != 0)
crypto/openssh/ssh-keysign.c
268
if (fd <= STDERR_FILENO)
crypto/openssh/ssh-keysign.c
269
fatal("%s: bad fd = %d", __progname, fd);
crypto/openssh/ssh-keysign.c
270
if ((host = get_local_name(fd)) == NULL)
crypto/openssh/ssh-pkcs11-client.c
132
close(helper->fd);
crypto/openssh/ssh-pkcs11-client.c
134
helper->fd = -1;
crypto/openssh/ssh-pkcs11-client.c
158
send_msg(int fd, struct sshbuf *m)
crypto/openssh/ssh-pkcs11-client.c
164
if (fd == -1)
crypto/openssh/ssh-pkcs11-client.c
167
if (atomicio(vwrite, fd, buf, 4) != 4 ||
crypto/openssh/ssh-pkcs11-client.c
168
atomicio(vwrite, fd, sshbuf_mutable_ptr(m),
crypto/openssh/ssh-pkcs11-client.c
176
recv_msg(int fd, struct sshbuf *m)
crypto/openssh/ssh-pkcs11-client.c
183
if (fd == -1)
crypto/openssh/ssh-pkcs11-client.c
185
if ((len = atomicio(read, fd, buf, 4)) != 4) {
crypto/openssh/ssh-pkcs11-client.c
197
if (atomicio(read, fd, buf, l) != l) {
crypto/openssh/ssh-pkcs11-client.c
245
if ((helper = helper_by_key(key)) == NULL || helper->fd == -1)
crypto/openssh/ssh-pkcs11-client.c
256
send_msg(helper->fd, msg);
crypto/openssh/ssh-pkcs11-client.c
259
if ((status = recv_msg(helper->fd, msg)) != SSH2_AGENT_SIGN_RESPONSE) {
crypto/openssh/ssh-pkcs11-client.c
296
if ((helper = helper_by_key(priv)) == NULL || helper->fd == -1)
crypto/openssh/ssh-pkcs11-client.c
371
helper->fd = pair[0];
crypto/openssh/ssh-pkcs11-client.c
375
helper->path, helper->fd, (long)helper->pid);
crypto/openssh/ssh-pkcs11-client.c
405
send_msg(helper->fd, msg);
crypto/openssh/ssh-pkcs11-client.c
408
type = recv_msg(helper->fd, msg);
crypto/openssh/ssh-pkcs11-client.c
469
if ((helper = helper_by_key(key)) == NULL || helper->fd == -1)
crypto/openssh/ssh-pkcs11-client.c
52
int fd;
crypto/openssh/ssh-pkcs11-client.c
66
helpers[i]->fd == -1)
crypto/openssh/ssh-pkcs11-helper.c
257
pfd[0].fd = in;
crypto/openssh/ssh-pkcs11-helper.c
258
pfd[1].fd = out;
crypto/openssh/ssh-sk-client.c
160
int oerrno, fd, r2, ll, r = SSH_ERR_INTERNAL_ERROR;
crypto/openssh/ssh-sk-client.c
168
if ((r = start_helper(&fd, &pid, &osigchld)) != 0)
crypto/openssh/ssh-sk-client.c
184
if ((r = ssh_msg_send(fd, SSH_SK_HELPER_VERSION, req)) != 0) {
crypto/openssh/ssh-sk-client.c
188
if ((r = ssh_msg_recv(fd, resp)) != 0) {
crypto/openssh/ssh-sk-client.c
228
close(fd);
crypto/openssh/sshbuf-io.c
102
int fd, oerrno;
crypto/openssh/sshbuf-io.c
104
if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
crypto/openssh/sshbuf-io.c
106
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(buf),
crypto/openssh/sshbuf-io.c
107
sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) {
crypto/openssh/sshbuf-io.c
109
close(fd);
crypto/openssh/sshbuf-io.c
34
sshbuf_load_fd(int fd, struct sshbuf **blobp)
crypto/openssh/sshbuf-io.c
44
if (fstat(fd, &st) == -1)
crypto/openssh/sshbuf-io.c
51
if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) {
crypto/openssh/sshbuf-io.c
82
int r, fd, oerrno;
crypto/openssh/sshbuf-io.c
85
if ((fd = open(path, O_RDONLY)) == -1)
crypto/openssh/sshbuf-io.c
87
if ((r = sshbuf_load_fd(fd, bufp)) != 0)
crypto/openssh/sshbuf-io.c
93
close(fd);
crypto/openssh/sshbuf-misc.c
326
sshbuf_read(int fd, struct sshbuf *buf, size_t maxlen, size_t *rlen)
crypto/openssh/sshbuf-misc.c
337
rr = read(fd, d, maxlen);
crypto/openssh/sshd-session.c
644
recv_rexec_state(int fd, struct sshbuf *conf, uint64_t *timing_secretp)
crypto/openssh/sshd-session.c
652
debug3_f("entering fd = %d", fd);
crypto/openssh/sshd-session.c
658
if (ssh_msg_recv(fd, m) == -1)
crypto/openssh/sshd-session.c
685
if (ssh_msg_recv(fd, m) == -1)
crypto/openssh/sshd.c
1018
pfd[i].fd = listen_socks[i];
crypto/openssh/sshd.c
1025
pfd[npfd].fd = children[i].pipefd;
crypto/openssh/sshd.c
797
send_rexec_state(int fd)
crypto/openssh/sshd.c
808
debug3_f("entering fd = %d config len %zu", fd,
crypto/openssh/sshd.c
812
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(config), mlen) != mlen)
crypto/openssh/sshd.c
817
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(keys), mlen) != mlen)
crypto/openssh/sshpty.c
102
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
crypto/openssh/sshpty.c
103
if (fd >= 0) {
crypto/openssh/sshpty.c
104
(void) ioctl(fd, TIOCNOTTY, NULL);
crypto/openssh/sshpty.c
105
close(fd);
crypto/openssh/sshpty.c
115
fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
crypto/openssh/sshpty.c
116
if (fd >= 0) {
crypto/openssh/sshpty.c
118
close(fd);
crypto/openssh/sshpty.c
130
fd = open(tty, O_RDWR);
crypto/openssh/sshpty.c
131
if (fd == -1)
crypto/openssh/sshpty.c
134
close(fd);
crypto/openssh/sshpty.c
137
fd = open(_PATH_TTY, O_WRONLY);
crypto/openssh/sshpty.c
138
if (fd == -1)
crypto/openssh/sshpty.c
142
close(fd);
crypto/openssh/sshpty.c
221
int fd;
crypto/openssh/sshpty.c
223
if ((fd = open(_PATH_TTY, O_RDWR | O_NOCTTY)) >= 0) {
crypto/openssh/sshpty.c
224
(void) ioctl(fd, TIOCNOTTY, NULL);
crypto/openssh/sshpty.c
225
close(fd);
crypto/openssh/sshpty.c
98
int fd;
crypto/openssh/sshsig.c
506
hash_file(int fd, const char *hashalg, struct sshbuf **bp)
crypto/openssh/sshsig.c
528
if ((n = read(fd, rbuf, sizeof(rbuf))) == -1) {
crypto/openssh/sshsig.c
578
int fd, const char *sig_namespace, struct sshbuf **out,
crypto/openssh/sshsig.c
588
if ((r = hash_file(fd, hashalg, &b)) != 0) {
crypto/openssh/sshsig.c
603
sshsig_verify_fd(struct sshbuf *signature, int fd,
crypto/openssh/sshsig.c
618
if ((r = hash_file(fd, hashalg, &b)) != 0) {
crypto/openssh/sshsig.h
60
int fd, const char *sig_namespace,
crypto/openssh/sshsig.h
68
int sshsig_verify_fd(struct sshbuf *signature, int fd,
crypto/openssh/ttymodes.c
278
ssh_tty_make_modes(struct ssh *ssh, int fd, struct termios *tiop)
crypto/openssh/ttymodes.c
288
if (fd == -1) {
crypto/openssh/ttymodes.c
292
if (tcgetattr(fd, &tio) == -1) {
crypto/openssh/ttymodes.c
342
ssh_tty_parse_modes(struct ssh *ssh, int fd)
crypto/openssh/ttymodes.c
366
if (tcgetattr(fd, &tio) == -1) {
crypto/openssh/ttymodes.c
447
if (tcsetattr(fd, TCSANOW, &tio) == -1)
crypto/openssl/apps/lib/apps.c
3100
int fd = -1, mode;
crypto/openssl/apps/lib/apps.c
3131
fd = open(filename, mode, 0600, "ctx=bin");
crypto/openssl/apps/lib/apps.c
3134
fd = open(filename, mode, 0600);
crypto/openssl/apps/lib/apps.c
3135
if (fd < 0)
crypto/openssl/apps/lib/apps.c
3137
fp = fdopen(fd, modestr('w', format));
crypto/openssl/apps/lib/apps.c
3159
else if (fd >= 0)
crypto/openssl/apps/lib/apps.c
3160
close(fd);
crypto/openssl/apps/s_server.c
3067
int fd = -1;
crypto/openssl/apps/s_server.c
3072
BIO_get_fd(wbio, &fd);
crypto/openssl/apps/s_server.c
3075
if (!wbio || BIO_connect(fd, client, 0) == 0) {
crypto/openssl/apps/s_server.c
3636
int fd;
crypto/openssl/apps/s_server.c
3642
fd = fileno(fp);
crypto/openssl/apps/s_server.c
3643
if (fstat(fd, &st) < 0) {
crypto/openssl/apps/s_server.c
3654
i = SSL_sendfile(con, fd, offset, filesize, 0);
crypto/openssl/apps/s_time.c
148
int min_version = 0, max_version = 0, ver, buf_len, fd;
crypto/openssl/apps/s_time.c
362
if ((fd = SSL_get_fd(scon)) >= 0)
crypto/openssl/apps/s_time.c
363
BIO_closesocket(fd);
crypto/openssl/apps/s_time.c
390
if ((fd = SSL_get_fd(scon)) >= 0)
crypto/openssl/apps/s_time.c
391
BIO_closesocket(fd);
crypto/openssl/apps/s_time.c
484
int fd;
crypto/openssl/apps/s_time.c
488
fd = SSL_get_fd(serverCon);
crypto/openssl/apps/s_time.c
489
if (fd >= 0)
crypto/openssl/apps/s_time.c
490
(void)setsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&no_linger,
crypto/openssl/apps/speed.c
4943
int fd[2];
crypto/openssl/apps/speed.c
4950
if (pipe(fd) == -1) {
crypto/openssl/apps/speed.c
4957
close(fd[1]);
crypto/openssl/apps/speed.c
4958
fds[n] = fd[0];
crypto/openssl/apps/speed.c
4960
close(fd[0]);
crypto/openssl/apps/speed.c
4962
if (dup(fd[1]) == -1) {
crypto/openssl/apps/speed.c
4966
close(fd[1]);
crypto/openssl/crypto/async/async_local.h
51
OSSL_ASYNC_FD fd;
crypto/openssl/crypto/async/async_wait.c
100
if (fd != NULL) {
crypto/openssl/crypto/async/async_wait.c
101
*fd = curr->fd;
crypto/openssl/crypto/async/async_wait.c
102
fd++;
crypto/openssl/crypto/async/async_wait.c
126
*delfd = curr->fd;
crypto/openssl/crypto/async/async_wait.c
130
*addfd = curr->fd;
crypto/openssl/crypto/async/async_wait.c
33
curr->cleanup(ctx, curr->key, curr->fd, curr->custom_data);
crypto/openssl/crypto/async/async_wait.c
45
OSSL_ASYNC_FD fd, void *custom_data,
crypto/openssl/crypto/async/async_wait.c
55
fdlookup->fd = fd;
crypto/openssl/crypto/async/async_wait.c
66
OSSL_ASYNC_FD *fd, void **custom_data)
crypto/openssl/crypto/async/async_wait.c
78
*fd = curr->fd;
crypto/openssl/crypto/async/async_wait.c
87
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
crypto/openssl/crypto/bio/bio_lib.c
956
int fd;
crypto/openssl/crypto/bio/bio_lib.c
964
if (BIO_get_fd(bio, &fd) > 0) {
crypto/openssl/crypto/bio/bio_lib.c
965
int ret = BIO_socket_wait(fd, BIO_should_read(bio), max_time);
crypto/openssl/crypto/bio/bio_sock.c
214
int BIO_socket_ioctl(int fd, long type, void *arg)
crypto/openssl/crypto/bio/bio_sock.c
219
i = ioctlsocket(fd, type, (char *)arg);
crypto/openssl/crypto/bio/bio_sock.c
245
i = ioctlsocket(fd, type, ARG);
crypto/openssl/crypto/bio/bio_sock.c
432
int BIO_socket_wait(int fd, int for_read, time_t max_time)
crypto/openssl/crypto/bio/bio_sock.c
440
if ((SOCKET)fd == INVALID_SOCKET)
crypto/openssl/crypto/bio/bio_sock.c
442
if (fd < 0 || fd >= FD_SETSIZE)
crypto/openssl/crypto/bio/bio_sock.c
453
openssl_fdset(fd, &confds);
crypto/openssl/crypto/bio/bio_sock.c
456
return select(fd + 1, for_read ? &confds : NULL,
crypto/openssl/crypto/bio/bio_sock.c
462
if (fd < 0)
crypto/openssl/crypto/bio/bio_sock.c
471
confds.fd = fd;
crypto/openssl/crypto/bio/bss_conn.c
605
pd->value.fd = b->num;
crypto/openssl/crypto/bio/bss_dgram.c
1037
pd->value.fd = b->num;
crypto/openssl/crypto/bio/bss_dgram.c
1788
BIO *BIO_new_dgram_sctp(int fd, int close_flag)
crypto/openssl/crypto/bio/bss_dgram.c
1808
BIO_set_fd(bio, fd, close_flag);
crypto/openssl/crypto/bio/bss_dgram.c
1812
ret = setsockopt(fd, IPPROTO_SCTP, SCTP_AUTH_CHUNK, &auth,
crypto/openssl/crypto/bio/bss_dgram.c
1821
ret = setsockopt(fd, IPPROTO_SCTP, SCTP_AUTH_CHUNK, &auth,
crypto/openssl/crypto/bio/bss_dgram.c
1842
ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks,
crypto/openssl/crypto/bio/bss_dgram.c
1875
ret = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENT, &event,
crypto/openssl/crypto/bio/bss_dgram.c
1883
ret = getsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, &sockopt_len);
crypto/openssl/crypto/bio/bss_dgram.c
1891
ret = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event,
crypto/openssl/crypto/bio/bss_dgram.c
1904
ret = setsockopt(fd, IPPROTO_SCTP, SCTP_PARTIAL_DELIVERY_POINT, &optval,
crypto/openssl/crypto/bio/bss_dgram.c
262
BIO *BIO_new_dgram(int fd, int close_flag)
crypto/openssl/crypto/bio/bss_dgram.c
269
BIO_set_fd(ret, fd, close_flag);
crypto/openssl/crypto/bio/bss_fd.c
19
BIO *BIO_new_fd(int fd, int close_flag)
crypto/openssl/crypto/bio/bss_fd.c
80
BIO *BIO_new_fd(int fd, int close_flag)
crypto/openssl/crypto/bio/bss_fd.c
86
BIO_set_fd(ret, fd, close_flag);
crypto/openssl/crypto/bio/bss_file.c
244
int fd = _fileno((FILE *)ptr);
crypto/openssl/crypto/bio/bss_file.c
246
_setmode(fd, _O_TEXT);
crypto/openssl/crypto/bio/bss_file.c
248
_setmode(fd, _O_BINARY);
crypto/openssl/crypto/bio/bss_file.c
250
int fd = fileno((FILE *)ptr);
crypto/openssl/crypto/bio/bss_file.c
253
_setmode(fd, _O_TEXT);
crypto/openssl/crypto/bio/bss_file.c
256
if (fd == STDIN_FILENO || fd == STDOUT_FILENO) {
crypto/openssl/crypto/bio/bss_file.c
257
if (isatty(fd) <= 0)
crypto/openssl/crypto/bio/bss_file.c
258
_setmode(fd, _O_BINARY);
crypto/openssl/crypto/bio/bss_file.c
260
_setmode(fd, _O_BINARY);
crypto/openssl/crypto/bio/bss_file.c
263
int fd = fileno((FILE *)ptr);
crypto/openssl/crypto/bio/bss_file.c
265
setmode(fd, O_BINARY);
crypto/openssl/crypto/bio/bss_sock.c
217
pd->value.fd = b->num;
crypto/openssl/crypto/bio/bss_sock.c
67
BIO *BIO_new_socket(int fd, int close_flag)
crypto/openssl/crypto/bio/bss_sock.c
74
BIO_set_fd(ret, fd, close_flag);
crypto/openssl/crypto/mem_sec.c
520
int fd;
crypto/openssl/crypto/mem_sec.c
523
if ((fd = open("/dev/zero", O_RDWR)) >= 0) {
crypto/openssl/crypto/mem_sec.c
525
PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
crypto/openssl/crypto/mem_sec.c
526
close(fd);
crypto/openssl/crypto/rand/rand_egd.c
111
int mybuffer, ret = -1, i, numbytes, fd = -1;
crypto/openssl/crypto/rand/rand_egd.c
128
fd = hpns_socket(AF_UNIX, SOCK_STREAM, 0, AF_UNIX_COMPATIBILITY);
crypto/openssl/crypto/rand/rand_egd.c
130
fd = socket(AF_UNIX, SOCK_STREAM, 0);
crypto/openssl/crypto/rand/rand_egd.c
132
if (fd == -1)
crypto/openssl/crypto/rand/rand_egd.c
137
if (connect(fd, (struct sockaddr *)&addr, i) == 0)
crypto/openssl/crypto/rand/rand_egd.c
162
close(fd);
crypto/openssl/crypto/rand/rand_egd.c
163
fd = hpns_socket(AF_UNIX, SOCK_STREAM, 0, AF_UNIX_PORTABILITY);
crypto/openssl/crypto/rand/rand_egd.c
164
if (fd == -1)
crypto/openssl/crypto/rand/rand_egd.c
177
fp = fdopen(fd, "r+");
crypto/openssl/crypto/rand/rand_egd.c
179
close(fd);
crypto/openssl/crypto/rand/rand_egd.c
212
else if (fd != -1)
crypto/openssl/crypto/rand/rand_egd.c
213
close(fd);
crypto/openssl/crypto/rand/randfile.c
213
int fd = open(file, O_WRONLY | O_CREAT | O_BINARY, 0600);
crypto/openssl/crypto/rand/randfile.c
215
if (fd != -1) {
crypto/openssl/crypto/rand/randfile.c
216
out = fdopen(fd, "wb");
crypto/openssl/crypto/rand/randfile.c
218
close(fd);
crypto/openssl/demos/guide/quic-server-block.c
178
int fd;
crypto/openssl/demos/guide/quic-server-block.c
182
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
crypto/openssl/demos/guide/quic-server-block.c
191
if (bind(fd, (const struct sockaddr *)&sa, sizeof(sa)) < 0) {
crypto/openssl/demos/guide/quic-server-block.c
193
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-block.c
197
return fd;
crypto/openssl/demos/guide/quic-server-block.c
200
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-block.c
208
static int run_quic_server(SSL_CTX *ctx, int fd)
crypto/openssl/demos/guide/quic-server-block.c
225
if (!SSL_set_fd(listener, fd))
crypto/openssl/demos/guide/quic-server-block.c
285
int fd;
crypto/openssl/demos/guide/quic-server-block.c
310
if ((fd = create_socket((uint16_t)port)) < 0) {
crypto/openssl/demos/guide/quic-server-block.c
317
if (!run_quic_server(ctx, fd)) {
crypto/openssl/demos/guide/quic-server-block.c
319
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-block.c
326
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-non-block.c
178
int fd;
crypto/openssl/demos/guide/quic-server-non-block.c
182
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
crypto/openssl/demos/guide/quic-server-non-block.c
191
if (bind(fd, (const struct sockaddr *)&sa, sizeof(sa)) < 0) {
crypto/openssl/demos/guide/quic-server-non-block.c
193
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-non-block.c
198
if (BIO_socket_nbio(fd, 1) <= 0) {
crypto/openssl/demos/guide/quic-server-non-block.c
200
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-non-block.c
204
return fd;
crypto/openssl/demos/guide/quic-server-non-block.c
360
static int run_quic_server(SSL_CTX *ctx, int fd)
crypto/openssl/demos/guide/quic-server-non-block.c
373
if (!SSL_set_fd(listener, fd))
crypto/openssl/demos/guide/quic-server-non-block.c
471
int fd;
crypto/openssl/demos/guide/quic-server-non-block.c
495
if ((fd = create_socket((uint16_t)port)) < 0) {
crypto/openssl/demos/guide/quic-server-non-block.c
502
if (run_quic_server(ctx, fd) < 0) {
crypto/openssl/demos/guide/quic-server-non-block.c
504
BIO_closesocket(fd);
crypto/openssl/demos/guide/quic-server-non-block.c
511
BIO_closesocket(fd);
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1042
static int run_quic_server(SSL_CTX *ctx, int fd)
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1057
if (!SSL_set_fd(listener, fd))
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1344
int fd = -1;
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1365
if ((fd = create_socket((uint16_t)port)) < 0)
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1369
if (!run_quic_server(ctx, fd))
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1379
if (fd != -1)
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
1380
BIO_closesocket(fd);
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
795
int fd;
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
807
fd = open(filename, O_RDONLY);
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
808
if (read(fd, res, size) == -1) {
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
809
close(fd);
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
813
close(fd);
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
939
int fd = -1;
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
942
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
950
if (bind(fd, (const struct sockaddr *)&sa, sizeof(sa)) < 0) {
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
955
return fd;
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
958
if (fd >= 0)
crypto/openssl/demos/http3/ossl-nghttp3-demo-server.c
959
BIO_closesocket(fd);
crypto/openssl/demos/quic/server/server.c
101
if (fd >= 0)
crypto/openssl/demos/quic/server/server.c
102
BIO_closesocket(fd);
crypto/openssl/demos/quic/server/server.c
140
static int run_quic_server(SSL_CTX *ctx, int fd)
crypto/openssl/demos/quic/server/server.c
150
if (!SSL_set_fd(listener, fd))
crypto/openssl/demos/quic/server/server.c
205
int fd = -1;
crypto/openssl/demos/quic/server/server.c
225
if ((fd = create_socket((uint16_t)port)) < 0)
crypto/openssl/demos/quic/server/server.c
229
if (!run_quic_server(ctx, fd))
crypto/openssl/demos/quic/server/server.c
239
if (fd != -1)
crypto/openssl/demos/quic/server/server.c
240
BIO_closesocket(fd);
crypto/openssl/demos/quic/server/server.c
82
int fd = -1;
crypto/openssl/demos/quic/server/server.c
85
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
crypto/openssl/demos/quic/server/server.c
93
if (bind(fd, (const struct sockaddr *)&sa, sizeof(sa)) < 0) {
crypto/openssl/demos/quic/server/server.c
98
return fd;
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking-threads.c
196
return d.value.fd;
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking-threads.c
300
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking-threads.c
318
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking.c
208
return d.value.fd;
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking.c
376
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-02-conn-nonblocking.c
420
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
139
int rc, fd = -1, l, mlen, res = 1;
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
172
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
174
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
176
if (fd < 0) {
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
181
rc = connect(fd, result->ai_addr, result->ai_addrlen);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
187
ssl = new_conn(ctx, fd, argv[1]);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
212
if (fd >= 0)
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
213
close(fd);
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
50
SSL *new_conn(SSL_CTX *ctx, int fd, const char *bare_hostname)
crypto/openssl/doc/designs/ddd/ddd-03-fd-blocking.c
63
if (SSL_set_fd(ssl, fd) <= 0) {
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
104
conn->fd = fd;
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
16
int fd;
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
182
return conn->fd;
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
296
int rc, fd = -1, res = 1;
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
340
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
342
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
344
if (fd < 0) {
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
349
rc = connect(fd, result->ai_addr, result->ai_addrlen);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
355
rc = fcntl(fd, F_SETFL, O_NONBLOCK);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
361
conn = new_conn(ctx, fd, argv[1]);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
391
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
435
pfd.fd = get_conn_fd(conn);
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
56
APP_CONN *new_conn(SSL_CTX *ctx, int fd, const char *bare_hostname)
crypto/openssl/doc/designs/ddd/ddd-04-fd-nonblocking.c
76
if (SSL_set_fd(ssl, fd) <= 0) {
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
297
static int pump(APP_CONN *conn, int fd, int events, int timeout)
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
304
pfd.fd = fd;
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
319
l = read(fd, buf, wspace > sizeof(buf) ? sizeof(buf) : wspace);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
345
l2 = write(fd, buf, l);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
356
int rc, fd = -1, res = 1;
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
393
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
395
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
397
if (fd < 0) {
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
402
rc = connect(fd, result->ai_addr, result->ai_addrlen);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
408
rc = fcntl(fd, F_SETFL, O_NONBLOCK);
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
429
if (pump(conn, fd, get_conn_pending_tx(conn), timeout) != 1) {
crypto/openssl/doc/designs/ddd/ddd-05-mem-nonblocking.c
444
if (pump(conn, fd, get_conn_pending_rx(conn), timeout) != 1) {
crypto/openssl/engines/e_devcrypto.c
1200
int fd;
crypto/openssl/engines/e_devcrypto.c
1205
if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
crypto/openssl/engines/e_devcrypto.c
1214
if (ioctl(fd, CRIOGET, &cfd) < 0) {
crypto/openssl/engines/e_devcrypto.c
1216
close(fd);
crypto/openssl/engines/e_devcrypto.c
1220
close(fd);
crypto/openssl/engines/e_devcrypto.c
1222
cfd = fd;
crypto/openssl/include/internal/ktls.h
100
static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
crypto/openssl/include/internal/ktls.h
123
return sendmsg(fd, &msg, 0);
crypto/openssl/include/internal/ktls.h
128
static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
crypto/openssl/include/internal/ktls.h
142
static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
crypto/openssl/include/internal/ktls.h
167
ret = recvmsg(fd, &msg, 0);
crypto/openssl/include/internal/ktls.h
204
static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off,
crypto/openssl/include/internal/ktls.h
210
ret = sendfile(fd, s, off, size, NULL, &sbytes, flags);
crypto/openssl/include/internal/ktls.h
294
static ossl_inline int ktls_enable(int fd)
crypto/openssl/include/internal/ktls.h
296
return setsockopt(fd, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) ? 0 : 1;
crypto/openssl/include/internal/ktls.h
307
static ossl_inline int ktls_start(int fd, ktls_crypto_info_t *crypto_info,
crypto/openssl/include/internal/ktls.h
314
ktls_enable(fd);
crypto/openssl/include/internal/ktls.h
316
return setsockopt(fd, SOL_TLS, is_tx ? TLS_TX : TLS_RX,
crypto/openssl/include/internal/ktls.h
322
static ossl_inline int ktls_enable_tx_zerocopy_sendfile(int fd)
crypto/openssl/include/internal/ktls.h
327
return setsockopt(fd, SOL_TLS, TLS_TX_ZEROCOPY_RO,
crypto/openssl/include/internal/ktls.h
343
static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type,
crypto/openssl/include/internal/ktls.h
370
return sendmsg(fd, &msg, 0);
crypto/openssl/include/internal/ktls.h
377
static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, size_t size, int flags)
crypto/openssl/include/internal/ktls.h
379
return sendfile(s, fd, &off, size);
crypto/openssl/include/internal/ktls.h
384
static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
crypto/openssl/include/internal/ktls.h
397
static ossl_inline int ktls_read_record(int fd, void *data, size_t length)
crypto/openssl/include/internal/ktls.h
424
ret = recvmsg(fd, &msg, 0);
crypto/openssl/include/internal/ktls.h
55
static ossl_inline int ktls_enable(int fd)
crypto/openssl/include/internal/ktls.h
70
static ossl_inline int ktls_start(int fd, ktls_crypto_info_t *tls_en, int is_tx)
crypto/openssl/include/internal/ktls.h
73
return setsockopt(fd, IPPROTO_TCP, TCP_TXTLS_ENABLE,
crypto/openssl/include/internal/ktls.h
78
return setsockopt(fd, IPPROTO_TCP, TCP_RXTLS_ENABLE, tls_en,
crypto/openssl/include/internal/ktls.h
88
static ossl_inline int ktls_enable_tx_zerocopy_sendfile(int fd)
crypto/openssl/include/openssl/async.h
58
OSSL_ASYNC_FD fd,
crypto/openssl/include/openssl/async.h
63
OSSL_ASYNC_FD *fd, void **custom_data);
crypto/openssl/include/openssl/async.h
64
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
crypto/openssl/include/openssl/bio.h
423
int fd;
crypto/openssl/include/openssl/bio.h
564
#define BIO_set_fd(b, fd, c) BIO_int_ctrl(b, BIO_C_SET_FD, c, fd)
crypto/openssl/include/openssl/bio.h
804
BIO *BIO_new_dgram(int fd, int close_flag);
crypto/openssl/include/openssl/bio.h
807
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
crypto/openssl/include/openssl/bio.h
821
int BIO_socket_wait(int fd, int for_read, time_t max_time);
crypto/openssl/include/openssl/bio.h
880
int BIO_socket_ioctl(int fd, long type, void *arg);
crypto/openssl/include/openssl/bio.h
881
int BIO_socket_nbio(int fd, int mode);
crypto/openssl/include/openssl/bio.h
925
BIO *BIO_new_fd(int fd, int close_flag);
crypto/openssl/include/openssl/ssl.h
1665
__owur int SSL_set_fd(SSL *s, int fd);
crypto/openssl/include/openssl/ssl.h
1666
__owur int SSL_set_rfd(SSL *s, int fd);
crypto/openssl/include/openssl/ssl.h
1667
__owur int SSL_set_wfd(SSL *s, int fd);
crypto/openssl/include/openssl/ssl.h
2013
__owur ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size,
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
411
int fd;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
439
int shm_id, fd, r;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
467
if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
468
if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
470
FD_SET(fd, &fds);
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
471
while ((r = select(fd + 1, &fds, NULL, NULL, NULL)) < 0
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
475
while ((r = read(fd, &c, 1)) < 0 && errno == EINTR)
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
478
close(fd);
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
518
return rd->fd != -1
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
519
&& fstat(rd->fd, &st) != -1
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
536
return rd->fd;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
539
if ((rd->fd = open(random_device_paths[n], O_RDONLY)) == -1)
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
540
return rd->fd;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
543
if (fstat(rd->fd, &st) != -1) {
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
549
close(rd->fd);
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
550
rd->fd = -1;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
553
return rd->fd;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
564
close(rd->fd);
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
565
rd->fd = -1;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
573
random_devices[i].fd = -1;
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
675
const int fd = get_random_device(i);
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
677
if (fd == -1)
crypto/openssl/providers/implementations/rands/seeding/rand_unix.c
682
bytes = read(fd, buffer, bytes_needed);
crypto/openssl/ssl/quic/quic_port.c
285
if (d->type == BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD && d->value.fd < 0) {
crypto/openssl/ssl/quic/quic_reactor.c
100
WSAIoctl(bpd->value.fd, SIO_UDP_NETRESET, &bNewBehavior,
crypto/openssl/ssl/quic/quic_reactor.c
350
pfds[npfd].fd = rfd;
crypto/openssl/ssl/quic/quic_reactor.c
356
pfds[npfd].fd = rfd;
crypto/openssl/ssl/quic/quic_reactor.c
361
pfds[npfd].fd = wfd;
crypto/openssl/ssl/quic/quic_reactor.c
368
pfds[npfd].fd = notify_rfd;
crypto/openssl/ssl/quic/quic_reactor.c
403
static int poll_descriptor_to_fd(const BIO_POLL_DESCRIPTOR *d, int *fd)
crypto/openssl/ssl/quic/quic_reactor.c
406
*fd = INVALID_SOCKET;
crypto/openssl/ssl/quic/quic_reactor.c
411
|| d->value.fd == INVALID_SOCKET)
crypto/openssl/ssl/quic/quic_reactor.c
414
*fd = d->value.fd;
crypto/openssl/ssl/quic/quic_reactor.c
98
WSAIoctl(bpd->value.fd, SIO_UDP_CONNRESET, &bNewBehavior,
crypto/openssl/ssl/rio/poll_builder.c
101
openssl_fdset(fd, &rpb->efd);
crypto/openssl/ssl/rio/poll_builder.c
102
if (fd > rpb->hwm_fd)
crypto/openssl/ssl/rio/poll_builder.c
103
rpb->hwm_fd = fd;
crypto/openssl/ssl/rio/poll_builder.c
111
if (pfd->fd == -1 || pfd->fd == fd)
crypto/openssl/ssl/rio/poll_builder.c
123
pfds[i].fd = fd;
crypto/openssl/ssl/rio/poll_builder.c
72
int ossl_rio_poll_builder_add_fd(RIO_POLL_BUILDER *rpb, int fd,
crypto/openssl/ssl/rio/poll_builder.c
81
if (fd < 0)
crypto/openssl/ssl/rio/poll_builder.c
91
if (fd >= FD_SETSIZE)
crypto/openssl/ssl/rio/poll_builder.c
96
openssl_fdset(fd, &rpb->rfd);
crypto/openssl/ssl/rio/poll_builder.c
99
openssl_fdset(fd, &rpb->wfd);
crypto/openssl/ssl/rio/poll_builder.h
64
int ossl_rio_poll_builder_add_fd(RIO_POLL_BUILDER *rpb, int fd,
crypto/openssl/ssl/rio/poll_immediate.c
78
fd1 = rd.value.fd;
crypto/openssl/ssl/rio/poll_immediate.c
98
fd2 = wd.value.fd;
crypto/openssl/ssl/rio/rio_notifier.c
104
if (setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (void *)&on, sizeof(on)) < 0) {
crypto/openssl/ssl/rio/rio_notifier.c
107
BIO_closesocket(fd);
crypto/openssl/ssl/rio/rio_notifier.c
116
fd = BIO_socket(domain, socktype, protocol, 0);
crypto/openssl/ssl/rio/rio_notifier.c
117
if (fd == INVALID_SOCKET) {
crypto/openssl/ssl/rio/rio_notifier.c
127
if (!set_cloexec(fd)) {
crypto/openssl/ssl/rio/rio_notifier.c
130
BIO_closesocket(fd);
crypto/openssl/ssl/rio/rio_notifier.c
135
return fd;
crypto/openssl/ssl/rio/rio_notifier.c
20
static int set_cloexec(int fd)
crypto/openssl/ssl/rio/rio_notifier.c
23
return fcntl(fd, F_SETFD, FD_CLOEXEC) >= 0;
crypto/openssl/ssl/rio/rio_notifier.c
66
int fd;
crypto/openssl/ssl/rio/rio_notifier.c
80
fd = (int)WSASocketA(domain, socktype, protocol, NULL, 0,
crypto/openssl/ssl/rio/rio_notifier.c
90
if (fd == INVALID_SOCKET)
crypto/openssl/ssl/rio/rio_notifier.c
91
fd = (int)WSASocketA(domain, socktype, protocol, NULL, 0, 0);
crypto/openssl/ssl/rio/rio_notifier.c
93
fd = (int)WSASocketA(domain, socktype, protocol, NULL, 0, 0);
crypto/openssl/ssl/rio/rio_notifier.c
95
if (fd == INVALID_SOCKET) {
crypto/openssl/ssl/ssl_lib.c
1710
int SSL_set_fd(SSL *s, int fd)
crypto/openssl/ssl/ssl_lib.c
1726
BIO_set_fd(bio, fd, BIO_NOCLOSE);
crypto/openssl/ssl/ssl_lib.c
1733
int SSL_set_wfd(SSL *s, int fd)
crypto/openssl/ssl/ssl_lib.c
1744
|| (int)BIO_get_fd(rbio, NULL) != fd) {
crypto/openssl/ssl/ssl_lib.c
1751
BIO_set_fd(bio, fd, BIO_NOCLOSE);
crypto/openssl/ssl/ssl_lib.c
1761
int SSL_set_rfd(SSL *s, int fd)
crypto/openssl/ssl/ssl_lib.c
1772
|| ((int)BIO_get_fd(wbio, NULL) != fd)) {
crypto/openssl/ssl/ssl_lib.c
1779
BIO_set_fd(bio, fd, BIO_NOCLOSE);
crypto/openssl/ssl/ssl_lib.c
2580
ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags)
crypto/openssl/ssl/ssl_lib.c
2631
ret = ktls_sendfile(SSL_get_wfd(s), fd, offset, size, flags);
crypto/openssl/test/asynctest.c
256
OSSL_ASYNC_FD fd = OSSL_BAD_ASYNC_FD, delfd = OSSL_BAD_ASYNC_FD;
crypto/openssl/test/asynctest.c
275
|| !ASYNC_WAIT_CTX_get_all_fds(waitctx, &fd, &numfds)
crypto/openssl/test/asynctest.c
276
|| fd != MAGIC_WAIT_FD
crypto/openssl/test/asynctest.c
277
|| (fd = OSSL_BAD_ASYNC_FD, 0) /* Assign to something else */
crypto/openssl/test/asynctest.c
282
|| !ASYNC_WAIT_CTX_get_changed_fds(waitctx, &fd, &numfds, NULL,
crypto/openssl/test/asynctest.c
284
|| fd != MAGIC_WAIT_FD
crypto/openssl/test/drbgtest.c
334
int fd[2];
crypto/openssl/test/drbgtest.c
338
if (!TEST_int_ge(pipe(fd), 0))
crypto/openssl/test/drbgtest.c
342
close(fd[0]);
crypto/openssl/test/drbgtest.c
343
close(fd[1]);
crypto/openssl/test/drbgtest.c
348
close(fd[1]);
crypto/openssl/test/drbgtest.c
353
&& TEST_true(read(fd[0], &random[0], sizeof(random))
crypto/openssl/test/drbgtest.c
370
close(fd[0]);
crypto/openssl/test/drbgtest.c
377
close(fd[0]);
crypto/openssl/test/drbgtest.c
383
&& TEST_true(write(fd[1], random, sizeof(random))
crypto/openssl/test/drbgtest.c
390
close(fd[1]);
crypto/openssl/test/helpers/ssltestlib.c
1154
|| !TEST_int_eq(rdesc.value.fd, cfd)
crypto/openssl/test/helpers/ssltestlib.c
1155
|| !TEST_int_eq(wdesc.value.fd, cfd))
crypto/openssl/test/helpers/ssltestlib.c
1162
|| !TEST_int_eq(rdesc.value.fd, sfd)
crypto/openssl/test/helpers/ssltestlib.c
1163
|| !TEST_int_eq(wdesc.value.fd, sfd))
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
282
int fd = -1;
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
293
if ((fd = BIO_socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP, 0)) < 0) {
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
304
if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt)) < 0) {
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
328
if (!BIO_bind(fd, addr, 0)) {
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
345
if (!BIO_set_fd(sock, fd, BIO_CLOSE)) {
crypto/openssl/test/quic-openssl-docker/hq-interop/quic-hq-interop-server.c
359
BIO_closesocket(fd);
crypto/openssl/test/quicapitest.c
841
int fd = -1, resfd = -1;
crypto/openssl/test/quicapitest.c
850
if (!TEST_int_ge(fd = BIO_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP, 0), 0))
crypto/openssl/test/quicapitest.c
854
if (!TEST_true(SSL_set_fd(ssl, fd)))
crypto/openssl/test/quicapitest.c
861
if (!TEST_true(SSL_set_rfd(ssl, fd)))
crypto/openssl/test/quicapitest.c
868
if (!TEST_true(SSL_set_wfd(ssl, fd)))
crypto/openssl/test/quicapitest.c
880
|| !TEST_int_eq(resfd, fd))
crypto/openssl/test/quicapitest.c
887
if (fd >= 0)
crypto/openssl/test/quicapitest.c
888
BIO_closesocket(fd);
crypto/openssl/test/radix/quic_ops.c
103
if (!TEST_true(BIO_sock_info(fd, BIO_SOCK_INFO_ADDRESS, &info)))
crypto/openssl/test/radix/quic_ops.c
111
if (!ok && fd >= 0)
crypto/openssl/test/radix/quic_ops.c
112
BIO_closesocket(fd);
crypto/openssl/test/radix/quic_ops.c
114
*p_fd = fd;
crypto/openssl/test/radix/quic_ops.c
78
int fd = -1;
crypto/openssl/test/radix/quic_ops.c
85
fd = BIO_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP, 0);
crypto/openssl/test/radix/quic_ops.c
86
if (!TEST_int_ge(fd, 0))
crypto/openssl/test/radix/quic_ops.c
89
if (!TEST_true(BIO_socket_nbio(fd, 1)))
crypto/openssl/test/radix/quic_ops.c
99
if (!TEST_true(BIO_bind(fd, addr, 0)))
include/db.h
105
int (*fd)(const struct __db *);
include/mpool.h
68
int fd; /* file descriptor */
include/ssp/uio.h
37
(int fd, const struct iovec *iov, int iovcnt))
include/ssp/uio.h
40
return (__ssp_real(readv)(fd, iov, iovcnt));
include/ssp/uio.h
44
(int fd, const struct iovec *iov, int iovcnt, off_t offset))
include/ssp/uio.h
47
return (__ssp_real(preadv)(fd, iov, iovcnt, offset));
include/unistd.h
521
ssize_t freadlink(int fd, char *buf, size_t bufsize);
lib/geom/eli/geom_eli.c
1590
eli_trash_metadata(struct gctl_req *req, const char *prov, int fd, off_t offset)
lib/geom/eli/geom_eli.c
1603
size = g_sectorsize(fd);
lib/geom/eli/geom_eli.c
1618
if (pwrite(fd, sector, size, offset) != size) {
lib/geom/eli/geom_eli.c
1622
(void)g_flush(fd);
lib/geom/eli/geom_eli.c
1637
int fd;
lib/geom/eli/geom_eli.c
1654
fd = g_open(prov, 1);
lib/geom/eli/geom_eli.c
1655
if (fd == -1) {
lib/geom/eli/geom_eli.c
1660
offset = g_mediasize(fd) - g_sectorsize(fd);
lib/geom/eli/geom_eli.c
1665
(void)g_close(fd);
lib/geom/eli/geom_eli.c
1668
(void)eli_trash_metadata(req, prov, fd, offset);
lib/geom/eli/geom_eli.c
1669
(void)g_close(fd);
lib/geom/eli/geom_eli.c
375
int error, fd, i;
lib/geom/eli/geom_eli.c
396
fd = STDIN_FILENO;
lib/geom/eli/geom_eli.c
398
fd = open(file, O_RDONLY);
lib/geom/eli/geom_eli.c
399
if (fd == -1) {
lib/geom/eli/geom_eli.c
406
while ((done = read(fd, buf, sizeof(buf))) > 0)
lib/geom/eli/geom_eli.c
411
while ((done = read(fd, buf, sizeof(buf) - 1)) > 0) {
lib/geom/eli/geom_eli.c
431
close(fd);
lib/geom/eli/geom_eli.c
632
int fd;
lib/geom/eli/geom_eli.c
635
fd = open(prov, O_RDONLY);
lib/geom/eli/geom_eli.c
636
if (fd == -1) {
lib/geom/eli/geom_eli.c
641
if (read(fd, sector, sizeof(sector)) != sizeof(sector)) {
lib/geom/eli/geom_eli.c
644
close(fd);
lib/geom/eli/geom_eli.c
647
close(fd);
lib/geom/eli/geom_eli.c
689
int fd;
lib/geom/eli/geom_eli.c
692
fd = open(prov, O_WRONLY | O_TRUNC);
lib/geom/eli/geom_eli.c
693
if (fd == -1) {
lib/geom/eli/geom_eli.c
699
if (write(fd, sector, sizeof(sector)) != sizeof(sector)) {
lib/geom/eli/geom_eli.c
703
close(fd);
lib/geom/eli/geom_eli.c
706
close(fd);
lib/geom/label/geom_label.c
238
int i, nargs, fd;
lib/geom/label/geom_label.c
248
fd = g_open(name, 1);
lib/geom/label/geom_label.c
249
if (fd == -1) {
lib/geom/label/geom_label.c
254
(void)g_close(fd);
lib/geom/multipath/geom_multipath.c
157
int error, i, nargs, fd;
lib/geom/multipath/geom_multipath.c
255
fd = g_open(name2, 1);
lib/geom/multipath/geom_multipath.c
256
if (fd < 0) {
lib/geom/multipath/geom_multipath.c
261
if (pread(fd, rsector, secsize, disksize - secsize) !=
lib/geom/multipath/geom_multipath.c
265
g_close(fd);
lib/geom/multipath/geom_multipath.c
268
g_close(fd);
lib/geom/part/geom_part.c
1117
int fd;
lib/geom/part/geom_part.c
1131
fd = open(bootfile, O_RDONLY);
lib/geom/part/geom_part.c
1132
if (fd == -1)
lib/geom/part/geom_part.c
1137
if (read(fd, code, *size) != *size)
lib/geom/part/geom_part.c
1139
close(fd);
lib/geom/part/geom_part.c
1155
int error, fd;
lib/geom/part/geom_part.c
1190
fd = open(dsf, O_WRONLY);
lib/geom/part/geom_part.c
1191
if (fd == -1)
lib/geom/part/geom_part.c
1204
if (write(fd, buf, bsize) != bsize)
lib/geom/part/geom_part.c
1207
close(fd);
lib/geom/virstor/geom_virstor.c
164
int fd;
lib/geom/virstor/geom_virstor.c
310
fd = open(name, O_RDWR);
lib/geom/virstor/geom_virstor.c
313
fd = open(param, O_RDWR);
lib/geom/virstor/geom_virstor.c
315
if (fd < 0) {
lib/geom/virstor/geom_virstor.c
333
close(fd);
lib/geom/virstor/geom_virstor.c
345
written = write(fd, ((char *)map) + off,
lib/geom/virstor/geom_virstor.c
358
close(fd);
lib/geom/virstor/geom_virstor.c
365
close (fd);
lib/geom/virstor/geom_virstor.c
451
int fd;
lib/geom/virstor/geom_virstor.c
471
fd = open(name, O_RDWR);
lib/geom/virstor/geom_virstor.c
474
fd = open(param, O_RDWR);
lib/geom/virstor/geom_virstor.c
476
if (fd < 0) {
lib/lib80211/lib80211_regdomain.c
622
int fd;
lib/lib80211/lib80211_regdomain.c
626
fd = open(_PATH_REGDOMAIN, O_RDONLY);
lib/lib80211/lib80211_regdomain.c
627
if (fd < 0) {
lib/lib80211/lib80211_regdomain.c
634
if (fstat(fd, &sb) < 0) {
lib/lib80211/lib80211_regdomain.c
638
close(fd);
lib/lib80211/lib80211_regdomain.c
642
xml = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
lib/lib80211/lib80211_regdomain.c
647
close(fd);
lib/lib80211/lib80211_regdomain.c
656
close(fd);
lib/lib80211/lib80211_regdomain.c
661
close(fd);
lib/libbe/be.c
1089
be_export(libbe_handle_t *lbh, const char *bootenv, int fd)
lib/libbe/be.c
1106
err = zfs_send_one(zfs, NULL, fd, &flags, /* redactbook */ NULL);
lib/libbe/be.c
1114
be_import(libbe_handle_t *lbh, const char *bootenv, int fd)
lib/libbe/be.c
1124
if ((err = zfs_receive(lbh->lzh, buf, NULL, &flags, fd, NULL)) != 0) {
lib/libbe/be.h
108
int be_export(libbe_handle_t *, const char *, int fd);
lib/libbe/be.h
109
int be_import(libbe_handle_t *, const char *, int fd);
lib/libbsdstat/bsdstat.c
102
fprintf(fd, "%*s", f->width, f->label);
lib/libbsdstat/bsdstat.c
104
putc(*cp, fd);
lib/libbsdstat/bsdstat.c
106
putc('\n', fd);
lib/libbsdstat/bsdstat.c
110
bsdstat_print_current(struct bsdstat *sf, FILE *fd)
lib/libbsdstat/bsdstat.c
123
fprintf(fd, "%*s", f->width, buf);
lib/libbsdstat/bsdstat.c
125
putc(*cp, fd);
lib/libbsdstat/bsdstat.c
127
putc('\n', fd);
lib/libbsdstat/bsdstat.c
131
bsdstat_print_total(struct bsdstat *sf, FILE *fd)
lib/libbsdstat/bsdstat.c
144
fprintf(fd, "%*s", f->width, buf);
lib/libbsdstat/bsdstat.c
146
putc(*cp, fd);
lib/libbsdstat/bsdstat.c
148
putc('\n', fd);
lib/libbsdstat/bsdstat.c
152
bsdstat_print_verbose(struct bsdstat *sf, FILE *fd)
lib/libbsdstat/bsdstat.c
167
fprintf(fd, "%-*s %s\n", width, s, f->desc);
lib/libbsdstat/bsdstat.c
172
bsdstat_print_fields(struct bsdstat *sf, FILE *fd)
lib/libbsdstat/bsdstat.c
185
fprintf(fd, "%-*s %s\n", width, f->name, f->desc);
lib/libbsdstat/bsdstat.c
91
bsdstat_print_header(struct bsdstat *sf, FILE *fd)
lib/libbsdstat/bsdstat.h
104
static void _t##_print_header(struct _t *wf, FILE *fd) \
lib/libbsdstat/bsdstat.h
105
{ wf->base.print_header(&wf->base, fd); } \
lib/libbsdstat/bsdstat.h
106
static void _t##_print_current(struct _t *wf, FILE *fd) \
lib/libbsdstat/bsdstat.h
107
{ wf->base.print_current(&wf->base, fd); } \
lib/libbsdstat/bsdstat.h
108
static void _t##_print_total(struct _t *wf, FILE *fd) \
lib/libbsdstat/bsdstat.h
109
{ wf->base.print_total(&wf->base, fd); } \
lib/libbsdstat/bsdstat.h
110
static void _t##_print_verbose(struct _t *wf, FILE *fd) \
lib/libbsdstat/bsdstat.h
111
{ wf->base.print_verbose(&wf->base, fd); } \
lib/libbsdstat/bsdstat.h
112
static void _t##_print_fields(struct _t *wf, FILE *fd) \
lib/libbsdstat/bsdstat.h
113
{ wf->base.print_fields(&wf->base, fd); }
lib/libc/db/btree/bt_close.c
101
return (_close(fd) ? RET_ERROR : RET_SUCCESS);
lib/libc/db/btree/bt_close.c
63
int fd;
lib/libc/db/btree/bt_close.c
98
fd = t->bt_fd;
lib/libc/db/btree/bt_open.c
174
dbp->fd = __bt_fd;
lib/libc/db/btree/bt_open.c
387
int fd, len;
lib/libc/db/btree/bt_open.c
401
if ((fd = mkostemp(path, O_CLOEXEC)) != -1)
lib/libc/db/btree/bt_open.c
404
return(fd);
lib/libc/db/db/db.c
95
dbp->fd = (int (*)(const struct __db *))__dberr;
lib/libc/db/hash/hash.c
197
dbp->fd = hash_fd;
lib/libc/db/hash/hash_page.c
517
int fd, page, size, rsize;
lib/libc/db/hash/hash_page.c
520
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
523
if ((fd == -1) || !is_disk) {
lib/libc/db/hash/hash_page.c
531
if ((rsize = pread(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/hash/hash_page.c
571
int fd, page, size;
lib/libc/db/hash/hash_page.c
578
fd = hashp->fp;
lib/libc/db/hash/hash_page.c
600
if ((wsize = pwrite(fd, p, size, (off_t)page << hashp->BSHIFT)) == -1)
lib/libc/db/mpool/mpool.c
216
if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != (ssize_t)mp->pagesize) {
lib/libc/db/mpool/mpool.c
331
return (_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
lib/libc/db/mpool/mpool.c
407
if (pwrite(mp->fd, bp->page, mp->pagesize, off) != (ssize_t)mp->pagesize)
lib/libc/db/mpool/mpool.c
59
mpool_open(void *key, int fd, pgno_t pagesize, pgno_t maxcache)
lib/libc/db/mpool/mpool.c
71
if (_fstat(fd, &sb))
lib/libc/db/mpool/mpool.c
87
mp->fd = fd;
lib/libc/db/recno/rec_open.c
183
dbp->fd = __rec_fd;
lib/libc/db/test/dbtest.c
672
int fd;
lib/libc/db/test/dbtest.c
678
if ((fd = open(name, O_RDONLY, 0)) < 0 ||
lib/libc/db/test/dbtest.c
679
fstat(fd, &sb))
lib/libc/db/test/dbtest.c
687
(void)read(fd, p, (int)sb.st_size);
lib/libc/db/test/dbtest.c
689
(void)close(fd);
lib/libc/gen/closedir.c
50
int fd;
lib/libc/gen/closedir.c
54
fd = dirp->dd_fd;
lib/libc/gen/closedir.c
65
return (fd);
lib/libc/gen/dlfcn.c
258
fdlopen(int fd __unused, int mode __unused)
lib/libc/gen/eventfd.c
43
int eventfd_read(int fd, eventfd_t *value)
lib/libc/gen/eventfd.c
45
return (sizeof(*value) == _read(fd, value, sizeof(*value)) ? 0 : -1);
lib/libc/gen/eventfd.c
48
int eventfd_write(int fd, eventfd_t value)
lib/libc/gen/eventfd.c
50
return (sizeof(value) == _write(fd, &value, sizeof(value)) ? 0 : -1);
lib/libc/gen/fdevname.c
36
fdevname_r(int fd, char *buf, int len)
lib/libc/gen/fdevname.c
43
if (_ioctl(fd, FIODGNAME, &fgn) == -1)
lib/libc/gen/fdevname.c
49
fdevname(int fd)
lib/libc/gen/fdevname.c
53
return (fdevname_r(fd, buf, sizeof(buf)));
lib/libc/gen/fdopendir.c
50
fdopendir(int fd)
lib/libc/gen/fdopendir.c
54
flags = _fcntl(fd, F_GETFD, 0);
lib/libc/gen/fdopendir.c
59
rc = _fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
lib/libc/gen/fdopendir.c
63
return (__opendir_common(fd, DTF_HIDEW | DTF_NODUP, true));
lib/libc/gen/freadlink.c
13
freadlink(int fd, char *buf, size_t bufsize)
lib/libc/gen/freadlink.c
15
return (readlinkat(fd, "", buf, bufsize));
lib/libc/gen/fts-compat.c
1166
fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
lib/libc/gen/fts-compat.c
1171
newfd = fd;
lib/libc/gen/fts-compat.c
1174
if (fd < 0 && (newfd = _open(path, O_RDONLY | O_CLOEXEC, 0)) < 0)
lib/libc/gen/fts-compat.c
1188
if (fd < 0)
lib/libc/gen/fts-compat.c
516
int fd;
lib/libc/gen/fts-compat.c
569
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
lib/libc/gen/fts-compat.c
572
if (fchdir(fd)) {
lib/libc/gen/fts-compat.c
573
(void)_close(fd);
lib/libc/gen/fts-compat.c
576
(void)_close(fd);
lib/libc/gen/fts-compat.c
81
#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
lib/libc/gen/fts-compat11.c
1145
fts_safe_changedir(FTS11 *sp, FTSENT11 *p, int fd, char *path)
lib/libc/gen/fts-compat11.c
1150
newfd = fd;
lib/libc/gen/fts-compat11.c
1153
if (fd < 0 && (newfd = _open(path, O_RDONLY | O_DIRECTORY |
lib/libc/gen/fts-compat11.c
1168
if (fd < 0)
lib/libc/gen/fts-compat11.c
510
int fd, rc, serrno;
lib/libc/gen/fts-compat11.c
563
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
lib/libc/gen/fts-compat11.c
567
rc = fchdir(fd);
lib/libc/gen/fts-compat11.c
570
(void)_close(fd);
lib/libc/gen/fts-compat11.c
70
#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
lib/libc/gen/fts.c
1272
fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
lib/libc/gen/fts.c
1278
newfd = fd;
lib/libc/gen/fts.c
1281
if (fd < 0 && (newfd = _open(path, O_RDONLY | O_DIRECTORY |
lib/libc/gen/fts.c
1302
if (fd < 0)
lib/libc/gen/fts.c
621
int fd, rc, serrno;
lib/libc/gen/fts.c
674
if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
lib/libc/gen/fts.c
678
rc = fchdir(fd);
lib/libc/gen/fts.c
681
(void)_close(fd);
lib/libc/gen/fts.c
83
#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
lib/libc/gen/getcap.c
183
getent(char **cap, u_int *len, char **db_array, int fd, const char *name,
lib/libc/gen/getcap.c
235
if (fd >= 0) {
lib/libc/gen/getcap.c
236
(void)lseek(fd, (off_t)0, SEEK_SET);
lib/libc/gen/getcap.c
263
fd = _open(*db_p, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/getcap.c
264
if (fd < 0)
lib/libc/gen/getcap.c
298
n = _read(fd, buf, sizeof(buf));
lib/libc/gen/getcap.c
301
(void)_close(fd);
lib/libc/gen/getcap.c
306
fd = -1;
lib/libc/gen/getcap.c
340
(void)_close(fd);
lib/libc/gen/getcap.c
424
iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
lib/libc/gen/getcap.c
432
(void)_close(fd);
lib/libc/gen/getcap.c
482
(void)_close(fd);
lib/libc/gen/getcap.c
514
(void)_close(fd);
lib/libc/gen/getcwd.c
139
fd = _openat(dir != NULL ? _dirfd(dir) : AT_FDCWD,
lib/libc/gen/getcwd.c
141
if (fd == -1)
lib/libc/gen/getcwd.c
145
if (!(dir = fdopendir(fd)) || _fstat(_dirfd(dir), &s)) {
lib/libc/gen/getcwd.c
146
_close(fd);
lib/libc/gen/getcwd.c
69
int fd;
lib/libc/gen/inotify.c
22
inotify_add_watch(int fd, const char *pathname, uint32_t mask)
lib/libc/gen/inotify.c
24
return (inotify_add_watch_at(fd, AT_FDCWD, pathname, mask));
lib/libc/gen/isatty.c
36
isatty(int fd)
lib/libc/gen/isatty.c
41
retval = (tcgetattr(fd, &t) != -1);
lib/libc/gen/memfd_create.c
120
error = ioctl(fd, FIOSSHMLPGCNF, &slc);
lib/libc/gen/memfd_create.c
123
return (fd);
lib/libc/gen/memfd_create.c
127
close(fd);
lib/libc/gen/memfd_create.c
57
int error, fd, npgs, oflags, pgidx, saved_errno, shmflags;
lib/libc/gen/memfd_create.c
91
fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name);
lib/libc/gen/memfd_create.c
92
if (fd == -1 || (flags & MFD_HUGETLB) == 0)
lib/libc/gen/memfd_create.c
93
return (fd);
lib/libc/gen/nlist.c
124
__elf_fdnlist(int fd, struct nlist *list)
lib/libc/gen/nlist.c
139
if (lseek(fd, 0, SEEK_SET) == -1 ||
lib/libc/gen/nlist.c
140
_read(fd, &ehdr, sizeof(Elf_Ehdr)) != sizeof(Elf_Ehdr) ||
lib/libc/gen/nlist.c
142
_fstat(fd, &st) < 0)
lib/libc/gen/nlist.c
155
base = mmap(NULL, (size_t)shdr_size, PROT_READ, MAP_PRIVATE, fd,
lib/libc/gen/nlist.c
218
MAP_PRIVATE, fd, (off_t)stroff);
lib/libc/gen/nlist.c
222
nent = elf_scan_symtab(shdr, ehdr.e_shnum, fd, symoff, symsize,
lib/libc/gen/nlist.c
236
elf_scan_symtab(Elf_Shdr *shdr, int shnum, int fd, off_t symoff, size_t symsize,
lib/libc/gen/nlist.c
246
if (lseek(fd, symoff, SEEK_SET) == -1)
lib/libc/gen/nlist.c
250
if (_read(fd, sbuf, cc) != cc)
lib/libc/gen/nlist.c
57
int fd, n;
lib/libc/gen/nlist.c
59
fd = _open(name, O_RDONLY | O_CLOEXEC, 0);
lib/libc/gen/nlist.c
60
if (fd < 0)
lib/libc/gen/nlist.c
62
n = __fdnlist(fd, list);
lib/libc/gen/nlist.c
63
(void)_close(fd);
lib/libc/gen/nlist.c
68
int (*fn)(int fd, struct nlist *list);
lib/libc/gen/nlist.c
74
__fdnlist(int fd, struct nlist *list)
lib/libc/gen/nlist.c
80
n = (nlist_fn[i].fn)(fd, list);
lib/libc/gen/opendir2.c
250
is_unionstack(int fd)
lib/libc/gen/opendir2.c
256
return (_fcntl(fd, F_ISUNIONSTACK, 0) > 0);
lib/libc/gen/opendir2.c
263
__opendir_common(int fd, int flags, bool use_current_pos)
lib/libc/gen/opendir2.c
275
dirp->dd_fd = fd;
lib/libc/gen/opendir2.c
298
unionstack = is_unionstack(fd);
lib/libc/gen/opendir2.c
50
int fd;
lib/libc/gen/opendir2.c
56
if ((fd = _open(name, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/gen/opendir2.c
59
dir = __opendir_common(fd, flags, false);
lib/libc/gen/opendir2.c
62
_close(fd);
lib/libc/gen/posix_spawn.c
162
int fd, saved_errno;
lib/libc/gen/posix_spawn.c
167
fd = _open(fae->fae_path, fae->fae_oflag, fae->fae_mode);
lib/libc/gen/posix_spawn.c
168
if (fd < 0)
lib/libc/gen/posix_spawn.c
170
if (fd != fae->fae_fildes) {
lib/libc/gen/posix_spawn.c
171
if (_dup2(fd, fae->fae_fildes) == -1) {
lib/libc/gen/posix_spawn.c
173
(void)_close(fd);
lib/libc/gen/posix_spawn.c
176
if (_close(fd) != 0) {
lib/libc/gen/pututxline.c
180
int fd;
lib/libc/gen/pututxline.c
183
fd = _open(_PATH_UTX_ACTIVE, O_CREAT|O_RDWR|O_TRUNC, 0644);
lib/libc/gen/pututxline.c
184
if (fd < 0)
lib/libc/gen/pututxline.c
186
_write(fd, fu, sizeof(*fu));
lib/libc/gen/pututxline.c
187
_close(fd);
lib/libc/gen/pututxline.c
238
int fd;
lib/libc/gen/pututxline.c
240
fd = _open(_PATH_UTX_LASTLOGIN, O_RDWR|O_CLOEXEC, 0644);
lib/libc/gen/pututxline.c
241
if (fd < 0)
lib/libc/gen/pututxline.c
249
if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0)
lib/libc/gen/pututxline.c
250
ftruncate(fd, 0);
lib/libc/gen/pututxline.c
251
_close(fd);
lib/libc/gen/pututxline.c
258
int error, fd;
lib/libc/gen/pututxline.c
274
fd = _open(_PATH_UTX_LOG, O_CREAT|O_WRONLY|O_APPEND|O_CLOEXEC, 0644);
lib/libc/gen/pututxline.c
275
if (fd < 0)
lib/libc/gen/pututxline.c
277
if (_writev(fd, vec, 2) == -1)
lib/libc/gen/pututxline.c
281
_close(fd);
lib/libc/gen/pututxline.c
47
int fd;
lib/libc/gen/pututxline.c
49
fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK|O_CLOEXEC, 0644);
lib/libc/gen/pututxline.c
50
if (fd < 0)
lib/libc/gen/pututxline.c
54
if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) {
lib/libc/gen/pututxline.c
55
_close(fd);
lib/libc/gen/pututxline.c
60
fp = fdopen(fd, "r+");
lib/libc/gen/pututxline.c
62
_close(fd);
lib/libc/gen/scandir.c
209
int fd, ret, serrno;
lib/libc/gen/scandir.c
211
fd = _openat(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
lib/libc/gen/scandir.c
212
if (fd == -1)
lib/libc/gen/scandir.c
220
(fd, namelist, select, dcomp);
lib/libc/gen/scandir.c
222
_close(fd);
lib/libc/gen/sem_new.c
146
int errsave, fd, len, mode, value;
lib/libc/gen/sem_new.c
150
fd = -1;
lib/libc/gen/sem_new.c
173
fd = -1;
lib/libc/gen/sem_new.c
179
fd = _open(path, flags | O_RDWR | O_CLOEXEC |
lib/libc/gen/sem_new.c
181
if (fd == -1 || _fstat(fd, &sb) == -1) {
lib/libc/gen/sem_new.c
195
_close(fd);
lib/libc/gen/sem_new.c
210
if (fd == -1) {
lib/libc/gen/sem_new.c
211
fd = _open(path, flags | O_RDWR | O_CLOEXEC | O_EXLOCK, mode);
lib/libc/gen/sem_new.c
212
if (fd == -1 || _fstat(fd, &sb) == -1)
lib/libc/gen/sem_new.c
219
if (_write(fd, &tmp, sizeof(tmp)) != sizeof(tmp))
lib/libc/gen/sem_new.c
222
flock(fd, LOCK_UN);
lib/libc/gen/sem_new.c
224
MAP_SHARED | MAP_NOSYNC, fd, 0);
lib/libc/gen/sem_new.c
240
_close(fd);
lib/libc/gen/sem_new.c
246
if (fd != -1)
lib/libc/gen/sem_new.c
247
_close(fd);
lib/libc/gen/statvfs.c
43
fstatvfs(int fd, struct statvfs *result)
lib/libc/gen/statvfs.c
49
rv = _fstatfs(fd, &sfs);
lib/libc/gen/statvfs.c
61
pcval = _fpathconf(fd, _PC_NAME_MAX);
lib/libc/gen/syslog.c
140
int cnt, fd, saved_errno;
lib/libc/gen/syslog.c
318
(fd = _open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK|O_CLOEXEC, 0)) >=
lib/libc/gen/syslog.c
329
(void)_writev(fd, iov, 2);
lib/libc/gen/syslog.c
330
(void)_close(fd);
lib/libc/gen/termios.c
102
if (_ioctl(fd, TIOCGSID, &s) < 0)
lib/libc/gen/termios.c
109
tcsetsid(int fd, pid_t pid)
lib/libc/gen/termios.c
117
return (_ioctl(fd, TIOCSCTTY, NULL));
lib/libc/gen/termios.c
194
tcsendbreak(int fd, int len __unused)
lib/libc/gen/termios.c
200
if (_ioctl(fd, TIOCSBRK, 0) == -1)
lib/libc/gen/termios.c
203
if (_ioctl(fd, TIOCCBRK, 0) == -1)
lib/libc/gen/termios.c
209
__libc_tcdrain(int fd)
lib/libc/gen/termios.c
212
return (_ioctl(fd, TIOCDRAIN, 0));
lib/libc/gen/termios.c
217
tcdrain(int fd)
lib/libc/gen/termios.c
221
__libc_interposing[INTERPOS_tcdrain])(fd));
lib/libc/gen/termios.c
228
tcflush(int fd, int which)
lib/libc/gen/termios.c
246
return (_ioctl(fd, TIOCFLUSH, &com));
lib/libc/gen/termios.c
250
tcflow(int fd, int action)
lib/libc/gen/termios.c
257
return (_ioctl(fd, TIOCSTOP, 0));
lib/libc/gen/termios.c
259
return (_ioctl(fd, TIOCSTART, 0));
lib/libc/gen/termios.c
262
if (tcgetattr(fd, &term) == -1)
lib/libc/gen/termios.c
265
if (c != _POSIX_VDISABLE && _write(fd, &c, sizeof(c)) == -1)
lib/libc/gen/termios.c
276
tcgetwinsize(int fd, struct winsize *w)
lib/libc/gen/termios.c
279
return (_ioctl(fd, TIOCGWINSZ, w));
lib/libc/gen/termios.c
283
tcsetwinsize(int fd, const struct winsize *w)
lib/libc/gen/termios.c
286
return (_ioctl(fd, TIOCSWINSZ, w));
lib/libc/gen/termios.c
48
tcgetattr(int fd, struct termios *t)
lib/libc/gen/termios.c
51
return (_ioctl(fd, TIOCGETA, t));
lib/libc/gen/termios.c
55
tcsetattr(int fd, int opt, const struct termios *t)
lib/libc/gen/termios.c
66
return (_ioctl(fd, TIOCSETA, t));
lib/libc/gen/termios.c
68
return (_ioctl(fd, TIOCSETAW, t));
lib/libc/gen/termios.c
70
return (_ioctl(fd, TIOCSETAF, t));
lib/libc/gen/termios.c
78
tcsetpgrp(int fd, pid_t pgrp)
lib/libc/gen/termios.c
83
return (_ioctl(fd, TIOCSPGRP, &s));
lib/libc/gen/termios.c
87
tcgetpgrp(int fd)
lib/libc/gen/termios.c
91
if (_ioctl(fd, TIOCGPGRP, &s) < 0)
lib/libc/gen/termios.c
98
tcgetsid(int fd)
lib/libc/gen/ttyname.c
108
if (ttyname_r(fd, buf, sizeof ttyname_buf) != 0)
lib/libc/gen/ttyname.c
57
__ssp_real(ttyname_r)(int fd, char *buf, size_t len)
lib/libc/gen/ttyname.c
68
if (!isatty(fd))
lib/libc/gen/ttyname.c
76
if (fdevname_r(fd, buf + used, len - used) == NULL)
lib/libc/gen/ttyname.c
88
ttyname(int fd)
lib/libc/gen/wordexp.c
104
nwritten = _write(fd, buffer + done, len - done);
lib/libc/gen/wordexp.c
79
we_read_fully(int fd, char *buffer, size_t len)
lib/libc/gen/wordexp.c
86
nread = _read(fd, buffer + done, len - done);
lib/libc/gen/wordexp.c
97
we_write_fully(int fd, const char *buffer, size_t len)
lib/libc/gmon/gmon.c
112
int fd;
lib/libc/gmon/gmon.c
154
fd = _open(outname, O_CREAT|O_TRUNC|O_WRONLY|O_CLOEXEC, 0666);
lib/libc/gmon/gmon.c
155
if (fd < 0) {
lib/libc/gmon/gmon.c
176
_write(fd, (char *)hdr, sizeof *hdr);
lib/libc/gmon/gmon.c
177
_write(fd, p->kcount, p->kcountsize);
lib/libc/gmon/gmon.c
197
_write(fd, &rawarc, sizeof rawarc);
lib/libc/gmon/gmon.c
200
_close(fd);
lib/libc/iconv/citrus_mmap.c
56
int fd, ret;
lib/libc/iconv/citrus_mmap.c
62
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1)
lib/libc/iconv/citrus_mmap.c
65
if (_fstat(fd, &st) == -1) {
lib/libc/iconv/citrus_mmap.c
75
fd, (off_t)0);
lib/libc/iconv/citrus_mmap.c
83
(void)_close(fd);
lib/libc/isc/ev_streams.c
106
new->fd = fd;
lib/libc/isc/ev_streams.c
108
if (evSelectFD(opaqueCtx, fd, EV_READ, readable, new, &new->file) < 0)
lib/libc/isc/ev_streams.c
265
writable(evContext opaqueCtx, void *uap, int fd, int evmask) {
lib/libc/isc/ev_streams.c
271
bytes = writev(fd, str->iovCur, str->iovCurCount);
lib/libc/isc/ev_streams.c
288
readable(evContext opaqueCtx, void *uap, int fd, int evmask) {
lib/libc/isc/ev_streams.c
294
bytes = readv(fd, str->iovCur, str->iovCurCount);
lib/libc/isc/ev_streams.c
46
static void writable(evContext opaqueCtx, void *uap, int fd, int evmask);
lib/libc/isc/ev_streams.c
47
static void readable(evContext opaqueCtx, void *uap, int fd, int evmask);
lib/libc/isc/ev_streams.c
62
evWrite(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
lib/libc/isc/ev_streams.c
72
new->fd = fd;
lib/libc/isc/ev_streams.c
74
if (evSelectFD(opaqueCtx, fd, EV_WRITE, writable, new, &new->file) < 0)
lib/libc/isc/ev_streams.c
96
evRead(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
lib/libc/isc/eventlib_p.h
119
int fd;
lib/libc/isc/eventlib_p.h
135
int fd;
lib/libc/isc/eventlib_p.h
196
extern short *__fd_eventfield(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
198
extern void __fd_clr(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
199
extern void __fd_set(int fd, __evEmulMask *maskp);
lib/libc/isc/eventlib_p.h
205
#define FD_SET(fd, maskp) \
lib/libc/isc/eventlib_p.h
206
__fd_set(fd, maskp)
lib/libc/isc/eventlib_p.h
209
#define FD_CLR(fd, maskp) \
lib/libc/isc/eventlib_p.h
210
__fd_clr(fd, maskp)
lib/libc/isc/eventlib_p.h
213
#define FD_ISSET(fd, maskp) \
lib/libc/isc/eventlib_p.h
214
((*__fd_eventfield(fd, maskp) & __poll_event(maskp)) != 0)
lib/libc/isc/eventlib_p.h
271
extern int evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd);
lib/libc/isc/eventlib_p.h
82
int fd;
lib/libc/isc/eventlib_p.h
94
int fd;
lib/libc/locale/collate.c
136
int fd;
lib/libc/locale/collate.c
149
if ((fd = _open(buf, O_RDONLY | O_CLOEXEC)) < 0) {
lib/libc/locale/collate.c
154
if (_fstat(fd, &sbuf) < 0) {
lib/libc/locale/collate.c
155
(void) _close(fd);
lib/libc/locale/collate.c
161
(void) _close(fd);
lib/libc/locale/collate.c
165
map = mmap(NULL, sbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
lib/libc/locale/collate.c
166
(void) _close(fd);
lib/libc/locale/ldpart.c
106
if (_read(fd, p, (size_t) st.st_size) != st.st_size)
lib/libc/locale/ldpart.c
124
(void)_close(fd);
lib/libc/locale/ldpart.c
145
(void)_close(fd);
lib/libc/locale/ldpart.c
55
int saverr, fd, i, num_lines;
lib/libc/locale/ldpart.c
90
if ((fd = _open(filename, O_RDONLY | O_CLOEXEC)) < 0)
lib/libc/locale/ldpart.c
92
if (_fstat(fd, &st) != 0)
lib/libc/locale/rune.c
69
int fd;
lib/libc/locale/rune.c
71
if ((fd = _open(fname, O_RDONLY | O_CLOEXEC)) < 0) {
lib/libc/locale/rune.c
76
if (_fstat(fd, &sb) < 0) {
lib/libc/locale/rune.c
77
(void) _close(fd);
lib/libc/locale/rune.c
83
(void) _close(fd);
lib/libc/locale/rune.c
89
fdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
lib/libc/locale/rune.c
90
(void) _close(fd);
lib/libc/net/getaddrinfo.c
1669
int fd;
lib/libc/net/getaddrinfo.c
1671
if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
lib/libc/net/getaddrinfo.c
1675
if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) {
lib/libc/net/getaddrinfo.c
1676
_close(fd);
lib/libc/net/getaddrinfo.c
1679
_close(fd);
lib/libc/nls/msgcat.c
393
int fd, saved_errno;
lib/libc/nls/msgcat.c
411
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/nls/msgcat.c
416
if (_fstat(fd, &st) != 0) {
lib/libc/nls/msgcat.c
418
_close(fd);
lib/libc/nls/msgcat.c
425
_close(fd);
lib/libc/nls/msgcat.c
436
_close(fd);
lib/libc/nls/msgcat.c
441
data = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
lib/libc/nls/msgcat.c
444
_close(fd);
lib/libc/nls/msgcat.c
448
_close(fd);
lib/libc/posix1e/acl_get.c
103
acl_get_fd(int fd)
lib/libc/posix1e/acl_get.c
105
if (fpathconf(fd, _PC_ACL_NFS4) == 1)
lib/libc/posix1e/acl_get.c
106
return (acl_get_fd_np(fd, ACL_TYPE_NFS4));
lib/libc/posix1e/acl_get.c
108
return (acl_get_fd_np(fd, ACL_TYPE_ACCESS));
lib/libc/posix1e/acl_get.c
112
acl_get_fd_np(int fd, acl_type_t type)
lib/libc/posix1e/acl_get.c
122
error = ___acl_get_fd(fd, type, &aclp->ats_acl);
lib/libc/posix1e/acl_set.c
101
return (acl_set_fd_np(fd, acl, ACL_TYPE_ACCESS));
lib/libc/posix1e/acl_set.c
105
acl_set_fd_np(int fd, acl_t acl, acl_type_t type)
lib/libc/posix1e/acl_set.c
122
return (___acl_set_fd(fd, type, &acl->ats_acl));
lib/libc/posix1e/acl_set.c
95
acl_set_fd(int fd, acl_t acl)
lib/libc/posix1e/acl_set.c
98
if (fpathconf(fd, _PC_ACL_NFS4) == 1)
lib/libc/posix1e/acl_set.c
99
return (acl_set_fd_np(fd, acl, ACL_TYPE_NFS4));
lib/libc/posix1e/acl_valid.c
109
acl_valid_fd_np(int fd, acl_type_t type, acl_t acl)
lib/libc/posix1e/acl_valid.c
122
return (___acl_aclcheck_fd(fd, type, &acl->ats_acl));
lib/libc/posix1e/mac_get.c
38
extern int __mac_get_fd(int fd, struct mac *mac_p);
lib/libc/posix1e/mac_get.c
45
mac_get_fd(int fd, struct mac *label)
lib/libc/posix1e/mac_get.c
48
return (__mac_get_fd(fd, label));
lib/libc/posix1e/mac_get.c
66
mac_get_peer(int fd, struct mac *label)
lib/libc/posix1e/mac_get.c
71
return (getsockopt(fd, SOL_SOCKET, SO_PEERLABEL, label, &len));
lib/libc/posix1e/mac_set.c
37
extern int __mac_set_fd(int fd, struct mac *mac_p);
lib/libc/posix1e/mac_set.c
43
mac_set_fd(int fd, struct mac *label)
lib/libc/posix1e/mac_set.c
46
return (__mac_set_fd(fd, label));
lib/libc/resolv/res_send.c
388
int fd;
lib/libc/resolv/res_send.c
394
fd = EXT(statp).nssocks[0];
lib/libc/resolv/res_send.c
407
EXT(statp).nssocks[lastns] = fd;
lib/libc/resolv/res_send.c
952
pollfd.fd = s;
lib/libc/rpc/clnt_bcast.c
260
int fd; /* File descriptor */
lib/libc/rpc/clnt_bcast.c
306
int fd;
lib/libc/rpc/clnt_bcast.c
321
fd = _socket(si.si_af, si.si_socktype, si.si_proto);
lib/libc/rpc/clnt_bcast.c
322
if (fd < 0) {
lib/libc/rpc/clnt_bcast.c
328
fdlist[fdlistno].fd = fd;
lib/libc/rpc/clnt_bcast.c
333
pfd[fdlistno].fd = fdlist[fdlistno].fd = fd;
lib/libc/rpc/clnt_bcast.c
345
_close(fd);
lib/libc/rpc/clnt_bcast.c
448
__rpc_broadenable(fdlist[i].af, fdlist[i].fd,
lib/libc/rpc/clnt_bcast.c
456
if (_sendto(fdlist[i].fd, outbuf,
lib/libc/rpc/clnt_bcast.c
481
if (_sendto(fdlist[i].fd, outbuf_pmap,
lib/libc/rpc/clnt_bcast.c
533
pfd[i].fd = -1;
lib/libc/rpc/clnt_bcast.c
543
inlen = _recvfrom(fdlist[i].fd, inbuf, fdlist[i].dsize,
lib/libc/rpc/clnt_bcast.c
640
(void)_close(fdlist[i].fd);
lib/libc/rpc/clnt_dg.c
102
int fd;
lib/libc/rpc/clnt_dg.c
108
if (a->fd > b->fd) {
lib/libc/rpc/clnt_dg.c
110
} else if (a->fd < b->fd) {
lib/libc/rpc/clnt_dg.c
126
dg_fd_find(int fd)
lib/libc/rpc/clnt_dg.c
130
key.fd = fd;
lib/libc/rpc/clnt_dg.c
134
elem->fd = fd;
lib/libc/rpc/clnt_dg.c
201
clnt_dg_create(int fd, const struct netbuf *svcaddr, rpcprog_t program,
lib/libc/rpc/clnt_dg.c
216
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/clnt_dg.c
272
(void)bindresvport_sa(fd, (struct sockaddr *)svcaddr->buf);
lib/libc/rpc/clnt_dg.c
274
_ioctl(fd, FIONBIO, (char *)(void *)&one);
lib/libc/rpc/clnt_dg.c
282
cu->cu_fd = fd;
lib/libc/rpc/clnt_generic.c
325
clnt_tli_create(int fd, const struct netconfig *nconf,
lib/libc/rpc/clnt_generic.c
336
if (fd == RPC_ANYFD) {
lib/libc/rpc/clnt_generic.c
342
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/clnt_generic.c
344
if (fd == -1)
lib/libc/rpc/clnt_generic.c
346
if (fd < __rpc_minfd)
lib/libc/rpc/clnt_generic.c
347
fd = __rpc_raise_fd(fd);
lib/libc/rpc/clnt_generic.c
350
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_generic.c
352
bindresvport(fd, NULL);
lib/libc/rpc/clnt_generic.c
354
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_generic.c
370
cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz);
lib/libc/rpc/clnt_generic.c
374
_setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one,
lib/libc/rpc/clnt_generic.c
377
cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz);
lib/libc/rpc/clnt_generic.c
380
cl = clnt_dg_create(fd, svcaddr, prog, vers, sendsz, recvsz);
lib/libc/rpc/clnt_generic.c
406
(void)_close(fd);
lib/libc/rpc/clnt_generic.c
419
__rpc_raise_fd(int fd)
lib/libc/rpc/clnt_generic.c
423
if (fd >= __rpc_minfd)
lib/libc/rpc/clnt_generic.c
424
return (fd);
lib/libc/rpc/clnt_generic.c
426
if ((nfd = _fcntl(fd, F_DUPFD, __rpc_minfd)) == -1)
lib/libc/rpc/clnt_generic.c
427
return (fd);
lib/libc/rpc/clnt_generic.c
431
return (fd);
lib/libc/rpc/clnt_generic.c
434
if (_close(fd) == -1) {
lib/libc/rpc/clnt_generic.c
437
"could not close() fd %d; mem & fd leak", fd);
lib/libc/rpc/clnt_simple.c
156
int fd;
lib/libc/rpc/clnt_simple.c
178
if (CLNT_CONTROL(rcp->client, CLGET_FD, (char *)(void *)&fd))
lib/libc/rpc/clnt_simple.c
179
_fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
lib/libc/rpc/clnt_vc.c
131
int fd;
lib/libc/rpc/clnt_vc.c
137
if (a->fd > b->fd) {
lib/libc/rpc/clnt_vc.c
139
} else if (a->fd < b->fd) {
lib/libc/rpc/clnt_vc.c
155
vc_fd_find(int fd)
lib/libc/rpc/clnt_vc.c
159
key.fd = fd;
lib/libc/rpc/clnt_vc.c
163
elem->fd = fd;
lib/libc/rpc/clnt_vc.c
200
clnt_vc_create(int fd, const struct netbuf *raddr, const rpcprog_t prog,
lib/libc/rpc/clnt_vc.c
230
if (_getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/clnt_vc.c
237
if (_connect(fd, (struct sockaddr *)raddr->buf, raddr->len) < 0){
lib/libc/rpc/clnt_vc.c
245
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/clnt_vc.c
253
ct->ct_fd = fd;
lib/libc/rpc/clnt_vc.c
280
(void)_close(fd);
lib/libc/rpc/clnt_vc.c
668
struct pollfd fd;
lib/libc/rpc/clnt_vc.c
674
fd.fd = ct->ct_fd;
lib/libc/rpc/clnt_vc.c
675
fd.events = POLLIN;
lib/libc/rpc/clnt_vc.c
677
switch (_poll(&fd, 1, milliseconds)) {
lib/libc/rpc/getpublickey.c
100
fclose(fd);
lib/libc/rpc/getpublickey.c
127
fclose(fd);
lib/libc/rpc/getpublickey.c
154
fclose(fd);
lib/libc/rpc/getpublickey.c
90
FILE *fd;
lib/libc/rpc/getpublickey.c
94
fd = fopen(PKFILE, "r");
lib/libc/rpc/getpublickey.c
95
if (fd == NULL)
lib/libc/rpc/getpublickey.c
98
res = fgets(buf, sizeof(buf), fd);
lib/libc/rpc/key_call.c
300
int fd;
lib/libc/rpc/key_call.c
405
if (clnt_control(kcp->client, CLGET_FD, (char *)&fd))
lib/libc/rpc/key_call.c
406
_fcntl(fd, F_SETFD, 1); /* make it "close on exec" */
lib/libc/rpc/netnamer.c
235
FILE *fd;
lib/libc/rpc/netnamer.c
246
fd = fopen(NETIDFILE, "r");
lib/libc/rpc/netnamer.c
247
if (fd == NULL) {
lib/libc/rpc/netnamer.c
255
while (fd != NULL) {
lib/libc/rpc/netnamer.c
256
res = fgets(buf, sizeof(buf), fd);
lib/libc/rpc/netnamer.c
316
if (fd != NULL)
lib/libc/rpc/netnamer.c
317
fclose(fd);
lib/libc/rpc/rpc_generic.c
439
__rpcgettp(int fd)
lib/libc/rpc/rpc_generic.c
444
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/rpc_generic.c
455
__rpc_fd2sockinfo(int fd, struct __rpc_sockinfo *sip)
lib/libc/rpc/rpc_generic.c
462
if (_getsockname(fd, (struct sockaddr *)(void *)&ss, &len) < 0)
lib/libc/rpc/rpc_generic.c
467
if (_getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len) < 0)
lib/libc/rpc/rpc_generic.c
797
__rpc_sockisbound(int fd)
lib/libc/rpc/rpc_generic.c
803
if (_getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0)
lib/libc/rpc/rpc_soc.c
101
if (fd == RPC_ANYSOCK) {
lib/libc/rpc/rpc_soc.c
102
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpc_soc.c
103
if (fd == -1)
lib/libc/rpc/rpc_soc.c
127
bindresvport(fd, NULL);
lib/libc/rpc/rpc_soc.c
128
cl = clnt_tli_create(fd, nconf, &bindaddr, prog, vers,
lib/libc/rpc/rpc_soc.c
136
*sockp = fd;
lib/libc/rpc/rpc_soc.c
149
(void)_close(fd);
lib/libc/rpc/rpc_soc.c
199
svc_com_create(int fd, u_int sendsize, u_int recvsize, char *netid)
lib/libc/rpc/rpc_soc.c
211
if (fd == RPC_ANYSOCK) {
lib/libc/rpc/rpc_soc.c
212
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpc_soc.c
213
if (fd == -1) {
lib/libc/rpc/rpc_soc.c
224
bindresvport(fd, &sin);
lib/libc/rpc/rpc_soc.c
225
_listen(fd, SOMAXCONN);
lib/libc/rpc/rpc_soc.c
226
svc = svc_tli_create(fd, nconf, NULL, sendsize, recvsize);
lib/libc/rpc/rpc_soc.c
230
(void)_close(fd);
lib/libc/rpc/rpc_soc.c
239
svctcp_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/rpc_soc.c
242
return svc_com_create(fd, sendsize, recvsize, "tcp");
lib/libc/rpc/rpc_soc.c
246
svcudp_bufcreate(int fd, u_int sendsz, u_int recvsz)
lib/libc/rpc/rpc_soc.c
249
return svc_com_create(fd, sendsz, recvsz, "udp");
lib/libc/rpc/rpc_soc.c
253
svcfd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/rpc_soc.c
256
return svc_fd_create(fd, sendsize, recvsize);
lib/libc/rpc/rpc_soc.c
261
svcudp_create(int fd)
lib/libc/rpc/rpc_soc.c
264
return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp");
lib/libc/rpc/rpc_soc.c
510
svcunixfd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/rpc_soc.c
512
return (svc_fd_create(fd, sendsize, recvsize));
lib/libc/rpc/rpc_soc.c
91
int fd = *sockp;
lib/libc/rpc/rpcb_clnt.c
461
int fd;
lib/libc/rpc/rpcb_clnt.c
480
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/rpcb_clnt.c
485
if (fd < 0)
lib/libc/rpc/rpcb_clnt.c
487
_close(fd);
lib/libc/rpc/svc.c
592
int bit, fd;
lib/libc/rpc/svc.c
603
fd = sock + bit - 1;
lib/libc/rpc/svc.c
604
svc_getreq_common(fd);
lib/libc/rpc/svc.c
610
svc_getreq_common(int fd)
lib/libc/rpc/svc.c
626
xprt = __svc_xports[fd];
lib/libc/rpc/svc.c
690
if (xprt != __svc_xports[fd]) {
lib/libc/rpc/svc.c
729
FD_CLR(p->fd, &svc_fdset);
lib/libc/rpc/svc.c
732
svc_getreq_common(p->fd);
lib/libc/rpc/svc_dg.c
101
svc_dg_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_dg.c
109
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/svc_dg.c
136
xprt->xp_fd = fd;
lib/libc/rpc/svc_dg.c
143
if (_getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/svc_dg.c
161
if (_setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR,
lib/libc/rpc/svc_dg.c
190
svc_dg_recvfrom(int fd, char *buf, int buflen,
lib/libc/rpc/svc_dg.c
213
rlen = _recvmsg(fd, &msg, 0);
lib/libc/rpc/svc_dg.c
294
svc_dg_sendto(int fd, char *buf, int buflen,
lib/libc/rpc/svc_dg.c
324
return _sendmsg(fd, &msg, 0);
lib/libc/rpc/svc_generic.c
194
svc_tli_create(int fd, const struct netconfig *nconf,
lib/libc/rpc/svc_generic.c
203
if (fd == RPC_ANYFD) {
lib/libc/rpc/svc_generic.c
208
fd = __rpc_nconf2fd(nconf);
lib/libc/rpc/svc_generic.c
209
if (fd == -1) {
lib/libc/rpc/svc_generic.c
221
if (!__rpc_fd2sockinfo(fd, &si)) {
lib/libc/rpc/svc_generic.c
231
if (madefd || !__rpc_sockisbound(fd)) {
lib/libc/rpc/svc_generic.c
233
if (bindresvport(fd, NULL) < 0) {
lib/libc/rpc/svc_generic.c
237
if (_bind(fd, (struct sockaddr *)(void *)&ss,
lib/libc/rpc/svc_generic.c
244
_listen(fd, SOMAXCONN);
lib/libc/rpc/svc_generic.c
246
if (_bind(fd,
lib/libc/rpc/svc_generic.c
253
_listen(fd, (int)bindaddr->qlen);
lib/libc/rpc/svc_generic.c
263
if (_getpeername(fd, (struct sockaddr *)(void *)&ss, &slen)
lib/libc/rpc/svc_generic.c
266
xprt = svc_fd_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
268
xprt = svc_vc_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
279
xprt = svc_dg_create(fd, sendsz, recvsz);
lib/libc/rpc/svc_generic.c
304
(void)_close(fd);
lib/libc/rpc/svc_nl.c
105
if (setsockopt(sc->snl.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
lib/libc/rpc/svc_nl.c
123
xprt->xp_fd = sc->snl.fd,
lib/libc/rpc/svc_vc.c
120
svc_vc_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
128
if (!__rpc_fd2sockinfo(fd, &si))
lib/libc/rpc/svc_vc.c
148
xprt->xp_fd = fd;
lib/libc/rpc/svc_vc.c
151
if (_getsockname(fd, (struct sockaddr *)(void *)&sslocal, &slen) < 0) {
lib/libc/rpc/svc_vc.c
180
svc_fd_create(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
186
assert(fd != -1);
lib/libc/rpc/svc_vc.c
188
ret = makefd_xprt(fd, sendsize, recvsize);
lib/libc/rpc/svc_vc.c
193
if (_getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/svc_vc.c
206
if (_getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
lib/libc/rpc/svc_vc.c
234
makefd_xprt(int fd, u_int sendsize, u_int recvsize)
lib/libc/rpc/svc_vc.c
241
assert(fd != -1);
lib/libc/rpc/svc_vc.c
262
xprt->xp_fd = fd;
lib/libc/rpc/svc_vc.c
263
if (__rpc_fd2sockinfo(fd, &si) && __rpc_sockinfo2netid(&si, &netid))
lib/libc/rpc/svc_vc.c
475
pollfd.fd = sock;
lib/libc/stdio/dprintf.c
35
dprintf(int fd, const char * __restrict fmt, ...)
lib/libc/stdio/dprintf.c
41
ret = vdprintf(fd, fmt, ap);
lib/libc/stdio/fdopen.c
104
fp->_file = fd;
lib/libc/stdio/fdopen.c
46
fdopen(int fd, const char *mode)
lib/libc/stdio/fdopen.c
58
if (fd > SHRT_MAX) {
lib/libc/stdio/fdopen.c
67
if ((fdflags = _fcntl(fd, F_GETFL, 0)) < 0)
lib/libc/stdio/fdopen.c
80
tmp = _fcntl(fd, F_GETFD, 0);
lib/libc/stdio/fdopen.c
86
rc = _fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
lib/libc/stdio/fileno.c
47
int fd;
lib/libc/stdio/fileno.c
49
fd = fp->_file;
lib/libc/stdio/fileno.c
50
if (fd == -1)
lib/libc/stdio/fileno.c
52
return (fd);
lib/libc/stdio/fileno.c
58
int fd;
lib/libc/stdio/fileno.c
62
fd = __fileno_impl(fp);
lib/libc/stdio/fileno.c
65
fd = __fileno_impl(fp);
lib/libc/stdio/fileno.c
68
return (fd);
lib/libc/stdio/mktemp.c
54
int fd;
lib/libc/stdio/mktemp.c
56
return (_gettemp(dfd, path, &fd, 0, slen, oflags) ? fd : -1);
lib/libc/stdio/mktemp.c
62
int fd;
lib/libc/stdio/mktemp.c
64
return (_gettemp(AT_FDCWD, path, &fd, 0, slen, oflags) ? fd : -1);
lib/libc/stdio/mktemp.c
70
int fd;
lib/libc/stdio/mktemp.c
72
return (_gettemp(AT_FDCWD, path, &fd, 0, slen, 0) ? fd : -1);
lib/libc/stdio/mktemp.c
78
int fd;
lib/libc/stdio/mktemp.c
80
return (_gettemp(AT_FDCWD, path, &fd, 0, 0, oflags) ? fd : -1);
lib/libc/stdio/mktemp.c
86
int fd;
lib/libc/stdio/mktemp.c
88
return (_gettemp(AT_FDCWD, path, &fd, 0, 0, 0) ? fd : -1);
lib/libc/stdio/tmpfile.c
52
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
77
if (fd == -1)
lib/libc/stdio/tmpfile.c
80
if ((fp = fdopen(fd, "w+")) == NULL) {
lib/libc/stdio/tmpfile.c
82
(void)_close(fd);
lib/libc/stdio/vdprintf.c
45
vdprintf(int fd, const char * __restrict fmt, va_list ap)
lib/libc/stdio/vdprintf.c
52
if (fd > SHRT_MAX) {
lib/libc/stdio/vdprintf.c
60
f._file = fd;
lib/libc/sys/close.c
39
close(int fd)
lib/libc/sys/close.c
41
return (INTERPOS_SYS(close, fd));
lib/libc/sys/fcntl.c
43
fcntl(int fd, int cmd, ...)
lib/libc/sys/fcntl.c
52
return (INTERPOS_SYS(fcntl, fd, cmd, arg));
lib/libc/sys/fdatasync.c
38
fdatasync(int fd)
lib/libc/sys/fdatasync.c
40
return (INTERPOS_SYS(fdatasync, fd));
lib/libc/sys/fsync.c
38
fsync(int fd)
lib/libc/sys/fsync.c
40
return (INTERPOS_SYS(fsync, fd));
lib/libc/sys/getdents.c
34
getdents(int fd, char *buf, size_t nbytes)
lib/libc/sys/getdents.c
37
return (__sys_getdirentries(fd, buf, nbytes, NULL));
lib/libc/sys/openat.c
43
openat(int fd, const char *path, int flags, ...)
lib/libc/sys/openat.c
55
return (INTERPOS_SYS(openat, fd, path, flags, mode));
lib/libc/sys/pdwait.c
16
pdwait(int fd, int *status, int options, struct __wrusage *ru,
lib/libc/sys/pdwait.c
19
return (INTERPOS_SYS(pdwait, fd, status, options, ru, infop));
lib/libc/sys/read.c
39
read(int fd, void *buf, size_t nbytes)
lib/libc/sys/read.c
41
return (INTERPOS_SYS(read, fd, buf, nbytes));
lib/libc/sys/readv.c
40
__ssp_real(readv)(int fd, const struct iovec *iov, int iovcnt)
lib/libc/sys/readv.c
42
return (INTERPOS_SYS(readv, fd, iov, iovcnt));
lib/libc/sys/shm_open.c
56
int error, fd, saved_errno;
lib/libc/sys/shm_open.c
58
fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL);
lib/libc/sys/shm_open.c
59
if (fd == -1)
lib/libc/sys/shm_open.c
65
error = ioctl(fd, FIOSSHMLPGCNF, &slc);
lib/libc/sys/shm_open.c
68
close(fd);
lib/libc/sys/shm_open.c
72
return (fd);
lib/libc/sys/write.c
39
write(int fd, const void *buf, size_t nbytes)
lib/libc/sys/write.c
41
return (INTERPOS_SYS(write, fd, buf, nbytes));
lib/libc/sys/writev.c
40
writev(int fd, const struct iovec *iov, int iovcnt)
lib/libc/sys/writev.c
42
return (INTERPOS_SYS(writev, fd, iov, iovcnt));
lib/libc/tests/gen/dir2_test.c
145
int fd;
lib/libc/tests/gen/dir2_test.c
149
fd = openat(dd, filename, O_WRONLY | O_CREAT, 0600);
lib/libc/tests/gen/dir2_test.c
150
ATF_REQUIRE(fd > 0);
lib/libc/tests/gen/dir2_test.c
151
close(fd);
lib/libc/tests/gen/dir2_test.c
68
int fd;
lib/libc/tests/gen/dir2_test.c
72
fd = openat(dd, filename, O_WRONLY | O_CREAT, 0600);
lib/libc/tests/gen/dir2_test.c
73
ATF_REQUIRE(fd > 0);
lib/libc/tests/gen/dir2_test.c
74
close(fd);
lib/libc/tests/gen/dlopen_empty_test.c
59
int fd;
lib/libc/tests/gen/dlopen_empty_test.c
67
fd = open(soname, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE);
lib/libc/tests/gen/dlopen_empty_test.c
68
ATF_REQUIRE_MSG(fd != -1, "open(\"%s\") failed; errno=%d", soname, errno);
lib/libc/tests/gen/dlopen_empty_test.c
69
close(fd);
lib/libc/tests/gen/ftw_test.c
115
close(fd);
lib/libc/tests/gen/ftw_test.c
78
int fd;
lib/libc/tests/gen/ftw_test.c
86
fd = open(dir, O_DIRECTORY|O_RDONLY);
lib/libc/tests/gen/ftw_test.c
87
ATF_REQUIRE_MSG(fd != -1, "open failed; errno=%d", errno);
lib/libc/tests/gen/ftw_test.c
89
ATF_REQUIRE_MSG(mkdirat(fd, "d1", 0777) == 0,
lib/libc/tests/gen/ftw_test.c
92
ATF_REQUIRE_MSG(symlinkat(dir, fd, "d1/looper") == 0,
lib/libc/tests/gen/glob2_test.c
56
int fd, rc;
lib/libc/tests/gen/glob2_test.c
58
fd = open(longname, O_CREAT | O_RDWR, 0666);
lib/libc/tests/gen/glob2_test.c
59
ATF_REQUIRE(fd >= 0);
lib/libc/tests/gen/opendir_test.c
129
int fd;
lib/libc/tests/gen/opendir_test.c
131
ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0);
lib/libc/tests/gen/opendir_test.c
132
ATF_REQUIRE((dirp = fdopendir(fd)) == NULL);
lib/libc/tests/gen/opendir_test.c
134
ATF_CHECK_EQ(0, close(fd));
lib/libc/tests/gen/opendir_test.c
75
int fd;
lib/libc/tests/gen/opendir_test.c
77
ATF_REQUIRE((fd = mkfifo("fifo", 0644)) >= 0);
lib/libc/tests/gen/opendir_test.c
78
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/gen/posix_spawn_test.c
188
int error, fd, nfd, status;
lib/libc/tests/gen/posix_spawn_test.c
199
fd = open(dsopath, O_RDONLY);
lib/libc/tests/gen/posix_spawn_test.c
200
ATF_REQUIRE(fd >= 0);
lib/libc/tests/gen/posix_spawn_test.c
214
ATF_REQUIRE(fstat(fd, &sb) == 0);
lib/libc/tests/gen/posix_spawn_test.c
216
dsomap = mmap(NULL, dsosz, PROT_READ, MAP_SHARED, fd, 0);
lib/libc/tests/gen/realpath2_test.c
101
fd = open("aaa", O_RDONLY | O_CREAT, 0600);
lib/libc/tests/gen/realpath2_test.c
103
ATF_REQUIRE(fd >= 0);
lib/libc/tests/gen/realpath2_test.c
104
ATF_REQUIRE(close(fd) == 0);
lib/libc/tests/gen/realpath2_test.c
95
int fd;
lib/libc/tests/gen/scandir_blocks_test.c
109
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/gen/scandir_blocks_test.c
68
int fd, i, ret;
lib/libc/tests/gen/scandir_blocks_test.c
71
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0);
lib/libc/tests/gen/scandir_blocks_test.c
72
ret = fdscandir_b(fd, &namelist,
lib/libc/tests/gen/scandir_blocks_test.c
83
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/gen/scandir_blocks_test.c
94
int fd, i, ret;
lib/libc/tests/gen/scandir_blocks_test.c
97
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_SEARCH)) >= 0);
lib/libc/tests/gen/scandir_blocks_test.c
98
ret = scandirat_b(fd, ".", &namelist,
lib/libc/tests/gen/scandir_test.c
100
ret = scandirat(fd, ".", &namelist, scandir_select, scandir_compare);
lib/libc/tests/gen/scandir_test.c
105
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/gen/scandir_test.c
160
int fd, i;
lib/libc/tests/gen/scandir_test.c
169
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0);
lib/libc/tests/gen/scandir_test.c
171
scandir_error_fd = fd;
lib/libc/tests/gen/scandir_test.c
174
fdscandir(fd, &namelist, scandir_error_select, NULL) < 0);
lib/libc/tests/gen/scandir_test.c
178
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0);
lib/libc/tests/gen/scandir_test.c
180
scandir_error_fd = fd;
lib/libc/tests/gen/scandir_test.c
183
fdscandir(fd, &namelist, scandir_error_select, NULL) < 0);
lib/libc/tests/gen/scandir_test.c
76
int fd, i, ret;
lib/libc/tests/gen/scandir_test.c
79
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0);
lib/libc/tests/gen/scandir_test.c
80
ret = fdscandir(fd, &namelist, scandir_select, scandir_compare);
lib/libc/tests/gen/scandir_test.c
85
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/gen/scandir_test.c
96
int fd, i, ret;
lib/libc/tests/gen/scandir_test.c
99
ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_SEARCH)) >= 0);
lib/libc/tests/secure/fortify_poll_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_poll_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_poll_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_poll_test.c
124
int fd;
lib/libc/tests/secure/fortify_poll_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_poll_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_poll_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_poll_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_poll_test.c
138
return (fd);
lib/libc/tests/secure/fortify_poll_test.c
157
int fd;
lib/libc/tests/secure/fortify_poll_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_poll_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_poll_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_poll_test.c
163
close(fd);
lib/libc/tests/secure/fortify_poll_test.c
183
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
208
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
242
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
290
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
316
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
351
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
399
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
425
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
460
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
509
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
536
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
572
__stack.__buf[i].fd = -1;
lib/libc/tests/secure/fortify_poll_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_random_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_random_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_random_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_random_test.c
124
int fd;
lib/libc/tests/secure/fortify_random_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_random_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_random_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_random_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_random_test.c
138
return (fd);
lib/libc/tests/secure/fortify_random_test.c
157
int fd;
lib/libc/tests/secure/fortify_random_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_random_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_random_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_random_test.c
163
close(fd);
lib/libc/tests/secure/fortify_random_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_select_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_select_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_select_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_select_test.c
124
int fd;
lib/libc/tests/secure/fortify_select_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_select_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_select_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_select_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_select_test.c
138
return (fd);
lib/libc/tests/secure/fortify_select_test.c
157
int fd;
lib/libc/tests/secure/fortify_select_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_select_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_select_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_select_test.c
163
close(fd);
lib/libc/tests/secure/fortify_select_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_signal_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_signal_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_signal_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_signal_test.c
124
int fd;
lib/libc/tests/secure/fortify_signal_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_signal_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_signal_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_signal_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_signal_test.c
138
return (fd);
lib/libc/tests/secure/fortify_signal_test.c
157
int fd;
lib/libc/tests/secure/fortify_signal_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_signal_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_signal_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_signal_test.c
163
close(fd);
lib/libc/tests/secure/fortify_signal_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_socket_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_socket_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_socket_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_socket_test.c
124
int fd;
lib/libc/tests/secure/fortify_socket_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_socket_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_socket_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_socket_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_socket_test.c
138
return (fd);
lib/libc/tests/secure/fortify_socket_test.c
157
int fd;
lib/libc/tests/secure/fortify_socket_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_socket_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_socket_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_socket_test.c
163
close(fd);
lib/libc/tests/secure/fortify_socket_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_stdio_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_stdio_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_stdio_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_stdio_test.c
124
int fd;
lib/libc/tests/secure/fortify_stdio_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_stdio_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_stdio_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_stdio_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_stdio_test.c
138
return (fd);
lib/libc/tests/secure/fortify_stdio_test.c
157
int fd;
lib/libc/tests/secure/fortify_stdio_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_stdio_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_stdio_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_stdio_test.c
163
close(fd);
lib/libc/tests/secure/fortify_stdio_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_stdlib_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_stdlib_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_stdlib_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_stdlib_test.c
124
int fd;
lib/libc/tests/secure/fortify_stdlib_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_stdlib_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_stdlib_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_stdlib_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_stdlib_test.c
138
return (fd);
lib/libc/tests/secure/fortify_stdlib_test.c
157
int fd;
lib/libc/tests/secure/fortify_stdlib_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_stdlib_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_stdlib_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_stdlib_test.c
163
close(fd);
lib/libc/tests/secure/fortify_stdlib_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_string_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_string_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_string_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_string_test.c
124
int fd;
lib/libc/tests/secure/fortify_string_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_string_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_string_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_string_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_string_test.c
138
return (fd);
lib/libc/tests/secure/fortify_string_test.c
157
int fd;
lib/libc/tests/secure/fortify_string_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_string_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_string_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_string_test.c
163
close(fd);
lib/libc/tests/secure/fortify_string_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_strings_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_strings_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_strings_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_strings_test.c
124
int fd;
lib/libc/tests/secure/fortify_strings_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_strings_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_strings_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_strings_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_strings_test.c
138
return (fd);
lib/libc/tests/secure/fortify_strings_test.c
157
int fd;
lib/libc/tests/secure/fortify_strings_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_strings_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_strings_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_strings_test.c
163
close(fd);
lib/libc/tests/secure/fortify_strings_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_uio_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_uio_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_uio_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_uio_test.c
124
int fd;
lib/libc/tests/secure/fortify_uio_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_uio_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_uio_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_uio_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_uio_test.c
138
return (fd);
lib/libc/tests/secure/fortify_uio_test.c
157
int fd;
lib/libc/tests/secure/fortify_uio_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_uio_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_uio_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_uio_test.c
163
close(fd);
lib/libc/tests/secure/fortify_uio_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_unistd_test.c
1002
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
1005
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
1007
read(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
1029
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
1039
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
1041
read(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_unistd_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_unistd_test.c
124
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_unistd_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_unistd_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_unistd_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_unistd_test.c
138
return (fd);
lib/libc/tests/secure/fortify_unistd_test.c
157
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_unistd_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_unistd_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_unistd_test.c
163
close(fd);
lib/libc/tests/secure/fortify_unistd_test.c
1979
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
1981
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
1982
if (!isatty(fd))
lib/libc/tests/secure/fortify_unistd_test.c
1985
ttyname_r(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
2005
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
2007
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
2008
if (!isatty(fd))
lib/libc/tests/secure/fortify_unistd_test.c
2011
ttyname_r(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
2031
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
2033
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
2034
if (!isatty(fd))
lib/libc/tests/secure/fortify_unistd_test.c
2039
ttyname_r(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
2059
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
2061
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
2062
if (!isatty(fd))
lib/libc/tests/secure/fortify_unistd_test.c
2067
ttyname_r(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
2089
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
2091
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_unistd_test.c
2092
if (!isatty(fd))
lib/libc/tests/secure/fortify_unistd_test.c
2104
ttyname_r(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
775
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
777
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
779
pread(fd, __stack.__buf, __len, 0);
lib/libc/tests/secure/fortify_unistd_test.c
799
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
801
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
803
pread(fd, __stack.__buf, __len, 0);
lib/libc/tests/secure/fortify_unistd_test.c
823
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
826
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
828
pread(fd, __stack.__buf, __len, 0);
lib/libc/tests/secure/fortify_unistd_test.c
848
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
85
int error, fd;
lib/libc/tests/secure/fortify_unistd_test.c
851
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
853
pread(fd, __stack.__buf, __len, 0);
lib/libc/tests/secure/fortify_unistd_test.c
875
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
885
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
887
pread(fd, __stack.__buf, __len, 0);
lib/libc/tests/secure/fortify_unistd_test.c
929
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
931
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
933
read(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
953
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
955
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
957
read(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_unistd_test.c
977
int fd;
lib/libc/tests/secure/fortify_unistd_test.c
980
fd = new_tmpfile(); /* Cannot fail */
lib/libc/tests/secure/fortify_unistd_test.c
982
read(fd, __stack.__buf, __len);
lib/libc/tests/secure/fortify_wchar_test.c
107
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libc/tests/secure/fortify_wchar_test.c
108
fd = STDIN_FILENO;
lib/libc/tests/secure/fortify_wchar_test.c
109
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
lib/libc/tests/secure/fortify_wchar_test.c
124
int fd;
lib/libc/tests/secure/fortify_wchar_test.c
126
fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644);
lib/libc/tests/secure/fortify_wchar_test.c
127
ATF_REQUIRE(fd >= 0);
lib/libc/tests/secure/fortify_wchar_test.c
131
rv = write(fd, buf, sizeof(buf));
lib/libc/tests/secure/fortify_wchar_test.c
137
ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET));
lib/libc/tests/secure/fortify_wchar_test.c
138
return (fd);
lib/libc/tests/secure/fortify_wchar_test.c
157
int fd;
lib/libc/tests/secure/fortify_wchar_test.c
159
fd = new_tmpfile();
lib/libc/tests/secure/fortify_wchar_test.c
161
(void)dup2(fd, STDIN_FILENO);
lib/libc/tests/secure/fortify_wchar_test.c
162
if (fd != STDIN_FILENO)
lib/libc/tests/secure/fortify_wchar_test.c
163
close(fd);
lib/libc/tests/secure/fortify_wchar_test.c
85
int error, fd;
lib/libc/tests/stdio/fdopen_test.c
41
int fd;
lib/libc/tests/stdio/fdopen_test.c
43
fd = open(fname, intmode);
lib/libc/tests/stdio/fdopen_test.c
44
ATF_REQUIRE_MSG(fd != -1,
lib/libc/tests/stdio/fdopen_test.c
47
fp = fdopen(fd, strmode);
lib/libc/tests/stdio/fdopen_test.c
49
close(fd);
lib/libc/tests/stdio/fopen_test.c
44
int exp_fget_ret, fget_ret, fd, flags, wantedflags;
lib/libc/tests/stdio/fopen_test.c
49
fd = fileno(fp);
lib/libc/tests/stdio/fopen_test.c
50
ATF_REQUIRE_MSG(fd >= 0, "fileno() failed for fopen");
lib/libc/tests/stdio/fopen_test.c
52
ATF_REQUIRE_MSG((fget_ret = fcntl(fd, F_GETFD)) == exp_fget_ret,
lib/libc/tests/stdio/fopen_test.c
55
flags = fcntl(fd, F_GETFL);
lib/libc/tests/stdio/getdelim_test.c
229
_ipc_read(int fd, char wait_c)
lib/libc/tests/stdio/getdelim_test.c
236
len = read(fd, &c, 1);
lib/libc/tests/stdio/getdelim_test.c
247
_ipc_write(int fd, char c)
lib/libc/tests/stdio/getdelim_test.c
250
while ((write(fd, &c, 1) != 1))
lib/libc/tests/stdio/gets_s_test.c
59
int fd[2];
lib/libc/tests/stdio/gets_s_test.c
64
pipe(fd);
lib/libc/tests/stdio/gets_s_test.c
69
close(fd[1]);
lib/libc/tests/stdio/gets_s_test.c
70
nfd = dup2(fd[0], 0);
lib/libc/tests/stdio/gets_s_test.c
71
close(fd[0]);
lib/libc/tests/stdio/gets_s_test.c
78
close(fd[0]);
lib/libc/tests/stdio/gets_s_test.c
79
stdout = fdopen(fd[1], "w");
lib/libc/tests/stdio/mkostemp_test.c
116
if (fstat(fd, &st2) == -1)
lib/libc/tests/stdio/mkostemp_test.c
119
testnum++, oflags, fd, strerror(errno));
lib/libc/tests/stdio/mkostemp_test.c
126
(void)close(fd);
lib/libc/tests/stdio/mkostemp_test.c
129
(void)close(fd);
lib/libc/tests/stdio/mkostemp_test.c
53
int fd;
lib/libc/tests/stdio/mkostemp_test.c
56
fd = mkostemp(tmpf, oflags);
lib/libc/tests/stdio/mkostemp_test.c
57
if (fd < 0) {
lib/libc/tests/stdio/mkostemp_test.c
70
if (fcntl(fd, F_GETFD) !=
lib/libc/tests/stdio/mkostemp_test.c
77
if ((fcntl(fd, F_GETFL) & MISCFLAGS) != (oflags & MISCFLAGS)) {
lib/libc/tests/stdio/mkostemp_test.c
89
if (fstat(fd, &st2) == -1) {
lib/libc/tests/stdio/mkostemp_test.c
92
testnum++, oflags, fd, strerror(errno));
lib/libc/tests/stdlib/system_test.c
113
int fd[N];
lib/libc/tests/stdlib/system_test.c
119
fd[i] = open(fn, O_CREAT|O_EXCL|O_EXLOCK|O_CLOEXEC, 0644);
lib/libc/tests/stdlib/system_test.c
120
ATF_REQUIRE_MSG(fd[i] >= 0, "%s: %m", fn);
lib/libc/tests/stdlib/system_test.c
162
ATF_REQUIRE_INTEQ(0, close(fd[i]));
lib/libc/tests/stdtime/detect_tz_changes_test.c
132
int fd;
lib/libc/tests/stdtime/detect_tz_changes_test.c
137
ATF_REQUIRE((fd = open(dfn, O_RDWR | O_CREAT, 0644)) >= 0);
lib/libc/tests/stdtime/detect_tz_changes_test.c
138
ATF_REQUIRE_EQ(8, write(fd, "invalid\n", 8));
lib/libc/tests/stdtime/detect_tz_changes_test.c
139
ATF_REQUIRE_EQ(0, close(fd));
lib/libc/tests/stdtime/detect_tz_changes_test.c
247
fds[0].fd = spd[1];
lib/libc/tests/stdtime/detect_tz_changes_test.c
271
fds[0].fd = opd[0];
lib/libc/tests/stdtime/detect_tz_changes_test.c
273
fds[1].fd = epd[0];
lib/libc/tests/stdtime/detect_tz_changes_test.c
275
fds[2].fd = spd[0];
lib/libc/tests/sys/cpuset_test.c
487
jail_attach_disjoint_newjail(int fd)
lib/libc/tests/sys/cpuset_test.c
506
write(fd, &jid, sizeof(jid));
lib/libc/tests/sys/cpuset_test.c
513
wait_jail(int fd, int pfd)
lib/libc/tests/sys/cpuset_test.c
520
FD_SET(fd, &lset);
lib/libc/tests/sys/cpuset_test.c
523
maxfd = MAX(fd, pfd);
lib/libc/tests/sys/cpuset_test.c
544
ATF_REQUIRE(FD_ISSET(fd, &lset));
lib/libc/tests/sys/cpuset_test.c
545
ATF_REQUIRE_EQ(sizeof(jid), recv(fd, &jid, sizeof(jid), 0));
lib/libc/tests/sys/sendfile_test.c
1018
int client_sock, error, fd, port;
lib/libc/tests/sys/sendfile_test.c
1023
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
1024
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
1026
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
1029
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
1075
int client_sock, error, fd;
lib/libc/tests/sys/sendfile_test.c
1082
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
1083
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
1085
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
1088
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
1101
int client_sock, error, fd;
lib/libc/tests/sys/sendfile_test.c
1106
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
1107
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
1112
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
1115
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
1122
int client_sock, error, fd, port;
lib/libc/tests/sys/sendfile_test.c
1127
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
1128
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
1130
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
1133
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
265
file_size_from_fd(int fd)
lib/libc/tests/sys/sendfile_test.c
269
ATF_REQUIRE_EQ_MSG(0, fstat(fd, &st),
lib/libc/tests/sys/sendfile_test.c
336
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
342
fd = open(SOURCE_FILE, O_RDONLY);
lib/libc/tests/sys/sendfile_test.c
343
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
359
error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL,
lib/libc/tests/sys/sendfile_test.c
365
verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes);
lib/libc/tests/sys/sendfile_test.c
367
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
409
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
415
fd = shm_open(SHM_ANON, O_RDWR|O_CREAT, 0600);
lib/libc/tests/sys/sendfile_test.c
416
ATF_REQUIRE_MSG(fd != -1, "shm_open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
417
ATF_REQUIRE_EQ_MSG(0, ftruncate(fd, pattern_size),
lib/libc/tests/sys/sendfile_test.c
420
MAP_SHARED, fd, 0);
lib/libc/tests/sys/sendfile_test.c
443
error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL,
lib/libc/tests/sys/sendfile_test.c
449
verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes);
lib/libc/tests/sys/sendfile_test.c
452
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
488
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
494
fd = -1;
lib/libc/tests/sys/sendfile_test.c
496
error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
538
int client_sock, error, fd, i, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
594
fd = open(SOURCE_FILE, O_RDONLY);
lib/libc/tests/sys/sendfile_test.c
595
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
611
error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL,
lib/libc/tests/sys/sendfile_test.c
618
verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes);
lib/libc/tests/sys/sendfile_test.c
620
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
681
int client_sock, error, fd, fd2, i, port, rc, server_sock;
lib/libc/tests/sys/sendfile_test.c
724
fd = open(SOURCE_FILE, O_RDONLY);
lib/libc/tests/sys/sendfile_test.c
725
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
739
error = sendfile(fd, client_sock, offset, nbytes, &hdtr,
lib/libc/tests/sys/sendfile_test.c
748
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
788
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
803
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
804
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
809
error = sendfile(fd, client_sock, 0, 0, hdtr1, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
812
error = sendfile(fd, client_sock, 0, 0, &hdtr2, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
815
error = sendfile(fd, client_sock, 0, 0, &hdtr3, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
818
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
856
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
862
fd = open(SOURCE_FILE, O_CREAT|O_RDWR, 0600);
lib/libc/tests/sys/sendfile_test.c
863
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
865
error = sendfile(fd, client_sock, -1, 0, NULL, NULL, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
868
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
908
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
915
fd = open(SOURCE_FILE, O_RDONLY);
lib/libc/tests/sys/sendfile_test.c
916
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
918
error = sendfile(fd, client_sock, 0, 0, NULL, &sbytes, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
921
(void)close(fd);
lib/libc/tests/sys/sendfile_test.c
964
int client_sock, error, fd, port, server_sock;
lib/libc/tests/sys/sendfile_test.c
971
fd = open(SOURCE_FILE, O_RDONLY);
lib/libc/tests/sys/sendfile_test.c
972
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
lib/libc/tests/sys/sendfile_test.c
977
error = sendfile(fd, client_sock, 0, 0, NULL, sbytes_p, SF_FLAGS(0, 0));
lib/libc/tests/sys/sendfile_test.c
980
(void)close(fd);
lib/libc/yp/yplib.c
289
int clnt_sock, fd;
lib/libc/yp/yplib.c
372
if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libc/yp/yplib.c
375
_close(fd);
lib/libc/yp/yplib.c
378
if (_flock(fd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK) {
lib/libc/yp/yplib.c
388
r = _readv(fd, iov, 2);
lib/libc/yp/yplib.c
390
_close(fd);
lib/libc/yp/yplib.c
406
_close(fd);
lib/libc/yp/yplib.c
411
_close(fd);
lib/libcam/camlib.c
278
int fd, bufsize;
lib/libcam/camlib.c
280
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
lib/libcam/camlib.c
300
close(fd);
lib/libcam/camlib.c
315
close(fd);
lib/libcam/camlib.c
333
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
lib/libcam/camlib.c
381
close(fd);
lib/libcam/camlib.c
400
close(fd);
lib/libcam/camlib.c
421
int fd;
lib/libcam/camlib.c
430
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
lib/libcam/camlib.c
449
if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) {
lib/libcam/camlib.c
469
close(fd);
lib/libcam/camlib.c
473
close(fd);
lib/libcam/camlib.c
505
int fd = -1, malloced_device = 0;
lib/libcam/camlib.c
519
device->fd = -1;
lib/libcam/camlib.c
543
if ((fd = open(path, flags)) < 0) {
lib/libcam/camlib.c
551
device->fd = fd;
lib/libcam/camlib.c
566
if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) {
lib/libcam/camlib.c
598
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
lib/libcam/camlib.c
613
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
lib/libcam/camlib.c
637
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
lib/libcam/camlib.c
659
if (fd >= 0)
lib/libcam/camlib.c
660
close(fd);
lib/libcam/camlib.c
68
return(ioctl(device->fd, CAMIOCOMMAND, ccb));
lib/libcam/camlib.c
685
if (dev->fd >= 0) {
lib/libcam/camlib.c
686
close(dev->fd);
lib/libcam/camlib.c
687
dev->fd = -1;
lib/libcam/camlib.h
122
int fd; /* file descriptor for device */
lib/libcapsicum/capsicum_helpers.h
167
caph_rights_limit(int fd, const cap_rights_t *rights)
lib/libcapsicum/capsicum_helpers.h
170
if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS)
lib/libcapsicum/capsicum_helpers.h
177
caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds)
lib/libcapsicum/capsicum_helpers.h
180
if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS)
lib/libcapsicum/capsicum_helpers.h
187
caph_fcntls_limit(int fd, uint32_t fcntlrights)
lib/libcapsicum/capsicum_helpers.h
190
if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS)
lib/libcapsicum/capsicum_helpers.h
79
caph_limit_stream(int fd, int flags)
lib/libcapsicum/capsicum_helpers.h
84
if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) {
lib/libcapsicum/capsicum_helpers.h
90
if (cap_ioctls_limit(fd, caph_stream_cmds,
lib/libcapsicum/capsicum_helpers.h
94
if (cap_fcntls_limit(fd, caph_stream_fcntls) < 0 && errno != ENOSYS)
lib/libcasper/libcasper/libcasper.h
170
int fd;
lib/libcasper/libcasper/libcasper.h
172
fd = chan->cch_fd;
lib/libcasper/libcasper/libcasper.h
174
return (fd);
lib/libcasper/libcasper/libcasper_impl.c
42
fd_is_valid(int fd)
lib/libcasper/libcasper/libcasper_impl.c
45
return (fcntl(fd, F_GETFL) != -1 || errno != EBADF);
lib/libcasper/libcasper/libcasper_impl.h
44
bool fd_is_valid(int fd);
lib/libcasper/libcasper/libcasper_impl.h
80
void casper_main_loop(int fd);
lib/libcasper/libcasper/libcasper_service.c
208
service_register_core(int fd)
lib/libcasper/libcasper/libcasper_service.c
215
sconn = service_connection_add(casserv->cs_service, fd, NULL);
lib/libcasper/libcasper/libcasper_service.c
217
close(fd);
lib/libcasper/libcasper/libcasper_service.c
223
casper_main_loop(int fd)
lib/libcasper/libcasper/libcasper_service.c
232
service_register_core(fd);
lib/libcasper/libcasper/service.c
101
if (pollset_pfds[i].fd < 0)
lib/libcasper/libcasper/service.c
121
pollset_pfds[i].fd = sock;
lib/libcasper/libcasper/service.c
133
pollset_pfds[sconn->sc_pollidx].fd = -1;
lib/libcasper/libcasper/service.c
143
if (pollset_pfds[i].fd >= 0)
lib/libcasper/libcasper/service.c
425
int fd;
lib/libcasper/libcasper/service.c
427
fd = open(_PATH_DEVNULL, O_RDWR);
lib/libcasper/libcasper/service.c
428
if (fd == -1)
lib/libcasper/libcasper/service.c
434
if (dup2(fd, STDIN_FILENO) == -1)
lib/libcasper/libcasper/service.c
436
if (dup2(fd, STDOUT_FILENO) == -1)
lib/libcasper/libcasper/service.c
438
if (dup2(fd, STDERR_FILENO) == -1)
lib/libcasper/libcasper/service.c
441
if (fd > STDERR_FILENO)
lib/libcasper/libcasper/service.c
442
close(fd);
lib/libcasper/libcasper/service.c
448
int fd, maxfd, minfd;
lib/libcasper/libcasper/service.c
469
for (fd = STDERR_FILENO + 1; fd < maxfd; fd++) {
lib/libcasper/libcasper/service.c
470
if (fd != minfd)
lib/libcasper/libcasper/service.c
471
close(fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
116
fd = nvlist_take_descriptor(tnvl, "fd");
lib/libcasper/services/cap_fileargs/cap_fileargs.c
120
if (fcntl(fd, F_SETFD, fa->fa_fdflags) == -1) {
lib/libcasper/services/cap_fileargs/cap_fileargs.c
121
close(fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
126
return (fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
316
int fd;
lib/libcasper/services/cap_fileargs/cap_fileargs.c
333
fd = fileargs_get_fd_cache(fa, name);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
334
if (fd != -1)
lib/libcasper/services/cap_fileargs/cap_fileargs.c
335
return (fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
341
fd = nvlist_take_descriptor(nvl, "fd");
lib/libcasper/services/cap_fileargs/cap_fileargs.c
349
return (fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
355
int fd;
lib/libcasper/services/cap_fileargs/cap_fileargs.c
357
if ((fd = fileargs_open(fa, name)) < 0) {
lib/libcasper/services/cap_fileargs/cap_fileargs.c
361
return (fdopen(fd, mode));
lib/libcasper/services/cap_fileargs/cap_fileargs.c
511
int fd, serrno;
lib/libcasper/services/cap_fileargs/cap_fileargs.c
514
fd = open(name, capflags);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
516
fd = open(name, capflags, capmode);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
517
if (fd < 0)
lib/libcasper/services/cap_fileargs/cap_fileargs.c
521
if (cap_rights_limit(fd, caprightsp) < 0 && errno != ENOSYS) {
lib/libcasper/services/cap_fileargs/cap_fileargs.c
523
close(fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
529
return (fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
536
int type, i, fd;
lib/libcasper/services/cap_fileargs/cap_fileargs.c
574
fd = open_file(fname);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
575
if (fd < 0) {
lib/libcasper/services/cap_fileargs/cap_fileargs.c
580
nvlist_move_descriptor(new, "fd", fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
695
int fd;
lib/libcasper/services/cap_fileargs/cap_fileargs.c
706
fd = open_file(name);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
707
if (fd < 0)
lib/libcasper/services/cap_fileargs/cap_fileargs.c
717
nvlist_move_descriptor(nvlout, "fd", fd);
lib/libcasper/services/cap_fileargs/cap_fileargs.c
91
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
100
*fdp = fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
202
test_file_mode(int fd, int mode)
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
206
flags = fcntl(fd, F_GETFL, 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
217
test_file_cap(int fd, cap_rights_t *rights)
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
221
ATF_REQUIRE(cap_rights_get(fd, &fdrights) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
227
test_file_write(int fd)
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
232
if (write(fd, &buf, sizeof(buf)) != sizeof(buf)) {
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
240
test_file_read(int fd)
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
244
if (read(fd, &buf, sizeof(buf)) < 0) {
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
288
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
303
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
304
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
306
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
307
ATF_REQUIRE(test_file_mode(fd, O_RDONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
308
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
309
ATF_REQUIRE(test_file_read(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
314
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
315
ATF_REQUIRE(test_file_write(fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
320
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
335
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
350
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
351
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
353
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
354
ATF_REQUIRE(test_file_mode(fd, O_WRONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
355
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
356
ATF_REQUIRE(test_file_write(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
361
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
362
ATF_REQUIRE(test_file_read(fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
367
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
382
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
396
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
398
ATF_REQUIRE(test_file_mode(fd, O_RDWR) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
399
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
400
ATF_REQUIRE(test_file_write(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
401
ATF_REQUIRE(test_file_read(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
406
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
411
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
427
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
443
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
444
ATF_REQUIRE(test_file_read(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
447
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
463
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
482
fd = fileno(pfile);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
483
ATF_REQUIRE(test_file_mode(fd, O_RDONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
484
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
491
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
513
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
532
fd = fileno(pfile);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
533
ATF_REQUIRE(test_file_mode(fd, O_WRONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
534
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
541
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
563
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
578
fd = fileno(pfile);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
579
ATF_REQUIRE(test_file_mode(fd, O_RDWR) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
580
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
606
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
620
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
622
ATF_REQUIRE(test_file_open(fa, TEST_FILE, &fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
638
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
650
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
653
ATF_REQUIRE(test_file_open(fa, TEST_FILE, &fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
669
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
685
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
686
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
688
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
690
ATF_REQUIRE(test_file_mode(fd, O_RDONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
691
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
692
ATF_REQUIRE(test_file_read(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
696
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
697
ATF_REQUIRE(test_file_write(fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
702
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
717
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
733
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
734
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
736
ATF_REQUIRE(test_file_open(fa, files[i], &fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
738
ATF_REQUIRE(test_file_mode(fd, O_RDONLY) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
739
ATF_REQUIRE(test_file_cap(fd, &rights) == true);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
740
ATF_REQUIRE(test_file_read(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
744
ATF_REQUIRE(test_file_cap(fd, &norights) == false);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
745
ATF_REQUIRE(test_file_write(fd) == ENOTCAPABLE);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
749
ATF_REQUIRE(close(fd) == 0);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
93
int fd;
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
95
fd = fileargs_open(fa, file);
lib/libcasper/services/cap_fileargs/tests/fileargs_test.c
96
if (fd < 0)
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
100
int error, fd, val;
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
102
fd = open(file, O_RDONLY);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
103
ATF_REQUIRE(fd >= 0);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
105
n = read(fd, &val, sz);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
109
error = close(fd);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
80
int error, fd, val;
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
87
fd = open(file, O_CREAT | O_WRONLY, 0600);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
88
ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", file, strerror(errno));
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
89
n = write(fd, &val, sz);
lib/libcasper/services/cap_sysctl/tests/sysctl_test.c
91
error = close(fd);
lib/libdevdctl/consumer.cc
233
fds->fd = m_devdSockFD;
lib/libfetch/common.c
1368
pfd.fd = conn->sd;
lib/libfetch/common.c
1602
pfd.fd = conn->sd;
lib/libfetch/common.c
1791
int fd, serrno;
lib/libfetch/common.c
1810
if ((fd = open(fn, O_RDONLY)) < 0) {
lib/libfetch/common.c
1815
return (fd);
lib/libfetch/common.c
668
pfd.fd = sd;
lib/libgeom/geom_ctl.c
195
int fd;
lib/libgeom/geom_ctl.c
210
fd = open(_PATH_DEV PATH_GEOM_CTL, O_RDONLY);
lib/libgeom/geom_ctl.c
211
if (fd < 0)
lib/libgeom/geom_ctl.c
213
req->nerror = ioctl(fd, GEOM_CTL, req);
lib/libgeom/geom_ctl.c
214
close(fd);
lib/libgeom/geom_util.c
104
g_sectorsize(int fd)
lib/libgeom/geom_util.c
108
if (g_ioctl_arg(fd, DIOCGSECTORSIZE, &sectorsize) == -1)
lib/libgeom/geom_util.c
117
g_stripesize(int fd)
lib/libgeom/geom_util.c
121
if (g_ioctl_arg(fd, DIOCGSTRIPESIZE, &stripesize) == -1)
lib/libgeom/geom_util.c
130
g_stripeoffset(int fd)
lib/libgeom/geom_util.c
134
if (g_ioctl_arg(fd, DIOCGSTRIPEOFFSET, &stripeoffset) == -1)
lib/libgeom/geom_util.c
143
g_providername(int fd)
lib/libgeom/geom_util.c
147
if (g_ioctl_arg(fd, DIOCGPROVIDERNAME, name) == -1)
lib/libgeom/geom_util.c
156
g_flush(int fd)
lib/libgeom/geom_util.c
159
return (g_ioctl(fd, DIOCGFLUSH));
lib/libgeom/geom_util.c
166
g_delete(int fd, off_t offset, off_t length)
lib/libgeom/geom_util.c
172
return (g_ioctl_arg(fd, DIOCGDELETE, arg));
lib/libgeom/geom_util.c
179
g_get_ident(int fd, char *ident, size_t size)
lib/libgeom/geom_util.c
183
if (g_ioctl_arg(fd, DIOCGIDENT, lident) == -1)
lib/libgeom/geom_util.c
202
int fd;
lib/libgeom/geom_util.c
204
fd = g_open_by_ident(ident, 0, name, size);
lib/libgeom/geom_util.c
205
if (fd == -1)
lib/libgeom/geom_util.c
207
g_close(fd);
lib/libgeom/geom_util.c
222
int error, fd;
lib/libgeom/geom_util.c
231
fd = -1;
lib/libgeom/geom_util.c
236
fd = g_open(pp->lg_name, dowrite);
lib/libgeom/geom_util.c
237
if (fd == -1)
lib/libgeom/geom_util.c
239
if (g_get_ident(fd, lident,
lib/libgeom/geom_util.c
241
g_close(fd);
lib/libgeom/geom_util.c
245
g_close(fd);
lib/libgeom/geom_util.c
252
g_close(fd);
lib/libgeom/geom_util.c
264
return (fd);
lib/libgeom/geom_util.c
276
int fd;
lib/libgeom/geom_util.c
283
fd = open(devpath, dowrite ? O_RDWR : O_RDONLY);
lib/libgeom/geom_util.c
284
if (fd != -1) {
lib/libgeom/geom_util.c
286
close(fd);
lib/libgeom/geom_util.c
299
fd = open(path, dowrite ? O_RDWR : O_RDONLY);
lib/libgeom/geom_util.c
300
if (fd == -1) {
lib/libgeom/geom_util.c
309
if (g_sectorsize(fd) == -1) {
lib/libgeom/geom_util.c
311
close(fd);
lib/libgeom/geom_util.c
316
*fdp = fd;
lib/libgeom/geom_util.c
318
close(fd);
lib/libgeom/geom_util.c
53
int fd;
lib/libgeom/geom_util.c
55
path = g_device_path_open(name, &fd, dowrite);
lib/libgeom/geom_util.c
58
return (fd);
lib/libgeom/geom_util.c
62
g_close(int fd)
lib/libgeom/geom_util.c
65
return (close(fd));
lib/libgeom/geom_util.c
69
g_ioctl_arg(int fd, unsigned long cmd, void *arg)
lib/libgeom/geom_util.c
74
ret = ioctl(fd, cmd, arg);
lib/libgeom/geom_util.c
76
ret = ioctl(fd, cmd);
lib/libgeom/geom_util.c
81
g_ioctl(int fd, unsigned long cmd)
lib/libgeom/geom_util.c
84
return (g_ioctl_arg(fd, cmd, NULL));
lib/libgeom/geom_util.c
91
g_mediasize(int fd)
lib/libgeom/geom_util.c
95
if (g_ioctl_arg(fd, DIOCGMEDIASIZE, &mediasize) == -1)
lib/libgpio/gpio.c
51
int fd, maxpins;
lib/libgpio/gpio.c
54
fd = open(device, O_RDONLY);
lib/libgpio/gpio.c
55
if (fd < 0)
lib/libgpio/gpio.c
60
if (ioctl(fd, GPIOMAXPIN, &maxpins) < 0) {
lib/libgpio/gpio.c
62
close(fd);
lib/libgpio/gpio.c
67
return (fd);
lib/libmd/mdXhl.c
100
int e, fd;
lib/libmd/mdXhl.c
102
fd = open(filename, O_RDONLY);
lib/libmd/mdXhl.c
103
if (fd < 0)
lib/libmd/mdXhl.c
105
ret = MDXFdChunk(fd, buf, ofs, len);
lib/libmd/mdXhl.c
107
close (fd);
lib/libmd/mdXhl.c
44
MDXFd(int fd, char *buf)
lib/libmd/mdXhl.c
46
return MDXFdChunk(fd, buf, 0, 0);
lib/libmd/mdXhl.c
50
MDXFdChunk(int fd, char *buf, off_t ofs, off_t len)
lib/libmd/mdXhl.c
66
if (lseek(fd, ofs, SEEK_SET) != ofs ||
lib/libmd/mdXhl.c
76
readrv = read(fd, buffer, sizeof(buffer));
lib/libmd/mdXhl.c
78
readrv = read(fd, buffer, remain);
lib/libmixer/mixer.c
100
if (ioctl(m->fd, SNDCTL_MIXERINFO, &m->mi) < 0) {
lib/libmixer/mixer.c
104
if (ioctl(m->fd, SNDCTL_CARDINFO, &m->ci) < 0)
lib/libmixer/mixer.c
106
if (ioctl(m->fd, SOUND_MIXER_READ_DEVMASK, &m->devmask) < 0 ||
lib/libmixer/mixer.c
107
ioctl(m->fd, SOUND_MIXER_READ_MUTE, &m->mutemask) < 0 ||
lib/libmixer/mixer.c
108
ioctl(m->fd, SOUND_MIXER_READ_RECMASK, &m->recmask) < 0 ||
lib/libmixer/mixer.c
109
ioctl(m->fd, SOUND_MIXER_READ_RECSRC, &m->recsrc) < 0)
lib/libmixer/mixer.c
149
r = close(m->fd);
lib/libmixer/mixer.c
333
if (ioctl(m->fd, MIXER_WRITE(m->dev->devno), &v) < 0)
lib/libmixer/mixer.c
365
if (ioctl(m->fd, SOUND_MIXER_WRITE_MUTE, &m->mutemask) < 0)
lib/libmixer/mixer.c
367
if (ioctl(m->fd, SOUND_MIXER_READ_MUTE, &m->mutemask) < 0)
lib/libmixer/mixer.c
406
if (ioctl(m->fd, SOUND_MIXER_WRITE_RECSRC, &m->recsrc) < 0)
lib/libmixer/mixer.c
408
if (ioctl(m->fd, SOUND_MIXER_READ_RECSRC, &m->recsrc) < 0)
lib/libmixer/mixer.c
46
if (ioctl(dev->parent_mixer->fd, MIXER_READ(dev->devno), &v) < 0)
lib/libmixer/mixer.c
486
if (ioctl(m->fd, OSS_SYSINFO, &si) < 0) {
lib/libmixer/mixer.c
91
if ((m->fd = open(m->name, O_RDWR)) < 0)
lib/libmixer/mixer.h
78
int fd; /* file descriptor */
lib/libnetgraph/msg.c
235
rfds.fd = cs;
lib/libnetmap/libnetmap.h
197
int fd; /* "/dev/netmap", -1 if not open */
lib/libnetmap/nmport.c
190
int fd = -1;
lib/libnetmap/nmport.c
203
fd = open(fname, O_RDWR);
lib/libnetmap/nmport.c
204
if (fd < 0) {
lib/libnetmap/nmport.c
208
mapsize = lseek(fd, 0, SEEK_END);
lib/libnetmap/nmport.c
213
p = mmap(0, mapsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
lib/libnetmap/nmport.c
218
close(fd);
lib/libnetmap/nmport.c
219
fd = -1;
lib/libnetmap/nmport.c
232
if (fd >= 0)
lib/libnetmap/nmport.c
233
close(fd);
lib/libnetmap/nmport.c
611
d->fd = open("/dev/netmap", O_RDWR);
lib/libnetmap/nmport.c
612
if (d->fd < 0) {
lib/libnetmap/nmport.c
617
if (ioctl(d->fd, NIOCCTRL, &d->hdr) < 0) {
lib/libnetmap/nmport.c
648
if (d->fd >= 0)
lib/libnetmap/nmport.c
649
close(d->fd);
lib/libnetmap/nmport.c
650
d->fd = -1;
lib/libnetmap/nmport.c
696
MAP_SHARED, d->fd, 0);
lib/libnetmap/nmport.c
857
c->fd = -1;
lib/libnetmap/nmport.c
92
d->fd = -1;
lib/libnetmap/nmreq.c
203
int fd = -1;
lib/libnetmap/nmreq.c
215
fd = open("/dev/netmap", O_RDWR);
lib/libnetmap/nmreq.c
216
if (fd < 0) {
lib/libnetmap/nmreq.c
225
if (ioctl(fd, NIOCCTRL, &gh) < 0) {
lib/libnetmap/nmreq.c
230
close(fd);
lib/libnetmap/nmreq.c
234
if (fd >= 0)
lib/libnetmap/nmreq.c
235
close(fd);
lib/libnv/common_impl.h
39
fd_is_valid(int fd)
lib/libnv/common_impl.h
42
return (fcntl(fd, F_GETFD) != -1 || errno != EBADF);
lib/libnv/msgio.c
73
msghdr_add_fd(struct cmsghdr *cmsg, int fd)
lib/libnv/msgio.c
76
PJDLOG_ASSERT(fd >= 0);
lib/libnv/msgio.c
80
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
lib/libnv/msgio.c
81
bcopy(&fd, CMSG_DATA(cmsg), sizeof(fd));
lib/libnv/msgio.c
87
fd_wait(int fd, bool doread)
lib/libnv/msgio.c
91
PJDLOG_ASSERT(fd >= 0);
lib/libnv/msgio.c
93
pfd.fd = fd;
lib/libnv/tests/cnv_tests.cc
36
#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF)
lib/libnv/tests/nv_array_tests.cc
1010
fd = socks[0];
lib/libnv/tests/nv_array_tests.cc
1027
ATF_REQUIRE(nvlist_send(fd, nvl) >= 0);
lib/libnv/tests/nv_array_tests.cc
1033
fd = socks[1];
lib/libnv/tests/nv_array_tests.cc
1037
nvl = nvlist_recv(fd, 0);
lib/libnv/tests/nv_array_tests.cc
1052
close(fd);
lib/libnv/tests/nv_array_tests.cc
151
int fd[32], *result;
lib/libnv/tests/nv_array_tests.cc
158
for (i = 0; i < nitems(fd); i++) {
lib/libnv/tests/nv_array_tests.cc
159
fd[i] = dup(STDERR_FILENO);
lib/libnv/tests/nv_array_tests.cc
160
ATF_REQUIRE(fd_is_valid(fd[i]));
lib/libnv/tests/nv_array_tests.cc
169
nvlist_add_descriptor_array(nvl, key, fd, nitems(fd));
lib/libnv/tests/nv_array_tests.cc
178
ATF_REQUIRE(num_items == nitems(fd));
lib/libnv/tests/nv_array_tests.cc
187
ATF_REQUIRE_EQ(num_items, nitems(fd));
lib/libnv/tests/nv_array_tests.cc
200
close(fd[i]);
lib/libnv/tests/nv_array_tests.cc
42
#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF)
lib/libnv/tests/nv_array_tests.cc
999
int desc[32], fd, socks[2];
lib/libnv/tests/nvlist_get_test.c
46
#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF)
lib/libnv/tests/nvlist_move_test.c
54
int fd;
lib/libnv/tests/nvlist_move_test.c
90
fd = dup(STDERR_FILENO);
lib/libnv/tests/nvlist_move_test.c
91
CHECK(fd >= 0);
lib/libnv/tests/nvlist_move_test.c
92
nvlist_move_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", fd);
lib/libnv/tests/nvlist_move_test.c
95
CHECK(fd ==
lib/libnv/tests/nvlist_send_recv_test.c
107
int type, ctype, fd;
lib/libnv/tests/nvlist_send_recv_test.c
194
fd = nvlist_get_descriptor(nvl, name);
lib/libnv/tests/nvlist_send_recv_test.c
195
ATF_REQUIRE(fd_is_valid(fd));
lib/libnv/tests/nvlist_send_recv_test.c
196
ATF_REQUIRE(read(fd, buf, sizeof(buf)) == 4);
lib/libnv/tests/nvlist_send_recv_test.c
409
int anfds, bnfds, fd, i, j;
lib/libnv/tests/nvlist_send_recv_test.c
411
fd = open(_PATH_DEVNULL, O_RDONLY);
lib/libnv/tests/nvlist_send_recv_test.c
412
ATF_REQUIRE(fd >= 0);
lib/libnv/tests/nvlist_send_recv_test.c
422
nvlist_add_descriptor(nvl, name, fd);
lib/libnv/tests/nvlist_send_recv_test.c
440
int anfds, bnfds, fd, i, j, socks[2], status;
lib/libnv/tests/nvlist_send_recv_test.c
464
fd = nvlist_take_descriptor(nvl, name);
lib/libnv/tests/nvlist_send_recv_test.c
465
ATF_REQUIRE(close(fd) == 0);
lib/libnv/tests/nvlist_send_recv_test.c
55
#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF)
lib/libnv/tests/nvlist_send_recv_test.c
611
int fd, socks[2], status;
lib/libnv/tests/nvlist_send_recv_test.c
625
fd = socks[0];
lib/libnv/tests/nvlist_send_recv_test.c
639
ATF_REQUIRE_EQ(write(fd, packed, packed_size),
lib/libnv/tests/nvlist_send_recv_test.c
648
fd = socks[1];
lib/libnv/tests/nvlist_send_recv_test.c
652
nvl = nvlist_recv(fd, 0);
lib/libnv/tests/nvlist_send_recv_test.c
663
close(fd);
lib/libnv/tests/nvlist_send_recv_test.c
726
int fd, socks[2], status;
lib/libnv/tests/nvlist_send_recv_test.c
736
fd = socks[0];
lib/libnv/tests/nvlist_send_recv_test.c
753
ATF_REQUIRE_EQ(write(fd, packed, packed_size),
lib/libnv/tests/nvlist_send_recv_test.c
762
fd = socks[1];
lib/libnv/tests/nvlist_send_recv_test.c
765
nvl = nvlist_recv(fd, 0);
lib/libnv/tests/nvlist_send_recv_test.c
772
close(fd);
lib/libnv/tests/nvlist_send_recv_test.c
782
int fd, socks[2], fds[1], status;
lib/libnv/tests/nvlist_send_recv_test.c
792
fd = socks[0];
lib/libnv/tests/nvlist_send_recv_test.c
809
ATF_REQUIRE_EQ(write(fd, packed, packed_size),
lib/libnv/tests/nvlist_send_recv_test.c
814
ATF_REQUIRE_EQ(fd_send(fd, fds, 1), 0);
lib/libnv/tests/nvlist_send_recv_test.c
820
close(fd);
lib/libnv/tests/nvlist_send_recv_test.c
825
fd = socks[1];
lib/libnv/tests/nvlist_send_recv_test.c
828
nvl = nvlist_recv(fd, 0);
lib/libnv/tests/nvlist_send_recv_test.c
832
ATF_REQUIRE(fd_recv(fd, fds, 1) == 0);
lib/libnv/tests/nvlist_send_recv_test.c
838
close(fd);
lib/libnvmf/libnvmf.h
373
int nvmf_reconnect_params(int fd, nvlist_t **nvlp);
lib/libnvmf/libnvmf.h
379
int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle,
lib/libnvmf/libnvmf.h
387
int nvmf_connection_status(int fd, nvlist_t **nvlp);
lib/libnvmf/libnvmf.h
49
int fd;
lib/libnvmf/nvmf_host.c
1006
if (ioctl(fd, NVMF_RECONNECT_HOST, &nv) == -1)
lib/libnvmf/nvmf_host.c
1018
nvmf_connection_status(int fd, nvlist_t **nvlp)
lib/libnvmf/nvmf_host.c
1020
return (nvmf_read_ioc_nv(fd, NVMF_CONNECTION_STATUS, nvlp));
lib/libnvmf/nvmf_host.c
887
int error, fd;
lib/libnvmf/nvmf_host.c
889
fd = open("/dev/nvmf", O_RDWR);
lib/libnvmf/nvmf_host.c
890
if (fd == -1) {
lib/libnvmf/nvmf_host.c
901
if (ioctl(fd, NVMF_HANDOFF_HOST, &nv) == -1)
lib/libnvmf/nvmf_host.c
906
if (fd >= 0)
lib/libnvmf/nvmf_host.c
907
close(fd);
lib/libnvmf/nvmf_host.c
917
int error, fd;
lib/libnvmf/nvmf_host.c
920
fd = open("/dev/nvmf", O_RDWR);
lib/libnvmf/nvmf_host.c
921
if (fd == -1) {
lib/libnvmf/nvmf_host.c
926
if (ioctl(fd, NVMF_DISCONNECT_HOST, &host) == -1)
lib/libnvmf/nvmf_host.c
930
if (fd >= 0)
lib/libnvmf/nvmf_host.c
931
close(fd);
lib/libnvmf/nvmf_host.c
938
int error, fd;
lib/libnvmf/nvmf_host.c
941
fd = open("/dev/nvmf", O_RDWR);
lib/libnvmf/nvmf_host.c
942
if (fd == -1) {
lib/libnvmf/nvmf_host.c
947
if (ioctl(fd, NVMF_DISCONNECT_ALL) == -1)
lib/libnvmf/nvmf_host.c
951
if (fd >= 0)
lib/libnvmf/nvmf_host.c
952
close(fd);
lib/libnvmf/nvmf_host.c
957
nvmf_read_ioc_nv(int fd, u_long com, nvlist_t **nvlp)
lib/libnvmf/nvmf_host.c
964
if (ioctl(fd, com, &nv) == -1)
lib/libnvmf/nvmf_host.c
969
if (ioctl(fd, com, &nv) == -1) {
lib/libnvmf/nvmf_host.c
985
nvmf_reconnect_params(int fd, nvlist_t **nvlp)
lib/libnvmf/nvmf_host.c
987
return (nvmf_read_ioc_nv(fd, NVMF_RECONNECT_PARAMS, nvlp));
lib/libnvmf/nvmf_host.c
991
nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle,
lib/libnvmf/nvmf_tcp.c
1098
qp->s = qparams->tcp.fd;
lib/libopenbsd/imsg-buffer.c
162
if ((n = writev(msgbuf->fd, iov, i)) == -1) {
lib/libopenbsd/imsg-buffer.c
191
msgbuf->fd = -1;
lib/libopenbsd/imsg-buffer.c
245
if (buf->fd != -1)
lib/libopenbsd/imsg-buffer.c
252
if (buf != NULL && buf->fd != -1) {
lib/libopenbsd/imsg-buffer.c
259
*(int *)CMSG_DATA(cmsg) = buf->fd;
lib/libopenbsd/imsg-buffer.c
263
if ((n = sendmsg(msgbuf->fd, &msg, 0)) == -1) {
lib/libopenbsd/imsg-buffer.c
280
if (buf != NULL && buf->fd != -1) {
lib/libopenbsd/imsg-buffer.c
281
close(buf->fd);
lib/libopenbsd/imsg-buffer.c
282
buf->fd = -1;
lib/libopenbsd/imsg-buffer.c
302
if (buf->fd != -1)
lib/libopenbsd/imsg-buffer.c
303
close(buf->fd);
lib/libopenbsd/imsg-buffer.c
48
buf->fd = -1;
lib/libopenbsd/imsg.c
105
fd = ((int *)CMSG_DATA(cmsg))[i];
lib/libopenbsd/imsg.c
107
ifd->fd = fd;
lib/libopenbsd/imsg.c
112
close(fd);
lib/libopenbsd/imsg.c
149
imsg->fd = imsg_get_fd(ibuf);
lib/libopenbsd/imsg.c
151
imsg->fd = -1;
lib/libopenbsd/imsg.c
167
pid_t pid, int fd, const void *data, u_int16_t datalen)
lib/libopenbsd/imsg.c
177
wbuf->fd = fd;
lib/libopenbsd/imsg.c
186
pid_t pid, int fd, const struct iovec *iov, int iovcnt)
lib/libopenbsd/imsg.c
201
wbuf->fd = fd;
lib/libopenbsd/imsg.c
255
if (msg->fd != -1)
lib/libopenbsd/imsg.c
272
int fd;
lib/libopenbsd/imsg.c
278
fd = ifd->fd;
lib/libopenbsd/imsg.c
282
return (fd);
lib/libopenbsd/imsg.c
297
int fd;
lib/libopenbsd/imsg.c
300
while ((fd = imsg_get_fd(ibuf)) != -1)
lib/libopenbsd/imsg.c
301
close(fd);
lib/libopenbsd/imsg.c
36
imsg_init(struct imsgbuf *ibuf, int fd)
lib/libopenbsd/imsg.c
40
ibuf->fd = fd;
lib/libopenbsd/imsg.c
41
ibuf->w.fd = fd;
lib/libopenbsd/imsg.c
57
int fd;
lib/libopenbsd/imsg.c
82
if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) {
lib/libopenbsd/imsg.h
35
int fd;
lib/libopenbsd/imsg.h
41
int fd;
lib/libopenbsd/imsg.h
52
int fd;
lib/libopenbsd/imsg.h
59
int fd;
lib/libopenbsd/imsg.h
75
int fd;
lib/libpam/modules/pam_exec/pam_exec.c
345
pfd[0].fd = pd;
lib/libpam/modules/pam_exec/pam_exec.c
350
pfd[nfds].fd = chout[0];
lib/libpam/modules/pam_exec/pam_exec.c
356
pfd[nfds].fd = cherr[0];
lib/libpam/modules/pam_exec/pam_exec.c
362
pfd[nfds].fd = chin[1];
lib/libpam/modules/pam_exec/pam_exec.c
377
if ((rlen = read(pfd[i].fd, buf, sizeof(buf) - 1)) < 0) {
lib/libpam/modules/pam_exec/pam_exec.c
385
(void)pam_prompt(pamh, pfd[i].fd == chout[0] ?
lib/libpam/modules/pam_nologin/pam_nologin.c
106
if (fstat(fd, &st) == 0) {
lib/libpam/modules/pam_nologin/pam_nologin.c
109
ss = read(fd, mtmp, st.st_size);
lib/libpam/modules/pam_nologin/pam_nologin.c
120
close(fd);
lib/libpam/modules/pam_nologin/pam_nologin.c
65
int retval, fd;
lib/libpam/modules/pam_nologin/pam_nologin.c
98
fd = open(nologin, O_RDONLY, 0);
lib/libpam/modules/pam_nologin/pam_nologin.c
99
if (fd < 0) {
lib/libpam/modules/pam_ssh/pam_ssh.c
294
int fd;
lib/libpam/modules/pam_ssh/pam_ssh.c
303
for (fd = 3; fd < getdtablesize(); ++fd)
lib/libpam/modules/pam_ssh/pam_ssh.c
304
close(fd);
lib/libpam/modules/pam_ssh/pam_ssh.c
329
int fd, pam_err;
lib/libpam/modules/pam_ssh/pam_ssh.c
339
if (ssh_get_authentication_socket(&fd) != 0) {
lib/libpam/modules/pam_ssh/pam_ssh.c
350
if (ssh_add_identity(fd, psk->key, psk->comment) == 0)
lib/libpam/modules/pam_ssh/pam_ssh.c
363
ssh_close_authentication_socket(fd);
lib/libpam/modules/pam_xdg/pam_xdg.c
179
remove_dir(int fd)
lib/libpam/modules/pam_xdg/pam_xdg.c
184
dirp = fdopendir(fd);
lib/libpam/modules/pam_xdg/pam_xdg.c
195
dirfd = openat(fd, dp->d_name, 0);
lib/libpam/modules/pam_xdg/pam_xdg.c
198
unlinkat(fd, dp->d_name, AT_REMOVEDIR);
lib/libpam/modules/pam_xdg/pam_xdg.c
201
unlinkat(fd, dp->d_name, 0);
lib/libpfctl/libpfctl.c
108
close(h->fd);
lib/libpfctl/libpfctl.c
116
return (h->fd);
lib/libpfctl/libpfctl.c
60
int fd;
lib/libpfctl/libpfctl.c
84
h->fd = open(pf_device, O_RDWR);
lib/libpfctl/libpfctl.c
85
if (h->fd < 0)
lib/libpfctl/libpfctl.c
97
if (h->fd != -1)
lib/libpfctl/libpfctl.c
98
close(h->fd);
lib/libpmc/libpmc.c
1380
pmc_configure_logfile(int fd)
lib/libpmc/libpmc.c
1385
cla.pm_logfd = fd;
lib/libpmc/pmclog.c
561
pmclog_open(int fd)
lib/libpmc/pmclog.c
576
ps->ps_fd = fd;
lib/libpmc/pmu-events/json.c
50
int fd = open(fn, O_RDONLY);
lib/libpmc/pmu-events/json.c
52
if (fd < 0 && verbose > 0 && fn) {
lib/libpmc/pmu-events/json.c
57
if (fd < 0)
lib/libpmc/pmu-events/json.c
59
err = fstat(fd, &st);
lib/libpmc/pmu-events/json.c
65
PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
lib/libpmc/pmu-events/json.c
69
close(fd);
lib/libpmcstat/libpmcstat_image.c
260
int fd;
lib/libpmcstat/libpmcstat_image.c
276
if ((fd = open(buffer, O_RDONLY, 0)) < 0 ||
lib/libpmcstat/libpmcstat_image.c
277
(nbytes = read(fd, &ex, sizeof(ex))) < 0) {
lib/libpmcstat/libpmcstat_image.c
282
if (fd != -1)
lib/libpmcstat/libpmcstat_image.c
283
(void) close(fd);
lib/libpmcstat/libpmcstat_image.c
287
(void) close(fd);
lib/libpmcstat/libpmcstat_image.c
310
int fd;
lib/libpmcstat/libpmcstat_image.c
343
fd = open(buffer, O_RDONLY, 0);
lib/libpmcstat/libpmcstat_image.c
344
if (fd < 0) {
lib/libpmcstat/libpmcstat_image.c
355
if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
lib/libpmcstat/libpmcstat_image.c
473
if (fd >= 0)
lib/libpmcstat/libpmcstat_image.c
474
(void) close(fd);
lib/libpmcstat/libpmcstat_logging.c
428
int error, fd, cfd;
lib/libpmcstat/libpmcstat_logging.c
435
fd = -1;
lib/libpmcstat/libpmcstat_logging.c
448
fd = (mode == PMCSTAT_OPEN_FOR_READ) ? 0 : 1;
lib/libpmcstat/libpmcstat_logging.c
471
fd = -1;
lib/libpmcstat/libpmcstat_logging.c
473
if ((fd = socket(res->ai_family, res->ai_socktype,
lib/libpmcstat/libpmcstat_logging.c
479
if (bind(fd, res->ai_addr, res->ai_addrlen) < 0) {
lib/libpmcstat/libpmcstat_logging.c
481
(void) close(fd);
lib/libpmcstat/libpmcstat_logging.c
482
fd = -1;
lib/libpmcstat/libpmcstat_logging.c
485
listen(fd, 1);
lib/libpmcstat/libpmcstat_logging.c
486
cfd = accept(fd, NULL, NULL);
lib/libpmcstat/libpmcstat_logging.c
487
(void) close(fd);
lib/libpmcstat/libpmcstat_logging.c
490
fd = -1;
lib/libpmcstat/libpmcstat_logging.c
493
fd = cfd;
lib/libpmcstat/libpmcstat_logging.c
495
if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
lib/libpmcstat/libpmcstat_logging.c
497
(void) close(fd);
lib/libpmcstat/libpmcstat_logging.c
498
fd = -1;
lib/libpmcstat/libpmcstat_logging.c
507
} else if ((fd = open(path, mode == PMCSTAT_OPEN_FOR_READ ?
lib/libpmcstat/libpmcstat_logging.c
518
return (fd);
lib/libproc/_libproc.h
51
int fd;
lib/libproc/proc_create.c
101
if ((fd = open(phdl->execpath, O_RDONLY)) < 0) {
lib/libproc/proc_create.c
105
class = getelfclass(fd);
lib/libproc/proc_create.c
118
(void)close(fd);
lib/libproc/proc_create.c
249
(void)close(file->fd);
lib/libproc/proc_create.c
53
getelfclass(int fd)
lib/libproc/proc_create.c
61
if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL)
lib/libproc/proc_create.c
76
int error, class, count, fd;
lib/libproc/proc_rtld.c
81
file->fd = -1;
lib/libproc/proc_sym.c
211
int fd;
lib/libproc/proc_sym.c
213
fd = -1;
lib/libproc/proc_sym.c
215
return (fd);
lib/libproc/proc_sym.c
218
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) < 0)
lib/libproc/proc_sym.c
220
if (crc32_file(fd, &compcrc) != 0 || crc != compcrc) {
lib/libproc/proc_sym.c
222
(void)close(fd);
lib/libproc/proc_sym.c
223
fd = -1;
lib/libproc/proc_sym.c
227
return (fd);
lib/libproc/proc_sym.c
248
int fd, fd2;
lib/libproc/proc_sym.c
257
if ((fd = open(map->pr_mapname, O_RDONLY | O_CLOEXEC)) < 0) {
lib/libproc/proc_sym.c
261
if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
lib/libproc/proc_sym.c
344
file->fd = fd;
lib/libproc/proc_sym.c
355
(void)close(fd);
lib/libproc/proc_sym.c
357
file->fd = fd2;
lib/libproc/proc_sym.c
364
(void)close(fd);
lib/libproc/proc_sym.c
68
crc32_file(int fd, uint32_t *crc)
lib/libproc/proc_sym.c
74
while ((nr = read(fd, buf, sizeof(buf))) > 0) {
lib/libprocstat/core.c
133
int fd, i;
lib/libprocstat/core.c
139
fd = open(filename, O_RDONLY, 0);
lib/libprocstat/core.c
140
if (fd == -1) {
lib/libprocstat/core.c
144
e = elf_begin(fd, ELF_C_READ, NULL);
lib/libprocstat/core.c
183
core->pc_fd = fd;
lib/libprocstat/core.c
192
close(fd);
lib/libprocstat/libprocstat.c
382
filestat_new_entry(void *typedep, int type, int fd, int fflags, int uflags,
lib/libprocstat/libprocstat.c
395
entry->fs_fd = fd;
lib/libprocstat/libprocstat.c
776
kinfo_uflags2fst(int fd)
lib/libprocstat/libprocstat.c
779
switch (fd) {
lib/libprocstat/libprocstat.c
863
int cnt, fd, fflags;
lib/libprocstat/libprocstat.c
896
fd = kif->kf_fd >= 0 ? kif->kf_fd : -1;
lib/libprocstat/libprocstat.c
910
entry = filestat_new_entry(kif, type, fd, fflags, uflags,
lib/libradius/radlib.c
1000
if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
lib/libradius/radlib.c
1009
if (bind(h->fd, (const struct sockaddr *)&sin,
lib/libradius/radlib.c
1012
close(h->fd);
lib/libradius/radlib.c
1013
h->fd = -1;
lib/libradius/radlib.c
1070
return rad_continue_send_request(h, 0, fd, tv);
lib/libradius/radlib.c
1085
h->fd = -1;
lib/libradius/radlib.c
1114
rad_server_open(int fd)
lib/libradius/radlib.c
1121
h->fd = fd;
lib/libradius/radlib.c
1239
int fd;
lib/libradius/radlib.c
1242
n = rad_init_send_request(h, &fd, &tv);
lib/libradius/radlib.c
1254
FD_SET(fd, &readfds);
lib/libradius/radlib.c
1256
n = select(fd + 1, &readfds, NULL, NULL, &tv);
lib/libradius/radlib.c
1263
if (!FD_ISSET(fd, &readfds)) {
lib/libradius/radlib.c
1272
n = rad_continue_send_request(h, n, &fd, &tv);
lib/libradius/radlib.c
481
if (h->fd != -1)
lib/libradius/radlib.c
482
close(h->fd);
lib/libradius/radlib.c
679
rad_continue_send_request(struct rad_handle *h, int selected, int *fd,
lib/libradius/radlib.c
695
h->in_len = recvfrom(h->fd, h->in,
lib/libradius/radlib.c
746
close(h->fd);
lib/libradius/radlib.c
747
if ((h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
lib/libradius/radlib.c
756
if (bind(h->fd, (const struct sockaddr *)&sin,
lib/libradius/radlib.c
759
close(h->fd);
lib/libradius/radlib.c
760
h->fd = -1;
lib/libradius/radlib.c
779
n = sendto(h->fd, h->out, h->out_len, 0,
lib/libradius/radlib.c
788
*fd = h->fd;
lib/libradius/radlib.c
806
h->in_len = recvfrom(h->fd, h->in,
lib/libradius/radlib.c
848
n = sendto(h->fd, h->out, h->out_len, 0,
lib/libradius/radlib.c
988
rad_init_send_request(struct rad_handle *h, int *fd, struct timeval *tv)
lib/libradius/radlib.c
999
if (h->fd == -1) {
lib/libradius/radlib.h
230
struct rad_handle *rad_server_open(int fd);
lib/libradius/radlib_private.h
79
int fd; /* Socket file descriptor */
lib/librss/librss.c
47
rss_sock_set_recvrss(int fd, int af, int val)
lib/librss/librss.c
71
retval = setsockopt(fd, p, f1, &opt, optlen);
lib/librss/librss.c
80
retval = setsockopt(fd, p, f2, &opt, optlen);
lib/librss/librss.h
51
extern int rss_sock_set_recvrss(int fd, int af, int val);
lib/librtld_db/rtld_db.c
285
int fd, i, ret;
lib/librtld_db/rtld_db.c
290
fd = open(rtldpath, O_RDONLY);
lib/librtld_db/rtld_db.c
291
if (fd < 0)
lib/librtld_db/rtld_db.c
296
e = elf_begin(fd, ELF_C_READ, NULL);
lib/librtld_db/rtld_db.c
338
if (fd >= 0)
lib/librtld_db/rtld_db.c
339
(void)close(fd);
lib/libsecureboot/openpgp/dearmor.c
104
int fd;
lib/libsecureboot/openpgp/dearmor.c
123
if ((fd = open(outfile, O_WRONLY|O_CREAT|O_TRUNC)) < 0)
lib/libsecureboot/openpgp/dearmor.c
126
fd = 1; /* stdout */
lib/libsecureboot/openpgp/dearmor.c
132
o = write(fd, &data[x], (n - x));
lib/libsecureboot/openpgp/dearmor.c
137
if (fd != 1)
lib/libsecureboot/openpgp/dearmor.c
138
close(fd);
lib/libsecureboot/readfile.c
29
read_fd(int fd, size_t len)
lib/libsecureboot/readfile.c
37
n = read(fd, &buf[x], m);
lib/libsecureboot/readfile.c
59
int fd;
lib/libsecureboot/readfile.c
63
if ((fd = open(path, O_RDONLY)) < 0)
lib/libsecureboot/readfile.c
65
fstat(fd, &st);
lib/libsecureboot/readfile.c
66
ucp = read_fd(fd, st.st_size);
lib/libsecureboot/readfile.c
67
close(fd);
lib/libsecureboot/tests/tvo.c
109
fd = open(argv[optind], O_RDONLY);
lib/libsecureboot/tests/tvo.c
110
if (fd > 0) {
lib/libsecureboot/tests/tvo.c
116
x = verify_file(fd, argv[optind], 0, VE_GUESS, __func__);
lib/libsecureboot/tests/tvo.c
118
close(fd);
lib/libsecureboot/tests/tvo.c
156
fd = verify_open(argv[optind], O_RDONLY);
lib/libsecureboot/tests/tvo.c
157
printf("verify_open(%s) = %d %s\n", argv[optind], fd,
lib/libsecureboot/tests/tvo.c
158
(fd < 0) ? ve_error_get() : "");
lib/libsecureboot/tests/tvo.c
159
if (fd > 0) {
lib/libsecureboot/tests/tvo.c
170
fstat(fd, &st);
lib/libsecureboot/tests/tvo.c
171
lseek(fd, 0, SEEK_SET);
lib/libsecureboot/tests/tvo.c
173
vp = vectx_open(fd, argv[optind], VE_GUESS,
lib/libsecureboot/tests/tvo.c
203
close(fd);
lib/libsecureboot/tests/tvo.c
46
int fd;
lib/libsecureboot/vectx.c
110
rc = verify_prep(fd, path, off, stp, __func__);
lib/libsecureboot/vectx.c
116
caller, fd, path, rc, severity));
lib/libsecureboot/vectx.c
131
ctx->vec_fd = fd;
lib/libsecureboot/vectx.c
147
cp = fingerprint_info_lookup(fd, path);
lib/libsecureboot/vectx.c
197
lseek(fd, 0, SEEK_SET);
lib/libsecureboot/vectx.c
97
vectx_open(int fd, const char *path, int severity,
lib/libsecureboot/veopen.c
190
fingerprint_info_lookup(int fd, const char *path)
lib/libsecureboot/veopen.c
206
if (fstat(fd, &st) == 0)
lib/libsecureboot/veopen.c
348
verify_fingerprint(int fd, const char *path, const char *cp, off_t off)
lib/libsecureboot/veopen.c
387
lseek(fd, 0, SEEK_SET);
lib/libsecureboot/veopen.c
389
n = read(fd, buf, sizeof(buf));
lib/libsecureboot/veopen.c
395
lseek(fd, off, SEEK_SET);
lib/libsecureboot/veopen.c
416
verify_fd(int fd, const char *path, off_t off, struct stat *stp)
lib/libsecureboot/veopen.c
423
if (fstat(fd, &st) == 0)
lib/libsecureboot/veopen.c
428
cp = fingerprint_info_lookup(fd, path);
lib/libsecureboot/veopen.c
433
rc = verify_fingerprint(fd, path, cp, off);
lib/libsecureboot/veopen.c
459
int fd;
lib/libsecureboot/veopen.c
462
if ((fd = open(path, flags)) >= 0) {
lib/libsecureboot/veopen.c
463
if ((rc = verify_fd(fd, path, 0, NULL)) < 0) {
lib/libsecureboot/veopen.c
464
close(fd);
lib/libsecureboot/veopen.c
465
fd = rc;
lib/libsecureboot/veopen.c
468
return (fd);
lib/libsecureboot/verify_file.c
106
ve_status_get(int fd)
lib/libsecureboot/verify_file.c
112
fd >= 0 && fd < SOPEN_MAX)
lib/libsecureboot/verify_file.c
113
return (ve_status[fd]);
lib/libsecureboot/verify_file.c
304
verify_tweak(int fd, off_t off, struct stat *stp,
lib/libsecureboot/verify_file.c
337
lseek(fd, 0, SEEK_SET);
lib/libsecureboot/verify_file.c
338
ucp = read_fd(fd, stp->st_size);
lib/libsecureboot/verify_file.c
453
verify_prep(int fd, const char *filename, off_t off, struct stat *stp,
lib/libsecureboot/verify_file.c
469
if (!Verifying || fd < 0)
lib/libsecureboot/verify_file.c
472
if (fstat(fd, stp) < 0 || !S_ISREG(stp->st_mode))
lib/libsecureboot/verify_file.c
477
caller, fd, filename, (long long)off, (long long)stp->st_dev,
lib/libsecureboot/verify_file.c
485
ve_status_set(fd, rc);
lib/libsecureboot/verify_file.c
518
verify_file(int fd, const char *filename, off_t off, int severity,
lib/libsecureboot/verify_file.c
537
rc = verify_prep(fd, filename, off, &st, caller);
lib/libsecureboot/verify_file.c
562
rc = verify_fd(fd, filename, off, &st);
lib/libsecureboot/verify_file.c
570
verify_tweak(fd, off, &st, cp,
lib/libsecureboot/verify_file.c
576
ve_status_set(fd, rc);
lib/libsecureboot/verify_file.c
604
ve_status_set(fd, rc);
lib/libsecureboot/verify_file.c
86
ve_status_set(int fd, int ves)
lib/libsecureboot/verify_file.c
88
if (fd >= 0 && fd < SOPEN_MAX) {
lib/libsecureboot/verify_file.c
89
ve_status[fd] = ves;
lib/libsys/_libsys.h
483
ssize_t __sys_read(int fd, void * buf, size_t nbyte);
lib/libsys/_libsys.h
484
ssize_t __sys_write(int fd, const void * buf, size_t nbyte);
lib/libsys/_libsys.h
486
int __sys_close(int fd);
lib/libsys/_libsys.h
491
int __sys_fchdir(int fd);
lib/libsys/_libsys.h
510
int __sys_fchflags(int fd, u_long flags);
lib/libsys/_libsys.h
514
int __sys_dup(u_int fd);
lib/libsys/_libsys.h
523
int __sys_ioctl(int fd, u_long com, char * data);
lib/libsys/_libsys.h
544
int __sys_fcntl(int fd, int cmd, intptr_t arg);
lib/libsys/_libsys.h
546
int __sys_fsync(int fd);
lib/libsys/_libsys.h
557
ssize_t __sys_readv(int fd, const struct iovec * iovp, u_int iovcnt);
lib/libsys/_libsys.h
558
ssize_t __sys_writev(int fd, const struct iovec * iovp, u_int iovcnt);
lib/libsys/_libsys.h
560
int __sys_fchown(int fd, int uid, int gid);
lib/libsys/_libsys.h
561
int __sys_fchmod(int fd, mode_t mode);
lib/libsys/_libsys.h
565
int __sys_flock(int fd, int how);
lib/libsys/_libsys.h
591
int __sys_fpathconf(int fd, int name);
lib/libsys/_libsys.h
598
int __sys_futimes(int fd, const struct timeval * tptr);
lib/libsys/_libsys.h
633
ssize_t __sys_preadv(int fd, struct iovec * iovp, u_int iovcnt, off_t offset);
lib/libsys/_libsys.h
634
ssize_t __sys_pwritev(int fd, struct iovec * iovp, u_int iovcnt, off_t offset);
lib/libsys/_libsys.h
651
int __sys_aio_cancel(int fd, struct aiocb * aiocbp);
lib/libsys/_libsys.h
689
ssize_t __sys_extattr_set_fd(int fd, int attrnamespace, const char * attrname, void * data, size_t nbytes);
lib/libsys/_libsys.h
690
ssize_t __sys_extattr_get_fd(int fd, int attrnamespace, const char * attrname, void * data, size_t nbytes);
lib/libsys/_libsys.h
691
int __sys_extattr_delete_fd(int fd, int attrnamespace, const char * attrname);
lib/libsys/_libsys.h
698
int __sys___mac_get_fd(int fd, struct mac * mac_p);
lib/libsys/_libsys.h
700
int __sys___mac_set_fd(int fd, struct mac * mac_p);
lib/libsys/_libsys.h
705
int __sys_sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr * hdtr, off_t * sbytes, int flags);
lib/libsys/_libsys.h
738
ssize_t __sys_extattr_list_fd(int fd, int attrnamespace, void * data, size_t nbytes);
lib/libsys/_libsys.h
771
ssize_t __sys_pread(int fd, void * buf, size_t nbyte, off_t offset);
lib/libsys/_libsys.h
772
ssize_t __sys_pwrite(int fd, const void * buf, size_t nbyte, off_t offset);
lib/libsys/_libsys.h
773
void * __sys_mmap(void * addr, size_t len, int prot, int flags, int fd, off_t pos);
lib/libsys/_libsys.h
774
off_t __sys_lseek(int fd, off_t offset, int whence);
lib/libsys/_libsys.h
776
int __sys_ftruncate(int fd, off_t length);
lib/libsys/_libsys.h
784
int __sys_faccessat(int fd, const char * path, int amode, int flag);
lib/libsys/_libsys.h
785
int __sys_fchmodat(int fd, const char * path, mode_t mode, int flag);
lib/libsys/_libsys.h
786
int __sys_fchownat(int fd, const char * path, uid_t uid, gid_t gid, int flag);
lib/libsys/_libsys.h
787
int __sys_fexecve(int fd, char ** argv, char ** envv);
lib/libsys/_libsys.h
788
int __sys_futimesat(int fd, const char * path, const struct timeval * times);
lib/libsys/_libsys.h
790
int __sys_mkdirat(int fd, const char * path, mode_t mode);
lib/libsys/_libsys.h
791
int __sys_mkfifoat(int fd, const char * path, mode_t mode);
lib/libsys/_libsys.h
792
int __sys_openat(int fd, const char * path, int flag, mode_t mode);
lib/libsys/_libsys.h
793
ssize_t __sys_readlinkat(int fd, const char * path, char * buf, size_t bufsize);
lib/libsys/_libsys.h
795
int __sys_symlinkat(const char * path1, int fd, const char * path2);
lib/libsys/_libsys.h
796
int __sys_unlinkat(int fd, const char * path, int flag);
lib/libsys/_libsys.h
805
int __sys___cap_rights_get(int version, int fd, cap_rights_t * rightsp);
lib/libsys/_libsys.h
809
int __sys_pdkill(int fd, int signum);
lib/libsys/_libsys.h
810
int __sys_pdgetpid(int fd, pid_t * pidp);
lib/libsys/_libsys.h
819
int __sys_posix_fallocate(int fd, off_t offset, off_t len);
lib/libsys/_libsys.h
820
int __sys_posix_fadvise(int fd, off_t offset, off_t len, int advice);
lib/libsys/_libsys.h
822
int __sys_cap_rights_limit(int fd, cap_rights_t * rightsp);
lib/libsys/_libsys.h
823
int __sys_cap_ioctls_limit(int fd, const u_long * cmds, size_t ncmds);
lib/libsys/_libsys.h
824
ssize_t __sys_cap_ioctls_get(int fd, u_long * cmds, size_t maxcmds);
lib/libsys/_libsys.h
825
int __sys_cap_fcntls_limit(int fd, uint32_t fcntlrights);
lib/libsys/_libsys.h
826
int __sys_cap_fcntls_get(int fd, uint32_t * fcntlrightsp);
lib/libsys/_libsys.h
827
int __sys_bindat(int fd, int s, const struct sockaddr * name, __socklen_t namelen);
lib/libsys/_libsys.h
828
int __sys_connectat(int fd, int s, const struct sockaddr * name, __socklen_t namelen);
lib/libsys/_libsys.h
829
int __sys_chflagsat(int fd, const char * path, u_long flags, int atflag);
lib/libsys/_libsys.h
835
int __sys_futimens(int fd, const struct timespec * times);
lib/libsys/_libsys.h
836
int __sys_utimensat(int fd, const char * path, const struct timespec * times, int flag);
lib/libsys/_libsys.h
837
int __sys_fdatasync(int fd);
lib/libsys/_libsys.h
838
int __sys_fstat(int fd, struct stat * sb);
lib/libsys/_libsys.h
839
int __sys_fstatat(int fd, const char * path, struct stat * buf, int flag);
lib/libsys/_libsys.h
841
ssize_t __sys_getdirentries(int fd, char * buf, size_t count, off_t * basep);
lib/libsys/_libsys.h
843
int __sys_fstatfs(int fd, struct statfs * buf);
lib/libsys/_libsys.h
846
int __sys_mknodat(int fd, const char * path, mode_t mode, dev_t dev);
lib/libsys/_libsys.h
847
int __sys_kevent(int fd, const struct kevent * changelist, int nchanges, struct kevent * eventlist, int nevents, const struct timespec * timeout);
lib/libsys/_libsys.h
851
int __sys_getfhat(int fd, const char * path, struct fhandle * fhp, int flags);
lib/libsys/_libsys.h
855
int __sys_funlinkat(int dfd, const char * path, int fd, int flag);
lib/libsys/_libsys.h
861
int __sys___realpathat(int fd, const char * path, char * buf, size_t size, int flags);
lib/libsys/_libsys.h
867
int __sys_fspacectl(int fd, int cmd, const struct spacectl_range * rqsr, int flags, struct spacectl_range * rmsr);
lib/libsys/_libsys.h
873
int __sys_timerfd_gettime(int fd, struct itimerspec * curr_value);
lib/libsys/_libsys.h
874
int __sys_timerfd_settime(int fd, int flags, const struct itimerspec * new_value, struct itimerspec * old_value);
lib/libsys/_libsys.h
877
int __sys_fchroot(int fd);
lib/libsys/_libsys.h
880
int __sys_inotify_add_watch_at(int fd, int dfd, const char * path, uint32_t mask);
lib/libsys/_libsys.h
881
int __sys_inotify_rm_watch(int fd, int wd);
lib/libsys/_libsys.h
884
int __sys_jail_attach_jd(int fd);
lib/libsys/_libsys.h
885
int __sys_jail_remove_jd(int fd);
lib/libsys/_libsys.h
888
int __sys_pdwait(int fd, int * status, int options, struct __wrusage * wrusage, struct __siginfo * info);
lib/libsys/_libsys.h
891
int __sys_pddupfd(int pd, int fd, int flags);
lib/libsys/recvmmsg.c
49
pfd[0].fd = s;
lib/libsys/x86/__vdso_gettc.c
240
int fd;
lib/libsys/x86/__vdso_gettc.c
264
(fd = _open(devname, O_RDONLY | O_CLOEXEC)) == -1) {
lib/libsys/x86/__vdso_gettc.c
271
new_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0);
lib/libsys/x86/__vdso_gettc.c
272
_close(fd);
lib/libsys/x86/__vdso_gettc.c
294
int fd;
lib/libsys/x86/__vdso_gettc.c
300
fd = _open(HYPERV_REFTSC_DEVPATH, O_RDONLY | O_CLOEXEC);
lib/libsys/x86/__vdso_gettc.c
301
if (fd < 0)
lib/libsys/x86/__vdso_gettc.c
304
MAP_SHARED, fd, 0);
lib/libsys/x86/__vdso_gettc.c
305
_close(fd);
lib/libsys/x86/__vdso_gettc.c
383
int fd, ncpus;
lib/libsys/x86/__vdso_gettc.c
389
(fd = _open("/dev/" PVCLOCK_CDEVNAME, O_RDONLY | O_CLOEXEC)) < 0)
lib/libsys/x86/__vdso_gettc.c
392
timeinfos = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
lib/libsys/x86/__vdso_gettc.c
393
_close(fd);
lib/libsysdecode/flags.c
91
sysdecode_atfd(int fd)
lib/libsysdecode/flags.c
94
if (fd == AT_FDCWD)
lib/libtacplus/taclib.c
230
if (h->fd != -1) {
lib/libtacplus/taclib.c
231
close(h->fd);
lib/libtacplus/taclib.c
232
h->fd = -1;
lib/libtacplus/taclib.c
242
if ((h->fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
lib/libtacplus/taclib.c
246
if ((flags = fcntl(h->fd, F_GETFL, 0)) == -1 ||
lib/libtacplus/taclib.c
247
fcntl(h->fd, F_SETFL, flags | O_NONBLOCK) == -1) {
lib/libtacplus/taclib.c
250
close(h->fd);
lib/libtacplus/taclib.c
251
h->fd = -1;
lib/libtacplus/taclib.c
254
if (connect(h->fd, (struct sockaddr *)&srvp->addr,
lib/libtacplus/taclib.c
268
FD_SET(h->fd, &wfds);
lib/libtacplus/taclib.c
271
nfds = select(h->fd + 1, NULL, &wfds, NULL, &tv);
lib/libtacplus/taclib.c
274
close(h->fd);
lib/libtacplus/taclib.c
275
h->fd = -1;
lib/libtacplus/taclib.c
280
close(h->fd);
lib/libtacplus/taclib.c
281
h->fd = -1;
lib/libtacplus/taclib.c
287
if (getpeername(h->fd, &peer, &peerlen) == 0)
lib/libtacplus/taclib.c
292
close(h->fd);
lib/libtacplus/taclib.c
293
h->fd = -1;
lib/libtacplus/taclib.c
299
getsockopt(h->fd, SOL_SOCKET, SO_ERROR, &err, &errlen);
lib/libtacplus/taclib.c
303
close(h->fd);
lib/libtacplus/taclib.c
304
h->fd = -1;
lib/libtacplus/taclib.c
379
if (h->fd >= 0) /* Already connected. */
lib/libtacplus/taclib.c
493
n = read(h->fd, ptr, len);
lib/libtacplus/taclib.c
511
FD_SET(h->fd, &rfds);
lib/libtacplus/taclib.c
513
select(h->fd + 1, &rfds, NULL, NULL, &tv);
lib/libtacplus/taclib.c
645
n = write(h->fd, ptr, len);
lib/libtacplus/taclib.c
663
FD_SET(h->fd, &wfds);
lib/libtacplus/taclib.c
665
select(h->fd + 1, NULL, &wfds, NULL, &tv);
lib/libtacplus/taclib.c
765
if (h->fd != -1)
lib/libtacplus/taclib.c
766
close(h->fd);
lib/libtacplus/taclib.c
984
h->fd = -1;
lib/libtacplus/taclib_private.h
162
int fd; /* Socket file descriptor */
lib/libthr/thread/thr_printf.c
100
pstr(fd, "0x");
lib/libthr/thread/thr_printf.c
108
pchar(fd, '-');
lib/libthr/thread/thr_printf.c
123
pchar(fd, *s);
lib/libthr/thread/thr_printf.c
127
pchar(fd, c);
lib/libthr/thread/thr_printf.c
135
pchar(int fd, char c)
lib/libthr/thread/thr_printf.c
138
__sys_write(fd, &c, 1);
lib/libthr/thread/thr_printf.c
145
pstr(int fd, const char *s)
lib/libthr/thread/thr_printf.c
148
__sys_write(fd, s, strlen(s));
lib/libthr/thread/thr_printf.c
37
static void pchar(int fd, char c);
lib/libthr/thread/thr_printf.c
38
static void pstr(int fd, const char *s);
lib/libthr/thread/thr_printf.c
52
_thread_printf(int fd, const char *fmt, ...)
lib/libthr/thread/thr_printf.c
57
_thread_vprintf(fd, fmt, ap);
lib/libthr/thread/thr_printf.c
62
_thread_vprintf(int fd, const char *fmt, va_list ap)
lib/libthr/thread/thr_printf.c
84
pchar(fd, va_arg(ap, int));
lib/libthr/thread/thr_printf.c
87
pstr(fd, va_arg(ap, char *));
lib/libthr/thread/thr_printf.c
93
pstr(fd, "0x");
lib/libthr/thread/thr_pshared.c
229
int fd, ins_done;
lib/libthr/thread/thr_pshared.c
242
fd = _umtx_op(NULL, UMTX_OP_SHM, doalloc ? UMTX_SHM_CREAT :
lib/libthr/thread/thr_pshared.c
244
if (fd == -1)
lib/libthr/thread/thr_pshared.c
246
res = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
lib/libthr/thread/thr_pshared.c
247
close(fd);
lib/libthr/thread/thr_syscalls.c
152
__thr_close(int fd)
lib/libthr/thread/thr_syscalls.c
159
ret = __sys_close(fd);
lib/libthr/thread/thr_syscalls.c
170
__thr_connect(int fd, const struct sockaddr *name, socklen_t namelen)
lib/libthr/thread/thr_syscalls.c
177
ret = __sys_connect(fd, name, namelen);
lib/libthr/thread/thr_syscalls.c
191
__thr_fcntl(int fd, int cmd, __intptr_t arg)
lib/libthr/thread/thr_syscalls.c
199
ret = __sys_fcntl(fd, cmd, arg);
lib/libthr/thread/thr_syscalls.c
202
ret = __sys_fcntl(fd, cmd, arg);
lib/libthr/thread/thr_syscalls.c
213
__thr_fsync(int fd)
lib/libthr/thread/thr_syscalls.c
220
ret = __sys_fsync(fd);
lib/libthr/thread/thr_syscalls.c
227
__thr_fdatasync(int fd)
lib/libthr/thread/thr_syscalls.c
234
ret = __sys_fdatasync(fd);
lib/libthr/thread/thr_syscalls.c
294
__thr_openat(int fd, const char *path, int flags, int mode)
lib/libthr/thread/thr_syscalls.c
301
ret = __sys_openat(fd, path, flags, mode);
lib/libthr/thread/thr_syscalls.c
395
__thr_read(int fd, void *buf, size_t nbytes)
lib/libthr/thread/thr_syscalls.c
402
ret = __sys_read(fd, buf, nbytes);
lib/libthr/thread/thr_syscalls.c
414
__thr_readv(int fd, const struct iovec *iov, int iovcnt)
lib/libthr/thread/thr_syscalls.c
421
ret = __sys_readv(fd, iov, iovcnt);
lib/libthr/thread/thr_syscalls.c
538
__thr_tcdrain(int fd)
lib/libthr/thread/thr_syscalls.c
545
ret = __libc_tcdrain(fd);
lib/libthr/thread/thr_syscalls.c
588
__thr_pdwait(int fd, int *status, int options, struct __wrusage *ru,
lib/libthr/thread/thr_syscalls.c
596
ret = __sys_pdwait(fd, status, options, ru, infop);
lib/libthr/thread/thr_syscalls.c
607
__thr_write(int fd, const void *buf, size_t nbytes)
lib/libthr/thread/thr_syscalls.c
614
ret = __sys_write(fd, buf, nbytes);
lib/libthr/thread/thr_syscalls.c
625
__thr_writev(int fd, const struct iovec *iov, int iovcnt)
lib/libthr/thread/thr_syscalls.c
632
ret = __sys_writev(fd, iov, iovcnt);
lib/libufs/sblock.c
227
int fd;
lib/libufs/sblock.c
229
fd = *(int *)devfd;
lib/libufs/sblock.c
233
if (pread(fd, *bufp, size, loc) != size)
lib/libufs/sblock.c
285
int fd;
lib/libufs/sblock.c
287
fd = *(int *)devfd;
lib/libufs/sblock.c
288
if (pwrite(fd, buf, size, loc) != size)
lib/libufs/type.c
147
fd = open(name, O_RDONLY);
lib/libufs/type.c
148
if (fd == -1) {
lib/libufs/type.c
156
close(fd);
lib/libufs/type.c
162
disk->d_fd = fd;
lib/libufs/type.c
189
int fd;
lib/libufs/type.c
196
fd = open(disk->d_name, O_RDWR);
lib/libufs/type.c
197
if (fd < 0) {
lib/libufs/type.c
203
disk->d_fd = fd;
lib/libufs/type.c
97
int fd, ret;
lib/libulog/ulog_login_pseudo.c
46
ulog_exec_helper(int fd, char const * const argv[])
lib/libulog/ulog_login_pseudo.c
62
if (dup2(fd, STDIN_FILENO) == -1)
lib/libulog/ulog_login_pseudo.c
79
ulog_login_pseudo(int fd, const char *host)
lib/libulog/ulog_login_pseudo.c
83
ulog_exec_helper(fd, args);
lib/libulog/ulog_login_pseudo.c
87
ulog_logout_pseudo(int fd)
lib/libulog/ulog_login_pseudo.c
91
ulog_exec_helper(fd, args);
lib/libulog/utempter.c
36
utempter_add_record(int fd, const char *host)
lib/libulog/utempter.c
39
ulog_login_pseudo(fd, host);
lib/libulog/utempter.c
40
last_fd = fd;
lib/libulog/utempter.c
56
utempter_remove_record(int fd)
lib/libulog/utempter.c
59
ulog_logout_pseudo(fd);
lib/libulog/utempter.c
60
if (last_fd == fd)
lib/libulog/utempter.c
66
addToUtmp(const char *pty __unused, const char *host, int fd)
lib/libulog/utempter.c
69
utempter_add_record(fd, host);
lib/libulog/utempter.c
80
removeLineFromUtmp(const char *pty __unused, int fd)
lib/libulog/utempter.c
83
utempter_remove_record(fd);
lib/libusb/libusb.h
314
int fd;
lib/libusb/libusb.h
342
typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
lib/libusb/libusb.h
343
typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);
lib/libusb/libusb10.c
344
close(ctx->ss.fd);
lib/libusb/libusb10.c
345
ctx->ss.fd = -1;
lib/libusb/libusb10.h
152
void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events);
lib/libusb/libusb10_hotplug.c
230
pfd.fd = ctx->devd_pipe;
lib/libusb/libusb10_hotplug.c
234
pfd.fd = ctx->ss.fd;
lib/libusb/libusb10_hotplug.c
262
if (ctx->ss.fd != -1)
lib/libusb/libusb10_hotplug.c
263
close(ctx->ss.fd);
lib/libusb/libusb10_hotplug.c
280
close(ctx->ss.fd);
lib/libusb/libusb10_hotplug.c
79
if (setsockopt(ctx->ss.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group,
lib/libusb/libusb10_io.c
128
fds[i].fd = pfd->pollfd.fd;
lib/libusb/libusb10_io.c
192
eventfd_read(fds[i].fd, &(eventfd_t){0});
lib/libusb/libusb10_io.c
55
struct libusb20_device *pdev, int fd, short events)
lib/libusb/libusb10_io.c
63
if (fd < 0)
lib/libusb/libusb10_io.c
67
pollfd->pollfd.fd = fd;
lib/libusb/libusb10_io.c
75
ctx->fd_added_cb(fd, events, ctx->fd_cb_user_data);
lib/libusb/libusb10_io.c
93
ctx->fd_removed_cb(pollfd->pollfd.fd, ctx->fd_cb_user_data);
lib/libusb/libusb20.c
1117
pfd[0].fd = pdev->file;
lib/libusbhid/data.c
121
hid_get_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size)
lib/libusbhid/data.c
129
return (ioctl(fd, USB_GET_REPORT, &ugd));
lib/libusbhid/data.c
133
hid_set_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size)
lib/libusbhid/data.c
141
return (ioctl(fd, USB_SET_REPORT, &ugd));
lib/libusbhid/descr.c
107
if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) {
lib/libusbhid/descr.c
111
return (hid_get_report_desc_compat7(fd));
lib/libusbhid/descr.c
128
if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) {
lib/libusbhid/descr.c
46
hid_set_immed(int fd, int enable)
lib/libusbhid/descr.c
49
ret = ioctl(fd, USB_SET_IMMED, &enable);
lib/libusbhid/descr.c
52
ret = hid_set_immed_compat7(fd, enable);
lib/libusbhid/descr.c
58
hid_get_report_id(int fd)
lib/libusbhid/descr.c
67
if ((rep = hid_get_report_desc(fd)) == NULL)
lib/libusbhid/descr.c
84
ret = ioctl(fd, USB_GET_REPORT_ID, &temp);
lib/libusbhid/descr.c
87
ret = hid_get_report_id_compat7(fd);
lib/libusbhid/descr.c
96
hid_get_report_desc(int fd)
lib/libusbhid/descr_compat.c
51
hid_set_immed_compat7(int fd, int enable)
lib/libusbhid/descr_compat.c
53
return (ioctl(fd, USB_SET_IMMED, &enable));
lib/libusbhid/descr_compat.c
57
hid_get_report_id_compat7(int fd)
lib/libusbhid/descr_compat.c
61
if (ioctl(fd, USB_GET_REPORT_ID, &temp) < 0)
lib/libusbhid/descr_compat.c
68
hid_get_report_desc_compat7(int fd)
lib/libusbhid/descr_compat.c
73
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
lib/libusbhid/usbhid.h
111
int hid_get_report(int fd, enum hid_kind k,
lib/libusbhid/usbhid.h
113
int hid_set_report(int fd, enum hid_kind k,
lib/libusbhid/usbhid.h
91
int hid_set_immed(int fd, int enable);
lib/libusbhid/usbvar.h
43
int hid_set_immed_compat7(int fd, int enable);
lib/libusbhid/usbvar.h
44
int hid_get_report_id_compat7(int fd);
lib/libusbhid/usbvar.h
45
report_desc_t hid_get_report_desc_compat7(int fd);
lib/libutil++/libutil++.hh
113
explicit operator bool() const { return fd >= 0; }
lib/libutil++/libutil++.hh
114
operator int() const { return fd; }
lib/libutil++/libutil++.hh
116
int fd;
lib/libutil++/libutil++.hh
72
fd_up() : fd(-1) {}
lib/libutil++/libutil++.hh
73
fd_up(int _fd) : fd(_fd) {}
lib/libutil++/libutil++.hh
74
fd_up(fd_up &&other) : fd(other.release()) {}
lib/libutil++/libutil++.hh
79
int get() const { return (fd); }
lib/libutil++/libutil++.hh
83
int oldfd = fd;
lib/libutil++/libutil++.hh
85
fd = -1;
lib/libutil++/libutil++.hh
91
if (fd >= 0)
lib/libutil++/libutil++.hh
92
close(fd);
lib/libutil++/libutil++.hh
93
fd = newfd;
lib/libutil/flopen.c
100
if (trunc && ftruncate(fd, 0) != 0) {
lib/libutil/flopen.c
103
(void)close(fd);
lib/libutil/flopen.c
112
if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) {
lib/libutil/flopen.c
114
(void)close(fd);
lib/libutil/flopen.c
119
return (fd);
lib/libutil/flopen.c
51
int fd, operation, serrno, trunc;
lib/libutil/flopen.c
72
if ((fd = openat(dirfd, path, flags, mode)) == -1)
lib/libutil/flopen.c
75
if (flock(fd, operation) == -1) {
lib/libutil/flopen.c
78
(void)close(fd);
lib/libutil/flopen.c
84
(void)close(fd);
lib/libutil/flopen.c
87
if (fstat(fd, &fsb) == -1) {
lib/libutil/flopen.c
90
(void)close(fd);
lib/libutil/flopen.c
97
(void)close(fd);
lib/libutil/gr_util.c
331
int fd;
lib/libutil/gr_util.c
343
if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1)
lib/libutil/gr_util.c
346
if (fsync(fd) != 0) {
lib/libutil/gr_util.c
347
close(fd);
lib/libutil/gr_util.c
351
close(fd);
lib/libutil/login_auth.c
100
while ((count = read(fd, buf, sizeof(buf))) > 0)
lib/libutil/login_auth.c
102
close(fd);
lib/libutil/login_auth.c
95
int fd, count;
lib/libutil/login_auth.c
98
if ((fd = open(file, O_RDONLY | O_CLOEXEC)) < 0)
lib/libutil/login_tty.c
41
login_tty(int fd)
lib/libutil/login_tty.c
48
if (tcsetsid(fd, s) == -1)
lib/libutil/login_tty.c
50
(void) dup2(fd, 0);
lib/libutil/login_tty.c
51
(void) dup2(fd, 1);
lib/libutil/login_tty.c
52
(void) dup2(fd, 2);
lib/libutil/login_tty.c
53
if (fd > 2)
lib/libutil/login_tty.c
54
(void) close(fd);
lib/libutil/pidfile.c
127
int error, fd, dirfd, dirlen, filenamelen;
lib/libutil/pidfile.c
173
fd = flopenat(dirfd, pfh->pf_filename,
lib/libutil/pidfile.c
175
if (fd == -1) {
lib/libutil/pidfile.c
197
if (fstat(fd, &sb) == -1) {
lib/libutil/pidfile.c
206
if (cap_rights_limit(fd, cap_rights_init(&caprights, CAP_PWRITE,
lib/libutil/pidfile.c
213
pfh->pf_fd = fd;
lib/libutil/pidfile.c
223
close(fd);
lib/libutil/pidfile.c
233
int error, fd;
lib/libutil/pidfile.c
246
fd = pfh->pf_fd;
lib/libutil/pidfile.c
251
if (ftruncate(fd, 0) == -1) {
lib/libutil/pidfile.c
259
if (pwrite(fd, pidstr, strlen(pidstr), 0) != (ssize_t)strlen(pidstr)) {
lib/libutil/pidfile.c
346
int fd;
lib/libutil/pidfile.c
348
fd = flopenat(AT_FDCWD, pathp,
lib/libutil/pidfile.c
350
if (fd >= 0) {
lib/libutil/pidfile.c
355
close(fd);
lib/libutil/pidfile.c
79
int error, fd, i;
lib/libutil/pidfile.c
81
fd = openat(dirfd, filename, O_RDONLY | O_CLOEXEC);
lib/libutil/pidfile.c
82
if (fd == -1)
lib/libutil/pidfile.c
85
i = read(fd, buf, sizeof(buf) - 1);
lib/libutil/pidfile.c
87
close(fd);
lib/libutil/property.c
70
properties_read(int fd)
lib/libutil/property.c
93
if ((max = read(fd, buf, sizeof buf)) < 0) {
lib/libutil/quotafile.c
124
qf->fd = -1;
lib/libutil/quotafile.c
150
if ((qf->fd = open(qf->qfname, qf->accmode|O_CLOEXEC)) < 0 &&
lib/libutil/quotafile.c
154
if (qf->fd != -1) {
lib/libutil/quotafile.c
156
switch (read(qf->fd, &dqh, sizeof(dqh))) {
lib/libutil/quotafile.c
181
if ((qf->fd = open(qf->qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0)) <
lib/libutil/quotafile.c
190
if (write(qf->fd, &dqh, sizeof(dqh)) != sizeof(dqh)) {
lib/libutil/quotafile.c
196
fchown(qf->fd, 0, grp ? grp->gr_gid : 0);
lib/libutil/quotafile.c
197
fchmod(qf->fd, 0640);
lib/libutil/quotafile.c
202
if (qf->fd != -1)
lib/libutil/quotafile.c
203
close(qf->fd);
lib/libutil/quotafile.c
213
if (qf->fd != -1)
lib/libutil/quotafile.c
214
close(qf->fd);
lib/libutil/quotafile.c
287
if (lseek(qf->fd, off, SEEK_SET) == -1)
lib/libutil/quotafile.c
289
switch (read(qf->fd, &dqb32, sizeof(dqb32))) {
lib/libutil/quotafile.c
315
if (lseek(qf->fd, off, SEEK_SET) == -1)
lib/libutil/quotafile.c
317
switch (read(qf->fd, &dqb64, sizeof(dqb64))) {
lib/libutil/quotafile.c
341
if (qf->fd == -1) {
lib/libutil/quotafile.c
375
if (lseek(qf->fd, off, SEEK_SET) == -1)
lib/libutil/quotafile.c
377
if (write(qf->fd, &dqb32, sizeof(dqb32)) == sizeof(dqb32))
lib/libutil/quotafile.c
398
if (lseek(qf->fd, off, SEEK_SET) == -1)
lib/libutil/quotafile.c
400
if (write(qf->fd, &dqb64, sizeof(dqb64)) == sizeof(dqb64))
lib/libutil/quotafile.c
411
if (qf->fd == -1) {
lib/libutil/quotafile.c
459
if (qf->fd == -1) {
lib/libutil/quotafile.c
51
int fd; /* -1 means using quotactl for access */
lib/libutil/quotafile.c
521
int serrno, maxid, id, fd;
lib/libutil/quotafile.c
527
if ((qf->accmode & O_RDWR) != O_RDWR || qf->fd == -1) {
lib/libutil/quotafile.c
548
if ((newqf->fd = open(qf->qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC,
lib/libutil/quotafile.c
560
if (write(newqf->fd, &dqh, sizeof(dqh)) != sizeof(dqh)) {
lib/libutil/quotafile.c
566
fchown(newqf->fd, 0, grp ? grp->gr_gid : 0);
lib/libutil/quotafile.c
567
fchmod(newqf->fd, 0640);
lib/libutil/quotafile.c
593
fd = qf->fd;
lib/libutil/quotafile.c
594
qf->fd = newqf->fd;
lib/libutil/quotafile.c
595
newqf->fd = fd;
lib/libutil/tests/flopen_test.c
49
int fd;
lib/libutil/tests/flopen_test.c
52
fd = flopen(fn, O_RDWR|O_CREAT, 0640);
lib/libutil/tests/flopen_test.c
53
if (fd < 0) {
lib/libutil/tests/flopen_test.c
56
close(fd);
lib/libutil/tests/flopen_test.c
70
int fd;
lib/libutil/tests/flopen_test.c
72
fd = open(fn, O_RDWR|O_CREAT, 0640);
lib/libutil/tests/flopen_test.c
73
if (fd < 0) {
lib/libutil/tests/flopen_test.c
76
close(fd);
lib/libutil/tests/flopen_test.c
77
fd = flopen(fn, O_RDWR);
lib/libutil/tests/flopen_test.c
78
if (fd < 0) {
lib/libutil/tests/flopen_test.c
81
close(fd);
lib/libutil/tests/forkpty_test.c
27
int prevfd, fd, pty;
lib/libutil/tests/forkpty_test.c
35
ATF_REQUIRE((fd = dup(0)) > 0);
lib/libutil/tests/forkpty_test.c
36
ATF_REQUIRE_EQ(0, close(fd));
lib/libutil/tests/forkpty_test.c
49
prevfd = fd;
lib/libutil/tests/forkpty_test.c
50
ATF_REQUIRE((fd = dup(0)) > 0);
lib/libutil/tests/forkpty_test.c
51
ATF_CHECK_EQ(prevfd, fd);
lib/libutil/tests/pidfile_test.c
129
int fd[2], serrno, status;
lib/libutil/tests/pidfile_test.c
135
if (pipe(fd) != 0)
lib/libutil/tests/pidfile_test.c
151
close(fd[0]);
lib/libutil/tests/pidfile_test.c
178
if (write(fd[1], "*", 1) != 1)
lib/libutil/tests/pidfile_test.c
186
close(fd[1]);
lib/libutil/tests/pidfile_test.c
191
if (read(fd[0], &ch, 1) != 1) {
lib/libutil/tests/pidfile_test.c
271
int fd;
lib/libutil/tests/pidfile_test.c
283
fd = open(path, O_RDONLY);
lib/libutil/tests/pidfile_test.c
284
if (fd < 0)
lib/libutil/tests/pidfile_test.c
287
if (read(fd, pid, sizeof(pid) - 1) < 0)
lib/libutil/tests/pidfile_test.c
291
if (close(fd) != 0)
lib/libutil/uucplock.c
115
(void)close(fd);
lib/libutil/uucplock.c
127
int fd, err;
lib/libutil/uucplock.c
132
if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) < 0)
lib/libutil/uucplock.c
134
if (get_pid(fd, &err) != getpid())
lib/libutil/uucplock.c
137
lseek(fd, (off_t)0, SEEK_SET);
lib/libutil/uucplock.c
138
err = put_pid(fd, pid) ? 0 : UU_LOCK_WRITE_ERR;
lib/libutil/uucplock.c
140
close(fd);
lib/libutil/uucplock.c
196
put_pid(int fd, pid_t pid)
lib/libutil/uucplock.c
202
return write (fd, buf, (size_t)len) == len;
lib/libutil/uucplock.c
206
get_pid(int fd, int *err)
lib/libutil/uucplock.c
212
bytes_read = read (fd, buf, sizeof (buf) - 1);
lib/libutil/uucplock.c
54
static int put_pid (int fd, pid_t pid);
lib/libutil/uucplock.c
55
static pid_t get_pid (int fd,int *err);
lib/libutil/uucplock.c
64
int fd, tmpfd, i;
lib/libutil/uucplock.c
88
if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) < 0)
lib/libutil/uucplock.c
91
if ((pid_old = get_pid (fd, &err)) == -1)
lib/libutil/uucplock.c
94
close(fd);
lib/libveriexec/exec_script.c
49
int fd;
lib/libveriexec/exec_script.c
53
if ((fd = open(script, O_RDONLY)) >= 0) {
lib/libveriexec/exec_script.c
54
if ((n = read(fd, buf, sizeof(buf))) > 0) {
lib/libveriexec/exec_script.c
67
close(fd);
lib/libveriexec/gbl_check.c
50
int fd;
lib/libveriexec/gbl_check.c
54
if ((fd = open(path, O_RDONLY|O_VERIFY)) >= 0) {
lib/libveriexec/gbl_check.c
55
gbl.u.fd = fd;
lib/libveriexec/gbl_check.c
62
close(fd);
lib/libveriexec/veriexec_check.c
100
error = veriexec_check_fd_mode(fd, mask);
lib/libveriexec/veriexec_check.c
101
close(fd);
lib/libveriexec/veriexec_check.c
118
veriexec_check_fd(int fd)
lib/libveriexec/veriexec_check.c
120
return veriexec_check_fd_mode(fd, 0);
lib/libveriexec/veriexec_check.c
46
check_fd_mode(int fd, unsigned int mask)
lib/libveriexec/veriexec_check.c
50
if (fstat(fd, &st) < 0)
lib/libveriexec/veriexec_check.c
60
veriexec_check_fd_mode(int fd, unsigned int mask)
lib/libveriexec/veriexec_check.c
64
if (fd < 0) {
lib/libveriexec/veriexec_check.c
70
(void *)(intptr_t)fd);
lib/libveriexec/veriexec_check.c
79
error = check_fd_mode(fd, mask);
lib/libveriexec/veriexec_check.c
95
int fd;
lib/libveriexec/veriexec_check.c
97
if ((fd = open(file, O_RDONLY)) < 0)
lib/libvgl/text.c
43
FILE *fd;
lib/libvgl/text.c
60
if ((fd=fopen(filename, "r"))==(FILE*)0)
lib/libvgl/text.c
62
fread(&VGLTextFont->Width, 1 , 1, fd);
lib/libvgl/text.c
63
fread(&VGLTextFont->Height, 1 , 1, fd);
lib/libvgl/text.c
67
(256*((VGLTextFont->Width + 7)/8)*VGLTextFont->Height), fd);
lib/libvgl/text.c
68
fclose(fd);
lib/libvmmapi/aarch64/vmmapi_machdep.c
114
return (ioctl(ctx->fd, VM_RAISE_MSI, &vmsi));
lib/libvmmapi/aarch64/vmmapi_machdep.c
67
error = ioctl(ctx->fd, VM_GET_VGIC_VERSION, &vgic.ver);
lib/libvmmapi/aarch64/vmmapi_machdep.c
76
return (ioctl(ctx->fd, VM_ATTACH_VGIC, &vgic));
lib/libvmmapi/aarch64/vmmapi_machdep.c
87
return (ioctl(ctx->fd, VM_ASSERT_IRQ, &vi));
lib/libvmmapi/aarch64/vmmapi_machdep.c
98
return (ioctl(ctx->fd, VM_DEASSERT_IRQ, &vi));
lib/libvmmapi/amd64/vmmapi_machdep.c
173
return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi));
lib/libvmmapi/amd64/vmmapi_machdep.c
201
return (ioctl(ctx->fd, VM_IOAPIC_ASSERT_IRQ, &ioapic_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
212
return (ioctl(ctx->fd, VM_IOAPIC_DEASSERT_IRQ, &ioapic_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
223
return (ioctl(ctx->fd, VM_IOAPIC_PULSE_IRQ, &ioapic_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
230
return (ioctl(ctx->fd, VM_IOAPIC_PINCOUNT, pincount));
lib/libvmmapi/amd64/vmmapi_machdep.c
242
return (ioctl(ctx->fd, VM_ISA_ASSERT_IRQ, &isa_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
254
return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
266
return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq));
lib/libvmmapi/amd64/vmmapi_machdep.c
279
return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger));
lib/libvmmapi/amd64/vmmapi_machdep.c
358
error = ioctl(ctx->fd, VM_GET_HPET_CAPABILITIES, &cap);
lib/libvmmapi/amd64/vmmapi_machdep.c
373
error = ioctl(ctx->fd, VM_RTC_WRITE, &rtcdata);
lib/libvmmapi/amd64/vmmapi_machdep.c
385
error = ioctl(ctx->fd, VM_RTC_READ, &rtcdata);
lib/libvmmapi/amd64/vmmapi_machdep.c
399
error = ioctl(ctx->fd, VM_RTC_SETTIME, &rtctime);
lib/libvmmapi/amd64/vmmapi_machdep.c
410
error = ioctl(ctx->fd, VM_RTC_GETTIME, &rtctime);
lib/libvmmapi/internal.h
14
int fd; /* device file descriptor */
lib/libvmmapi/ppt.c
112
return (ioctl(ctx->fd, VM_PPTDEV_MSI, &pptmsi));
lib/libvmmapi/ppt.c
130
return (ioctl(ctx->fd, VM_PPTDEV_MSIX, &pptmsix));
lib/libvmmapi/ppt.c
143
return (ioctl(ctx->fd, VM_PPTDEV_DISABLE_MSIX, &ppt));
lib/libvmmapi/ppt.c
49
return (ioctl(ctx->fd, VM_BIND_PPTDEV, &pptdev));
lib/libvmmapi/ppt.c
62
return (ioctl(ctx->fd, VM_UNBIND_PPTDEV, &pptdev));
lib/libvmmapi/ppt.c
79
return (ioctl(ctx->fd, VM_MAP_PPTDEV_MMIO, &pptmmio));
lib/libvmmapi/ppt.c
95
return (ioctl(ctx->fd, VM_UNMAP_PPTDEV_MMIO, &pptmmio));
lib/libvmmapi/riscv/vmmapi_machdep.c
106
return (ioctl(ctx->fd, VM_RAISE_MSI, &vmsi));
lib/libvmmapi/riscv/vmmapi_machdep.c
68
return (ioctl(ctx->fd, VM_ATTACH_APLIC, &aplic));
lib/libvmmapi/riscv/vmmapi_machdep.c
79
return (ioctl(ctx->fd, VM_ASSERT_IRQ, &vi));
lib/libvmmapi/riscv/vmmapi_machdep.c
90
return (ioctl(ctx->fd, VM_DEASSERT_IRQ, &vi));
lib/libvmmapi/vmmapi.c
1107
error = ioctl(ctx->fd, VM_GET_CPUS, &vm_cpuset);
lib/libvmmapi/vmmapi.c
1151
error = ioctl(ctx->fd, VM_SUSPEND_CPU, &ac);
lib/libvmmapi/vmmapi.c
1185
error = ioctl(ctx->fd, VM_RESUME_CPU, &ac);
lib/libvmmapi/vmmapi.c
121
int error, fd;
lib/libvmmapi/vmmapi.c
123
fd = vm_ctl_open();
lib/libvmmapi/vmmapi.c
1231
if (ioctl(ctx->fd, VM_SNAPSHOT_REQ, meta) == -1) {
lib/libvmmapi/vmmapi.c
124
if (fd < 0)
lib/libvmmapi/vmmapi.c
1247
return (ioctl(ctx->fd, VM_RESTORE_TIME, &dummy));
lib/libvmmapi/vmmapi.c
1262
return (ioctl(ctx->fd, VM_SET_TOPOLOGY, &topology));
lib/libvmmapi/vmmapi.c
127
error = vm_ctl_create(name, 0, fd);
lib/libvmmapi/vmmapi.c
1273
error = ioctl(ctx->fd, VM_GET_TOPOLOGY, &topology);
lib/libvmmapi/vmmapi.c
1289
if (caph_rights_limit(ctx->fd, &rights) != 0)
lib/libvmmapi/vmmapi.c
1291
if (caph_ioctls_limit(ctx->fd, vm_ioctl_cmds, vm_ioctl_ncmds) != 0)
lib/libvmmapi/vmmapi.c
130
(void)close(fd);
lib/libvmmapi/vmmapi.c
1304
return (ctx->fd);
lib/libvmmapi/vmmapi.c
134
(void)close(fd);
lib/libvmmapi/vmmapi.c
156
vm->fd = vm->ctlfd = -1;
lib/libvmmapi/vmmapi.c
165
vm->fd = vm_device_open(vm->name);
lib/libvmmapi/vmmapi.c
166
if (vm->fd < 0 && errno == ENOENT) {
lib/libvmmapi/vmmapi.c
170
vm->fd = vm_device_open(vm->name);
lib/libvmmapi/vmmapi.c
174
if (vm->fd < 0)
lib/libvmmapi/vmmapi.c
196
if (vm->fd >= 0)
lib/libvmmapi/vmmapi.c
197
(void)close(vm->fd);
lib/libvmmapi/vmmapi.c
322
error = ioctl(ctx->fd, VM_MMAP_MEMSEG, &memmap);
lib/libvmmapi/vmmapi.c
346
error = ioctl(ctx->fd, VM_MUNMAP_MEMSEG, &munmap);
lib/libvmmapi/vmmapi.c
359
error = ioctl(ctx->fd, VM_MMAP_GETNEXT, &memmap);
lib/libvmmapi/vmmapi.c
433
error = ioctl(ctx->fd, VM_ALLOC_MEMSEG, &memseg);
lib/libvmmapi/vmmapi.c
447
error = ioctl(ctx->fd, VM_GET_MEMSEG, &memseg);
lib/libvmmapi/vmmapi.c
476
ptr = mmap(base + gpa, len, PROT_RW, flags, ctx->fd, gpa);
lib/libvmmapi/vmmapi.c
695
int fd, error, flags;
lib/libvmmapi/vmmapi.c
697
fd = -1;
lib/libvmmapi/vmmapi.c
713
fd = open(pathname, O_RDWR);
lib/libvmmapi/vmmapi.c
714
if (fd < 0)
lib/libvmmapi/vmmapi.c
732
ptr = mmap(base + VM_MMAP_GUARD_SIZE, len, PROT_RW, flags, fd, 0);
lib/libvmmapi/vmmapi.c
734
if (fd >= 0)
lib/libvmmapi/vmmapi.c
735
close(fd);
lib/libvmmapi/vmmapi.c
748
return (ioctl(vcpu->ctx->fd, cmd, arg));
lib/libvmmapi/vmmapi.c
824
return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend));
lib/libvmmapi/vmmapi.c
831
return (ioctl(ctx->fd, VM_REINIT, 0));
lib/libvmmapi/vmmapi.c
934
if (ioctl(ctx->fd, VM_STAT_DESC, &statdesc) == 0)
lib/libvmmapi/vmmapi.c
950
error = ioctl(ctx->fd, VM_GET_GPA_PMAP, &gpapte);
lib/libz/zopen.c
10
FILE *zdopen(int fd, const char *mode);
lib/libz/zopen.c
51
zdopen(int fd, const char *mode)
lib/libz/zopen.c
55
gz = gzdopen(fd, mode);
lib/virtual_oss/bt/avdtp.c
112
avdtpSendPacket(int fd, uint8_t command, uint8_t trans, uint8_t type,
lib/virtual_oss/bt/avdtp.c
134
retval = writev(fd, iov, 3);
lib/virtual_oss/bt/avdtp.c
143
avdtpSendSyncCommand(int fd, struct avdtpGetPacketInfo *info,
lib/virtual_oss/bt/avdtp.c
155
retval = avdtpSendPacket(fd, command, trans, type,
lib/virtual_oss/bt/avdtp.c
160
switch (avdtpGetPacket(fd, info)) {
lib/virtual_oss/bt/avdtp.c
172
retval = avdtpSendReject(fd, info->trans, info->signalID);
lib/virtual_oss/bt/avdtp.c
191
avdtpSendCapabilitiesResponseSBCForACP(int fd, int trans)
lib/virtual_oss/bt/avdtp.c
220
return (avdtpSendPacket(fd, AVDTP_GET_CAPABILITIES, trans,
lib/virtual_oss/bt/avdtp.c
226
avdtpSendAccept(int fd, uint8_t trans, uint8_t myCommand)
lib/virtual_oss/bt/avdtp.c
228
return (avdtpSendPacket(fd, myCommand, trans, RESPONSEACCEPT,
lib/virtual_oss/bt/avdtp.c
234
avdtpSendReject(int fd, uint8_t trans, uint8_t myCommand)
lib/virtual_oss/bt/avdtp.c
238
return (avdtpSendPacket(fd, myCommand, trans, RESPONSEREJECT,
lib/virtual_oss/bt/avdtp.c
244
avdtpSendDiscResponseAudio(int fd, uint8_t trans,
lib/virtual_oss/bt/avdtp.c
252
return (avdtpSendPacket(fd, AVDTP_DISCOVER, trans, RESPONSEACCEPT,
lib/virtual_oss/bt/avdtp.c
298
avdtpGetCapabilities(int fd, uint8_t sep, struct avdtpGetPacketInfo *info)
lib/virtual_oss/bt/avdtp.c
302
return (avdtpSendSyncCommand(fd, info,
lib/virtual_oss/bt/avdtp.c
309
avdtpSetConfiguration(int fd, uint8_t sep, uint8_t * data, int datasize)
lib/virtual_oss/bt/avdtp.c
317
return (avdtpSendSyncCommand(fd, &info, AVDTP_SET_CONFIGURATION, 0,
lib/virtual_oss/bt/avdtp.c
323
avdtpOpen(int fd, uint8_t sep)
lib/virtual_oss/bt/avdtp.c
328
return (avdtpSendSyncCommand(fd, &info, AVDTP_OPEN, 0,
lib/virtual_oss/bt/avdtp.c
334
avdtpStart(int fd, uint8_t sep)
lib/virtual_oss/bt/avdtp.c
339
return (avdtpSendSyncCommand(fd, &info, AVDTP_START, 0,
lib/virtual_oss/bt/avdtp.c
345
avdtpClose(int fd, uint8_t sep)
lib/virtual_oss/bt/avdtp.c
350
return (avdtpSendSyncCommand(fd, &info, AVDTP_CLOSE, 0,
lib/virtual_oss/bt/avdtp.c
356
avdtpSuspend(int fd, uint8_t sep)
lib/virtual_oss/bt/avdtp.c
361
return (avdtpSendSyncCommand(fd, &info, AVDTP_SUSPEND, 0,
lib/virtual_oss/bt/avdtp.c
367
avdtpAbort(int fd, uint8_t sep)
lib/virtual_oss/bt/avdtp.c
372
return (avdtpSendSyncCommand(fd, &info, AVDTP_ABORT, 0,
lib/virtual_oss/bt/avdtp.c
59
avdtpGetPacket(int fd, struct avdtpGetPacketInfo *info)
lib/virtual_oss/bt/avdtp.c
70
len = read(fd, pos, end - pos);
lib/virtual_oss/bt/bt.c
126
err = read(cfg->fd, cfg->mtu_data, cfg->mtu);
lib/virtual_oss/bt/bt.c
172
if (cfg->fd > 0) {
lib/virtual_oss/bt/bt.c
173
close(cfg->fd);
lib/virtual_oss/bt/bt.c
174
cfg->fd = -1;
lib/virtual_oss/bt/bt.c
525
cfg->fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BLUETOOTH_PROTO_L2CAP);
lib/virtual_oss/bt/bt.c
526
if (cfg->fd < 0) {
lib/virtual_oss/bt/bt.c
536
if (bind(cfg->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
lib/virtual_oss/bt/bt.c
542
if (connect(cfg->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
lib/virtual_oss/bt/bt.c
547
if (getsockopt(cfg->fd, SOL_L2CAP, SO_L2CAP_OMTU, &cfg->mtu, &mtusize) == -1) {
lib/virtual_oss/bt/bt.c
552
if (setsockopt(cfg->fd, SOL_SOCKET, SO_SNDBUF, &temp, sizeof(temp)) == -1) {
lib/virtual_oss/bt/bt.c
557
if (setsockopt(cfg->fd, SOL_SOCKET, SO_SNDLOWAT, &temp, sizeof(temp)) == -1) {
lib/virtual_oss/bt/bt.c
562
if (getsockopt(cfg->fd, SOL_L2CAP, SO_L2CAP_IMTU, &cfg->mtu, &mtusize) == -1) {
lib/virtual_oss/bt/bt.c
567
if (setsockopt(cfg->fd, SOL_SOCKET, SO_RCVBUF, &temp, sizeof(temp)) == -1) {
lib/virtual_oss/bt/bt.c
572
if (setsockopt(cfg->fd, SOL_SOCKET, SO_RCVLOWAT, &temp, sizeof(temp)) == -1) {
lib/virtual_oss/bt/bt.c
577
if (ioctl(cfg->fd, FIONBIO, &temp) == -1) {
lib/virtual_oss/bt/bt.c
602
if (cfg->fd > 0) {
lib/virtual_oss/bt/bt.c
603
close(cfg->fd);
lib/virtual_oss/bt/bt.c
604
cfg->fd = -1;
lib/virtual_oss/bt/bt.c
872
xlen = write(cfg->fd, cfg->mtu_data, cfg->mtu_offset);
lib/virtual_oss/bt/bt.c
995
xlen = write(cfg->fd, cfg->mtu_data, cfg->mtu_offset);
lib/virtual_oss/bt/bt.h
95
int fd;
lib/virtual_oss/oss/oss.c
104
err = ioctl(pbe->fd, SOUND_PCM_WRITE_CHANNELS, &temp);
lib/virtual_oss/oss/oss.c
107
err = ioctl(pbe->fd, SOUND_PCM_READ_CHANNELS, &temp);
lib/virtual_oss/oss/oss.c
115
err = ioctl(pbe->fd, SNDCTL_DSP_SPEED, &temp);
lib/virtual_oss/oss/oss.c
122
err = ioctl(pbe->fd, SNDCTL_DSP_SETBLKSIZE, &temp);
lib/virtual_oss/oss/oss.c
129
close(pbe->fd);
lib/virtual_oss/oss/oss.c
130
pbe->fd = -1;
lib/virtual_oss/oss/oss.c
152
struct pollfd fds = { .fd = pbe->fd, .events = POLLIN | POLLRDNORM };
lib/virtual_oss/oss/oss.c
159
return (read(pbe->fd, ptr, len));
lib/virtual_oss/oss/oss.c
165
return (write(pbe->fd, ptr, len));
lib/virtual_oss/oss/oss.c
171
if (ioctl(pbe->fd, FIONREAD, pdelay) != 0)
lib/virtual_oss/oss/oss.c
179
ioctl(pbe->fd, SNDCTL_DSP_GETODELAY, pdelay) != 0)
lib/virtual_oss/oss/oss.c
188
.fd = -1,
lib/virtual_oss/oss/oss.c
196
.fd = -1,
lib/virtual_oss/oss/oss.c
42
oss_set_format(int fd, int *format)
lib/virtual_oss/oss/oss.c
60
error = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
lib/virtual_oss/oss/oss.c
73
if (pbe->fd > -1) {
lib/virtual_oss/oss/oss.c
74
close(pbe->fd);
lib/virtual_oss/oss/oss.c
75
pbe->fd = -1;
lib/virtual_oss/oss/oss.c
86
pbe->fd = open(devname, attr);
lib/virtual_oss/oss/oss.c
87
if (pbe->fd < 0) {
lib/virtual_oss/oss/oss.c
91
err = ioctl(pbe->fd, FIONBIO, &fionbio);
lib/virtual_oss/oss/oss.c
96
err = oss_set_format(pbe->fd, pformat);
lib/virtual_oss/sndio/sndio.c
194
.fd = -1,
lib/virtual_oss/sndio/sndio.c
202
.fd = -1,
libexec/atrun/atrun.c
100
return write(fd, a, strlen(a));
libexec/atrun/atrun.c
98
write_string(int fd, const char* a)
libexec/bootpd/getether.c
122
int fd, rc = -1;
libexec/bootpd/getether.c
129
fd = socket(AF_INET, SOCK_DGRAM, 0);
libexec/bootpd/getether.c
130
if (fd < 0) {
libexec/bootpd/getether.c
132
return (fd);
libexec/bootpd/getether.c
136
if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 ||
libexec/bootpd/getether.c
161
close(fd);
libexec/bootpd/getether.c
192
int fd, flags;
libexec/bootpd/getether.c
198
fd = open(devname, 2);
libexec/bootpd/getether.c
199
if (fd < 0) {
libexec/bootpd/getether.c
208
fd = open(devname, 2);
libexec/bootpd/getether.c
209
if (fd < 0) {
libexec/bootpd/getether.c
229
if (putmsg(fd, &cbuf, NULL, 0) < 0) {
libexec/bootpd/getether.c
237
if (getmsg(fd, &cbuf, NULL, &flags) < 0) {
libexec/bootpd/getether.c
271
if (putmsg(fd, &cbuf, NULL, 0) < 0) {
libexec/bootpd/getether.c
279
if (getmsg(fd, &cbuf, NULL, &flags) < 0) {
libexec/bootpd/getether.c
312
close(fd);
libexec/bootpd/getether.c
341
int fd;
libexec/bootpd/getether.c
346
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
libexec/bootpd/getether.c
350
if (ioctl(fd, SIOCGIFHWADDR, &phys) < 0) {
libexec/bootpd/getether.c
356
close(fd);
libexec/bootpd/getether.c
44
int fd;
libexec/bootpd/getether.c
48
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
libexec/bootpd/getether.c
52
if (ioctl(fd, SIOCRPHYSADDR, &phys) < 0) {
libexec/bootpd/getether.c
58
close(fd);
libexec/bootpd/hwaddr.c
145
int fd;
libexec/bootpd/hwaddr.c
148
if ((fd=open("/dev/arp", O_RDWR)) < 0) {
libexec/bootpd/hwaddr.c
155
if (ioctl(fd, I_STR, (caddr_t)&iocb) < 0) {
libexec/bootpd/hwaddr.c
158
close (fd);
libexec/bootpd/tools/bootptest/bootptest.c
350
int fd = open(vendor_file, 0);
libexec/bootpd/tools/bootptest/bootptest.c
351
if (fd < 0) {
libexec/bootpd/tools/bootptest/bootptest.c
357
n = read(fd, bp->bp_vend, n);
libexec/bootpd/tools/bootptest/bootptest.c
358
close(fd);
libexec/flua/lfbsd/lfbsd.c
204
lua_process_makestdio(lua_State *L, int fd, const char *mode)
libexec/flua/lfbsd/lfbsd.c
210
if (fd == -1) {
libexec/flua/lfbsd/lfbsd.c
216
fp = fdopen(fd, mode);
libexec/flua/lfs/lfs.c
156
entry = readdirfd(dp->fd);
libexec/flua/modules/lposix.c
154
int error, fd;
libexec/flua/modules/lposix.c
158
fd = luaL_checkinteger(L, 1);
libexec/flua/modules/lposix.c
159
if (fd < 0) {
libexec/flua/modules/lposix.c
164
if (close(fd) == 0) {
libexec/flua/modules/lposix.c
367
int error, fd[2];
libexec/flua/modules/lposix.c
371
error = pipe(fd);
libexec/flua/modules/lposix.c
379
lua_pushinteger(L, fd[0]);
libexec/flua/modules/lposix.c
380
lua_pushinteger(L, fd[1]);
libexec/flua/modules/lposix.c
390
int error = 0, fd;
libexec/flua/modules/lposix.c
393
fd = luaL_checkinteger(L, 1);
libexec/flua/modules/lposix.c
396
if (fd < 0) {
libexec/flua/modules/lposix.c
411
ret = read(fd, buf, sz);
libexec/flua/modules/lposix.c
505
int error, fd;
libexec/flua/modules/lposix.c
509
fd = luaL_checkinteger(L, 1);
libexec/flua/modules/lposix.c
510
if (fd < 0) {
libexec/flua/modules/lposix.c
532
ret = write(fd, buf + offset, sz);
libexec/getty/main.c
303
int fd;
libexec/getty/main.c
305
if ((fd = open(IF, O_RDONLY)) != -1) {
libexec/getty/main.c
308
while ((cp = get_line(fd)) != NULL) {
libexec/getty/main.c
311
close(fd);
libexec/getty/main.c
699
get_line(int fd)
libexec/getty/main.c
708
while (i < (sizeof linebuf - 3) && read(fd, linebuf+i, 1)==1) {
libexec/getty/subr.c
642
set[0].fd = STDIN_FILENO;
libexec/phttpget/phttpget.c
252
copybytes(int sd, int fd, off_t copylen, char * resbuf, int * resbuflen,
libexec/phttpget/phttpget.c
263
if (fd != -1)
libexec/phttpget/phttpget.c
264
len = write(fd, resbuf + *resbufpos, len);
libexec/phttpget/phttpget.c
312
int fd = -1; /* Descriptor for download target file */
libexec/phttpget/phttpget.c
597
fd = open(fname, O_CREAT | O_TRUNC | O_WRONLY, 0644);
libexec/phttpget/phttpget.c
598
if (fd == -1)
libexec/phttpget/phttpget.c
630
error = copybytes(sd, fd, clen, resbuf,
libexec/phttpget/phttpget.c
648
error = copybytes(sd, fd, contentlength, resbuf,
libexec/phttpget/phttpget.c
658
error = copybytes(sd, fd, OFF_MAX, resbuf,
libexec/phttpget/phttpget.c
665
if (fd != -1) {
libexec/phttpget/phttpget.c
666
close(fd);
libexec/phttpget/phttpget.c
667
fd = -1;
libexec/phttpget/phttpget.c
710
if (fd != -1) {
libexec/phttpget/phttpget.c
711
close(fd);
libexec/phttpget/phttpget.c
712
fd = -1;
libexec/pkg-serve/pkg-serve.c
133
if (fstatat(fd, file, &st, AT_RESOLVE_BENEATH) == -1) {
libexec/pkg-serve/pkg-serve.c
151
if ((ffd = openat(fd, file, O_RDONLY | O_RESOLVE_BENEATH)) == -1) {
libexec/pkg-serve/pkg-serve.c
50
int fd, ffd;
libexec/pkg-serve/pkg-serve.c
59
if ((fd = open(basedir, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) < 0)
libexec/pkg-serve/pkg-serve.c
64
if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS)
libexec/rbootd/bpf.c
212
int fd;
libexec/rbootd/bpf.c
221
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
libexec/rbootd/bpf.c
228
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 ||
libexec/rbootd/bpf.c
239
if (ioctl(fd, SIOCGIFFLAGS, (char *)ifrp) < 0) {
libexec/rbootd/bpf.c
265
(void) close(fd);
libexec/rbootd/rbootd.c
198
fd = BpfOpen();
libexec/rbootd/rbootd.c
206
maxfds = fd + 1;
libexec/rbootd/rbootd.c
208
FD_SET(fd, &rset);
libexec/rbootd/rbootd.c
234
if (FD_ISSET(fd, &r)) {
libexec/rbootd/rbootd.c
62
int c, fd, omask, maxfds;
libexec/rtld-elf/libmap.c
105
int fd, saved_errno;
libexec/rtld-elf/libmap.c
112
fd = open(path, O_RDONLY | O_CLOEXEC);
libexec/rtld-elf/libmap.c
113
if (fd == -1) {
libexec/rtld-elf/libmap.c
118
if (fstat(fd, &st) == -1) {
libexec/rtld-elf/libmap.c
121
close(fd);
libexec/rtld-elf/libmap.c
127
close(fd);
libexec/rtld-elf/libmap.c
133
retval = read(fd, lm_map, st.st_size);
libexec/rtld-elf/libmap.c
135
close(fd);
libexec/rtld-elf/map_object.c
169
MAP_PRIVATE, fd,
libexec/rtld-elf/map_object.c
240
MAP_PREFAULT_READ, fd, data_offset) == MAP_FAILED) {
libexec/rtld-elf/map_object.c
397
get_elf_header(int fd, const char *path, const struct stat *sbp,
libexec/rtld-elf/map_object.c
410
fd, 0);
libexec/rtld-elf/map_object.c
429
MAP_PRIVATE | MAP_PREFAULT_READ, fd, hdr->e_phoff);
libexec/rtld-elf/map_object.c
60
map_object(int fd, const char *path, const struct stat *sb, bool ismain)
libexec/rtld-elf/map_object.c
98
hdr = get_elf_header(fd, path, sb, &phdr);
libexec/rtld-elf/rtld-libc/rtld_libc.h
49
int __sys_fstat(int fd, struct stat *);
libexec/rtld-elf/rtld-libc/rtld_libc.h
71
#define close(fd) __sys_close(fd)
libexec/rtld-elf/rtld-libc/rtld_libc.h
72
#define _close(fd) __sys_close(fd)
libexec/rtld-elf/rtld-libc/rtld_libc.h
75
#define fcntl(fd, cmd, arg) __sys_fcntl(fd, cmd, arg)
libexec/rtld-elf/rtld-libc/rtld_libc.h
76
#define _fcntl(fd, cmd, arg) __sys_fcntl(fd, cmd, arg)
libexec/rtld-elf/rtld-libc/rtld_libc.h
77
#define _fstat(fd, sb) __sys_fstat(fd, sb)
libexec/rtld-elf/rtld-libc/rtld_libc.h
79
#define pread(fd, buf, nbytes, offset) __sys_pread(fd, buf, nbytes, offset)
libexec/rtld-elf/rtld-libc/rtld_libc.h
80
#define read(fd, buf, nbytes) __sys_read(fd, buf, nbytes)
libexec/rtld-elf/rtld-libc/rtld_libc.h
83
#define _write(fd, buf, nbytes) __sys_write(fd, buf, nbytes)
libexec/rtld-elf/rtld-libc/rtld_libc.h
84
#define write(fd, buf, nbytes) __sys_write(fd, buf, nbytes)
libexec/rtld-elf/rtld.c
104
static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj,
libexec/rtld-elf/rtld.c
134
static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int);
libexec/rtld-elf/rtld.c
164
static void *rtld_dlopen(const char *name, int fd, int mode);
libexec/rtld-elf/rtld.c
2148
int fd;
libexec/rtld-elf/rtld.c
2164
if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) ==
libexec/rtld-elf/rtld.c
2177
if (read(fd, &hdr, sizeof hdr) != sizeof hdr) {
libexec/rtld-elf/rtld.c
2181
close(fd);
libexec/rtld-elf/rtld.c
2210
if (fstat(fd, &hint_stat) == -1) {
libexec/rtld-elf/rtld.c
2233
if (pread(fd, p, dirlistlen + 1, strtab + dirlist) !=
libexec/rtld-elf/rtld.c
2243
close(fd);
libexec/rtld-elf/rtld.c
2818
int fd;
libexec/rtld-elf/rtld.c
2833
fd = parse_integer(p);
libexec/rtld-elf/rtld.c
2834
if (fd == -1) {
libexec/rtld-elf/rtld.c
2840
fd = -1;
libexec/rtld-elf/rtld.c
2843
obj = load_object(name, fd, NULL, 0);
libexec/rtld-elf/rtld.c
2878
int fd;
libexec/rtld-elf/rtld.c
2882
fd = -1;
libexec/rtld-elf/rtld.c
2891
path = find_library(name, refobj, &fd);
libexec/rtld-elf/rtld.c
2897
if (fd >= 0) {
libexec/rtld-elf/rtld.c
2912
if ((fd = open(path, O_RDONLY | O_CLOEXEC | O_VERIFY)) == -1) {
libexec/rtld-elf/rtld.c
2913
fd = try_fds_open(path, ld_library_dirs);
libexec/rtld-elf/rtld.c
2914
if (fd == -1) {
libexec/rtld-elf/rtld.c
2921
fd = fcntl(fd_u, F_DUPFD_CLOEXEC, 0);
libexec/rtld-elf/rtld.c
2922
if (fd == -1) {
libexec/rtld-elf/rtld.c
2928
if (fstat(fd, &sb) == -1) {
libexec/rtld-elf/rtld.c
2930
close(fd);
libexec/rtld-elf/rtld.c
2944
close(fd);
libexec/rtld-elf/rtld.c
2949
close(fd);
libexec/rtld-elf/rtld.c
2954
obj = do_load_object(fd, name, path, &sb, flags);
libexec/rtld-elf/rtld.c
2957
close(fd);
libexec/rtld-elf/rtld.c
2963
do_load_object(int fd, const char *name, char *path, struct stat *sbp,
libexec/rtld-elf/rtld.c
2975
if (dangerous_ld_env && fstatfs(fd, &fs) == 0 &&
libexec/rtld-elf/rtld.c
2982
obj = map_object(fd, printable_path(path), sbp, false);
libexec/rtld-elf/rtld.c
3642
int fd, dirfd, dirfd_path;
libexec/rtld-elf/rtld.c
3672
fd = __sys_openat(dirfd, n + 1, O_RDONLY | O_CLOEXEC | O_VERIFY);
libexec/rtld-elf/rtld.c
3673
return (fd);
libexec/rtld-elf/rtld.c
3715
int fd;
libexec/rtld-elf/rtld.c
3722
int fd;
libexec/rtld-elf/rtld.c
3737
fd = open(pathname, O_RDONLY | O_CLOEXEC | O_VERIFY);
libexec/rtld-elf/rtld.c
3738
if (fd >= 0) {
libexec/rtld-elf/rtld.c
3739
dbg(" Opened \"%s\", fd %d", pathname, fd);
libexec/rtld-elf/rtld.c
3742
arg->fd = fd;
libexec/rtld-elf/rtld.c
3766
arg.fd = -1;
libexec/rtld-elf/rtld.c
3769
*fdp = arg.fd;
libexec/rtld-elf/rtld.c
3788
int dirfd, fd;
libexec/rtld-elf/rtld.c
3821
fd = __sys_openat(dirfd, name, O_RDONLY | O_CLOEXEC | O_VERIFY);
libexec/rtld-elf/rtld.c
3822
if (fd >= 0) {
libexec/rtld-elf/rtld.c
3823
*fdp = fd;
libexec/rtld-elf/rtld.c
3832
dbg("open('%s') => %d", found, fd);
libexec/rtld-elf/rtld.c
3924
fdlopen(int fd, int mode)
libexec/rtld-elf/rtld.c
3926
return (rtld_dlopen(NULL, fd, mode));
libexec/rtld-elf/rtld.c
3930
rtld_dlopen(const char *name, int fd, int mode)
libexec/rtld-elf/rtld.c
3955
return (dlopen_object(name, fd, obj_main, lo_flags,
libexec/rtld-elf/rtld.c
3969
dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags,
libexec/rtld-elf/rtld.c
3979
name != NULL ? name : "<null>", fd,
libexec/rtld-elf/rtld.c
3990
if (name == NULL && fd == -1) {
libexec/rtld-elf/rtld.c
3994
obj = load_object(name, fd, refobj, lo_flags);
libexec/rtld-elf/rtld.c
537
int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc;
libexec/rtld-elf/rtld.c
589
fd = -1;
libexec/rtld-elf/rtld.c
591
fd = aux_info[AT_EXECFD]->a_un.a_val;
libexec/rtld-elf/rtld.c
607
&search_in_path, &fd, &argv0, &dir_ignore);
libexec/rtld-elf/rtld.c
608
explicit_fd = (fd != -1);
libexec/rtld-elf/rtld.c
611
fd = open_binary_fd(argv0,
libexec/rtld-elf/rtld.c
613
if (fstat(fd, &st) == -1) {
libexec/rtld-elf/rtld.c
616
fd,
libexec/rtld-elf/rtld.c
6355
int fd;
libexec/rtld-elf/rtld.c
6371
fd = -1;
libexec/rtld-elf/rtld.c
6381
fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY);
libexec/rtld-elf/rtld.c
6382
if (fd != -1 || errno != ENOENT) {
libexec/rtld-elf/rtld.c
6389
fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY);
libexec/rtld-elf/rtld.c
6393
if (fd == -1) {
libexec/rtld-elf/rtld.c
6408
return (fd);
libexec/rtld-elf/rtld.c
6421
int arglen, fd, i, j, mib[2];
libexec/rtld-elf/rtld.c
6493
fd = parse_integer(argv[i]);
libexec/rtld-elf/rtld.c
6494
if (fd == -1) {
libexec/rtld-elf/rtld.c
6500
*fdp = fd;
libexec/rtld-elf/rtld.c
773
if (fd != -1) { /* Load the main program. */
libexec/rtld-elf/rtld.c
775
obj_main = map_object(fd, argv0, NULL, true);
libexec/rtld-elf/rtld.c
776
close(fd);
libexec/rtld-elf/rtld.c
795
if (aux_info[AT_EXECPATH] != NULL && fd == -1) {
libexec/rtld-elf/rtld_printf.c
453
info.fd = -1;
libexec/rtld-elf/rtld_printf.c
461
rtld_vfdprintf(int fd, const char *fmt, va_list ap)
libexec/rtld-elf/rtld_printf.c
470
info.fd = fd;
libexec/rtld-elf/rtld_printf.c
477
rtld_fdprintf(int fd, const char *fmt, ...)
libexec/rtld-elf/rtld_printf.c
483
retval = rtld_vfdprintf(fd, fmt, ap);
libexec/rtld-elf/rtld_printf.c
489
rtld_fdprintfx(int fd, const char *fmt, ...)
libexec/rtld-elf/rtld_printf.c
495
retval = rtld_vfdprintf(fd, fmt, ap);
libexec/rtld-elf/rtld_printf.c
501
rtld_fdputstr(int fd, const char *str)
libexec/rtld-elf/rtld_printf.c
504
write(fd, str, strlen(str));
libexec/rtld-elf/rtld_printf.c
508
rtld_fdputchar(int fd, int c)
libexec/rtld-elf/rtld_printf.c
513
write(fd, &c1, 1);
libexec/rtld-elf/rtld_printf.c
58
int fd;
libexec/rtld-elf/rtld_printf.c
67
write(info->fd, info->buf, info->buf_total - info->remain);
libexec/rtld-elf/rtld_printf.h
38
int rtld_vfdprintf(int fd, const char *fmt, va_list ap);
libexec/rtld-elf/rtld_printf.h
39
int rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3);
libexec/rtld-elf/rtld_printf.h
40
int rtld_fdprintfx(int fd, const char *fmt, ...);
libexec/rtld-elf/rtld_printf.h
41
void rtld_fdputstr(int fd, const char *str);
libexec/rtld-elf/rtld_printf.h
42
void rtld_fdputchar(int fd, int c);
libexec/tftpd/tests/functional.c
1003
int fd;
libexec/tftpd/tests/functional.c
1012
fd = open("medium.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1013
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1014
close(fd);
libexec/tftpd/tests/functional.c
1023
fd = open("medium.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
1024
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1025
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
1027
close(fd);
libexec/tftpd/tests/functional.c
1036
int fd;
libexec/tftpd/tests/functional.c
1046
fd = open("medium.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1047
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1048
close(fd);
libexec/tftpd/tests/functional.c
1056
fd = open("medium.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
1057
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1058
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
1060
close(fd);
libexec/tftpd/tests/functional.c
1069
int fd;
libexec/tftpd/tests/functional.c
1080
fd = open("unix.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1081
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1082
close(fd);
libexec/tftpd/tests/functional.c
1090
fd = open("unix.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
1091
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1092
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
1094
close(fd);
libexec/tftpd/tests/functional.c
1113
int fd;
libexec/tftpd/tests/functional.c
1119
fd = open("small.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1120
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1121
close(fd);
libexec/tftpd/tests/functional.c
1129
fd = open("small.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
1130
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1131
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
1133
close(fd);
libexec/tftpd/tests/functional.c
1142
int fd;
libexec/tftpd/tests/functional.c
1146
fd = open("small.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1147
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1148
write_all(fd, contents, strlen(contents) + 1);
libexec/tftpd/tests/functional.c
1149
close(fd);
libexec/tftpd/tests/functional.c
1165
int fd;
libexec/tftpd/tests/functional.c
1177
fd = open("rfc7440.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
1178
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1179
close(fd);
libexec/tftpd/tests/functional.c
1217
fd = open("rfc7440.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
1218
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
1219
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
1221
close(fd);
libexec/tftpd/tests/functional.c
433
write_all(int fd, const void *buf, size_t nbytes)
libexec/tftpd/tests/functional.c
438
r = write(fd, buf, nbytes);
libexec/tftpd/tests/functional.c
455
int fd;
libexec/tftpd/tests/functional.c
467
fd = open("abspath.txt", O_CREAT | O_RDONLY, 0644);
libexec/tftpd/tests/functional.c
468
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
469
close(fd);
libexec/tftpd/tests/functional.c
499
int fd;
libexec/tftpd/tests/functional.c
502
fd = open("small.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
503
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
504
write_all(fd, contents, strlen(contents) + 1);
libexec/tftpd/tests/functional.c
505
close(fd);
libexec/tftpd/tests/functional.c
517
int fd;
libexec/tftpd/tests/functional.c
520
fd = open("small.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
521
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
522
write_all(fd, contents, strlen(contents) + 1);
libexec/tftpd/tests/functional.c
523
close(fd);
libexec/tftpd/tests/functional.c
540
int fd;
libexec/tftpd/tests/functional.c
548
fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
549
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
550
write_all(fd, contents, sizeof(contents));
libexec/tftpd/tests/functional.c
551
close(fd);
libexec/tftpd/tests/functional.c
571
int fd;
libexec/tftpd/tests/functional.c
578
fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
579
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
580
write_all(fd, contents, sizeof(contents));
libexec/tftpd/tests/functional.c
581
close(fd);
libexec/tftpd/tests/functional.c
598
int fd;
libexec/tftpd/tests/functional.c
600
fd = open("empty.txt", O_CREAT | O_RDONLY, 0000);
libexec/tftpd/tests/functional.c
601
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
602
close(fd);
libexec/tftpd/tests/functional.c
613
int fd;
libexec/tftpd/tests/functional.c
615
fd = open("empty.txt", O_CREAT | O_RDONLY, 0644);
libexec/tftpd/tests/functional.c
616
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
617
close(fd);
libexec/tftpd/tests/functional.c
629
int fd;
libexec/tftpd/tests/functional.c
636
fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
637
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
638
write_all(fd, contents, sizeof(contents));
libexec/tftpd/tests/functional.c
639
close(fd);
libexec/tftpd/tests/functional.c
653
int fd;
libexec/tftpd/tests/functional.c
661
fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
662
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
663
write_all(fd, contents, sizeof(contents));
libexec/tftpd/tests/functional.c
664
close(fd);
libexec/tftpd/tests/functional.c
679
int fd;
libexec/tftpd/tests/functional.c
687
fd = open("unix.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
688
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
689
write_all(fd, contents, strlen(contents) + 1);
libexec/tftpd/tests/functional.c
690
close(fd);
libexec/tftpd/tests/functional.c
740
int fd;
libexec/tftpd/tests/functional.c
743
fd = open("small.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
744
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
745
write_all(fd, contents, strlen(contents) + 1);
libexec/tftpd/tests/functional.c
746
close(fd);
libexec/tftpd/tests/functional.c
758
int fd;
libexec/tftpd/tests/functional.c
768
fd = open("rfc7440.txt", O_RDWR | O_CREAT, 0644);
libexec/tftpd/tests/functional.c
769
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
770
write_all(fd, contents, sizeof(contents));
libexec/tftpd/tests/functional.c
771
close(fd);
libexec/tftpd/tests/functional.c
839
int fd;
libexec/tftpd/tests/functional.c
851
fd = open("small.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
852
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
853
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
855
close(fd);
libexec/tftpd/tests/functional.c
864
int fd;
libexec/tftpd/tests/functional.c
873
fd = open("medium.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
874
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
875
close(fd);
libexec/tftpd/tests/functional.c
889
fd = open("medium.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
890
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
891
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
893
close(fd);
libexec/tftpd/tests/functional.c
902
int fd;
libexec/tftpd/tests/functional.c
908
fd = open("small.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
909
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
910
close(fd);
libexec/tftpd/tests/functional.c
923
fd = open("small.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
924
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
925
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
927
close(fd);
libexec/tftpd/tests/functional.c
936
int fd;
libexec/tftpd/tests/functional.c
945
fd = open("medium.txt", O_RDWR | O_CREAT, 0666);
libexec/tftpd/tests/functional.c
946
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
947
close(fd);
libexec/tftpd/tests/functional.c
958
fd = open("medium.txt", O_RDONLY);
libexec/tftpd/tests/functional.c
959
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
960
r = read(fd, buffer, sizeof(buffer));
libexec/tftpd/tests/functional.c
962
close(fd);
libexec/tftpd/tests/functional.c
971
int fd;
libexec/tftpd/tests/functional.c
973
fd = open("empty.txt", O_CREAT | O_RDONLY, 0440);
libexec/tftpd/tests/functional.c
974
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
975
close(fd);
libexec/tftpd/tests/functional.c
987
int fd;
libexec/tftpd/tests/functional.c
989
fd = open("empty.txt", O_CREAT | O_RDONLY, 0444);
libexec/tftpd/tests/functional.c
990
ATF_REQUIRE(fd >= 0);
libexec/tftpd/tests/functional.c
991
close(fd);
libexec/tftpd/tftp-file.c
176
write_init(int fd, FILE *f, const char *mode)
libexec/tftpd/tftp-file.c
180
file = fdopen(fd, "w");
libexec/tftpd/tftp-file.c
229
read_init(int fd, FILE *f, const char *mode)
libexec/tftpd/tftp-file.c
234
file = fdopen(fd, "r");
libexec/tftpd/tftp-file.h
28
int write_init(int fd, FILE *f, const char *mode);
libexec/tftpd/tftp-file.h
32
int read_init(int fd, FILE *f, const char *mode);
libexec/tftpd/tftp-io.c
394
pfd.fd = peer;
libexec/tftpd/tftpd.c
619
find_next_name(char *filename, int *fd)
libexec/tftpd/tftpd.c
668
*fd = open(newname, O_WRONLY | O_CREAT | O_EXCL, 0666);
libexec/tftpd/tftpd.c
669
if (*fd > 0)
libexec/tftpd/tftpd.c
694
int err, fd;
libexec/tftpd/tftpd.c
770
fd = open(filename, O_RDONLY);
libexec/tftpd/tftpd.c
773
err = find_next_name(filename, &fd);
libexec/tftpd/tftpd.c
777
fd = open(filename,
libexec/tftpd/tftpd.c
783
fd = open(filename, O_WRONLY | O_TRUNC);
libexec/tftpd/tftpd.c
785
if (fd < 0)
libexec/tftpd/tftpd.c
787
file = fdopen(fd, mode == RRQ ? "r" : "w");
libexec/tftpd/tftpd.c
789
close(fd);
sbin/bsdlabel/bsdlabel.c
132
int ch, error, fd;
sbin/bsdlabel/bsdlabel.c
211
fd = open(specname, O_RDONLY);
sbin/bsdlabel/bsdlabel.c
212
if (fd < 0) {
sbin/bsdlabel/bsdlabel.c
216
pname = g_providername(fd);
sbin/bsdlabel/bsdlabel.c
219
close(fd);
sbin/bsdlabel/bsdlabel.c
222
close(fd);
sbin/bsdlabel/bsdlabel.c
328
int fd;
sbin/bsdlabel/bsdlabel.c
333
fd = open(xxboot, O_RDONLY);
sbin/bsdlabel/bsdlabel.c
334
if (fd < 0)
sbin/bsdlabel/bsdlabel.c
336
fstat(fd, &st);
sbin/bsdlabel/bsdlabel.c
338
if (read(fd, bootarea, st.st_size) != st.st_size)
sbin/bsdlabel/bsdlabel.c
340
close(fd);
sbin/bsdlabel/bsdlabel.c
372
int i, fd, serrno;
sbin/bsdlabel/bsdlabel.c
393
fd = open(specname, O_RDWR);
sbin/bsdlabel/bsdlabel.c
394
if (fd < 0) {
sbin/bsdlabel/bsdlabel.c
416
if (write(fd, bootarea, bbsize) != bbsize) {
sbin/bsdlabel/bsdlabel.c
418
close (fd);
sbin/bsdlabel/bsdlabel.c
421
close (fd);
sbin/bsdlabel/bsdlabel.c
608
int c, fd;
sbin/bsdlabel/bsdlabel.c
612
if ((fd = mkstemp(tmpfil)) == -1 ||
sbin/bsdlabel/bsdlabel.c
613
(fp = fdopen(fd, "w")) == NULL) {
sbin/camcontrol/camcontrol.c
3529
int fd;
sbin/camcontrol/camcontrol.c
3545
if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
sbin/camcontrol/camcontrol.c
3549
if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) {
sbin/camcontrol/camcontrol.c
3552
close(fd);
sbin/camcontrol/camcontrol.c
3555
close(fd);
sbin/camcontrol/camcontrol.c
3680
int fd = -1, retval;
sbin/camcontrol/camcontrol.c
3685
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
3709
if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
sbin/camcontrol/camcontrol.c
3774
if (ioctl(fd, CAMIOCOMMAND, matchccb) == -1) {
sbin/camcontrol/camcontrol.c
3815
if (ioctl(fd, CAMIOCOMMAND, ccb) == -1) {
sbin/camcontrol/camcontrol.c
3843
if (fd != -1)
sbin/camcontrol/camcontrol.c
3844
close(fd);
sbin/camcontrol/camcontrol.c
3861
int fd;
sbin/camcontrol/camcontrol.c
3880
fd = -1;
sbin/camcontrol/camcontrol.c
3885
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
3910
if (ioctl(fd, CAMIOCOMMAND, &ccb) < 0) {
sbin/camcontrol/camcontrol.c
3912
close(fd);
sbin/camcontrol/camcontrol.c
3924
close(fd);
sbin/camcontrol/camcontrol.c
462
int bufsize, fd;
sbin/camcontrol/camcontrol.c
481
if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
sbin/camcontrol/camcontrol.c
498
close(fd);
sbin/camcontrol/camcontrol.c
5071
int c, fd;
sbin/camcontrol/camcontrol.c
5143
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/camcontrol.c
515
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
sbin/camcontrol/camcontrol.c
5154
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
sbin/camcontrol/camcontrol.c
5181
close(fd);
sbin/camcontrol/camcontrol.c
659
close(fd);
sbin/camcontrol/camcontrol.c
6958
int fd = -1;
sbin/camcontrol/camcontrol.c
7053
fd = open(pattern, O_RDONLY);
sbin/camcontrol/camcontrol.c
7054
if (fd < 0) {
sbin/camcontrol/camcontrol.c
7059
if (fstat(fd, &sb) < 0) {
sbin/camcontrol/camcontrol.c
7079
amt = read(fd, data_ptr + sizeof(*pl), sz);
sbin/camcontrol/camcontrol.c
7309
if (fd >= 0)
sbin/camcontrol/camcontrol.c
7310
close(fd);
sbin/camcontrol/camcontrol.c
8884
int bufsize, fd = -1;
sbin/camcontrol/camcontrol.c
8890
if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
sbin/camcontrol/camcontrol.c
8907
close(fd);
sbin/camcontrol/camcontrol.c
8939
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
sbin/camcontrol/camcontrol.c
9025
if (fd != -1)
sbin/camcontrol/camcontrol.c
9026
close(fd);
sbin/camcontrol/fwdownload.c
277
int timeout, int fd, char *buf,
sbin/camcontrol/fwdownload.c
455
fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd,
sbin/camcontrol/fwdownload.c
510
if (read(fd, buf, sizeof(*header)) != sizeof(*header)) {
sbin/camcontrol/fwdownload.c
517
if (lseek(fd, 0, SEEK_SET) == -1) {
sbin/camcontrol/fwdownload.c
573
int fd;
sbin/camcontrol/fwdownload.c
579
if ((fd = open(fw_img_path, O_RDONLY)) < 0) {
sbin/camcontrol/fwdownload.c
583
if (fstat(fd, &stbuf) < 0) {
sbin/camcontrol/fwdownload.c
599
if (read(fd, buf, 16) != 16) {
sbin/camcontrol/fwdownload.c
603
if (lseek(fd, 0, SEEK_SET) == -1) {
sbin/camcontrol/fwdownload.c
617
if (fw_validate_ibm(dev, retry_count, timeout, fd, buf,
sbin/camcontrol/fwdownload.c
627
if (lseek(fd, skip_bytes, SEEK_SET) == -1) {
sbin/camcontrol/fwdownload.c
634
if (read(fd, buf, img_size) != img_size) {
sbin/camcontrol/fwdownload.c
639
close(fd);
sbin/camcontrol/fwdownload.c
644
close(fd);
sbin/camcontrol/fwdownload.c
777
int fd;
sbin/camcontrol/fwdownload.c
785
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) {
sbin/camcontrol/fwdownload.c
801
if (ioctl(fd, CAMIOCOMMAND, &ccb) < 0) {
sbin/camcontrol/fwdownload.c
803
close(fd);
sbin/camcontrol/fwdownload.c
811
close(fd);
sbin/camcontrol/fwdownload.c
814
close(fd);
sbin/camcontrol/modeedit.c
943
int fd;
sbin/camcontrol/modeedit.c
957
if ((fd = mkstemp(edit_path)) == -1)
sbin/camcontrol/modeedit.c
962
if ((edit_file = fdopen(fd, "w")) == NULL)
sbin/comcontrol/comcontrol.c
104
close(fd);
sbin/comcontrol/comcontrol.c
56
int fd;
sbin/comcontrol/comcontrol.c
65
fd = STDIN_FILENO;
sbin/comcontrol/comcontrol.c
67
fd = open(argv[1], O_RDONLY|O_NONBLOCK, 0);
sbin/comcontrol/comcontrol.c
68
if (fd < 0) {
sbin/comcontrol/comcontrol.c
74
if (ioctl(fd, TIOCGDRAINWAIT, &drainwait) < 0) {
sbin/comcontrol/comcontrol.c
97
if (ioctl(fd, TIOCSDRAINWAIT, &drainwait) < 0) {
sbin/devd/devd.cc
1001
close(i->fd);
sbin/devd/devd.cc
1011
new_client(int fd, int socktype)
sbin/devd/devd.cc
1023
s.fd = accept(fd, NULL, NULL);
sbin/devd/devd.cc
1024
if (s.fd != -1) {
sbin/devd/devd.cc
1026
if (setsockopt(s.fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size,
sbin/devd/devd.cc
1029
shutdown(s.fd, SHUT_RD);
sbin/devd/devd.cc
1040
int fd;
sbin/devd/devd.cc
1048
fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC);
sbin/devd/devd.cc
1049
if (fd == -1)
sbin/devd/devd.cc
1054
max_fd = max(fd, max(stream_fd, seqpacket_fd)) + 1;
sbin/devd/devd.cc
1061
FD_SET(fd, &fds);
sbin/devd/devd.cc
1062
rv = select(fd + 1, &fds, NULL, NULL, &tv);
sbin/devd/devd.cc
1082
FD_SET(fd, &fds);
sbin/devd/devd.cc
1122
if (FD_ISSET(fd, &fds)) {
sbin/devd/devd.cc
1123
rv = read(fd, buffer, sizeof(buffer) - 1);
sbin/devd/devd.cc
1154
close(fd);
sbin/devd/devd.cc
134
int fd;
sbin/devd/devd.cc
923
int fd, slen;
sbin/devd/devd.cc
926
if ((fd = socket(PF_LOCAL, socktype, 0)) < 0)
sbin/devd/devd.cc
933
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
sbin/devd/devd.cc
935
if (::bind(fd, (struct sockaddr *) & sun, slen) < 0)
sbin/devd/devd.cc
937
listen(fd, 4);
sbin/devd/devd.cc
942
return (fd);
sbin/devd/devd.cc
969
if (send(i->fd, data, len, flags) != len) {
sbin/devd/devd.cc
971
close(i->fd);
sbin/devd/devd.cc
996
pfd.fd = i->fd;
sbin/devmatch/devmatch.c
76
int fd;
sbin/devmatch/devmatch.c
79
fd = open(fn, O_RDONLY);
sbin/devmatch/devmatch.c
80
if (fd < 0) {
sbin/devmatch/devmatch.c
85
if (fstat(fd, &sb) != 0)
sbin/devmatch/devmatch.c
90
if (read(fd, h, sb.st_size) != sb.st_size)
sbin/devmatch/devmatch.c
92
close(fd);
sbin/dhclient/bpf.c
339
send_packet_priv(struct interface_info *interface, struct imsg_hdr *hdr, int fd)
sbin/dhclient/bpf.c
351
buf_read(fd, &len, sizeof(len));
sbin/dhclient/bpf.c
358
buf_read(fd, &raw, len);
sbin/dhclient/bpf.c
359
buf_read(fd, &from, sizeof(from));
sbin/dhclient/bpf.c
360
buf_read(fd, &to, sizeof(to));
sbin/dhclient/dhclient.c
2892
fork_privchld(int fd, int fd2)
sbin/dhclient/dhclient.c
2918
pfd[0].fd = fd;
sbin/dhclient/dhclient.c
2927
dispatch_imsg(ifi, fd);
sbin/dhclient/dhclient.c
376
int ch, fd, quiet = 0, i = 0;
sbin/dhclient/dhclient.c
523
if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1)
sbin/dhclient/dhclient.c
527
close(fd);
sbin/dhclient/dhcpd.h
228
int fd;
sbin/dhclient/dispatch.c
210
fds[i].fd = l->fd;
sbin/dhclient/dispatch.c
285
close(l->fd);
sbin/dhclient/dispatch.c
463
add_protocol(const char *name, int fd, void (*handler)(struct protocol *),
sbin/dhclient/dispatch.c
472
p->fd = fd;
sbin/dhclient/privsep.c
103
dispatch_imsg(struct interface_info *ifix, int fd)
sbin/dhclient/privsep.c
115
buf_read(fd, &hdr, sizeof(hdr));
sbin/dhclient/privsep.c
121
buf_read(fd, &medium_len, sizeof(medium_len));
sbin/dhclient/privsep.c
128
buf_read(fd, medium, medium_len);
sbin/dhclient/privsep.c
132
buf_read(fd, &reason_len, sizeof(reason_len));
sbin/dhclient/privsep.c
139
buf_read(fd, reason, reason_len);
sbin/dhclient/privsep.c
152
buf_read(fd, &lease, sizeof(lease));
sbin/dhclient/privsep.c
154
buf_read(fd, &filename_len, sizeof(filename_len));
sbin/dhclient/privsep.c
161
buf_read(fd, filename, filename_len);
sbin/dhclient/privsep.c
165
buf_read(fd, &servername_len, sizeof(servername_len));
sbin/dhclient/privsep.c
173
buf_read(fd, servername, servername_len);
sbin/dhclient/privsep.c
177
buf_read(fd, &prefix_len, sizeof(prefix_len));
sbin/dhclient/privsep.c
184
buf_read(fd, prefix, prefix_len);
sbin/dhclient/privsep.c
192
buf_read(fd, &optlen, sizeof(optlen));
sbin/dhclient/privsep.c
203
buf_read(fd, lease.options[i].data, optlen);
sbin/dhclient/privsep.c
232
if (buf_close(fd, buf) == -1)
sbin/dhclient/privsep.c
236
send_packet_priv(ifix, &hdr, fd);
sbin/dhclient/privsep.c
242
buf_read(fd, &mtu, sizeof(u_int16_t));
sbin/dump/cache.c
107
return(pread(fd, buf, nbytes, offset));
sbin/dump/cache.c
128
n = pread(fd, blk->b_Data, BlockSize, blk->b_Offset);
sbin/dump/cache.c
141
return(pread(fd, buf, nbytes, offset));
sbin/dump/cache.c
79
cread(int fd, void *buf, size_t nbytes, off_t offset)
sbin/dump/cache.c
94
return(pread(fd, buf, nbytes, offset));
sbin/dump/dump.h
107
ssize_t cread(int fd, void *buf, size_t nbytes, off_t offset);
sbin/dump/itime.c
161
int fd;
sbin/dump/itime.c
169
fd = fileno(df);
sbin/dump/itime.c
170
(void) flock(fd, LOCK_EX);
sbin/dump/itime.c
204
if (ftruncate(fd, ftell(df)))
sbin/dump/tape.c
232
if (atomic_write(wp->fd, (const void *)wp->req, siz) != siz)
sbin/dump/tape.c
243
if (atomic_read(wp->fd, (void *)&got, sizeof got)
sbin/dump/tape.c
260
if (atomic_read(workers[i].fd,
sbin/dump/tape.c
318
if (atomic_read(workers[f].fd, (void *)&got, sizeof got)
sbin/dump/tape.c
330
(void) close(workers[f].fd);
sbin/dump/tape.c
442
if (atomic_write(wp->fd, (const void *)q, size) != size) {
sbin/dump/tape.c
482
if (atomic_read(wp->fd, (void *)&got, sizeof got)
sbin/dump/tape.c
718
workers[i].fd = cmd[1];
sbin/dump/tape.c
722
(void) close(workers[j].fd);
sbin/dump/tape.c
730
(void) atomic_write(workers[i].fd,
sbin/dump/tape.c
872
atomic_read(int fd, void *buf, int count)
sbin/dump/tape.c
876
while ((got = read(fd, buf, need)) > 0 && (need -= got) > 0)
sbin/dump/tape.c
886
atomic_write(int fd, const void *buf, int count)
sbin/dump/tape.c
890
while ((got = write(fd, buf, need)) > 0 && (need -= got) > 0)
sbin/dump/tape.c
98
int fd; /* FD for this worker */
sbin/dumpon/dumpon.c
195
check_size(int fd, const char *fn)
sbin/dumpon/dumpon.c
211
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) != 0)
sbin/dumpon/dumpon.c
384
int fd;
sbin/dumpon/dumpon.c
412
fd = open(_PATH_NETDUMP, O_RDONLY);
sbin/dumpon/dumpon.c
413
if (fd < 0) {
sbin/dumpon/dumpon.c
418
if (ioctl(fd, DIOCGKERNELDUMP, &ndconf) != 0) {
sbin/dumpon/dumpon.c
421
(void)close(fd);
sbin/dumpon/dumpon.c
434
(void)close(fd);
sbin/dumpon/dumpon.c
441
int fd, i;
sbin/dumpon/dumpon.c
453
fd = open(dumpdev, O_RDONLY);
sbin/dumpon/dumpon.c
454
if (fd < 0)
sbin/dumpon/dumpon.c
456
return (fd);
sbin/dumpon/dumpon.c
466
int ch, error, fd;
sbin/dumpon/dumpon.c
592
fd = open(_PATH_NETDUMP, O_RDONLY);
sbin/dumpon/dumpon.c
593
if (fd != -1) {
sbin/dumpon/dumpon.c
597
error = ioctl(fd, DIOCSKERNELDUMP, &ndconf);
sbin/dumpon/dumpon.c
601
close(fd);
sbin/dumpon/dumpon.c
607
fd = opendumpdev(dev, dumpdev);
sbin/dumpon/dumpon.c
609
check_size(fd, dumpdev);
sbin/dumpon/dumpon.c
669
error = ioctl(fd, DIOCSKERNELDUMP, kdap);
sbin/dumpon/dumpon.c
675
error = ioctl(fd, DIOCSKERNELDUMP, kdap);
sbin/etherswitchcfg/etherswitchcfg.c
126
if (ioctl(cfg->fd, IOETHERSWITCHGETREG, &er) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
138
if (ioctl(cfg->fd, IOETHERSWITCHSETREG, &er) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
149
if (ioctl(cfg->fd, IOETHERSWITCHGETPHYREG, &er) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
162
if (ioctl(cfg->fd, IOETHERSWITCHSETPHYREG, &er) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
181
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
184
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
227
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
233
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
252
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
259
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
278
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
288
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
305
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
324
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
344
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
347
if (ioctl(cfg->fd, IOETHERSWITCHSETVLANGROUP, &vg) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
386
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
390
if (ioctl(cfg->fd, IOETHERSWITCHSETVLANGROUP, &vg) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
457
if (ioctl(cfg->fd, IOETHERSWITCHSETCONF, &conf) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
487
if (ioctl(cfg->fd, i, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
506
if (ioctl(cfg->fd, IOETHERSWITCHGETTABLE, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
513
if (ioctl(cfg->fd, IOETHERSWITCHGETTABLEENTRY, &e) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
579
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
622
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
67
int fd;
sbin/etherswitchcfg/etherswitchcfg.c
713
if (ioctl(cfg->fd, IOETHERSWITCHGETCONF, &cfg->conf) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
758
cfg.fd = open(cfg.controlfile, O_RDONLY);
sbin/etherswitchcfg/etherswitchcfg.c
759
if (cfg.fd < 0)
sbin/etherswitchcfg/etherswitchcfg.c
761
if (ioctl(cfg.fd, IOETHERSWITCHGETINFO, &cfg.info) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
763
if (ioctl(cfg.fd, IOETHERSWITCHGETCONF, &cfg.conf) != 0)
sbin/etherswitchcfg/etherswitchcfg.c
855
close(cfg.fd);
sbin/fdisk/fdisk.c
732
fd = g_open(disk, rwmode);
sbin/fdisk/fdisk.c
734
if (fd == -1 && errno == EPERM && rwmode)
sbin/fdisk/fdisk.c
735
fd = g_open(disk, 0);
sbin/fdisk/fdisk.c
736
if (fd == -1 && errno == ENXIO)
sbin/fdisk/fdisk.c
738
if (fd == -1) {
sbin/fdisk/fdisk.c
746
return fd;
sbin/fdisk/fdisk.c
753
lseek(fd, (sector * 512), 0);
sbin/fdisk/fdisk.c
758
int size = read(fd, buf, secsize);
sbin/fdisk/fdisk.c
764
return read(fd, buf, secsize);
sbin/fdisk/fdisk.c
803
wr = pwrite(fd, buf, secsize, (sector * 512));
sbin/fdisk/fdisk.c
821
error = ioctl(fd, DIOCGFWSECTORS, &u);
sbin/fdisk/fdisk.c
827
error = ioctl(fd, DIOCGFWHEADS, &u);
sbin/fdisk/fdisk.c
836
u = g_sectorsize(fd);
sbin/fdisk/fdisk.c
840
o = g_mediasize(fd);
sbin/fdisk/fdisk.c
86
static int fd;
sbin/fsck/fsck.c
552
int fd, i;
sbin/fsck/fsck.c
554
if ((fd = open(str, O_RDONLY)) == -1)
sbin/fsck/fsck.c
560
if (ioctl(fd, DIOCGATTR, &attr) == -1) {
sbin/fsck/fsck.c
561
(void) close(fd);
sbin/fsck/fsck.c
564
(void) close(fd);
sbin/fsck_ffs/fsck.h
465
int blread(int fd, char *buf, ufs2_daddr_t blk, long size);
sbin/fsck_ffs/fsck.h
467
void blwrite(int fd, char *buf, ufs2_daddr_t blk, ssize_t size);
sbin/fsck_ffs/fsck.h
468
void blerase(int fd, ufs2_daddr_t blk, long size);
sbin/fsck_ffs/fsck.h
469
void blzero(int fd, ufs2_daddr_t blk, long size);
sbin/fsck_ffs/fsck.h
497
void flush(int fd, struct bufarea *bp);
sbin/fsck_ffs/fsutil.c
439
flush(int fd, struct bufarea *bp)
sbin/fsck_ffs/fsutil.c
467
if (sbput(fd, bp->b_un.b_fs, 0) == 0)
sbin/fsck_ffs/fsutil.c
504
blwrite(fd, bp->b_un.b_buf, bp->b_bno, bp->b_size);
sbin/fsck_ffs/fsutil.c
861
blread(int fd, char *buf, ufs2_daddr_t blk, long size)
sbin/fsck_ffs/fsutil.c
873
if (pread(fd, buf, (int)size, offset) == size) {
sbin/fsck_ffs/fsutil.c
894
if (pread(fd, cp, (int)secsize, offset + i) != secsize) {
sbin/fsck_ffs/fsutil.c
911
blwrite(int fd, char *buf, ufs2_daddr_t blk, ssize_t size)
sbin/fsck_ffs/fsutil.c
917
if (fd < 0)
sbin/fsck_ffs/fsutil.c
921
if (pwrite(fd, buf, size, offset) == size) {
sbin/fsck_ffs/fsutil.c
929
if (pwrite(fd, cp, dev_bsize, offset + i) != dev_bsize)
sbin/fsck_ffs/fsutil.c
936
blerase(int fd, ufs2_daddr_t blk, long size)
sbin/fsck_ffs/fsutil.c
940
if (fd < 0)
sbin/fsck_ffs/fsutil.c
944
ioctl(fd, DIOCGDELETE, ioarg);
sbin/fsck_ffs/fsutil.c
954
blzero(int fd, ufs2_daddr_t blk, long size)
sbin/fsck_ffs/fsutil.c
959
if (fd < 0)
sbin/fsck_ffs/fsutil.c
967
if (lseek(fd, offset, 0) < 0)
sbin/fsck_ffs/fsutil.c
971
if (write(fd, zero, len) != len)
sbin/fsck_msdosfs/dir.c
1014
if (lseek(fd, off, SEEK_SET) != off
sbin/fsck_msdosfs/dir.c
1015
|| write(fd, buffer, iosize) != iosize) {
sbin/fsck_msdosfs/dir.c
1034
if (lseek(fd, off, SEEK_SET) != off
sbin/fsck_msdosfs/dir.c
1035
|| write(fd, buffer, iosize) != iosize) {
sbin/fsck_msdosfs/dir.c
301
int clsz, fd;
sbin/fsck_msdosfs/dir.c
305
fd = fat_get_fd(fat);
sbin/fsck_msdosfs/dir.c
319
if (lseek(fd, off, SEEK_SET) != off) {
sbin/fsck_msdosfs/dir.c
323
if (read(fd, delbuf, clsz) != clsz) {
sbin/fsck_msdosfs/dir.c
331
if (lseek(fd, off, SEEK_SET) != off) {
sbin/fsck_msdosfs/dir.c
335
if (write(fd, delbuf, clsz) != clsz) {
sbin/fsck_msdosfs/dir.c
481
int fd;
sbin/fsck_msdosfs/dir.c
485
fd = fat_get_fd(fat);
sbin/fsck_msdosfs/dir.c
512
if (lseek(fd, off, SEEK_SET) != off ||
sbin/fsck_msdosfs/dir.c
513
read(fd, buf, boot->bpbBytesPerSec) != (ssize_t)boot->bpbBytesPerSec) {
sbin/fsck_msdosfs/dir.c
553
int fd, i, j, k, iosize, entries;
sbin/fsck_msdosfs/dir.c
564
fd = fat_get_fd(fat);
sbin/fsck_msdosfs/dir.c
612
if (lseek(fd, off, SEEK_SET) != off ||
sbin/fsck_msdosfs/dir.c
613
read(fd, buffer, iosize) != iosize) {
sbin/fsck_msdosfs/fat.c
1156
int ret, fd;
sbin/fsck_msdosfs/fat.c
1159
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
1178
if ((lseek(fd, src_off, SEEK_SET) != src_off ||
sbin/fsck_msdosfs/fat.c
1179
(size_t)read(fd, fat->fatbuf, rwsize) != rwsize) &&
sbin/fsck_msdosfs/fat.c
1185
if ((lseek(fd, dst_off, SEEK_SET) != dst_off ||
sbin/fsck_msdosfs/fat.c
1186
(size_t)write(fd, fat->fatbuf, rwsize) != rwsize) &&
sbin/fsck_msdosfs/fat.c
1204
int ret = FSOK, fd;
sbin/fsck_msdosfs/fat.c
1209
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
1240
if ((lseek(fd, dst_base, SEEK_SET) != dst_base ||
sbin/fsck_msdosfs/fat.c
1241
(size_t)write(fd, fat->fatbuf, writesz) != writesz) &&
sbin/fsck_msdosfs/fat.c
173
int fd;
sbin/fsck_msdosfs/fat.c
361
int fd;
sbin/fsck_msdosfs/fat.c
365
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
373
if (lseek(fd, fat_addr, SEEK_SET) != fat_addr ||
sbin/fsck_msdosfs/fat.c
374
(size_t)write(fd, entry->chunk, writesize) != writesize) {
sbin/fsck_msdosfs/fat.c
387
int fd;
sbin/fsck_msdosfs/fat.c
426
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
427
if (lseek(fd, fat_addr, SEEK_SET) != fat_addr ||
sbin/fsck_msdosfs/fat.c
428
(size_t)read(fd, entry->chunk, rwsize) != rwsize) {
sbin/fsck_msdosfs/fat.c
535
return (fat->fd);
sbin/fsck_msdosfs/fat.c
645
int fd, ret = FSERROR;
sbin/fsck_msdosfs/fat.c
652
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
666
if ((size_t)pread(fd, buffer, len, off) != len) {
sbin/fsck_msdosfs/fat.c
677
if ((size_t)pwrite(fd, buffer, len, off) != len) {
sbin/fsck_msdosfs/fat.c
695
int fd;
sbin/fsck_msdosfs/fat.c
703
fd = fd_of_(fat);
sbin/fsck_msdosfs/fat.c
748
if (lseek(fd, off, SEEK_SET) != off) {
sbin/fsck_msdosfs/fat.c
752
if ((size_t)read(fd, fat->fatbuf, readsize) != readsize) {
sbin/fsck_msdosfs/fat.c
821
fat->fd = fs;
sbin/fsdb/fsdb.h
33
extern int blread(int fd, char *buf, ufs2_daddr_t blk, long size);
sbin/geom/misc/subr.c
193
int fd;
sbin/geom/misc/subr.c
195
fd = g_open(name, 0);
sbin/geom/misc/subr.c
196
if (fd == -1)
sbin/geom/misc/subr.c
198
mediasize = g_mediasize(fd);
sbin/geom/misc/subr.c
201
(void)g_close(fd);
sbin/geom/misc/subr.c
209
int fd;
sbin/geom/misc/subr.c
211
fd = g_open(name, 0);
sbin/geom/misc/subr.c
212
if (fd == -1)
sbin/geom/misc/subr.c
214
sectorsize = g_sectorsize(fd);
sbin/geom/misc/subr.c
217
(void)g_close(fd);
sbin/geom/misc/subr.c
229
int error, fd;
sbin/geom/misc/subr.c
234
fd = g_open(name, 0);
sbin/geom/misc/subr.c
235
if (fd == -1)
sbin/geom/misc/subr.c
237
mediasize = g_mediasize(fd);
sbin/geom/misc/subr.c
242
sectorsize = g_sectorsize(fd);
sbin/geom/misc/subr.c
253
if (pread(fd, sector, sectorsize, mediasize - sectorsize) !=
sbin/geom/misc/subr.c
269
g_close(fd);
sbin/geom/misc/subr.c
286
int error, fd;
sbin/geom/misc/subr.c
291
fd = g_open(name, 1);
sbin/geom/misc/subr.c
292
if (fd == -1)
sbin/geom/misc/subr.c
294
mediasize = g_mediasize(fd);
sbin/geom/misc/subr.c
299
sectorsize = g_sectorsize(fd);
sbin/geom/misc/subr.c
312
if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) !=
sbin/geom/misc/subr.c
317
(void)g_flush(fd);
sbin/geom/misc/subr.c
321
(void)g_close(fd);
sbin/geom/misc/subr.c
332
int error, fd;
sbin/geom/misc/subr.c
337
fd = g_open(name, 1);
sbin/geom/misc/subr.c
338
if (fd == -1)
sbin/geom/misc/subr.c
340
mediasize = g_mediasize(fd);
sbin/geom/misc/subr.c
345
sectorsize = g_sectorsize(fd);
sbin/geom/misc/subr.c
356
if (pread(fd, sector, sectorsize, mediasize - sectorsize) !=
sbin/geom/misc/subr.c
368
if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) !=
sbin/geom/misc/subr.c
373
(void)g_flush(fd);
sbin/geom/misc/subr.c
376
g_close(fd);
sbin/ggate/ggated/ggated.c
289
FILE *fd;
sbin/ggate/ggated/ggated.c
293
fd = fopen(exports_file, "r");
sbin/ggate/ggated/ggated.c
294
if (fd == NULL) {
sbin/ggate/ggated/ggated.c
302
if (fgets(buf, sizeof(buf), fd) == NULL) {
sbin/ggate/ggated/ggated.c
303
if (feof(fd))
sbin/ggate/ggated/ggated.c
326
if (!feof(fd))
sbin/ggate/ggated/ggated.c
334
fclose(fd);
sbin/ggate/ggated/ggated.c
698
int error, fd;
sbin/ggate/ggated/ggated.c
702
fd = conn->c_recvfd;
sbin/ggate/ggated/ggated.c
708
data = g_gate_recv(fd, &req->r_hdr, sizeof(req->r_hdr),
sbin/ggate/ggated/ggated.c
736
data = g_gate_recv(fd, req->r_data, req->r_length,
sbin/ggate/ggated/ggated.c
763
int error, fd;
sbin/ggate/ggated/ggated.c
767
fd = conn->c_diskfd;
sbin/ggate/ggated/ggated.c
798
data = pread(fd, req->r_data, req->r_length,
sbin/ggate/ggated/ggated.c
802
data = pwrite(fd, req->r_data, req->r_length,
sbin/ggate/ggated/ggated.c
809
data = fsync(fd);
sbin/ggate/ggated/ggated.c
856
int error, fd;
sbin/ggate/ggated/ggated.c
860
fd = conn->c_sendfd;
sbin/ggate/ggated/ggated.c
883
if (g_gate_send(fd, &req->r_hdr, sizeof(req->r_hdr), 0) == -1) {
sbin/ggate/ggated/ggated.c
890
data = g_gate_send(fd, req->r_data, req->r_length, 0);
sbin/ggate/ggatel/ggatel.c
120
close(fd);
sbin/ggate/ggatel/ggatel.c
151
if (pread(fd, ggio.gctl_data, ggio.gctl_length,
sbin/ggate/ggatel/ggatel.c
159
if (pwrite(fd, ggio.gctl_data, ggio.gctl_length,
sbin/ggate/ggatel/ggatel.c
177
int fd;
sbin/ggate/ggatel/ggatel.c
179
fd = open(path, g_gate_openflags(flags) | O_DIRECT | O_FSYNC);
sbin/ggate/ggatel/ggatel.c
180
if (fd == -1)
sbin/ggate/ggatel/ggatel.c
185
ggioc.gctl_mediasize = g_gate_mediasize(fd);
sbin/ggate/ggatel/ggatel.c
187
sectorsize = g_gate_sectorsize(fd);
sbin/ggate/ggatel/ggatel.c
197
g_gatel_serve(fd);
sbin/ggate/ggatel/ggatel.c
204
int fd;
sbin/ggate/ggatel/ggatel.c
206
fd = open(path, g_gate_openflags(flags));
sbin/ggate/ggatel/ggatel.c
207
if (fd == -1)
sbin/ggate/ggatel/ggatel.c
215
g_gatel_serve(fd);
sbin/ggate/ggatel/ggatel.c
90
g_gatel_serve(int fd)
sbin/ggate/shared/ggate.c
132
g_gate_mediasize(int fd)
sbin/ggate/shared/ggate.c
137
if (fstat(fd, &sb) == -1)
sbin/ggate/shared/ggate.c
140
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) == -1) {
sbin/ggate/shared/ggate.c
153
g_gate_sectorsize(int fd)
sbin/ggate/shared/ggate.c
158
if (fstat(fd, &sb) == -1)
sbin/ggate/shared/ggate.c
161
if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1) {
sbin/ggate/shared/ggate.h
104
off_t g_gate_mediasize(int fd);
sbin/ggate/shared/ggate.h
105
unsigned g_gate_sectorsize(int fd);
sbin/hastd/hastd.c
1070
int fd, maxfd, ret;
sbin/hastd/hastd.c
1083
maxfd = fd = proto_descriptor(cfg->hc_controlconn);
sbin/hastd/hastd.c
1084
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/hastd.c
1085
FD_SET(fd, &rfds);
sbin/hastd/hastd.c
1089
fd = proto_descriptor(lst->hl_conn);
sbin/hastd/hastd.c
1090
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/hastd.c
1091
FD_SET(fd, &rfds);
sbin/hastd/hastd.c
1092
maxfd = MAX(fd, maxfd);
sbin/hastd/hastd.c
1097
fd = proto_descriptor(res->hr_event);
sbin/hastd/hastd.c
1098
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/hastd.c
1099
FD_SET(fd, &rfds);
sbin/hastd/hastd.c
1100
maxfd = MAX(fd, maxfd);
sbin/hastd/hastd.c
1104
fd = proto_descriptor(res->hr_conn);
sbin/hastd/hastd.c
1105
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/hastd.c
1106
FD_SET(fd, &rfds);
sbin/hastd/hastd.c
1107
maxfd = MAX(fd, maxfd);
sbin/hastd/hastd.c
172
int fd;
sbin/hastd/hastd.c
190
for (fd = 0; fd <= maxfd; fd++) {
sbin/hastd/hastd.c
191
if (fstat(fd, &sb) == 0) {
sbin/hastd/hastd.c
199
"Unable to fstat descriptor %d: %s", fd,
sbin/hastd/hastd.c
203
if (fd == STDIN_FILENO || fd == STDOUT_FILENO ||
sbin/hastd/hastd.c
204
fd == STDERR_FILENO) {
sbin/hastd/hastd.c
208
fd, (fd == STDIN_FILENO ? "stdin" :
sbin/hastd/hastd.c
209
(fd == STDOUT_FILENO ? "stdout" : "stderr")));
sbin/hastd/hastd.c
212
} else if (fd == proto_descriptor(res->hr_event)) {
sbin/hastd/hastd.c
216
fd);
sbin/hastd/hastd.c
222
fd, dtype2str(mode), dtype2str(S_IFSOCK));
sbin/hastd/hastd.c
225
} else if (fd == proto_descriptor(res->hr_ctrl)) {
sbin/hastd/hastd.c
229
fd);
sbin/hastd/hastd.c
235
fd, dtype2str(mode), dtype2str(S_IFSOCK));
sbin/hastd/hastd.c
239
fd == proto_descriptor(res->hr_conn)) {
sbin/hastd/hastd.c
243
fd);
sbin/hastd/hastd.c
249
fd, dtype2str(mode), dtype2str(S_IFSOCK));
sbin/hastd/hastd.c
254
fd == proto_descriptor(res->hr_conn)) {
sbin/hastd/hastd.c
258
fd);
sbin/hastd/hastd.c
262
fd == proto_descriptor(res->hr_remotein)) {
sbin/hastd/hastd.c
266
fd);
sbin/hastd/hastd.c
272
fd, dtype2str(mode), dtype2str(S_IFSOCK));
sbin/hastd/hastd.c
276
fd == proto_descriptor(res->hr_remoteout)) {
sbin/hastd/hastd.c
280
fd);
sbin/hastd/hastd.c
286
fd, dtype2str(mode), dtype2str(S_IFSOCK));
sbin/hastd/hastd.c
293
fd, dtype2str(mode));
sbin/hastd/hooks.c
105
fd = open(_PATH_DEVNULL, O_RDONLY);
sbin/hastd/hooks.c
106
if (fd == -1) {
sbin/hastd/hooks.c
109
} else if (fd != STDIN_FILENO) {
sbin/hastd/hooks.c
110
if (dup2(fd, STDIN_FILENO) == -1) {
sbin/hastd/hooks.c
114
close(fd);
sbin/hastd/hooks.c
116
fd = open(_PATH_DEVNULL, O_WRONLY);
sbin/hastd/hooks.c
117
if (fd == -1) {
sbin/hastd/hooks.c
121
if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) == -1) {
sbin/hastd/hooks.c
125
if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) == -1) {
sbin/hastd/hooks.c
129
if (fd != STDOUT_FILENO && fd != STDERR_FILENO)
sbin/hastd/hooks.c
130
close(fd);
sbin/hastd/hooks.c
89
int fd;
sbin/hastd/proto.c
285
int ret, fd;
sbin/hastd/proto.c
294
fd = proto_descriptor(mconn);
sbin/hastd/proto.c
295
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/proto.c
300
(const unsigned char *)protoname, strlen(protoname) + 1, fd);
sbin/hastd/proto.c
316
int ret, fd;
sbin/hastd/proto.c
327
sizeof(protoname) - 1, &fd);
sbin/hastd/proto.c
333
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/proto.c
349
ret = newconn->pc_proto->prt_wrap(fd, client, &newconn->pc_ctx);
sbin/hastd/proto.c
413
int fd;
sbin/hastd/proto.c
419
fd = proto_descriptor(conn);
sbin/hastd/proto.c
420
if (fd == -1)
sbin/hastd/proto.c
425
if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) == -1)
sbin/hastd/proto.c
427
if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) == -1)
sbin/hastd/proto_common.c
156
if (fd == -1)
sbin/hastd/proto_common.c
158
return (proto_descriptor_send(sock, fd));
sbin/hastd/proto_common.c
62
proto_descriptor_send(int sock, int fd)
sbin/hastd/proto_common.c
64
unsigned char ctrl[CMSG_SPACE(sizeof(fd))];
sbin/hastd/proto_common.c
69
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/proto_common.c
82
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
sbin/hastd/proto_common.c
83
bcopy(&fd, CMSG_DATA(cmsg), sizeof(fd));
sbin/hastd/proto_common.c
92
proto_common_send(int sock, const unsigned char *data, size_t size, int fd)
sbin/hastd/proto_impl.h
75
int proto_common_send(int sock, const unsigned char *data, size_t size, int fd);
sbin/hastd/proto_socketpair.c
120
return (proto_common_send(sock, data, size, fd));
sbin/hastd/proto_socketpair.c
127
int fd;
sbin/hastd/proto_socketpair.c
145
fd = spctx->sp_fd[1];
sbin/hastd/proto_socketpair.c
149
fd = spctx->sp_fd[0];
sbin/hastd/proto_socketpair.c
159
return (proto_common_recv(fd, data, size, fdp));
sbin/hastd/proto_socketpair.c
85
sp_send(void *ctx, const unsigned char *data, size_t size, int fd)
sbin/hastd/proto_tcp.c
237
tcp_setup_wrap(int fd, int side, void **ctxp)
sbin/hastd/proto_tcp.c
241
PJDLOG_ASSERT(fd >= 0);
sbin/hastd/proto_tcp.c
250
tctx->tc_fd = fd;
sbin/hastd/proto_tcp.c
474
tcp_wrap(int fd, bool client, void **ctxp)
sbin/hastd/proto_tcp.c
477
return (tcp_setup_wrap(fd,
sbin/hastd/proto_tcp.c
482
tcp_send(void *ctx, const unsigned char *data, size_t size, int fd)
sbin/hastd/proto_tcp.c
489
PJDLOG_ASSERT(fd == -1);
sbin/hastd/proto_uds.c
230
uds_send(void *ctx, const unsigned char *data, size_t size, int fd)
sbin/hastd/proto_uds.c
238
return (proto_common_send(uctx->uc_fd, data, size, fd));
sbin/init/init.c
1620
int fd;
sbin/init/init.c
1626
fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0);
sbin/init/init.c
1627
if (fd < 0) {
sbin/init/init.c
1633
close(fd);
sbin/init/init.c
591
int fd;
sbin/init/init.c
598
if ((fd = open(_PATH_CONSOLE, O_RDWR | O_NONBLOCK)) != -1) {
sbin/init/init.c
599
(void)fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK);
sbin/init/init.c
600
if (login_tty(fd) == 0)
sbin/init/init.c
602
close(fd);
sbin/init/init.c
606
if ((fd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
sbin/init/init.c
610
if (fd != STDIN_FILENO) {
sbin/init/init.c
611
dup2(fd, STDIN_FILENO);
sbin/init/init.c
612
close(fd);
sbin/init/init.c
614
fd = open(_PATH_INITLOG, O_WRONLY | O_APPEND | O_CREAT, 0644);
sbin/init/init.c
615
if (fd == -1)
sbin/init/init.c
617
else if (fd != STDOUT_FILENO) {
sbin/init/init.c
618
dup2(fd, STDOUT_FILENO);
sbin/init/init.c
619
close(fd);
sbin/init/init.c
650
int error, fd;
sbin/init/init.c
652
fd = open(path, O_RDONLY);
sbin/init/init.c
653
if (fd < 0) {
sbin/init/init.c
658
error = fstat(fd, &sb);
sbin/init/init.c
661
close(fd);
sbin/init/init.c
669
close(fd);
sbin/init/init.c
673
nbytes = read(fd, buf, bufsize);
sbin/init/init.c
676
close(fd);
sbin/init/init.c
681
error = close(fd);
sbin/init/init.c
699
int error, fd;
sbin/init/init.c
701
fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0700);
sbin/init/init.c
702
if (fd < 0) {
sbin/init/init.c
707
nbytes = write(fd, buf, bufsize);
sbin/init/init.c
710
close(fd);
sbin/init/init.c
714
error = close(fd);
sbin/ipf/common/ipf_y.y
1986
ipf_parsefile(int fd, addfunc_t addfunc, ioctlfunc_t *iocfuncs, char *filename)
sbin/ipf/common/ipf_y.y
2010
while (ipf_parsesome(fd, addfunc, iocfuncs, fp) == 1)
sbin/ipf/common/ipf_y.y
2019
ipf_parsesome(int fd, addfunc_t addfunc, ioctlfunc_t *iocfuncs, FILE *fp)
sbin/ipf/common/ipf_y.y
2024
ipffd = fd;
sbin/ipf/common/ipf_y.y
2390
ipf_addrule(int fd, ioctlfunc_t ioctlfunc, void *ptr)
sbin/ipf/common/ipf_y.y
2410
fd = -1;
sbin/ipf/common/ipf_y.y
2438
if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) {
sbin/ipf/common/ipf_y.y
2444
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/common/ipf_y.y
2458
if ((*ioctlfunc)(fd, del, (void *)&obj) == -1) {
sbin/ipf/common/ipf_y.y
2464
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/common/ipf_y.y
2468
if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) {
sbin/ipf/common/ipf_y.y
2474
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/ipf/ipf.c
136
ipf_dotuning(fd, optarg, ioctl);
sbin/ipf/ipf/ipf.c
160
if (fd != -1)
sbin/ipf/ipf/ipf.c
161
(void) close(fd);
sbin/ipf/ipf/ipf.c
182
if (fd == -1)
sbin/ipf/ipf/ipf.c
183
if ((fd = open(ipfdev, O_RDWR)) == -1)
sbin/ipf/ipf/ipf.c
184
if ((fd = open(ipfdev, O_RDONLY)) == -1)
sbin/ipf/ipf/ipf.c
185
ipferror(fd, "open device");
sbin/ipf/ipf/ipf.c
186
return (fd);
sbin/ipf/ipf/ipf.c
193
close(fd);
sbin/ipf/ipf/ipf.c
194
fd = -1;
sbin/ipf/ipf/ipf.c
204
(ioctl(fd, SIOCGETFF, &i) == -1)) {
sbin/ipf/ipf/ipf.c
205
ipferror(fd, "SIOCGETFF");
sbin/ipf/ipf/ipf.c
216
if (ioctl(fd, SIOCFRENB, &enable) == -1) {
sbin/ipf/ipf/ipf.c
221
ipferror(fd, "SIOCFRENB");
sbin/ipf/ipf/ipf.c
236
ipf_parsefile(fd, ipf_interceptadd, iocfunctions, file);
sbin/ipf/ipf/ipf.c
247
ipf_interceptadd(int fd, ioctlfunc_t ioctlfunc, void *ptr)
sbin/ipf/ipf/ipf.c
252
if (ipf_addrule(fd, ioctlfunc, ptr) != 0)
sbin/ipf/ipf/ipf.c
297
(ioctl(fd, SIOCSETFF, &flag) != 0))
sbin/ipf/ipf/ipf.c
298
ipferror(fd, "ioctl(SIOCSETFF)");
sbin/ipf/ipf/ipf.c
313
ipferror(fd, "ioctl(SIOCGETLG)");
sbin/ipf/ipf/ipf.c
373
if (ioctl(fd, SIOCMATCHFLUSH, &obj) == -1) {
sbin/ipf/ipf/ipf.c
374
ipferror(fd, "ioctl(SIOCMATCHFLUSH)");
sbin/ipf/ipf/ipf.c
380
if (ioctl(fd, SIOCIPFFL, &fl) == -1) {
sbin/ipf/ipf/ipf.c
381
ipferror(fd, "ioctl(SIOCIPFFL)");
sbin/ipf/ipf/ipf.c
413
if (ioctl(fd, SIOCIPFL6, &fl) == -1) {
sbin/ipf/ipf/ipf.c
414
ipferror(fd, "ioctl(SIOCIPFL6)");
sbin/ipf/ipf/ipf.c
418
if (ioctl(fd, SIOCIPFFL, &fl) == -1) {
sbin/ipf/ipf/ipf.c
419
ipferror(fd, "ioctl(SIOCIPFFL)");
sbin/ipf/ipf/ipf.c
441
if (opendevice(ipfname, 1) != -2 && ioctl(fd, SIOCSWAPA, &in) == -1)
sbin/ipf/ipf/ipf.c
442
ipferror(fd, "ioctl(SIOCSWAPA)");
sbin/ipf/ipf/ipf.c
453
if (opendevice(ipfname, 1) != -2 && ioctl(fd, SIOCFRSYN, &frsyn) == -1)
sbin/ipf/ipf/ipf.c
454
ipferror(fd, "SIOCFRSYN");
sbin/ipf/ipf/ipf.c
46
static int fd = -1;
sbin/ipf/ipf/ipf.c
473
if (ioctl(fd, SIOCFRZST, &obj) == -1) {
sbin/ipf/ipf/ipf.c
474
ipferror(fd, "ioctl(SIOCFRZST)");
sbin/ipf/ipfs/ipfs.c
103
fd = open(fname, O_RDWR);
sbin/ipf/ipfs/ipfs.c
104
if (fd == -1) {
sbin/ipf/ipfs/ipfs.c
109
for (pos = 0; read(fd, &ips, sizeof(ips)) == sizeof(ips); ) {
sbin/ipf/ipfs/ipfs.c
128
if (lseek(fd, pos, SEEK_SET) != pos) {
sbin/ipf/ipfs/ipfs.c
132
if (write(fd, &ips, sizeof(ips)) != sizeof(ips)) {
sbin/ipf/ipfs/ipfs.c
137
pos = lseek(fd, 0, SEEK_CUR);
sbin/ipf/ipfs/ipfs.c
139
close(fd);
sbin/ipf/ipfs/ipfs.c
150
int fd, olen, nlen, rw;
sbin/ipf/ipfs/ipfs.c
167
fd = open(fname, O_RDWR);
sbin/ipf/ipfs/ipfs.c
168
if (fd == -1) {
sbin/ipf/ipfs/ipfs.c
173
for (pos = 0; read(fd, &ipn, sizeof(ipn)) == sizeof(ipn); ) {
sbin/ipf/ipfs/ipfs.c
184
if (lseek(fd, pos, SEEK_SET) != pos) {
sbin/ipf/ipfs/ipfs.c
188
if (write(fd, &ipn, sizeof(ipn)) != sizeof(ipn)) {
sbin/ipf/ipfs/ipfs.c
193
pos = lseek(fd, 0, SEEK_CUR);
sbin/ipf/ipfs/ipfs.c
195
close(fd);
sbin/ipf/ipfs/ipfs.c
332
int fd = -1;
sbin/ipf/ipfs/ipfs.c
340
if ((fd = open(ipfdev, O_RDWR)) == -1)
sbin/ipf/ipfs/ipfs.c
341
if ((fd = open(ipfdev, O_RDONLY)) == -1)
sbin/ipf/ipfs/ipfs.c
343
return (fd);
sbin/ipf/ipfs/ipfs.c
347
void closedevice(int fd)
sbin/ipf/ipfs/ipfs.c
349
close(fd);
sbin/ipf/ipfs/ipfs.c
353
int setlock(int fd, int lock)
sbin/ipf/ipfs/ipfs.c
358
if (ioctl(fd, SIOCSTLCK, &lock) == -1) {
sbin/ipf/ipfs/ipfs.c
369
int writestate(int fd, char *file)
sbin/ipf/ipfs/ipfs.c
398
if (ioctl(fd, SIOCSTGET, &obj)) {
sbin/ipf/ipfs/ipfs.c
419
int readstate(int fd, char *file)
sbin/ipf/ipfs/ipfs.c
504
if (ioctl(fd, SIOCSTPUT, &obj)) {
sbin/ipf/ipfs/ipfs.c
534
int readnat(int fd, char *file)
sbin/ipf/ipfs/ipfs.c
648
if (ioctl(fd, SIOCSTPUT, &obj)) {
sbin/ipf/ipfs/ipfs.c
679
int writenat(int fd, char *file)
sbin/ipf/ipfs/ipfs.c
704
if (ioctl(fd, SIOCSTGSZ, &ng)) {
sbin/ipf/ipfs/ipfs.c
733
if (ioctl(fd, SIOCSTGET, &obj)) {
sbin/ipf/ipfs/ipfs.c
763
int fd, devfd;
sbin/ipf/ipfs/ipfs.c
774
fd = opendevice(NULL);
sbin/ipf/ipfs/ipfs.c
775
if (fd == -1)
sbin/ipf/ipfs/ipfs.c
777
if (setlock(fd, 1)) {
sbin/ipf/ipfs/ipfs.c
778
close(fd);
sbin/ipf/ipfs/ipfs.c
796
if (setlock(fd, 0)) {
sbin/ipf/ipfs/ipfs.c
797
close(fd);
sbin/ipf/ipfs/ipfs.c
801
close(fd);
sbin/ipf/ipfs/ipfs.c
805
setlock(fd, 0);
sbin/ipf/ipfs/ipfs.c
806
close(fd);
sbin/ipf/ipfs/ipfs.c
813
int fd, devfd;
sbin/ipf/ipfs/ipfs.c
823
fd = opendevice(NULL);
sbin/ipf/ipfs/ipfs.c
824
if (fd == -1)
sbin/ipf/ipfs/ipfs.c
826
if (setlock(fd, 1)) {
sbin/ipf/ipfs/ipfs.c
827
close(fd);
sbin/ipf/ipfs/ipfs.c
845
if (setlock(fd, 0)) {
sbin/ipf/ipfs/ipfs.c
846
close(fd);
sbin/ipf/ipfs/ipfs.c
88
int fd, olen, nlen, rw;
sbin/ipf/ipfstat/ipfstat.c
2131
static int fetchfrag( int fd, int type, ipfr_t *frp)
sbin/ipf/ipfstat/ipfstat.c
2145
if (ioctl(fd, SIOCGENITER, &obj))
sbin/ipf/ipfstat/ipfstat.c
2296
static void showtqtable_live(int fd)
sbin/ipf/ipfstat/ipfstat.c
2307
if (ioctl(fd, SIOCGTQTAB, &obj) == 0) {
sbin/ipf/ipfsync/ipfsyncd.c
133
int fd = open("/dev/null", O_RDWR);
sbin/ipf/ipfsync/ipfsyncd.c
151
dup2(fd, 0);
sbin/ipf/ipfsync/ipfsyncd.c
152
dup2(fd, 1);
sbin/ipf/ipfsync/ipfsyncd.c
153
dup2(fd, 2);
sbin/ipf/ipfsync/ipfsyncd.c
154
close(fd);
sbin/ipf/ipftest/ip_fil.c
127
int fd;
sbin/ipf/ipftest/ip_fil.c
138
fd = open(fname, O_WRONLY|O_APPEND);
sbin/ipf/ipftest/ip_fil.c
139
if (fd == -1) {
sbin/ipf/ipftest/ip_fil.c
143
write(fd, (char *)ip, ntohs(ip->ip_len));
sbin/ipf/ipftest/ip_fil.c
144
close(fd);
sbin/ipf/ipftest/ip_fil.c
340
int fd;
sbin/ipf/ipftest/ip_fil.c
347
fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
sbin/ipf/ipftest/ip_fil.c
348
if (fd == -1)
sbin/ipf/ipftest/ip_fil.c
351
close(fd);
sbin/ipf/ipftest/ip_fil.c
358
fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
sbin/ipf/ipftest/ip_fil.c
359
if (fd == -1)
sbin/ipf/ipftest/ip_fil.c
362
close(fd);
sbin/ipf/ipftest/ipftest.c
185
fd = (*r->r_open)(datain);
sbin/ipf/ipftest/ipftest.c
187
fd = (*r->r_open)("-");
sbin/ipf/ipftest/ipftest.c
189
if (fd < 0) {
sbin/ipf/ipftest/ipftest.c
608
int fd, i;
sbin/ipf/ipftest/ipftest.c
610
fd = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0644);
sbin/ipf/ipftest/ipftest.c
611
if (fd == -1) {
sbin/ipf/ipftest/ipftest.c
634
write(fd, buffer, resid - uio.uio_resid);
sbin/ipf/ipftest/ipftest.c
639
close(fd);
sbin/ipf/ipftest/ipftest.c
64
int fd, i, dir, c, loaded, dump, hlen;
sbin/ipf/iplang/iplang_y.y
792
int fd, len;
sbin/ipf/iplang/iplang_y.y
794
if ((fd = open(file, O_RDONLY)) == -1) {
sbin/ipf/iplang/iplang_y.y
799
if (fstat(fd, &sb) == -1) {
sbin/ipf/iplang/iplang_y.y
806
close(fd);
sbin/ipf/iplang/iplang_y.y
809
if ((len = read(fd, canip->ah_data, sb.st_size)) == -1) {
sbin/ipf/iplang/iplang_y.y
811
close(fd);
sbin/ipf/iplang/iplang_y.y
816
close(fd);
sbin/ipf/ipmon/ipmon.c
1425
int fd;
sbin/ipf/ipmon/ipmon.c
1427
if ((fd = open(file, O_CREAT|O_TRUNC|O_WRONLY, 0644)) >= 0) {
sbin/ipf/ipmon/ipmon.c
1428
fp = fdopen(fd, "w");
sbin/ipf/ipmon/ipmon.c
1430
close(fd);
sbin/ipf/ipmon/ipmon.c
1444
int fd, flushed = 0;
sbin/ipf/ipmon/ipmon.c
1446
if ((fd = open(file, O_RDWR)) == -1) {
sbin/ipf/ipmon/ipmon.c
1452
if (ioctl(fd, SIOCIPFFB, &flushed) == 0) {
sbin/ipf/ipmon/ipmon.c
1457
ipferror(fd, "SIOCIPFFB");
sbin/ipf/ipmon/ipmon.c
1458
(void) close(fd);
sbin/ipf/ipmon/ipmon.c
1513
conf->logsrc[i].fd = -1;
sbin/ipf/ipmon/ipmon.c
1726
l->fd = 0;
sbin/ipf/ipmon/ipmon.c
1728
if ((l->fd= open(l->file, O_RDONLY)) == -1) {
sbin/ipf/ipmon/ipmon.c
1736
if (fstat(l->fd, &sb) == -1) {
sbin/ipf/ipmon/ipmon.c
1738
l->fd, STRERROR(errno));
sbin/ipf/ipmon/ipmon.c
1747
FD_SET(l->fd, &conf->fdmr);
sbin/ipf/ipmon/ipmon.c
1748
if (l->fd > conf->maxfd)
sbin/ipf/ipmon/ipmon.c
1749
conf->maxfd = l->fd;
sbin/ipf/ipmon/ipmon.c
1777
if ((l->logtype == -1) || !FD_ISSET(l->fd, &fdr))
sbin/ipf/ipmon/ipmon.c
1782
tr = (lseek(l->fd, 0, SEEK_CUR) < l->size);
sbin/ipf/ipmon/ipmon.c
1788
tr = read_log(l->fd, &n, (char *)buf, sizeof(buf));
sbin/ipf/ipmon/ipmon.c
1818
ipferror(l->fd, "read");
sbin/ipf/ipmon/ipmon.c
37
int fd;
sbin/ipf/ipmon/ipmon.c
447
read_log(int fd, int *lenp, char *buf, int bufsize)
sbin/ipf/ipmon/ipmon.c
454
nr = read(fd, buf, bufsize);
sbin/ipf/ipnat/ipnat.c
177
if (((fd = open(IPNAT_NAME, mode)) == -1) &&
sbin/ipf/ipnat/ipnat.c
178
((fd = open(IPNAT_NAME, O_RDONLY)) == -1)) {
sbin/ipf/ipnat/ipnat.c
200
if (ioctl(fd, SIOCGNATS, &obj) == -1) {
sbin/ipf/ipnat/ipnat.c
201
ipferror(fd, "ioctl(SIOCGNATS)");
sbin/ipf/ipnat/ipnat.c
212
dostats(fd, nsp, opts, 0, natfilter);
sbin/ipf/ipnat/ipnat.c
217
flushtable(fd, opts, natfilter);
sbin/ipf/ipnat/ipnat.c
219
return (ipnat_parsefile(fd, ipnat_addrule, ioctl, file));
sbin/ipf/ipnat/ipnat.c
222
dostats(fd, nsp, opts, 1, natfilter);
sbin/ipf/ipnat/ipnat.c
283
flushtable(int fd, int opts, int *match)
sbin/ipf/ipnat/ipnat.c
297
if (ioctl(fd, SIOCMATCHFLUSH, &obj) == -1) {
sbin/ipf/ipnat/ipnat.c
298
ipferror(fd, "ioctl(SIOCMATCHFLUSH)");
sbin/ipf/ipnat/ipnat.c
303
} else if (ioctl(fd, SIOCIPFFL, &n) == -1) {
sbin/ipf/ipnat/ipnat.c
304
ipferror(fd, "ioctl(SIOCIPFFL)");
sbin/ipf/ipnat/ipnat.c
314
if (!(opts & OPT_DONOTHING) && ioctl(fd, SIOCIPFFL, &n) == -1)
sbin/ipf/ipnat/ipnat.c
315
ipferror(fd, "ioctl(SIOCCNATL)");
sbin/ipf/ipnat/ipnat.c
391
dotable(natstat_t *nsp, int fd, int alive, int which, char *side)
sbin/ipf/ipnat/ipnat.c
419
if (ioctl(fd, SIOCGTABL, &obj) != 0) {
sbin/ipf/ipnat/ipnat.c
420
ipferror(fd, "SIOCFTABL");
sbin/ipf/ipnat/ipnat.c
460
dostats(int fd, natstat_t *nsp, int opts, int alive, int *filter)
sbin/ipf/ipnat/ipnat.c
467
dotable(nsp, fd, alive, 0, "in");
sbin/ipf/ipnat/ipnat.c
470
dotable(nsp, fd, alive, 1, "out");
sbin/ipf/ipnat/ipnat.c
503
dostats_live(fd, nsp, opts, filter);
sbin/ipf/ipnat/ipnat.c
514
dostats_live(int fd, natstat_t *nsp, int opts, int *filter)
sbin/ipf/ipnat/ipnat.c
540
if (ioctl(fd, SIOCGENITER, &obj) == -1)
sbin/ipf/ipnat/ipnat.c
562
(void) ioctl(fd,SIOCIPFDELTOK, &i);
sbin/ipf/ipnat/ipnat.c
570
if (ioctl(fd, SIOCGENITER, &obj) == -1)
sbin/ipf/ipnat/ipnat.c
597
showhostmap_live(fd, nsp);
sbin/ipf/ipnat/ipnat.c
600
(void) ioctl(fd,SIOCIPFDELTOK, &i);
sbin/ipf/ipnat/ipnat.c
644
showhostmap_live(int fd, natstat_t *nsp)
sbin/ipf/ipnat/ipnat.c
664
if (ioctl(fd, SIOCGENITER, &obj) == -1)
sbin/ipf/ipnat/ipnat.c
671
(void) ioctl(fd,SIOCIPFDELTOK, &i);
sbin/ipf/ipnat/ipnat.c
89
int fd, c, mode, *natfilter;
sbin/ipf/ipnat/ipnat.c
94
fd = -1;
sbin/ipf/ipnat/ipnat_y.y
1296
ipnat_parsefile(int fd, addfunc_t addfunc, ioctlfunc_t ioctlfunc,
sbin/ipf/ipnat/ipnat_y.y
1323
while ((rval = ipnat_parsesome(fd, addfunc, ioctlfunc, fp)) == 0)
sbin/ipf/ipnat/ipnat_y.y
1336
ipnat_parsesome(int fd, addfunc_t addfunc, ioctlfunc_t ioctlfunc,
sbin/ipf/ipnat/ipnat_y.y
1342
natfd = fd;
sbin/ipf/ipnat/ipnat_y.y
1461
ipnat_addrule(int fd, ioctlfunc_t ioctlfunc, void *ptr)
sbin/ipf/ipnat/ipnat_y.y
1475
fd = -1;
sbin/ipf/ipnat/ipnat_y.y
1495
if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) {
sbin/ipf/ipnat/ipnat_y.y
1501
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/ipnat/ipnat_y.y
1515
if ((*ioctlfunc)(fd, del, (void *)&obj) == -1) {
sbin/ipf/ipnat/ipnat_y.y
1521
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/ipnat/ipnat_y.y
1525
if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) {
sbin/ipf/ipnat/ipnat_y.y
1536
return(ipf_perror_fd(fd, ioctlfunc, msg));
sbin/ipf/ipnat/ipnat_y.y
1650
proxy_loadrules(int fd, ioctlfunc_t ioctlfunc, proxyrule_t *rules)
sbin/ipf/ipnat/ipnat_y.y
1655
proxy_loadconfig(fd, ioctlfunc, pr->pr_proxy, pr->pr_proto,
sbin/ipf/ipnat/ipnat_y.y
1665
proxy_loadconfig(int fd, ioctlfunc_t ioctlfunc, char *proxy, int proto,
sbin/ipf/ipnat/ipnat_y.y
1693
if ((*ioctlfunc)(fd, SIOCPROXY, (void *)&obj) == -1) {
sbin/ipf/ipnat/ipnat_y.y
1699
ipf_perror_fd(fd, ioctlfunc, msg);
sbin/ipf/ippool/ippool.c
1000
ipferror(fd, "ioctl(SIOCLOOKUPITER)");
sbin/ipf/ippool/ippool.c
1004
printhash_live(&table, fd, poolname, opts, pool_fields);
sbin/ipf/ippool/ippool.c
1013
showdstls_live(int fd, int role, ipf_dstl_stat_t *dlstp, char *poolname)
sbin/ipf/ippool/ippool.c
1033
if (ioctl(fd, SIOCLOOKUPITER, &obj)) {
sbin/ipf/ippool/ippool.c
1034
ipferror(fd, "ioctl(SIOCLOOKUPITER)");
sbin/ipf/ippool/ippool.c
1038
printdstl_live(&table, fd, poolname, opts, pool_fields);
sbin/ipf/ippool/ippool.c
405
if (!(opts & (OPT_DONOTHING|OPT_DONTOPEN)) && (fd == -1)) {
sbin/ipf/ippool/ippool.c
406
fd = open(IPLOOKUP_NAME, O_RDWR);
sbin/ipf/ippool/ippool.c
407
if (fd == -1) {
sbin/ipf/ippool/ippool.c
413
if (ippool_parsefile(fd, infile, ioctl) != 0)
sbin/ipf/ippool/ippool.c
468
if (!(opts & (OPT_DONOTHING|OPT_DONTOPEN)) && (fd == -1)) {
sbin/ipf/ippool/ippool.c
469
fd = open(IPLOOKUP_NAME, O_RDWR);
sbin/ipf/ippool/ippool.c
470
if (fd == -1) {
sbin/ipf/ippool/ippool.c
481
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
483
ipferror(fd, "ioctl(S0IOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
496
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
498
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
513
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
515
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
578
if (!(opts & (OPT_DONOTHING|OPT_DONTOPEN)) && (fd == -1)) {
sbin/ipf/ippool/ippool.c
579
fd = open(IPLOOKUP_NAME, O_RDWR);
sbin/ipf/ippool/ippool.c
580
if (fd == -1) {
sbin/ipf/ippool/ippool.c
592
if (ioctl(fd, SIOCLOOKUPFLUSH, &flush) == -1) {
sbin/ipf/ippool/ippool.c
593
ipferror(fd, "ioctl(SIOCLOOKUPFLUSH)");
sbin/ipf/ippool/ippool.c
60
int fd = -1;
sbin/ipf/ippool/ippool.c
730
if (!(opts & (OPT_DONOTHING|OPT_DONTOPEN)) && (fd == -1)) {
sbin/ipf/ippool/ippool.c
731
fd = open(IPLOOKUP_NAME, O_RDWR);
sbin/ipf/ippool/ippool.c
732
if (fd == -1) {
sbin/ipf/ippool/ippool.c
746
if (poollist_live(role, poolname, type, fd) != 0)
sbin/ipf/ippool/ippool.c
824
poollist_live(int role, char *poolname, int type, int fd)
sbin/ipf/ippool/ippool.c
840
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
842
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
846
if (showpools_live(fd, role, &plstat, poolname))
sbin/ipf/ippool/ippool.c
852
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
854
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
858
if (showpools_live(fd, role, &plstat, poolname))
sbin/ipf/ippool/ippool.c
878
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
880
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
883
if (showhashs_live(fd, role, &htstat, poolname))
sbin/ipf/ippool/ippool.c
889
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
891
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
895
if (showhashs_live(fd, role, &htstat, poolname))
sbin/ipf/ippool/ippool.c
914
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
916
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
919
if (showdstls_live(fd, role, &dlstat, poolname))
sbin/ipf/ippool/ippool.c
925
c = ioctl(fd, SIOCLOOKUPSTAT, &op);
sbin/ipf/ippool/ippool.c
927
ipferror(fd, "ioctl(SIOCLOOKUPSTAT)");
sbin/ipf/ippool/ippool.c
931
if (showdstls_live(fd, role, &dlstat, poolname))
sbin/ipf/ippool/ippool.c
942
showpools_live(int fd, int role, ipf_pool_stat_t *plstp, char *poolname)
sbin/ipf/ippool/ippool.c
964
if (ioctl(fd, SIOCLOOKUPITER, &obj)) {
sbin/ipf/ippool/ippool.c
965
ipferror(fd, "ioctl(SIOCLOOKUPITER)");
sbin/ipf/ippool/ippool.c
970
printpool_live(&pool, fd, poolname, opts, pool_fields);
sbin/ipf/ippool/ippool.c
979
showhashs_live(int fd, int role, iphtstat_t *htstp, char *poolname)
sbin/ipf/ippool/ippool.c
999
if (ioctl(fd, SIOCLOOKUPITER, &obj)) {
sbin/ipf/ippool/ippool_y.y
612
ippool_parsefile(int fd, char *filename, ioctlfunc_t iocfunc)
sbin/ipf/ippool/ippool_y.y
636
while (ippool_parsesome(fd, fp, iocfunc) == 1)
sbin/ipf/ippool/ippool_y.y
645
ippool_parsesome(int fd, FILE *fp, ioctlfunc_t iocfunc)
sbin/ipf/ipscan/ipscan_y.y
392
if (ioctl(fd, SIOCRMSCA, &iscp) == -1)
sbin/ipf/ipscan/ipscan_y.y
395
if (ioctl(fd, SIOCADSCA, &iscp) == -1)
sbin/ipf/ipscan/ipscan_y.y
41
int fd = -1;
sbin/ipf/ipscan/ipscan_y.y
469
if (ioctl(fd, SIOCGSCST, &ipscp) == -1)
sbin/ipf/ipscan/ipscan_y.y
547
fd = open(IPL_SCAN, O_RDWR);
sbin/ipf/ipscan/ipscan_y.y
548
if (fd == -1) {
sbin/ipf/ipsend/arp.c
104
fd = socket(AF_INET, SOCK_DGRAM, 0);
sbin/ipf/ipsend/arp.c
105
(void) sendto(fd, ip, 4, 0,
sbin/ipf/ipsend/arp.c
108
(void) close(fd);
sbin/ipf/ipsend/arp.c
66
int fd;
sbin/ipf/ipsend/arp.c
76
fd = -1;
sbin/ipf/ipsend/arp.c
98
if (fd == -1)
sbin/ipf/ipsend/dlcommon.c
101
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
106
dlenabmultireq(int fd, char *addr, int length)
sbin/ipf/ipsend/dlcommon.c
1267
strioctl(int fd, int cmd, int timout, int len, char *dp)
sbin/ipf/ipsend/dlcommon.c
127
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
1276
rc = ioctl(fd, I_STR, &sioc);
sbin/ipf/ipsend/dlcommon.c
132
dldisabmultireq(int fd, char *addr, int length)
sbin/ipf/ipsend/dlcommon.c
153
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
158
dlpromisconreq(int fd, u_long level)
sbin/ipf/ipsend/dlcommon.c
173
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
179
dlpromiscoff(int fd, u_long level)
sbin/ipf/ipsend/dlcommon.c
194
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
199
dlphysaddrreq(int fd, u_long addrtype)
sbin/ipf/ipsend/dlcommon.c
214
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
219
dlsetphysaddrreq(int fd, char *addr, int length)
sbin/ipf/ipsend/dlcommon.c
240
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
245
dldetachreq(int fd)
sbin/ipf/ipsend/dlcommon.c
259
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
264
dlbindreq(int fd, u_long sap, u_long max_conind, u_long service_mode,
sbin/ipf/ipsend/dlcommon.c
284
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
289
dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri,
sbin/ipf/ipsend/dlcommon.c
314
if (putmsg(fd, &ctl, &data, 0) < 0)
sbin/ipf/ipsend/dlcommon.c
319
dlunbindreq(int fd)
sbin/ipf/ipsend/dlcommon.c
333
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
338
dlokack(int fd, char *bufp)
sbin/ipf/ipsend/dlcommon.c
348
strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlokack");
sbin/ipf/ipsend/dlcommon.c
365
dlerrorack(int fd, char *bufp)
sbin/ipf/ipsend/dlcommon.c
375
strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlerrorack");
sbin/ipf/ipsend/dlcommon.c
392
dlbindack(int fd, char *bufp)
sbin/ipf/ipsend/dlcommon.c
40
dlinforeq(int fd)
sbin/ipf/ipsend/dlcommon.c
402
strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlbindack");
sbin/ipf/ipsend/dlcommon.c
416
dlphysaddrack(int fd, char *bufp)
sbin/ipf/ipsend/dlcommon.c
426
strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlphysaddrack");
sbin/ipf/ipsend/dlcommon.c
445
strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *flagsp,
sbin/ipf/ipsend/dlcommon.c
464
if ((rc = getmsg(fd, ctlp, datap, flagsp)) < 0) {
sbin/ipf/ipsend/dlcommon.c
54
if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
sbin/ipf/ipsend/dlcommon.c
59
dlinfoack(int fd, char *bufp)
sbin/ipf/ipsend/dlcommon.c
69
strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlinfoack");
sbin/ipf/ipsend/dlcommon.c
86
dlattachreq(int fd, u_long ppa)
sbin/ipf/ipsend/iptests.c
1051
int fd;
sbin/ipf/ipsend/iptests.c
1057
fd = socket(AF_INET, SOCK_STREAM, 0);
sbin/ipf/ipsend/iptests.c
1062
if (!connect(fd, (struct sockaddr *)&sin, sizeof(sin)))
sbin/ipf/ipsend/iptests.c
1064
close(fd);
sbin/ipf/ipsend/iptests.c
1077
if (!getsockname(fd, (struct sockaddr *)&sin, &slen))
sbin/ipf/ipsend/iptests.c
1079
if (!(tcbp = find_tcp(fd, &ti))) {
sbin/ipf/ipsend/iptests.c
1132
(void) close(fd);
sbin/ipf/ipsend/resend.c
68
int fd, wfd = initdevice(dev, 5), len, i;
sbin/ipf/ipsend/resend.c
75
fd = (*r->r_open)(datain);
sbin/ipf/ipsend/resend.c
77
fd = (*r->r_open)("-");
sbin/ipf/ipsend/resend.c
79
if (fd < 0)
sbin/ipf/ipsend/sbpf.c
100
fprintf(stderr, "%s(%d):", ifr.ifr_name, fd);
sbin/ipf/ipsend/sbpf.c
107
if (ioctl(fd, BIOCGBLEN, &bufsize) == -1)
sbin/ipf/ipsend/sbpf.c
119
if (ioctl(fd, BIOCSRTIMEOUT, (caddr_t)&to) == -1)
sbin/ipf/ipsend/sbpf.c
125
(void) ioctl(fd, BIOCFLUSH, 0);
sbin/ipf/ipsend/sbpf.c
126
return (fd);
sbin/ipf/ipsend/sbpf.c
134
sendip(int fd, char *pkt, int len)
sbin/ipf/ipsend/sbpf.c
136
if (write(fd, pkt, len) == -1)
sbin/ipf/ipsend/sbpf.c
58
int fd;
sbin/ipf/ipsend/sbpf.c
60
if ((fd = open(bpfname, O_RDWR)) < 0)
sbin/ipf/ipsend/sbpf.c
67
int fd = 0, i;
sbin/ipf/ipsend/sbpf.c
72
if ((fd = open(bpfname, O_RDWR)) >= 0)
sbin/ipf/ipsend/sbpf.c
82
if (ioctl(fd, BIOCVERSION, (caddr_t)&bv) < 0)
sbin/ipf/ipsend/sbpf.c
98
if (ioctl(fd, BIOCSETIF, &ifr) == -1)
sbin/ipf/ipsend/sdlpi.c
102
dlbindreq(fd, 22, 1, DL_HP_RAWDLS, 0, 0);
sbin/ipf/ipsend/sdlpi.c
104
dlbindreq(fd, ETHERTYPE_IP, 0, DL_CLDLS, 0, 0);
sbin/ipf/ipsend/sdlpi.c
106
dlbindack(fd, buf);
sbin/ipf/ipsend/sdlpi.c
111
if (strioctl(fd, DLIOCRAW, -1, 0, NULL) == -1)
sbin/ipf/ipsend/sdlpi.c
117
return (fd);
sbin/ipf/ipsend/sdlpi.c
125
sendip(int fd, char *pkt, int len)
sbin/ipf/ipsend/sdlpi.c
126
int fd, len;
sbin/ipf/ipsend/sdlpi.c
149
if (putmsg(fd, cp, dp, pri) == -1)
sbin/ipf/ipsend/sdlpi.c
154
if (ioctl(fd, I_FLUSH, FLUSHW) == -1)
sbin/ipf/ipsend/sdlpi.c
54
int i, fd;
sbin/ipf/ipsend/sdlpi.c
72
if ((fd = open(devname, O_RDWR)) < 0)
sbin/ipf/ipsend/sdlpi.c
79
if (dlattachreq(fd, i) == -1)
sbin/ipf/ipsend/sdlpi.c
84
else if (dlokack(fd, buf) == -1)
sbin/ipf/ipsend/sdlpi.c
90
if (dlpromisconreq(fd, DL_PROMISC_SAP) < 0)
sbin/ipf/ipsend/sdlpi.c
95
else if (dlokack(fd, buf) < 0)
sbin/ipf/ipsend/snit.c
104
return (fd);
sbin/ipf/ipsend/snit.c
112
sendip(int fd, char *pkt, int len)
sbin/ipf/ipsend/snit.c
113
int fd, len;
sbin/ipf/ipsend/snit.c
143
if (putmsg(fd, cp, dp, 0) == -1)
sbin/ipf/ipsend/snit.c
149
if (ioctl(fd, I_FLUSH, FLUSHW) == -1)
sbin/ipf/ipsend/snit.c
61
int fd;
sbin/ipf/ipsend/snit.c
63
if ((fd = open("/dev/nit", O_RDWR)) < 0)
sbin/ipf/ipsend/snit.c
72
ioctl(fd, I_SRDOPT, (char*)RMSGD);
sbin/ipf/ipsend/snit.c
73
ioctl(fd, I_PUSH, "nbuf");
sbin/ipf/ipsend/snit.c
85
if (ioctl(fd, I_STR, (char*)&si) == -1)
sbin/ipf/ipsend/snit.c
99
if (ioctl(fd, I_STR, (char*)&si) == -1)
sbin/ipf/ipsend/sock.c
154
struct filedesc *fd;
sbin/ipf/ipsend/sock.c
161
fd = (struct filedesc *)malloc(sizeof(*fd));
sbin/ipf/ipsend/sock.c
162
if (fd == NULL)
sbin/ipf/ipsend/sock.c
165
if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1)
sbin/ipf/ipsend/sock.c
169
free(fd);
sbin/ipf/ipsend/sock.c
173
if (KMCPY(fd, p->kp_proc.p_fd, sizeof(*fd)) == -1)
sbin/ipf/ipsend/sock.c
177
free(fd);
sbin/ipf/ipsend/sock.c
188
o = (struct file **)calloc(fd->fd_lastfile + 1, sizeof(*o));
sbin/ipf/ipsend/sock.c
189
if (KMCPY(o, fd->fd_ofiles, (fd->fd_lastfile + 1) * sizeof(*o)) == -1)
sbin/ipf/ipsend/sock.c
192
(u_long)fd->fd_ofiles, (u_long)o, (u_long)sizeof(*o));
sbin/ipf/ipsend/sock.c
247
int fd, nfd;
sbin/ipf/ipsend/sock.c
252
fd = socket(AF_INET, SOCK_STREAM, 0);
sbin/ipf/ipsend/sock.c
253
if (fd == -1)
sbin/ipf/ipsend/sock.c
259
if (fcntl(fd, F_SETFL, FNDELAY) == -1)
sbin/ipf/ipsend/sock.c
269
if (bind(fd, (struct sockaddr *)&lsin, sizeof(lsin)) == -1)
sbin/ipf/ipsend/sock.c
275
(void) getsockname(fd, (struct sockaddr *)&lsin, &len);
sbin/ipf/ipsend/sock.c
283
if (!(t = find_tcp(fd, ti)))
sbin/ipf/ipsend/sock.c
291
if (connect(fd, (struct sockaddr *)&rsin, sizeof(rsin)) == -1 &&
sbin/ipf/ipsend/sock.c
304
(void)write(fd, "Hello World\n", 12);
sbin/ipf/ipsend/sock.c
306
close(fd);
sbin/ipf/ipsend/sockraw.c
38
int fd;
sbin/ipf/ipsend/sockraw.c
43
if ((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
sbin/ipf/ipsend/sockraw.c
49
if (ioctl(fd, SIOCGIFADDR, &ifr) == -1)
sbin/ipf/ipsend/sockraw.c
58
if (bind(fd, &s, sizeof(s)) == -1)
sbin/ipf/ipsend/sockraw.c
60
return (fd);
sbin/ipf/ipsend/sockraw.c
67
int sendip(int fd, char *pkt, int len)
sbin/ipf/ipsend/sockraw.c
79
if (sendto(fd, pkt, len, 0, &sin, sizeof(sin)) == -1)
sbin/ipf/libipf/connecttcp.c
20
int fd;
sbin/ipf/libipf/connecttcp.c
38
fd = socket(AF_INET, SOCK_STREAM, 0);
sbin/ipf/libipf/connecttcp.c
39
if (fd == -1)
sbin/ipf/libipf/connecttcp.c
42
if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
sbin/ipf/libipf/connecttcp.c
43
close(fd);
sbin/ipf/libipf/connecttcp.c
47
return (fd);
sbin/ipf/libipf/interror.c
567
ipf_geterror(int fd, ioctlfunc_t *func)
sbin/ipf/libipf/interror.c
573
if ((*func)(fd, SIOCIPFINTERROR, &errnum) == 0) {
sbin/ipf/libipf/ipf_dotuning.c
14
void ipf_dotuning(int fd, char *tuneargs, ioctlfunc_t iocfn)
sbin/ipf/libipf/ipf_dotuning.c
29
if ((*iocfn)(fd, SIOCIPFGETNEXT, &obj) == -1) {
sbin/ipf/libipf/ipf_dotuning.c
30
ipf_perror_fd(fd, iocfn,
sbin/ipf/libipf/ipf_dotuning.c
45
if ((*iocfn)(fd, SIOCIPFSET, &obj) == -1) {
sbin/ipf/libipf/ipf_dotuning.c
46
ipf_perror_fd(fd, iocfn,
sbin/ipf/libipf/ipf_dotuning.c
57
if ((*iocfn)(fd, SIOCIPFGET, &obj) == -1) {
sbin/ipf/libipf/ipf_dotuning.c
58
ipf_perror_fd(fd, iocfn, "ioctl(SIOCIPFGET)");
sbin/ipf/libipf/ipf_perror.c
15
ipf_perror_fd( int fd, ioctlfunc_t iocfunc, char *string)
sbin/ipf/libipf/ipf_perror.c
21
if ((*iocfunc)(fd, SIOCIPFINTERROR, &realerr) == -1)
sbin/ipf/libipf/ipf_perror.c
32
ipferror(int fd, char *msg)
sbin/ipf/libipf/ipf_perror.c
34
if (fd >= 0) {
sbin/ipf/libipf/ipf_perror.c
35
ipf_perror_fd(fd, ioctl, msg);
sbin/ipf/libipf/ipft_pc.c
110
(void) close(fd);
sbin/ipf/libipf/ipft_pc.c
114
pfd = fd;
sbin/ipf/libipf/ipft_pc.c
119
return (fd);
sbin/ipf/libipf/ipft_pc.c
81
int fd, i;
sbin/ipf/libipf/ipft_pc.c
87
fd = 0;
sbin/ipf/libipf/ipft_pc.c
88
else if ((fd = open(fname, O_RDONLY)) == -1)
sbin/ipf/libipf/ipft_pc.c
91
if (read(fd, (char *)&ph, sizeof(ph)) != sizeof(ph))
sbin/ipf/libipf/ipft_pc.c
96
(void) close(fd);
sbin/ipf/libipf/kvatoname.c
20
int fd;
sbin/ipf/libipf/kvatoname.c
24
fd = -1;
sbin/ipf/libipf/kvatoname.c
27
fd = open(IPL_NAME, O_RDONLY);
sbin/ipf/libipf/kvatoname.c
28
if (fd == -1)
sbin/ipf/libipf/kvatoname.c
31
(void) (*iocfunc)(fd, SIOCFUNCL, &res);
sbin/ipf/libipf/kvatoname.c
32
if (fd >= 0)
sbin/ipf/libipf/kvatoname.c
33
close(fd);
sbin/ipf/libipf/load_http.c
103
fd = connecttcp(s, port);
sbin/ipf/libipf/load_http.c
104
if (fd == -1)
sbin/ipf/libipf/load_http.c
109
if (write(fd, buffer, len) != len)
sbin/ipf/libipf/load_http.c
116
while ((len = read(fd, s, left)) > 0) {
sbin/ipf/libipf/load_http.c
204
if (fd != -1)
sbin/ipf/libipf/load_http.c
205
close(fd);
sbin/ipf/libipf/load_http.c
32
int fd, len, left, port, endhdr, removed, linenum = 0;
sbin/ipf/libipf/load_http.c
47
fd = -1;
sbin/ipf/libipf/nametokva.c
19
int fd;
sbin/ipf/libipf/nametokva.c
23
fd = -1;
sbin/ipf/libipf/nametokva.c
26
fd = open(IPL_NAME, O_RDONLY);
sbin/ipf/libipf/nametokva.c
27
if (fd == -1)
sbin/ipf/libipf/nametokva.c
30
(void) (*iocfunc)(fd, SIOCFUNCL, &res);
sbin/ipf/libipf/nametokva.c
31
if (fd >= 0)
sbin/ipf/libipf/nametokva.c
32
close(fd);
sbin/ipf/libipf/printdstl_live.c
17
printdstl_live( ippool_dst_t *d, int fd, char *name, int opts,
sbin/ipf/libipf/printdstl_live.c
64
while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
sbin/ipf/libipf/printdstl_live.c
73
(void) ioctl(fd, SIOCIPFDELTOK, &iter.ili_key);
sbin/ipf/libipf/printhash_live.c
13
printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields)
sbin/ipf/libipf/printhash_live.c
50
while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
sbin/ipf/libipf/printhash_live.c
61
ipferror(fd, "walking hash nodes");
sbin/ipf/libipf/printhash_live.c
69
(void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key);
sbin/ipf/libipf/printpool_live.c
13
printpool_live(ip_pool_t *pool, int fd, char *name, int opts,
sbin/ipf/libipf/printpool_live.c
50
while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
sbin/ipf/libipf/printpool_live.c
72
(void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key);
sbin/ipf/libipf/save_v1trap.c
124
ctx->fd = -1;
sbin/ipf/libipf/save_v1trap.c
142
ctx->fd = socket(AF_INET, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v1trap.c
143
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v1trap.c
146
if (connect(ctx->fd,
sbin/ipf/libipf/save_v1trap.c
158
ctx->fd = socket(AF_INET6, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v1trap.c
159
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v1trap.c
162
if (connect(ctx->fd,
sbin/ipf/libipf/save_v1trap.c
174
ctx->fd = socket(AF_INET, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v1trap.c
175
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v1trap.c
178
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
sbin/ipf/libipf/save_v1trap.c
210
if (v1->fd >= 0)
sbin/ipf/libipf/save_v1trap.c
211
close(v1->fd);
sbin/ipf/libipf/save_v1trap.c
221
return (sendtrap_v1_0(v1->fd, v1->community,
sbin/ipf/libipf/save_v1trap.c
28
int fd;
sbin/ipf/libipf/save_v1trap.c
430
sendtrap_v1_0(int fd, char *community, char *msg, int msglen, time_t when)
sbin/ipf/libipf/save_v1trap.c
439
return (send(fd, buffer, n, 0));
sbin/ipf/libipf/save_v2trap.c
129
ctx->fd = -1;
sbin/ipf/libipf/save_v2trap.c
147
ctx->fd = socket(AF_INET, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v2trap.c
148
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v2trap.c
151
if (connect(ctx->fd,
sbin/ipf/libipf/save_v2trap.c
163
ctx->fd = socket(AF_INET6, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v2trap.c
164
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v2trap.c
167
if (connect(ctx->fd,
sbin/ipf/libipf/save_v2trap.c
179
ctx->fd = socket(AF_INET, SOCK_DGRAM, 0);
sbin/ipf/libipf/save_v2trap.c
180
if (ctx->fd >= 0) {
sbin/ipf/libipf/save_v2trap.c
183
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
sbin/ipf/libipf/save_v2trap.c
215
if (v2->fd >= 0)
sbin/ipf/libipf/save_v2trap.c
216
close(v2->fd);
sbin/ipf/libipf/save_v2trap.c
226
return (sendtrap_v2_0(v2->fd, v2->community,
sbin/ipf/libipf/save_v2trap.c
32
int fd;
sbin/ipf/libipf/save_v2trap.c
431
sendtrap_v2_0(int fd, char *community, char *msg, int msglen)
sbin/ipf/libipf/save_v2trap.c
440
return (send(fd, buffer, n, 0));
sbin/ldconfig/elfhints.c
194
int fd;
sbin/ldconfig/elfhints.c
203
if ((fd = open(hintsfile, O_RDONLY)) == -1) {
sbin/ldconfig/elfhints.c
208
if (fstat(fd, &s) == -1)
sbin/ldconfig/elfhints.c
217
MAP_PRIVATE, fd, 0);
sbin/ldconfig/elfhints.c
220
close(fd);
sbin/ldconfig/elfhints.c
271
int fd;
sbin/ldconfig/elfhints.c
277
if ((fd = mkstemp(tempname)) == -1)
sbin/ldconfig/elfhints.c
279
if (fchmod(fd, 0444) == -1)
sbin/ldconfig/elfhints.c
281
if ((fp = fdopen(fd, "wb")) == NULL)
sbin/mdconfig/mdconfig.c
470
int fd;
sbin/mdconfig/mdconfig.c
474
fd = open(mdio.md_file, O_RDONLY);
sbin/mdconfig/mdconfig.c
475
if (fd < 0)
sbin/mdconfig/mdconfig.c
477
if (fstat(fd, &sb) == -1)
sbin/mdconfig/mdconfig.c
483
close(fd);
sbin/mdmfs/mdmfs.c
452
int fd; /* Standard output of mdconfig invocation. */
sbin/mdmfs/mdmfs.c
472
rv = run(&fd, "%s -a %s%s", path_mdconfig, ta, args);
sbin/mdmfs/mdmfs.c
482
sfd = fdopen(fd, "r");
sbin/mksnap_ffs/mksnap_ffs.c
100
int fd, iovlen;
sbin/mksnap_ffs/mksnap_ffs.c
177
if ((fd = open(snapname, O_RDONLY)) < 0)
sbin/mksnap_ffs/mksnap_ffs.c
179
if (fstat(fd, &stbuf) != 0)
sbin/mksnap_ffs/mksnap_ffs.c
183
if (fchown(fd, -1, grp->gr_gid) != 0)
sbin/mksnap_ffs/mksnap_ffs.c
185
if (fchmod(fd, S_IRUSR | S_IRGRP) != 0)
sbin/mount_cd9660/mount_cd9660.c
204
int fd, ntocentries, i;
sbin/mount_cd9660/mount_cd9660.c
206
if ((fd = open(dev, O_RDONLY)) == -1)
sbin/mount_cd9660/mount_cd9660.c
208
if (ioctl(fd, CDIOREADTOCHEADER, &h) == -1) {
sbin/mount_cd9660/mount_cd9660.c
209
close(fd);
sbin/mount_cd9660/mount_cd9660.c
216
close(fd);
sbin/mount_cd9660/mount_cd9660.c
224
if (ioctl(fd, CDIOREADTOCENTRYS, (char *) &t) == -1) {
sbin/mount_cd9660/mount_cd9660.c
225
close(fd);
sbin/mount_cd9660/mount_cd9660.c
228
close(fd);
sbin/mount_fusefs/mount_fusefs.c
144
int fd = -1, fdx;
sbin/mount_fusefs/mount_fusefs.c
345
if ((fd = open(dev, O_RDWR)) < 0)
sbin/mount_fusefs/mount_fusefs.c
350
fd = fdx;
sbin/mount_fusefs/mount_fusefs.c
354
if (fd >= 0) {
sbin/mount_fusefs/mount_fusefs.c
358
if (fstat(fd, &sbuf) == -1)
sbin/mount_fusefs/mount_fusefs.c
379
if (fd < 0 && (fd = open(dev, O_RDWR)) < 0)
sbin/mount_fusefs/mount_fusefs.c
382
if (asprintf(&fds, "%d", fd) == -1)
sbin/mount_fusefs/mount_fusefs.c
422
sprintf(fdstr, "%d", fd);
sbin/natd/natd.c
104
static void DoAliasing (int fd, int direction);
sbin/natd/natd.c
106
static void HandleRoutingInfo (int fd);
sbin/natd/natd.c
129
static void DoGlobal (int fd);
sbin/natd/natd.c
509
static void DoGlobal (int fd)
sbin/natd/natd.c
524
origBytes = recvfrom (fd,
sbin/natd/natd.c
609
wrote = sendto (fd,
sbin/natd/natd.c
634
static void DoAliasing (int fd, int direction)
sbin/natd/natd.c
663
origBytes = recvfrom (fd,
sbin/natd/natd.c
768
wrote = sendto (fd,
sbin/natd/natd.c
793
static void HandleRoutingInfo (int fd)
sbin/natd/natd.c
800
bytes = read (fd, &ifMsg, sizeof ifMsg);
sbin/newfs_msdos/mkfs_msdos.c
256
int fd, fd1, rv;
sbin/newfs_msdos/mkfs_msdos.c
262
fd = fd1 = -1;
sbin/newfs_msdos/mkfs_msdos.c
277
fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
sbin/newfs_msdos/mkfs_msdos.c
278
if (fd == -1) {
sbin/newfs_msdos/mkfs_msdos.c
282
if (ftruncate(fd, o.create_size)) {
sbin/newfs_msdos/mkfs_msdos.c
286
} else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) {
sbin/newfs_msdos/mkfs_msdos.c
290
if (fstat(fd, &sb)) {
sbin/newfs_msdos/mkfs_msdos.c
310
if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) {
sbin/newfs_msdos/mkfs_msdos.c
335
if (getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb) == -1)
sbin/newfs_msdos/mkfs_msdos.c
773
n = write(fd, physbuf, chunksize);
sbin/newfs_msdos/mkfs_msdos.c
788
n = write(fd, physbuf, tailsize);
sbin/newfs_msdos/mkfs_msdos.c
798
if (fd != -1)
sbin/newfs_msdos/mkfs_msdos.c
799
close(fd);
sbin/newfs_msdos/mkfs_msdos.c
905
compute_geometry_from_file(int fd, const char *fname, struct disklabel *lp)
sbin/newfs_msdos/mkfs_msdos.c
910
if (fstat(fd, &st))
sbin/newfs_msdos/mkfs_msdos.c
925
getdiskinfo(int fd, const char *fname, const char *dtype, __unused int oflag,
sbin/newfs_msdos/mkfs_msdos.c
943
if (ioctl(fd, DIOCGMEDIASIZE, &ms) == -1) {
sbin/newfs_msdos/mkfs_msdos.c
945
compute_geometry_from_file(fd, fname, &dlp);
sbin/newfs_msdos/mkfs_msdos.c
947
} else if (ioctl(fd, FD_GTYPE, &type) != -1) {
sbin/newfs_msdos/mkfs_msdos.c
960
if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE,
sbin/newfs_msdos/mkfs_msdos.c
966
if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS,
sbin/newfs_msdos/mkfs_msdos.c
972
ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) {
sbin/newfs_msdos/mkfs_msdos.c
988
compute_geometry_from_file(fd, fname, &dlp);
sbin/nvmecontrol/devlist.c
103
if (read_namespace_data(fd, nsid, &nsdata) != 0)
sbin/nvmecontrol/devlist.c
120
print_controller_info(const char *name, int fd,
sbin/nvmecontrol/devlist.c
135
if (nvmf_connection_status(fd, &nvl) != 0) {
sbin/nvmecontrol/devlist.c
143
if (read_controller_data(fd, &cdata) != 0) {
sbin/nvmecontrol/devlist.c
148
if (ioctl(fd, NVME_GET_CONTROLLER_DATA, &cdata) == -1) {
sbin/nvmecontrol/devlist.c
162
if (nvmf_reconnect_params(fd, &nvl) == 0) {
sbin/nvmecontrol/devlist.c
196
int fd, ret;
sbin/nvmecontrol/devlist.c
200
ret = open_dev(name, &fd, 0, 0);
sbin/nvmecontrol/devlist.c
208
if (!print_controller_info(name, fd, &cdata)) {
sbin/nvmecontrol/devlist.c
209
close(fd);
sbin/nvmecontrol/devlist.c
221
scan_namespace(fd, ctrlr, nsid);
sbin/nvmecontrol/devlist.c
225
if (read_active_namespaces(fd, nsid, &nslist) != 0)
sbin/nvmecontrol/devlist.c
231
scan_namespace(fd, ctrlr, nsid);
sbin/nvmecontrol/devlist.c
238
close(fd);
sbin/nvmecontrol/devlist.c
96
scan_namespace(int fd, int ctrlr, uint32_t nsid)
sbin/nvmecontrol/disconnect.c
30
int error, fd;
sbin/nvmecontrol/disconnect.c
41
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/disconnect.c
42
get_nsid(fd, &path, NULL);
sbin/nvmecontrol/disconnect.c
43
close(fd);
sbin/nvmecontrol/fabrics.c
176
params->tcp.fd = s;
sbin/nvmecontrol/fabrics.c
203
params->tcp.fd = s;
sbin/nvmecontrol/firmware.c
104
read_logpage(fd, NVME_LOG_FIRMWARE_SLOT,
sbin/nvmecontrol/firmware.c
119
int fd;
sbin/nvmecontrol/firmware.c
124
if ((fd = open(path, O_RDONLY)) < 0)
sbin/nvmecontrol/firmware.c
126
if (fstat(fd, &sb) < 0)
sbin/nvmecontrol/firmware.c
146
if ((*size = read(fd, *buf, filesize)) < 0)
sbin/nvmecontrol/firmware.c
153
close(fd);
sbin/nvmecontrol/firmware.c
157
update_firmware(int fd, uint8_t *payload, int32_t payload_size, uint8_t fwug)
sbin/nvmecontrol/firmware.c
168
if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0)
sbin/nvmecontrol/firmware.c
188
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/firmware.c
201
activate_firmware(int fd, int slot, int activate_action)
sbin/nvmecontrol/firmware.c
211
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/firmware.c
230
int fd = -1;
sbin/nvmecontrol/firmware.c
270
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/firmware.c
271
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/firmware.c
273
close(fd);
sbin/nvmecontrol/firmware.c
274
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/firmware.c
278
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/firmware.c
300
!slot_has_valid_firmware(fd, opt.slot))
sbin/nvmecontrol/firmware.c
339
update_firmware(fd, buf, size, cdata.fwug);
sbin/nvmecontrol/firmware.c
348
reboot_required = activate_firmware(fd, opt.slot, activate_action);
sbin/nvmecontrol/firmware.c
364
close(fd);
sbin/nvmecontrol/firmware.c
99
slot_has_valid_firmware(int fd, int slot)
sbin/nvmecontrol/format.c
120
int lbaf, ms, pi, pil, ses, fd;
sbin/nvmecontrol/format.c
143
open_dev(target, &fd, 1, 1);
sbin/nvmecontrol/format.c
144
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/format.c
154
close(fd);
sbin/nvmecontrol/format.c
155
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/format.c
160
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/format.c
177
if (read_namespace_data(fd, nsid, &nsd))
sbin/nvmecontrol/format.c
208
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/format.c
213
close(fd);
sbin/nvmecontrol/identify.c
188
identify_ctrlr(int fd)
sbin/nvmecontrol/identify.c
193
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/identify.c
195
close(fd);
sbin/nvmecontrol/identify.c
212
identify_ns(int fd, uint32_t nsid)
sbin/nvmecontrol/identify.c
217
if (read_namespace_data(fd, nsid, &nsdata))
sbin/nvmecontrol/identify.c
219
close(fd);
sbin/nvmecontrol/identify.c
239
int fd;
sbin/nvmecontrol/identify.c
245
open_dev(opt.dev, &fd, 0, 1);
sbin/nvmecontrol/identify.c
246
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/identify.c
254
close(fd);
sbin/nvmecontrol/identify.c
255
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/identify.c
262
identify_ctrlr(fd);
sbin/nvmecontrol/identify.c
264
identify_ns(fd, nsid);
sbin/nvmecontrol/logpage.c
192
read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp,
sbin/nvmecontrol/logpage.c
221
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/logpage.c
717
int fd;
sbin/nvmecontrol/logpage.c
739
open_dev(opt.dev, &fd, 0, 1);
sbin/nvmecontrol/logpage.c
740
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/logpage.c
744
close(fd);
sbin/nvmecontrol/logpage.c
745
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/logpage.c
749
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/logpage.c
801
read_logpage(fd, opt.page, nsid, opt.lsp, opt.lsi, opt.rae,
sbin/nvmecontrol/logpage.c
805
close(fd);
sbin/nvmecontrol/modules/wdc/wdc.c
118
wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix)
sbin/nvmecontrol/modules/wdc/wdc.c
126
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/modules/wdc/wdc.c
137
wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd,
sbin/nvmecontrol/modules/wdc/wdc.c
154
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/modules/wdc/wdc.c
161
wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, uint32_t opcode,
sbin/nvmecontrol/modules/wdc/wdc.c
172
wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix);
sbin/nvmecontrol/modules/wdc/wdc.c
180
wdc_get_data(fd, opcode, len, offset, cmd, hdr, len, false);
sbin/nvmecontrol/modules/wdc/wdc.c
189
if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0)
sbin/nvmecontrol/modules/wdc/wdc.c
200
wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid, e6lg_flag);
sbin/nvmecontrol/modules/wdc/wdc.c
229
wdc_get_data_dui(int fd, uint32_t opcode, uint32_t len, uint64_t off,
sbin/nvmecontrol/modules/wdc/wdc.c
244
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/modules/wdc/wdc.c
267
wdc_get_dui_log_size(int fd, uint32_t opcode, uint8_t data_area,
sbin/nvmecontrol/modules/wdc/wdc.c
282
wdc_get_data_dui(fd, opcode, len, 0, hdr, len);
sbin/nvmecontrol/modules/wdc/wdc.c
321
wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area,
sbin/nvmecontrol/modules/wdc/wdc.c
331
wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix);
sbin/nvmecontrol/modules/wdc/wdc.c
332
wdc_get_dui_log_size(fd, opcode, data_area, &log_len, len_off);
sbin/nvmecontrol/modules/wdc/wdc.c
338
if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, &max_xfer_size) < 0)
sbin/nvmecontrol/modules/wdc/wdc.c
348
wdc_get_data_dui(fd, opcode, resid, offset, buf, resid);
sbin/nvmecontrol/modules/wdc/wdc.c
370
int fd;
sbin/nvmecontrol/modules/wdc/wdc.c
385
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/modules/wdc/wdc.c
386
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/modules/wdc/wdc.c
393
wdc_do_dump_e6(fd, tmpl, "cap_diag", WDC_NVME_CAP_DIAG_OPCODE_E6,
sbin/nvmecontrol/modules/wdc/wdc.c
397
wdc_do_dump_dui(fd, tmpl, opt.data_area, "cap_diag",
sbin/nvmecontrol/modules/wdc/wdc.c
403
close(fd);
sbin/nvmecontrol/ns.c
401
int fd, i;
sbin/nvmecontrol/ns.c
408
open_dev(active_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/ns.c
409
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
411
close(fd);
sbin/nvmecontrol/ns.c
412
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/ns.c
415
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
429
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
446
int fd, i;
sbin/nvmecontrol/ns.c
453
open_dev(active_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/ns.c
454
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
456
close(fd);
sbin/nvmecontrol/ns.c
457
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/ns.c
460
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
474
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
491
int fd, i, n;
sbin/nvmecontrol/ns.c
498
open_dev(controllers_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/ns.c
499
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
501
close(fd);
sbin/nvmecontrol/ns.c
502
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/ns.c
505
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
518
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
544
int fd, result;
sbin/nvmecontrol/ns.c
559
open_dev(create_opt.dev, &fd, 1, 1);
sbin/nvmecontrol/ns.c
560
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
562
close(fd);
sbin/nvmecontrol/ns.c
563
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
566
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
618
if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0)
sbin/nvmecontrol/ns.c
634
int fd, result;
sbin/nvmecontrol/ns.c
642
open_dev(delete_opt.dev, &fd, 1, 1);
sbin/nvmecontrol/ns.c
643
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
645
close(fd);
sbin/nvmecontrol/ns.c
646
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
648
close(fd);
sbin/nvmecontrol/ns.c
655
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
670
if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0)
sbin/nvmecontrol/ns.c
701
int fd, result;
sbin/nvmecontrol/ns.c
708
open_dev(attach_opt.dev, &fd, 1, 1);
sbin/nvmecontrol/ns.c
709
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
711
close(fd);
sbin/nvmecontrol/ns.c
712
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
714
close(fd);
sbin/nvmecontrol/ns.c
720
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
735
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
755
if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0)
sbin/nvmecontrol/ns.c
771
int fd, result;
sbin/nvmecontrol/ns.c
778
open_dev(detach_opt.dev, &fd, 1, 1);
sbin/nvmecontrol/ns.c
779
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
781
close(fd);
sbin/nvmecontrol/ns.c
782
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
784
close(fd);
sbin/nvmecontrol/ns.c
790
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
806
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
832
if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0)
sbin/nvmecontrol/ns.c
848
int fd, i, n;
sbin/nvmecontrol/ns.c
855
open_dev(attached_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/ns.c
856
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
858
close(fd);
sbin/nvmecontrol/ns.c
859
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
861
close(fd);
sbin/nvmecontrol/ns.c
867
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
881
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
901
int fd;
sbin/nvmecontrol/ns.c
908
open_dev(identify_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/ns.c
909
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/ns.c
911
close(fd);
sbin/nvmecontrol/ns.c
912
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/ns.c
914
close(fd);
sbin/nvmecontrol/ns.c
920
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/ns.c
935
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/ns.c
941
close(fd);
sbin/nvmecontrol/nsid.c
67
int fd;
sbin/nvmecontrol/nsid.c
73
open_dev(nsid_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/nsid.c
74
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/nsid.c
75
close(fd);
sbin/nvmecontrol/nvmecontrol.c
110
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/nvmecontrol.c
122
read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata)
sbin/nvmecontrol/nvmecontrol.c
134
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/nvmecontrol.c
146
read_active_namespaces(int fd, uint32_t nsid, struct nvme_ns_list *nslist)
sbin/nvmecontrol/nvmecontrol.c
158
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/nvmecontrol.c
170
open_dev(const char *str, int *fd, int write, int exit_on_error)
sbin/nvmecontrol/nvmecontrol.c
178
*fd = open(full_path, write ? O_RDWR : O_RDONLY);
sbin/nvmecontrol/nvmecontrol.c
179
if (*fd < 0) {
sbin/nvmecontrol/nvmecontrol.c
191
get_nsid(int fd, char **ctrlr_str, uint32_t *nsid)
sbin/nvmecontrol/nvmecontrol.c
195
if (ioctl(fd, NVME_GET_NSID, &gnsid) < 0)
sbin/nvmecontrol/nvmecontrol.c
99
read_controller_data(int fd, struct nvme_controller_data *cdata)
sbin/nvmecontrol/nvmecontrol.h
80
int open_dev(const char *str, int *fd, int write, int exit_on_error);
sbin/nvmecontrol/nvmecontrol.h
81
void get_nsid(int fd, char **ctrlr_str, uint32_t *nsid);
sbin/nvmecontrol/nvmecontrol.h
82
int read_controller_data(int fd, struct nvme_controller_data *cdata);
sbin/nvmecontrol/nvmecontrol.h
83
int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata);
sbin/nvmecontrol/nvmecontrol.h
84
int read_active_namespaces(int fd, uint32_t nsid, struct nvme_ns_list *nslist);
sbin/nvmecontrol/nvmecontrol.h
87
void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp,
sbin/nvmecontrol/passthru.c
157
int fd = -1, ifd = -1;
sbin/nvmecontrol/passthru.c
164
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/passthru.c
243
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/passthru.c
257
close(fd);
sbin/nvmecontrol/perftest.c
137
int fd;
sbin/nvmecontrol/perftest.c
179
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/perftest.c
180
if (ioctl(fd, ioctl_cmd, &io_test) < 0)
sbin/nvmecontrol/perftest.c
183
close(fd);
sbin/nvmecontrol/power.c
102
power_set(int fd, int power_val, int workload, int perm)
sbin/nvmecontrol/power.c
113
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/power.c
121
power_show(int fd)
sbin/nvmecontrol/power.c
129
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/power.c
143
int fd;
sbin/nvmecontrol/power.c
155
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/power.c
156
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/power.c
158
close(fd);
sbin/nvmecontrol/power.c
159
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/power.c
164
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/power.c
171
power_set(fd, opt.power, opt.workload, 0);
sbin/nvmecontrol/power.c
174
power_show(fd);
sbin/nvmecontrol/power.c
177
close(fd);
sbin/nvmecontrol/reconnect.c
107
reconnect_by_address(int fd, const nvlist_t *rparams, const char *addr)
sbin/nvmecontrol/reconnect.c
143
error = reconnect_nvm_controller(fd, &aparams, trtype, AF_UNSPEC,
sbin/nvmecontrol/reconnect.c
153
reconnect_by_params(int fd, const nvlist_t *rparams)
sbin/nvmecontrol/reconnect.c
201
error = reconnect_nvm_controller(fd, &aparams, dle->trtype, adrfam,
sbin/nvmecontrol/reconnect.c
216
fetch_and_validate_rparams(int fd, nvlist_t **rparamsp)
sbin/nvmecontrol/reconnect.c
223
error = nvmf_reconnect_params(fd, &rparams);
sbin/nvmecontrol/reconnect.c
270
int error, fd;
sbin/nvmecontrol/reconnect.c
275
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/reconnect.c
276
error = fetch_and_validate_rparams(fd, &rparams);
sbin/nvmecontrol/reconnect.c
282
error = reconnect_by_address(fd, rparams, argv[optind]);
sbin/nvmecontrol/reconnect.c
284
error = reconnect_by_params(fd, rparams);
sbin/nvmecontrol/reconnect.c
289
close(fd);
sbin/nvmecontrol/reconnect.c
63
reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams,
sbin/nvmecontrol/reconnect.c
95
error = nvmf_reconnect_host(fd, dle, hostnqn, admin, num_io_queues, io,
sbin/nvmecontrol/reset.c
56
int fd;
sbin/nvmecontrol/reset.c
62
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/reset.c
63
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/reset.c
65
close(fd);
sbin/nvmecontrol/reset.c
66
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/reset.c
70
if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
sbin/nvmecontrol/resv.c
238
int fd;
sbin/nvmecontrol/resv.c
243
open_dev(acquire_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/resv.c
244
get_nsid(fd, NULL, &nsid);
sbin/nvmecontrol/resv.c
262
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/resv.c
268
close(fd);
sbin/nvmecontrol/resv.c
277
int fd;
sbin/nvmecontrol/resv.c
282
open_dev(register_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/resv.c
283
get_nsid(fd, NULL, &nsid);
sbin/nvmecontrol/resv.c
301
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/resv.c
307
close(fd);
sbin/nvmecontrol/resv.c
316
int fd;
sbin/nvmecontrol/resv.c
321
open_dev(release_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/resv.c
322
get_nsid(fd, NULL, &nsid);
sbin/nvmecontrol/resv.c
339
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/resv.c
345
close(fd);
sbin/nvmecontrol/resv.c
356
int fd;
sbin/nvmecontrol/resv.c
362
open_dev(report_opt.dev, &fd, 0, 1);
sbin/nvmecontrol/resv.c
363
get_nsid(fd, NULL, &nsid);
sbin/nvmecontrol/resv.c
379
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/resv.c
385
close(fd);
sbin/nvmecontrol/sanitize.c
114
int sanact = 0, fd, delay = 1;
sbin/nvmecontrol/sanitize.c
146
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/sanitize.c
147
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/sanitize.c
149
close(fd);
sbin/nvmecontrol/sanitize.c
150
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/sanitize.c
158
if (read_controller_data(fd, &cd))
sbin/nvmecontrol/sanitize.c
180
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/sanitize.c
187
read_logpage(fd, NVME_LOG_SANITIZE_STATUS,
sbin/nvmecontrol/sanitize.c
219
close(fd);
sbin/nvmecontrol/selftest.c
105
selftest_op(fd, nsid, opt.stc);
sbin/nvmecontrol/selftest.c
107
close(fd);
sbin/nvmecontrol/selftest.c
56
selftest_op(int fd, uint32_t nsid, uint8_t stc)
sbin/nvmecontrol/selftest.c
65
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
sbin/nvmecontrol/selftest.c
79
int fd;
sbin/nvmecontrol/selftest.c
86
open_dev(opt.dev, &fd, 1, 1);
sbin/nvmecontrol/selftest.c
87
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/selftest.c
89
close(fd);
sbin/nvmecontrol/selftest.c
90
open_dev(path, &fd, 1, 1);
sbin/nvmecontrol/selftest.c
99
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/telemetry.c
116
open_dev(opt.dev, &fd, 0, 1);
sbin/nvmecontrol/telemetry.c
117
get_nsid(fd, &path, &nsid);
sbin/nvmecontrol/telemetry.c
121
close(fd);
sbin/nvmecontrol/telemetry.c
122
open_dev(path, &fd, 0, 1);
sbin/nvmecontrol/telemetry.c
126
if (read_controller_data(fd, &cdata))
sbin/nvmecontrol/telemetry.c
142
read_logpage(fd, NVME_LOG_TELEMETRY_HOST_INITIATED, nsid, 0, 0, 1,
sbin/nvmecontrol/telemetry.c
174
read_logpage(fd, NVME_LOG_TELEMETRY_HOST_INITIATED, nsid, 0, 0, 1,
sbin/nvmecontrol/telemetry.c
188
close(fd);
sbin/nvmecontrol/telemetry.c
99
int fd, fdout;
sbin/pfctl/parse.y
7579
check_file_secrecy(int fd, const char *fname)
sbin/pfctl/parse.y
7583
if (fstat(fd, &st)) {
sbin/pfctl/tests/pfctl_test.c
71
read_fd(int fd, size_t sizehint)
sbin/pfctl/tests/pfctl_test.c
79
while ((count = read(fd, buffer, sizeof(buffer) - 1)) > 0) {
sbin/pfctl/tests/pfctl_test.c
92
int fd;
sbin/pfctl/tests/pfctl_test.c
96
fd = open(filename, O_RDONLY);
sbin/pfctl/tests/pfctl_test.c
97
ATF_REQUIRE_ERRNO(0, fd > 0);
sbin/pfctl/tests/pfctl_test.c
98
result = read_fd(fd, s.st_size);
sbin/pfctl/tests/pfctl_test.c
99
ATF_REQUIRE_ERRNO(0, close(fd) == 0);
sbin/ping/ping6.c
1161
pfd.fd = srecv;
sbin/reboot/reboot.c
123
int fd, tmpfd;
sbin/reboot/reboot.c
161
if ((fd = open(fn, O_RDONLY)) < 0) {
sbin/reboot/reboot.c
166
ret = copy_file_range(fd, NULL, tmpfd, NULL,
sbin/reboot/reboot.c
171
close(fd);
sbin/recoverdisk/recoverdisk.c
395
write_buf(int fd, const void *buf, uint64_t length, uint64_t where)
sbin/recoverdisk/recoverdisk.c
399
i = pwrite(fd, buf, length, (off_t)where);
sbin/restore/dirs.c
131
int i, fd;
sbin/restore/dirs.c
141
fd = mkstemp(dirfile);
sbin/restore/dirs.c
143
fd = open(dirfile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/restore/dirs.c
144
if (fd == -1 || (df = fdopen(fd, "w")) == NULL) {
sbin/restore/dirs.c
145
if (fd != -1)
sbin/restore/dirs.c
146
close(fd);
sbin/restore/dirs.c
155
fd = mkstemp(modefile);
sbin/restore/dirs.c
157
fd = open(modefile, O_RDWR|O_CREAT|O_EXCL, 0666);
sbin/restore/dirs.c
158
if (fd == -1 || (mf = fdopen(fd, "w")) == NULL) {
sbin/restore/dirs.c
159
if (fd != -1)
sbin/restore/dirs.c
160
close(fd);
sbin/restore/dirs.c
535
int fd;
sbin/restore/dirs.c
537
if ((fd = open(name, O_RDONLY)) == -1)
sbin/restore/dirs.c
540
(void)close(fd);
sbin/restore/dirs.c
543
dirp->dd_fd = fd;
sbin/restore/symtab.c
438
FILE *fd;
sbin/restore/symtab.c
444
if ((fd = fopen(filename, "w")) == NULL) {
sbin/restore/symtab.c
450
clearerr(fd);
sbin/restore/symtab.c
459
(int)allocsize(ep->e_namlen), fd);
sbin/restore/symtab.c
485
(void) fwrite((char *)tep, sizeof(struct entry), 1, fd);
sbin/restore/symtab.c
496
(void) fwrite((char *)&tentry, sizeof(struct entry *), 1, fd);
sbin/restore/symtab.c
505
(void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd);
sbin/restore/symtab.c
506
if (ferror(fd)) {
sbin/restore/symtab.c
511
(void) fclose(fd);
sbin/restore/symtab.c
527
int fd;
sbin/restore/symtab.c
539
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
sbin/restore/symtab.c
543
if (fstat(fd, &stbuf) < 0) {
sbin/restore/symtab.c
551
if (read(fd, base, (int)tblsize) < 0 ||
sbin/restore/symtab.c
552
read(fd, (char *)&hdr, sizeof(struct symtableheader)) < 0) {
sbin/restore/symtab.c
556
(void)close(fd);
sbin/restore/tape.c
728
set_extattr(int fd, char *name, void *buf, int size, enum set_extattr_mode mode)
sbin/restore/tape.c
760
res = extattr_set_fd(fd, eap->ea_namespace,
sbin/restore/tape.c
787
error = acl_set_fd(fd, EXTATTR_CONTENT(eap));
sbin/route/route_netlink.c
833
setsockopt(ss_event.fd, SOL_NETLINK, NETLINK_MSG_INFO, &optval, optlen);
sbin/route/route_netlink.c
839
error = setsockopt(ss_event.fd, SOL_NETLINK,
sbin/routed/trace.c
179
int fd;
sbin/routed/trace.c
189
fd = open(_PATH_DEVNULL, O_RDWR);
sbin/routed/trace.c
190
if (fd < 0)
sbin/routed/trace.c
193
(void)dup2(fd, STDIN_FILENO);
sbin/routed/trace.c
195
(void)dup2(fd, STDOUT_FILENO);
sbin/routed/trace.c
197
(void)dup2(fd, STDERR_FILENO);
sbin/routed/trace.c
198
(void)close(fd);
sbin/savecore/savecore.c
140
int error, fd;
sbin/savecore/savecore.c
149
fd = openat(dirfd, path, flags, mode);
sbin/savecore/savecore.c
150
if (fd < 0)
sbin/savecore/savecore.c
152
fp = fdopen(fd, modestr);
sbin/savecore/savecore.c
155
(void)close(fd);
sbin/savecore/savecore.c
291
int fd;
sbin/savecore/savecore.c
293
fd = openat(savedirfd, keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
sbin/savecore/savecore.c
294
if (fd == -1) {
sbin/savecore/savecore.c
300
if (write(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) {
sbin/savecore/savecore.c
302
close(fd);
sbin/savecore/savecore.c
306
close(fd);
sbin/savecore/savecore.c
615
DoRegularFile(int fd, off_t dumpsize, u_int sectorsize, bool sparse,
sbin/savecore/savecore.c
653
nr = read(fd, buf, roundup(wl, sectorsize));
sbin/savecore/savecore.c
702
DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, char *buf,
sbin/savecore/savecore.c
718
nr = pread(fd, buf, wl, lasthd - (totsize - dumpsize) - wl);
sbin/savecore/savecore.c
792
marg.fd = fdcore;
sbin/swapon/swapon.c
420
int fd, mdunit, error;
sbin/swapon/swapon.c
430
fd = -1;
sbin/swapon/swapon.c
473
error = run_cmd(&fd, "%s -l -n -f %s",
sbin/swapon/swapon.c
477
close(fd);
sbin/swapon/swapon.c
484
error = run_cmd(&fd, "%s -a -t vnode -n -f %s",
sbin/swapon/swapon.c
492
sfd = fdopen(fd, "r");
sbin/swapon/swapon.c
520
error = run_cmd(&fd, "%s -l -n -f %s -u %d",
sbin/swapon/swapon.c
524
close(fd);
sbin/swapon/swapon.c
542
error = run_cmd(&fd, "%s -l -n -f %s",
sbin/swapon/swapon.c
546
close(fd);
sbin/swapon/swapon.c
553
sfd = fdopen(fd, "r");
sbin/swapon/swapon.c
584
error = run_cmd(&fd, "%s -l -n -f %s -u %d",
sbin/swapon/swapon.c
588
close(fd);
sbin/swapon/swapon.c
623
if (fd != -1)
sbin/swapon/swapon.c
624
close(fd);
sbin/swapon/swapon.c
709
int error, fd;
sbin/swapon/swapon.c
712
fd = open(name, O_WRONLY);
sbin/swapon/swapon.c
713
if (fd < 0)
sbin/swapon/swapon.c
716
if (fstat(fd, &sb) < 0)
sbin/swapon/swapon.c
721
if (ioctl(fd, DIOCGMEDIASIZE, &sz) != 0)
sbin/swapon/swapon.c
728
if (ioctl(fd, DIOCGDELETE, ioarg) != 0)
sbin/swapon/swapon.c
741
close(fd);
sbin/umbctl/umbctl.c
135
static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request,
sbin/umbctl/umbctl.c
190
int fd;
sbin/umbctl/umbctl.c
195
if((fd = _umbctl_socket()) < 0)
sbin/umbctl/umbctl.c
203
if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0
sbin/umbctl/umbctl.c
205
|| _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM,
sbin/umbctl/umbctl.c
208
close(fd);
sbin/umbctl/umbctl.c
215
if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0)
sbin/umbctl/umbctl.c
217
close(fd);
sbin/umbctl/umbctl.c
222
if(close(fd) != 0)
sbin/umbctl/umbctl.c
234
int fd;
sbin/umbctl/umbctl.c
239
if((fd = _umbctl_socket()) < 0)
sbin/umbctl/umbctl.c
245
if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0
sbin/umbctl/umbctl.c
247
|| _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM, &ifr) != 0)
sbin/umbctl/umbctl.c
249
close(fd);
sbin/umbctl/umbctl.c
255
if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0)
sbin/umbctl/umbctl.c
257
close(fd);
sbin/umbctl/umbctl.c
262
if(close(fd) != 0)
sbin/umbctl/umbctl.c
348
static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request,
sbin/umbctl/umbctl.c
351
if(ioctl(fd, request, ifr) != 0)
sbin/umbctl/umbctl.c
491
int fd;
sbin/umbctl/umbctl.c
493
if((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
sbin/umbctl/umbctl.c
495
return fd;
sbin/umount/umount.c
674
int fd;
sbin/umount/umount.c
691
fd = open(DEV_MDCTL, O_RDWR, 0);
sbin/umount/umount.c
692
if (fd < 0) {
sbin/umount/umount.c
697
if (ioctl(fd, MDIOCDETACH, &mdio) < 0) {
sbin/umount/umount.c
699
close(fd);
sbin/umount/umount.c
703
close(fd);
share/examples/ipfilter/l4check/l4check.c
180
int n, i, fd;
share/examples/ipfilter/l4check/l4check.c
182
fd = l4->l4_fd;
share/examples/ipfilter/l4check/l4check.c
191
i = send(fd, l4->l4_wptr, n, 0);
share/examples/ipfilter/l4check/l4check.c
195
fd, strerror(errno));
share/examples/ipfilter/l4check/l4check.c
203
fprintf(stderr, "Sent %d bytes to fd %d\n", i, fd);
share/examples/ipfilter/l4check/l4check.c
211
int n, i, fd;
share/examples/ipfilter/l4check/l4check.c
213
fd = l4->l4_fd;
share/examples/ipfilter/l4check/l4check.c
230
n, fd, ptr);
share/examples/ipfilter/l4check/l4check.c
231
i = recv(fd, ptr, n, 0);
share/examples/ipfilter/l4check/l4check.c
235
fd, (i == 0) ? "EOF" : strerror(errno));
share/examples/ipfilter/l4check/l4check.c
242
fd, i, i, i, ptr);
share/examples/ipfilter/l4check/l4check.c
249
fd);
share/examples/ipfilter/l4check/l4check.c
258
fd);
share/examples/ipfilter/l4check/l4check.c
274
int fd, opt, res, mfd, i;
share/examples/ipfilter/l4check/l4check.c
290
fd = socket(AF_INET, SOCK_STREAM, 0);
share/examples/ipfilter/l4check/l4check.c
291
if (fd == -1)
share/examples/ipfilter/l4check/l4check.c
293
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt,
share/examples/ipfilter/l4check/l4check.c
296
if ((res = fcntl(fd, F_GETFL, 0)) != -1)
share/examples/ipfilter/l4check/l4check.c
297
fcntl(fd, F_SETFL, res | O_NONBLOCK);
share/examples/ipfilter/l4check/l4check.c
303
ntohs(l4->l4_sin.sin_port), fd);
share/examples/ipfilter/l4check/l4check.c
304
if (connect(fd, (struct sockaddr *)&l4->l4_sin,
share/examples/ipfilter/l4check/l4check.c
310
close(fd);
share/examples/ipfilter/l4check/l4check.c
311
fd = -1;
share/examples/ipfilter/l4check/l4check.c
322
l4->l4_fd = fd;
share/examples/ipfilter/l4check/l4check.c
455
int fd;
share/examples/ipfilter/l4check/l4check.c
457
fd = open(file, O_RDONLY);
share/examples/ipfilter/l4check/l4check.c
458
if (fd == -1) {
share/examples/ipfilter/l4check/l4check.c
463
if (fstat(fd, &sb) == -1) {
share/examples/ipfilter/l4check/l4check.c
465
close(fd);
share/examples/ipfilter/l4check/l4check.c
469
addr = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
share/examples/ipfilter/l4check/l4check.c
472
close(fd);
share/examples/ipfilter/l4check/l4check.c
475
close(fd);
share/examples/ipfilter/samples/proxy.c
101
fd = open(IPNAT_NAME, O_RDONLY);
share/examples/ipfilter/samples/proxy.c
102
if (ioctl(fd, SIOCGNATL, &obj) == -1) {
share/examples/ipfilter/samples/proxy.c
110
do_nat_out(0, 1, fd, &natlook, argv[1]);
share/examples/ipfilter/samples/proxy.c
133
do_nat_out(in, out, fd, nlp, extif)
share/examples/ipfilter/samples/proxy.c
134
int fd;
share/examples/ipfilter/samples/proxy.c
209
if (ioctl(fd, SIOCSTLCK, &onoff) == 0) {
share/examples/ipfilter/samples/proxy.c
210
if (ioctl(fd, SIOCSTPUT, &obj) != 0)
share/examples/ipfilter/samples/proxy.c
213
if (ioctl(fd, SIOCSTLCK, &onoff) != 0)
share/examples/ipfilter/samples/proxy.c
60
int namelen, fd, n;
share/examples/ipfilter/samples/relay.c
112
int fd, sl = sizeof(sl), se;
share/examples/ipfilter/samples/relay.c
115
if ((fd = open(IPNAT_NAME, O_RDONLY)) == -1) {
share/examples/ipfilter/samples/relay.c
160
if (ioctl(fd, SIOCGNATL, &obj) == -1) {
share/examples/ipfilter/samples/relay.c
172
fd = socket(AF_INET, SOCK_STREAM, 0);
share/examples/ipfilter/samples/relay.c
173
if (connect(fd, (struct sockaddr *)&sin, sl) == -1) {
share/examples/ipfilter/samples/relay.c
181
(void) ioctl(fd, F_SETFL, ioctl(fd, F_GETFL, 0)|O_NONBLOCK);
share/examples/ipfilter/samples/relay.c
182
(void) ioctl(0, F_SETFL, ioctl(fd, F_GETFL, 0)|O_NONBLOCK);
share/examples/ipfilter/samples/relay.c
183
(void) ioctl(1, F_SETFL, ioctl(fd, F_GETFL, 0)|O_NONBLOCK);
share/examples/ipfilter/samples/relay.c
187
if (relay(0, 1, fd) == -1) {
share/examples/ipfilter/samples/userauth.c
23
int fd;
share/examples/ipfilter/samples/userauth.c
25
fd = open(IPL_NAME, O_RDWR);
share/examples/ipfilter/samples/userauth.c
28
while (ioctl(fd, SIOCAUTHW, &frap) == 0) {
share/examples/ipfilter/samples/userauth.c
56
if (ioctl(fd, SIOCAUTHR, &frap) != 0)
share/examples/ses/srcs/chpmon.c
101
(void) close(fd);
share/examples/ses/srcs/chpmon.c
116
if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
share/examples/ses/srcs/chpmon.c
120
(void) close(fd);
share/examples/ses/srcs/chpmon.c
51
int fd, delay, dev;
share/examples/ses/srcs/chpmon.c
69
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/chpmon.c
70
if (fd < 0) {
share/examples/ses/srcs/chpmon.c
79
if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
share/examples/ses/srcs/chpmon.c
82
(void) close(fd);
share/examples/ses/srcs/chpmon.c
88
if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
share/examples/ses/srcs/chpmon.c
91
(void) close(fd);
share/examples/ses/srcs/getencstat.c
105
(void) close(fd);
share/examples/ses/srcs/getencstat.c
135
(void) close(fd);
share/examples/ses/srcs/getencstat.c
138
if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) {
share/examples/ses/srcs/getencstat.c
140
(void) close(fd);
share/examples/ses/srcs/getencstat.c
145
if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &ob) < 0) {
share/examples/ses/srcs/getencstat.c
147
(void) close(fd);
share/examples/ses/srcs/getencstat.c
156
(void) close(fd);
share/examples/ses/srcs/getencstat.c
159
if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t)&objd) < 0) {
share/examples/ses/srcs/getencstat.c
161
(void) close(fd);
share/examples/ses/srcs/getencstat.c
170
(void) close(fd);
share/examples/ses/srcs/getencstat.c
177
(void)ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t)&objdn);
share/examples/ses/srcs/getencstat.c
192
(void) close(fd);
share/examples/ses/srcs/getencstat.c
55
int fd, nobj, f, i, verbose, quiet, errors;
share/examples/ses/srcs/getencstat.c
77
fd = open(*v, O_RDONLY);
share/examples/ses/srcs/getencstat.c
78
if (fd < 0) {
share/examples/ses/srcs/getencstat.c
85
if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0)
share/examples/ses/srcs/getencstat.c
89
if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0)
share/examples/ses/srcs/getencstat.c
92
if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) {
share/examples/ses/srcs/getencstat.c
94
(void) close(fd);
share/examples/ses/srcs/getencstat.c
97
if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) {
share/examples/ses/srcs/getencstat.c
99
(void) close(fd);
share/examples/ses/srcs/getnobj.c
49
int fd;
share/examples/ses/srcs/getnobj.c
53
fd = open(name, O_RDONLY);
share/examples/ses/srcs/getnobj.c
54
if (fd < 0) {
share/examples/ses/srcs/getnobj.c
58
if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
share/examples/ses/srcs/getnobj.c
63
close (fd);
share/examples/ses/srcs/getobjmap.c
50
int nobj, fd, i;
share/examples/ses/srcs/getobjmap.c
53
fd = open(*v, O_RDONLY);
share/examples/ses/srcs/getobjmap.c
54
if (fd < 0) {
share/examples/ses/srcs/getobjmap.c
58
if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
share/examples/ses/srcs/getobjmap.c
60
(void) close(fd);
share/examples/ses/srcs/getobjmap.c
65
(void) close(fd);
share/examples/ses/srcs/getobjmap.c
71
(void) close(fd);
share/examples/ses/srcs/getobjmap.c
74
if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) {
share/examples/ses/srcs/getobjmap.c
76
(void) close(fd);
share/examples/ses/srcs/getobjmap.c
84
(void) close(fd);
share/examples/ses/srcs/getobjstat.c
46
int fd;
share/examples/ses/srcs/getobjstat.c
57
fd = open(v[1], O_RDONLY);
share/examples/ses/srcs/getobjstat.c
58
if (fd < 0) {
share/examples/ses/srcs/getobjstat.c
68
if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &obj) < 0) {
share/examples/ses/srcs/getobjstat.c
74
(void) close(fd);
share/examples/ses/srcs/inienc.c
47
int fd;
share/examples/ses/srcs/inienc.c
50
fd = open(*v, O_RDWR);
share/examples/ses/srcs/inienc.c
51
if (fd < 0) {
share/examples/ses/srcs/inienc.c
55
if (ioctl(fd, SESIOC_INIT, NULL) < 0) {
share/examples/ses/srcs/inienc.c
58
(void) close(fd);
share/examples/ses/srcs/sesd.c
100
if (fd < 0) {
share/examples/ses/srcs/sesd.c
104
if (ioctl(fd, ENCIOC_INIT, NULL) < 0) {
share/examples/ses/srcs/sesd.c
109
(void) close(fd);
share/examples/ses/srcs/sesd.c
123
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/sesd.c
124
if (fd < 0) {
share/examples/ses/srcs/sesd.c
132
if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
share/examples/ses/srcs/sesd.c
135
(void) close(fd);
share/examples/ses/srcs/sesd.c
140
if (ioctl(fd, ENCIOC_SETENCSTAT,
share/examples/ses/srcs/sesd.c
146
(void) close(fd);
share/examples/ses/srcs/sesd.c
59
int fd, polltime, dev, nodaemon, clear, c;
share/examples/ses/srcs/sesd.c
99
fd = open(v[dev], O_RDWR);
share/examples/ses/srcs/setencstat.c
47
int fd;
share/examples/ses/srcs/setencstat.c
55
fd = open(v[1], O_RDWR);
share/examples/ses/srcs/setencstat.c
56
if (fd < 0) {
share/examples/ses/srcs/setencstat.c
63
if (ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
share/examples/ses/srcs/setencstat.c
66
(void) close(fd);
share/examples/ses/srcs/setobjstat.c
47
int fd;
share/examples/ses/srcs/setobjstat.c
59
fd = open(v[1], O_RDWR);
share/examples/ses/srcs/setobjstat.c
60
if (fd < 0) {
share/examples/ses/srcs/setobjstat.c
78
if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &obj) < 0) {
share/examples/ses/srcs/setobjstat.c
81
(void) close(fd);
share/examples/sound/kqueue.c
49
EV_SET(&event, config.fd, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0);
share/examples/sound/kqueue.c
61
if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/kqueue.c
65
if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/kqueue.c
70
EV_SET(&event, config.fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0);
share/examples/sound/kqueue.c
76
close(config.fd);
share/examples/sound/midi.c
47
int fd;
share/examples/sound/midi.c
50
if ((fd = open("/dev/umidi0.0", O_RDWR)) < 0)
share/examples/sound/midi.c
54
if (read(fd, &raw, sizeof(raw)) < sizeof(raw))
share/examples/sound/midi.c
62
if (read(fd, &b1, sizeof(b1)) < sizeof(b1))
share/examples/sound/midi.c
64
if (read(fd, &b2, sizeof(b2)) < sizeof(b2))
share/examples/sound/midi.c
86
close(fd);
share/examples/sound/mmap.c
140
if (ioctl(config_in.fd, SNDCTL_DSP_SYNCGROUP, &sync_group) < 0)
share/examples/sound/mmap.c
143
if (ioctl(config_out.fd, SNDCTL_DSP_SYNCGROUP, &sync_group) < 0)
share/examples/sound/mmap.c
145
if (ioctl(config_in.fd, SNDCTL_DSP_SYNCSTART, &sync_group.id) < 0)
share/examples/sound/mmap.c
152
EV_SET(&ev, config_in.fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
share/examples/sound/mmap.c
215
close(config_in.fd);
share/examples/sound/mmap.c
216
close(config_out.fd);
share/examples/sound/oss.h
110
if (ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp) < 0)
share/examples/sound/oss.h
116
if (ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp) < 0)
share/examples/sound/oss.h
124
if (ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0)
share/examples/sound/oss.h
132
if (ioctl(config->fd, SNDCTL_DSP_SPEED, &config->sample_rate) < 0)
share/examples/sound/oss.h
192
if (ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp) < 0)
share/examples/sound/oss.h
198
if (ioctl(config->fd, request, &config->buffer_info) < 0)
share/examples/sound/oss.h
240
config->buf = mmap(NULL, config->buffer_info.bytes, prot, MAP_SHARED, config->fd, 0);
share/examples/sound/oss.h
249
if (ioctl(config->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0)
share/examples/sound/oss.h
45
int fd;
share/examples/sound/oss.h
90
if ((config->fd = open(config->device, config->mode)) < 0)
share/examples/sound/oss.h
94
if (ioctl(config->fd, SNDCTL_ENGINEINFO, &config->audio_info) < 0)
share/examples/sound/oss.h
98
if (ioctl(config->fd, SNDCTL_DSP_GETCAPS, &config->audio_info.caps) < 0)
share/examples/sound/poll.c
48
pfds[0].fd = config.fd;
share/examples/sound/poll.c
53
if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/poll.c
58
if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/poll.c
67
close(config.fd);
share/examples/sound/select.c
49
FD_SET(config.fd, &fds);
share/examples/sound/select.c
50
if (select(config.fd + 1, &fds, NULL, NULL, NULL) < 0)
share/examples/sound/select.c
52
if (FD_ISSET(config.fd, &fds)) {
share/examples/sound/select.c
53
if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/select.c
58
if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/select.c
67
close(config.fd);
share/examples/sound/simple.c
126
if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/simple.c
140
if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
share/examples/sound/simple.c
148
close(config.fd);
share/examples/sound/sndstat_nv.c
203
close(fd);
share/examples/sound/sndstat_nv.c
56
int fd, pchan, rchan;
share/examples/sound/sndstat_nv.c
58
if ((fd = open("/dev/sndstat", O_RDONLY)) < 0)
share/examples/sound/sndstat_nv.c
61
if (ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL) < 0)
share/examples/sound/sndstat_nv.c
66
if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0)
share/examples/sound/sndstat_nv.c
72
if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0)
share/syscons/scrnmaps/mkscrfil.c
37
FILE *fd;
share/syscons/scrnmaps/mkscrfil.c
40
if ((fd = fopen(argv[1], "w")) == NULL) {
share/syscons/scrnmaps/mkscrfil.c
44
fwrite(&scrmap, sizeof(scrmap_t), 1, fd);
share/syscons/scrnmaps/mkscrfil.c
45
fclose(fd);
stand/common/boot.c
323
int fd, error;
stand/common/boot.c
330
if ((fd = open(lbuf, O_RDONLY)) < 0)
stand/common/boot.c
336
while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) {
stand/common/boot.c
395
close(fd);
stand/common/bootstrap.h
76
int kern_pread(readin_handle_t fd, vm_offset_t dest, size_t len, off_t off);
stand/common/bootstrap.h
77
void *alloc_pread(readin_handle_t fd, off_t off, size_t len);
stand/common/commands.c
547
int fd;
stand/common/commands.c
559
if ((fd = open(argv[1], O_RDONLY)) < 0) {
stand/common/commands.c
564
while ((rv = read(fd, buf, sizeof(buf))) > 0)
stand/common/commands.c
569
close(fd);
stand/common/commands.c
61
help_getnext(int fd, char **topic, char **subtopic, char **desc)
stand/common/commands.c
68
if (fgetstr(line, 80, fd) < 0)
stand/common/gfx_fb.c
2553
load_mapping(int fd, struct vt_font *fp, int n)
stand/common/gfx_fb.c
2568
rv = read(fd, mp, size);
stand/common/gfx_fb.c
2615
int fd, i;
stand/common/gfx_fb.c
2636
fd = -1;
stand/common/gfx_fb.c
2680
fd = open(path, O_RDONLY);
stand/common/gfx_fb.c
2681
if (fd < 0)
stand/common/gfx_fb.c
2685
rv = read(fd, &fh, size);
stand/common/gfx_fb.c
2710
rv = read(fd, fp->vf_bytes, size);
stand/common/gfx_fb.c
2714
if (load_mapping(fd, fp, i) != 0)
stand/common/gfx_fb.c
2745
if (fd != -1)
stand/common/gfx_fb.c
2746
close(fd);
stand/common/gfx_fb.c
2773
int fd, len;
stand/common/gfx_fb.c
2784
fd = open(fonts, O_RDONLY);
stand/common/gfx_fb.c
2785
if (fd < 0)
stand/common/gfx_fb.c
2790
close(fd);
stand/common/gfx_fb.c
2795
while ((len = fgetstr(buf, sizeof (buf), fd)) >= 0) {
stand/common/gfx_fb.c
2813
close(fd);
stand/common/gfx_fb.c
2818
close(fd);
stand/common/gfx_fb.c
2823
close(fd);
stand/common/gfx_fb.c
2839
int fd;
stand/common/gfx_fb.c
2863
fd = open(name, O_RDONLY);
stand/common/gfx_fb.c
2864
if (fd < 0)
stand/common/gfx_fb.c
2866
rv = read(fd, &fh, sizeof(fh));
stand/common/gfx_fb.c
2867
close(fd);
stand/common/gfx_fb.c
3204
struct vt_font *fd;
stand/common/gfx_fb.c
3240
fd = bd->vfbd_font;
stand/common/gfx_fb.c
3242
fi.fi_width = fd->vf_width;
stand/common/gfx_fb.c
3244
fi.fi_height = fd->vf_height;
stand/common/gfx_fb.c
3251
fi.fi_map_count[i] = fd->vf_map_count[i];
stand/common/gfx_fb.c
3253
size += fd->vf_map_count[i] * sizeof (struct vfnt_map);
stand/common/gfx_fb.c
3270
if (fd->vf_map_count[i] != 0) {
stand/common/gfx_fb.c
3271
addr += archsw.arch_copyin(fd->vf_map[i], addr,
stand/common/gfx_fb.c
3272
fd->vf_map_count[i] * sizeof (struct vfnt_map));
stand/common/gfx_fb.c
3278
addr += archsw.arch_copyin(fd->vf_bytes, addr, fi.fi_bitmap_size);
stand/common/install.c
102
read_metatags(int fd)
stand/common/install.c
109
fsize = read(fd, buf, sizeof(buf));
stand/common/install.c
198
int error, fd, i, local;
stand/common/install.c
317
fd = open("/metatags", O_RDONLY);
stand/common/install.c
318
if (fd != -1) {
stand/common/install.c
319
error = read_metatags(fd);
stand/common/install.c
320
close(fd);
stand/common/install.c
336
fd = open(s, O_RDONLY);
stand/common/install.c
337
if (fd != -1) {
stand/common/install.c
338
close(fd);
stand/common/interp_forth.c
255
int fd;
stand/common/interp_forth.c
281
if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
stand/common/interp_forth.c
283
if (verify_file(fd, "/boot/boot.4th", 0, VE_GUESS, __func__) < 0) {
stand/common/interp_forth.c
284
close(fd);
stand/common/interp_forth.c
288
(void)ficlExecFD(bf_vm, fd);
stand/common/interp_forth.c
289
close(fd);
stand/common/interp_forth.c
385
int prevsrcid, fd, line;
stand/common/interp_forth.c
387
if (((fd = open(filename, O_RDONLY)) == -1)) {
stand/common/interp_forth.c
394
if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) {
stand/common/interp_forth.c
395
close(fd);
stand/common/interp_forth.c
406
while (fgetstr(input, sizeof(input), fd) >= 0) {
stand/common/interp_forth.c
423
close(fd);
stand/common/interp_forth.c
436
close(fd);
stand/common/interp_forth.c
442
bf_vm->sourceID.i = fd;
stand/common/interp_simple.c
102
if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) {
stand/common/interp_simple.c
103
close(fd);
stand/common/interp_simple.c
115
while (fgetstr(input, sizeof(input), fd) >= 0) {
stand/common/interp_simple.c
147
close(fd);
stand/common/interp_simple.c
162
close(fd);
stand/common/interp_simple.c
93
int fd, flags, line;
stand/common/interp_simple.c
95
if (((fd = open(filename, O_RDONLY)) == -1)) {
stand/common/load_elf.c
1002
ef.fd = -1;
stand/common/load_elf.c
1100
if (ef.fd != -1) {
stand/common/load_elf.c
1112
close(ef.fd);
stand/common/load_elf.c
274
if ((ef->fd = open(filename, O_RDONLY)) == -1)
stand/common/load_elf.c
278
close(ef->fd);
stand/common/load_elf.c
281
preload(ef->fd);
stand/common/load_elf.c
286
ef->vctx = vectx_open(ef->fd, filename, VE_MUST,
stand/common/load_elf.c
290
close(ef->fd);
stand/common/load_elf.c
328
if (verify_file(ef->fd, filename, bytes_read, VE_MUST, __func__) < 0) {
stand/common/load_elf.c
340
if (ef->fd != -1) {
stand/common/load_elf.c
344
close(ef->fd);
stand/common/load_elf.c
345
ef->fd = -1;
stand/common/load_elf.c
372
ef.fd = -1;
stand/common/load_elf.c
503
if (ef.fd != -1) {
stand/common/load_elf.c
515
close(ef.fd);
stand/common/load_elf.c
63
int fd;
stand/common/load_elf.c
76
#define VECTX_HANDLE(ef) (ef)->fd
stand/common/load_elf_obj.c
101
if ((ef.fd = open(filename, O_RDONLY)) == -1)
stand/common/load_elf_obj.c
107
ef.vctx = vectx_open(ef.fd, filename, VE_MUST,
stand/common/load_elf_obj.c
111
close(ef.fd);
stand/common/load_elf_obj.c
147
if (verify_file(ef.fd, filename, bytes_read, VE_MUST, __func__) < 0) {
stand/common/load_elf_obj.c
207
close(ef.fd);
stand/common/load_elf_obj.c
55
int fd;
stand/common/load_elf_obj.c
65
#define VECTX_HANDLE(ef) (ef)->fd
stand/common/ls.c
103
fd = ls_getdir(&path);
stand/common/ls.c
104
if (fd == -1) {
stand/common/ls.c
112
while ((d = readdirfd(fd)) != NULL) {
stand/common/ls.c
143
if (fd != -1)
stand/common/ls.c
144
close(fd);
stand/common/ls.c
157
int fd;
stand/common/ls.c
161
fd = -1;
stand/common/ls.c
183
fd = open(path, O_RDONLY);
stand/common/ls.c
184
if (fd < 0) {
stand/common/ls.c
189
if (fstat(fd, &sb) < 0) {
stand/common/ls.c
201
return (fd);
stand/common/ls.c
206
if (fd != -1)
stand/common/ls.c
207
close(fd);
stand/common/ls.c
58
int fd;
stand/common/ls.c
67
fd = -1;
stand/common/misc.c
116
kern_pread(readin_handle_t fd, vm_offset_t dest, size_t len, off_t off)
stand/common/misc.c
119
if (VECTX_LSEEK(fd, off, SEEK_SET) == -1) {
stand/common/misc.c
125
if ((size_t)archsw.arch_readin(fd, dest, len) != len) {
stand/common/misc.c
140
alloc_pread(readin_handle_t fd, off_t off, size_t len)
stand/common/misc.c
152
if (VECTX_LSEEK(fd, off, SEEK_SET) == -1) {
stand/common/misc.c
159
if ((size_t)VECTX_READ(fd, buf, len) != len) {
stand/common/module.c
1712
int fd, size, version;
stand/common/module.c
1719
st.st_size > LINKER_HINTS_MAX || (fd = open(path, O_RDONLY)) < 0) {
stand/common/module.c
1725
size = read(fd, &version, sizeof(version));
stand/common/module.c
1732
if (read(fd, mdp->d_hints, size) != size)
stand/common/module.c
1735
close(fd);
stand/common/module.c
1738
close(fd);
stand/common/module.c
645
#define VECTX_HANDLE(fd) vctx
stand/common/module.c
647
#define VECTX_HANDLE(fd) fd
stand/common/module.c
660
int fd, got;
stand/common/module.c
685
if ((fd = open(name, O_RDONLY)) < 0) {
stand/common/module.c
703
vctx = vectx_open(fd, name, severity, 0L, NULL, &verror, __func__);
stand/common/module.c
709
close(fd);
stand/common/module.c
715
if (verify_file(fd, name, 0, VE_MUST, __func__) < 0) {
stand/common/module.c
719
close(fd);
stand/common/module.c
734
got = archsw.arch_readin(VECTX_HANDLE(fd), laddr, 4096);
stand/common/module.c
741
close(fd);
stand/common/module.c
759
close(fd);
stand/common/module.c
772
close(fd);
stand/common/module.c
788
close(fd);
stand/common/module.c
798
close(fd);
stand/common/zfs_cmd.c
96
int fd = (uintptr_t) priv;
stand/common/zfs_cmd.c
99
ioctl(fd, DIOCGMEDIASIZE, &size);
stand/efi/libefi/efipart.c
457
efipart_testfd(pdinfo_t *fd, pdinfo_t *data __unused)
stand/efi/libefi/efipart.c
461
node = efi_devpath_last_node(fd->pd_devpath);
stand/efi/libefi/efipart.c
476
pdinfo_t *parent, *fd;
stand/efi/libefi/efipart.c
478
while ((fd = efipart_get_pd(&pdinfo, efipart_testfd, NULL)) != NULL) {
stand/efi/libefi/efipart.c
479
if ((node = efi_devpath_last_node(fd->pd_devpath)) == NULL)
stand/efi/libefi/efipart.c
485
STAILQ_REMOVE(&pdinfo, fd, pdinfo, pd_link);
stand/efi/libefi/efipart.c
486
parent = fd->pd_parent;
stand/efi/libefi/efipart.c
489
parent->pd_alias = fd->pd_handle;
stand/efi/libefi/efipart.c
491
free(fd);
stand/efi/libefi/efipart.c
492
fd = parent;
stand/efi/libefi/efipart.c
494
fd->pd_unit = acpi->UID;
stand/efi/libefi/efipart.c
496
fd->pd_devsw = &efipart_fddev;
stand/efi/libefi/efipart.c
497
STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link);
stand/efi/loader/arch/amd64/multiboot2.c
130
error = lseek(fd, i + sizeof(*header), SEEK_SET);
stand/efi/loader/arch/amd64/multiboot2.c
136
search_size = read(fd, multiboot,
stand/efi/loader/arch/amd64/multiboot2.c
243
close(fd);
stand/efi/loader/arch/amd64/multiboot2.c
77
int error, fd;
stand/efi/loader/arch/amd64/multiboot2.c
91
if ((fd = open(filename, O_RDONLY)) == -1)
stand/efi/loader/arch/amd64/multiboot2.c
98
search_size = read(fd, header_search, MULTIBOOT_SEARCH);
stand/efi/loader/copy.c
509
efi_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
stand/efi/loader/copy.c
521
return (VECTX_READ(fd, (void *)(dest + stage_offset), len));
stand/efi/loader/loader_efi.h
56
ssize_t efi_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
stand/efi/loader/main.c
1150
int fd = -1;
stand/efi/loader/main.c
1159
fd = open(env_fn, O_RDONLY);
stand/efi/loader/main.c
1160
if (fd == -1)
stand/efi/loader/main.c
1165
if (read(fd, env, st.st_size) != st.st_size)
stand/efi/loader/main.c
1171
close(fd);
stand/efi/loader/main.c
1961
int fd;
stand/efi/loader/main.c
1970
if ((fd = open(name, O_RDONLY)) < 0) {
stand/efi/loader/main.c
1976
if (verify_file(fd, name, 0, VE_MUST, __func__) < 0) {
stand/efi/loader/main.c
1978
close(fd);
stand/efi/loader/main.c
1983
if (fstat(fd, &st) < -1) {
stand/efi/loader/main.c
1985
close(fd);
stand/efi/loader/main.c
1992
close(fd);
stand/efi/loader/main.c
1995
if (read(fd, buf, st.st_size) != st.st_size) {
stand/efi/loader/main.c
1998
close(fd);
stand/efi/loader/main.c
2001
close(fd);
stand/ficl/ficl.h
980
int ficlExecFD(FICL_VM *pVM, int fd);
stand/ficl/loader.c
419
int ficlExecFD(FICL_VM *pVM, int fd)
stand/ficl/loader.c
427
pVM->sourceID.i = fd;
stand/ficl/loader.c
434
while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
stand/ficl/loader.c
480
int fd;
stand/ficl/loader.c
486
fd = stackPopINT(pVM->pStack);
stand/ficl/loader.c
489
if (fd < 0)
stand/ficl/loader.c
491
if (fstat(fd, &sb) < 0)
stand/ficl/loader.c
506
int mode, fd, count;
stand/ficl/loader.c
528
fd = open(name, mode);
stand/ficl/loader.c
530
if (fd >= 0) {
stand/ficl/loader.c
531
if (verify_file(fd, name, 0, VE_GUESS, __func__) < 0) {
stand/ficl/loader.c
534
close(fd);
stand/ficl/loader.c
535
fd = -1;
stand/ficl/loader.c
540
close(fd);
stand/ficl/loader.c
541
fd = -1;
stand/ficl/loader.c
547
stackPushINT(pVM->pStack, fd);
stand/ficl/loader.c
557
int fd;
stand/ficl/loader.c
562
fd = stackPopINT(pVM->pStack); /* get fd */
stand/ficl/loader.c
563
if (fd != -1)
stand/ficl/loader.c
564
close(fd);
stand/ficl/loader.c
574
int fd, len;
stand/ficl/loader.c
582
fd = stackPopINT(pVM->pStack); /* get fd */
stand/ficl/loader.c
583
if (len > 0 && buf && fd != -1)
stand/ficl/loader.c
584
stackPushINT(pVM->pStack, read(fd, buf, len));
stand/ficl/loader.c
605
int fd;
stand/ficl/loader.c
611
fd = stackPopINT(pVM->pStack);
stand/ficl/loader.c
621
if (fd == -1)
stand/ficl/loader.c
623
if (fstat(fd, &sb) == -1)
stand/ficl/loader.c
631
off = lseek(fd, 0LL, SEEK_CUR);
stand/ficl/loader.c
635
if (lseek(fd, 0, SEEK_SET) == -1)
stand/ficl/loader.c
637
bufsz = getdents(fd, buf, blksz);
stand/ficl/loader.c
640
bufsz = getdents(fd, buf, blksz);
stand/ficl/loader.c
647
d = (lseek(fd, off, SEEK_SET) != off) ? NULL : &dirent;
stand/ficl/loader.c
652
d = readdirfd(fd);
stand/ficl/loader.c
669
int fd;
stand/ficl/loader.c
674
fd = stackPopINT(pVM->pStack); /* get fd */
stand/ficl/loader.c
675
if (fd != -1)
stand/ficl/loader.c
676
ficlExecFD(pVM, fd);
stand/ficl/loader.c
686
int fd, len;
stand/ficl/loader.c
694
fd = stackPopINT(pVM->pStack); /* get fd */
stand/ficl/loader.c
695
if (len > 0 && buf && fd != -1)
stand/ficl/loader.c
696
stackPushINT(pVM->pStack, write(fd, buf, len));
stand/ficl/loader.c
708
int fd, pos, whence;
stand/ficl/loader.c
715
fd = stackPopINT(pVM->pStack);
stand/ficl/loader.c
716
stackPushINT(pVM->pStack, lseek(fd, pos, whence));
stand/ficl/loader.c
794
int i, fd;
stand/ficl/loader.c
800
fd = stackPopINT(pVM->pStack);
stand/ficl/loader.c
801
i = read(fd, &ch, 1);
stand/i386/gptzfsboot/zfsboot.c
176
int auto_boot, fd, nextboot = 0;
stand/i386/gptzfsboot/zfsboot.c
262
fd = open(PATH_CONFIG, O_RDONLY);
stand/i386/gptzfsboot/zfsboot.c
263
if (fd == -1)
stand/i386/gptzfsboot/zfsboot.c
264
fd = open(PATH_DOTCONFIG, O_RDONLY);
stand/i386/gptzfsboot/zfsboot.c
266
if (fd != -1) {
stand/i386/gptzfsboot/zfsboot.c
269
if ((cmdlen = read(fd, cmd, sizeof(cmd))) > 0)
stand/i386/gptzfsboot/zfsboot.c
273
close(fd);
stand/i386/gptzfsboot/zfsboot.c
350
int fd, fmt, i, j;
stand/i386/gptzfsboot/zfsboot.c
353
if ((fd = open(kname, O_RDONLY)) == -1) {
stand/i386/gptzfsboot/zfsboot.c
359
if (read(fd, &hdr, sizeof (hdr)) != size) {
stand/i386/gptzfsboot/zfsboot.c
360
close(fd);
stand/i386/gptzfsboot/zfsboot.c
369
close(fd);
stand/i386/gptzfsboot/zfsboot.c
375
lseek(fd, PAGE_SIZE, SEEK_SET);
stand/i386/gptzfsboot/zfsboot.c
377
if (read(fd, p, hdr.ex.a_text) != size) {
stand/i386/gptzfsboot/zfsboot.c
378
close(fd);
stand/i386/gptzfsboot/zfsboot.c
383
if (read(fd, p, hdr.ex.a_data) != size) {
stand/i386/gptzfsboot/zfsboot.c
384
close(fd);
stand/i386/gptzfsboot/zfsboot.c
393
if (read(fd, p, hdr.ex.a_syms) != size) {
stand/i386/gptzfsboot/zfsboot.c
394
close(fd);
stand/i386/gptzfsboot/zfsboot.c
399
if (read(fd, p, sizeof (int)) != size) {
stand/i386/gptzfsboot/zfsboot.c
400
close(fd);
stand/i386/gptzfsboot/zfsboot.c
407
if (read(fd, p, x) != size) {
stand/i386/gptzfsboot/zfsboot.c
408
close(fd);
stand/i386/gptzfsboot/zfsboot.c
414
lseek(fd, hdr.eh.e_phoff, SEEK_SET);
stand/i386/gptzfsboot/zfsboot.c
417
if (read(fd, ep + j, sizeof (ep[0])) != size) {
stand/i386/gptzfsboot/zfsboot.c
418
close(fd);
stand/i386/gptzfsboot/zfsboot.c
426
lseek(fd, ep[i].p_offset, SEEK_SET);
stand/i386/gptzfsboot/zfsboot.c
428
if (read(fd, p, ep[i].p_filesz) != size) {
stand/i386/gptzfsboot/zfsboot.c
429
close(fd);
stand/i386/gptzfsboot/zfsboot.c
436
lseek(fd, hdr.eh.e_shoff +
stand/i386/gptzfsboot/zfsboot.c
440
if (read(fd, &es, sizeof (es)) != size) {
stand/i386/gptzfsboot/zfsboot.c
441
close(fd);
stand/i386/gptzfsboot/zfsboot.c
448
lseek(fd, es[i].sh_offset, SEEK_SET);
stand/i386/gptzfsboot/zfsboot.c
450
if (read(fd, p, es[i].sh_size) != size) {
stand/i386/gptzfsboot/zfsboot.c
451
close(fd);
stand/i386/gptzfsboot/zfsboot.c
459
close(fd);
stand/i386/gptzfsboot/zfsboot.c
547
int fd;
stand/i386/gptzfsboot/zfsboot.c
551
fd = open(arg, O_RDONLY);
stand/i386/gptzfsboot/zfsboot.c
552
if (fd < 0)
stand/i386/gptzfsboot/zfsboot.c
555
while ((d = readdirfd(fd)) != NULL) {
stand/i386/gptzfsboot/zfsboot.c
561
close(fd);
stand/i386/libi386/i386_copy.c
63
i386_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
stand/i386/libi386/i386_copy.c
71
return (VECTX_READ(fd, PTOV(dest), len));
stand/i386/libi386/libi386.h
104
ssize_t i386_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
stand/i386/libi386/multiboot.c
101
if ((fd = open(filename, O_RDONLY)) == -1)
stand/i386/libi386/multiboot.c
105
close(fd);
stand/i386/libi386/multiboot.c
108
search_size = read(fd, header_search, MULTIBOOT_SEARCH);
stand/i386/libi386/multiboot.c
157
close(fd);
stand/i386/libi386/multiboot.c
91
int fd;
stand/i386/libi386/pread.c
51
pread(fd, dest, size)
stand/i386/libi386/pread.c
52
int fd;
stand/i386/libi386/pread.c
64
got = read(fd, buf, count);
stand/i386/loader/chain.c
104
if (fstat(fd, &st) == -1) {
stand/i386/loader/chain.c
106
close(fd);
stand/i386/loader/chain.c
112
close(fd);
stand/i386/loader/chain.c
119
close(fd);
stand/i386/loader/chain.c
123
if (archsw.arch_readin(VECTX_HANDLE(fd), mem, size) != size) {
stand/i386/loader/chain.c
125
close(fd);
stand/i386/loader/chain.c
128
close(fd);
stand/i386/loader/chain.c
61
int fd, len, size = SECTOR_SIZE;
stand/i386/loader/chain.c
79
fd = open(argv[1], O_RDONLY);
stand/i386/loader/chain.c
80
if (fd == -1) {
stand/i386/loader/chain.c
86
vctx = vectx_open(fd, argv[1], VE_MUST, 0L, NULL, &verror, __func__);
stand/i386/loader/chain.c
89
close(fd);
stand/i386/loader/chain.c
95
if (verify_file(fd, argv[1], 0, VE_MUST, __func__) < 0) {
stand/i386/loader/chain.c
97
close(fd);
stand/kboot/include/host_syscall.h
161
int host_close(int fd);
stand/kboot/include/host_syscall.h
162
int host_dup(int fd);
stand/kboot/include/host_syscall.h
164
int host_fstat(int fd, struct host_kstat *sb);
stand/kboot/include/host_syscall.h
165
int host_getdents64(int fd, void *dirp, int count);
stand/kboot/include/host_syscall.h
168
int host_ioctl(int fd, unsigned long request, unsigned long arg);
stand/kboot/include/host_syscall.h
170
ssize_t host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence);
stand/kboot/include/host_syscall.h
172
void *host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off);
stand/kboot/include/host_syscall.h
177
ssize_t host_read(int fd, void *buf, size_t nbyte);
stand/kboot/include/host_syscall.h
184
ssize_t host_write(int fd, const void *buf, size_t nbyte);
stand/kboot/kboot/arch/aarch64/load_addr.c
17
do_memory_from_fdt(int fd)
stand/kboot/kboot/arch/aarch64/load_addr.c
27
if (fstat(fd, &sb) < 0)
stand/kboot/kboot/arch/aarch64/load_addr.c
32
len = read(fd, buf, sb.st_size);
stand/kboot/kboot/arch/aarch64/load_addr.c
84
int fd = -1;
stand/kboot/kboot/arch/aarch64/load_addr.c
95
fd = open("host:/sys/firmware/fdt", O_RDONLY);
stand/kboot/kboot/arch/aarch64/load_addr.c
96
if (fd != -1) {
stand/kboot/kboot/arch/aarch64/load_addr.c
97
rv = do_memory_from_fdt(fd);
stand/kboot/kboot/arch/aarch64/load_addr.c
98
close(fd);
stand/kboot/kboot/arch/powerpc64/load_addr.c
100
if (fd >= 0) {
stand/kboot/kboot/arch/powerpc64/load_addr.c
101
ret = host_read(fd, &entry, sizeof(entry));
stand/kboot/kboot/arch/powerpc64/load_addr.c
120
host_close(fd);
stand/kboot/kboot/arch/powerpc64/load_addr.c
53
int fd;
stand/kboot/kboot/arch/powerpc64/load_addr.c
69
fd = host_open("/proc/device-tree/reserved-ranges", O_RDONLY, 0);
stand/kboot/kboot/arch/powerpc64/load_addr.c
70
if (fd >= 0) {
stand/kboot/kboot/arch/powerpc64/load_addr.c
71
while (host_read(fd, &entry[0], sizeof(entry)) == sizeof(entry)) {
stand/kboot/kboot/arch/powerpc64/load_addr.c
77
host_close(fd);
stand/kboot/kboot/arch/powerpc64/load_addr.c
80
fd = host_open("/proc/device-tree/chosen/linux,kernel-end", O_RDONLY, 0);
stand/kboot/kboot/arch/powerpc64/load_addr.c
81
if (fd >= 0) {
stand/kboot/kboot/arch/powerpc64/load_addr.c
82
ret = host_read(fd, &val_64, sizeof(val_64));
stand/kboot/kboot/arch/powerpc64/load_addr.c
94
host_close(fd);
stand/kboot/kboot/arch/powerpc64/load_addr.c
97
fd = host_open("/proc/device-tree/memory@0/reg", O_RDONLY, 0);
stand/kboot/kboot/arch/powerpc64/load_addr.c
98
if (fd < 0)
stand/kboot/kboot/arch/powerpc64/load_addr.c
99
fd = host_open("/proc/device-tree/memory/reg", O_RDONLY, 0);
stand/kboot/kboot/hostdisk.c
102
fd = host_open(dir, O_RDONLY, 0);
stand/kboot/kboot/hostdisk.c
103
if (fd < 0) {
stand/kboot/kboot/hostdisk.c
108
dentsize = host_getdents64(fd, dents, sizeof(dents));
stand/kboot/kboot/hostdisk.c
118
host_close(fd);
stand/kboot/kboot/hostdisk.c
99
int fd, dentsize;
stand/kboot/kboot/init.c
70
int fd;
stand/kboot/kboot/init.c
83
fd = host_open("/dev/console", HOST_O_RDWR | HOST_O_NOCTTY, 0);
stand/kboot/kboot/init.c
84
host_dup(fd);
stand/kboot/kboot/init.c
85
host_dup(fd);
stand/kboot/kboot/init.c
95
host_tcsetattr(fd, HOST_TCANOW, &tty);
stand/kboot/kboot/init.c
96
host_tcflush(fd, HOST_TCIOFLUSH)
stand/kboot/kboot/kbootfdt.c
103
fd = host_open("/sys/firmware/fdt", O_RDONLY, 0);
stand/kboot/kboot/kbootfdt.c
104
if (fd >= 0) {
stand/kboot/kboot/kbootfdt.c
105
err = host_read(fd, buffer, buflen);
stand/kboot/kboot/kbootfdt.c
106
close(fd);
stand/kboot/kboot/kbootfdt.c
108
if (fd < 0 || err < 0) {
stand/kboot/kboot/kbootfdt.c
36
int child_offset, fd, pfd, error, dentsize;
stand/kboot/kboot/kbootfdt.c
45
fd = host_open(path, O_RDONLY, 0);
stand/kboot/kboot/kbootfdt.c
47
dentsize = host_getdents64(fd, dents, sizeof(dents));
stand/kboot/kboot/kbootfdt.c
86
host_close(fd);
stand/kboot/kboot/kbootfdt.c
94
int fd, err = 0;
stand/kboot/kboot/main.c
118
close(fd);
stand/kboot/kboot/main.c
364
int fd = -1;
stand/kboot/kboot/main.c
369
fd = open(fn, O_RDONLY);
stand/kboot/kboot/main.c
370
if (fd == -1)
stand/kboot/kboot/main.c
375
if (read(fd, env, st.st_size) != st.st_size)
stand/kboot/kboot/main.c
381
close(fd);
stand/kboot/kboot/main.c
43
ssize_t kboot_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
stand/kboot/kboot/main.c
604
kboot_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
stand/kboot/kboot/main.c
622
got = VECTX_READ(fd, buf, get);
stand/kboot/kboot/main.c
84
int fd;
stand/kboot/kboot/main.c
95
fd = open("host:/proc/meminfo", O_RDONLY);
stand/kboot/kboot/main.c
96
if (fd != -1) {
stand/kboot/kboot/main.c
97
while (fgetstr(buf, sizeof(buf), fd) > 0) {
stand/kboot/libkboot/dfk.c
203
ef.fd = open(KCORE_PATH, O_RDONLY);
stand/kboot/libkboot/dfk.c
204
if (ef.fd == -1) {
stand/kboot/libkboot/dfk.c
215
rv = read(ef.fd, ef.buf, sizeof(ef.buf));
stand/kboot/libkboot/dfk.c
218
close(ef.fd);
stand/kboot/libkboot/dfk.c
224
close(ef.fd);
stand/kboot/libkboot/dfk.c
234
close(ef.fd);
stand/kboot/libkboot/dfk.c
245
lseek(ef.fd, (off_t)phdr[i].p_offset + addr - phdr[i].p_vaddr,
stand/kboot/libkboot/dfk.c
247
rv = read(ef.fd, buf, len);
stand/kboot/libkboot/dfk.c
250
close(ef.fd);
stand/kboot/libkboot/dfk.c
254
close(ef.fd);
stand/kboot/libkboot/dfk.c
53
int fd;
stand/kboot/libkboot/dfk.c
60
int fd;
stand/kboot/libkboot/dfk.c
75
rv = read(lb->fd, lb->buf, sizeof(lb->buf));
stand/kboot/libkboot/dfk.c
86
close(lb->fd);
stand/kboot/libkboot/dfk.c
93
lb->fd = open(fn, O_RDONLY);
stand/kboot/libkboot/dfk.c
94
if (lb->fd == -1)
stand/kboot/libkboot/host_syscalls.c
122
host_read(int fd, void *buf, size_t nbyte)
stand/kboot/libkboot/host_syscalls.c
124
return host_syscall(SYS_read, fd, (uintptr_t)buf, nbyte);
stand/kboot/libkboot/host_syscalls.c
168
host_write(int fd, const void *buf, size_t nbyte)
stand/kboot/libkboot/host_syscalls.c
17
host_close(int fd)
stand/kboot/libkboot/host_syscalls.c
170
return host_syscall(SYS_write, fd, (uintptr_t)buf, nbyte);
stand/kboot/libkboot/host_syscalls.c
19
return host_syscall(SYS_close, fd);
stand/kboot/libkboot/host_syscalls.c
23
host_dup(int fd)
stand/kboot/libkboot/host_syscalls.c
25
return host_syscall(SYS_dup, fd);
stand/kboot/libkboot/host_syscalls.c
36
host_fstat(int fd, struct host_kstat *sb)
stand/kboot/libkboot/host_syscalls.c
39
return host_syscall(SYS_newfstat, fd, (uintptr_t)sb);
stand/kboot/libkboot/host_syscalls.c
41
return host_syscall(SYS_fstat, fd, (uintptr_t)sb);
stand/kboot/libkboot/host_syscalls.c
46
host_getdents64(int fd, void *dirp, int count)
stand/kboot/libkboot/host_syscalls.c
48
return host_syscall(SYS_getdents64, fd, (uintptr_t)dirp, count);
stand/kboot/libkboot/host_syscalls.c
64
host_ioctl(int fd, unsigned long request, unsigned long arg)
stand/kboot/libkboot/host_syscalls.c
66
return host_syscall(SYS_ioctl, fd, request, arg);
stand/kboot/libkboot/host_syscalls.c
70
host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence)
stand/kboot/libkboot/host_syscalls.c
73
return host_syscall(SYS_llseek, fd, offset_high, offset_lo, (uintptr_t)result, whence);
stand/kboot/libkboot/host_syscalls.c
75
int64_t rv = host_syscall(SYS_lseek, fd,
stand/kboot/libkboot/host_syscalls.c
96
host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off)
stand/kboot/libkboot/host_syscalls.c
98
return (void *)host_syscall(SYS_mmap, (uintptr_t)addr, len, prot, flags, fd, off);
stand/kboot/libkboot/seg.c
280
int fd;
stand/kboot/libkboot/seg.c
286
fd = open("host:/proc/iomem", O_RDONLY);
stand/kboot/libkboot/seg.c
287
if (fd == -1) {
stand/kboot/libkboot/seg.c
295
if (fgetstr(buf, sizeof(buf), fd) < 0)
stand/kboot/libkboot/seg.c
319
while (fgetstr(buf, sizeof(buf), fd) >= 0 && buf[0] == ' ') {
stand/kboot/libkboot/seg.c
342
if (fgetstr(buf, sizeof(buf), fd) < 0)
stand/kboot/libkboot/seg.c
347
close(fd);
stand/kboot/libkboot/termios.c
14
host_tcgetattr(int fd, struct host_termios *tio)
stand/kboot/libkboot/termios.c
16
if (host_ioctl(fd, HOST_TCGETS, (uintptr_t)tio))
stand/kboot/libkboot/termios.c
22
host_tcsetattr(int fd, int act, const struct host_termios *tio)
stand/kboot/libkboot/termios.c
28
return host_ioctl(fd, HOST_TCSETS+act, (uintptr_t)tio);
stand/kboot/libkboot/util.c
14
int fd;
stand/kboot/libkboot/util.c
17
fd = host_open(fn, HOST_O_RDONLY, 0);
stand/kboot/libkboot/util.c
18
if (fd == -1)
stand/kboot/libkboot/util.c
20
len = host_read(fd, buffer, buflen - 1);
stand/kboot/libkboot/util.c
22
host_close(fd);
stand/kboot/libkboot/util.c
31
host_close(fd);
stand/liblua/lstd.c
113
r = (size_t)read(stream->fd, ptr, size * count);
stand/liblua/lstd.c
126
w = write(stream->fd, ptr, size * count);
stand/liblua/lstd.c
139
close(stream->fd);
stand/liblua/lstd.c
149
return (stream == NULL || stream->fd < 0);
stand/liblua/lstd.c
170
r = read(stream->fd, &ch, 1);
stand/liblua/lstd.c
180
int fd;
stand/liblua/lstd.c
182
fd = open(name, O_RDONLY);
stand/liblua/lstd.c
183
if (fd < 0)
stand/liblua/lstd.c
185
dp = fdopendir(fd);
stand/liblua/lstd.c
187
close(fd);
stand/liblua/lstd.c
192
fdopendir(int fd)
stand/liblua/lstd.c
199
dp->fd = fd;
stand/liblua/lstd.c
206
close(dp->fd);
stand/liblua/lstd.c
207
dp->fd = -1;
stand/liblua/lstd.c
39
int fd, m, o;
stand/liblua/lstd.c
64
fd = open(filename, m | o);
stand/liblua/lstd.c
65
if (fd < 0)
stand/liblua/lstd.c
70
close(fd);
stand/liblua/lstd.c
74
if (fstat(fd, &st) != 0) {
stand/liblua/lstd.c
76
close(fd);
stand/liblua/lstd.c
83
if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) {
stand/liblua/lstd.c
85
close(fd);
stand/liblua/lstd.c
91
f->fd = fd;
stand/liblua/lstd.h
48
int fd;
stand/liblua/lstd.h
55
int fd;
stand/liblua/lstd.h
79
DIR *fdopendir(int fd);
stand/libofw/libofw.h
55
ssize_t ofw_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
stand/libofw/ofw_copy.c
133
ofw_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
stand/libofw/ofw_copy.c
157
got = VECTX_READ(fd, buf, get);
stand/libsa/close.c
64
close(int fd)
stand/libsa/close.c
69
f = fd2open_file(fd);
stand/libsa/dosfs.c
1025
struct open_file *fd = fs->fd;
stand/libsa/dosfs.c
1031
rv = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec,
stand/libsa/dosfs.c
222
dos_mount_impl(DOS_FS *fs, struct open_file *fd)
stand/libsa/dosfs.c
228
fs->fd = fd;
stand/libsa/dosfs.c
230
err = ioctl(fd->f_id, DIOCGSECTORSIZE, &secsz);
stand/libsa/dosfs.c
345
dos_open(const char *path, struct open_file *fd)
stand/libsa/dosfs.c
355
dev = devformat((struct devdesc *)fd->f_devdata);
stand/libsa/dosfs.c
365
if ((err = dos_mount_impl(fs, fd))) {
stand/libsa/dosfs.c
398
fd->f_fsdata = f;
stand/libsa/dosfs.c
406
dos_read(struct open_file *fd, void *buf, size_t nbyte, size_t *resid)
stand/libsa/dosfs.c
412
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
stand/libsa/dosfs.c
472
dos_seek(struct open_file *fd, off_t offset, int whence)
stand/libsa/dosfs.c
476
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
stand/libsa/dosfs.c
507
dos_close(struct open_file *fd)
stand/libsa/dosfs.c
509
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
stand/libsa/dosfs.c
522
dos_stat(struct open_file *fd, struct stat *sb)
stand/libsa/dosfs.c
524
DOS_FILE *f = (DOS_FILE *)fd->f_fsdata;
stand/libsa/dosfs.c
53
static int dos_open(const char *path, struct open_file *fd);
stand/libsa/dosfs.c
54
static int dos_close(struct open_file *fd);
stand/libsa/dosfs.c
55
static int dos_read(struct open_file *fd, void *buf, size_t size, size_t *resid);
stand/libsa/dosfs.c
554
dos_readdir(struct open_file *fd, struct dirent *d)
stand/libsa/dosfs.c
56
static off_t dos_seek(struct open_file *fd, off_t offset, int whence);
stand/libsa/dosfs.c
567
err = dos_read(fd, &dd, sizeof(dd), &res);
stand/libsa/dosfs.c
57
static int dos_stat(struct open_file *fd, struct stat *sb);
stand/libsa/dosfs.c
58
static int dos_readdir(struct open_file *fd, struct dirent *d);
stand/libsa/dosfs.h
96
struct open_file *fd; /* file descriptor */
stand/libsa/fstat.c
35
fstat(int fd, struct stat *sb)
stand/libsa/fstat.c
39
f = fd2open_file(fd);
stand/libsa/gets.c
85
fgetstr(char *buf, int size, int fd)
stand/libsa/gets.c
93
err = read(fd, &c, sizeof(c));
stand/libsa/ioctl.c
64
ioctl(int fd, u_long cmd, void *arg)
stand/libsa/ioctl.c
68
f = fd2open_file(fd);
stand/libsa/lseek.c
64
lseek(int fd, off_t offset, int where)
stand/libsa/lseek.c
69
f = fd2open_file(fd);
stand/libsa/open.c
140
int fd, i, error, besterror;
stand/libsa/open.c
147
if ((fd = o_gethandle(&f)) == -1) {
stand/libsa/open.c
171
return (fd);
stand/libsa/open.c
218
return (fd);
stand/libsa/open.c
84
fd2open_file(int fd)
stand/libsa/open.c
89
if (fd >= 0) {
stand/libsa/open.c
90
if (f->f_id == fd)
stand/libsa/pager.c
132
int fd;
stand/libsa/pager.c
135
if ((fd = open(fname, O_RDONLY)) == -1) {
stand/libsa/pager.c
141
hmuch = read(fd, buf, sizeof(buf) - 1);
stand/libsa/pager.c
156
close(fd);
stand/libsa/pkgfs.c
158
int error, fd;
stand/libsa/pkgfs.c
166
fd = open(pkgname, O_RDONLY);
stand/libsa/pkgfs.c
171
proto->fs_name, pkgname, fd, errno));
stand/libsa/pkgfs.c
173
if (fd == -1)
stand/libsa/pkgfs.c
176
error = new_package(fd, &pkg);
stand/libsa/pkgfs.c
178
close(fd);
stand/libsa/pkgfs.c
665
new_package(int fd, struct package **pp)
stand/libsa/pkgfs.c
676
pkg->pkg_fd = fd;
stand/libsa/preload.c
31
preload(int fd)
stand/libsa/preload.c
35
f = fd2open_file(fd);
stand/libsa/read.c
65
read(int fd, void *dest, size_t bcount)
stand/libsa/read.c
72
f = fd2open_file(fd);
stand/libsa/readdir.c
31
readdirfd(int fd)
stand/libsa/readdir.c
36
f = fd2open_file(fd);
stand/libsa/splitfs.c
181
int fd;
stand/libsa/splitfs.c
185
fd = sf->curfd;
stand/libsa/splitfs.c
187
return(close(fd));
stand/libsa/stand.h
315
extern int fgetstr(char *buf, int size, int fd);
stand/libsa/stat.c
37
int fd, rv;
stand/libsa/stat.c
39
fd = open(str, O_RDONLY);
stand/libsa/stat.c
40
if (fd < 0)
stand/libsa/stat.c
42
rv = fstat(fd, sb);
stand/libsa/stat.c
43
(void)close(fd);
stand/libsa/write.c
65
write(int fd, const void *dest, size_t bcount)
stand/libsa/write.c
70
f = fd2open_file(fd);
stand/libsa/zfs/zfs.c
1478
pa.fd = open(devname, O_RDWR);
stand/libsa/zfs/zfs.c
1479
if (pa.fd == -1)
stand/libsa/zfs/zfs.c
1482
ret = zfs_probe(pa.fd, pool_guid);
stand/libsa/zfs/zfs.c
1489
ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz);
stand/libsa/zfs/zfs.c
1491
ret = ioctl(pa.fd, DIOCGSECTORSIZE, &pa.secsz);
stand/libsa/zfs/zfs.c
1502
close(pa.fd);
stand/libsa/zfs/zfs.c
460
int fd, ret;
stand/libsa/zfs/zfs.c
466
fd = (uintptr_t) priv;
stand/libsa/zfs/zfs.c
470
ret = ioctl(fd, DIOCGSECTORSIZE, &secsz);
stand/libsa/zfs/zfs.c
523
if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) {
stand/libsa/zfs/zfs.c
530
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
547
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
554
res = read(fd, outbuf, full_sec_size);
stand/libsa/zfs/zfs.c
565
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
582
int fd, ret;
stand/libsa/zfs/zfs.c
589
fd = (uintptr_t)vdev->v_priv;
stand/libsa/zfs/zfs.c
593
ret = ioctl(fd, DIOCGSECTORSIZE, &secsz);
stand/libsa/zfs/zfs.c
617
if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) {
stand/libsa/zfs/zfs.c
624
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
630
(void) lseek(fd, -secsz, SEEK_CUR);
stand/libsa/zfs/zfs.c
631
res = write(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
647
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
653
(void) lseek(fd, -secsz, SEEK_CUR);
stand/libsa/zfs/zfs.c
654
res = write(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
660
res = write(fd, outbuf, full_sec_size);
stand/libsa/zfs/zfs.c
671
res = read(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
677
(void) lseek(fd, -secsz, SEEK_CUR);
stand/libsa/zfs/zfs.c
678
res = write(fd, bouncebuf, secsz);
stand/libsa/zfs/zfs.c
720
int fd;
stand/libsa/zfs/zfs.c
732
return (vdev_read(NULL, (void *)(uintptr_t)ppa->fd,
stand/libsa/zfs/zfs.c
737
zfs_probe(int fd, uint64_t *pool_guid)
stand/libsa/zfs/zfs.c
743
ret = vdev_probe(vdev_read, vdev_write, (void *)(uintptr_t)fd, &spa);
stand/libsa/zfs/zfs.c
768
pa.fd = open(devname, O_RDWR);
stand/libsa/zfs/zfs.c
769
if (pa.fd == -1)
stand/libsa/zfs/zfs.c
771
ret = zfs_probe(pa.fd, ppa->pool_guid);
stand/libsa/zfs/zfs.c
786
close(pa.fd);
stand/powerpc/ofw/main.c
61
#define OF_puts(fd, text) OF_write(fd, text, strlen(text))
stand/uboot/copy.c
160
uboot_readin(readin_handle_t fd, vm_offset_t dest, const size_t len)
stand/uboot/copy.c
162
return (VECTX_READ(fd, (void *)dest, len));
stand/uboot/libuboot.h
62
ssize_t uboot_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
stand/usb/tools/sysinit.c
83
do_write(int fd, const char *buf)
stand/usb/tools/sysinit.c
87
if (write(fd, buf, len) != len)
stand/userboot/test/test.c
105
int fd;
stand/userboot/test/test.c
226
tf->tf_u.fd = comp_fd;
stand/userboot/test/test.c
256
close(tf->tf_u.fd);
stand/userboot/test/test.c
278
close(tf->tf_u.fd);
stand/userboot/test/test.c
300
sz = read(tf->tf_u.fd, dst, size);
stand/userboot/test/test.c
341
if (lseek(tf->tf_u.fd, offset, whence) < 0)
stand/userboot/userboot/copy.c
48
userboot_readin(readin_handle_t fd, vm_offset_t va, size_t len)
stand/userboot/userboot/copy.c
59
s = VECTX_READ(fd, buf, sz);
stand/userboot/userboot/main.c
106
int fd;
stand/userboot/userboot/main.c
116
if ((fd = open(LOADER_PATH, O_RDONLY)) < 0)
stand/userboot/userboot/main.c
123
if (read(fd, buf, rdsize) < rdsize)
stand/userboot/userboot/main.c
151
close(fd);
sys/amd64/linux/linux_proto.h
100
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
1041
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
105
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
1077
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
1083
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
1089
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
111
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
1121
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux/linux_proto.h
1128
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux/linux_proto.h
117
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux/linux_proto.h
1178
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
1187
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
1219
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
1296
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux/linux_proto.h
1304
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux/linux_proto.h
355
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
360
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
367
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
37
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux/linux_proto.h
371
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
51
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
526
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
658
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
677
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
693
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
706
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
73
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux/linux_proto.h
759
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux/linux_proto.h
776
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
832
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
917
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_proto.h
922
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux/linux_systrace_args.c
1146
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
1459
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
1490
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
1518
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
1543
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
157
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
1638
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
166
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
1669
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
176
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
1773
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
18
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
186
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
1922
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
1931
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
195
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
2132
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2194
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2204
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2214
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2276
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux/linux_systrace_args.c
2287
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux/linux_systrace_args.c
2369
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2386
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2438
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
2571
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux/linux_systrace_args.c
2583
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux/linux_systrace_args.c
27
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
300
uarg[a++] = p->fd; /* u_int */
sys/amd64/linux/linux_systrace_args.c
45
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
60
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
646
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
655
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
663
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
670
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
685
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux/linux_systrace_args.c
693
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux/linux_systrace_args.c
717
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
795
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
812
iarg[a++] = p->fd; /* int */
sys/amd64/linux/linux_systrace_args.c
98
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux/linux_vdso_gtod.c
58
write(int fd, const void *buf, size_t size)
sys/amd64/linux/linux_vdso_gtod.c
66
: "a"(LINUX_SYS_linux_write), "D"(fd), "S"(buf), "d"(size)
sys/amd64/linux32/linux.h
165
l_int fd;
sys/amd64/linux32/linux32_machdep.c
108
error = kern_readv(td, uap->fd, auio);
sys/amd64/linux32/linux32_machdep.c
320
linux_args.prot, linux_args.flags, linux_args.fd,
sys/amd64/linux32/linux32_proto.h
1107
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1153
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1161
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1167
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1193
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
1200
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
1250
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1285
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1440
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
1448
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
1571
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
1575
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
192
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
197
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
293
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
305
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux32/linux32_proto.h
317
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
347
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
43
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux32/linux32_proto.h
436
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
443
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
460
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
465
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
473
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
582
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
589
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
634
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/amd64/linux32/linux32_proto.h
643
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
656
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
704
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
709
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
731
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
750
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
766
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
779
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
814
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux32/linux32_proto.h
832
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
892
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/amd64/linux32/linux32_proto.h
906
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/amd64/linux32/linux32_proto.h
986
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_proto.h
991
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/amd64/linux32/linux32_systrace_args.c
1235
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1246
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1325
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
1342
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1367
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1540
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1549
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1585
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1616
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1644
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1669
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1732
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
1764
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
1878
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
1904
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
2040
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2049
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2245
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2323
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2335
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2345
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2397
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
2408
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
2490
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2547
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
2814
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
2826
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
283
uarg[a++] = p->fd; /* u_int */
sys/amd64/linux32/linux32_systrace_args.c
30
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
3045
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
3053
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
356
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
365
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
39
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
57
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
598
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
630
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
638
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
646
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
680
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
738
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
797
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
882
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
924
iarg[a++] = p->fd; /* l_int */
sys/amd64/linux32/linux32_systrace_args.c
935
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_systrace_args.c
955
iarg[a++] = p->fd; /* int */
sys/amd64/linux32/linux32_systrace_args.c
972
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
981
iarg[a++] = p->fd; /* l_ulong */
sys/amd64/linux32/linux32_systrace_args.c
997
iarg[a++] = p->fd; /* l_uint */
sys/amd64/linux32/linux32_vdso_gtod.c
57
write(int fd, const void *buf, size_t size)
sys/amd64/linux32/linux32_vdso_gtod.c
65
: "a"(LINUX32_SYS_linux_write), "b"(fd), "c"(buf), "d"(size)
sys/amd64/sgx/sgx_linux.c
64
error = fget(td, args->fd, cap_rights_init_one(&rights, CAP_IOCTL),
sys/arm64/linux/linux_proto.h
1000
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
1033
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
1103
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/arm64/linux/linux_proto.h
1111
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/arm64/linux/linux_proto.h
119
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
136
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
144
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
149
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
153
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
215
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
223
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
227
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
266
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
276
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/arm64/linux/linux_proto.h
281
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/arm64/linux/linux_proto.h
286
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
292
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
298
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/arm64/linux/linux_proto.h
305
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/arm64/linux/linux_proto.h
362
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
366
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/arm64/linux/linux_proto.h
369
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
379
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
385
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
51
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
70
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
86
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
891
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/arm64/linux/linux_proto.h
895
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
99
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_proto.h
997
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/arm64/linux/linux_systrace_args.c
124
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
162
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
1791
iarg[a++] = p->fd; /* l_ulong */
sys/arm64/linux/linux_systrace_args.c
1799
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
182
uarg[a++] = p->fd; /* u_int */
sys/arm64/linux/linux_systrace_args.c
198
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
2006
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
2013
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
2066
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
214
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
2188
iarg[a++] = p->fd; /* l_ulong */
sys/arm64/linux/linux_systrace_args.c
2200
iarg[a++] = p->fd; /* l_ulong */
sys/arm64/linux/linux_systrace_args.c
223
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
231
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
257
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
347
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
363
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
371
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
397
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
40
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
411
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
439
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
458
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
478
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
496
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
505
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
514
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
523
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
532
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
542
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
552
iarg[a++] = p->fd; /* l_ulong */
sys/arm64/linux/linux_systrace_args.c
563
iarg[a++] = p->fd; /* l_ulong */
sys/arm64/linux/linux_systrace_args.c
654
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
662
iarg[a++] = p->fd; /* int */
sys/arm64/linux/linux_systrace_args.c
669
iarg[a++] = p->fd; /* l_uint */
sys/arm64/linux/linux_systrace_args.c
676
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
694
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
704
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
71
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_systrace_args.c
99
iarg[a++] = p->fd; /* l_int */
sys/arm64/linux/linux_vdso_gtod.c
56
register int fd asm("x0") = lfd;
sys/arm64/linux/linux_vdso_gtod.c
64
: "r" (fd), "r" (buf), "r" (size), "r" (svc)
sys/compat/freebsd32/freebsd32_capability.c
100
AUDIT_ARG_FD(fd);
sys/compat/freebsd32/freebsd32_capability.c
105
if (fget_noref(fdp, fd) == NULL) {
sys/compat/freebsd32/freebsd32_capability.c
116
fdep = &fdp->fd_ofiles[fd];
sys/compat/freebsd32/freebsd32_capability.c
81
return (kern_cap_ioctls_limit(td, uap->fd, cmds, ncmds));
sys/compat/freebsd32/freebsd32_capability.c
93
int error, fd;
sys/compat/freebsd32/freebsd32_capability.c
96
fd = uap->fd;
sys/compat/freebsd32/freebsd32_ioctl.c
191
int fd;
sys/compat/freebsd32/freebsd32_ioctl.c
199
error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp);
sys/compat/freebsd32/freebsd32_ioctl.c
223
ap.fd = uap->fd;
sys/compat/freebsd32/freebsd32_misc.c
1313
error = kern_readv(td, uap->fd, auio);
sys/compat/freebsd32/freebsd32_misc.c
1327
error = kern_writev(td, uap->fd, auio);
sys/compat/freebsd32/freebsd32_misc.c
1341
error = kern_preadv(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
sys/compat/freebsd32/freebsd32_misc.c
1355
error = kern_pwritev(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
sys/compat/freebsd32/freebsd32_misc.c
1878
return (kern_futimes(td, uap->fd, sp, UIO_SYSSPACE));
sys/compat/freebsd32/freebsd32_misc.c
1899
return (kern_utimesat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/compat/freebsd32/freebsd32_misc.c
1921
return (kern_futimens(td, uap->fd, tsp, UIO_SYSSPACE));
sys/compat/freebsd32/freebsd32_misc.c
1942
return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/compat/freebsd32/freebsd32_misc.c
1999
error = kern_fstatfs(td, uap->fd, sp);
sys/compat/freebsd32/freebsd32_misc.c
2035
return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
sys/compat/freebsd32/freebsd32_misc.c
2043
return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
sys/compat/freebsd32/freebsd32_misc.c
2052
return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
sys/compat/freebsd32/freebsd32_misc.c
2062
error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
sys/compat/freebsd32/freebsd32_misc.c
2091
return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
sys/compat/freebsd32/freebsd32_misc.c
2098
return (kern_ftruncate(td, uap->fd, uap->length));
sys/compat/freebsd32/freebsd32_misc.c
2110
ap.fd = uap->fd;
sys/compat/freebsd32/freebsd32_misc.c
2132
error = freebsd11_kern_getdirentries(td, uap->fd, uap->buf, uap->count,
sys/compat/freebsd32/freebsd32_misc.c
2150
return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
sys/compat/freebsd32/freebsd32_misc.c
2158
return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
sys/compat/freebsd32/freebsd32_misc.c
2168
error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
sys/compat/freebsd32/freebsd32_misc.c
2189
return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
sys/compat/freebsd32/freebsd32_misc.c
2257
AUDIT_ARG_FD(uap->fd);
sys/compat/freebsd32/freebsd32_misc.c
2259
if ((error = fget_read(td, uap->fd,
sys/compat/freebsd32/freebsd32_misc.c
2386
error = kern_fstat(td, uap->fd, &ub);
sys/compat/freebsd32/freebsd32_misc.c
2402
error = kern_fstat(td, uap->fd, &ub);
sys/compat/freebsd32/freebsd32_misc.c
2418
error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE,
sys/compat/freebsd32/freebsd32_misc.c
2571
error = kern_fstat(td, uap->fd, &sb);
sys/compat/freebsd32/freebsd32_misc.c
2588
error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE,
sys/compat/freebsd32/freebsd32_misc.c
2714
error = kern_fstat(td, uap->fd, &ub);
sys/compat/freebsd32/freebsd32_misc.c
296
error = kern_pdwait(td, uap->fd, &status, uap->options, wrup, sip);
sys/compat/freebsd32/freebsd32_misc.c
3233
error = kern_timerfd_gettime(td, uap->fd, &curr_value);
sys/compat/freebsd32/freebsd32_misc.c
3262
error = kern_timerfd_settime(td, uap->fd, uap->flags,
sys/compat/freebsd32/freebsd32_misc.c
3265
error = kern_timerfd_settime(td, uap->fd, uap->flags,
sys/compat/freebsd32/freebsd32_misc.c
3868
error = kern_posix_fallocate(td, uap->fd,
sys/compat/freebsd32/freebsd32_misc.c
3879
error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset),
sys/compat/freebsd32/freebsd32_misc.c
4045
return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp));
sys/compat/freebsd32/freebsd32_misc.c
529
eargs.fd = uap->fd;
sys/compat/freebsd32/freebsd32_misc.c
541
return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/compat/freebsd32/freebsd32_misc.c
575
.mr_fd = uap->fd,
sys/compat/freebsd32/freebsd32_misc.c
598
.mr_fd = uap->fd,
sys/compat/freebsd32/freebsd32_misc.c
609
uap->flags, uap->fd, uap->pos));
sys/compat/freebsd32/freebsd32_misc.c
831
error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents,
sys/compat/freebsd32/freebsd32_misc.c
929
error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents,
sys/compat/freebsd32/freebsd32_proto.h
1009
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
1085
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
1093
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
110
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
1103
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
1115
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
1128
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
115
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
168
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
250
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
260
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
314
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
414
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
424
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
438
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
446
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
463
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
503
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
508
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
547
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
557
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
580
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
585
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
609
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
613
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
619
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
623
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
638
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
648
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
66
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
688
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
692
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
703
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
832
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
850
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
858
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
888
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
895
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
90
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
931
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
939
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
970
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
978
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
990
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_proto.h
996
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/compat/freebsd32/freebsd32_systrace_args.c
104
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1284
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1298
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1433
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1730
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1741
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1752
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
1811
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2044
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2337
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2351
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2369
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2381
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2406
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2489
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2499
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2509
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2520
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2529
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2549
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2558
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2567
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2577
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
258
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2598
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2606
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2684
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2712
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2720
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2805
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2819
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
284
uarg[a++] = p->fd; /* u_int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2850
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2858
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2867
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2876
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2884
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2892
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2902
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2912
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2971
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2979
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2989
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
2996
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3004
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3022
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3040
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3065
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3079
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3126
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3164
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3224
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3274
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3322
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3330
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3360
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3385
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3395
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3419
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3426
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3442
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
3473
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
351
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
38
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
47
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
513
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
533
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
630
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
639
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
65
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
656
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
665
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
697
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
890
iarg[a++] = p->fd; /* int */
sys/compat/freebsd32/freebsd32_systrace_args.c
954
iarg[a++] = p->fd; /* int */
sys/compat/linux/linux.c
536
linux_to_bsd_poll_events(struct thread *td, int fd, short lev,
sys/compat/linux/linux.c
570
error = fget_unlocked(td, fd, &cap_no_rights, &fp);
sys/compat/linux/linux_common.h
53
void linux_to_bsd_poll_events(struct thread *td, int fd,
sys/compat/linux/linux_event.c
143
epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event,
sys/compat/linux/linux_event.c
163
EV_SET(kevent, fd, EVFILT_READ, kev_flags, 0, 0, 0);
sys/compat/linux/linux_event.c
169
EV_SET(kevent, fd, EVFILT_WRITE, kev_flags, 0, 0, 0);
sys/compat/linux/linux_event.c
176
EV_SET(kevent++, fd, EVFILT_READ, EV_ADD|EV_DISABLE, 0, 0, 0);
sys/compat/linux/linux_event.c
312
error = fget(td, args->fd,
sys/compat/linux/linux_event.c
326
error = epoll_to_kevent(td, args->fd, &le, kev, &nchanges);
sys/compat/linux/linux_event.c
333
error = epoll_delete_all_events(td, epfp, args->fd);
sys/compat/linux/linux_event.c
339
if (epoll_fd_registered(td, epfp, args->fd)) {
sys/compat/linux/linux_event.c
347
error = epoll_delete_all_events(td, epfp, args->fd);
sys/compat/linux/linux_event.c
530
epoll_register_kevent(struct thread *td, struct file *epfp, int fd, int filter,
sys/compat/linux/linux_event.c
540
EV_SET(&kev, fd, filter, flags, 0, 0, 0);
sys/compat/linux/linux_event.c
546
epoll_fd_registered(struct thread *td, struct file *epfp, int fd)
sys/compat/linux/linux_event.c
556
if (epoll_register_kevent(td, epfp, fd, EVFILT_READ, 0) != ENOENT ||
sys/compat/linux/linux_event.c
557
epoll_register_kevent(td, epfp, fd, EVFILT_WRITE, 0) != ENOENT)
sys/compat/linux/linux_event.c
564
epoll_delete_all_events(struct thread *td, struct file *epfp, int fd)
sys/compat/linux/linux_event.c
568
error1 = epoll_register_kevent(td, epfp, fd, EVFILT_READ, EV_DELETE);
sys/compat/linux/linux_event.c
569
error2 = epoll_register_kevent(td, epfp, fd, EVFILT_WRITE, EV_DELETE);
sys/compat/linux/linux_event.c
635
error = kern_timerfd_gettime(td, args->fd, &ots);
sys/compat/linux/linux_event.c
660
error = kern_timerfd_settime(td, args->fd, args->flags, &nts, NULL);
sys/compat/linux/linux_event.c
662
error = kern_timerfd_settime(td, args->fd, args->flags, &nts, &ots);
sys/compat/linux/linux_event.c
680
error = kern_timerfd_gettime(td, args->fd, &ots);
sys/compat/linux/linux_event.c
705
error = kern_timerfd_settime(td, args->fd, args->flags, &nts, NULL);
sys/compat/linux/linux_event.c
707
error = kern_timerfd_settime(td, args->fd, args->flags, &nts, &ots);
sys/compat/linux/linux_event.c
79
static int epoll_to_kevent(struct thread *td, int fd,
sys/compat/linux/linux_event.c
86
int fd, int filter, unsigned int flags);
sys/compat/linux/linux_event.c
88
int fd);
sys/compat/linux/linux_event.c
90
int fd);
sys/compat/linux/linux_file.c
1022
return (kern_fsync(td, uap->fd, false));
sys/compat/linux/linux_file.c
1038
error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, offset);
sys/compat/linux/linux_file.c
1041
error = fgetvp(td, uap->fd, &cap_pread_rights, &vp);
sys/compat/linux/linux_file.c
1062
return (linux_enobufs2eagain(td, uap->fd,
sys/compat/linux/linux_file.c
1063
kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, offset)));
sys/compat/linux/linux_file.c
1097
error = kern_preadv(td, uap->fd, auio, offset);
sys/compat/linux/linux_file.c
1124
error = kern_pwritev(td, uap->fd, auio, offset);
sys/compat/linux/linux_file.c
1126
return (linux_enobufs2eagain(td, uap->fd, error));
sys/compat/linux/linux_file.c
1373
return (kern_fcntl(td, args->fd, F_DUPFD, args->arg));
sys/compat/linux/linux_file.c
1376
return (kern_fcntl(td, args->fd, F_GETFD, 0));
sys/compat/linux/linux_file.c
1379
return (kern_fcntl(td, args->fd, F_SETFD, args->arg));
sys/compat/linux/linux_file.c
1382
error = kern_fcntl(td, args->fd, F_GETFL, 0);
sys/compat/linux/linux_file.c
1427
return (kern_fcntl(td, args->fd, F_SETFL, arg));
sys/compat/linux/linux_file.c
1435
error = kern_fcntl(td, args->fd, F_GETLK, (intptr_t)&bsd_flock);
sys/compat/linux/linux_file.c
1448
return (kern_fcntl(td, args->fd, F_SETLK,
sys/compat/linux/linux_file.c
1457
return (kern_fcntl(td, args->fd, F_SETLKW,
sys/compat/linux/linux_file.c
1461
return (kern_fcntl(td, args->fd, F_GETOWN, 0));
sys/compat/linux/linux_file.c
1469
error = fget(td, args->fd,
sys/compat/linux/linux_file.c
1479
return (kern_fcntl(td, args->fd, F_SETOWN, args->arg));
sys/compat/linux/linux_file.c
1482
return (kern_fcntl(td, args->fd, F_DUPFD_CLOEXEC, args->arg));
sys/compat/linux/linux_file.c
1488
error = kern_fcntl(td, args->fd, F_GET_SEALS, 0);
sys/compat/linux/linux_file.c
1496
return (kern_fcntl(td, args->fd, F_ADD_SEALS,
sys/compat/linux/linux_file.c
1500
error = fget(td, args->fd,
sys/compat/linux/linux_file.c
1515
KCMP_FILE, args->fd, args->arg);
sys/compat/linux/linux_file.c
1550
error = kern_fcntl(td, args->fd, F_GETLK, (intptr_t)&bsd_flock);
sys/compat/linux/linux_file.c
1563
return (kern_fcntl(td, args->fd, F_SETLK,
sys/compat/linux/linux_file.c
1572
return (kern_fcntl(td, args->fd, F_SETLKW,
sys/compat/linux/linux_file.c
1576
fcntl_args.fd = args->fd;
sys/compat/linux/linux_file.c
163
int fd;
sys/compat/linux/linux_file.c
1660
return (kern_posix_fadvise(td, args->fd, offset, args->len, advice));
sys/compat/linux/linux_file.c
1681
return (kern_posix_fadvise(td, args->fd, offset, len, advice));
sys/compat/linux/linux_file.c
1772
return (kern_posix_fallocate(td, args->fd, offset, len));
sys/compat/linux/linux_file.c
183
fd = td->td_retval[0];
sys/compat/linux/linux_file.c
184
if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) {
sys/compat/linux/linux_file.c
1900
linux_enobufs2eagain(struct thread *td, int fd, int error)
sys/compat/linux/linux_file.c
1906
if (fget(td, fd, &cap_no_rights, &fp) != 0)
sys/compat/linux/linux_file.c
1918
.fd = args->fd,
sys/compat/linux/linux_file.c
1923
return (linux_enobufs2eagain(td, args->fd, sys_write(td, &bargs)));
sys/compat/linux/linux_file.c
1939
error = kern_writev(td, args->fd, auio);
sys/compat/linux/linux_file.c
1941
return (linux_enobufs2eagain(td, args->fd, error));
sys/compat/linux/linux_file.c
2046
return (kern_inotify_add_watch(args->fd, AT_FDCWD, args->pathname,
sys/compat/linux/linux_file.c
2054
return (kern_inotify_rm_watch(args->fd, args->wd, td));
sys/compat/linux/linux_file.c
239
int error, fd, bsd_flags;
sys/compat/linux/linux_file.c
244
fd = args->dirfd;
sys/compat/linux/linux_file.c
245
if (fd == LINUX_AT_FDCWD)
sys/compat/linux/linux_file.c
246
fd = AT_FDCWD;
sys/compat/linux/linux_file.c
254
error = kern_getfhat(td, bsd_flags, fd, args->name,
sys/compat/linux/linux_file.c
330
error = kern_lseek(td, args->fd, off, args->whence);
sys/compat/linux/linux_file.c
356
linux_getdents_error(struct thread *td, int fd, int err)
sys/compat/linux/linux_file.c
363
error = getvnode(td, fd, &cap_read_rights, &fp);
sys/compat/linux/linux_file.c
407
linux_getdirentries(struct thread *td, int fd, caddr_t *bufp, int buflen,
sys/compat/linux/linux_file.c
416
error = kern_getdirentries(td, fd, *bufp, buflen,
sys/compat/linux/linux_file.c
457
error = linux_getdirentries(td, args->fd, &buf, buflen,
sys/compat/linux/linux_file.c
460
error = linux_getdents_error(td, args->fd, error);
sys/compat/linux/linux_file.c
535
error = linux_getdirentries(td, args->fd, &buf, buflen,
sys/compat/linux/linux_file.c
538
error = linux_getdents_error(td, args->fd, error);
sys/compat/linux/linux_file.c
607
error = linux_getdirentries(td, args->fd, &buf, buflen,
sys/compat/linux/linux_file.c
610
error = linux_getdents_error(td, args->fd, error);
sys/compat/linux/linux_file.c
948
return (kern_ftruncate(td, args->fd, args->length));
sys/compat/linux/linux_file.c
963
return (kern_ftruncate(td, args->fd, length));
sys/compat/linux/linux_file.c
999
return (kern_fsync(td, uap->fd, false));
sys/compat/linux/linux_ioctl.c
1513
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
186
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
2062
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
2327
linux_ioctl_socket_ifreq(struct thread *td, int fd, u_int cmd,
sys/compat/linux/linux_ioctl.c
2388
fd, cmd);
sys/compat/linux/linux_ioctl.c
2424
error = kern_ioctl(td, fd, cmd, (caddr_t)&bifr);
sys/compat/linux/linux_ioctl.c
2469
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
247
__func__, args->fd, args->cmd,
sys/compat/linux/linux_ioctl.c
2544
error = linux_ioctl_socket_ifreq(td, args->fd, args->cmd,
sys/compat/linux/linux_ioctl.c
2562
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
2591
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
265
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
2918
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
2938
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
2957
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
2971
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
2996
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3010
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3040
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3296
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3323
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3347
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3368
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3575
error = fget(td, args->fd,
sys/compat/linux/linux_ioctl.c
3672
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
3817
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
3865
__func__, args->fd, args->cmd,
sys/compat/linux/linux_ioctl.c
718
error = fget(td, args->fd, &cap_ioctl_rights, &fp);
sys/compat/linux/linux_ioctl.c
825
wr.fd = args->fd;
sys/compat/linux/linux_misc.c
2331
linux_to_bsd_poll_events(td, fds->fd,
sys/compat/linux/linux_misc.c
380
uap->flags, uap->fd, (uint64_t)(uint32_t)uap->pgoff * PAGE_SIZE));
sys/compat/linux/linux_misc.c
383
uap->flags, uap->fd, uap->pgoff));
sys/compat/linux/linux_mmap.c
136
fd = (bsd_flags & MAP_ANON) ? -1 : fd;
sys/compat/linux/linux_mmap.c
209
.mr_fd = fd,
sys/compat/linux/linux_mmap.c
79
int flags, int fd, off_t pos)
sys/compat/linux/linux_mmap.c
87
addr, len, prot, flags, fd, pos);
sys/compat/linux/linux_socket.c
1628
int i, fd, fds, *fdp;
sys/compat/linux/linux_socket.c
1634
fd = *fdp++;
sys/compat/linux/linux_socket.c
1635
(void)kern_fcntl(td, fd, F_SETFD, FD_CLOEXEC);
sys/compat/linux/linux_stats.c
109
linux_kern_fstat(struct thread *td, int fd, struct stat *sbp)
sys/compat/linux/linux_stats.c
115
AUDIT_ARG_FD(fd);
sys/compat/linux/linux_stats.c
117
error = fget(td, fd, &cap_fstat_rights, &fp);
sys/compat/linux/linux_stats.c
135
linux_kern_statat(struct thread *td, int flag, int fd, const char *path,
sys/compat/linux/linux_stats.c
147
AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights);
sys/compat/linux/linux_stats.c
152
error = linux_kern_fstat(td, fd, sbp);
sys/compat/linux/linux_stats.c
245
error = linux_kern_fstat(td, args->fd, &buf);
sys/compat/linux/linux_stats.c
492
error = kern_fstatfs(td, args->fd, bsd_statfs);
sys/compat/linux/linux_stats.c
510
error = kern_fstatfs(td, args->fd, bsd_statfs);
sys/compat/linux/linux_stats.c
627
error = linux_kern_fstat(td, args->fd, &buf);
sys/compat/linux/linux_stats.c
685
error = fgetvp(td, args->fd, &cap_fsync_rights, &vp);
sys/compat/linux/linux_xattr.c
149
error = getvnode(td, args->fd,
sys/compat/linux/linux_xattr.c
230
.fd = -1,
sys/compat/linux/linux_xattr.c
244
.fd = -1,
sys/compat/linux/linux_xattr.c
258
.fd = args->fd,
sys/compat/linux/linux_xattr.c
277
error = getvnode(td, args->fd,
sys/compat/linux/linux_xattr.c
305
.fd = -1,
sys/compat/linux/linux_xattr.c
318
.fd = -1,
sys/compat/linux/linux_xattr.c
331
.fd = args->fd,
sys/compat/linux/linux_xattr.c
421
error = getvnode(td, args->fd,
sys/compat/linux/linux_xattr.c
455
.fd = -1,
sys/compat/linux/linux_xattr.c
470
.fd = -1,
sys/compat/linux/linux_xattr.c
485
.fd = args->fd,
sys/compat/linux/linux_xattr.c
509
error = getvnode(td, args->fd, &rights, &fp);
sys/compat/linux/linux_xattr.c
562
.fd = -1,
sys/compat/linux/linux_xattr.c
578
.fd = -1,
sys/compat/linux/linux_xattr.c
59
int fd;
sys/compat/linux/linux_xattr.c
594
.fd = args->fd,
sys/compat/linux/linux_xattr.c
67
int fd;
sys/compat/linux/linux_xattr.c
77
int fd;
sys/compat/linux/linux_xattr.c
86
int fd;
sys/compat/linuxkpi/common/include/linux/eventfd.h
49
struct eventfd_ctx *lkpi_eventfd_ctx_fdget(int fd);
sys/compat/linuxkpi/common/include/linux/file.h
102
fdclose(curthread, file, fd);
sys/compat/linuxkpi/common/include/linux/file.h
109
fd_install(unsigned int fd, struct linux_file *filp)
sys/compat/linuxkpi/common/include/linux/file.h
113
if (fget_unlocked(curthread, fd, &cap_no_rights, &file) != 0) {
sys/compat/linuxkpi/common/include/linux/file.h
133
int fd;
sys/compat/linuxkpi/common/include/linux/file.h
135
error = falloc(curthread, &file, &fd, 0);
sys/compat/linuxkpi/common/include/linux/file.h
140
return fd;
sys/compat/linuxkpi/common/include/linux/file.h
148
int fd;
sys/compat/linuxkpi/common/include/linux/file.h
150
error = falloc(curthread, &file, &fd, flags);
sys/compat/linuxkpi/common/include/linux/file.h
155
return fd;
sys/compat/linuxkpi/common/include/linux/file.h
176
static inline void fdput(struct fd fd)
sys/compat/linuxkpi/common/include/linux/file.h
178
fput(fd.linux_file);
sys/compat/linuxkpi/common/include/linux/file.h
181
static inline struct fd fdget(unsigned int fd)
sys/compat/linuxkpi/common/include/linux/file.h
183
struct linux_file *f = linux_fget(fd);
sys/compat/linuxkpi/common/include/linux/file.h
184
return (struct fd){f};
sys/compat/linuxkpi/common/include/linux/file.h
187
#define fd_file(fd) ((fd).linux_file)
sys/compat/linuxkpi/common/include/linux/file.h
190
fd_empty(struct fd fd)
sys/compat/linuxkpi/common/include/linux/file.h
192
return (fd_file(fd) == NULL);
sys/compat/linuxkpi/common/include/linux/file.h
54
linux_fget(unsigned int fd)
sys/compat/linuxkpi/common/include/linux/file.h
59
if (fget_unlocked(curthread, fd, &cap_no_rights, &file) != 0)
sys/compat/linuxkpi/common/include/linux/file.h
90
put_unused_fd(unsigned int fd)
sys/compat/linuxkpi/common/include/linux/file.h
94
if (fget_unlocked(curthread, fd, &cap_no_rights, &file) != 0) {
sys/compat/linuxkpi/common/include/linux/fs.h
120
#define fasync_helper(fd, filp, on, queue) \
sys/compat/linuxkpi/common/src/linux_eventfd.c
37
lkpi_eventfd_ctx_fdget(int fd)
sys/compat/linuxkpi/common/src/linux_eventfd.c
43
if (fget_unlocked(curthread, fd, &cap_no_rights, &fp) != 0)
sys/dev/aac/aac_linux.c
75
error = fget(td, args->fd, cap_rights_init_one(&rights, CAP_IOCTL),
sys/dev/aacraid/aacraid_linux.c
77
if ((error = fget(td, args->fd,
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
1018
icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
1036
error = fget(curthread, fd,
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
1701
cxgbei_limits_fd(struct icl_drv_limits *idl, int fd)
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
1710
error = fget(curthread, fd,
sys/dev/dcons/dcons_crom.c
131
src = sc->fd.fc->crom_src;
sys/dev/dcons/dcons_crom.c
132
root = sc->fd.fc->crom_root;
sys/dev/dcons/dcons_crom.c
160
device_printf(sc->fd.dev,
sys/dev/dcons/dcons_crom.c
164
device_printf(sc->fd.dev, "dcons_paddr is already set\n");
sys/dev/dcons/dcons_crom.c
181
sc->fd.fc->poll(sc->fd.fc, -1, -1);
sys/dev/dcons/dcons_crom.c
193
sc->fd.fc = device_get_ivars(dev);
sys/dev/dcons/dcons_crom.c
194
sc->fd.dev = dev;
sys/dev/dcons/dcons_crom.c
195
sc->fd.post_explore = NULL;
sys/dev/dcons/dcons_crom.c
196
sc->fd.post_busreset = (void *) dcons_crom_post_busreset;
sys/dev/dcons/dcons_crom.c
200
/*parent*/ sc->fd.fc->dmat,
sys/dev/dcons/dcons_crom.c
234
sc->fd.post_busreset = NULL;
sys/dev/dcons/dcons_crom.c
75
struct firewire_dev_comm fd;
sys/dev/dpaa/dpaa_common.h
59
#define DPAA_FD_GET_ADDR(fd) ((void *)PHYS_TO_DMAP(fd->addr))
sys/dev/dpaa/dpaa_eth.c
618
struct dpaa_fd fd;
sys/dev/dpaa/dpaa_eth.c
700
fd.addr = pmap_kextract((vm_offset_t)&fi->fi_ic);
sys/dev/dpaa/dpaa_eth.c
701
fd.length = psize;
sys/dev/dpaa/dpaa_eth.c
702
fd.format = DPAA_FD_FORMAT_SHORT_MBSF;
sys/dev/dpaa/dpaa_eth.c
704
fd.liodn = 0;
sys/dev/dpaa/dpaa_eth.c
705
fd.bpid = 0;
sys/dev/dpaa/dpaa_eth.c
706
fd.eliodn = 0;
sys/dev/dpaa/dpaa_eth.c
707
fd.offset = offsetof(struct dpaa_eth_frame_info, fi_sgt) -
sys/dev/dpaa/dpaa_eth.c
709
fd.cmd_stat = dpaa_eth_tx_add_csum(fi);
sys/dev/dpaa/dpaa_eth.c
712
if (qman_fq_enqueue(sc->sc_tx_fq, &fd) != 0) {
sys/dev/dpaa/qman.h
120
struct qman_fd fd;
sys/dev/dpaa/qman.h
146
struct qman_fd fd;
sys/dev/dpaa/qman_portals.c
275
eqcr->fd = *frame;
sys/dev/dpaa/qman_portals.c
302
&dqrr->fd, fq->cb.ctx);
sys/dev/dpaa/qman_var.h
20
struct dpaa_fd fd;
sys/dev/dpaa2/dpaa2_frame.c
100
fd->data_length = (uint32_t)buf->m->m_pkthdr.len;
sys/dev/dpaa2/dpaa2_frame.c
101
fd->bpid_ivp_bmt = 0;
sys/dev/dpaa2/dpaa2_frame.c
102
fd->offset_fmt_sl = 0x2000u | tx_data_off;
sys/dev/dpaa2/dpaa2_frame.c
103
fd->ctrl = (0x4u & DPAA2_FD_PTAC_MASK) << DPAA2_FD_PTAC_SHIFT;
sys/dev/dpaa2/dpaa2_frame.c
109
dpaa2_fd_err(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
111
return ((fd->ctrl >> DPAA2_FD_ERR_SHIFT) & DPAA2_FD_ERR_MASK);
sys/dev/dpaa2/dpaa2_frame.c
115
dpaa2_fd_data_len(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
117
if (dpaa2_fd_short_len(fd)) {
sys/dev/dpaa2/dpaa2_frame.c
118
return (fd->data_length & DPAA2_FD_LEN_MASK);
sys/dev/dpaa2/dpaa2_frame.c
120
return (fd->data_length);
sys/dev/dpaa2/dpaa2_frame.c
124
dpaa2_fd_format(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
126
return ((enum dpaa2_fd_format)((fd->offset_fmt_sl >>
sys/dev/dpaa2/dpaa2_frame.c
131
dpaa2_fd_short_len(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
133
return (((fd->offset_fmt_sl >> DPAA2_FD_SL_SHIFT)
sys/dev/dpaa2/dpaa2_frame.c
138
dpaa2_fd_offset(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
140
return (fd->offset_fmt_sl & DPAA2_FD_OFFSET_MASK);
sys/dev/dpaa2/dpaa2_frame.c
144
dpaa2_fd_get_frc(struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
147
return (le32toh(fd->frame_ctx));
sys/dev/dpaa2/dpaa2_frame.c
152
dpaa2_fd_set_frc(struct dpaa2_fd *fd, uint32_t frc)
sys/dev/dpaa2/dpaa2_frame.c
155
fd->frame_ctx = htole32(frc);
sys/dev/dpaa2/dpaa2_frame.c
160
dpaa2_fa_get_swa(struct dpaa2_fd *fd, struct dpaa2_swa **swa)
sys/dev/dpaa2/dpaa2_frame.c
162
if (__predict_false(fd == NULL || swa == NULL))
sys/dev/dpaa2/dpaa2_frame.c
165
if (((fd->ctrl >> DPAA2_FD_PTAC_SHIFT) & DPAA2_FD_PTAC_PTA_MASK) == 0u) {
sys/dev/dpaa2/dpaa2_frame.c
170
*swa = (struct dpaa2_swa *)PHYS_TO_DMAP((bus_addr_t)fd->addr);
sys/dev/dpaa2/dpaa2_frame.c
176
dpaa2_fa_get_hwa(struct dpaa2_fd *fd, struct dpaa2_hwa **hwa)
sys/dev/dpaa2/dpaa2_frame.c
181
if (__predict_false(fd == NULL || hwa == NULL))
sys/dev/dpaa2/dpaa2_frame.c
188
if (((fd->ctrl >> DPAA2_FD_ASAL_SHIFT) & DPAA2_FD_ASAL_MASK) == 0u) {
sys/dev/dpaa2/dpaa2_frame.c
193
buf = (uint8_t *)PHYS_TO_DMAP((bus_addr_t)fd->addr);
sys/dev/dpaa2/dpaa2_frame.c
194
hwo = ((fd->ctrl >> DPAA2_FD_PTAC_SHIFT) & DPAA2_FD_PTAC_PTA_MASK) > 0u
sys/dev/dpaa2/dpaa2_frame.c
202
dpaa2_fa_get_fas(struct dpaa2_fd *fd, struct dpaa2_hwa_fas *fas)
sys/dev/dpaa2/dpaa2_frame.c
208
if (__predict_false(fd == NULL || fas == NULL))
sys/dev/dpaa2/dpaa2_frame.c
211
rc = dpaa2_fa_get_hwa(fd, &hwa);
sys/dev/dpaa2/dpaa2_frame.c
223
dpaa2_fa_set_fas(struct dpaa2_fd *fd, struct dpaa2_hwa_fas *fas)
sys/dev/dpaa2/dpaa2_frame.c
229
if (__predict_false(fd == NULL || fas == NULL))
sys/dev/dpaa2/dpaa2_frame.c
232
rc = dpaa2_fa_get_hwa(fd, &hwa);
sys/dev/dpaa2/dpaa2_frame.c
50
bus_dma_segment_t *segs, const int nsegs, struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_frame.c
57
if (buf == NULL || segs == NULL || nsegs == 0 || fd == NULL)
sys/dev/dpaa2/dpaa2_frame.c
65
memset(fd, 0, sizeof(*fd));
sys/dev/dpaa2/dpaa2_frame.c
99
fd->addr = buf->paddr;
sys/dev/dpaa2/dpaa2_io.c
353
struct dpaa2_fd *fd, int frames_n)
sys/dev/dpaa2/dpaa2_io.c
366
return (dpaa2_swp_enq_mult(swp, &ed, fd, &flags, frames_n));
sys/dev/dpaa2/dpaa2_ni.c
2970
struct dpaa2_fd fd;
sys/dev/dpaa2/dpaa2_ni.c
3026
error = dpaa2_fd_build(dev, sc->tx_data_off, buf, segs, nsegs, &fd);
sys/dev/dpaa2/dpaa2_ni.c
3042
rc = DPAA2_SWP_ENQ_MULTIPLE_FQ(fq->chan->io_dev, tx->fqid, &fd, 1);
sys/dev/dpaa2/dpaa2_ni.c
3077
struct dpaa2_fd *fd;
sys/dev/dpaa2/dpaa2_ni.c
3090
fd = &dq->fdr.fd;
sys/dev/dpaa2/dpaa2_ni.c
3095
(void)dpaa2_ni_rx(chan, fq, fd, &ctx);
sys/dev/dpaa2/dpaa2_ni.c
3098
(void)dpaa2_ni_rx_err(chan, fq, fd);
sys/dev/dpaa2/dpaa2_ni.c
3101
(void)dpaa2_ni_tx_conf(chan, fq, fd);
sys/dev/dpaa2/dpaa2_ni.c
3111
fd = &dq->fdr.fd;
sys/dev/dpaa2/dpaa2_ni.c
3121
(void)dpaa2_ni_rx(chan, fq, fd, &ctx);
sys/dev/dpaa2/dpaa2_ni.c
3124
(void)dpaa2_ni_rx_err(chan, fq, fd);
sys/dev/dpaa2/dpaa2_ni.c
3127
(void)dpaa2_ni_tx_conf(chan, fq, fd);
sys/dev/dpaa2/dpaa2_ni.c
3163
struct dpaa2_fd *fd, struct dpaa2_ni_rx_ctx *ctx)
sys/dev/dpaa2/dpaa2_ni.c
3178
error = dpaa2_fa_get_swa(fd, &swa);
sys/dev/dpaa2/dpaa2_ni.c
3183
paddr = (bus_addr_t)fd->addr;
sys/dev/dpaa2/dpaa2_ni.c
3201
switch (dpaa2_fd_err(fd)) {
sys/dev/dpaa2/dpaa2_ni.c
3221
switch (dpaa2_fd_format(fd)) {
sys/dev/dpaa2/dpaa2_ni.c
3240
buf_len = dpaa2_fd_data_len(fd);
sys/dev/dpaa2/dpaa2_ni.c
3241
buf_data = (uint8_t *)buf->vaddr + dpaa2_fd_offset(fd);
sys/dev/dpaa2/dpaa2_ni.c
3264
error = dpaa2_ni_update_csum_flags(fd, m);
sys/dev/dpaa2/dpaa2_ni.c
3336
struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_ni.c
3347
error = dpaa2_fa_get_swa(fd, &swa);
sys/dev/dpaa2/dpaa2_ni.c
3352
paddr = (bus_addr_t)fd->addr;
sys/dev/dpaa2/dpaa2_ni.c
3389
struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_ni.c
3399
error = dpaa2_fa_get_swa(fd, &swa);
sys/dev/dpaa2/dpaa2_ni.c
3404
paddr = (bus_addr_t)fd->addr;
sys/dev/dpaa2/dpaa2_ni.c
3777
dpaa2_ni_update_csum_flags(struct dpaa2_fd *fd, struct mbuf *m)
sys/dev/dpaa2/dpaa2_ni.c
3783
if (__predict_false((dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) == 0u)
sys/dev/dpaa2/dpaa2_ni.c
3797
rc = dpaa2_fa_get_fas(fd, &fas);
sys/dev/dpaa2/dpaa2_swp.c
791
struct dpaa2_fd *fd)
sys/dev/dpaa2/dpaa2_swp.c
794
int rc = dpaa2_swp_enq_mult(swp, ed, fd, &flags, 1);
sys/dev/dpaa2/dpaa2_swp.c
812
struct dpaa2_fd *fd, uint32_t *flags, int frames_n)
sys/dev/dpaa2/dpaa2_swp.c
817
const uint64_t *fd_pdat64 = (const uint64_t *) fd;
sys/dev/dpaa2/dpaa2_swp.c
824
if (swp == NULL || ed == NULL || fd == NULL || flags == NULL ||
sys/dev/dpaa2/dpaa2_swp.h
302
struct dpaa2_fd fd;
sys/dev/dpaa2/dpaa2_swp.h
479
struct dpaa2_fd *fd);
sys/dev/dpaa2/dpaa2_swp.h
481
struct dpaa2_fd *fd, uint32_t *flags, int frames_n);
sys/dev/drm2/drm.h
630
__s32 fd;
sys/dev/fdc/fdc.c
1001
head << 2 | fd->fdsu, 0))
sys/dev/fdc/fdc.c
1008
head << 2 | fd->fdsu, /* head & unit */
sys/dev/fdc/fdc.c
1009
fd->track, /* track */
sys/dev/fdc/fdc.c
1012
fd->ft->secsize, /* sector size */
sys/dev/fdc/fdc.c
1013
fd->ft->sectrac, /* sectors/track */
sys/dev/fdc/fdc.c
1014
fd->ft->gap, /* gap size */
sys/dev/fdc/fdc.c
1015
fd->ft->datalen, /* data length */
sys/dev/fdc/fdc.c
1023
head << 2 | fd->fdsu, /* head & unit */
sys/dev/fdc/fdc.c
1024
fd->track, /* track */
sys/dev/fdc/fdc.c
1027
fd->ft->secsize, /* sector size */
sys/dev/fdc/fdc.c
1028
fd->ft->sectrac, /* sectors/track */
sys/dev/fdc/fdc.c
1029
fd->ft->gap, /* gap size */
sys/dev/fdc/fdc.c
1030
fd->ft->datalen, /* data length */
sys/dev/fdc/fdc.c
1046
if (fd->flags & FD_ISADMA) {
sys/dev/fdc/fdc.c
1049
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
sys/dev/fdc/fdc.c
1051
fd->flags &= ~FD_ISADMA;
sys/dev/fdc/fdc.c
1097
need_recal |= (1 << fd->fdsu);
sys/dev/fdc/fdc.c
1106
if (fd->options & FDOPT_NOERROR)
sys/dev/fdc/fdc.c
1127
bp->bio_resid -= fd->fd_iosize;
sys/dev/fdc/fdc.c
1128
bp->bio_completed += fd->fd_iosize;
sys/dev/fdc/fdc.c
1129
fd->fd_ioptr += fd->fd_iosize;
sys/dev/fdc/fdc.c
1178
fd_enqueue(struct fd_data *fd, struct bio *bp)
sys/dev/fdc/fdc.c
1182
fdc = fd->fdc;
sys/dev/fdc/fdc.c
1185
if (fd->fd_iocount++ == 0)
sys/dev/fdc/fdc.c
1186
callout_stop(&fd->toffhandle);
sys/dev/fdc/fdc.c
1187
if (fd->flags & FD_MOTOR) {
sys/dev/fdc/fdc.c
1193
bioq_insert_tail(&fd->fd_bq, bp);
sys/dev/fdc/fdc.c
1194
if (!(fd->flags & FD_MOTORWAIT))
sys/dev/fdc/fdc.c
1195
fd_motor(fd, 1);
sys/dev/fdc/fdc.c
1204
fd_probe_disk(struct fd_data *fd, int *recal)
sys/dev/fdc/fdc.c
1210
fdc = fd->fdc;
sys/dev/fdc/fdc.c
1211
oopts = fd->options;
sys/dev/fdc/fdc.c
1212
fd->options |= FDOPT_NOERRLOG | FDOPT_NORETRY;
sys/dev/fdc/fdc.c
1222
fd->flags |= FD_NEWDISK;
sys/dev/fdc/fdc.c
1224
if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0))
sys/dev/fdc/fdc.c
1233
if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, 1, 0))
sys/dev/fdc/fdc.c
1238
*recal |= (1 << fd->fdsu);
sys/dev/fdc/fdc.c
1243
fd->flags |= FD_EMPTY;
sys/dev/fdc/fdc.c
1251
fd->flags &= ~FD_EMPTY;
sys/dev/fdc/fdc.c
1253
fd->flags |= FD_WP;
sys/dev/fdc/fdc.c
1255
fd->flags &= ~FD_WP;
sys/dev/fdc/fdc.c
1261
fd->options = oopts;
sys/dev/fdc/fdc.c
1266
fdmisccmd(struct fd_data *fd, u_int cmd, void *data)
sys/dev/fdc/fdc.c
1284
(finfo->cyl * fd->ft->heads + finfo->head) *
sys/dev/fdc/fdc.c
1285
fd->ft->sectrac;
sys/dev/fdc/fdc.c
1290
(idfield->cyl * fd->ft->heads + idfield->head) *
sys/dev/fdc/fdc.c
1291
fd->ft->sectrac;
sys/dev/fdc/fdc.c
1297
bp->bio_offset = bp->bio_pblkno * fd->sectorsize;
sys/dev/fdc/fdc.c
1299
bp->bio_driver1 = fd;
sys/dev/fdc/fdc.c
1302
fd_enqueue(fd, bp);
sys/dev/fdc/fdc.c
1317
fdautoselect(struct fd_data *fd)
sys/dev/fdc/fdc.c
1323
if (!(fd->ft->flags & FL_AUTO))
sys/dev/fdc/fdc.c
1326
fdtp = fd_native_types[fd->type];
sys/dev/fdc/fdc.c
1327
fdsettype(fd, fdtp);
sys/dev/fdc/fdc.c
1328
if (!(fd->ft->flags & FL_AUTO))
sys/dev/fdc/fdc.c
1351
oopts = fd->options;
sys/dev/fdc/fdc.c
1352
fd->options |= FDOPT_NOERRLOG | FDOPT_NORETRY;
sys/dev/fdc/fdc.c
1354
fdsettype(fd, fdtp);
sys/dev/fdc/fdc.c
1357
rv = fdmisccmd(fd, BIO_RDID, &id);
sys/dev/fdc/fdc.c
1363
id.head = fd->ft->heads - 1;
sys/dev/fdc/fdc.c
1364
rv = fdmisccmd(fd, BIO_RDID, &id);
sys/dev/fdc/fdc.c
1372
fd->options = oopts;
sys/dev/fdc/fdc.c
1375
device_printf(fd->dev, "autoselection failed\n");
sys/dev/fdc/fdc.c
1376
fdsettype(fd, fd_native_types[fd->type]);
sys/dev/fdc/fdc.c
1380
device_printf(fd->dev,
sys/dev/fdc/fdc.c
1382
fd->ft->size / 2);
sys/dev/fdc/fdc.c
1383
fdprinttype(fd->ft);
sys/dev/fdc/fdc.c
1410
struct fd_data *fd;
sys/dev/fdc/fdc.c
1414
fd = pp->geom->softc;
sys/dev/fdc/fdc.c
1415
fdc = fd->fdc;
sys/dev/fdc/fdc.c
1429
fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | FDOPT_NOERROR);
sys/dev/fdc/fdc.c
1434
if (fdmisccmd(fd, BIO_PROBE, NULL))
sys/dev/fdc/fdc.c
1436
if (fd->flags & FD_EMPTY)
sys/dev/fdc/fdc.c
1438
if (fd->flags & FD_NEWDISK) {
sys/dev/fdc/fdc.c
1439
if (fdautoselect(fd) != 0 &&
sys/dev/fdc/fdc.c
1440
(device_get_flags(fd->dev) & FD_NO_CHLINE)) {
sys/dev/fdc/fdc.c
1442
fd->flags |= FD_EMPTY;
sys/dev/fdc/fdc.c
1447
fd->flags &= ~FD_NEWDISK;
sys/dev/fdc/fdc.c
1452
if (w > 0 && (fd->flags & FD_WP)) {
sys/dev/fdc/fdc.c
1456
pp->sectorsize = fd->sectorsize;
sys/dev/fdc/fdc.c
1457
pp->stripesize = fd->ft->heads * fd->ft->sectrac * fd->sectorsize;
sys/dev/fdc/fdc.c
1458
pp->mediasize = pp->stripesize * fd->ft->tracks;
sys/dev/fdc/fdc.c
1465
struct fd_data * fd;
sys/dev/fdc/fdc.c
1467
fd = bp->bio_to->geom->softc;
sys/dev/fdc/fdc.c
1468
bp->bio_driver1 = fd;
sys/dev/fdc/fdc.c
1470
if (g_handleattr_int(bp, "GEOM::fwsectors", fd->ft->sectrac))
sys/dev/fdc/fdc.c
1472
if (g_handleattr_int(bp, "GEOM::fwheads", fd->ft->heads))
sys/dev/fdc/fdc.c
1481
bp->bio_pblkno = bp->bio_offset / fd->sectorsize;
sys/dev/fdc/fdc.c
1483
fd_enqueue(fd, bp);
sys/dev/fdc/fdc.c
1490
struct fd_data *fd;
sys/dev/fdc/fdc.c
1495
fd = pp->geom->softc;
sys/dev/fdc/fdc.c
1499
*(struct fd_type *)data = *fd->ft;
sys/dev/fdc/fdc.c
1508
fd->fts = *(struct fd_type *)data;
sys/dev/fdc/fdc.c
1509
if (fd->fts.sectrac) {
sys/dev/fdc/fdc.c
1511
fdsettype(fd, &fd->fts);
sys/dev/fdc/fdc.c
1513
fdsettype(fd, fd_native_types[fd->type]);
sys/dev/fdc/fdc.c
1516
fdprinttype(fd->ft);
sys/dev/fdc/fdc.c
1520
*(int *)data = fd->options;
sys/dev/fdc/fdc.c
1524
fd->options = *(int *)data;
sys/dev/fdc/fdc.c
1531
fd->fdc->fdc_errs = 0;
sys/dev/fdc/fdc.c
1536
if ((fd->fdc->flags & FDC_STAT_VALID) == 0)
sys/dev/fdc/fdc.c
1538
memcpy(fsp->status, fd->fdc->status, 7 * sizeof(u_int));
sys/dev/fdc/fdc.c
1542
*(enum fd_drivetype *)data = fd->type;
sys/dev/fdc/fdc.c
1551
error = fdmisccmd(fd, BIO_FMT, data);
sys/dev/fdc/fdc.c
1552
mtx_lock(&fd->fdc->fdc_mtx);
sys/dev/fdc/fdc.c
1553
fd->flags |= FD_NEWDISK;
sys/dev/fdc/fdc.c
1554
mtx_unlock(&fd->fdc->fdc_mtx);
sys/dev/fdc/fdc.c
1561
error = fdmisccmd(fd, BIO_RDID, data);
sys/dev/fdc/fdc.c
1886
struct fd_data *fd;
sys/dev/fdc/fdc.c
1892
fd = device_get_softc(dev);
sys/dev/fdc/fdc.c
1896
fd->dev = dev;
sys/dev/fdc/fdc.c
1897
fd->fdc = fdc;
sys/dev/fdc/fdc.c
1898
fd->fdsu = fdsu;
sys/dev/fdc/fdc.c
1903
fd->type = type;
sys/dev/fdc/fdc.c
1907
fd->flags = FD_EMPTY;
sys/dev/fdc/fdc.c
1908
fd->type = type;
sys/dev/fdc/fdc.c
1913
if (fd->type == FDT_NONE && (unit == 0 || unit == 1)) {
sys/dev/fdc/fdc.c
1916
fd->type = (rtcin(RTC_FDISKETTE) & 0xf0) >> 4;
sys/dev/fdc/fdc.c
1918
fd->type = rtcin(RTC_FDISKETTE) & 0x0f;
sys/dev/fdc/fdc.c
1919
if (fd->type == FDT_288M_1)
sys/dev/fdc/fdc.c
1920
fd->type = FDT_288M;
sys/dev/fdc/fdc.c
1924
if (fd->type == FDT_NONE)
sys/dev/fdc/fdc.c
1930
fd_select(fd);
sys/dev/fdc/fdc.c
1931
fd_motor(fd, 1);
sys/dev/fdc/fdc.c
1932
fdc->fd = fd;
sys/dev/fdc/fdc.c
1969
fd_motor(fd, 0);
sys/dev/fdc/fdc.c
1970
fdc->fd = NULL;
sys/dev/fdc/fdc.c
1979
switch (fd->type) {
sys/dev/fdc/fdc.c
1998
fd->track = FD_NO_TRACK;
sys/dev/fdc/fdc.c
1999
fd->fdc = fdc;
sys/dev/fdc/fdc.c
2000
fd->fdsu = fdsu;
sys/dev/fdc/fdc.c
2001
fd->options = 0;
sys/dev/fdc/fdc.c
2002
callout_init_mtx(&fd->toffhandle, &fd->fdc->fdc_mtx, 0);
sys/dev/fdc/fdc.c
2005
fdsettype(fd, fd_native_types[fd->type]);
sys/dev/fdc/fdc.c
2017
struct fd_data *fd;
sys/dev/fdc/fdc.c
2019
fd = arg;
sys/dev/fdc/fdc.c
2021
fd->fd_geom = g_new_geomf(&g_fd_class,
sys/dev/fdc/fdc.c
2022
"fd%d", device_get_unit(fd->dev));
sys/dev/fdc/fdc.c
2023
fd->fd_provider = g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name);
sys/dev/fdc/fdc.c
2024
fd->fd_geom->softc = fd;
sys/dev/fdc/fdc.c
2025
g_error_provider(fd->fd_provider, 0);
sys/dev/fdc/fdc.c
2031
struct fd_data *fd;
sys/dev/fdc/fdc.c
2033
fd = device_get_softc(dev);
sys/dev/fdc/fdc.c
2034
g_post_event(fd_attach2, fd, M_WAITOK, NULL);
sys/dev/fdc/fdc.c
2035
fd->flags |= FD_EMPTY;
sys/dev/fdc/fdc.c
2036
bioq_init(&fd->fd_bq);
sys/dev/fdc/fdc.c
2044
struct fd_data *fd;
sys/dev/fdc/fdc.c
2046
fd = pp->geom->softc;
sys/dev/fdc/fdc.c
2047
fd->gone = true;
sys/dev/fdc/fdc.c
2048
wakeup(fd);
sys/dev/fdc/fdc.c
2054
struct fd_data *fd = arg;
sys/dev/fdc/fdc.c
2057
g_wither_geom(fd->fd_geom, ENXIO);
sys/dev/fdc/fdc.c
2063
struct fd_data *fd;
sys/dev/fdc/fdc.c
2065
fd = device_get_softc(dev);
sys/dev/fdc/fdc.c
2067
g_waitfor_event(fd_detach_geom, fd, M_WAITOK, NULL);
sys/dev/fdc/fdc.c
2068
while (!fd->gone) {
sys/dev/fdc/fdc.c
2069
tsleep(fd, PZERO, "fdgone", hz/10);
sys/dev/fdc/fdc.c
2077
callout_drain(&fd->toffhandle);
sys/dev/fdc/fdc.c
2106
DRIVER_MODULE(fd, fdc, fd_driver, fdc_modevent, 0);
sys/dev/fdc/fdc.c
308
fdsettype(struct fd_data *fd, struct fd_type *ft)
sys/dev/fdc/fdc.c
310
fd->ft = ft;
sys/dev/fdc/fdc.c
312
fd->sectorsize = 128 << fd->ft->secsize;
sys/dev/fdc/fdc.c
559
if (fdc_cmd(fdc, 2, NE7CMD_SENSED, fdc->fd->fdsu, 1, &st3))
sys/dev/fdc/fdc.c
620
fd_select(struct fd_data *fd)
sys/dev/fdc/fdc.c
625
fdc = fd->fdc;
sys/dev/fdc/fdc.c
627
fdc->fdout |= FDO_FDMAEN | FDO_FRST | fd->fdsu;
sys/dev/fdc/fdc.c
634
struct fd_data *fd;
sys/dev/fdc/fdc.c
638
fd = arg;
sys/dev/fdc/fdc.c
639
mtx_assert(&fd->fdc->fdc_mtx, MA_OWNED);
sys/dev/fdc/fdc.c
640
fd->flags &= ~FD_MOTORWAIT;
sys/dev/fdc/fdc.c
641
fd->flags |= FD_MOTOR;
sys/dev/fdc/fdc.c
644
bp = bioq_takefirst(&fd->fd_bq);
sys/dev/fdc/fdc.c
647
bioq_disksort(&fd->fdc->head, bp);
sys/dev/fdc/fdc.c
651
wakeup(&fd->fdc->head);
sys/dev/fdc/fdc.c
655
fd_motor(struct fd_data *fd, int turnon)
sys/dev/fdc/fdc.c
659
fdc = fd->fdc;
sys/dev/fdc/fdc.c
664
fd->flags |= FD_MOTORWAIT;
sys/dev/fdc/fdc.c
665
fdc->fdout |= (FDO_MOEN0 << fd->fdsu);
sys/dev/fdc/fdc.c
666
callout_reset(&fd->toffhandle, hz, fd_turnon, fd);
sys/dev/fdc/fdc.c
668
callout_stop(&fd->toffhandle);
sys/dev/fdc/fdc.c
669
fd->flags &= ~(FD_MOTOR|FD_MOTORWAIT);
sys/dev/fdc/fdc.c
670
fdc->fdout &= ~(FDO_MOEN0 << fd->fdsu);
sys/dev/fdc/fdc.c
678
struct fd_data *fd = xfd;
sys/dev/fdc/fdc.c
680
mtx_assert(&fd->fdc->fdc_mtx, MA_OWNED);
sys/dev/fdc/fdc.c
681
fd_motor(fd, 0);
sys/dev/fdc/fdc.c
714
cptr = fdc->fd->fd_ioptr;
sys/dev/fdc/fdc.c
715
count = fdc->fd->fd_iosize;
sys/dev/fdc/fdc.c
731
struct fd_data *fd;
sys/dev/fdc/fdc.c
734
fd = fdc->fd;
sys/dev/fdc/fdc.c
738
if (--fd->fd_iocount == 0)
sys/dev/fdc/fdc.c
739
callout_reset(&fd->toffhandle, 4 * hz, fd_turnoff, fd);
sys/dev/fdc/fdc.c
741
fdc->fd = NULL;
sys/dev/fdc/fdc.c
744
if ((debugflags & 2) && fd->fdc->retry > 0)
sys/dev/fdc/fdc.c
745
printf("retries: %d\n", fd->fdc->retry);
sys/dev/fdc/fdc.c
760
struct fd_data *fd;
sys/dev/fdc/fdc.c
774
fd = fdc->fd;
sys/dev/fdc/fdc.c
776
(fdc->retry >= retries || (fd->options & FDOPT_NORETRY))) {
sys/dev/fdc/fdc.c
781
fd->flags |= FD_EMPTY;
sys/dev/fdc/fdc.c
788
if (fd != NULL && (fd->flags & FD_ISADMA)) {
sys/dev/fdc/fdc.c
791
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
sys/dev/fdc/fdc.c
793
fd->flags &= ~FD_ISADMA;
sys/dev/fdc/fdc.c
832
fd = fdc->fd = bp->bio_driver1;
sys/dev/fdc/fdc.c
834
fd->fd_ioptr = bp->bio_data;
sys/dev/fdc/fdc.c
837
fd->fd_ioptr += i;
sys/dev/fdc/fdc.c
838
fd->fd_iosize = bp->bio_length - i;
sys/dev/fdc/fdc.c
843
fd_select(fd);
sys/dev/fdc/fdc.c
845
fddsr_wr(fdc, fd->ft->trans);
sys/dev/fdc/fdc.c
847
fdctl_wr(fdc, fd->ft->trans);
sys/dev/fdc/fdc.c
850
if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) &&
sys/dev/fdc/fdc.c
852
!(fd->flags & FD_EMPTY)) ||
sys/dev/fdc/fdc.c
853
fd_probe_disk(fd, &need_recal) == 0)
sys/dev/fdc/fdc.c
861
if (fd->flags & FD_EMPTY)
sys/dev/fdc/fdc.c
869
fd->flags |= FD_EMPTY;
sys/dev/fdc/fdc.c
870
fd->flags |= FD_NEWDISK;
sys/dev/fdc/fdc.c
873
g_orphan_provider(fd->fd_provider, ENXIO);
sys/dev/fdc/fdc.c
874
fd->fd_provider->flags |= G_PF_WITHER;
sys/dev/fdc/fdc.c
875
fd->fd_provider =
sys/dev/fdc/fdc.c
876
g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name);
sys/dev/fdc/fdc.c
877
g_error_provider(fd->fd_provider, 0);
sys/dev/fdc/fdc.c
891
mfm = (fd->ft->flags & FL_MFM)? NE7CMD_MFM: 0;
sys/dev/fdc/fdc.c
892
steptrac = (fd->ft->flags & FL_2STEP)? 2: 1;
sys/dev/fdc/fdc.c
893
i = fd->ft->sectrac * fd->ft->heads;
sys/dev/fdc/fdc.c
898
head = sec / fd->ft->sectrac;
sys/dev/fdc/fdc.c
899
sec = sec % fd->ft->sectrac + 1;
sys/dev/fdc/fdc.c
904
fd->fd_iosize = imin(nsect * fd->sectorsize, bp->bio_resid);
sys/dev/fdc/fdc.c
905
nsect = fd->fd_iosize / fd->sectorsize;
sys/dev/fdc/fdc.c
907
fd->fd_iosize = fd->sectorsize;
sys/dev/fdc/fdc.c
912
if ((need_recal & (1 << fd->fdsu)) ||
sys/dev/fdc/fdc.c
913
(cylinder == 0 && fd->track != 0) ||
sys/dev/fdc/fdc.c
916
if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0))
sys/dev/fdc/fdc.c
925
need_recal &= ~(1 << fd->fdsu);
sys/dev/fdc/fdc.c
926
fd->track = 0;
sys/dev/fdc/fdc.c
929
tsleep(fdc->fd, PRIBIO, "fdhdstl", settle);
sys/dev/fdc/fdc.c
935
if (cylinder != fd->track) {
sys/dev/fdc/fdc.c
937
if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, descyl, 0))
sys/dev/fdc/fdc.c
945
need_recal |= (1 << fd->fdsu);
sys/dev/fdc/fdc.c
950
tsleep(fdc->fd, PRIBIO, "fdhdstl", settle);
sys/dev/fdc/fdc.c
952
fd->track = cylinder;
sys/dev/fdc/fdc.c
956
bp->bio_cmd, bp->bio_pblkno, fd->fd_iosize,
sys/dev/fdc/fdc.c
957
fd->fd_ioptr, fdc->retry);
sys/dev/fdc/fdc.c
966
fd->fd_ioptr, fd->fd_iosize, fdc->dmachan);
sys/dev/fdc/fdc.c
968
fd->flags |= FD_ISADMA;
sys/dev/fdc/fdc.c
977
fdbcdr_wr(fdc, 1, fd->fd_iosize);
sys/dev/fdc/fdc.c
990
head << 2 | fd->fdsu,
sys/dev/fdc/fdcvar.h
49
struct fd_data *fd; /* The active drive */
sys/dev/filemon/filemon_wrapper.c
149
int fd)
sys/dev/filemon/filemon_wrapper.c
168
if (filemon->fname1[0] != '/' && fd != AT_FDCWD) {
sys/dev/filemon/filemon_wrapper.c
184
if (getvnode(td, fd,
sys/dev/filemon/filemon_wrapper.c
229
_filemon_wrapper_openat(td, uap->path, uap->flag, uap->fd);
sys/dev/firewire/fwcam.c
1036
sc->fd.dev = dev;
sys/dev/firewire/fwcam.c
1037
sc->fd.fc = fw_get_comm(dev);
sys/dev/firewire/fwcam.c
153
err = fw_read_quadlet(sc->fd.fc, M_FWCAM, dst, spd,
sys/dev/firewire/fwcam.c
177
err = fw_write_quadlet(sc->fd.fc, M_FWCAM, dst, spd,
sys/dev/firewire/fwcam.c
192
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
199
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
247
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
265
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
284
device_printf(sc->fd.dev, "camera power-on timeout (5s)\n");
sys/dev/firewire/fwcam.c
299
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
369
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwcam.c
389
device_printf(sc->fd.dev, "no IR DMA channel available\n");
sys/dev/firewire/fwcam.c
432
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
439
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
446
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
454
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
466
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
483
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
488
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
495
device_printf(sc->fd.dev,
sys/dev/firewire/fwcam.c
533
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwcam.c
597
m = fw_iso_dequeue(xferq, sxfer, sc->fd.fc);
sys/dev/firewire/fwcam.c
651
fw_iso_rearm_done(xferq, sc->fd.fc, &sc->mtx, &sc->iso_active,
sys/dev/firewire/fwcam.h
285
struct firewire_dev_comm fd; /* must be first */
sys/dev/firewire/fwdv.c
1012
fw_bindremove(sc->fd.fc, &sc->fcp_bind);
sys/dev/firewire/fwdv.c
109
return (fw_read_quadlet(sc->fd.fc, M_FWDV, dst, spd,
sys/dev/firewire/fwdv.c
203
xfer->fc = sc->fd.fc;
sys/dev/firewire/fwdv.c
331
device_printf(sc->fd.dev,
sys/dev/firewire/fwdv.c
336
device_printf(sc->fd.dev,
sys/dev/firewire/fwdv.c
367
device_printf(sc->fd.dev, "%s rejected: 0x%02x\n",
sys/dev/firewire/fwdv.c
401
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwdv.c
433
device_printf(sc->fd.dev, "no IR DMA channel available\n");
sys/dev/firewire/fwdv.c
475
device_printf(sc->fd.dev, "failed to start IR DMA: %d\n", err);
sys/dev/firewire/fwdv.c
511
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwdv.c
574
m = fw_iso_dequeue(xferq, sxfer, sc->fd.fc);
sys/dev/firewire/fwdv.c
666
fw_iso_rearm_done(xferq, sc->fd.fc, &sc->mtx, &sc->iso_active,
sys/dev/firewire/fwdv.c
882
device_printf(sc->fd.dev,
sys/dev/firewire/fwdv.c
936
sc->fd.dev = dev;
sys/dev/firewire/fwdv.c
937
sc->fd.fc = fw_get_comm(dev);
sys/dev/firewire/fwdv.c
938
fc = sc->fd.fc;
sys/dev/firewire/fwdv.h
149
struct firewire_dev_comm fd;
sys/dev/firewire/fwisound.c
201
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwisound.c
306
struct firewire_comm *fc = sc->fd.fc;
sys/dev/firewire/fwisound.c
366
m = fw_iso_dequeue(xferq, sxfer, sc->fd.fc);
sys/dev/firewire/fwisound.c
432
fw_iso_rearm_done(xferq, sc->fd.fc, &sc->mtx, &sc->iso_active,
sys/dev/firewire/fwisound.c
472
sc->fd.dev = dev;
sys/dev/firewire/fwisound.c
473
sc->fd.fc = fw_get_comm(dev);
sys/dev/firewire/fwisound.c
73
err = fw_read_quadlet(sc->fd.fc, M_FWISOUND, dst, spd,
sys/dev/firewire/fwisound.c
97
err = fw_write_quadlet(sc->fd.fc, M_FWISOUND, dst, spd,
sys/dev/firewire/fwisound.h
73
struct firewire_dev_comm fd; /* MUST BE FIRST */
sys/dev/firewire/if_fwe.c
109
fc = fwe->fd.fc;
sys/dev/firewire/if_fwe.c
155
fwe->fd.fc = fw_get_comm(dev);
sys/dev/firewire/if_fwe.c
157
tx_speed = fwe->fd.fc->speed;
sys/dev/firewire/if_fwe.c
159
fwe->fd.dev = dev;
sys/dev/firewire/if_fwe.c
160
fwe->fd.post_explore = NULL;
sys/dev/firewire/if_fwe.c
171
eui = &fwe->fd.fc->eui;
sys/dev/firewire/if_fwe.c
212
fc = fwe->fd.fc;
sys/dev/firewire/if_fwe.c
275
fc = fwe->fd.fc;
sys/dev/firewire/if_fwe.c
305
xfer = fw_net_alloc_txfer(fwe->fd.fc, tx_speed,
sys/dev/firewire/if_fwe.c
359
fwe->fd.fc, fwe_poll);
sys/dev/firewire/if_fwe.c
435
xferq = fwe->fd.fc->atq;
sys/dev/firewire/if_fwe.c
464
if (fw_asyreq(fwe->fd.fc, -1, xfer) != 0) {
sys/dev/firewire/if_fwe.c
475
xferq->start(fwe->fd.fc);
sys/dev/firewire/if_fwe.c
496
if (fwe->fd.fc->irx_post != NULL)
sys/dev/firewire/if_fwe.c
497
fwe->fd.fc->irx_post(fwe->fd.fc, fp->mode.ld);
sys/dev/firewire/if_fwe.c
524
fwe->fd.fc->irx_enable(fwe->fd.fc, fwe->dma_ch);
sys/dev/firewire/if_fwevar.h
43
struct firewire_dev_comm fd;
sys/dev/firewire/if_fwip.c
126
fc = fwip->fd.fc;
sys/dev/firewire/if_fwip.c
170
fwip->fd.fc = fw_get_comm(dev);
sys/dev/firewire/if_fwip.c
172
tx_speed = fwip->fd.fc->speed;
sys/dev/firewire/if_fwip.c
174
fwip->fd.dev = dev;
sys/dev/firewire/if_fwip.c
175
fwip->fd.post_explore = NULL;
sys/dev/firewire/if_fwip.c
176
fwip->fd.post_busreset = fwip_post_busreset;
sys/dev/firewire/if_fwip.c
184
hwaddr->sender_unique_ID_hi = htonl(fwip->fd.fc->eui.hi);
sys/dev/firewire/if_fwip.c
185
hwaddr->sender_unique_ID_lo = htonl(fwip->fd.fc->eui.lo);
sys/dev/firewire/if_fwip.c
186
hwaddr->sender_max_rec = fwip->fd.fc->maxrec;
sys/dev/firewire/if_fwip.c
187
hwaddr->sspd = fwip->fd.fc->speed;
sys/dev/firewire/if_fwip.c
218
fc = fwip->fd.fc;
sys/dev/firewire/if_fwip.c
281
fc = fwip->fd.fc;
sys/dev/firewire/if_fwip.c
331
xfer = fw_net_alloc_txfer(fwip->fd.fc, tx_speed,
sys/dev/firewire/if_fwip.c
377
fwip->fd.fc, fwip_poll);
sys/dev/firewire/if_fwip.c
398
src = fwip->fd.fc->crom_src;
sys/dev/firewire/if_fwip.c
399
root = fwip->fd.fc->crom_root;
sys/dev/firewire/if_fwip.c
474
struct firewire_comm *fc = fwip->fd.fc;
sys/dev/firewire/if_fwip.c
571
struct fw_device *fd;
sys/dev/firewire/if_fwip.c
582
fd = fw_noderesolve_eui64(fc, &eui);
sys/dev/firewire/if_fwip.c
583
if (!fd) {
sys/dev/firewire/if_fwip.c
591
fwip->last_hdr.mode.wreqb.dst = FWLOCALBUS | fd->dst;
sys/dev/firewire/if_fwip.c
644
fwip->fd.fc->atq->start(fwip->fd.fc);
sys/dev/firewire/if_fwip.c
668
if (fwip->fd.fc->irx_post != NULL)
sys/dev/firewire/if_fwip.c
669
fwip->fd.fc->irx_post(fwip->fd.fc, fp->mode.ld);
sys/dev/firewire/if_fwip.c
730
struct fw_device *fd;
sys/dev/firewire/if_fwip.c
732
fd = fw_noderesolve_nodeid(fwip->fd.fc,
sys/dev/firewire/if_fwip.c
734
if (fd) {
sys/dev/firewire/if_fwip.c
735
p[0] = htonl(fd->eui.hi);
sys/dev/firewire/if_fwip.c
736
p[1] = htonl(fd->eui.lo);
sys/dev/firewire/if_fwip.c
755
fwip->fd.fc->irx_enable(fwip->fd.fc, fwip->dma_ch);
sys/dev/firewire/if_fwip.c
832
struct fw_device *fd;
sys/dev/firewire/if_fwip.c
834
fd = fw_noderesolve_nodeid(fwip->fd.fc,
sys/dev/firewire/if_fwip.c
836
if (fd) {
sys/dev/firewire/if_fwip.c
837
p[0] = htonl(fd->eui.hi);
sys/dev/firewire/if_fwip.c
838
p[1] = htonl(fd->eui.lo);
sys/dev/firewire/if_fwipvar.h
45
struct firewire_dev_comm fd;
sys/dev/firewire/sbp.c
1003
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1048
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1080
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1084
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1105
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1128
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1143
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1163
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1193
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1219
htonl(((sdev->target->sbp->fd.fc->nodeid | FWLOCALBUS) << 16));
sys/dev/firewire/sbp.c
1236
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1241
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1260
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1311
xfer->fc = sdev->target->sbp->fd.fc;
sys/dev/firewire/sbp.c
1341
nid = target->sbp->fd.fc->nodeid | FWLOCALBUS;
sys/dev/firewire/sbp.c
1364
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1430
device_get_nameunit(ocb->sdev->target->sbp->fd.dev),
sys/dev/firewire/sbp.c
1528
device_printf(ocb->sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1548
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1621
device_printf(sbp->fd.dev,
sys/dev/firewire/sbp.c
1628
device_printf(sbp->fd.dev,
sys/dev/firewire/sbp.c
1649
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1657
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1662
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1675
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1683
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1741
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1751
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1761
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1774
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1793
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
1897
sbp->fd.dev = dev;
sys/dev/firewire/sbp.c
1898
sbp->fd.fc = fc = fw_get_comm(dev);
sys/dev/firewire/sbp.c
1967
sbp->fd.post_busreset = sbp_post_busreset;
sys/dev/firewire/sbp.c
1968
sbp->fd.post_explore = sbp_post_explore;
sys/dev/firewire/sbp.c
2040
fwdma_free(sbp->fd.fc, &sdev->dma);
sys/dev/firewire/sbp.c
206
struct firewire_dev_comm fd;
sys/dev/firewire/sbp.c
2077
struct firewire_comm *fc = sbp->fd.fc;
sys/dev/firewire/sbp.c
2193
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2198
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2210
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2272
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2294
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2325
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2367
ocb->orb[2] = htonl(((sbp->fd.fc->nodeid | FWLOCALBUS) << 16));
sys/dev/firewire/sbp.c
2414
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2429
device_get_nameunit(sbp->fd.dev), cam_sim_path(sbp->sim));
sys/dev/firewire/sbp.c
2442
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2486
device_get_nameunit(sbp->fd.dev),
sys/dev/firewire/sbp.c
2582
fc = sbp->fd.fc;
sys/dev/firewire/sbp.c
2597
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2649
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2664
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
2739
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
333
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
346
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
371
bus = device_get_unit(sbp->fd.dev);
sys/dev/firewire/sbp.c
387
device_printf(sbp->fd.dev,
sys/dev/firewire/sbp.c
428
device_printf(target->sbp->fd.dev, "%d no LUN found\n",
sys/dev/firewire/sbp.c
503
device_get_nameunit(sdev->target->sbp->fd.dev),
sys/dev/firewire/sbp.c
513
fwdma_malloc(sbp->fd.fc,
sys/dev/firewire/sbp.c
575
device_printf(sbp->fd.dev, "increase SBP_NUM_TARGETS!\n");
sys/dev/firewire/sbp.c
683
device_printf(sbp->fd.dev, "%s %d%salive\n",
sys/dev/firewire/sbp.c
725
device_printf(sbp->fd.dev, "%s: lost target\n",
sys/dev/firewire/sbp.c
794
STAILQ_FOREACH(fwdev, &sbp->fd.fc->devices, link)
sys/dev/firewire/sbp.c
805
STAILQ_FOREACH(fwdev, &sbp->fd.fc->devices, link) {
sys/dev/firewire/sbp.c
807
device_printf(sbp->fd.dev,"%s:: EUI:%08x%08x %s attached, state=%d\n",
sys/dev/firewire/sbp.c
858
device_printf(sdev->target->sbp->fd.dev,"%s\n", __func__);
sys/dev/firewire/sbp.c
887
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
907
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
928
device_printf(sdev->target->sbp->fd.dev,
sys/dev/firewire/sbp.c
962
device_printf(sbp->fd.dev,
sys/dev/firewire/sbp.c
968
device_printf(sbp->fd.dev,
sys/dev/firewire/sbp_targ.c
133
struct firewire_dev_comm fd;
sys/dev/firewire/sbp_targ.c
1871
fwdev = fw_noderesolve_nodeid(sc->fd.fc, fp->mode.wreqb.src & 0x3f);
sys/dev/firewire/sbp_targ.c
1914
sc->fd.fc = fc = fw_get_comm(dev);
sys/dev/firewire/sbp_targ.c
1915
sc->fd.dev = dev;
sys/dev/firewire/sbp_targ.c
1916
sc->fd.post_explore = (void *) sbp_targ_post_explore;
sys/dev/firewire/sbp_targ.c
1917
sc->fd.post_busreset = (void *) sbp_targ_post_busreset;
sys/dev/firewire/sbp_targ.c
1967
sc->fd.post_busreset = NULL;
sys/dev/firewire/sbp_targ.c
1987
fw_bindremove(sc->fd.fc, &sc->fwb);
sys/dev/firewire/sbp_targ.c
317
src = sc->fd.fc->crom_src;
sys/dev/firewire/sbp_targ.c
318
root = sc->fd.fc->crom_root;
sys/dev/firewire/sbp_targ.c
476
sc->fd.fc->ibr(sc->fd.fc);
sys/dev/firewire/sbp_targ.c
522
sc->fd.fc->ibr(sc->fd.fc);
sys/dev/ipmi/ipmi_linux.c
89
error = fget(td, args->fd, cap_rights_init_one(&rights, CAP_IOCTL),
sys/dev/iscsi/icl_soft.c
1505
icl_soft_conn_handoff(struct icl_conn *ic, int fd)
sys/dev/iscsi/icl_soft.c
1519
if (fd == 0) {
sys/dev/iscsi/icl_soft.c
1534
error = fget(curthread, fd,
sys/dev/iscsi/icl_wrappers.h
119
icl_conn_handoff(struct icl_conn *ic, int fd)
sys/dev/iscsi/icl_wrappers.h
122
return (ICL_CONN_HANDOFF(ic, fd));
sys/dev/iser/icl_iser.c
316
iser_conn_handoff(struct icl_conn *ic, int fd)
sys/dev/ixl/i40e_common.c
4041
p->fd = TRUE;
sys/dev/ixl/i40e_type.h
415
bool fd;
sys/dev/mem/memdev.c
124
error = livedump_start(marg->fd, marg->flags, marg->compression);
sys/dev/mfi/mfi_linux.c
92
error = fget(p, args->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp);
sys/dev/mrsas/mrsas_linux.c
105
error = fget(p, args->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp);
sys/dev/ntsync/linux_ntsync.c
175
error = fget_cap(td, args->fd, &cap_no_rights, NULL, &fp, NULL);
sys/dev/ntsync/ntsync.c
274
int error, fd;
sys/dev/ntsync/ntsync.c
298
error = finstall(td, fp, &fd, 0, NULL);
sys/dev/ntsync/ntsync.c
306
td->td_retval[0] = fd;
sys/dev/ocs_fc/sli4.c
3064
uint32_t fd, uint32_t active_profile_id)
sys/dev/ocs_fc/sli4.c
3087
req->fd = fd;
sys/dev/ocs_fc/sli4.c
3153
uint32_t fd, uint32_t active_link_config_id)
sys/dev/ocs_fc/sli4.c
3182
req->fd = fd;
sys/dev/ocs_fc/sli4.h
2863
fd:1;
sys/dev/ocs_fc/sli4.h
2921
fd:1;
sys/dev/ocs_fc/sli4.h
3707
uint32_t fd,
sys/dev/ocs_fc/sli4.h
3713
uint32_t fd, uint32_t active_link_config_id);
sys/dev/qat/qat_api/qat_direct/include/icp_adf_transport.h
113
int *fd);
sys/dev/qat/qat_api/qat_kernel/src/qat_transport.c
432
icp_adf_transGetFdForHandle(icp_comms_trans_handle trans_hnd, int *fd)
sys/dev/sfxge/common/ef10_phy.c
131
boolean_t fd = !!(link_flags &
sys/dev/sfxge/common/ef10_phy.c
140
else if (speed == 100000 && fd)
sys/dev/sfxge/common/ef10_phy.c
142
else if (speed == 50000 && fd)
sys/dev/sfxge/common/ef10_phy.c
144
else if (speed == 40000 && fd)
sys/dev/sfxge/common/ef10_phy.c
146
else if (speed == 25000 && fd)
sys/dev/sfxge/common/ef10_phy.c
148
else if (speed == 10000 && fd)
sys/dev/sfxge/common/ef10_phy.c
151
*link_modep = fd ? EFX_LINK_1000FDX : EFX_LINK_1000HDX;
sys/dev/sfxge/common/ef10_phy.c
153
*link_modep = fd ? EFX_LINK_100FDX : EFX_LINK_100HDX;
sys/dev/sfxge/common/ef10_phy.c
155
*link_modep = fd ? EFX_LINK_10FDX : EFX_LINK_10HDX;
sys/dev/sfxge/common/siena_phy.c
80
boolean_t fd = !!(link_flags &
sys/dev/sfxge/common/siena_phy.c
89
else if (speed == 10000 && fd)
sys/dev/sfxge/common/siena_phy.c
92
*link_modep = fd ? EFX_LINK_1000FDX : EFX_LINK_1000HDX;
sys/dev/sfxge/common/siena_phy.c
94
*link_modep = fd ? EFX_LINK_100FDX : EFX_LINK_100HDX;
sys/dev/sfxge/common/siena_phy.c
96
*link_modep = fd ? EFX_LINK_10FDX : EFX_LINK_10HDX;
sys/dev/tdfx/tdfx_linux.c
57
error = fget(td, args->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp);
sys/dev/usb/video/uvideo.c
1716
struct usb_video_frame_desc *fd =
sys/dev/usb/video/uvideo.c
1736
sc->sc_fmtgrp[fmtidx].frame[frame_num] = fd;
sys/dev/usb/video/uvideo.c
1739
sc->sc_fmtgrp[fmtidx].format_dfidx == fd->bFrameIndex)
sys/dev/usb/video/uvideo.c
1740
sc->sc_fmtgrp[fmtidx].frame_cur = fd;
sys/dev/usb/video/uvideo.c
1747
fbuf_size = (uint64_t)UGETW(fd->u.uc.wWidth) *
sys/dev/usb/video/uvideo.c
1748
UGETW(fd->u.uc.wHeight) *
sys/dev/usb/video/uvideo.c
1751
fbuf_size = UGETDW(fd->u.uc.dwMaxVideoFrameBufferSize);
sys/dev/usb/video/uvideo.c
1767
struct usb_video_frame_desc *fd =
sys/dev/usb/video/uvideo.c
1789
sc->sc_fmtgrp[fmtidx].frame[frame_num] = fd;
sys/dev/usb/video/uvideo.c
1792
sc->sc_fmtgrp[fmtidx].format_dfidx == fd->bFrameIndex)
sys/dev/usb/video/uvideo.c
1793
sc->sc_fmtgrp[fmtidx].frame_cur = fd;
sys/dev/usb/video/uvideo.c
1799
frame_ival = UGETDW(fd->u.h264.dwDefaultFrameInterval);
sys/dev/usb/video/uvideo.c
1801
p = __DECONST(uint8_t *, desc) + UVIDEO_FRAME_MIN_LEN(fd);
sys/dev/usb/video/uvideo.c
1802
length = fd->bLength - UVIDEO_FRAME_MIN_LEN(fd);
sys/dev/usb/video/uvideo.c
1804
nivals = UVIDEO_FRAME_NUM_INTERVALS(fd);
sys/dev/usb/video/uvideo.c
1816
fbuf_size = UGETDW(UVIDEO_FRAME_FIELD(fd, dwMaxBitRate)) * frame_ival;
sys/dev/usb/video/uvideo_v4l2.h
247
int32_t fd;
sys/fs/fdescfs/fdesc_vnops.c
122
fdesc_remove_entry(struct fdescnode *fd)
sys/fs/fdescfs/fdesc_vnops.c
127
fc = FD_NHASH(fd->fd_ix);
sys/fs/fdescfs/fdesc_vnops.c
130
if (fd == fd2) {
sys/fs/fdescfs/fdesc_vnops.c
131
LIST_REMOVE(fd, fd_hash);
sys/fs/fdescfs/fdesc_vnops.c
144
struct fdescnode *fd, *fd2;
sys/fs/fdescfs/fdesc_vnops.c
162
LIST_FOREACH(fd, fc, fd_hash) {
sys/fs/fdescfs/fdesc_vnops.c
163
if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
sys/fs/fdescfs/fdesc_vnops.c
165
vp = fd->fd_vnode;
sys/fs/fdescfs/fdesc_vnops.c
176
fd = malloc(sizeof(struct fdescnode), M_TEMP, M_WAITOK);
sys/fs/fdescfs/fdesc_vnops.c
180
free(fd, M_TEMP);
sys/fs/fdescfs/fdesc_vnops.c
184
vp->v_data = fd;
sys/fs/fdescfs/fdesc_vnops.c
185
fd->fd_vnode = vp;
sys/fs/fdescfs/fdesc_vnops.c
186
fd->fd_type = ftype;
sys/fs/fdescfs/fdesc_vnops.c
187
fd->fd_fd = fd_fd;
sys/fs/fdescfs/fdesc_vnops.c
188
fd->fd_ix = ix;
sys/fs/fdescfs/fdesc_vnops.c
237
LIST_INSERT_HEAD(fc, fd, fd_hash);
sys/fs/fdescfs/fdesc_vnops.c
292
u_int fd, fd1;
sys/fs/fdescfs/fdesc_vnops.c
313
fd = 0;
sys/fs/fdescfs/fdesc_vnops.c
324
fd1 = 10 * fd + *pname++ - '0';
sys/fs/fdescfs/fdesc_vnops.c
325
if (fd1 < fd) {
sys/fs/fdescfs/fdesc_vnops.c
329
fd = fd1;
sys/fs/fdescfs/fdesc_vnops.c
335
if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0)
sys/fs/fdescfs/fdesc_vnops.c
348
arg.fd_fd = fd;
sys/fs/fdescfs/fdesc_vnops.c
349
arg.ix = FD_DESC + fd;
sys/fs/fdescfs/fdesc_vnops.c
484
unsigned fd;
sys/fs/fdescfs/fdesc_vnops.c
493
fd = VTOFDESC(ap->a_vp)->fd_fd;
sys/fs/fdescfs/fdesc_vnops.c
500
error = getvnode(td, fd,
sys/fs/fdescfs/fdesc_vnops.c
503
error = getvnode_path(td, fd,
sys/fs/fdescfs/fdesc_vnops.c
617
struct fdescnode *fd;
sys/fs/fdescfs/fdesc_vnops.c
620
fd = VTOFDESC(vp);
sys/fs/fdescfs/fdesc_vnops.c
621
fdesc_remove_entry(fd);
sys/fs/fuse/fuse_vfsops.c
304
int fd;
sys/fs/fuse/fuse_vfsops.c
367
if (vfs_scanopt(opts, "fd", "%d", &fd) != 1)
sys/fs/fuse/fuse_vfsops.c
375
err = fget(td, fd, &cap_read_rights, &fp);
sys/fs/nfsserver/nfs_nfsdport.c
4422
fp_getfvp(struct thread *p, int fd, struct file **fpp, struct vnode **vpp)
sys/fs/nfsserver/nfs_nfsdport.c
4429
if (fd < 0 || fd >= fdp->fd_nfiles ||
sys/fs/nfsserver/nfs_nfsdport.c
4430
(fp = fdp->fd_ofiles[fd].fde_file) == NULL) {
sys/i386/linux/linux.h
137
l_int fd;
sys/i386/linux/linux_machdep.c
322
linux_args.prot, linux_args.flags, linux_args.fd,
sys/i386/linux/linux_proto.h
1105
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1149
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1155
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1161
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1187
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/i386/linux/linux_proto.h
1194
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/i386/linux/linux_proto.h
1244
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1279
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1434
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/i386/linux/linux_proto.h
1442
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/i386/linux/linux_proto.h
1565
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
1569
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
192
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
197
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
284
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
296
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/i386/linux/linux_proto.h
308
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
343
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
43
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/i386/linux/linux_proto.h
440
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
447
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
464
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/i386/linux/linux_proto.h
472
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
584
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
590
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
634
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
sys/i386/linux/linux_proto.h
642
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
654
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
702
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
707
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
729
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
748
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
764
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
777
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
815
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/i386/linux/linux_proto.h
832
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
892
char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
sys/i386/linux/linux_proto.h
906
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/i386/linux/linux_proto.h
984
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_proto.h
989
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
sys/i386/linux/linux_systrace_args.c
1002
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
1011
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
1027
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1270
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1280
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1358
iarg[a++] = p->fd; /* l_ulong */
sys/i386/linux/linux_systrace_args.c
1374
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1398
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1571
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1580
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1616
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1647
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1675
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1700
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1770
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
1801
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
1915
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
1941
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
2075
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2084
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2280
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2356
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2366
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2376
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2428
iarg[a++] = p->fd; /* l_ulong */
sys/i386/linux/linux_systrace_args.c
2439
iarg[a++] = p->fd; /* l_ulong */
sys/i386/linux/linux_systrace_args.c
2521
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
2578
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
283
uarg[a++] = p->fd; /* u_int */
sys/i386/linux/linux_systrace_args.c
2845
iarg[a++] = p->fd; /* l_ulong */
sys/i386/linux/linux_systrace_args.c
2857
iarg[a++] = p->fd; /* l_ulong */
sys/i386/linux/linux_systrace_args.c
30
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
3076
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
3084
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
356
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
365
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
39
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
57
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
605
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
637
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
645
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
653
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
687
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
754
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
818
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
912
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_systrace_args.c
954
iarg[a++] = p->fd; /* l_int */
sys/i386/linux/linux_systrace_args.c
965
iarg[a++] = p->fd; /* l_uint */
sys/i386/linux/linux_systrace_args.c
985
iarg[a++] = p->fd; /* int */
sys/i386/linux/linux_vdso_gtod.c
57
write(int fd, const void *buf, size_t size)
sys/i386/linux/linux_vdso_gtod.c
65
: "a"(LINUX_SYS_linux_write), "b"(fd), "c"(buf), "d"(size)
sys/kern/imgact_binmisc.c
661
sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd);
sys/kern/imgact_shell.c
176
sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd);
sys/kern/kern_descrip.c
1026
fd, tmp);
sys/kern/kern_descrip.c
103
static int closefp(struct filedesc *fdp, int fd, struct file *fp,
sys/kern/kern_descrip.c
105
static void export_file_to_kinfo(struct file *fp, int fd,
sys/kern/kern_descrip.c
111
static void fdunused(struct filedesc *fdp, int fd);
sys/kern/kern_descrip.c
112
static void fdused(struct filedesc *fdp, int fd);
sys/kern/kern_descrip.c
113
static int fget_unlocked_seq(struct thread *td, int fd,
sys/kern/kern_descrip.c
1399
closefp_impl(struct filedesc *fdp, int fd, struct file *fp, struct thread *td,
sys/kern/kern_descrip.c
1413
knote_fdclose(td, fd);
sys/kern/kern_descrip.c
1416
fp->f_ops->fo_fdclose(fp, fd, td);
sys/kern/kern_descrip.c
1421
audit_sysclose(td, fd, fp);
sys/kern/kern_descrip.c
1437
closefp_hl(struct filedesc *fdp, int fd, struct file *fp, struct thread *td,
sys/kern/kern_descrip.c
1456
error = closefp_impl(fdp, fd, fp, td, audit);
sys/kern/kern_descrip.c
1471
closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td,
sys/kern/kern_descrip.c
1478
return (closefp_hl(fdp, fd, fp, td, holdleaders, audit));
sys/kern/kern_descrip.c
1480
return (closefp_impl(fdp, fd, fp, td, audit));
sys/kern/kern_descrip.c
1489
int fd;
sys/kern/kern_descrip.c
1497
return (kern_close(td, uap->fd));
sys/kern/kern_descrip.c
1501
kern_close(struct thread *td, int fd)
sys/kern/kern_descrip.c
1509
if ((fp = fget_noref(fdp, fd)) == NULL) {
sys/kern/kern_descrip.c
1513
fdfree(fdp, fd);
sys/kern/kern_descrip.c
1516
return (closefp(fdp, fd, fp, td, true, true));
sys/kern/kern_descrip.c
1525
int fd, fde_flags;
sys/kern/kern_descrip.c
1532
fd = lowfd;
sys/kern/kern_descrip.c
1533
if (__predict_false(fd > highfd)) {
sys/kern/kern_descrip.c
1536
for (; fd <= highfd; fd++) {
sys/kern/kern_descrip.c
1537
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
1552
int fd;
sys/kern/kern_descrip.c
1558
fd = lowfd;
sys/kern/kern_descrip.c
1559
if (__predict_false(fd > highfd)) {
sys/kern/kern_descrip.c
1563
fp = fdt->fdt_ofiles[fd].fde_file;
sys/kern/kern_descrip.c
1565
if (fd == highfd)
sys/kern/kern_descrip.c
1568
fdfree(fdp, fd);
sys/kern/kern_descrip.c
1569
(void) closefp(fdp, fd, fp, td, true, true);
sys/kern/kern_descrip.c
1570
if (fd == highfd)
sys/kern/kern_descrip.c
1575
fd++;
sys/kern/kern_descrip.c
1655
int fd;
sys/kern/kern_descrip.c
1667
error = kern_fstat(td, uap->fd, &ub);
sys/kern/kern_descrip.c
1684
error = kern_fstat(td, uap->fd, &sb);
sys/kern/kern_descrip.c
1699
int fd;
sys/kern/kern_descrip.c
1710
error = kern_fstat(td, uap->fd, &ub);
sys/kern/kern_descrip.c
1717
kern_fstat(struct thread *td, int fd, struct stat *sbp)
sys/kern/kern_descrip.c
1722
AUDIT_ARG_FD(fd);
sys/kern/kern_descrip.c
1724
error = fget(td, fd, &cap_fstat_rights, &fp);
sys/kern/kern_descrip.c
1753
int fd;
sys/kern/kern_descrip.c
1765
error = kern_fstat(td, uap->fd, &ub);
sys/kern/kern_descrip.c
1780
int fd;
sys/kern/kern_descrip.c
1791
error = kern_fpathconf(td, uap->fd, uap->name, &value);
sys/kern/kern_descrip.c
1798
kern_fpathconf(struct thread *td, int fd, int name, long *valuep)
sys/kern/kern_descrip.c
1804
error = fget(td, fd, &cap_fpathconf_rights, &fp);
sys/kern/kern_descrip.c
2130
int fd, maxfd, allocfd;
sys/kern/kern_descrip.c
2146
fd = fd_first_free(fdp, minfd, fdp->fd_nfiles);
sys/kern/kern_descrip.c
2147
if (__predict_false(fd >= maxfd))
sys/kern/kern_descrip.c
2149
if (__predict_false(fd >= fdp->fd_nfiles)) {
sys/kern/kern_descrip.c
2150
allocfd = min(fd * 2, maxfd);
sys/kern/kern_descrip.c
2169
KASSERT(fd >= 0 && fd < min(maxfd, fdp->fd_nfiles),
sys/kern/kern_descrip.c
2170
("invalid descriptor %d", fd));
sys/kern/kern_descrip.c
2171
KASSERT(!fdisused(fdp, fd),
sys/kern/kern_descrip.c
2173
KASSERT(fdp->fd_ofiles[fd].fde_file == NULL,
sys/kern/kern_descrip.c
2175
fdused(fdp, fd);
sys/kern/kern_descrip.c
2176
*result = fd;
sys/kern/kern_descrip.c
2217
int error, fd;
sys/kern/kern_descrip.c
2227
error = finstall_refed(td, fp, &fd, flags, fcaps);
sys/kern/kern_descrip.c
2234
*resultfd = fd;
sys/kern/kern_descrip.c
2289
_finstall(struct filedesc *fdp, struct file *fp, int fd, int flags,
sys/kern/kern_descrip.c
2299
fde = &fdp->fd_ofiles[fd];
sys/kern/kern_descrip.c
2315
finstall_refed(struct thread *td, struct file *fp, int *fd, int flags,
sys/kern/kern_descrip.c
2321
MPASS(fd != NULL);
sys/kern/kern_descrip.c
2324
error = fdalloc(td, 0, fd);
sys/kern/kern_descrip.c
2326
_finstall(fdp, fp, *fd, flags, fcaps);
sys/kern/kern_descrip.c
2333
finstall(struct thread *td, struct file *fp, int *fd, int flags,
sys/kern/kern_descrip.c
2338
MPASS(fd != NULL);
sys/kern/kern_descrip.c
2342
error = finstall_refed(td, fp, fd, flags, fcaps);
sys/kern/kern_descrip.c
254
fdisused(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
257
KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
sys/kern/kern_descrip.c
258
("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles));
sys/kern/kern_descrip.c
260
return ((fdp->fd_map[NDSLOT(fd)] & NDBIT(fd)) != 0);
sys/kern/kern_descrip.c
267
fdused_init(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
270
KASSERT(!fdisused(fdp, fd), ("fd=%d is already used", fd));
sys/kern/kern_descrip.c
272
fdp->fd_map[NDSLOT(fd)] |= NDBIT(fd);
sys/kern/kern_descrip.c
276
fdused(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
281
fdused_init(fdp, fd);
sys/kern/kern_descrip.c
282
if (fd == fdp->fd_freefile)
sys/kern/kern_descrip.c
290
fdunused(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
295
KASSERT(fdisused(fdp, fd), ("fd=%d is already unused", fd));
sys/kern/kern_descrip.c
296
KASSERT(fdp->fd_ofiles[fd].fde_file == NULL,
sys/kern/kern_descrip.c
297
("fd=%d is still in use", fd));
sys/kern/kern_descrip.c
299
fdp->fd_map[NDSLOT(fd)] &= ~NDBIT(fd);
sys/kern/kern_descrip.c
300
if (fd < fdp->fd_freefile)
sys/kern/kern_descrip.c
301
fdp->fd_freefile = fd;
sys/kern/kern_descrip.c
3072
fget_cap_noref(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3081
fde = fdeget_noref(fdp, fd);
sys/kern/kern_descrip.c
3105
fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3115
error = fget_unlocked_seq(td, fd, needrightsp, flagsp, &fp,
sys/kern/kern_descrip.c
3121
if (!filecaps_copy(&fdp->fd_ofiles[fd].fde_caps,
sys/kern/kern_descrip.c
3128
if (!fd_modified(fdp, fd, seq))
sys/kern/kern_descrip.c
3138
error = fget_cap_noref(fdp, fd, needrightsp, fpp, havecapsp);
sys/kern/kern_descrip.c
3146
fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3150
error = fget_unlocked_flags(td, fd, needrightsp, flagsp, fpp);
sys/kern/kern_descrip.c
3159
fget_remote(struct thread *td, struct proc *p, int fd, struct filecaps *fcaps,
sys/kern/kern_descrip.c
317
fdfree(struct filedesc *fdp, int fd)
sys/kern/kern_descrip.c
3174
return (fget_unlocked(td, fd, &cap_no_rights, fpp));
sys/kern/kern_descrip.c
3183
fp = fget_noref(fdp, fd);
sys/kern/kern_descrip.c
3187
*fd_flags = fde_to_fd_flags(fdp->fd_ofiles[fd].
sys/kern/kern_descrip.c
3192
&fdp->fd_ofiles[fd].fde_caps, fcaps, true);
sys/kern/kern_descrip.c
3214
int error, error1, fd, highfd;
sys/kern/kern_descrip.c
322
fde = &fdp->fd_ofiles[fd];
sys/kern/kern_descrip.c
3234
for (fd = 0; fd <= highfd; fd++) {
sys/kern/kern_descrip.c
3235
error1 = fget_remote(td, p, fd, NULL, NULL, &fp);
sys/kern/kern_descrip.c
3238
error = fn(p, fd, fp, arg);
sys/kern/kern_descrip.c
3260
int fd, flags;
sys/kern/kern_descrip.c
3264
fd = ndp->ni_dirfd;
sys/kern/kern_descrip.c
3270
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
sys/kern/kern_descrip.c
3272
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
sys/kern/kern_descrip.c
3273
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
3296
if (__predict_false(!seqc_consistent_no_fence(fd_seqc(fdt, fd), seq)))
sys/kern/kern_descrip.c
331
fdunused(fdp, fd);
sys/kern/kern_descrip.c
3328
int fd, flags;
sys/kern/kern_descrip.c
3332
fd = ndp->ni_dirfd;
sys/kern/kern_descrip.c
3335
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
sys/kern/kern_descrip.c
3337
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
3354
if (__predict_false(fp != fdt->fdt_ofiles[fd].fde_file))
sys/kern/kern_descrip.c
3448
fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3462
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
sys/kern/kern_descrip.c
3466
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
sys/kern/kern_descrip.c
3467
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
3472
if (seqc_consistent(fd_seqc(fdt, fd), seq))
sys/kern/kern_descrip.c
3479
if (seqc_consistent(fd_seqc(fdt, fd), seq))
sys/kern/kern_descrip.c
3494
if (seqc_consistent_no_fence(fd_seqc(fdt, fd), seq))
sys/kern/kern_descrip.c
3507
fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3517
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
sys/kern/kern_descrip.c
3521
fp = fdt->fdt_ofiles[fd].fde_file;
sys/kern/kern_descrip.c
3522
flags = fdt->fdt_ofiles[fd].fde_flags;
sys/kern/kern_descrip.c
3535
if (__predict_true(fp == fdt->fdt_ofiles[fd].fde_file))
sys/kern/kern_descrip.c
3554
fget_unlocked_flags(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3571
if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) {
sys/kern/kern_descrip.c
3576
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
sys/kern/kern_descrip.c
3577
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
3582
fp = fdt->fdt_ofiles[fd].fde_file;
sys/kern/kern_descrip.c
3583
flags = fdt->fdt_ofiles[fd].fde_flags;
sys/kern/kern_descrip.c
3601
if (__predict_false(!seqc_consistent_no_fence(fd_seqc(fdt, fd), seq)))
sys/kern/kern_descrip.c
3603
if (__predict_false(fp != fdt->fdt_ofiles[fd].fde_file))
sys/kern/kern_descrip.c
3614
return (fget_unlocked_seq(td, fd, needrightsp, flagsp, fpp, NULL));
sys/kern/kern_descrip.c
3618
fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3621
return (fget_unlocked_flags(td, fd, needrightsp, NULL, fpp));
sys/kern/kern_descrip.c
3635
fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3647
if (__predict_false(fd >= fdp->fd_nfiles))
sys/kern/kern_descrip.c
3651
fde = &fdt->fdt_ofiles[fd];
sys/kern/kern_descrip.c
3665
fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3673
if (__predict_false(fd >= fdp->fd_nfiles))
sys/kern/kern_descrip.c
3676
fp = fdp->fd_ofiles[fd].fde_file;
sys/kern/kern_descrip.c
3700
_fget(struct thread *td, int fd, struct file **fpp, int flags,
sys/kern/kern_descrip.c
3707
error = fget_unlocked(td, fd, needrightsp, &fp);
sys/kern/kern_descrip.c
3747
fget(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp)
sys/kern/kern_descrip.c
3750
return (_fget(td, fd, fpp, 0, rightsp));
sys/kern/kern_descrip.c
3754
fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3759
error = _fget(td, fd, fpp, 0, rightsp);
sys/kern/kern_descrip.c
3773
error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq);
sys/kern/kern_descrip.c
3781
fdrights = *cap_rights(fdp, fd);
sys/kern/kern_descrip.c
3782
if (!fd_modified(fdp, fd, seq))
sys/kern/kern_descrip.c
3798
fget_read(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3802
return (_fget(td, fd, fpp, FREAD, rightsp));
sys/kern/kern_descrip.c
3806
fget_write(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3810
return (_fget(td, fd, fpp, FWRITE, rightsp));
sys/kern/kern_descrip.c
3814
fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3818
return (fget_unlocked(td, fd, rightsp, fpp));
sys/kern/kern_descrip.c
3828
error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq);
sys/kern/kern_descrip.c
3831
error = cap_fcntl_check(fdp, fd, needfcntl);
sys/kern/kern_descrip.c
3832
if (!fd_modified(fdp, fd, seq))
sys/kern/kern_descrip.c
3853
_fgetvp(struct thread *td, int fd, int flags, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
386
u_int fd;
sys/kern/kern_descrip.c
3860
error = _fget(td, fd, &fp, flags, needrightsp);
sys/kern/kern_descrip.c
3875
fgetvp(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3879
return (_fgetvp(td, fd, 0, rightsp, vpp));
sys/kern/kern_descrip.c
3883
fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/kern_descrip.c
3890
error = fget_cap(td, fd, needrightsp, NULL, &fp, &caps);
sys/kern/kern_descrip.c
3915
fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3919
return (_fgetvp(td, fd, FREAD, rightsp, vpp));
sys/kern/kern_descrip.c
3923
fgetvp_exec(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3927
return (_fgetvp(td, fd, FEXEC, rightsp, vpp));
sys/kern/kern_descrip.c
3932
fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/kern_descrip.c
3936
return (_fgetvp(td, fd, FWRITE, rightsp, vpp));
sys/kern/kern_descrip.c
394
return (kern_dup(td, FDDUP_NORMAL, 0, (int)uap->fd, 0));
sys/kern/kern_descrip.c
3971
int fd;
sys/kern/kern_descrip.c
3984
error = fget(td, uap->fd, &cap_flock_rights, &fp);
sys/kern/kern_descrip.c
402
int fd;
sys/kern/kern_descrip.c
412
return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, uap->arg));
sys/kern/kern_descrip.c
416
kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg)
sys/kern/kern_descrip.c
466
error = kern_fcntl(td, fd, newcmd, arg1);
sys/kern/kern_descrip.c
4809
export_file_to_kinfo(struct file *fp, int fd, cap_rights_t *rightsp,
sys/kern/kern_descrip.c
4823
kif->kf_fd = fd;
sys/kern/kern_descrip.c
4841
export_vnode_to_kinfo(struct vnode *vp, int fd, int fflags,
sys/kern/kern_descrip.c
4854
kif->kf_fd = fd;
sys/kern/kern_descrip.c
4890
export_file_to_sb(struct file *fp, int fd, cap_rights_t *rightsp,
sys/kern/kern_descrip.c
4897
export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp,
sys/kern/kern_descrip.c
4906
export_vnode_to_sb(struct vnode *vp, int fd, int fflags,
sys/kern/kern_descrip.c
4915
export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif, efbuf->flags);
sys/kern/kern_descrip.c
569
kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
sys/kern/kern_descrip.c
594
error = kern_dup(td, FDDUP_FCNTL, 0, fd, tmp);
sys/kern/kern_descrip.c
599
error = kern_dup(td, FDDUP_FCNTL, FDDUP_FLAG_CLOEXEC, fd, tmp);
sys/kern/kern_descrip.c
604
error = kern_dup(td, FDDUP_FCNTL, FDDUP_FLAG_CLOFORK, fd, tmp);
sys/kern/kern_descrip.c
609
error = kern_dup(td, FDDUP_FIXED, 0, fd, tmp);
sys/kern/kern_descrip.c
614
error = kern_dup(td, FDDUP_FIXED, FDDUP_FLAG_CLOEXEC, fd, tmp);
sys/kern/kern_descrip.c
620
fde = fdeget_noref(fdp, fd);
sys/kern/kern_descrip.c
631
fde = fdeget_noref(fdp, fd);
sys/kern/kern_descrip.c
644
error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, &fp);
sys/kern/kern_descrip.c
652
error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, &fp);
sys/kern/kern_descrip.c
700
error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, &fp);
sys/kern/kern_descrip.c
710
error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, &fp);
sys/kern/kern_descrip.c
737
error = fget_unlocked(td, fd, &cap_flock_rights, &fp);
sys/kern/kern_descrip.c
824
error = fget_unlocked(td, fd, &cap_no_rights, &fp2);
sys/kern/kern_descrip.c
842
error = fget_unlocked(td, fd, &cap_flock_rights, &fp);
sys/kern/kern_descrip.c
876
error = fget_unlocked(td, fd, &cap_no_rights, &fp);
sys/kern/kern_descrip.c
884
error = fget_unlocked(td, fd, &cap_no_rights, &fp);
sys/kern/kern_descrip.c
898
error = fget_unlocked(td, fd, &cap_no_rights, &fp);
sys/kern/kern_descrip.c
949
error = fget_unlocked(td, fd, &cap_no_rights, &fp);
sys/kern/kern_descrip.c
996
error = fget_cap_noref(fdp, fd, &cap_fcntl_rights, &fp, NULL);
sys/kern/kern_descrip.c
998
export_file_to_kinfo(fp, fd, NULL, kif, fdp, 0);
sys/kern/kern_event.c
1281
int fd, error;
sys/kern/kern_event.c
1283
error = kern_kqueue_alloc(td, td->td_proc->p_fd, &fd, &fp, flags,
sys/kern/kern_event.c
1290
td->td_retval[0] = fd;
sys/kern/kern_event.c
1295
int fd;
sys/kern/kern_event.c
1313
.fd = uap->fd,
sys/kern/kern_event.c
1348
error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents,
sys/kern/kern_event.c
1463
.fd = uap->fd,
sys/kern/kern_event.c
1476
kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
sys/kern/kern_event.c
1488
error = fget(td, fd, &rights, &fp);
sys/kern/kern_event.c
2027
int error, fd, size;
sys/kern/kern_event.c
2034
fd = ident;
sys/kern/kern_event.c
2036
if (size <= fd) {
sys/kern/kern_event.c
2039
} while (size <= fd);
sys/kern/kern_event.c
2062
MPASS(error != 0 || kq->kq_knlistsize > fd);
sys/kern/kern_event.c
2860
knote_fdclose(struct thread *td, int fd)
sys/kern/kern_event.c
2874
if (kq->kq_knlistsize <= fd ||
sys/kern/kern_event.c
2875
SLIST_EMPTY(&kq->kq_knlist[fd])) {
sys/kern/kern_event.c
2880
while ((kn = SLIST_FIRST(&kq->kq_knlist[fd])) != NULL) {
sys/kern/kern_event.c
3030
kqfd_register(int fd, struct kevent *kev, struct thread *td, int mflag)
sys/kern/kern_event.c
3037
error = fget(td, fd, cap_rights_init_one(&rights, CAP_KQUEUE_CHANGE),
sys/kern/kern_event.c
3331
kern_proc_kqueues_out1_cb(struct proc *p, int fd, struct file *fp, void *arg)
sys/kern/kern_event.c
3340
return (kern_proc_kqueue_report(a->s, p, fd, kq, a->compat32));
sys/kern/kern_exec.c
244
int fd;
sys/kern/kern_exec.c
261
args.fd = uap->fd;
sys/kern/kern_exec.c
632
AUDIT_ARG_FD(args->fd);
sys/kern/kern_exec.c
642
error = fgetvp_exec(td, args->fd, &cap_fexecve_rights,
sys/kern/kern_exit.c
1555
kern_pdwait(struct thread *td, int fd, int *status,
sys/kern/kern_exit.c
1563
AUDIT_ARG_FD(fd);
sys/kern/kern_exit.c
1570
error = fget_procdesc(td, fd, &cap_pdwait_rights, &fp, &pd, NULL);
sys/kern/kern_exit.c
972
error = kern_pdwait(td, uap->fd, &status, uap->options, wrup, sip);
sys/kern/kern_fork.c
122
int error, fd, pid;
sys/kern/kern_fork.c
127
fr.fr_pd_fd = &fd;
sys/kern/kern_fork.c
139
error = copyout(&fd, uap->fdp, sizeof(fd));
sys/kern/kern_fork.c
197
int error, fd, pid;
sys/kern/kern_fork.c
200
fd = -1;
sys/kern/kern_fork.c
227
fr.fr_pd_fd = &fd;
sys/kern/kern_fork.c
235
error = copyout(&fd, uap->fdp, sizeof(fd));
sys/kern/kern_fork.c
419
struct filedesc *fd;
sys/kern/kern_fork.c
468
fd = fdinit();
sys/kern/kern_fork.c
475
fd = fdcopy(p1->p_fd, p2);
sys/kern/kern_fork.c
482
fd = fdshare(p1->p_fd);
sys/kern/kern_fork.c
583
p2->p_fd = fd;
sys/kern/kern_jail.c
3030
error = jaildesc_find(td, uap->fd, &pr, &jdcred);
sys/kern/kern_jail.c
3129
error = jaildesc_find(td, uap->fd, &pr, &jdcred);
sys/kern/kern_jaildesc.c
114
jaildesc_find(struct thread *td, int fd, struct prison **prp,
sys/kern/kern_jaildesc.c
120
error = fget(td, fd, &cap_no_rights, &fp);
sys/kern/kern_ktrace.c
788
ktrgenio(int fd, enum uio_rw rw, struct uio *uio, int error)
sys/kern/kern_ktrace.c
815
ktg->ktr_fd = fd;
sys/kern/kern_sendfile.c
1263
AUDIT_ARG_FD(uap->fd);
sys/kern/kern_sendfile.c
1269
if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != 0)
sys/kern/kern_sendfile.c
1309
args.fd = uap->fd;
sys/kern/kern_sig.c
1963
AUDIT_ARG_FD(uap->fd);
sys/kern/kern_sig.c
1968
error = fget_procdesc(td, uap->fd, &cap_pdkill_rights, &fp, NULL, &p);
sys/kern/kern_umtx.c
4635
int error, fd;
sys/kern/kern_umtx.c
4661
error = falloc_caps(td, &fp, &fd, O_CLOEXEC, NULL);
sys/kern/kern_umtx.c
4666
td->td_retval[0] = fd;
sys/kern/kern_vnodedumper.c
61
livedump_start(int fd, int flags, uint8_t compression)
sys/kern/kern_vnodedumper.c
75
error = getvnode(curthread, fd, &cap_write_rights, &fp);
sys/kern/sys_capability.c
223
cap_rights(struct filedesc *fdp, int fd)
sys/kern/sys_capability.c
226
return (cap_rights_fde(&fdp->fd_ofiles[fd]));
sys/kern/sys_capability.c
230
kern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights)
sys/kern/sys_capability.c
239
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_capability.c
245
error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE);
sys/kern/sys_capability.c
301
AUDIT_ARG_FD(uap->fd);
sys/kern/sys_capability.c
303
return (kern_cap_rights_limit(td, uap->fd, &rights));
sys/kern/sys_capability.c
314
int error, fd, i, n;
sys/kern/sys_capability.c
319
fd = uap->fd;
sys/kern/sys_capability.c
321
AUDIT_ARG_FD(fd);
sys/kern/sys_capability.c
325
if (fget_noref(fdp, fd) == NULL) {
sys/kern/sys_capability.c
329
rights = *cap_rights(fdp, fd);
sys/kern/sys_capability.c
357
cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd)
sys/kern/sys_capability.c
364
KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
sys/kern/sys_capability.c
365
("%s: invalid fd=%d", __func__, fd));
sys/kern/sys_capability.c
367
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_capability.c
369
("%s: invalid fd=%d", __func__, fd));
sys/kern/sys_capability.c
416
kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds, size_t ncmds)
sys/kern/sys_capability.c
423
AUDIT_ARG_FD(fd);
sys/kern/sys_capability.c
433
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_capability.c
481
return (kern_cap_ioctls_limit(td, uap->fd, cmds, ncmds));
sys/kern/sys_capability.c
492
int error, fd;
sys/kern/sys_capability.c
494
fd = uap->fd;
sys/kern/sys_capability.c
498
AUDIT_ARG_FD(fd);
sys/kern/sys_capability.c
509
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_capability.c
564
cap_fcntl_check(struct filedesc *fdp, int fd, int cmd)
sys/kern/sys_capability.c
567
KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
sys/kern/sys_capability.c
568
("%s: invalid fd=%d", __func__, fd));
sys/kern/sys_capability.c
570
return (cap_fcntl_check_fde(&fdp->fd_ofiles[fd], cmd));
sys/kern/sys_capability.c
579
int fd;
sys/kern/sys_capability.c
581
fd = uap->fd;
sys/kern/sys_capability.c
584
AUDIT_ARG_FD(fd);
sys/kern/sys_capability.c
593
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_capability.c
618
int fd;
sys/kern/sys_capability.c
620
fd = uap->fd;
sys/kern/sys_capability.c
622
AUDIT_ARG_FD(fd);
sys/kern/sys_capability.c
626
fdep = fdeget_noref(fdp, fd);
sys/kern/sys_generic.c
1009
error = finstall(td, fp, &fd, fflags, NULL);
sys/kern/sys_generic.c
1012
td->td_retval[0] = fd;
sys/kern/sys_generic.c
1466
int fd, ev, n, idx;
sys/kern/sys_generic.c
1475
fd = (int)(uintptr_t)sfp->sf_cookie;
sys/kern/sys_generic.c
1482
error = fget_only_user(fdp, fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1484
error = fget_unlocked(td, fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1487
idx = fd / NFDBITS;
sys/kern/sys_generic.c
1488
bit = (fd_mask)1 << (fd % NFDBITS);
sys/kern/sys_generic.c
1512
int ev, flags, end, fd;
sys/kern/sys_generic.c
1520
for (idx = 0, fd = 0; fd < nfd; idx++) {
sys/kern/sys_generic.c
1521
end = imin(fd + NFDBITS, nfd);
sys/kern/sys_generic.c
1522
for (bit = 1; fd < end; bit <<= 1, fd++) {
sys/kern/sys_generic.c
1528
error = fget_only_user(fdp, fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1530
error = fget_unlocked(td, fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1533
selfdalloc(td, (void *)(uintptr_t)fd);
sys/kern/sys_generic.c
1730
struct pollfd *fd;
sys/kern/sys_generic.c
1739
fd = (struct pollfd *)sfp->sf_cookie;
sys/kern/sys_generic.c
1746
error = fget_only_user(fdp, fd->fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1748
error = fget_unlocked(td, fd->fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1750
fd->revents = POLLNVAL;
sys/kern/sys_generic.c
1758
fd->revents = fo_poll(fp, fd->events, td->td_ucred, td);
sys/kern/sys_generic.c
1763
if (fd->revents != 0)
sys/kern/sys_generic.c
1804
if (fds->fd < 0) {
sys/kern/sys_generic.c
1809
error = fget_only_user(fdp, fds->fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
1811
error = fget_unlocked(td, fds->fd, &cap_event_rights, &fp);
sys/kern/sys_generic.c
190
int fd;
sys/kern/sys_generic.c
210
error = kern_readv(td, uap->fd, &auio);
sys/kern/sys_generic.c
219
int fd;
sys/kern/sys_generic.c
230
return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
sys/kern/sys_generic.c
234
kern_pread(struct thread *td, int fd, void *buf, size_t nbyte, off_t offset)
sys/kern/sys_generic.c
248
error = kern_preadv(td, fd, &auio, offset);
sys/kern/sys_generic.c
257
return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
sys/kern/sys_generic.c
266
int fd;
sys/kern/sys_generic.c
280
error = kern_readv(td, uap->fd, auio);
sys/kern/sys_generic.c
286
kern_readv(struct thread *td, int fd, struct uio *auio)
sys/kern/sys_generic.c
291
error = fget_read(td, fd, &cap_read_rights, &fp);
sys/kern/sys_generic.c
294
error = dofileread(td, fd, fp, auio, (off_t)-1, 0);
sys/kern/sys_generic.c
304
int fd;
sys/kern/sys_generic.c
319
error = kern_preadv(td, uap->fd, auio, uap->offset);
sys/kern/sys_generic.c
325
kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset)
sys/kern/sys_generic.c
330
error = fget_read(td, fd, &cap_pread_rights, &fp);
sys/kern/sys_generic.c
339
error = dofileread(td, fd, fp, auio, offset, FOF_OFFSET);
sys/kern/sys_generic.c
349
dofileread(struct thread *td, int fd, struct file *fp, struct uio *auio,
sys/kern/sys_generic.c
358
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
382
ktrgenio(fd, UIO_READ, ktruio, error);
sys/kern/sys_generic.c
391
int fd;
sys/kern/sys_generic.c
411
error = kern_writev(td, uap->fd, &auio);
sys/kern/sys_generic.c
420
int fd;
sys/kern/sys_generic.c
431
return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
sys/kern/sys_generic.c
435
kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte,
sys/kern/sys_generic.c
450
error = kern_pwritev(td, fd, &auio, offset);
sys/kern/sys_generic.c
459
return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset));
sys/kern/sys_generic.c
468
int fd;
sys/kern/sys_generic.c
482
error = kern_writev(td, uap->fd, auio);
sys/kern/sys_generic.c
488
kern_writev(struct thread *td, int fd, struct uio *auio)
sys/kern/sys_generic.c
493
error = fget_write(td, fd, &cap_write_rights, &fp);
sys/kern/sys_generic.c
496
error = dofilewrite(td, fd, fp, auio, (off_t)-1, 0);
sys/kern/sys_generic.c
506
int fd;
sys/kern/sys_generic.c
521
error = kern_pwritev(td, uap->fd, auio, uap->offset);
sys/kern/sys_generic.c
527
kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset)
sys/kern/sys_generic.c
532
error = fget_write(td, fd, &cap_pwrite_rights, &fp);
sys/kern/sys_generic.c
541
error = dofilewrite(td, fd, fp, auio, offset, FOF_OFFSET);
sys/kern/sys_generic.c
551
dofilewrite(struct thread *td, int fd, struct file *fp, struct uio *auio,
sys/kern/sys_generic.c
557
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
562
error = kern_filewrite(td, fd, fp, auio, flags, &cnt);
sys/kern/sys_generic.c
590
kern_filewrite(struct thread *td, int fd, struct file *fp, struct uio *auio,
sys/kern/sys_generic.c
598
ktruio = fd != -1 && KTRPOINT(td, KTR_GENIO) ? cloneuio(auio) : NULL;
sys/kern/sys_generic.c
607
ktrgenio(fd, UIO_WRITE, ktruio, error);
sys/kern/sys_generic.c
622
kern_ftruncate(struct thread *td, int fd, off_t length)
sys/kern/sys_generic.c
627
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
630
error = fget(td, fd, &cap_ftruncate_rights, &fp);
sys/kern/sys_generic.c
645
int fd;
sys/kern/sys_generic.c
654
return (kern_ftruncate(td, uap->fd, uap->length));
sys/kern/sys_generic.c
660
int fd;
sys/kern/sys_generic.c
668
return (kern_ftruncate(td, uap->fd, uap->length));
sys/kern/sys_generic.c
674
int fd;
sys/kern/sys_generic.c
739
error = kern_ioctl(td, uap->fd, com, data);
sys/kern/sys_generic.c
751
kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data)
sys/kern/sys_generic.c
757
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
779
if ((fp = fget_noref(fdp, fd)) == NULL) {
sys/kern/sys_generic.c
783
if ((error = cap_ioctl_check(fdp, fd, com)) != 0) {
sys/kern/sys_generic.c
797
error = fget(td, fd, &cap_ioctl_rights, &fp);
sys/kern/sys_generic.c
811
fdp->fd_ofiles[fd].fde_flags &= ~UF_EXCLOSE;
sys/kern/sys_generic.c
814
fdp->fd_ofiles[fd].fde_flags |= UF_EXCLOSE;
sys/kern/sys_generic.c
862
error = kern_posix_fallocate(td, uap->fd, uap->offset, uap->len);
sys/kern/sys_generic.c
867
kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len)
sys/kern/sys_generic.c
872
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
880
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
881
error = fget(td, fd, &cap_pwrite_rights, &fp);
sys/kern/sys_generic.c
910
error = kern_fspacectl(td, uap->fd, uap->cmd, &rqsr, uap->flags,
sys/kern/sys_generic.c
921
kern_fspacectl(struct thread *td, int fd, int cmd,
sys/kern/sys_generic.c
928
AUDIT_ARG_FD(fd);
sys/kern/sys_generic.c
949
error = fget_write(td, fd, &cap_pwrite_rights, &fp);
sys/kern/sys_generic.c
979
int error, fd, fflags;
sys/kern/sys_pipe.c
478
int fd, fflags, error;
sys/kern/sys_pipe.c
485
error = falloc_caps(td, &rf, &fd, flags, fcaps1);
sys/kern/sys_pipe.c
492
fildes[0] = fd;
sys/kern/sys_pipe.c
505
error = falloc_caps(td, &wf, &fd, flags, fcaps2);
sys/kern/sys_pipe.c
516
fildes[1] = fd;
sys/kern/sys_procdesc.c
139
kern_pdgetpid(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/sys_procdesc.c
145
error = fget_procdesc(td, fd, rightsp, &fp, NULL, NULL);
sys/kern/sys_procdesc.c
162
AUDIT_ARG_FD(uap->fd);
sys/kern/sys_procdesc.c
163
error = kern_pdgetpid(td, uap->fd, &cap_pdgetpid_rights, &pid);
sys/kern/sys_procdesc.c
656
int error, fd, fflags;
sys/kern/sys_procdesc.c
671
error = finstall(td, fp, &fd, fflags, NULL);
sys/kern/sys_procdesc.c
673
td->td_retval[0] = fd;
sys/kern/sys_procdesc.c
750
kern_pddupfd(struct thread *td, int pdfd, int fd, int flags)
sys/kern/sys_procdesc.c
786
error = fget_remote(td, p, fd, &fcaps, &fd_flags, &fp);
sys/kern/sys_procdesc.c
818
return (kern_pddupfd(td, args->pd, args->fd, args->flags));
sys/kern/sys_socket.c
368
soo_fdclose(struct file *fp, int fd __unused, struct thread *td)
sys/kern/sys_timerfd.c
439
int error, fd, fflags;
sys/kern/sys_timerfd.c
467
error = falloc(td, &fp, &fd, fflags);
sys/kern/sys_timerfd.c
488
td->td_retval[0] = fd;
sys/kern/sys_timerfd.c
493
kern_timerfd_gettime(struct thread *td, int fd, struct itimerspec *curr_value)
sys/kern/sys_timerfd.c
499
error = fget(td, fd, &cap_read_rights, &fp);
sys/kern/sys_timerfd.c
517
kern_timerfd_settime(struct thread *td, int fd, int flags,
sys/kern/sys_timerfd.c
531
error = fget(td, fd, &cap_write_rights, &fp);
sys/kern/sys_timerfd.c
590
error = kern_timerfd_gettime(td, uap->fd, &curr_value);
sys/kern/sys_timerfd.c
608
error = kern_timerfd_settime(td, uap->fd, uap->flags,
sys/kern/sys_timerfd.c
611
error = kern_timerfd_settime(td, uap->fd, uap->flags,
sys/kern/systrace_args.c
101
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1313
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1323
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1454
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1771
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1782
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1793
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1853
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1869
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
1911
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2186
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2479
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2489
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2503
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2511
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2528
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
255
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2600
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2610
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2620
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2631
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2640
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2660
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2669
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2678
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2688
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2709
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2717
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2795
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
281
uarg[a++] = p->fd; /* u_int */
sys/kern/systrace_args.c
2823
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2831
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2916
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2925
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2947
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2955
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2964
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2973
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2981
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2989
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
2999
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3009
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3064
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3072
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3082
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3089
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3097
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3115
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3133
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3158
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3168
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3213
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3251
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3311
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3361
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3409
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3417
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3447
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3472
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
348
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3482
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
35
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3506
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3513
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3539
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
3570
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
44
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
510
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
530
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
62
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
627
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
636
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
653
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
662
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
694
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
913
iarg[a++] = p->fd; /* int */
sys/kern/systrace_args.c
977
iarg[a++] = p->fd; /* int */
sys/kern/tty.c
2130
ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct ttyhook *th,
sys/kern/tty.c
2149
error = fget_cap_noref(fdp, fd, cap_rights_init_one(&rights, CAP_TTYHOOK),
sys/kern/tty_pts.c
834
int error, fd;
sys/kern/tty_pts.c
844
error = falloc(td, &fp, &fd, uap->flags);
sys/kern/tty_pts.c
851
fdclose(td, fp, fd);
sys/kern/tty_pts.c
857
td->td_retval[0] = fd;
sys/kern/uipc_domain.c
68
pr_bindat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
sys/kern/uipc_domain.c
81
pr_connectat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
sys/kern/uipc_mqueue.c
1966
notifier_search(struct proc *p, int fd)
sys/kern/uipc_mqueue.c
1971
if (nt->nt_ksi.ksi_mqd == fd)
sys/kern/uipc_mqueue.c
1991
notifier_remove(struct proc *p, struct mqueue *mq, int fd)
sys/kern/uipc_mqueue.c
1997
nt = notifier_search(p, fd);
sys/kern/uipc_mqueue.c
2016
int fd, error, len, cmode;
sys/kern/uipc_mqueue.c
2056
error = falloc(td, &fp, &fd, O_CLOEXEC);
sys/kern/uipc_mqueue.c
2100
fdclose(td, fp, fd);
sys/kern/uipc_mqueue.c
2111
td->td_retval[0] = fd;
sys/kern/uipc_mqueue.c
2180
_getmq(struct thread *td, int fd, const cap_rights_t *rightsp, _fgetf func,
sys/kern/uipc_mqueue.c
2186
error = func(td, fd, rightsp, fpp);
sys/kern/uipc_mqueue.c
2202
getmq(struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn,
sys/kern/uipc_mqueue.c
2206
return _getmq(td, fd, &cap_event_rights, fget,
sys/kern/uipc_mqueue.c
2211
getmq_read(struct thread *td, int fd, struct file **fpp,
sys/kern/uipc_mqueue.c
2215
return _getmq(td, fd, &cap_read_rights, fget_read,
sys/kern/uipc_mqueue.c
2220
getmq_write(struct thread *td, int fd, struct file **fpp,
sys/kern/uipc_mqueue.c
2224
return _getmq(td, fd, &cap_write_rights, fget_write,
sys/kern/uipc_mqueue.c
2539
mqf_fdclose(struct file *fp, int fd, struct thread *td)
sys/kern/uipc_mqueue.c
2551
notifier_remove(td->td_proc, mq, fd);
sys/kern/uipc_sem.c
433
ksem_create_copyout_semid(struct thread *td, semid_t *semidp, int fd,
sys/kern/uipc_sem.c
445
semid32 = fd;
sys/kern/uipc_sem.c
450
semid = fd;
sys/kern/uipc_sem.c
473
int error, fd;
sys/kern/uipc_sem.c
484
error = falloc(td, &fp, &fd, O_CLOEXEC);
sys/kern/uipc_sem.c
496
error = ksem_create_copyout_semid(td, semidp, fd, compat32);
sys/kern/uipc_sem.c
498
fdclose(td, fp, fd);
sys/kern/uipc_sem.c
524
fdclose(td, fp, fd);
sys/kern/uipc_sem.c
576
fdclose(td, fp, fd);
sys/kern/uipc_shm.c
1168
int error, fd, initial_seals;
sys/kern/uipc_shm.c
1236
error = falloc_caps(td, &fp, &fd, flags & O_CLOEXEC, fcaps);
sys/kern/uipc_shm.c
1380
td->td_retval[0] = fd;
sys/kern/uipc_shm.c
1387
fdclose(td, fp, fd);
sys/kern/uipc_socket.c
1418
sobindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
sys/kern/uipc_socket.c
1423
error = so->so_proto->pr_bindat(fd, so, nam, td);
sys/kern/uipc_socket.c
2141
soconnectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
sys/kern/uipc_socket.c
2165
if (fd == AT_FDCWD) {
sys/kern/uipc_socket.c
2168
error = so->so_proto->pr_connectat(fd, so, nam, td);
sys/kern/uipc_syscalls.c
108
getsock(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/uipc_syscalls.c
114
error = fget_unlocked(td, fd, rightsp, &fp);
sys/kern/uipc_syscalls.c
1367
kern_getsockname(struct thread *td, int fd, struct sockaddr *sa)
sys/kern/uipc_syscalls.c
1373
AUDIT_ARG_FD(fd);
sys/kern/uipc_syscalls.c
1374
error = getsock(td, fd, &cap_getsockname_rights, &fp);
sys/kern/uipc_syscalls.c
1431
kern_getpeername(struct thread *td, int fd, struct sockaddr *sa)
sys/kern/uipc_syscalls.c
1437
AUDIT_ARG_FD(fd);
sys/kern/uipc_syscalls.c
1438
error = getsock(td, fd, &cap_getpeername_rights, &fp);
sys/kern/uipc_syscalls.c
144
int fd, error, oflag, fflag;
sys/kern/uipc_syscalls.c
1548
int error, fd, *fds, nfd;
sys/kern/uipc_syscalls.c
1570
fd = *fds++;
sys/kern/uipc_syscalls.c
1571
error = fget(td, fd, &cap_no_rights,
sys/kern/uipc_syscalls.c
1574
fdclose(td, fp, fd);
sys/kern/uipc_syscalls.c
168
error = falloc(td, &fp, &fd, oflag);
sys/kern/uipc_syscalls.c
174
fdclose(td, fp, fd);
sys/kern/uipc_syscalls.c
179
td->td_retval[0] = fd;
sys/kern/uipc_syscalls.c
200
kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa)
sys/kern/uipc_syscalls.c
215
AUDIT_ARG_FD(fd);
sys/kern/uipc_syscalls.c
217
error = getsock(td, fd, &cap_bind_rights, &fp);
sys/kern/uipc_syscalls.c
248
error = kern_bindat(td, uap->fd, uap->s, sa);
sys/kern/uipc_syscalls.c
340
int error, fd, tmp;
sys/kern/uipc_syscalls.c
358
error = falloc_caps(td, &nfp, &fd,
sys/kern/uipc_syscalls.c
375
td->td_retval[0] = fd;
sys/kern/uipc_syscalls.c
410
fdclose(td, nfp, fd);
sys/kern/uipc_syscalls.c
474
kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa)
sys/kern/uipc_syscalls.c
489
AUDIT_ARG_FD(fd);
sys/kern/uipc_syscalls.c
491
error = getsock(td, fd, &cap_connect_rights, &fp);
sys/kern/uipc_syscalls.c
543
error = kern_connectat(td, uap->fd, uap->s, sa);
sys/kern/uipc_syscalls.c
555
int fd, error, oflag, fflag;
sys/kern/uipc_syscalls.c
587
error = falloc(td, &fp1, &fd, oflag);
sys/kern/uipc_syscalls.c
590
rsv[0] = fd;
sys/kern/uipc_syscalls.c
592
error = falloc(td, &fp2, &fd, oflag);
sys/kern/uipc_syscalls.c
596
rsv[1] = fd;
sys/kern/uipc_syscalls.c
88
getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/uipc_syscalls.c
94
error = fget_cap(td, fd, rightsp, NULL, &fp, havecapsp);
sys/kern/uipc_usrreq.c
2875
unp_connectat(int fd, struct socket *so, struct sockaddr *nam,
sys/kern/uipc_usrreq.c
2946
(fd == AT_FDCWD ? 0 : EMPTYPATH), UIO_SYSSPACE, buf, fd,
sys/kern/uipc_usrreq.c
565
uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
sys/kern/uipc_usrreq.c
618
UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_BINDAT));
sys/kern/uipc_usrreq.c
710
uipc_connectat(int fd, struct socket *so, struct sockaddr *nam,
sys/kern/uipc_usrreq.c
716
error = unp_connectat(fd, so, nam, td, false);
sys/kern/vfs_aio.c
1512
int fd, kqfd;
sys/kern/vfs_aio.c
1591
fd = job->uaiocb.aio_fildes;
sys/kern/vfs_aio.c
1595
error = fget_write(td, fd, &cap_pwrite_rights, &fp);
sys/kern/vfs_aio.c
1599
error = fget_read(td, fd, &cap_pread_rights, &fp);
sys/kern/vfs_aio.c
1603
error = fget(td, fd, &cap_fsync_rights, &fp);
sys/kern/vfs_aio.c
1608
error = fget(td, fd, &cap_no_rights, &fp);
sys/kern/vfs_aio.c
2055
error = fget(td, uap->fd, &cap_no_rights, &fp);
sys/kern/vfs_aio.c
2084
if (uap->fd == job->uaiocb.aio_fildes &&
sys/kern/vfs_cache.c
3281
kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
sys/kern/vfs_cache.c
3291
pathseg, path, fd, &cap_fstat_rights);
sys/kern/vfs_cache.c
3344
return (kern___realpathat(td, uap->fd, uap->path, uap->buf, uap->size,
sys/kern/vfs_extattr.c
223
int fd;
sys/kern/vfs_extattr.c
239
return (kern_extattr_set_fd(td, uap->fd, uap->attrnamespace,
sys/kern/vfs_extattr.c
253
kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace,
sys/kern/vfs_extattr.c
260
AUDIT_ARG_FD(fd);
sys/kern/vfs_extattr.c
264
error = getvnode_path(td, fd,
sys/kern/vfs_extattr.c
420
int fd;
sys/kern/vfs_extattr.c
436
return (kern_extattr_get_fd(td, uap->fd, uap->attrnamespace,
sys/kern/vfs_extattr.c
450
kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace,
sys/kern/vfs_extattr.c
457
AUDIT_ARG_FD(fd);
sys/kern/vfs_extattr.c
461
error = getvnode_path(td, fd,
sys/kern/vfs_extattr.c
587
int fd;
sys/kern/vfs_extattr.c
601
return (kern_extattr_delete_fd(td, uap->fd, uap->attrnamespace,
sys/kern/vfs_extattr.c
614
kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace,
sys/kern/vfs_extattr.c
621
AUDIT_ARG_FD(fd);
sys/kern/vfs_extattr.c
625
error = getvnode_path(td, fd,
sys/kern/vfs_extattr.c
751
int fd;
sys/kern/vfs_extattr.c
777
return (kern_extattr_list_fd(td, uap->fd, uap->attrnamespace,
sys/kern/vfs_extattr.c
790
kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace,
sys/kern/vfs_extattr.c
797
AUDIT_ARG_FD(fd);
sys/kern/vfs_extattr.c
799
error = getvnode_path(td, fd,
sys/kern/vfs_inotify.c
1005
return (kern_inotify_add_watch(uap->fd, uap->dfd, uap->path,
sys/kern/vfs_inotify.c
1010
kern_inotify_rm_watch(int fd, uint32_t wd, struct thread *td)
sys/kern/vfs_inotify.c
1018
error = fget_inotify(td, fd, &cap_inotify_rm_rights, &fp);
sys/kern/vfs_inotify.c
1055
return (kern_inotify_rm_watch(uap->fd, uap->wd, td));
sys/kern/vfs_inotify.c
906
fget_inotify(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/kern/vfs_inotify.c
912
error = fget(td, fd, needrightsp, &fp);
sys/kern/vfs_inotify.c
924
kern_inotify_add_watch(int fd, int dfd, const char *path, uint32_t mask,
sys/kern/vfs_inotify.c
946
error = fget_inotify(td, fd, &cap_inotify_add_rights, &fp);
sys/kern/vfs_mountroot.c
577
int error, fd, len;
sys/kern/vfs_mountroot.c
580
fd = -1;
sys/kern/vfs_mountroot.c
603
fd = td->td_retval[0];
sys/kern/vfs_mountroot.c
609
(void)kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio);
sys/kern/vfs_mountroot.c
618
error = kern_ioctl(td, fd, MDIOCATTACH, (void *)mdio);
sys/kern/vfs_mountroot.c
627
error = kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio);
sys/kern/vfs_mountroot.c
637
if (fd >= 0)
sys/kern/vfs_mountroot.c
638
(void)kern_close(td, fd);
sys/kern/vfs_subr.c
484
int fd;
sys/kern/vfs_subr.c
489
error = sysctl_handle_int(oidp, &fd, 0, req);
sys/kern/vfs_subr.c
492
error = getvnode(curthread, fd, &cap_fcntl_rights, &fp);
sys/kern/vfs_syscalls.c
102
static int kern_fhlinkat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
1042
int fd;
sys/kern/vfs_syscalls.c
1053
error = getvnode_path(td, uap->fd, &cap_fchroot_rights, &fdflags, &fp);
sys/kern/vfs_syscalls.c
106
static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd,
sys/kern/vfs_syscalls.c
1147
int fd;
sys/kern/vfs_syscalls.c
1157
AUDIT_ARG_FD(uap->fd);
sys/kern/vfs_syscalls.c
1158
return (kern_openat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag,
sys/kern/vfs_syscalls.c
1394
int fd;
sys/kern/vfs_syscalls.c
1404
return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode,
sys/kern/vfs_syscalls.c
1423
return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode,
sys/kern/vfs_syscalls.c
1429
kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
sys/kern/vfs_syscalls.c
1452
return (kern_mkfifoat(td, fd, path, pathseg, mode));
sys/kern/vfs_syscalls.c
1464
pathseg, path, fd, &cap_mknodat_rights);
sys/kern/vfs_syscalls.c
1549
int fd;
sys/kern/vfs_syscalls.c
1558
return (kern_mkfifoat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
1563
kern_mkfifoat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
1576
pathseg, path, fd, &cap_mkfifoat_rights);
sys/kern/vfs_syscalls.c
1727
kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path,
sys/kern/vfs_syscalls.c
1743
LOCKPARENT | AUDITVNODE2 | NOCACHE, segflag, path, fd,
sys/kern/vfs_syscalls.c
1826
int fd;
sys/kern/vfs_syscalls.c
1834
return (kern_symlinkat(td, uap->path1, uap->fd, uap->path2,
sys/kern/vfs_syscalls.c
1839
kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2,
sys/kern/vfs_syscalls.c
1862
path2, fd, &cap_symlinkat_rights);
sys/kern/vfs_syscalls.c
1976
kern_funlinkat_ex(struct thread *td, int dfd, const char *path, int fd,
sys/kern/vfs_syscalls.c
1984
return (kern_frmdirat(td, dfd, path, fd, pathseg,
sys/kern/vfs_syscalls.c
1987
return (kern_funlinkat(td, dfd, path, fd, pathseg, flags, 0));
sys/kern/vfs_syscalls.c
1992
int fd;
sys/kern/vfs_syscalls.c
2001
return (kern_funlinkat_ex(td, uap->fd, uap->path, FD_NONE, uap->flag,
sys/kern/vfs_syscalls.c
2009
int fd;
sys/kern/vfs_syscalls.c
2017
return (kern_funlinkat_ex(td, uap->dfd, uap->path, uap->fd, uap->flag,
sys/kern/vfs_syscalls.c
2022
kern_funlinkat(struct thread *td, int dfd, const char *path, int fd,
sys/kern/vfs_syscalls.c
2033
if (fd != FD_NONE) {
sys/kern/vfs_syscalls.c
2034
error = getvnode_path(td, fd, &cap_no_rights, NULL, &fp);
sys/kern/vfs_syscalls.c
2116
int fd;
sys/kern/vfs_syscalls.c
2126
return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
sys/kern/vfs_syscalls.c
2130
kern_lseek(struct thread *td, int fd, off_t offset, int whence)
sys/kern/vfs_syscalls.c
2135
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
2136
error = fget(td, fd, &cap_seek_rights, &fp);
sys/kern/vfs_syscalls.c
2151
int fd;
sys/kern/vfs_syscalls.c
2160
return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
sys/kern/vfs_syscalls.c
2170
return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
sys/kern/vfs_syscalls.c
2234
return (kern_accessat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag,
sys/kern/vfs_syscalls.c
2239
kern_accessat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
2270
AT_EMPTY_PATH), pathseg, path, fd, &cap_fstat_rights);
sys/kern/vfs_syscalls.c
2515
error = kern_statat(td, uap->flag, uap->fd, uap->path,
sys/kern/vfs_syscalls.c
2531
int fd;
sys/kern/vfs_syscalls.c
2543
error = kern_statat(td, uap->flag, uap->fd, uap->path,
sys/kern/vfs_syscalls.c
2551
kern_statat(struct thread *td, int flag, int fd, const char *path,
sys/kern/vfs_syscalls.c
2563
AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights);
sys/kern/vfs_syscalls.c
2568
error = kern_fstat(td, fd, sbp);
sys/kern/vfs_syscalls.c
2748
int fd;
sys/kern/vfs_syscalls.c
2758
return (kern_readlinkat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
2763
kern_readlinkat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
2774
EMPTYPATH, pathseg, path, fd);
sys/kern/vfs_syscalls.c
2881
int fd;
sys/kern/vfs_syscalls.c
2891
return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
2913
kern_chflagsat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
2926
fd, &cap_fchflags_rights);
sys/kern/vfs_syscalls.c
2940
int fd;
sys/kern/vfs_syscalls.c
2950
AUDIT_ARG_FD(uap->fd);
sys/kern/vfs_syscalls.c
2952
error = getvnode(td, uap->fd, &cap_fchflags_rights,
sys/kern/vfs_syscalls.c
3022
return (kern_fchmodat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
3044
kern_fchmodat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
3057
fd, &cap_fchmod_rights);
sys/kern/vfs_syscalls.c
3071
int fd;
sys/kern/vfs_syscalls.c
3081
AUDIT_ARG_FD(uap->fd);
sys/kern/vfs_syscalls.c
3084
error = fget(td, uap->fd, &cap_fchmod_rights, &fp);
sys/kern/vfs_syscalls.c
3140
int fd;
sys/kern/vfs_syscalls.c
3151
return (kern_fchownat(td, uap->fd, uap->path, UIO_USERSPACE, uap->uid,
sys/kern/vfs_syscalls.c
3156
kern_fchownat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
3169
fd, &cap_fchown_rights);
sys/kern/vfs_syscalls.c
3202
int fd;
sys/kern/vfs_syscalls.c
3213
AUDIT_ARG_FD(uap->fd);
sys/kern/vfs_syscalls.c
3215
error = fget(td, uap->fd, &cap_fchown_rights, &fp);
sys/kern/vfs_syscalls.c
3362
int fd;
sys/kern/vfs_syscalls.c
3371
return (kern_utimesat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
3376
kern_utimesat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
3385
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd,
sys/kern/vfs_syscalls.c
3437
int fd;
sys/kern/vfs_syscalls.c
3445
return (kern_futimes(td, uap->fd, uap->tptr, UIO_USERSPACE));
sys/kern/vfs_syscalls.c
3449
kern_futimes(struct thread *td, int fd, const struct timeval *tptr,
sys/kern/vfs_syscalls.c
3456
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
346
int fd;
sys/kern/vfs_syscalls.c
3460
error = getvnode(td, fd, &cap_futimes_rights, &fp);
sys/kern/vfs_syscalls.c
3479
return (kern_futimens(td, uap->fd, uap->times, UIO_USERSPACE));
sys/kern/vfs_syscalls.c
3483
kern_futimens(struct thread *td, int fd, const struct timespec *tptr,
sys/kern/vfs_syscalls.c
3490
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
3496
error = getvnode(td, fd, &cap_futimes_rights, &fp);
sys/kern/vfs_syscalls.c
3515
return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
3520
kern_utimensat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
3536
pathseg, path, fd, &cap_futimes_rights);
sys/kern/vfs_syscalls.c
357
error = kern_fstatfs(td, uap->fd, sfp);
sys/kern/vfs_syscalls.c
365
kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
sys/kern/vfs_syscalls.c
3650
return (kern_ftruncate(td, uap->fd, uap->length));
sys/kern/vfs_syscalls.c
3655
kern_fsync(struct thread *td, int fd, bool fullsync)
sys/kern/vfs_syscalls.c
3662
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
3663
error = getvnode(td, fd, &cap_fsync_rights, &fp);
sys/kern/vfs_syscalls.c
3693
int fd;
sys/kern/vfs_syscalls.c
3700
return (kern_fsync(td, uap->fd, true));
sys/kern/vfs_syscalls.c
3707
return (kern_fsync(td, uap->fd, false));
sys/kern/vfs_syscalls.c
372
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
373
error = getvnode_path(td, fd, &cap_fstatfs_rights, NULL, &fp);
sys/kern/vfs_syscalls.c
4029
int fd;
sys/kern/vfs_syscalls.c
4038
return (kern_mkdirat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode));
sys/kern/vfs_syscalls.c
4042
kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg,
sys/kern/vfs_syscalls.c
4056
segflg, path, fd, &cap_mkdirat_rights);
sys/kern/vfs_syscalls.c
4106
kern_frmdirat(struct thread *td, int dfd, const char *path, int fd,
sys/kern/vfs_syscalls.c
4117
if (fd != FD_NONE) {
sys/kern/vfs_syscalls.c
4118
error = getvnode(td, fd, cap_rights_init_one(&rights,
sys/kern/vfs_syscalls.c
4196
freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf, u_int count,
sys/kern/vfs_syscalls.c
4211
error = kern_getdirentries(td, fd, dirbuf, count, &base, &resid,
sys/kern/vfs_syscalls.c
4293
int fd;
sys/kern/vfs_syscalls.c
4322
error = freebsd11_kern_getdirentries(td, uap->fd, uap->buf, uap->count,
sys/kern/vfs_syscalls.c
4335
int fd;
sys/kern/vfs_syscalls.c
4348
error = freebsd11_kern_getdirentries(td, uap->fd, uap->buf, uap->count,
sys/kern/vfs_syscalls.c
4361
ap.fd = uap->fd;
sys/kern/vfs_syscalls.c
4378
error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base,
sys/kern/vfs_syscalls.c
4388
kern_getdirentries(struct thread *td, int fd, char *buf, size_t count,
sys/kern/vfs_syscalls.c
4399
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
4403
error = getvnode(td, fd, &cap_read_rights, &fp);
sys/kern/vfs_syscalls.c
4548
getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/vfs_syscalls.c
4554
error = fget_unlocked_flags(td, fd, rightsp, flagsp, &fp);
sys/kern/vfs_syscalls.c
4586
getvnode(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/kern/vfs_syscalls.c
4591
error = getvnode_path(td, fd, rightsp, NULL, fpp);
sys/kern/vfs_syscalls.c
4648
int fd;
sys/kern/vfs_syscalls.c
4658
return (kern_getfhat(td, uap->flags, uap->fd, uap->path, UIO_USERSPACE,
sys/kern/vfs_syscalls.c
4663
kern_getfhat(struct thread *td, int flags, int fd, const char *path,
sys/kern/vfs_syscalls.c
4678
fd);
sys/kern/vfs_syscalls.c
4725
kern_fhlinkat(struct thread *td, int fd, const char *path,
sys/kern/vfs_syscalls.c
4748
error = kern_linkat_vp(td, vp, fd, path, pathseg);
sys/kern/vfs_syscalls.c
5003
kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len,
sys/kern/vfs_syscalls.c
5030
AUDIT_ARG_FD(fd);
sys/kern/vfs_syscalls.c
5031
error = fget(td, fd, &cap_no_rights, &fp);
sys/kern/vfs_syscalls.c
5129
error = kern_posix_fadvise(td, uap->fd, uap->offset, uap->len,
sys/kern/vfs_syscalls.c
613
int fd;
sys/kern/vfs_syscalls.c
625
error = kern_fstatfs(td, uap->fd, sfp);
sys/kern/vfs_syscalls.c
773
error = kern_fstatfs(td, uap->fd, sfp);
sys/kern/vfs_syscalls.c
885
int fd;
sys/kern/vfs_syscalls.c
897
AUDIT_ARG_FD(uap->fd);
sys/kern/vfs_syscalls.c
898
error = getvnode_path(td, uap->fd, &cap_fchdir_rights, &fdflags,
sys/kern/vfs_syscalls.c
92
static int kern_chflagsat(struct thread *td, int fd, const char *path,
sys/net/if_ovpn.c
638
int fd;
sys/net/if_ovpn.c
662
fd = nvlist_get_number(nvl, "fd");
sys/net/if_ovpn.c
665
ret = getsock(td, fd, &cap_connect_rights, &fp);
sys/net/netmap_user.h
1010
d->fd, 0);
sys/net/netmap_user.h
269
int fd;
sys/net/netmap_user.h
311
#define NETMAP_FD(d) (P2NMD(d)->fd)
sys/net/netmap_user.h
415
win_insert_fd_record(int fd)
sys/net/netmap_user.h
420
if (fd == curr->win_netmap_fd) {
sys/net/netmap_user.h
426
curr->win_netmap_fd = fd;
sys/net/netmap_user.h
427
curr->win_netmap_handle = IntToPtr(_get_osfhandle(fd));
sys/net/netmap_user.h
432
win_remove_fd_record(int fd)
sys/net/netmap_user.h
437
if (fd != curr->win_netmap_fd)
sys/net/netmap_user.h
452
win_get_netmap_handle(int fd)
sys/net/netmap_user.h
457
if (fd == curr->win_netmap_fd) {
sys/net/netmap_user.h
521
win_nm_ioctl(int fd, int32_t ctlCode, void *arg)
sys/net/netmap_user.h
523
HANDLE h = win_get_netmap_handle(fd);
sys/net/netmap_user.h
526
return ioctl(fd, ctlCode, arg);
sys/net/netmap_user.h
540
win32_mmap_emulated(void *addr, size_t length, int prot, int flags, int fd, int32_t offset)
sys/net/netmap_user.h
542
HANDLE h = win_get_netmap_handle(fd);
sys/net/netmap_user.h
545
return mmap(addr, length, prot, flags, fd, offset);
sys/net/netmap_user.h
563
if (nfds != 1 || fds == NULL || (h = win_get_netmap_handle(fds->fd)) == NULL) {;
sys/net/netmap_user.h
586
int fd = open(NETMAP_DEVICE_NAME, O_RDWR);
sys/net/netmap_user.h
587
if (fd < 0) {
sys/net/netmap_user.h
591
win_insert_fd_record(fd);
sys/net/netmap_user.h
592
return fd;
sys/net/netmap_user.h
601
win_nm_close(int fd)
sys/net/netmap_user.h
603
if (fd != -1) {
sys/net/netmap_user.h
604
close(fd);
sys/net/netmap_user.h
605
if (win_get_netmap_handle(fd) != NULL) {
sys/net/netmap_user.h
606
win_remove_fd_record(fd);
sys/net/netmap_user.h
851
d->fd = open(NETMAP_DEVICE_NAME, O_RDWR);
sys/net/netmap_user.h
852
if (d->fd < 0) {
sys/net/netmap_user.h
902
if (ioctl(d->fd, NIOCREGIF, &d->req)) {
sys/net/netmap_user.h
984
if (d->fd != -1) {
sys/net/netmap_user.h
985
close(d->fd);
sys/net/route/fib_algo.c
1007
schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout)
sys/net/route/fib_algo.c
1012
RIB_WLOCK_ASSERT(fd->fd_rh);
sys/net/route/fib_algo.c
1015
is_dead = fd->fd_dead;
sys/net/route/fib_algo.c
1017
fd->fd_dead = true;
sys/net/route/fib_algo.c
1018
if (fd->fd_linked) {
sys/net/route/fib_algo.c
1019
TAILQ_REMOVE(&V_fib_data_list, fd, entries);
sys/net/route/fib_algo.c
1020
fd->fd_linked = false;
sys/net/route/fib_algo.c
1026
FD_PRINTF(LOG_INFO, fd, "DETACH");
sys/net/route/fib_algo.c
1028
if (fd->fd_rs != NULL)
sys/net/route/fib_algo.c
1029
rib_unsubscribe_locked(fd->fd_rs);
sys/net/route/fib_algo.c
1035
callout_stop(&fd->fd_callout);
sys/net/route/fib_algo.c
1037
fib_epoch_call(destroy_fd_instance_epoch, &fd->fd_epoch_ctx);
sys/net/route/fib_algo.c
1050
struct fib_data *fd, *fd_tmp;
sys/net/route/fib_algo.c
1054
TAILQ_FOREACH_SAFE(fd, &V_fib_data_list, entries, fd_tmp) {
sys/net/route/fib_algo.c
1055
if (fd->fd_rh == rh) {
sys/net/route/fib_algo.c
1060
TAILQ_REMOVE(&V_fib_data_list, fd, entries);
sys/net/route/fib_algo.c
1061
fd->fd_linked = false;
sys/net/route/fib_algo.c
1062
TAILQ_INSERT_TAIL(&tmp_head, fd, entries);
sys/net/route/fib_algo.c
1069
TAILQ_FOREACH_SAFE(fd, &tmp_head, entries, fd_tmp) {
sys/net/route/fib_algo.c
1071
RIB_WLOCK(fd->fd_rh);
sys/net/route/fib_algo.c
1072
schedule_destroy_fd_instance(fd, in_callout);
sys/net/route/fib_algo.c
1074
RIB_WUNLOCK(fd->fd_rh);
sys/net/route/fib_algo.c
1095
destroy_fd_instance(struct fib_data *fd)
sys/net/route/fib_algo.c
1098
FD_PRINTF(LOG_INFO, fd, "destroy fd %p", fd);
sys/net/route/fib_algo.c
1101
if (fd->fd_algo_data != NULL)
sys/net/route/fib_algo.c
1102
fd->fd_flm->flm_destroy_cb(fd->fd_algo_data);
sys/net/route/fib_algo.c
1105
if ((fd->nh_idx != NULL) && (fd->nh_ref_table != NULL)) {
sys/net/route/fib_algo.c
1106
for (int i = 0; i < fd->number_nhops; i++) {
sys/net/route/fib_algo.c
1107
if (!is_idx_free(fd, i)) {
sys/net/route/fib_algo.c
1108
FD_PRINTF(LOG_DEBUG2, fd, " FREE nhop %d %p",
sys/net/route/fib_algo.c
1109
i, fd->nh_idx[i]);
sys/net/route/fib_algo.c
1110
nhop_free_any(fd->nh_idx[i]);
sys/net/route/fib_algo.c
1113
free(fd->nh_idx, M_RTABLE);
sys/net/route/fib_algo.c
1115
if (fd->nh_ref_table != NULL)
sys/net/route/fib_algo.c
1116
free(fd->nh_ref_table, M_RTABLE);
sys/net/route/fib_algo.c
1118
if (fd->fd_ss.fd_change_queue.entries != NULL)
sys/net/route/fib_algo.c
1119
free(fd->fd_ss.fd_change_queue.entries, M_TEMP);
sys/net/route/fib_algo.c
1121
fib_unref_algo(fd->fd_flm);
sys/net/route/fib_algo.c
1123
free(fd, M_RTABLE);
sys/net/route/fib_algo.c
1132
struct fib_data *fd;
sys/net/route/fib_algo.c
1134
fd = __containerof(ctx, struct fib_data, fd_epoch_ctx);
sys/net/route/fib_algo.c
1136
CURVNET_SET(fd->fd_vnet);
sys/net/route/fib_algo.c
1137
destroy_fd_instance(fd);
sys/net/route/fib_algo.c
1156
struct fib_data *fd;
sys/net/route/fib_algo.c
1161
fd = malloc(sizeof(struct fib_data), M_RTABLE, M_NOWAIT | M_ZERO);
sys/net/route/fib_algo.c
1162
if (fd == NULL) {
sys/net/route/fib_algo.c
1167
*pfd = fd;
sys/net/route/fib_algo.c
1169
estimate_nhop_scale(old_fd, fd);
sys/net/route/fib_algo.c
1171
fd->fd_rh = rh;
sys/net/route/fib_algo.c
1172
fd->fd_family = rh->rib_family;
sys/net/route/fib_algo.c
1173
fd->fd_fibnum = rh->rib_fibnum;
sys/net/route/fib_algo.c
1174
callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0);
sys/net/route/fib_algo.c
1175
fd->fd_vnet = curvnet;
sys/net/route/fib_algo.c
1176
fd->fd_flm = flm;
sys/net/route/fib_algo.c
1180
fd->fd_gen = ++fib_gen;
sys/net/route/fib_algo.c
1183
FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd);
sys/net/route/fib_algo.c
1186
size = fd->number_nhops * sizeof(void *);
sys/net/route/fib_algo.c
1187
fd->nh_idx = malloc(size, M_RTABLE, M_NOWAIT | M_ZERO);
sys/net/route/fib_algo.c
1188
if (fd->nh_idx == NULL) {
sys/net/route/fib_algo.c
1189
FD_PRINTF(LOG_INFO, fd, "Unable to allocate nhop table idx (sz:%zu)", size);
sys/net/route/fib_algo.c
1195
size += fd->number_nhops * sizeof(uint32_t);
sys/net/route/fib_algo.c
1196
fd->nh_ref_table = malloc(size, M_RTABLE, M_NOWAIT | M_ZERO);
sys/net/route/fib_algo.c
1197
if (fd->nh_ref_table == NULL) {
sys/net/route/fib_algo.c
1198
FD_PRINTF(LOG_INFO, fd, "Unable to allocate nhop refcount table (sz:%zu)", size);
sys/net/route/fib_algo.c
1201
FD_PRINTF(LOG_DEBUG, fd, "Allocated %u nhop indexes", fd->number_nhops);
sys/net/route/fib_algo.c
1205
result = flm->flm_init_cb(fd->fd_fibnum, fd, old_algo_data, &fd->fd_algo_data);
sys/net/route/fib_algo.c
1207
FD_PRINTF(LOG_INFO, fd, "%s algo init failed", flm->flm_name);
sys/net/route/fib_algo.c
1213
fd->fd_rs = rib_subscribe_locked(fd->fd_rh,
sys/net/route/fib_algo.c
1214
handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE);
sys/net/route/fib_algo.c
1215
if (fd->fd_rs == NULL) {
sys/net/route/fib_algo.c
1216
FD_PRINTF(LOG_INFO, fd, "failed to subscribe to the rib changes");
sys/net/route/fib_algo.c
1222
result = sync_algo(fd);
sys/net/route/fib_algo.c
1224
FD_PRINTF(LOG_INFO, fd, "rib sync failed");
sys/net/route/fib_algo.c
1227
FD_PRINTF(LOG_INFO, fd, "DUMP completed successfully.");
sys/net/route/fib_algo.c
1235
TAILQ_INSERT_HEAD(&V_fib_data_list, fd, entries);
sys/net/route/fib_algo.c
1236
fd->fd_linked = true;
sys/net/route/fib_algo.c
1317
execute_callout_action(struct fib_data *fd)
sys/net/route/fib_algo.c
1319
enum fib_callout_action action = fd->fd_callout_action;
sys/net/route/fib_algo.c
1324
RIB_WLOCK_ASSERT(fd->fd_rh);
sys/net/route/fib_algo.c
1326
fd->fd_need_rebuild = false;
sys/net/route/fib_algo.c
1327
fd->fd_batch = false;
sys/net/route/fib_algo.c
1328
fd->fd_num_changes = 0;
sys/net/route/fib_algo.c
1331
if (!is_algo_fixed(fd->fd_rh))
sys/net/route/fib_algo.c
1332
flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm);
sys/net/route/fib_algo.c
1338
if (!apply_rtable_changes(fd))
sys/net/route/fib_algo.c
1343
result = rebuild_fd_flm(fd, flm_new != NULL ? flm_new : fd->fd_flm);
sys/net/route/fib_algo.c
1359
struct fib_data *fd = (struct fib_data *)_data;
sys/net/route/fib_algo.c
1362
FD_PRINTF(LOG_INFO, fd, "running callout type=%d", fd->fd_callout_action);
sys/net/route/fib_algo.c
1365
CURVNET_SET(fd->fd_vnet);
sys/net/route/fib_algo.c
1366
execute_callout_action(fd);
sys/net/route/fib_algo.c
1376
rebuild_fd_flm(struct fib_data *fd, struct fib_lookup_module *flm_new)
sys/net/route/fib_algo.c
1381
if (flm_new == fd->fd_flm)
sys/net/route/fib_algo.c
1382
fd_tmp = fd;
sys/net/route/fib_algo.c
1384
FD_PRINTF(LOG_INFO, fd, "switching algo to %s", flm_new->flm_name);
sys/net/route/fib_algo.c
1386
result = setup_fd_instance(flm_new, fd->fd_rh, fd_tmp, &fd_new, true);
sys/net/route/fib_algo.c
1388
FD_PRINTF(LOG_NOTICE, fd, "table rebuild failed");
sys/net/route/fib_algo.c
1394
schedule_destroy_fd_instance(fd, true);
sys/net/route/fib_algo.c
1400
rebuild_fd(struct fib_data *fd, const char *reason)
sys/net/route/fib_algo.c
1405
if (!is_algo_fixed(fd->fd_rh))
sys/net/route/fib_algo.c
1406
flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm);
sys/net/route/fib_algo.c
1408
FD_PRINTF(LOG_INFO, fd, "running sync rebuild: %s", reason);
sys/net/route/fib_algo.c
1409
result = rebuild_fd_flm(fd, flm_new != NULL ? flm_new : fd->fd_flm);
sys/net/route/fib_algo.c
1414
FD_PRINTF(LOG_ERR, fd, "sync rebuild failed");
sys/net/route/fib_algo.c
1415
schedule_fd_rebuild(fd, "sync rebuild failed");
sys/net/route/fib_algo.c
1457
struct fib_data *fd = NULL;
sys/net/route/fib_algo.c
1466
TAILQ_FOREACH(fd, &V_fib_data_list, entries) {
sys/net/route/fib_algo.c
1467
if ((fd->fd_family == family) && (fd->fd_fibnum == fibnum))
sys/net/route/fib_algo.c
1470
if (fd == NULL) {
sys/net/route/fib_algo.c
1474
rh = fd->fd_rh;
sys/net/route/fib_algo.c
1475
strlcpy(old_algo_name, fd->fd_flm->flm_name,
sys/net/route/fib_algo.c
1494
fd = NULL;
sys/net/route/fib_algo.c
1497
result = setup_fd_instance(flm, rh, NULL, &fd, true);
sys/net/route/fib_algo.c
1590
replace_rtables_family(struct fib_dp **pdp, struct fib_data *fd, struct fib_dp *dp)
sys/net/route/fib_algo.c
1596
FD_PRINTF(LOG_DEBUG, fd, "[vnet %p] replace with f:%p arg:%p",
sys/net/route/fib_algo.c
1602
if (old_fdh->fdh_idx[fd->fd_fibnum].f == dp->f) {
sys/net/route/fib_algo.c
1607
old_fdh->fdh_idx[fd->fd_fibnum].arg = dp->arg;
sys/net/route/fib_algo.c
1608
FD_PRINTF(LOG_DEBUG, fd, "FDH %p inline update", old_fdh);
sys/net/route/fib_algo.c
1614
FD_PRINTF(LOG_DEBUG, fd, "OLD FDH: %p NEW FDH: %p", old_fdh, new_fdh);
sys/net/route/fib_algo.c
1617
FD_PRINTF(LOG_WARNING, fd, "error attaching datapath");
sys/net/route/fib_algo.c
1624
new_fdh->fdh_idx[fd->fd_fibnum] = *dp;
sys/net/route/fib_algo.c
1631
FD_PRINTF(LOG_DEBUG, fd, "update %p -> %p", old_fdh, new_fdh);
sys/net/route/fib_algo.c
1658
fib_set_datapath_ptr(struct fib_data *fd, struct fib_dp *dp)
sys/net/route/fib_algo.c
1662
pdp = get_family_dp_ptr(fd->fd_family);
sys/net/route/fib_algo.c
1663
return (replace_rtables_family(pdp, fd, dp));
sys/net/route/fib_algo.c
1724
fib_set_algo_ptr(struct fib_data *fd, void *algo_data)
sys/net/route/fib_algo.c
1726
RIB_WLOCK_ASSERT(fd->fd_rh);
sys/net/route/fib_algo.c
1728
fd->fd_algo_data = algo_data;
sys/net/route/fib_algo.c
1744
fib_get_rh(struct fib_data *fd)
sys/net/route/fib_algo.c
1747
return (fd->fd_rh);
sys/net/route/fib_algo.c
1754
fib_get_nhop_array(struct fib_data *fd)
sys/net/route/fib_algo.c
1757
return (fd->nh_idx);
sys/net/route/fib_algo.c
1770
fib_get_nhop_idx(struct fib_data *fd, struct nhop_object *nh)
sys/net/route/fib_algo.c
1777
is_idx_free(struct fib_data *fd, uint32_t index)
sys/net/route/fib_algo.c
1780
return (fd->nh_ref_table->refcnt[index] == 0);
sys/net/route/fib_algo.c
1784
fib_ref_nhop(struct fib_data *fd, struct nhop_object *nh)
sys/net/route/fib_algo.c
1788
if (idx >= fd->number_nhops) {
sys/net/route/fib_algo.c
1789
fd->hit_nhops = 1;
sys/net/route/fib_algo.c
1793
if (is_idx_free(fd, idx)) {
sys/net/route/fib_algo.c
1795
fd->nh_idx[idx] = nh;
sys/net/route/fib_algo.c
1796
fd->nh_ref_table->count++;
sys/net/route/fib_algo.c
1797
FD_PRINTF(LOG_DEBUG2, fd, " REF nhop %u %p", idx, fd->nh_idx[idx]);
sys/net/route/fib_algo.c
1799
fd->nh_ref_table->refcnt[idx]++;
sys/net/route/fib_algo.c
1827
fib_schedule_release_nhop(struct fib_data *fd, struct nhop_object *nh)
sys/net/route/fib_algo.c
1840
FD_PRINTF(LOG_ERR, fd, "unable to schedule nhop %p deletion", nh);
sys/net/route/fib_algo.c
1845
fib_unref_nhop(struct fib_data *fd, struct nhop_object *nh)
sys/net/route/fib_algo.c
1849
KASSERT((idx < fd->number_nhops), ("invalid nhop index"));
sys/net/route/fib_algo.c
1850
KASSERT((nh == fd->nh_idx[idx]), ("index table contains whong nh"));
sys/net/route/fib_algo.c
1852
fd->nh_ref_table->refcnt[idx]--;
sys/net/route/fib_algo.c
1853
if (fd->nh_ref_table->refcnt[idx] == 0) {
sys/net/route/fib_algo.c
1854
FD_PRINTF(LOG_DEBUG, fd, " FREE nhop %d %p", idx, fd->nh_idx[idx]);
sys/net/route/fib_algo.c
1855
fib_schedule_release_nhop(fd, fd->nh_idx[idx]);
sys/net/route/fib_algo.c
194
static bool rebuild_fd(struct fib_data *fd, const char *reason);
sys/net/route/fib_algo.c
1947
struct fib_data *fd = NULL;
sys/net/route/fib_algo.c
195
static bool rebuild_fd_flm(struct fib_data *fd, struct fib_lookup_module *flm_new);
sys/net/route/fib_algo.c
1960
result = setup_fd_instance(flm, rh, NULL, &fd, false);
sys/net/route/fib_algo.c
1964
RH_PRINTF(LOG_DEBUG, rh, "result=%d fd=%p", result, fd);
sys/net/route/fib_algo.c
1966
*dp = fd->fd_dp;
sys/net/route/fib_algo.c
198
static bool is_idx_free(struct fib_data *fd, uint32_t index);
sys/net/route/fib_algo.c
202
static uint32_t fib_ref_nhop(struct fib_data *fd, struct nhop_object *nh);
sys/net/route/fib_algo.c
203
static void fib_unref_nhop(struct fib_data *fd, struct nhop_object *nh);
sys/net/route/fib_algo.c
414
fib_printf(int level, struct fib_data *fd, const char *func, char *fmt, ...)
sys/net/route/fib_algo.c
426
_ALGO_PRINTF(fd->fd_fibnum, fd->fd_family, fd->fd_flm->flm_name,
sys/net/route/fib_algo.c
427
fd->fd_gen, func, "%s", buf);
sys/net/route/fib_algo.c
485
callout_calc_delay_ms(struct fib_data *fd)
sys/net/route/fib_algo.c
489
if (fd->fd_failed_rebuilds > 10)
sys/net/route/fib_algo.c
492
shift = fd->fd_failed_rebuilds;
sys/net/route/fib_algo.c
498
schedule_callout(struct fib_data *fd, enum fib_callout_action action, int delay_ms)
sys/net/route/fib_algo.c
501
FD_PRINTF(LOG_DEBUG, fd, "delay=%d action=%d", delay_ms, action);
sys/net/route/fib_algo.c
502
fd->fd_callout_action = action;
sys/net/route/fib_algo.c
503
callout_reset_sbt(&fd->fd_callout, SBT_1MS * delay_ms, 0,
sys/net/route/fib_algo.c
504
handle_fd_callout, fd, 0);
sys/net/route/fib_algo.c
508
schedule_fd_rebuild(struct fib_data *fd, const char *reason)
sys/net/route/fib_algo.c
511
RIB_WLOCK_ASSERT(fd->fd_rh);
sys/net/route/fib_algo.c
513
if (!fd->fd_need_rebuild) {
sys/net/route/fib_algo.c
514
fd->fd_need_rebuild = true;
sys/net/route/fib_algo.c
516
fd->fd_batch = false;
sys/net/route/fib_algo.c
522
FD_PRINTF(LOG_INFO, fd, "Scheduling rebuild: %s (failures=%d)",
sys/net/route/fib_algo.c
523
reason, fd->fd_failed_rebuilds);
sys/net/route/fib_algo.c
524
schedule_callout(fd, FDA_REBUILD, callout_calc_delay_ms(fd));
sys/net/route/fib_algo.c
529
sync_rib_gen(struct fib_data *fd)
sys/net/route/fib_algo.c
531
FD_PRINTF(LOG_DEBUG, fd, "Sync gen %u -> %u", fd->fd_rh->rnh_gen, fd->fd_rh->rnh_gen_rib);
sys/net/route/fib_algo.c
532
fd->fd_rh->rnh_gen = fd->fd_rh->rnh_gen_rib;
sys/net/route/fib_algo.c
563
mark_diverge_time(struct fib_data *fd)
sys/net/route/fib_algo.c
565
struct fib_sync_status *fd_ss = &fd->fd_ss;
sys/net/route/fib_algo.c
584
update_rebuild_delay(struct fib_data *fd, enum fib_callout_action action)
sys/net/route/fib_algo.c
601
struct fib_sync_status *fd_ss = &fd->fd_ss;
sys/net/route/fib_algo.c
610
FD_PRINTF(LOG_DEBUG, fd,
sys/net/route/fib_algo.c
616
FD_PRINTF(LOG_DEBUG, fd,
sys/net/route/fib_algo.c
632
schedule_callout(fd, action, delay_ms);
sys/net/route/fib_algo.c
637
update_algo_state(struct fib_data *fd)
sys/net/route/fib_algo.c
640
RIB_WLOCK_ASSERT(fd->fd_rh);
sys/net/route/fib_algo.c
642
if (fd->fd_batch || fd->fd_need_rebuild) {
sys/net/route/fib_algo.c
643
enum fib_callout_action action = fd->fd_need_rebuild ? FDA_REBUILD : FDA_BATCH;
sys/net/route/fib_algo.c
644
update_rebuild_delay(fd, action);
sys/net/route/fib_algo.c
648
if (fd->fd_num_changes++ == 0) {
sys/net/route/fib_algo.c
650
if (!callout_pending(&fd->fd_callout))
sys/net/route/fib_algo.c
651
schedule_callout(fd, FDA_EVAL, ALGO_EVAL_DELAY_MS);
sys/net/route/fib_algo.c
652
} else if (fd->fd_num_changes == ALGO_EVAL_NUM_ROUTES) {
sys/net/route/fib_algo.c
654
if (fd->fd_callout_action == FDA_EVAL)
sys/net/route/fib_algo.c
655
schedule_callout(fd, FDA_EVAL, 1);
sys/net/route/fib_algo.c
660
need_immediate_sync(struct fib_data *fd, struct rib_cmd_info *rc)
sys/net/route/fib_algo.c
690
apply_rtable_changes(struct fib_data *fd)
sys/net/route/fib_algo.c
693
struct fib_change_queue *q = &fd->fd_ss.fd_change_queue;
sys/net/route/fib_algo.c
695
result = fd->fd_flm->flm_change_rib_items_cb(fd->fd_rh, q, fd->fd_algo_data);
sys/net/route/fib_algo.c
698
sync_rib_gen(fd);
sys/net/route/fib_algo.c
701
fib_unref_nhop(fd, q->entries[i].nh_old);
sys/net/route/fib_algo.c
704
fd->fd_batch = false;
sys/net/route/fib_algo.c
710
fill_change_entry(struct fib_data *fd, struct fib_change_entry *ce, struct rib_cmd_info *rc)
sys/net/route/fib_algo.c
714
switch (fd->fd_family) {
sys/net/route/fib_algo.c
731
if (fib_ref_nhop(fd, ce->nh_new) == 0)
sys/net/route/fib_algo.c
739
queue_rtable_change(struct fib_data *fd, struct rib_cmd_info *rc)
sys/net/route/fib_algo.c
741
struct fib_change_queue *q = &fd->fd_ss.fd_change_queue;
sys/net/route/fib_algo.c
754
FD_PRINTF(LOG_INFO, fd, "Unable to realloc queue for %u elements",
sys/net/route/fib_algo.c
762
return (fill_change_entry(fd, &q->entries[q->count++], rc));
sys/net/route/fib_algo.c
774
struct fib_data *fd = (struct fib_data *)_data;
sys/net/route/fib_algo.c
784
if (!fd->init_done)
sys/net/route/fib_algo.c
787
bool immediate_sync = need_immediate_sync(fd, rc);
sys/net/route/fib_algo.c
790
update_algo_state(fd);
sys/net/route/fib_algo.c
796
if (fd->fd_need_rebuild) {
sys/net/route/fib_algo.c
798
rebuild_fd(fd, "rtable change type enforced sync");
sys/net/route/fib_algo.c
806
if (fd->fd_batch) {
sys/net/route/fib_algo.c
808
if (!queue_rtable_change(fd, rc) || !apply_rtable_changes(fd))
sys/net/route/fib_algo.c
809
rebuild_fd(fd, "batch sync failed");
sys/net/route/fib_algo.c
811
if (!queue_rtable_change(fd, rc))
sys/net/route/fib_algo.c
812
schedule_fd_rebuild(fd, "batch queue failed");
sys/net/route/fib_algo.c
823
if (fib_ref_nhop(fd, rc->rc_nh_new) == 0) {
sys/net/route/fib_algo.c
825
schedule_fd_rebuild(fd, "ran out of nhop indexes");
sys/net/route/fib_algo.c
830
result = fd->fd_flm->flm_change_rib_item_cb(rnh, rc, fd->fd_algo_data);
sys/net/route/fib_algo.c
834
sync_rib_gen(fd);
sys/net/route/fib_algo.c
837
fib_unref_nhop(fd, rc->rc_nh_old);
sys/net/route/fib_algo.c
844
if (queue_rtable_change(fd, rc)) {
sys/net/route/fib_algo.c
846
fd->fd_batch = true;
sys/net/route/fib_algo.c
847
mark_diverge_time(fd);
sys/net/route/fib_algo.c
848
update_rebuild_delay(fd, FDA_BATCH);
sys/net/route/fib_algo.c
851
if (apply_rtable_changes(fd))
sys/net/route/fib_algo.c
854
FD_PRINTF(LOG_ERR, fd, "batched sync failed, force the rebuild");
sys/net/route/fib_algo.c
863
mark_diverge_time(fd);
sys/net/route/fib_algo.c
864
schedule_fd_rebuild(fd, "algo requested rebuild");
sys/net/route/fib_algo.c
868
FD_PRINTF(LOG_INFO, fd, "running sync rebuild");
sys/net/route/fib_algo.c
869
rebuild_fd(fd, "rtable change type enforced sync");
sys/net/route/fib_algo.c
878
FD_PRINTF(LOG_ERR, fd, "algo reported non-recoverable error");
sys/net/route/fib_algo.c
879
if (!flm_error_add(fd->fd_flm, fd->fd_fibnum))
sys/net/route/fib_algo.c
880
FD_PRINTF(LOG_ERR, fd, "failed to ban algo");
sys/net/route/fib_algo.c
881
schedule_fd_rebuild(fd, "algo reported non-recoverable error");
sys/net/route/fib_algo.c
886
estimate_nhop_scale(const struct fib_data *old_fd, struct fib_data *fd)
sys/net/route/fib_algo.c
891
fd->number_nhops = 16;
sys/net/route/fib_algo.c
896
fd->number_nhops = 2 * old_fd->number_nhops;
sys/net/route/fib_algo.c
898
fd->number_nhops = old_fd->number_nhops;
sys/net/route/fib_algo.c
902
struct fib_data *fd;
sys/net/route/fib_algo.c
918
struct fib_data *fd = w->fd;
sys/net/route/fib_algo.c
920
RIB_WLOCK_ASSERT(w->fd->fd_rh);
sys/net/route/fib_algo.c
927
if (fd->hit_nhops) {
sys/net/route/fib_algo.c
928
FD_PRINTF(LOG_INFO, fd, "ran out of nexthops at %u nhops",
sys/net/route/fib_algo.c
929
fd->nh_ref_table->count);
sys/net/route/fib_algo.c
939
w->result = fd->fd_flm->flm_dump_end_cb(fd->fd_algo_data, &fd->fd_dp);
sys/net/route/fib_algo.c
943
fd->init_done = 1;
sys/net/route/fib_algo.c
957
RIB_WLOCK_ASSERT(w->fd->fd_rh);
sys/net/route/fib_algo.c
967
if (fib_ref_nhop(w->fd, nh) != 0)
sys/net/route/fib_algo.c
968
w->result = w->func(rt, w->fd->fd_algo_data);
sys/net/route/fib_algo.c
980
sync_algo(struct fib_data *fd)
sys/net/route/fib_algo.c
983
.fd = fd,
sys/net/route/fib_algo.c
984
.func = fd->fd_flm->flm_dump_rib_item_cb,
sys/net/route/fib_algo.c
988
rib_walk_ext_locked(fd->fd_rh, sync_algo_cb, sync_algo_end_cb, &w);
sys/net/route/fib_algo.c
990
FD_PRINTF(LOG_INFO, fd,
sys/net/route/fib_algo.c
992
fd->fd_rh->rnh_gen, print_op_result(w.result));
sys/net/route/fib_algo.h
115
void fib_printf(int level, struct fib_data *fd, const char *func, char *fmt, ...);
sys/net/route/fib_algo.h
125
uint32_t fib_get_nhop_idx(struct fib_data *fd, struct nhop_object *nh);
sys/net/route/fib_algo.h
126
struct nhop_object **fib_get_nhop_array(struct fib_data *fd);
sys/net/route/fib_algo.h
128
struct rib_head *fib_get_rh(struct fib_data *fd);
sys/net/route/fib_algo.h
129
bool fib_set_datapath_ptr(struct fib_data *fd, struct fib_dp *dp);
sys/net/route/fib_algo.h
130
void fib_set_algo_ptr(struct fib_data *fd, void *algo_data);
sys/net/route/fib_algo.h
73
typedef enum flm_op_result flm_init_t (uint32_t fibnum, struct fib_data *fd,
sys/netinet/in_fib_algo.c
145
bsearch4_init(uint32_t fibnum, struct fib_data *fd, void *_old_data, void **_data)
sys/netinet/in_fib_algo.c
153
fib_get_rtable_info(fib_get_rh(fd), &rinfo);
sys/netinet/in_fib_algo.c
166
bd->fd = fd;
sys/netinet/in_fib_algo.c
518
struct fib_data *fd;
sys/netinet/in_fib_algo.c
558
lradix4_init(uint32_t fibnum, struct fib_data *fd, void *_old_data, void **_data)
sys/netinet/in_fib_algo.c
568
fib_get_rtable_info(fib_get_rh(fd), &rinfo);
sys/netinet/in_fib_algo.c
578
lr->fd = fd;
sys/netinet/in_fib_algo.c
672
struct fib_data *fd;
sys/netinet/in_fib_algo.c
709
radix4_init(uint32_t fibnum, struct fib_data *fd, void *_old_data, void **_data)
sys/netinet/in_fib_algo.c
716
r4->fd = fd;
sys/netinet/in_fib_algo.c
717
r4->rh = fib_get_rh(fd);
sys/netinet/in_fib_algo.c
80
struct fib_data *fd;
sys/netinet/in_fib_dxr.c
1031
FIB_PRINTF(LOG_NOTICE, da->fd,
sys/netinet/in_fib_dxr.c
1051
FIB_PRINTF(LOG_INFO, da->fd, "D%dX%dR, %d prefixes, %d nhops (max)",
sys/netinet/in_fib_dxr.c
1056
FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix",
sys/netinet/in_fib_dxr.c
1059
FIB_PRINTF(LOG_INFO, da->fd,
sys/netinet/in_fib_dxr.c
1064
FIB_PRINTF(LOG_INFO, da->fd, "range table %s in %u.%03u ms",
sys/netinet/in_fib_dxr.c
1067
FIB_PRINTF(LOG_INFO, da->fd, "trie %s in %u.%03u ms",
sys/netinet/in_fib_dxr.c
1070
FIB_PRINTF(LOG_INFO, da->fd, "snapshot forked in %u.%03u ms",
sys/netinet/in_fib_dxr.c
1088
dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data)
sys/netinet/in_fib_dxr.c
1096
FIB_PRINTF(LOG_NOTICE, fd,
sys/netinet/in_fib_dxr.c
1103
old_dxr->aux->fd == fd) {
sys/netinet/in_fib_dxr.c
1110
dxr->fd = fd;
sys/netinet/in_fib_dxr.c
1237
MPASS(da->fd == dxr->fd);
sys/netinet/in_fib_dxr.c
1240
FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count);
sys/netinet/in_fib_dxr.c
1270
fib_get_rtable_info(fib_get_rh(da->fd), &rinfo);
sys/netinet/in_fib_dxr.c
1274
res = dxr_init(0, dxr->fd, data, (void **) &new_dxr);
sys/netinet/in_fib_dxr.c
1293
if (fib_set_datapath_ptr(dxr->fd, &new_dp)) {
sys/netinet/in_fib_dxr.c
1294
fib_set_algo_ptr(dxr->fd, new_dxr);
sys/netinet/in_fib_dxr.c
1299
FIB_PRINTF(LOG_NOTICE, dxr->fd, "fib_set_datapath_ptr() failed");
sys/netinet/in_fib_dxr.c
162
struct fib_data *fd;
sys/netinet/in_fib_dxr.c
214
struct fib_data *fd;
sys/netinet/in_fib_dxr.c
361
fhp->nexthop = fib_get_nhop_idx(da->fd, rnd.rnd_nhop);
sys/netinet/in_fib_dxr.c
475
FIB_PRINTF(LOG_ERR, da->fd,
sys/netinet/in_fib_dxr.c
482
FIB_PRINTF(i, da->fd, "range table at %d%% structural limit",
sys/netinet/in_fib_dxr.c
488
FIB_PRINTF(LOG_NOTICE, da->fd,
sys/netinet/in_fib_dxr.c
622
FIB_PRINTF(LOG_NOTICE, da->fd,
sys/netinet/in_fib_dxr.c
708
nh = fib_get_nhop_idx(da->fd, rt_get_raw_nhop(rt));
sys/netinet/in_fib_dxr.c
863
FIB_PRINTF(LOG_NOTICE, dxr->fd,
sys/netinet/in_fib_dxr.c
869
da->fd = dxr->fd;
sys/netinet/in_fib_dxr.c
888
FIB_PRINTF(LOG_NOTICE, da->fd,
sys/netinet/in_fib_dxr.c
898
FIB_PRINTF(LOG_NOTICE, da->fd,
sys/netinet/in_fib_dxr.c
907
dxr->nh_tbl = fib_get_nhop_array(da->fd);
sys/netinet/in_fib_dxr.c
908
fib_get_rtable_info(fib_get_rh(da->fd), &rinfo);
sys/netinet/libalias/alias.c
1696
FILE *fd;
sys/netinet/libalias/alias.c
1699
fd = fopen(conf, "r");
sys/netinet/libalias/alias.c
1700
if (fd == NULL)
sys/netinet/libalias/alias.c
1706
fgets(buf, 256, fd);
sys/netinet/libalias/alias.c
1707
if (feof(fd))
sys/netinet/libalias/alias.c
1720
fclose(fd);
sys/netinet/sctp_syscalls.c
153
int error, fd;
sys/netinet/sctp_syscalls.c
175
error = falloc_caps(td, &nfp, &fd, 0, &fcaps);
sys/netinet/sctp_syscalls.c
178
td->td_retval[0] = fd;
sys/netinet/sctp_syscalls.c
213
fdclose(td, nfp, fd);
sys/netinet/sctputil.c
757
sctp_audit_log(uint8_t ev, uint8_t fd)
sys/netinet/sctputil.c
761
sctp_audit_data[sctp_audit_indx][1] = fd;
sys/netinet6/in6_fib_algo.c
126
lradix6_init(uint32_t fibnum, struct fib_data *fd, void *_old_data, void **_data)
sys/netinet6/in6_fib_algo.c
136
fib_get_rtable_info(fib_get_rh(fd), &rinfo);
sys/netinet6/in6_fib_algo.c
146
lr->fd = fd;
sys/netinet6/in6_fib_algo.c
242
struct fib_data *fd;
sys/netinet6/in6_fib_algo.c
293
radix6_init(uint32_t fibnum, struct fib_data *fd, void *_old_data, void **_data)
sys/netinet6/in6_fib_algo.c
300
r6->fd = fd;
sys/netinet6/in6_fib_algo.c
301
r6->rh = fib_get_rh(fd);
sys/netinet6/in6_fib_algo.c
89
struct fib_data *fd;
sys/netlink/netlink_snl.h
129
int fd;
sys/netlink/netlink_snl.h
256
close(ss->fd);
sys/netlink/netlink_snl.h
270
ss->fd = socket(AF_NETLINK, SOCK_RAW, netlink_family);
sys/netlink/netlink_snl.h
271
if (ss->fd == -1)
sys/netlink/netlink_snl.h
277
if (setsockopt(ss->fd, SOL_NETLINK, NETLINK_EXT_ACK, &val, optlen) == -1) {
sys/netlink/netlink_snl.h
283
if (getsockopt(ss->fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, &optlen) == -1) {
sys/netlink/netlink_snl.h
308
.fd = orig->fd,
sys/netlink/netlink_snl.h
317
return (send(ss->fd, data, sz, 0) == sz);
sys/netlink/netlink_snl.h
325
return (send(ss->fd, hdr, sz, 0) == sz);
sys/netlink/netlink_snl.h
368
ssize_t datalen = recvmsg(ss->fd, &msg, 0);
sys/netlink/netlink_snl.h
401
ssize_t datalen = recvmsg(ss->fd, &msg, 0);
sys/netsmb/smb_dev.c
375
smb_dev2share(int fd, int mode, struct smb_cred *scred,
sys/netsmb/smb_dev.c
385
error = fget(td, fd, &cap_read_rights, &fp);
sys/netsmb/smb_dev.h
193
int smb_dev2share(int fd, int mode, struct smb_cred *scred,
sys/ofed/drivers/infiniband/core/ib_rdma_core.c
595
int fd = uobj->id;
sys/ofed/drivers/infiniband/core/ib_rdma_core.c
609
fd_install(fd, filp);
sys/ofed/drivers/infiniband/core/ib_ucma.c
1553
struct fd f;
sys/ofed/drivers/infiniband/core/ib_ucma.c
1561
f = fdget(cmd.fd);
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
196
_ib_uverbs_lookup_comp_file(s32 fd, struct uverbs_attr_bundle *attrs)
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
199
fd, attrs);
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
593
if (cmd.fd != -1) {
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
595
ret = -fgetvp(curthread, cmd.fd, &cap_no_rights, &vnode);
sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
985
resp.fd = uobj->id;
sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
320
static int ib_uverbs_async_event_fasync(int fd, struct file *filp, int on)
sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
324
return fasync_helper(fd, filp, on, &file->ev_queue.async_queue);
sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
327
static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on)
sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
332
return fasync_helper(fd, filp, on, &comp_ev_file->ev_queue.async_queue);
sys/ofed/include/uapi/rdma/ib_user_verbs.h
330
__u32 fd;
sys/ofed/include/uapi/rdma/ib_user_verbs.h
406
__u32 fd;
sys/ofed/include/uapi/rdma/rdma_user_cm.h
315
__u32 fd;
sys/rpc/rpcsec_tls/rpctls_impl.c
156
int fd = -1, error;
sys/rpc/rpcsec_tls/rpctls_impl.c
183
if ((error = falloc(td, &fp, &fd, 0)) != 0) {
sys/rpc/rpcsec_tls/rpctls_impl.c
212
td->td_retval[0] = fd;
sys/rpc/svc_generic.c
185
if (_getpeername(fd, (struct sockaddr *)(void *)&ss, &slen)
sys/rpc/svc_generic.c
188
xprt = svc_fd_create(fd, sendsz, recvsz);
sys/security/audit/audit.h
141
void audit_sysclose(struct thread *td, int fd, struct file *fp);
sys/security/audit/audit.h
212
#define AUDIT_ARG_FD(fd) do { \
sys/security/audit/audit.h
214
audit_arg_fd((fd)); \
sys/security/audit/audit.h
416
#define AUDIT_SYSCLOSE(td, fd) do { \
sys/security/audit/audit.h
418
audit_sysclose(td, fd); \
sys/security/audit/audit.h
434
#define AUDIT_ARG_FD(fd)
sys/security/audit/audit.h
477
#define AUDIT_SYSCLOSE(p, fd)
sys/security/audit/audit.h
91
void audit_arg_fd(int fd);
sys/security/audit/audit_arg.c
1007
audit_arg_fd(fd);
sys/security/audit/audit_arg.c
136
audit_arg_fd(int fd)
sys/security/audit/audit_arg.c
144
ar->k_ar.ar_arg_fd = fd;
sys/security/audit/audit_arg.c
996
audit_sysclose(struct thread *td, int fd, struct file *fp)
sys/security/mac/mac_syscalls.c
516
error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_GET),
sys/security/mac/mac_syscalls.c
673
error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_SET),
sys/security/mac_grantbylabel/mac_grantbylabel.c
383
error = getvnode(td, gbl_args.u.fd,
sys/security/mac_grantbylabel/mac_grantbylabel.h
57
int fd;
sys/sys/acl.h
392
acl_t acl_get_fd_np(int fd, acl_type_t _type);
sys/sys/capsicum.h
522
const cap_rights_t *cap_rights(struct filedesc *fdp, int fd);
sys/sys/capsicum.h
524
int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd);
sys/sys/capsicum.h
526
int cap_fcntl_check(struct filedesc *fdp, int fd, int cmd);
sys/sys/capsicum.h
555
int cap_rights_limit(int fd, const cap_rights_t *rights);
sys/sys/capsicum.h
559
#define cap_rights_get(fd, rights) \
sys/sys/capsicum.h
560
__cap_rights_get(CAP_RIGHTS_VERSION, (fd), (rights))
sys/sys/capsicum.h
561
int __cap_rights_get(int version, int fd, cap_rights_t *rights);
sys/sys/capsicum.h
565
int cap_ioctls_limit(int fd, const cap_ioctl_t *cmds, size_t ncmds);
sys/sys/capsicum.h
571
ssize_t cap_ioctls_get(int fd, cap_ioctl_t *cmds, size_t maxcmds);
sys/sys/capsicum.h
575
int cap_fcntls_limit(int fd, uint32_t fcntlrights);
sys/sys/capsicum.h
579
int cap_fcntls_get(int fd, uint32_t *fcntlrightsp);
sys/sys/event.h
371
void knote_fdclose(struct thread *p, int fd);
sys/sys/event.h
372
int kqfd_register(int fd, struct kevent *kev, struct thread *p,
sys/sys/eventfd.h
53
int eventfd_read(int fd, eventfd_t *value);
sys/sys/eventfd.h
54
int eventfd_write(int fd, eventfd_t value);
sys/sys/file.h
120
typedef void fo_fdclose_t(struct file *fp, int fd, struct thread *td);
sys/sys/file.h
275
int fget(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
277
int fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
279
int fget_read(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
281
int fget_write(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
283
int fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
286
int fget_remote(struct thread *td, struct proc *p, int fd,
sys/sys/file.h
309
int fgetvp(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
311
int fgetvp_exec(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
313
int fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/sys/file.h
315
int fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/file.h
317
int fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/filedesc.h
258
void _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags,
sys/sys/filedesc.h
283
int getvnode(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/filedesc.h
285
int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/filedesc.h
289
int fget_cap_noref(struct filedesc *fdp, int fd,
sys/sys/filedesc.h
292
int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp,
sys/sys/filedesc.h
295
int fget_unlocked(struct thread *td, int fd,
sys/sys/filedesc.h
297
int fget_unlocked_flags(struct thread *td, int fd,
sys/sys/filedesc.h
301
int fget_only_user(struct filedesc *fdp, int fd,
sys/sys/filedesc.h
314
fget_noref_unlocked(struct filedesc *fdp, int fd)
sys/sys/filedesc.h
317
(u_int)fd >= (u_int)atomic_load_int(&fdp->fd_nfiles)))
sys/sys/filedesc.h
320
return (atomic_load_ptr(&fdp->fd_ofiles[fd].fde_file));
sys/sys/filedesc.h
325
fget_noref(struct filedesc *fdp, int fd)
sys/sys/filedesc.h
330
if (__predict_false((u_int)fd >= (u_int)fdp->fd_nfiles))
sys/sys/filedesc.h
333
return (fdp->fd_ofiles[fd].fde_file);
sys/sys/filedesc.h
337
fdeget_noref(struct filedesc *fdp, int fd)
sys/sys/filedesc.h
343
if (__predict_false((u_int)fd >= (u_int)fdp->fd_nfiles))
sys/sys/filedesc.h
346
fde = &fdp->fd_ofiles[fd];
sys/sys/filedesc.h
355
fd_modified(struct filedesc *fdp, int fd, seqc_t seqc)
sys/sys/filedesc.h
358
return (!seqc_consistent(fd_seqc(fdp->fd_files, fd), seqc));
sys/sys/filedesc.h
82
#define fd_seqc(fdt, fd) (&(fdt)->fdt_ofiles[(fd)].fde_seqc)
sys/sys/imgact.h
55
int fd; /* file descriptor of the executable */
sys/sys/inotify.h
151
int inotify_add_watch(int fd, const char *pathname, __uint32_t mask);
sys/sys/inotify.h
152
int inotify_add_watch_at(int fd, int dfd, const char *pathname,
sys/sys/inotify.h
154
int inotify_rm_watch(int fd, int wd);
sys/sys/jaildesc.h
77
int jaildesc_find(struct thread *td, int fd, struct prison **prp,
sys/sys/memrange.h
63
int fd;
sys/sys/nv.h
89
void nvlist_dump(const nvlist_t *nvl, int fd);
sys/sys/poll.h
46
int fd; /* which file descriptor to poll */
sys/sys/procdesc.h
108
int kern_pdgetpid(struct thread *, int fd, const cap_rights_t *,
sys/sys/socketvar.h
491
int getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/socketvar.h
493
int getsock(struct thread *td, int fd, const cap_rights_t *rightsp,
sys/sys/socketvar.h
504
int sobindat(int fd, struct socket *so, struct sockaddr *nam,
sys/sys/socketvar.h
508
int soconnectat(int fd, struct socket *so, struct sockaddr *nam,
sys/sys/stat.h
378
int futimens(int fd, const struct timespec times[2]);
sys/sys/stat.h
379
int utimensat(int fd, const char *path, const struct timespec times[2],
sys/sys/syscallsubr.h
100
int kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds,
sys/sys/syscallsubr.h
102
int kern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights);
sys/sys/syscallsubr.h
117
int kern_close(struct thread *td, int fd);
sys/sys/syscallsubr.h
118
int kern_connectat(struct thread *td, int dirfd, int fd,
sys/sys/syscallsubr.h
140
int kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace,
sys/sys/syscallsubr.h
147
int kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace,
sys/sys/syscallsubr.h
155
int kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace,
sys/sys/syscallsubr.h
162
int kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace,
sys/sys/syscallsubr.h
171
int kern_fchmodat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
173
int kern_fchownat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
175
int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg);
sys/sys/syscallsubr.h
176
int kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg);
sys/sys/syscallsubr.h
180
int kern_filewrite(struct thread *td, int fd, struct file *fp,
sys/sys/syscallsubr.h
182
int kern_fpathconf(struct thread *td, int fd, int name, long *valuep);
sys/sys/syscallsubr.h
185
int kern_frmdirat(struct thread *td, int dfd, const char *path, int fd,
sys/sys/syscallsubr.h
187
int kern_fstat(struct thread *td, int fd, struct stat *sbp);
sys/sys/syscallsubr.h
188
int kern_fstatfs(struct thread *td, int fd, struct statfs *buf);
sys/sys/syscallsubr.h
189
int kern_fsync(struct thread *td, int fd, bool fullsync);
sys/sys/syscallsubr.h
190
int kern_ftruncate(struct thread *td, int fd, off_t length);
sys/sys/syscallsubr.h
191
int kern_funlinkat(struct thread *td, int dfd, const char *path, int fd,
sys/sys/syscallsubr.h
193
int kern_futimes(struct thread *td, int fd, const struct timeval *tptr,
sys/sys/syscallsubr.h
195
int kern_futimens(struct thread *td, int fd, const struct timespec *tptr,
sys/sys/syscallsubr.h
197
int kern_getdirentries(struct thread *td, int fd, char *buf, size_t count,
sys/sys/syscallsubr.h
199
int kern_getfhat(struct thread *td, int flags, int fd, const char *path,
sys/sys/syscallsubr.h
205
int kern_getpeername(struct thread *td, int fd, struct sockaddr *sa);
sys/sys/syscallsubr.h
209
int kern_getsockname(struct thread *td, int fd, struct sockaddr *sa);
sys/sys/syscallsubr.h
212
int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data);
sys/sys/syscallsubr.h
218
int kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
sys/sys/syscallsubr.h
245
int kern_lseek(struct thread *td, int fd, off_t offset, int whence);
sys/sys/syscallsubr.h
254
int kern_mkdirat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
256
int kern_mkfifoat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
258
int kern_mknodat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
281
int oflags, int fd, long pos);
sys/sys/syscallsubr.h
296
int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len,
sys/sys/syscallsubr.h
298
int kern_posix_fallocate(struct thread *td, int fd, off_t offset,
sys/sys/syscallsubr.h
300
int kern_fspacectl(struct thread *td, int fd, int cmd,
sys/sys/syscallsubr.h
302
int kern_pdwait(struct thread *td, int fd, int *status,
sys/sys/syscallsubr.h
306
int kern_pread(struct thread *td, int fd, void *buf, size_t nbyte,
sys/sys/syscallsubr.h
308
int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset);
sys/sys/syscallsubr.h
313
int kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte,
sys/sys/syscallsubr.h
315
int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset);
sys/sys/syscallsubr.h
316
int kern_readlinkat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
318
int kern_readv(struct thread *td, int fd, struct uio *auio);
sys/sys/syscallsubr.h
373
int kern_statat(struct thread *td, int flag, int fd, const char *path,
sys/sys/syscallsubr.h
378
int kern_symlinkat(struct thread *td, const char *path1, int fd,
sys/sys/syscallsubr.h
396
int kern_timerfd_gettime(struct thread *td, int fd,
sys/sys/syscallsubr.h
398
int kern_timerfd_settime(struct thread *td, int fd, int flags,
sys/sys/syscallsubr.h
402
int kern_utimesat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
405
int kern_utimensat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
412
int kern_writev(struct thread *td, int fd, struct uio *auio);
sys/sys/syscallsubr.h
430
int freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf,
sys/sys/syscallsubr.h
94
int kern_accessat(struct thread *td, int fd, const char *path,
sys/sys/syscallsubr.h
98
int kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa);
sys/sys/sysproto.h
1000
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1022
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1165
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1326
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1332
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1342
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1346
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1355
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1395
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1401
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1407
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1414
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1419
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1431
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1436
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1441
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1447
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1460
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1464
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1506
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1520
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1524
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1573
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1578
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1592
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1596
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1601
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1606
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
161
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1610
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1614
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1620
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1626
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1657
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1661
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1667
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1670
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1674
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1684
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1694
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1707
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1713
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1742
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
175
char fd_l_[PADL_(u_int)]; u_int fd; char fd_r_[PADR_(u_int)];
sys/sys/sysproto.h
1764
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1800
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1826
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1852
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1856
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1874
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1887
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1893
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1905
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1908
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1922
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
1941
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
216
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2364
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2386
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2400
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2472
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2501
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2559
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2578
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2611
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2618
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2629
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2634
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2645
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2729
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2737
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2743
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2752
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2764
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2781
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2789
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
2795
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
306
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
318
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
371
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
376
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
385
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
390
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
406
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
43
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
48
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
529
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
560
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
58
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
708
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
714
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
77
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
777
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
946
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
953
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
960
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/sysproto.h
992
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
sys/sys/timerfd.h
54
int timerfd_gettime(int fd, struct itimerspec *curr_value);
sys/sys/timerfd.h
55
int timerfd_settime(int fd, int flags, const struct itimerspec *new_value,
sys/sys/tty.h
226
int pts_alloc_external(int fd, struct thread *td, struct file *fp,
sys/vm/vm_mmap.c
144
int fd;
sys/vm/vm_mmap.c
159
.mr_fd = uap->fd,
sys/vm/vm_mmap.c
187
int align, error, fd, flags, max_prot, prot;
sys/vm/vm_mmap.c
195
fd = mrp->mr_fd;
sys/vm/vm_mmap.c
221
AUDIT_ARG_FD(fd);
sys/vm/vm_mmap.c
241
if (fd != -1)
sys/vm/vm_mmap.c
243
"fd %#jd not -1 for MAP_ANON", fd));
sys/vm/vm_mmap.c
254
if ((fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) !=
sys/vm/vm_mmap.c
278
if ((flags & MAP_GUARD) != 0 && (prot != PROT_NONE || fd != -1 ||
sys/vm/vm_mmap.c
399
error = fget_mmap(td, fd, &rights, &cap_maxprot, &fp);
sys/vm/vm_mmap.c
439
.mr_fd = uap->fd,
sys/vm/vm_mmap.c
452
int fd;
sys/vm/vm_mmap.c
460
uap->flags, uap->fd, uap->pos));
sys/vm/vm_mmap.c
465
int oflags, int fd, long pos)
sys/vm/vm_mmap.c
509
.mr_fd = fd,
tests/sys/aio/aio_kqueue_test.c
116
iocb[i]->aio_fildes = fd;
tests/sys/aio/aio_kqueue_test.c
135
result = aio_cancel(fd, iocb[i]);
tests/sys/aio/aio_kqueue_test.c
68
int failed = 0, fd, kq, pending, result, run;
tests/sys/aio/aio_kqueue_test.c
90
fd = mkstemp(pathname);
tests/sys/aio/aio_kqueue_test.c
95
fd = open(file, O_RDWR|O_CREAT, 0666);
tests/sys/aio/aio_kqueue_test.c
97
if (fd == -1)
tests/sys/aio/aio_test.c
1010
fd = open(devname, O_RDWR);
tests/sys/aio/aio_test.c
1011
} while (fd == -1 && errno == EINTR);
tests/sys/aio/aio_test.c
1012
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1013
return (fd);
tests/sys/aio/aio_test.c
1044
int fd;
tests/sys/aio/aio_test.c
1065
fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1066
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1072
cb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1087
cb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1105
close(fd);
tests/sys/aio/aio_test.c
1466
int fd;
tests/sys/aio/aio_test.c
1471
fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1472
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1477
iocb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1489
iocb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1510
int fd;
tests/sys/aio/aio_test.c
1514
fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1515
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1518
ATF_REQUIRE(fstat(fd, &sb) == 0);
tests/sys/aio/aio_test.c
1520
ATF_REQUIRE(ftruncate(fd, sb.st_blksize * nitems(buffers)) == 0);
tests/sys/aio/aio_test.c
1533
buffers[i].iocb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1542
synccb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1571
close(fd);
tests/sys/aio/aio_test.c
1598
int fd;
tests/sys/aio/aio_test.c
1602
fd = open("testfile", O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1603
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1608
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1621
close(fd);
tests/sys/aio/aio_test.c
1635
int fd;
tests/sys/aio/aio_test.c
1639
fd = open("testfile", O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1640
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1646
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1654
close(fd);
tests/sys/aio/aio_test.c
1672
int fd;
tests/sys/aio/aio_test.c
1676
fd = aio_md_setup();
tests/sys/aio/aio_test.c
1690
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1698
close(fd);
tests/sys/aio/aio_test.c
1709
int fd;
tests/sys/aio/aio_test.c
1713
fd = open("testfile", O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1714
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1717
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1724
close(fd);
tests/sys/aio/aio_test.c
1731
int fd;
tests/sys/aio/aio_test.c
1735
fd = open("testfile", O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1736
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1739
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1747
close(fd);
tests/sys/aio/aio_test.c
1757
int fd, kq, nevents;
tests/sys/aio/aio_test.c
1765
fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
1766
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
1769
iocb.aio_fildes = fd;
tests/sys/aio/aio_test.c
1796
close(fd);
tests/sys/aio/aio_test.c
1820
int fd, i;
tests/sys/aio/aio_test.c
1834
fd = aio_md_setup();
tests/sys/aio/aio_test.c
1837
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1859
aio.aio_fildes = fd;
tests/sys/aio/aio_test.c
1877
close(fd);
tests/sys/aio/aio_test.c
1934
int fd;
tests/sys/aio/aio_test.c
1942
fd = aio_zvol_setup(atf_tc_get_ident(tc));
tests/sys/aio/aio_test.c
1943
aio_context_init(&ac, fd, fd, FILE_LEN);
tests/sys/aio/aio_test.c
1987
close(fd);
tests/sys/aio/aio_test.c
1999
int fd;
tests/sys/aio/aio_test.c
2001
fd = aio_zvol_setup(unique);
tests/sys/aio/aio_test.c
2002
aio_context_init(&ac, fd, fd, DEVICE_IO_LEN);
tests/sys/aio/aio_test.c
2011
close(fd);
tests/sys/aio/aio_test.c
453
int fd;
tests/sys/aio/aio_test.c
457
fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
458
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
460
aio_context_init(&ac, fd, fd, FILE_LEN);
tests/sys/aio/aio_test.c
468
close(fd);
tests/sys/aio/aio_test.c
785
int error, fd, mdctl_fd, unit;
tests/sys/aio/aio_test.c
815
fd = open(pathname, O_RDWR);
tests/sys/aio/aio_test.c
816
ATF_REQUIRE_MSG(fd != -1,
tests/sys/aio/aio_test.c
819
return (fd);
tests/sys/aio/aio_test.c
857
int fd;
tests/sys/aio/aio_test.c
859
fd = aio_md_setup();
tests/sys/aio/aio_test.c
860
aio_context_init(&ac, fd, fd, DEVICE_IO_LEN);
tests/sys/aio/aio_test.c
869
close(fd);
tests/sys/aio/aio_test.c
972
int fd;
tests/sys/aio/aio_test.c
987
fd = open(vdev_name, O_RDWR | O_CREAT, 0600);
tests/sys/aio/aio_test.c
988
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
990
ftruncate(fd, POOL_SIZE), "ftruncate failed: %s", strerror(errno));
tests/sys/aio/aio_test.c
991
close(fd);
tests/sys/aio/lio_kqueue_test.c
112
iocb[k]->aio_fildes = fd;
tests/sys/aio/lio_kqueue_test.c
55
int fd;
tests/sys/aio/lio_kqueue_test.c
85
fd = mkstemp(pathname);
tests/sys/aio/lio_kqueue_test.c
90
fd = open(file, O_RDWR|O_CREAT, 0666);
tests/sys/aio/lio_kqueue_test.c
92
if (fd < 0)
tests/sys/aio/lio_kqueue_test.c
96
printf("Hello kq %d fd %d\n", kq, fd);
tests/sys/aio/lio_test.c
103
aiocbs[i][j].aio_fildes = fd;
tests/sys/aio/lio_test.c
220
int fd;
tests/sys/aio/lio_test.c
222
fd = open("testfile", O_CREAT | O_RDWR, 0666);
tests/sys/aio/lio_test.c
223
ATF_REQUIRE_MSG(fd >= 0, "open: %s", strerror(errno));
tests/sys/aio/lio_test.c
226
ATF_CHECK_EQ(6, write(fd, "123456", 6));
tests/sys/aio/lio_test.c
232
write_cb.aio_fildes = fd;
tests/sys/aio/lio_test.c
241
read_cb.aio_fildes = fd;
tests/sys/aio/lio_test.c
254
writev_cb.aio_fildes = fd;
tests/sys/aio/lio_test.c
267
readv_cb.aio_fildes = fd;
tests/sys/aio/lio_test.c
284
ATF_CHECK_EQ(6, pread(fd, buffer, 6, 0));
tests/sys/aio/lio_test.c
287
close(fd);
tests/sys/aio/lio_test.c
299
int fd;
tests/sys/aio/lio_test.c
301
fd = open("testfile", O_CREAT | O_RDWR, 0666);
tests/sys/aio/lio_test.c
302
ATF_REQUIRE_MSG(fd >= 0, "open: %s", strerror(errno));
tests/sys/aio/lio_test.c
305
sync_cb.aio_fildes = fd;
tests/sys/aio/lio_test.c
317
close(fd);
tests/sys/aio/lio_test.c
64
int fd, i, j, kq, max_queue_per_proc, ios_per_call;
tests/sys/aio/lio_test.c
80
fd = open(path, O_RDWR|O_CREAT, 0666);
tests/sys/aio/lio_test.c
81
ATF_REQUIRE(fd >= 0);
tests/sys/audit/utils.c
145
check_auditpipe(struct pollfd fd[], const char *auditregex, FILE *pipestream)
tests/sys/audit/utils.c
164
switch (ppoll(fd, 1, &timeout, NULL)) {
tests/sys/audit/utils.c
167
if (fd[0].revents & POLLIN) {
tests/sys/audit/utils.c
172
"unknown event %#x", fd[0].revents);
tests/sys/audit/utils.c
197
check_audit_startup(struct pollfd fd[], const char *auditrgx, FILE *pipestream){
tests/sys/audit/utils.c
198
check_auditpipe(fd, auditrgx, pipestream);
tests/sys/audit/utils.c
202
check_audit(struct pollfd fd[], const char *auditrgx, FILE *pipestream) {
tests/sys/audit/utils.c
203
check_auditpipe(fd, auditrgx, pipestream);
tests/sys/audit/utils.c
257
setup(struct pollfd fd[], const char *name)
tests/sys/audit/utils.c
264
ATF_REQUIRE((fd[0].fd = open("/dev/auditpipe", O_RDONLY)) != -1);
tests/sys/audit/utils.c
265
ATF_REQUIRE((pipestream = fdopen(fd[0].fd, "r")) != NULL);
tests/sys/audit/utils.c
266
fd[0].events = POLLIN;
tests/sys/audit/utils.c
277
set_preselect_mode(fd[0].fd, &nomask);
tests/sys/audit/utils.c
302
check_audit_startup(fd, "audit startup", pipestream);
tests/sys/audit/utils.c
313
set_preselect_mode(fd[0].fd, &fmask);
tests/sys/auditpipe/auditpipe_test.c
108
int fd, curr_qlim;
tests/sys/auditpipe/auditpipe_test.c
112
ATF_REQUIRE((fd = open("/dev/auditpipe", O_RDONLY)) != -1);
tests/sys/auditpipe/auditpipe_test.c
114
ATF_REQUIRE_EQ(0, ioctl(fd, AUDITPIPE_SET_QLIMIT, &curr_qlim));
tests/sys/auditpipe/auditpipe_test.c
116
close(fd);
tests/sys/cam/ctl/prout_register_huge_cdb.c
51
int fd = open("/dev/cam/ctl", O_RDWR);
tests/sys/cam/ctl/prout_register_huge_cdb.c
80
r = ioctl(fd, CTL_IO, io);
tests/sys/capsicum/capability-fd.cc
1006
int fd = open(TmpFile("cap_fd_transfer"), O_RDWR | O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
1007
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
1008
if (fd < 0) return;
tests/sys/capsicum/capability-fd.cc
1009
int cap_fd = dup(fd);
tests/sys/capsicum/capability-fd.cc
1154
int fd = open(TmpFile("cap_extattr"), O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
1155
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
1158
int rc = fgetxattr_(fd, "user.capsicumtest", buffer, sizeof(buffer));
tests/sys/capsicum/capability-fd.cc
1161
close(fd);
tests/sys/capsicum/capability-fd.cc
1176
int cap = dup(fd);
tests/sys/capsicum/capability-fd.cc
1179
int cap_xlist = dup(fd);
tests/sys/capsicum/capability-fd.cc
1182
int cap_xget = dup(fd);
tests/sys/capsicum/capability-fd.cc
1185
int cap_xset = dup(fd);
tests/sys/capsicum/capability-fd.cc
1188
int cap_xdel = dup(fd);
tests/sys/capsicum/capability-fd.cc
122
void ShowCapRights(FILE *out, int fd) {
tests/sys/capsicum/capability-fd.cc
1223
close(fd);
tests/sys/capsicum/capability-fd.cc
1255
int fd = open(TmpFile("cap_root_owned"), O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
1256
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
1259
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/capability-fd.cc
127
if (cap_rights_get(fd, &rights) < 0) {
tests/sys/capsicum/capability-fd.cc
1270
int rc = fchmod(fd, 0666);
tests/sys/capsicum/capability-fd.cc
128
fprintf(out, "Failed to get rights for fd %d: errno %d\n", fd, errno);
tests/sys/capsicum/capability-fd.cc
1280
EXPECT_OK(fstat(fd, &info));
tests/sys/capsicum/capability-fd.cc
1282
close(fd);
tests/sys/capsicum/capability-fd.cc
165
int fd;
tests/sys/capsicum/capability-fd.cc
171
for (fd = 0; fd < (int)limits.rlim_cur; fd++) {
tests/sys/capsicum/capability-fd.cc
172
if (fcntl(fd, F_GETFD, 0) != 0) {
tests/sys/capsicum/capability-fd.cc
175
fprintf(out, "fd %d: ", fd);
tests/sys/capsicum/capability-fd.cc
176
ShowCapRights(out, fd);
tests/sys/capsicum/capability-fd.cc
293
int fd = open(TmpFile("cap_file_sync"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
294
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
296
EXPECT_OK(write(fd, message, strlen(message)));
tests/sys/capsicum/capability-fd.cc
301
int cap_fd = dup(fd);
tests/sys/capsicum/capability-fd.cc
311
EXPECT_EQ(1, lseek(fd, 1, SEEK_SET));
tests/sys/capsicum/capability-fd.cc
312
EXPECT_EQ(1, lseek(fd, 0, SEEK_CUR));
tests/sys/capsicum/capability-fd.cc
316
EXPECT_EQ(3, lseek(fd, 0, SEEK_CUR));
tests/sys/capsicum/capability-fd.cc
320
EXPECT_EQ(5, lseek(fd, 0, SEEK_CUR));
tests/sys/capsicum/capability-fd.cc
326
close(fd);
tests/sys/capsicum/capability-fd.cc
412
int fd = open(TmpFile("cap_mmap_operations"), O_RDWR | O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
413
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
414
if (fd < 0) return;
tests/sys/capsicum/capability-fd.cc
426
int cap_none = dup(fd);
tests/sys/capsicum/capability-fd.cc
429
int cap_mmap = dup(fd);
tests/sys/capsicum/capability-fd.cc
432
int cap_read = dup(fd);
tests/sys/capsicum/capability-fd.cc
435
int cap_both = dup(fd);
tests/sys/capsicum/capability-fd.cc
454
EXPECT_OK(close(fd));
tests/sys/capsicum/capability-fd.cc
459
#define TRY_FILE_OPS(fd, ...) do { \
tests/sys/capsicum/capability-fd.cc
463
TryFileOps((fd), rights); \
tests/sys/capsicum/capability-fd.cc
466
static void TryFileOps(int fd, cap_rights_t rights) {
tests/sys/capsicum/capability-fd.cc
467
int cap_fd = dup(fd);
tests/sys/capsicum/capability-fd.cc
499
EXPECT_OK(fstatfs(fd, &sf));
tests/sys/capsicum/capability-fd.cc
547
pollfd.fd = cap_fd;
tests/sys/capsicum/capability-fd.cc
579
int fd = open(TmpFile("cap_fd_operations"), O_RDWR | O_CREAT, 0644);
tests/sys/capsicum/capability-fd.cc
580
EXPECT_OK(fd);
tests/sys/capsicum/capability-fd.cc
581
if (fd < 0) return;
tests/sys/capsicum/capability-fd.cc
587
TRY_FILE_OPS(fd, CAP_READ);
tests/sys/capsicum/capability-fd.cc
588
TRY_FILE_OPS(fd, CAP_PREAD);
tests/sys/capsicum/capability-fd.cc
589
TRY_FILE_OPS(fd, CAP_WRITE);
tests/sys/capsicum/capability-fd.cc
590
TRY_FILE_OPS(fd, CAP_PWRITE);
tests/sys/capsicum/capability-fd.cc
591
TRY_FILE_OPS(fd, CAP_READ, CAP_WRITE);
tests/sys/capsicum/capability-fd.cc
592
TRY_FILE_OPS(fd, CAP_PREAD, CAP_PWRITE);
tests/sys/capsicum/capability-fd.cc
593
TRY_FILE_OPS(fd, CAP_SEEK);
tests/sys/capsicum/capability-fd.cc
594
TRY_FILE_OPS(fd, CAP_FCHFLAGS);
tests/sys/capsicum/capability-fd.cc
595
TRY_FILE_OPS(fd, CAP_IOCTL);
tests/sys/capsicum/capability-fd.cc
596
TRY_FILE_OPS(fd, CAP_FSTAT);
tests/sys/capsicum/capability-fd.cc
597
TRY_FILE_OPS(fd, CAP_MMAP);
tests/sys/capsicum/capability-fd.cc
598
TRY_FILE_OPS(fd, CAP_MMAP_R);
tests/sys/capsicum/capability-fd.cc
599
TRY_FILE_OPS(fd, CAP_MMAP_W);
tests/sys/capsicum/capability-fd.cc
600
TRY_FILE_OPS(fd, CAP_MMAP_X);
tests/sys/capsicum/capability-fd.cc
601
TRY_FILE_OPS(fd, CAP_MMAP_RW);
tests/sys/capsicum/capability-fd.cc
602
TRY_FILE_OPS(fd, CAP_MMAP_RX);
tests/sys/capsicum/capability-fd.cc
603
TRY_FILE_OPS(fd, CAP_MMAP_WX);
tests/sys/capsicum/capability-fd.cc
604
TRY_FILE_OPS(fd, CAP_MMAP_RWX);
tests/sys/capsicum/capability-fd.cc
605
TRY_FILE_OPS(fd, CAP_FCNTL);
tests/sys/capsicum/capability-fd.cc
606
TRY_FILE_OPS(fd, CAP_EVENT);
tests/sys/capsicum/capability-fd.cc
607
TRY_FILE_OPS(fd, CAP_FSYNC);
tests/sys/capsicum/capability-fd.cc
608
TRY_FILE_OPS(fd, CAP_FCHOWN);
tests/sys/capsicum/capability-fd.cc
609
TRY_FILE_OPS(fd, CAP_FCHMOD);
tests/sys/capsicum/capability-fd.cc
610
TRY_FILE_OPS(fd, CAP_FTRUNCATE);
tests/sys/capsicum/capability-fd.cc
611
TRY_FILE_OPS(fd, CAP_FLOCK);
tests/sys/capsicum/capability-fd.cc
612
TRY_FILE_OPS(fd, CAP_FSTATFS);
tests/sys/capsicum/capability-fd.cc
613
TRY_FILE_OPS(fd, CAP_FPATHCONF);
tests/sys/capsicum/capability-fd.cc
614
TRY_FILE_OPS(fd, CAP_FUTIMES);
tests/sys/capsicum/capability-fd.cc
615
TRY_FILE_OPS(fd, CAP_ACL_GET);
tests/sys/capsicum/capability-fd.cc
616
TRY_FILE_OPS(fd, CAP_ACL_SET);
tests/sys/capsicum/capability-fd.cc
617
TRY_FILE_OPS(fd, CAP_ACL_DELETE);
tests/sys/capsicum/capability-fd.cc
618
TRY_FILE_OPS(fd, CAP_ACL_CHECK);
tests/sys/capsicum/capability-fd.cc
619
TRY_FILE_OPS(fd, CAP_EXTATTR_GET);
tests/sys/capsicum/capability-fd.cc
620
TRY_FILE_OPS(fd, CAP_EXTATTR_SET);
tests/sys/capsicum/capability-fd.cc
621
TRY_FILE_OPS(fd, CAP_EXTATTR_DELETE);
tests/sys/capsicum/capability-fd.cc
622
TRY_FILE_OPS(fd, CAP_EXTATTR_LIST);
tests/sys/capsicum/capability-fd.cc
623
TRY_FILE_OPS(fd, CAP_MAC_GET);
tests/sys/capsicum/capability-fd.cc
624
TRY_FILE_OPS(fd, CAP_MAC_SET);
tests/sys/capsicum/capability-fd.cc
627
TRY_FILE_OPS(fd, CAP_GETPEERNAME);
tests/sys/capsicum/capability-fd.cc
628
TRY_FILE_OPS(fd, CAP_GETSOCKNAME);
tests/sys/capsicum/capability-fd.cc
629
TRY_FILE_OPS(fd, CAP_ACCEPT);
tests/sys/capsicum/capability-fd.cc
631
close(fd);
tests/sys/capsicum/capmode.cc
577
int fd = (int)(intptr_t)p;
tests/sys/capsicum/capmode.cc
579
AWAIT_INT_MESSAGE(fd, MSG_PARENT_CHILD_SHOULD_RUN);
tests/sys/capsicum/capmode.cc
612
int fd = open("/dev/null", O_RDWR);
tests/sys/capsicum/capmode.cc
613
EXPECT_OK(fd);
tests/sys/capsicum/capmode.cc
614
close(fd);
tests/sys/capsicum/capsicum-test.h
167
#define EXPECT_OPENAT_FAIL_TRAVERSAL(fd, path, flags) \
tests/sys/capsicum/capsicum-test.h
169
SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \
tests/sys/capsicum/capsicum-test.h
170
const int result = openat((fd), (path), (flags)); \
tests/sys/capsicum/capsicum-test.h
179
#define EXPECT_OPENAT_FAIL_TRAVERSAL(fd, path, flags) \
tests/sys/capsicum/capsicum-test.h
181
SCOPED_TRACE(GTEST_STRINGIFY_(openat((fd), (path), (flags)))); \
tests/sys/capsicum/capsicum-test.h
182
const int result = openat((fd), (path), (flags)); \
tests/sys/capsicum/capsicum-test.h
262
#define SEND_INT_MESSAGE(fd, message) \
tests/sys/capsicum/capsicum-test.h
265
EXPECT_EQ(sizeof(_msg), (size_t)write(fd, &_msg, sizeof(_msg))); \
tests/sys/capsicum/capsicum-test.h
268
#define AWAIT_INT_MESSAGE(fd, expected) \
tests/sys/capsicum/capsicum-test.h
271
EXPECT_EQ(sizeof(_msg), (size_t)read(fd, &_msg, sizeof(_msg))); \
tests/sys/capsicum/copy_file_range.cc
43
int fd = open(filename, O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/copy_file_range.cc
45
EXPECT_OK(fd);
tests/sys/capsicum/copy_file_range.cc
47
EXPECT_OK(write(fd, contents, strlen(contents)));
tests/sys/capsicum/copy_file_range.cc
49
close(fd);
tests/sys/capsicum/copy_file_range.cc
56
int fd = openat(wd_, INFILE, O_RDONLY);
tests/sys/capsicum/copy_file_range.cc
57
EXPECT_OK(fd);
tests/sys/capsicum/copy_file_range.cc
58
EXPECT_OK(cap_rights_limit(fd, rights));
tests/sys/capsicum/copy_file_range.cc
59
return fd;
tests/sys/capsicum/copy_file_range.cc
62
int fd = openat(wd_, OUTFILE, O_WRONLY);
tests/sys/capsicum/copy_file_range.cc
63
EXPECT_OK(fd);
tests/sys/capsicum/copy_file_range.cc
64
EXPECT_OK(cap_rights_limit(fd, rights));
tests/sys/capsicum/copy_file_range.cc
65
return fd;
tests/sys/capsicum/fcntl.cc
149
int fd = open(TmpFile("cap_fcntl_cmds"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/fcntl.cc
150
EXPECT_OK(fd);
tests/sys/capsicum/fcntl.cc
151
write(fd, "TEST", 4);
tests/sys/capsicum/fcntl.cc
157
caps[ii] = dup(fd);
tests/sys/capsicum/fcntl.cc
203
close(fd);
tests/sys/capsicum/fcntl.cc
208
int fd = open(TmpFile("cap_fcntl_readlock"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/fcntl.cc
209
EXPECT_OK(fd);
tests/sys/capsicum/fcntl.cc
210
write(fd, "TEST", 4);
tests/sys/capsicum/fcntl.cc
212
int cap = dup(fd);
tests/sys/capsicum/fcntl.cc
233
EXPECT_OK(fcntl(fd, F_GETLK, (long)&fl));
tests/sys/capsicum/fcntl.cc
250
close(fd);
tests/sys/capsicum/fcntl.cc
255
int fd = open(TmpFile("cap_fcntl_subrightnorm"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/fcntl.cc
256
EXPECT_OK(fd);
tests/sys/capsicum/fcntl.cc
259
EXPECT_OK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL));
tests/sys/capsicum/fcntl.cc
260
int fd_flag = fcntl(fd, F_GETFL, 0);
tests/sys/capsicum/fcntl.cc
262
EXPECT_NOTCAPABLE(fcntl(fd, F_SETFL, fd_flag));
tests/sys/capsicum/fcntl.cc
266
EXPECT_OK(cap_rights_get(fd, &rights));
tests/sys/capsicum/fcntl.cc
271
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
tests/sys/capsicum/fcntl.cc
275
EXPECT_NOTCAPABLE(cap_fcntls_limit(fd, CAP_FCNTL_GETFL|CAP_FCNTL_SETFL));
tests/sys/capsicum/fcntl.cc
277
close(fd);
tests/sys/capsicum/fcntl.cc
282
int fd = open(TmpFile("cap_fcntl_subrightpreserve"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/fcntl.cc
283
EXPECT_OK(fd);
tests/sys/capsicum/fcntl.cc
287
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/fcntl.cc
288
EXPECT_OK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL));
tests/sys/capsicum/fcntl.cc
292
EXPECT_OK(cap_rights_get(fd, &cur_rights));
tests/sys/capsicum/fcntl.cc
294
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
tests/sys/capsicum/fcntl.cc
299
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/fcntl.cc
300
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
tests/sys/capsicum/fcntl.cc
305
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/fcntl.cc
306
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
tests/sys/capsicum/fcntl.cc
308
EXPECT_EQ(-1, cap_fcntls_limit(fd, CAP_FCNTL_GETFL));
tests/sys/capsicum/fcntl.cc
310
close(fd);
tests/sys/capsicum/fcntl.cc
315
int fd = open(TmpFile("cap_fcntl_subrights"), O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/fcntl.cc
316
EXPECT_OK(fd);
tests/sys/capsicum/fcntl.cc
317
write(fd, "TEST", 4);
tests/sys/capsicum/fcntl.cc
320
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/fcntl.cc
323
int fd_flag = fcntl(fd, F_GETFL, 0);
tests/sys/capsicum/fcntl.cc
325
EXPECT_OK(fcntl(fd, F_SETFL, fd_flag));
tests/sys/capsicum/fcntl.cc
328
EXPECT_OK(cap_fcntls_limit(fd, CAP_FCNTL_ALL));
tests/sys/capsicum/fcntl.cc
329
fd_flag = fcntl(fd, F_GETFL, 0);
tests/sys/capsicum/fcntl.cc
331
EXPECT_OK(fcntl(fd, F_SETFL, fd_flag));
tests/sys/capsicum/fcntl.cc
334
int fd_get = dup(fd);
tests/sys/capsicum/fcntl.cc
335
int fd_set = dup(fd);
tests/sys/capsicum/fcntl.cc
348
EXPECT_OK(cap_fcntls_limit(fd, 0));
tests/sys/capsicum/fcntl.cc
349
EXPECT_NOTCAPABLE(fcntl(fd, F_GETFL, 0));
tests/sys/capsicum/fcntl.cc
350
EXPECT_NOTCAPABLE(fcntl(fd, F_SETFL, fd_flag));
tests/sys/capsicum/fcntl.cc
352
close(fd);
tests/sys/capsicum/fexecve.cc
117
int fd = open(exec_prog_noexec_.c_str(), O_RDONLY);
tests/sys/capsicum/fexecve.cc
118
EXPECT_OK(fd);
tests/sys/capsicum/fexecve.cc
119
if (fd >= 0) {
tests/sys/capsicum/fexecve.cc
121
EXPECT_OK(fstat(fd, &data));
tests/sys/capsicum/fexecve.cc
123
EXPECT_EQ(-1, fexecve_(fd, argv_fail_, null_envp));
tests/sys/capsicum/fexecve.cc
125
close(fd);
tests/sys/capsicum/fexecve.cc
133
int fd = open(exec_prog_setuid_.c_str(), O_RDONLY);
tests/sys/capsicum/fexecve.cc
134
EXPECT_OK(fd);
tests/sys/capsicum/fexecve.cc
136
if (fd >= 0) {
tests/sys/capsicum/fexecve.cc
138
EXPECT_OK(fstat(fd, &data));
tests/sys/capsicum/fexecve.cc
140
EXPECT_OK(fexecve_(fd, argv_checkroot_, null_envp));
tests/sys/capsicum/fexecve.cc
143
close(fd);
tests/sys/capsicum/fexecve.cc
154
int fd;
tests/sys/capsicum/fexecve.cc
157
fd = open(temp_script_filename_, O_RDONLY);
tests/sys/capsicum/fexecve.cc
160
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/fexecve.cc
165
EXPECT_EQ(-1, fexecve_(fd, argv_pass_, null_envp));
tests/sys/capsicum/fexecve.cc
65
int fd = open(temp_script_filename_, O_RDWR|O_CREAT, 0755);
tests/sys/capsicum/fexecve.cc
66
EXPECT_OK(fd);
tests/sys/capsicum/fexecve.cc
68
EXPECT_OK(write(fd, contents, strlen(contents)));
tests/sys/capsicum/fexecve.cc
69
close(fd);
tests/sys/capsicum/ioctl.cc
100
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/ioctl.cc
101
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/ioctl.cc
104
EXPECT_EQ(-1, cap_ioctls_limit(fd, &ioctl_nread, 1));
tests/sys/capsicum/ioctl.cc
106
close(fd);
tests/sys/capsicum/ioctl.cc
110
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/ioctl.cc
111
EXPECT_OK(fd);
tests/sys/capsicum/ioctl.cc
116
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/ioctl.cc
122
EXPECT_OK(cap_rights_limit(fd, &rights_ioctl));
tests/sys/capsicum/ioctl.cc
124
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/ioctl.cc
130
EXPECT_OK(ioctl(fd, FIONREAD, &bytes));
tests/sys/capsicum/ioctl.cc
132
EXPECT_OK(ioctl(fd, FIOCLEX, &one));
tests/sys/capsicum/ioctl.cc
136
EXPECT_OK(cap_ioctls_limit(fd, both_ioctls, 2));
tests/sys/capsicum/ioctl.cc
137
EXPECT_OK(ioctl(fd, FIONREAD, &bytes));
tests/sys/capsicum/ioctl.cc
138
EXPECT_OK(ioctl(fd, FIOCLEX, &one));
tests/sys/capsicum/ioctl.cc
145
nioctls = cap_ioctls_get(fd, &one_ioctl, 1);
tests/sys/capsicum/ioctl.cc
152
int fd_nread = dup(fd);
tests/sys/capsicum/ioctl.cc
153
int fd_clex = dup(fd);
tests/sys/capsicum/ioctl.cc
181
EXPECT_OK(cap_ioctls_limit(fd, NULL, 0));
tests/sys/capsicum/ioctl.cc
182
EXPECT_NOTCAPABLE(ioctl(fd, FIONREAD, &bytes));
tests/sys/capsicum/ioctl.cc
183
EXPECT_NOTCAPABLE(ioctl(fd, FIOCLEX, &one));
tests/sys/capsicum/ioctl.cc
185
close(fd);
tests/sys/capsicum/ioctl.cc
189
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/ioctl.cc
19
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/ioctl.cc
190
EXPECT_OK(fd);
tests/sys/capsicum/ioctl.cc
199
EXPECT_OK(cap_rights_limit(fd, &rights_ioctl));
tests/sys/capsicum/ioctl.cc
20
EXPECT_OK(fd);
tests/sys/capsicum/ioctl.cc
202
EXPECT_EQ(-1, cap_ioctls_limit(fd, ioctls, CAP_IOCTLS_LIMIT_MAX + 1));
tests/sys/capsicum/ioctl.cc
204
EXPECT_OK(cap_ioctls_limit(fd, ioctls, CAP_IOCTLS_LIMIT_MAX));
tests/sys/capsicum/ioctl.cc
206
close(fd);
tests/sys/capsicum/ioctl.cc
21
int fd_no = dup(fd);
tests/sys/capsicum/ioctl.cc
23
EXPECT_OK(cap_rights_limit(fd, &rights_ioctl));
tests/sys/capsicum/ioctl.cc
28
EXPECT_OK(ioctl(fd, FIONREAD, &bytes));
tests/sys/capsicum/ioctl.cc
32
EXPECT_OK(ioctl(fd, FIOCLEX, &one));
tests/sys/capsicum/ioctl.cc
35
close(fd);
tests/sys/capsicum/ioctl.cc
40
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/ioctl.cc
41
EXPECT_OK(fd);
tests/sys/capsicum/ioctl.cc
45
EXPECT_OK(cap_ioctls_limit(fd, &ioctl_nread, 1));
tests/sys/capsicum/ioctl.cc
47
EXPECT_OK(ioctl(fd, FIONREAD, &bytes));
tests/sys/capsicum/ioctl.cc
49
EXPECT_NOTCAPABLE(ioctl(fd, FIOCLEX, &one));
tests/sys/capsicum/ioctl.cc
53
EXPECT_OK(cap_rights_get(fd, &rights));
tests/sys/capsicum/ioctl.cc
59
ssize_t nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/ioctl.cc
66
EXPECT_NOTCAPABLE(cap_ioctls_limit(fd, both_ioctls, 2));
tests/sys/capsicum/ioctl.cc
68
close(fd);
tests/sys/capsicum/ioctl.cc
72
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/ioctl.cc
73
EXPECT_OK(fd);
tests/sys/capsicum/ioctl.cc
76
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/ioctl.cc
78
EXPECT_OK(cap_ioctls_limit(fd, &ioctl_nread, 1));
tests/sys/capsicum/ioctl.cc
83
EXPECT_OK(cap_rights_get(fd, &cur_rights));
tests/sys/capsicum/ioctl.cc
85
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/ioctl.cc
92
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/ioctl.cc
93
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/linux.cc
104
close(fd);
tests/sys/capsicum/linux.cc
1076
int fd = open(TmpFile("cap_bpf_capmode"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
1079
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/linux.cc
1096
EXPECT_SYSCALL_FAIL(ENOMEM, fchmod(fd, 0644));
tests/sys/capsicum/linux.cc
1101
EXPECT_SYSCALL_FAIL(ENOEXEC, fstat(fd, &buf));
tests/sys/capsicum/linux.cc
1103
fsync(fd); // terminate with unhandled SIGSYS
tests/sys/capsicum/linux.cc
1114
int fd = open(TmpFile("cap_aio"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
1115
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1124
int cap_ro = dup(fd);
tests/sys/capsicum/linux.cc
1128
int cap_wo = dup(fd);
tests/sys/capsicum/linux.cc
1132
int cap_all = dup(fd);
tests/sys/capsicum/linux.cc
1145
req.aio_fildes = fd;
tests/sys/capsicum/linux.cc
118
int fd = signalfd(-1, &mask, 0);
tests/sys/capsicum/linux.cc
1182
close(fd);
tests/sys/capsicum/linux.cc
119
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1191
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/linux.cc
1192
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1196
int rc = syscall(__NR_kcmp, parent, parent, KCMP_FILE, fd, fd);
tests/sys/capsicum/linux.cc
1205
EXPECT_OK(syscall(__NR_kcmp, parent, child, KCMP_FILE, fd, fd));
tests/sys/capsicum/linux.cc
1208
EXPECT_OK(cap_rights_limit(fd, &rights));
tests/sys/capsicum/linux.cc
1211
EXPECT_NE(0, syscall(__NR_kcmp, parent, child, KCMP_FILE, fd, fd));
tests/sys/capsicum/linux.cc
1220
close(fd);
tests/sys/capsicum/linux.cc
1226
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/linux.cc
1227
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1228
lseek(fd, 4, SEEK_SET);
tests/sys/capsicum/linux.cc
1229
int cap = dup(fd);
tests/sys/capsicum/linux.cc
1252
close(fd);
tests/sys/capsicum/linux.cc
1320
int fd = open(TmpFile("cap_invalid_rights"), O_RDONLY|O_CREAT, 0644);
tests/sys/capsicum/linux.cc
1321
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1327
EXPECT_EQ(0, syscall(__NR_cap_rights_limit, fd, &rights, 0, 0, NULL, 0));
tests/sys/capsicum/linux.cc
133
int cap_fd_none = dup(fd);
tests/sys/capsicum/linux.cc
1331
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, 0, NULL, 1));
tests/sys/capsicum/linux.cc
1334
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, CAP_FCNTL_GETFL, 0, NULL, 0));
tests/sys/capsicum/linux.cc
1338
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, 1, &ioctl1, 0));
tests/sys/capsicum/linux.cc
1341
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, 1, NULL, 0));
tests/sys/capsicum/linux.cc
1344
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, -2, NULL, 0));
tests/sys/capsicum/linux.cc
1347
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, NULL, 0, 0, NULL, 0));
tests/sys/capsicum/linux.cc
1351
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, 0, NULL, 0));
tests/sys/capsicum/linux.cc
1355
EXPECT_EQ(-1, syscall(__NR_cap_rights_limit, fd, &rights, 0, 0, NULL, 0));
tests/sys/capsicum/linux.cc
1358
close(fd);
tests/sys/capsicum/linux.cc
136
int cap_fd_read = dup(fd);
tests/sys/capsicum/linux.cc
1366
int fd = openat(dir, "cap_openbyhandle_testfile", O_RDWR|O_CREAT, 0644);
tests/sys/capsicum/linux.cc
1367
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1369
EXPECT_OK(write(fd, message, strlen(message)));
tests/sys/capsicum/linux.cc
1370
close(fd);
tests/sys/capsicum/linux.cc
1377
fd = open_by_handle_at(dir, fhandle, O_RDONLY);
tests/sys/capsicum/linux.cc
1378
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
1380
ssize_t len = read(fd, buffer, 199);
tests/sys/capsicum/linux.cc
1383
close(fd);
tests/sys/capsicum/linux.cc
139
int cap_fd_sig = dup(fd);
tests/sys/capsicum/linux.cc
142
int cap_fd_sig_read = dup(fd);
tests/sys/capsicum/linux.cc
145
int cap_fd_all = dup(fd);
tests/sys/capsicum/linux.cc
175
poll_fd.fd = cap_fd_sig_read;
tests/sys/capsicum/linux.cc
180
poll_fd.fd = cap_fd_all;
tests/sys/capsicum/linux.cc
187
int fd = eventfd(0, 0);
tests/sys/capsicum/linux.cc
188
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
199
int cap_ro = dup(fd);
tests/sys/capsicum/linux.cc
202
int cap_wo = dup(fd);
tests/sys/capsicum/linux.cc
205
int cap_rw = dup(fd);
tests/sys/capsicum/linux.cc
208
int cap_all = dup(fd);
tests/sys/capsicum/linux.cc
226
poll_fd.fd = cap_rw;
tests/sys/capsicum/linux.cc
231
poll_fd.fd = cap_all;
tests/sys/capsicum/linux.cc
251
close(fd);
tests/sys/capsicum/linux.cc
32
int fd = timerfd_create(CLOCK_MONOTONIC, 0);
tests/sys/capsicum/linux.cc
331
int fd = open(TmpFile("cap_fstatat"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
332
EXPECT_OK(fd);
tests/sys/capsicum/linux.cc
334
EXPECT_OK(write(fd, buffer, sizeof(buffer)));
tests/sys/capsicum/linux.cc
336
int cap_rf = dup(fd);
tests/sys/capsicum/linux.cc
339
int cap_ro = dup(fd);
tests/sys/capsicum/linux.cc
344
EXPECT_OK(fstatat(fd, "", &info, AT_EMPTY_PATH));
tests/sys/capsicum/linux.cc
350
close(fd);
tests/sys/capsicum/linux.cc
357
int dir_ro = dup(fd);
tests/sys/capsicum/linux.cc
417
int fd = open(TmpFile("cap_notify/file"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
418
close(fd);
tests/sys/capsicum/linux.cc
43
int cap_fd_ro = dup(fd);
tests/sys/capsicum/linux.cc
456
int fd = open(TmpFile("cap_notify/temp"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
457
close(fd);
tests/sys/capsicum/linux.cc
46
int cap_fd_wo = dup(fd);
tests/sys/capsicum/linux.cc
465
poll_fd.fd = cap_fd_rw;
tests/sys/capsicum/linux.cc
470
poll_fd.fd = cap_fd_not;
tests/sys/capsicum/linux.cc
475
poll_fd.fd = cap_fd_poll;
tests/sys/capsicum/linux.cc
488
EXPECT_NE(0, ev.fd);
tests/sys/capsicum/linux.cc
49
int cap_fd_rw = dup(fd);
tests/sys/capsicum/linux.cc
498
EXPECT_OK(cap_rights_get(ev.fd, &rights));
tests/sys/capsicum/linux.cc
52
int cap_fd_all = dup(fd);
tests/sys/capsicum/linux.cc
551
int fd = open(TmpFile("cap_inotify"), O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/linux.cc
557
EXPECT_OK(write(fd, buffer, sizeof(buffer)));
tests/sys/capsicum/linux.cc
570
close(fd);
tests/sys/capsicum/linux.cc
650
static void SendFD(int fd, int over) {
tests/sys/capsicum/linux.cc
667
*(int *)CMSG_DATA(cmptr) = fd;
tests/sys/capsicum/linux.cc
691
int fd = *(int*)CMSG_DATA(cmptr);
tests/sys/capsicum/linux.cc
695
return fd;
tests/sys/capsicum/linux.cc
79
case 0: poll_fd.fd = cap_fd_ro; break;
tests/sys/capsicum/linux.cc
80
case 1: poll_fd.fd = cap_fd_wo; break;
tests/sys/capsicum/linux.cc
81
case 2: poll_fd.fd = cap_fd_rw; break;
tests/sys/capsicum/linux.cc
89
poll_fd.fd = cap_fd_all;
tests/sys/capsicum/mini-me.c
28
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/mini-me.c
29
if (fd > 0) {
tests/sys/capsicum/openat.cc
102
close(fd);
tests/sys/capsicum/openat.cc
126
fd = openat(etc, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
127
EXPECT_OK(fd);
tests/sys/capsicum/openat.cc
130
fd = openat(etc_cap_base, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
131
EXPECT_OK(fd);
tests/sys/capsicum/openat.cc
132
EXPECT_OK(cap_rights_get(fd, &rights));
tests/sys/capsicum/openat.cc
134
close(fd);
tests/sys/capsicum/openat.cc
136
fd = openat(etc_cap_ro, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
137
EXPECT_OK(fd);
tests/sys/capsicum/openat.cc
138
EXPECT_OK(cap_rights_get(fd, &rights));
tests/sys/capsicum/openat.cc
140
close(fd);
tests/sys/capsicum/openat.cc
21
int fd = open(filename, O_CREAT|O_RDWR, 0644);
tests/sys/capsicum/openat.cc
22
EXPECT_OK(fd);
tests/sys/capsicum/openat.cc
23
EXPECT_OK(write(fd, contents, strlen(contents)));
tests/sys/capsicum/openat.cc
24
close(fd);
tests/sys/capsicum/openat.cc
87
int fd = openat(etc_cap_base, "passwd", O_RDONLY);
tests/sys/capsicum/openat.cc
88
EXPECT_OK(fd);
tests/sys/capsicum/openat.cc
90
EXPECT_OK(cap_rights_get(fd, &rights));
tests/sys/capsicum/openat.cc
93
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
tests/sys/capsicum/openat.cc
98
nioctls = cap_ioctls_get(fd, ioctls, 16);
tests/sys/capsicum/overhead.cc
41
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/overhead.cc
42
EXPECT_GT(50, CompareSyscall(&cap_enter, 10000, __NR_lseek, fd, 0, SEEK_SET));
tests/sys/capsicum/overhead.cc
43
close(fd);
tests/sys/capsicum/procdesc.cc
210
int fd = open("/etc/passwd", O_RDONLY);
tests/sys/capsicum/procdesc.cc
211
EXPECT_OK(fd);
tests/sys/capsicum/procdesc.cc
213
EXPECT_EQ(-1, pdkill(fd, SIGUSR1));
tests/sys/capsicum/procdesc.cc
215
EXPECT_EQ(-1, pdwait4_(fd, &status, 0, NULL));
tests/sys/capsicum/procdesc.cc
217
EXPECT_EQ(-1, pdgetpid(fd, &pid));
tests/sys/capsicum/procdesc.cc
218
close(fd);
tests/sys/capsicum/procdesc.cc
357
fdp.fd = pd_;
tests/sys/capsicum/procdesc.cc
409
fdp.fd = pd_;
tests/sys/capsicum/procdesc.cc
918
int fd;
tests/sys/capsicum/procdesc.cc
922
rc = pdfork(&fd, PD_DAEMON);
tests/sys/capsicum/procdesc.cc
929
rc = pdfork(&fd, 0);
tests/sys/capsicum/select.cc
100
if (fd < 0) return;
tests/sys/capsicum/select.cc
108
cap_fd[ii].fd = dup(fd);
tests/sys/capsicum/select.cc
109
EXPECT_OK(cap_fd[ii].fd);
tests/sys/capsicum/select.cc
110
EXPECT_OK(cap_rights_limit(cap_fd[ii].fd, &r_poll));
tests/sys/capsicum/select.cc
113
cap_fd[kCapCount].fd = fd;
tests/sys/capsicum/select.cc
117
int cap_rw = dup(fd);
tests/sys/capsicum/select.cc
120
cap_fd[kCapCount + 1].fd = cap_rw;
tests/sys/capsicum/select.cc
13
int AddFDToSet(fd_set* fset, int fd, int maxfd) {
tests/sys/capsicum/select.cc
14
FD_SET(fd, fset);
tests/sys/capsicum/select.cc
15
if (fd > maxfd) maxfd = fd;
tests/sys/capsicum/select.cc
31
int fd = open(TmpFile("cap_select"), O_RDWR | O_CREAT, 0644);
tests/sys/capsicum/select.cc
32
EXPECT_OK(fd);
tests/sys/capsicum/select.cc
33
if (fd < 0) return;
tests/sys/capsicum/select.cc
41
cap_fd[ii] = dup(fd);
tests/sys/capsicum/select.cc
47
int cap_rw = dup(fd);
tests/sys/capsicum/select.cc
60
maxfd = AddFDToSet(&rset, fd, maxfd);
tests/sys/capsicum/select.cc
62
AddFDToSet(&rset, fd, 0);
tests/sys/capsicum/select.cc
68
AddFDToSet(&rset, fd, maxfd);
tests/sys/capsicum/select.cc
71
AddFDToSet(&wset, fd, maxfd);
tests/sys/capsicum/select.cc
81
maxfd = AddFDToSet(&rset, fd, maxfd);
tests/sys/capsicum/select.cc
83
AddFDToSet(&rset, fd, 0);
tests/sys/capsicum/select.cc
88
AddFDToSet(&rset, fd, maxfd);
tests/sys/capsicum/select.cc
91
AddFDToSet(&wset, fd, maxfd);
tests/sys/capsicum/select.cc
98
int fd = open(TmpFile("cap_poll"), O_RDWR | O_CREAT, 0644);
tests/sys/capsicum/select.cc
99
EXPECT_OK(fd);
tests/sys/capsicum/syscalls.h
20
inline int getdents_(unsigned int fd, void *dirp, unsigned int count) {
tests/sys/capsicum/syscalls.h
21
return getdents(fd, (char*)dirp, count);
tests/sys/capsicum/syscalls.h
52
inline ssize_t flistxattr_(int fd, char *list, size_t size) {
tests/sys/capsicum/syscalls.h
53
return extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, list, size);
tests/sys/capsicum/syscalls.h
55
inline ssize_t fgetxattr_(int fd, const char *name, void *value, size_t size) {
tests/sys/capsicum/syscalls.h
58
return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
tests/sys/capsicum/syscalls.h
60
inline int fsetxattr_(int fd, const char *name, const void *value, size_t size, int) {
tests/sys/capsicum/syscalls.h
63
return extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size);
tests/sys/capsicum/syscalls.h
65
inline int fremovexattr_(int fd, const char *name) {
tests/sys/capsicum/syscalls.h
68
return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
tests/sys/cddl/zfs/bin/devname2devid.c
59
int fd;
tests/sys/cddl/zfs/bin/devname2devid.c
75
if ((fd = open(device, O_RDONLY|O_NDELAY)) < 0) {
tests/sys/cddl/zfs/bin/devname2devid.c
79
if (devid_get(fd, &devid) != 0) {
tests/sys/cddl/zfs/bin/devname2devid.c
83
if (devid_get_minor_name(fd, &minor_name) != 0) {
tests/sys/cddl/zfs/bin/dir_rd_update.c
104
int fd = open(dirpath, O_RDONLY);
tests/sys/cddl/zfs/bin/dir_rd_update.c
110
chownret = fchown(fd, 0, 0);
tests/sys/cddl/zfs/bin/dir_rd_update.c
90
int fd = open(dirpath, O_RDONLY|O_SYNC);
tests/sys/cddl/zfs/bin/dir_rd_update.c
97
rdret = read(fd, buf, 16);
tests/sys/cddl/zfs/bin/file_trunc.c
168
do_write(int fd)
tests/sys/cddl/zfs/bin/file_trunc.c
182
if (lseek(fd, (offset + roffset), SEEK_SET) < 0) {
tests/sys/cddl/zfs/bin/file_trunc.c
188
if (write(fd, buf, bsize) < bsize) {
tests/sys/cddl/zfs/bin/file_trunc.c
194
if (lseek(fd, (offset + roffset), SEEK_SET) < 0) {
tests/sys/cddl/zfs/bin/file_trunc.c
199
if (read(fd, rbuf, bsize) < bsize) {
tests/sys/cddl/zfs/bin/file_trunc.c
223
do_trunc(int fd)
tests/sys/cddl/zfs/bin/file_trunc.c
228
if (ftruncate(fd, (offset + roffset)) < 0) {
tests/sys/cddl/zfs/bin/file_trunc.c
60
static void do_write(int fd);
tests/sys/cddl/zfs/bin/file_trunc.c
61
static void do_trunc(int fd);
tests/sys/cddl/zfs/bin/file_trunc.c
76
int fd = -1;
tests/sys/cddl/zfs/bin/file_trunc.c
80
fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/sys/cddl/zfs/bin/file_trunc.c
81
if (fd < 0) {
tests/sys/cddl/zfs/bin/file_trunc.c
87
(void) do_write(fd);
tests/sys/cddl/zfs/bin/file_trunc.c
88
(void) do_trunc(fd);
tests/sys/cddl/zfs/bin/file_trunc.c
93
(void) close(fd);
tests/sys/cddl/zfs/bin/largest_file.c
53
int fd = 0;
tests/sys/cddl/zfs/bin/largest_file.c
69
fd = open(testfile, O_CREAT | O_RDWR);
tests/sys/cddl/zfs/bin/largest_file.c
70
if (fd < 0) {
tests/sys/cddl/zfs/bin/largest_file.c
76
lseek_ret = lseek(fd, offset, SEEK_SET);
tests/sys/cddl/zfs/bin/largest_file.c
83
write_ret = write(fd, mybuf, 1);
tests/sys/cddl/zfs/bin/largest_file.c
91
lseek_ret = lseek(fd, offset, SEEK_CUR);
tests/sys/cddl/zfs/bin/largest_file.c
98
write_ret = write(fd, mybuf, 1);
tests/sys/cddl/zfs/bin/mkfile.c
119
int fd;
tests/sys/cddl/zfs/bin/mkfile.c
129
if ((fd = open(f, MKFILE_FLAG, MKFILE_MODE)) < 0) {
tests/sys/cddl/zfs/bin/mkfile.c
134
if ((lseek(fd, (off_t)(s - 1LL), SEEK_SET) == (off_t)-1) ||
tests/sys/cddl/zfs/bin/mkfile.c
135
(write(fd, buf, (size_t)1) == (ssize_t)-1)) {
tests/sys/cddl/zfs/bin/mkfile.c
146
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
tests/sys/cddl/zfs/bin/mkfile.c
152
if ((ws = write(fd, buf, w)) == (ssize_t)-1) {
tests/sys/cddl/zfs/bin/mkfile.c
159
close(fd);
tests/sys/cddl/zfs/bin/mktree.c
150
int fd = -1;
tests/sys/cddl/zfs/bin/mktree.c
167
if ((fd = open(pname, O_CREAT|O_RDWR, 0777)) < 0) {
tests/sys/cddl/zfs/bin/mktree.c
172
if (write(fd, pbuf, 1024) < 1024) {
tests/sys/cddl/zfs/bin/mktree.c
179
if ((afd = openat(fd, "xattr", O_CREAT | O_RDWR | O_XATTR, 0777)) < 0) {
tests/sys/cddl/zfs/bin/mktree.c
192
(void) close(fd);
tests/sys/cddl/zfs/bin/mmapwrite.c
49
int fd = *(int *)fdp;
tests/sys/cddl/zfs/bin/mmapwrite.c
52
mmap(0, 8192, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) {
tests/sys/cddl/zfs/bin/mmapwrite.c
58
MAP_SHARED|MAP_FIXED, fd, 0) == MAP_FAILED) {
tests/sys/cddl/zfs/bin/mmapwrite.c
70
int fd;
tests/sys/cddl/zfs/bin/mmapwrite.c
79
if ((fd = open(argv[1], O_RDWR|O_CREAT|O_TRUNC, 0666)) == -1) {
tests/sys/cddl/zfs/bin/mmapwrite.c
84
if (pthread_create(&pt, NULL, mapper, &fd) != 0) {
tests/sys/cddl/zfs/bin/mmapwrite.c
89
if (write(fd, buf, sizeof (buf)) == -1) {
tests/sys/cddl/zfs/bin/randfree_file.c
52
int fd, ch;
tests/sys/cddl/zfs/bin/randfree_file.c
79
if ((fd = open(filename, O_RDWR|O_CREAT|O_TRUNC)) < 0) {
tests/sys/cddl/zfs/bin/randfree_file.c
83
if (write(fd, buf, filesize) < filesize) {
tests/sys/cddl/zfs/bin/randfree_file.c
91
if (fcntl(fd, F_FREESP, &fl) != 0) {
tests/sys/cddl/zfs/bin/readmmap.c
114
bytes = pread(fd, buf, size, 0);
tests/sys/cddl/zfs/bin/readmmap.c
131
if (fd != -1) {
tests/sys/cddl/zfs/bin/readmmap.c
132
(void) close(fd);
tests/sys/cddl/zfs/bin/readmmap.c
58
int fd = -1, bytes, retval = 0;
tests/sys/cddl/zfs/bin/readmmap.c
76
fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
tests/sys/cddl/zfs/bin/readmmap.c
77
if (fd == -1) {
tests/sys/cddl/zfs/bin/readmmap.c
83
bytes = write(fd, buf, size);
tests/sys/cddl/zfs/bin/readmmap.c
90
map = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
100
(void) write(*fd, "test\n", 5);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
109
int fd;
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
118
fd = open(filebase, O_APPEND | O_RDWR | O_CREAT, 0644);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
119
if (fd < 0) {
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
130
(void) pthread_create(&tid, NULL, writer, (void *) &fd);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
93
int *fd = (int *)a;
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
96
(void) close (*fd);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
97
*fd = open(filebase, O_APPEND | O_RDWR | O_CREAT, 0644);
tests/sys/cddl/zfs/bin/rm_lnkcnt_zero_file.c
98
if (*fd < 0)
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
108
int i, ret, fd;
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
131
fd = open(tfile, O_WRONLY | O_CREAT | O_TRUNC, ALL_MODE);
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
132
if (fd < 0) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
136
(void) close(fd);
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
212
int fd, ret = 0;
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
219
if ((fd = open(pfile, O_RDONLY, ALL_MODE)) == -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
222
if (read(fd, buf, sizeof (buf)) == -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
225
(void) close(fd);
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
228
fprintf(stderr, "read(%d, buf, %zu)\n", fd, sizeof (buf));
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
238
int fd, ret = 0;
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
245
if ((fd = open(pfile, O_WRONLY, ALL_MODE)) == -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
248
if (write(fd, buf, strlen(buf)) == -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
251
(void) close(fd);
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
254
fprintf(stderr, "write(%d, buf, %zu)\n", fd, strlen(buf));
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
296
int fd, ret = 0;
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
302
if ((fd = creat(pfile, ALL_MODE)) == -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
305
if (fd != -1) {
tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c
306
(void) close(fd);
tests/sys/cddl/zfs/tests/exec/mmap_exec.c
40
int fd;
tests/sys/cddl/zfs/tests/exec/mmap_exec.c
52
if ((fd = open(argv[1], O_RDONLY)) < 0) {
tests/sys/cddl/zfs/tests/exec/mmap_exec.c
56
if (fstat(fd, &statbuf) < 0) {
tests/sys/cddl/zfs/tests/exec/mmap_exec.c
62
PROT_EXEC, MAP_SHARED, fd, 0) == MAP_FAILED) {
tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c
308
verify_file(int fd, const pattern_t* p_pat){
tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c
323
if( read(fd, actual_buf, size) <= 0 ){
tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c
369
my_sync(int fd){
tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c
370
if (fsync(fd)){
tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c
341
verify_file(int fd, const pattern_t* p_pat){
tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c
361
if( read(fd, actual_buf, size) <= 0 ){
tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c
411
my_sync(int fd){
tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c
414
if (fsync(fd)){
tests/sys/common/sendfile_helper.c
175
int ch, fd, ss[2], flags, error;
tests/sys/common/sendfile_helper.c
208
fd = open(argv[0], O_RDONLY);
tests/sys/common/sendfile_helper.c
209
if (fd < 0)
tests/sys/common/sendfile_helper.c
228
if (sendfile(fd, ss[0], start, readlen, NULL, NULL, flags) < 0)
tests/sys/fifo/fifo_io.c
1008
assert_status(int fd, int kqueue_fd, int assert_readable,
tests/sys/fifo/fifo_io.c
1014
if (poll_status(fd, &readable, &writable, &exception, testname) < 0)
tests/sys/fifo/fifo_io.c
1024
if (select_status(fd, &readable, &writable, &exception, testname) < 0)
tests/sys/fifo/fifo_io.c
1034
if (kqueue_status(kqueue_fd, fd, &readable, &writable, &exception,
tests/sys/fifo/fifo_io.c
1045
if (fionread_status(fd, &readable, __func__) < 0)
tests/sys/fifo/fifo_io.c
1300
int fd, kqueue_fd;
tests/sys/fifo/fifo_io.c
1305
if (openfifo_rw("testfifo", &fd) < 0) {
tests/sys/fifo/fifo_io.c
1314
cleanfifo2("testifo", fd, -1);
tests/sys/fifo/fifo_io.c
1318
if (kqueue_setup(kqueue_fd, fd, __func__) < 0) {
tests/sys/fifo/fifo_io.c
1319
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1327
if (assert_status(fd, kqueue_fd, NOT_READABLE, WRITABLE,
tests/sys/fifo/fifo_io.c
1329
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1338
len = write(fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
1341
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1345
if (assert_status(fd, kqueue_fd, READABLE, WRITABLE, NOT_EXCEPTION,
tests/sys/fifo/fifo_io.c
1347
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1355
len = read(fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
1358
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1362
if (assert_status(fd, kqueue_fd, NOT_READABLE, WRITABLE,
tests/sys/fifo/fifo_io.c
1364
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
1368
cleanfifo2("testfifo", fd, kqueue_fd);
tests/sys/fifo/fifo_io.c
157
int fd;
tests/sys/fifo/fifo_io.c
159
fd = open(fifoname, O_RDWR);
tests/sys/fifo/fifo_io.c
160
if (fd < 0)
tests/sys/fifo/fifo_io.c
162
*fdp = fd;
tests/sys/fifo/fifo_io.c
168
set_nonblocking(int fd, const char *testname)
tests/sys/fifo/fifo_io.c
172
flags = fcntl(fd, F_GETFL);
tests/sys/fifo/fifo_io.c
180
if (fcntl(fd, F_SETFL, flags) < 0) {
tests/sys/fifo/fifo_io.c
189
set_blocking(int fd, const char *testname)
tests/sys/fifo/fifo_io.c
193
flags = fcntl(fd, F_GETFL);
tests/sys/fifo/fifo_io.c
201
if (fcntl(fd, F_SETFL, flags) < 0) {
tests/sys/fifo/fifo_io.c
214
drain_fd(int fd, const char *testname)
tests/sys/fifo/fifo_io.c
219
if (set_nonblocking(fd, testname) < 0)
tests/sys/fifo/fifo_io.c
222
while ((len = read(fd, &ch, sizeof(ch))) > 0);
tests/sys/fifo/fifo_io.c
313
timed_write(int fd, void *data, size_t len, ssize_t *written_lenp,
tests/sys/fifo/fifo_io.c
328
written_len = write(fd, data, len);
tests/sys/fifo/fifo_io.c
353
timed_read(int fd, void *data, size_t len, ssize_t *read_lenp,
tests/sys/fifo/fifo_io.c
368
read_len = read(fd, data, len);
tests/sys/fifo/fifo_io.c
862
poll_status(int fd, int *readable, int *writable, int *exception,
tests/sys/fifo/fifo_io.c
867
fds[0].fd = fd;
tests/sys/fifo/fifo_io.c
882
select_status(int fd, int *readable, int *writable, int *exception,
tests/sys/fifo/fifo_io.c
891
FD_SET(fd, &readfds);
tests/sys/fifo/fifo_io.c
892
FD_SET(fd, &writefds);
tests/sys/fifo/fifo_io.c
893
FD_SET(fd, &exceptfds);
tests/sys/fifo/fifo_io.c
896
if (select(fd+1, &readfds, &writefds, &exceptfds, &timeout) < 0) {
tests/sys/fifo/fifo_io.c
900
*readable = FD_ISSET(fd, &readfds) ? 1 : 0;
tests/sys/fifo/fifo_io.c
901
*writable = FD_ISSET(fd, &writefds) ? 1 : 0;
tests/sys/fifo/fifo_io.c
902
*exception = FD_ISSET(fd, &exceptfds) ? 1 : 0;
tests/sys/fifo/fifo_io.c
912
kqueue_setup(int kqueue_fd, int fd, const char *testname)
tests/sys/fifo/fifo_io.c
923
EV_SET(&kevent_changelist[0], fd, EVFILT_READ, EV_ADD, 0, 0, 0);
tests/sys/fifo/fifo_io.c
924
EV_SET(&kevent_changelist[1], fd, EVFILT_WRITE, EV_ADD, 0, 0, 0);
tests/sys/fifo/fifo_io.c
951
kqueue_status(int kqueue_fd, int fd, int *readable, int *writable,
tests/sys/fifo/fifo_io.c
971
if (kp->ident != (u_int)fd)
tests/sys/fifo/fifo_io.c
983
fionread_status(int fd, int *readable, const char *testname)
tests/sys/fifo/fifo_io.c
987
if (ioctl(fd, FIONREAD, &i) < 0) {
tests/sys/fifo/fifo_misc.c
151
test_ioctl_setclearflag(int fd, unsigned long flag, const char *testname,
tests/sys/fifo/fifo_misc.c
157
if (ioctl(fd, flag, &i) < 0) {
tests/sys/fifo/fifo_misc.c
165
if (ioctl(fd, flag, &i) < 0) {
tests/sys/fifo/fifo_open.c
180
int fd;
tests/sys/fifo/fifo_open.c
182
fd = open("testfifo", O_RDONLY | O_NONBLOCK);
tests/sys/fifo/fifo_open.c
183
if (fd < 0)
tests/sys/fifo/fifo_open.c
185
close(fd);
tests/sys/fifo/fifo_open.c
193
int fd;
tests/sys/fifo/fifo_open.c
195
fd = open("testfifo", O_WRONLY | O_NONBLOCK);
tests/sys/fifo/fifo_open.c
196
if (fd < 0)
tests/sys/fifo/fifo_open.c
198
close(fd);
tests/sys/fifo/fifo_open.c
206
int fd;
tests/sys/fifo/fifo_open.c
208
fd = open("testfifo", O_RDONLY);
tests/sys/fifo/fifo_open.c
209
if (fd < 0)
tests/sys/fifo/fifo_open.c
211
close(fd);
tests/sys/fifo/fifo_open.c
219
int fd;
tests/sys/fifo/fifo_open.c
221
fd = open("testfifo", O_WRONLY);
tests/sys/fifo/fifo_open.c
222
if (fd < 0)
tests/sys/fifo/fifo_open.c
224
close(fd);
tests/sys/file/closefrom_test.c
121
int fd;
tests/sys/file/closefrom_test.c
123
fd = open(_PATH_DEVNULL, O_RDONLY);
tests/sys/file/closefrom_test.c
124
ATF_REQUIRE_MSG(fd != -1, "open(\" "_PATH_DEVNULL" \"): %s",
tests/sys/file/closefrom_test.c
126
return (fd);
tests/sys/file/closefrom_test.c
132
int fd, start;
tests/sys/file/closefrom_test.c
138
fd = devnull();
tests/sys/file/closefrom_test.c
139
ATF_REQUIRE(fd > start);
tests/sys/file/closefrom_test.c
142
ATF_REQUIRE_INTEQ(fd, highest_fd());
tests/sys/file/closefrom_test.c
145
closefrom(fd);
tests/sys/file/closefrom_test.c
185
int fd;
tests/sys/file/closefrom_test.c
194
fd = highest_fd();
tests/sys/file/closefrom_test.c
195
CHILD_REQUIRE(fd == -1);
tests/sys/file/closefrom_test.c
206
int fd;
tests/sys/file/closefrom_test.c
215
fd = highest_fd();
tests/sys/file/closefrom_test.c
216
CHILD_REQUIRE(fd == -1);
tests/sys/file/closefrom_test.c
279
int fd;
tests/sys/file/closefrom_test.c
288
fd = highest_fd();
tests/sys/file/closefrom_test.c
289
CHILD_REQUIRE(fd == -1);
tests/sys/file/closefrom_test.c
291
fd = highest_fd();
tests/sys/file/closefrom_test.c
292
CHILD_REQUIRE(fd == -1);
tests/sys/file/closefrom_test.c
300
require_fd_flag(int fd, const char *descr, const char *descr2, int flag,
tests/sys/file/closefrom_test.c
305
flags = fcntl(fd, F_GETFD);
tests/sys/file/closefrom_test.c
310
"%s did not set %s on fd %d", descr, descr2, fd);
tests/sys/file/closefrom_test.c
314
fd);
tests/sys/file/dup_test.c
68
int fd;
tests/sys/file/dup_test.c
71
if ((fd = mkstemp(temp)) < 0)
tests/sys/file/dup_test.c
74
if (ftruncate(fd, 1024) != 0)
tests/sys/file/dup_test.c
76
return (fd);
tests/sys/file/fcntlflags_test.c
102
int fd, flags1, flags2, val;
tests/sys/file/fcntlflags_test.c
104
fd = open("/dev/null", O_RDONLY);
tests/sys/file/fcntlflags_test.c
105
ATF_REQUIRE_MSG(fd != -1, "open(\"/dev/null\") failed: %s",
tests/sys/file/fcntlflags_test.c
108
flags1 = fcntl(fd, F_GETFL);
tests/sys/file/fcntlflags_test.c
114
ATF_REQUIRE_ERRNO(EINVAL, ioctl(fd, FIOASYNC, &val) == -1);
tests/sys/file/fcntlflags_test.c
116
flags2 = fcntl(fd, F_GETFL);
tests/sys/file/fcntlflags_test.c
121
(void)close(fd);
tests/sys/file/fcntlflags_test.c
44
int fd, flags1, flags2, flags3;
tests/sys/file/fcntlflags_test.c
46
fd = open(path, omode);
tests/sys/file/fcntlflags_test.c
47
ATF_REQUIRE_MSG(fd != -1, "open(\"%s\", %s) failed: %s", path,
tests/sys/file/fcntlflags_test.c
50
flags1 = fcntl(fd, F_GETFL);
tests/sys/file/fcntlflags_test.c
56
ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags1) != -1,
tests/sys/file/fcntlflags_test.c
59
flags2 = fcntl(fd, F_GETFL);
tests/sys/file/fcntlflags_test.c
64
ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, flags2 | O_NONBLOCK) != -1,
tests/sys/file/fcntlflags_test.c
67
flags3 = fcntl(fd, F_GETFL);
tests/sys/file/fcntlflags_test.c
72
(void)close(fd);
tests/sys/file/flock_helper.c
102
return (fd);
tests/sys/file/flock_helper.c
1022
res = fcntl(fd, F_SETLKW, &fl);
tests/sys/file/flock_helper.c
1032
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
1045
test13(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
1081
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
1110
res = fcntl(fd, F_SETLKW, &fl);
tests/sys/file/flock_helper.c
1120
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
1130
test14(int fd, int argc, const char **argv)
tests/sys/file/flock_helper.c
1203
if (fcntl(fd, F_SETLKW, &fl) < 0) {
tests/sys/file/flock_helper.c
1249
if (pwrite(fd, &buf[start], len,
tests/sys/file/flock_helper.c
1264
if (pread(fd, &buf[start], len,
tests/sys/file/flock_helper.c
1282
if (pread(fd, tbuf, sizeof(tbuf), 0) != sizeof(tbuf)) {
tests/sys/file/flock_helper.c
1328
test15(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
1362
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
1377
(void)dup(fd);
tests/sys/file/flock_helper.c
1378
if (flock(fd, LOCK_SH) < 0)
tests/sys/file/flock_helper.c
1388
flock(fd, LOCK_EX);
tests/sys/file/flock_helper.c
1400
res = fcntl(fd, F_GETLK, &fl);
tests/sys/file/flock_helper.c
1438
test16(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
1446
struct test_ctx tc = { .tc_fd = fd };
tests/sys/file/flock_helper.c
147
test1(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
1470
if (fcntl(fd, F_SETLK, &tc.tc_fl) < 0)
tests/sys/file/flock_helper.c
1548
int fd;
tests/sys/file/flock_helper.c
1559
fd = make_file(argv[1], 1024);
tests/sys/file/flock_helper.c
156
if (fcntl(fd, F_GETLK, &fl1) < 0)
tests/sys/file/flock_helper.c
1583
fstatfs(fd, &st);
tests/sys/file/flock_helper.c
1592
tests[i].testfn(fd, test_argc, test_argv);
tests/sys/file/flock_helper.c
179
test2(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
209
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
229
res = fcntl(fd, F_SETLK, &fl);
tests/sys/file/flock_helper.c
250
test3(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
280
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
303
res = fcntl(fd, F_SETLKW, &fl);
tests/sys/file/flock_helper.c
320
test4(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
349
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
368
if (fcntl(fd, F_GETLK, &fl) < 0)
tests/sys/file/flock_helper.c
397
test5(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
424
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
437
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
440
if (fcntl(fd, F_SETLKW, &fl) < 0)
tests/sys/file/flock_helper.c
460
res = fcntl(fd, F_SETLKW, &fl);
tests/sys/file/flock_helper.c
470
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
491
test6(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
510
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
523
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
540
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
543
if (fcntl(fd, F_SETLKW, &fl) < 0)
tests/sys/file/flock_helper.c
564
res = fcntl(fd, F_SETLKW, &fl);
tests/sys/file/flock_helper.c
573
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
594
test7(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
624
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
646
res = fcntl(fd, F_SETLK, &fl);
tests/sys/file/flock_helper.c
666
test8(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
696
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
718
res = fcntl(fd, F_SETLK, &fl);
tests/sys/file/flock_helper.c
728
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
743
test9(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
76
int fd;
tests/sys/file/flock_helper.c
773
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
795
res = fcntl(fd, F_SETLK, &fl);
tests/sys/file/flock_helper.c
80
fd = open(pathname, O_RDWR);
tests/sys/file/flock_helper.c
81
if (fd < 0)
tests/sys/file/flock_helper.c
815
test10(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
83
if (ftruncate(fd, sz) < 0)
tests/sys/file/flock_helper.c
848
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/flock_helper.c
85
return (fd);
tests/sys/file/flock_helper.c
865
if (fcntl(fd, F_GETLK, &fl) < 0)
tests/sys/file/flock_helper.c
888
test11(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
906
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
910
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
914
res = fcntl(fd, F_GETLK, &fl);
tests/sys/file/flock_helper.c
923
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
93
fd = mkstemp(filename);
tests/sys/file/flock_helper.c
932
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
936
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
94
if (fd < 0)
tests/sys/file/flock_helper.c
941
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
945
res = fcntl(fd, F_GETLK, &fl);
tests/sys/file/flock_helper.c
952
res = fcntl(fd, F_SETLK_REMOTE, &fl);
tests/sys/file/flock_helper.c
96
if (ftruncate(fd, sz) < 0)
tests/sys/file/flock_helper.c
968
test12(int fd, __unused int argc, const __unused char **argv)
tests/sys/file/flock_helper.c
998
if (fcntl(fd, F_SETLK, &fl) < 0)
tests/sys/file/fspacectl_test.c
116
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/file/fspacectl_test.c
137
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/file/fspacectl_test.c
156
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/file/fspacectl_test.c
171
if (fstat(fd, &statbuf) == -1)
tests/sys/file/fspacectl_test.c
189
int fd;
tests/sys/file/fspacectl_test.c
196
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
198
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
199
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
200
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
202
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
214
int fd;
tests/sys/file/fspacectl_test.c
221
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
223
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
224
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
225
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
227
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
239
int fd;
tests/sys/file/fspacectl_test.c
245
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
247
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
248
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
249
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
251
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
263
int fd;
tests/sys/file/fspacectl_test.c
269
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
271
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
272
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
273
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
275
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
287
int fd;
tests/sys/file/fspacectl_test.c
294
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
296
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
297
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
298
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
300
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
312
int fd;
tests/sys/file/fspacectl_test.c
319
ATF_REQUIRE((fd = open("sys_fspacectl_testfile",
tests/sys/file/fspacectl_test.c
321
ATF_REQUIRE(fill(fd, 0, file_max_blocks * blocksize) == 0);
tests/sys/file/fspacectl_test.c
322
ATF_CHECK(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0);
tests/sys/file/fspacectl_test.c
323
ATF_CHECK(check_content_dealloc(fd, offset, length,
tests/sys/file/fspacectl_test.c
325
ATF_REQUIRE(close(fd) == 0);
tests/sys/file/fspacectl_test.c
44
fill(int fd, off_t offset, off_t len)
tests/sys/file/fspacectl_test.c
52
if (fstat(fd, &statbuf) == -1)
tests/sys/file/fspacectl_test.c
63
if (pwrite(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/file/fspacectl_test.c
86
check_content_dealloc(int fd, off_t hole_start, off_t hole_len, off_t file_sz)
tests/sys/file/ftruncate_test.c
103
size = pread(fd, &ch, sizeof(ch), len - 1);
tests/sys/file/ftruncate_test.c
118
if (ftruncate(fd, len) < 0)
tests/sys/file/ftruncate_test.c
120
if (fstat(fd, &sb) < 0)
tests/sys/file/ftruncate_test.c
126
close(fd);
tests/sys/file/ftruncate_test.c
140
fd = socket(PF_UNIX, SOCK_STREAM, 0);
tests/sys/file/ftruncate_test.c
141
if (fd < 0)
tests/sys/file/ftruncate_test.c
143
if (ftruncate(fd, 0) == 0)
tests/sys/file/ftruncate_test.c
147
close(fd);
tests/sys/file/ftruncate_test.c
164
fd = kqueue();
tests/sys/file/ftruncate_test.c
165
if (fd < 0)
tests/sys/file/ftruncate_test.c
171
close(fd);
tests/sys/file/ftruncate_test.c
60
int error, fd, fds[2], i, read_only_fd;
tests/sys/file/ftruncate_test.c
76
fd = open(path, O_RDWR|O_CREAT, 0600);
tests/sys/file/ftruncate_test.c
77
if (fd < 0)
tests/sys/file/ftruncate_test.c
88
if (ftruncate(fd, -1) == 0)
tests/sys/file/ftruncate_test.c
95
if (ftruncate(fd, len) < 0)
tests/sys/file/ftruncate_test.c
97
if (fstat(fd, &sb) < 0)
tests/sys/file/path_test.c
220
int dfd, fd, pathfd, pathdfd;
tests/sys/file/path_test.c
255
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH);
tests/sys/file/path_test.c
256
ATF_REQUIRE(fd >= 0);
tests/sys/file/path_test.c
257
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
261
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH | O_APPEND);
tests/sys/file/path_test.c
262
ATF_REQUIRE(fd >= 0);
tests/sys/file/path_test.c
263
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
270
fd = openat(pathfd, "", O_RDWR | O_EMPTY_PATH);
tests/sys/file/path_test.c
271
ATF_REQUIRE_ERRNO(ENOTCAPABLE, fd == -1);
tests/sys/file/path_test.c
278
fd = openat(pathfd, "", O_RDONLY | O_EMPTY_PATH);
tests/sys/file/path_test.c
279
ATF_REQUIRE_ERRNO(ENOTCAPABLE, fd == -1);
tests/sys/file/path_test.c
333
int fd, pathfd;
tests/sys/file/path_test.c
345
fd = openat(pathfd, "test", O_RDWR | O_CREAT, 0600);
tests/sys/file/path_test.c
346
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/file/path_test.c
349
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
502
pollfd.fd = pathfd;
tests/sys/file/path_test.c
601
int fd, pathfd;
tests/sys/file/path_test.c
623
fd = open(path, O_CREAT | O_RDONLY, 0600);
tests/sys/file/path_test.c
624
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/file/path_test.c
63
#define CHECKED_CLOSE(fd) \
tests/sys/file/path_test.c
64
ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close"))
tests/sys/file/path_test.c
685
int error, fd, pathfd, sd[2];
tests/sys/file/path_test.c
71
int fd;
tests/sys/file/path_test.c
724
fd = open(path2, O_RDWR);
tests/sys/file/path_test.c
726
copy_file_range(fd, NULL, pathfd, NULL, sizeof(buf), 0) == -1);
tests/sys/file/path_test.c
728
copy_file_range(pathfd, NULL, fd, NULL, sizeof(buf), 0) == -1);
tests/sys/file/path_test.c
729
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
74
fd = mkstemp(path);
tests/sys/file/path_test.c
75
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("mkstemp"));
tests/sys/file/path_test.c
77
ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) == sizeof(buf),
tests/sys/file/path_test.c
79
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
807
int fd, pathfd;
tests/sys/file/path_test.c
810
fd = mkostemp(path, O_SHLOCK);
tests/sys/file/path_test.c
811
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("mkostemp"));
tests/sys/file/path_test.c
813
ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) == sizeof(buf),
tests/sys/file/path_test.c
820
CHECKED_CLOSE(fd);
tests/sys/file/path_test.c
851
int fd[2];
tests/sys/file/path_test.c
853
ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe"));
tests/sys/file/path_test.c
854
ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0,
tests/sys/file/path_test.c
856
ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb,
tests/sys/file/path_test.c
858
CHECKED_CLOSE(fd[0]);
tests/sys/file/path_test.c
859
CHECKED_CLOSE(fd[1]);
tests/sys/fs/fusefs/allow_other.cc
196
int fd;
tests/sys/fs/fusefs/allow_other.cc
198
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/allow_other.cc
199
if (fd >= 0) {
tests/sys/fs/fusefs/allow_other.cc
201
leak(fd);
tests/sys/fs/fusefs/allow_other.cc
241
int fd;
tests/sys/fs/fusefs/allow_other.cc
243
fd = openat(dfd, RELPATH2, O_RDONLY);
tests/sys/fs/fusefs/allow_other.cc
244
if (fd >= 0) {
tests/sys/fs/fusefs/allow_other.cc
246
leak(fd);
tests/sys/fs/fusefs/allow_other.cc
85
int fd;
tests/sys/fs/fusefs/allow_other.cc
87
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/allow_other.cc
88
if (fd < 0) {
tests/sys/fs/fusefs/allow_other.cc
93
leak(fd);
tests/sys/fs/fusefs/bmap.cc
101
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/bmap.cc
102
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
107
ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
123
leak(fd);
tests/sys/fs/fusefs/bmap.cc
136
int fd;
tests/sys/fs/fusefs/bmap.cc
147
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/bmap.cc
148
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
155
ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
165
ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
175
ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
180
leak(fd);
tests/sys/fs/fusefs/bmap.cc
193
int fd;
tests/sys/fs/fusefs/bmap.cc
205
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/bmap.cc
206
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
211
ASSERT_EQ(-1, ioctl(fd, FIOBMAP2, &arg));
tests/sys/fs/fusefs/bmap.cc
214
leak(fd);
tests/sys/fs/fusefs/bmap.cc
227
int fd, r;
tests/sys/fs/fusefs/bmap.cc
255
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/bmap.cc
256
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
262
r = read(fd, buf, sizeof(buf));
tests/sys/fs/fusefs/bmap.cc
264
r = read(fd, buf, sizeof(buf));
tests/sys/fs/fusefs/bmap.cc
266
r = read(fd, buf, sizeof(buf));
tests/sys/fs/fusefs/bmap.cc
291
int fd;
tests/sys/fs/fusefs/bmap.cc
346
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/bmap.cc
347
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/bmap.cc
348
read(fd, buf, filesize);
tests/sys/fs/fusefs/bmap.cc
351
leak(fd);
tests/sys/fs/fusefs/bmap.cc
95
int fd;
tests/sys/fs/fusefs/cache.cc
143
int fd;
tests/sys/fs/fusefs/cache.cc
169
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/cache.cc
170
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/cache.cc
172
ASSERT_EQ(osize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/cache.cc
181
ASSERT_EQ(0, close(fd));
tests/sys/fs/fusefs/cache.cc
184
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/cache.cc
185
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/cache.cc
191
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET));
tests/sys/fs/fusefs/cache.cc
192
ASSERT_EQ(nsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/cache.cc
195
leak(fd);
tests/sys/fs/fusefs/copy_file_range.cc
343
int fd;
tests/sys/fs/fusefs/copy_file_range.cc
371
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/copy_file_range.cc
374
p = mmap(NULL, wsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/copy_file_range.cc
383
r = copy_file_range(fd, &offset2_in, fd, &offset2_out, copysize, 0);
tests/sys/fs/fusefs/copy_file_range.cc
545
int fd;
tests/sys/fs/fusefs/copy_file_range.cc
567
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/copy_file_range.cc
568
ASSERT_EQ(len, copy_file_range(fd, &off_in, fd, &off_out, len, 0));
tests/sys/fs/fusefs/copy_file_range.cc
570
leak(fd);
tests/sys/fs/fusefs/copy_file_range.cc
655
int fd;
tests/sys/fs/fusefs/copy_file_range.cc
677
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/copy_file_range.cc
678
ASSERT_GE(fd, 0);
tests/sys/fs/fusefs/copy_file_range.cc
679
ASSERT_EQ(len, copy_file_range(fd, &off_in, fd, &off_out, len, 0));
tests/sys/fs/fusefs/copy_file_range.cc
682
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/copy_file_range.cc
685
leak(fd);
tests/sys/fs/fusefs/create.cc
122
int fd;
tests/sys/fs/fusefs/create.cc
143
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
144
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
145
leak(fd);
tests/sys/fs/fusefs/create.cc
155
int fd;
tests/sys/fs/fusefs/create.cc
184
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
185
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
188
leak(fd);
tests/sys/fs/fusefs/create.cc
219
int fd;
tests/sys/fs/fusefs/create.cc
254
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
255
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
256
leak(fd);
tests/sys/fs/fusefs/create.cc
268
int fd;
tests/sys/fs/fusefs/create.cc
288
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
289
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
290
leak(fd);
tests/sys/fs/fusefs/create.cc
302
int fd;
tests/sys/fs/fusefs/create.cc
319
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
320
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
326
leak(fd);
tests/sys/fs/fusefs/create.cc
353
int fd;
tests/sys/fs/fusefs/create.cc
366
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
367
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
368
leak(fd);
tests/sys/fs/fusefs/create.cc
383
int fd;
tests/sys/fs/fusefs/create.cc
407
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
408
ASSERT_EQ(-1, fd);
tests/sys/fs/fusefs/create.cc
426
int fd;
tests/sys/fs/fusefs/create.cc
439
fd = open(FULLPATH, O_CREAT | O_WRONLY, mode);
tests/sys/fs/fusefs/create.cc
440
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
441
leak(fd);
tests/sys/fs/fusefs/create.cc
450
int fd;
tests/sys/fs/fusefs/create.cc
466
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
467
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
468
close(fd);
tests/sys/fs/fusefs/create.cc
477
int fd;
tests/sys/fs/fusefs/create.cc
490
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
tests/sys/fs/fusefs/create.cc
491
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/create.cc
492
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1000
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
1001
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1002
EXPECT_EQ(0, posix_fallocate(fd, off, len)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1003
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1006
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1021
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1030
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
1031
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1032
EXPECT_EQ(0, posix_fallocate(fd, off, len)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1033
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1036
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1051
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1059
fd = open(FULLPATH, O_CREAT | O_RDWR, 0);
tests/sys/fs/fusefs/default_permissions.cc
1060
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1061
EXPECT_EQ(0, posix_fallocate(fd, off, len)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1062
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1250
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1270
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/default_permissions.cc
1271
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1276
ASSERT_EQ(fsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1278
close(fd);
tests/sys/fs/fusefs/default_permissions.cc
1338
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1358
fd = open(FULLPATH, O_CREAT | O_RDWR, 0);
tests/sys/fs/fusefs/default_permissions.cc
1359
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1360
ASSERT_EQ(0, ftruncate(fd, 100)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1361
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1628
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1636
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
1637
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1638
ASSERT_EQ(1, write(fd, wbuf, sizeof(wbuf))) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1639
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1641
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1654
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1662
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
1663
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1664
ASSERT_EQ(1, write(fd, wbuf, sizeof(wbuf))) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1665
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1667
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
1684
int fd;
tests/sys/fs/fusefs/default_permissions.cc
1693
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
1694
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1695
ASSERT_EQ(1, write(fd, wbuf, sizeof(wbuf))) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
1696
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
594
int fd;
tests/sys/fs/fusefs/default_permissions.cc
601
fd = open(FULLPATH, O_CREAT | O_EXCL, 0644);
tests/sys/fs/fusefs/default_permissions.cc
602
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
603
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
851
int fd;
tests/sys/fs/fusefs/default_permissions.cc
861
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
862
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
865
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/default_permissions.cc
866
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
869
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
885
int fd;
tests/sys/fs/fusefs/default_permissions.cc
895
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/default_permissions.cc
896
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
899
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/default_permissions.cc
900
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
903
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
919
int fd;
tests/sys/fs/fusefs/default_permissions.cc
928
fd = open(FULLPATH, O_CREAT | O_RDWR, 0);
tests/sys/fs/fusefs/default_permissions.cc
929
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
932
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/default_permissions.cc
933
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
968
int fd;
tests/sys/fs/fusefs/default_permissions.cc
974
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/default_permissions.cc
975
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/default_permissions.cc
976
leak(fd);
tests/sys/fs/fusefs/default_permissions.cc
991
int fd;
tests/sys/fs/fusefs/destroy.cc
90
int fd;
tests/sys/fs/fusefs/destroy.cc
93
fd = open(path, O_RDONLY);
tests/sys/fs/fusefs/destroy.cc
94
EXPECT_EQ(-1, fd);
tests/sys/fs/fusefs/fallocate.cc
189
int fd;
tests/sys/fs/fusefs/fallocate.cc
198
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
199
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
200
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
205
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
208
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off1, len1));
tests/sys/fs/fusefs/fallocate.cc
210
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
229
int fd;
tests/sys/fs/fusefs/fallocate.cc
243
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
244
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
252
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
257
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
260
EXPECT_EQ(0, posix_fallocate(fd, fsize, len));
tests/sys/fs/fusefs/fallocate.cc
262
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
275
int fd;
tests/sys/fs/fusefs/fallocate.cc
294
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
295
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
306
EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
309
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
325
int fd;
tests/sys/fs/fusefs/fallocate.cc
353
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
354
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
357
EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
360
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
373
int fd;
tests/sys/fs/fusefs/fallocate.cc
380
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
381
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
382
ASSERT_EQ(0, fstat(fd, &sb0)) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
385
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr));
tests/sys/fs/fusefs/fallocate.cc
393
EXPECT_EQ(0, fstat(fd, &sb1));
tests/sys/fs/fusefs/fallocate.cc
401
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
414
int fd;
tests/sys/fs/fusefs/fallocate.cc
421
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
422
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
425
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr));
tests/sys/fs/fusefs/fallocate.cc
429
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
442
int fd;
tests/sys/fs/fusefs/fallocate.cc
449
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
450
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
453
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr));
tests/sys/fs/fusefs/fallocate.cc
457
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
474
int fd;
tests/sys/fs/fusefs/fallocate.cc
482
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
483
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
486
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr));
tests/sys/fs/fusefs/fallocate.cc
490
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
510
int fd;
tests/sys/fs/fusefs/fallocate.cc
522
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
523
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
526
ASSERT_EQ(fsize, (uint64_t)pread(fd, buf, bufsize, 0))
tests/sys/fs/fusefs/fallocate.cc
533
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr));
tests/sys/fs/fusefs/fallocate.cc
538
ASSERT_EQ(fsize, (uint64_t)pread(fd, buf, bufsize, 0))
tests/sys/fs/fusefs/fallocate.cc
542
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
564
int fd;
tests/sys/fs/fusefs/fallocate.cc
571
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
572
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
573
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off0, len0));
tests/sys/fs/fusefs/fallocate.cc
576
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, off0, len0));
tests/sys/fs/fusefs/fallocate.cc
579
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
581
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
599
int fd;
tests/sys/fs/fusefs/fallocate.cc
608
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
609
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
610
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, fsize, length));
tests/sys/fs/fusefs/fallocate.cc
613
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
618
EXPECT_EQ(0, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL));
tests/sys/fs/fusefs/fallocate.cc
620
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
631
int fd;
tests/sys/fs/fusefs/fallocate.cc
637
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
638
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
639
EXPECT_EQ(EIO, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
643
EXPECT_EQ(0, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
645
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
658
int fd;
tests/sys/fs/fusefs/fallocate.cc
677
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
678
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
689
EXPECT_EQ(EROFS, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
691
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
702
int fd;
tests/sys/fs/fusefs/fallocate.cc
715
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
716
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
717
ASSERT_EQ(0, fstat(fd, &sb0)) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
718
EXPECT_EQ(0, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
731
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
743
int fd;
tests/sys/fs/fusefs/fallocate.cc
753
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
754
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
755
EXPECT_EQ(EFBIG, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
758
leak(fd);
tests/sys/fs/fusefs/fallocate.cc
769
int fd;
tests/sys/fs/fusefs/fallocate.cc
774
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fallocate.cc
775
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fallocate.cc
776
EXPECT_EQ(EOPNOTSUPP, posix_fallocate(fd, offset, length));
tests/sys/fs/fusefs/fallocate.cc
778
leak(fd);
tests/sys/fs/fusefs/fifo.cc
102
r = read(fd, message + recvd, bufsize - recvd);
tests/sys/fs/fusefs/fifo.cc
109
leak(fd);
tests/sys/fs/fusefs/fifo.cc
115
int fd, err;
tests/sys/fs/fusefs/fifo.cc
118
fd = socket(AF_UNIX, SOCK_STREAM, 0);
tests/sys/fs/fusefs/fifo.cc
119
if (fd < 0) {
tests/sys/fs/fusefs/fifo.cc
126
err = connect(fd, (struct sockaddr*)&sa, sizeof(sa));
tests/sys/fs/fusefs/fifo.cc
135
r = write(fd, MESSAGE + sent, msgsize - sent);
tests/sys/fs/fusefs/fifo.cc
143
FuseTest::leak(fd);
tests/sys/fs/fusefs/fifo.cc
159
int fd, connected;
tests/sys/fs/fusefs/fifo.cc
189
fd = socket(AF_UNIX, SOCK_STREAM, 0);
tests/sys/fs/fusefs/fifo.cc
190
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fifo.cc
194
ASSERT_EQ(0, bind(fd, (struct sockaddr*)&sa, sizeof(sa)))
tests/sys/fs/fusefs/fifo.cc
196
listen(fd, 5);
tests/sys/fs/fusefs/fifo.cc
199
connected = accept(fd, 0, 0);
tests/sys/fs/fusefs/fifo.cc
210
leak(fd);
tests/sys/fs/fusefs/fifo.cc
67
int fd;
tests/sys/fs/fusefs/fifo.cc
69
fd = *(int*)arg;
tests/sys/fs/fusefs/fifo.cc
73
r = write(fd, MESSAGE + sent, msgsize - sent);
tests/sys/fs/fusefs/fifo.cc
93
int fd;
tests/sys/fs/fusefs/fifo.cc
97
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fifo.cc
98
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fifo.cc
99
ASSERT_EQ(0, pthread_create(&m_child, NULL, writer, &fd))
tests/sys/fs/fusefs/flush.cc
102
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/flush.cc
103
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
109
EXPECT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
121
int fd;
tests/sys/fs/fusefs/flush.cc
136
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/flush.cc
137
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
139
EXPECT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
155
int fd;
tests/sys/fs/fusefs/flush.cc
162
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/flush.cc
163
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
165
ASSERT_TRUE(0 == close(fd) || errno == EIO) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
209
int fd;
tests/sys/fs/fusefs/flush.cc
216
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/flush.cc
217
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
219
ASSERT_TRUE(0 == close(fd)) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
231
int fd, fd2;
tests/sys/fs/fusefs/flush.cc
257
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/flush.cc
258
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
265
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/flush.cc
270
leak(fd);
tests/sys/fs/fusefs/flush.cc
95
int fd, fd2;
tests/sys/fs/fusefs/fsync.cc
102
int fd;
tests/sys/fs/fusefs/fsync.cc
109
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
110
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
111
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
114
iocb.aio_fildes = fd;
tests/sys/fs/fusefs/fsync.cc
119
leak(fd);
tests/sys/fs/fusefs/fsync.cc
135
int fd;
tests/sys/fs/fusefs/fsync.cc
158
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
159
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
160
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
161
close(fd);
tests/sys/fs/fusefs/fsync.cc
171
int fd;
tests/sys/fs/fusefs/fsync.cc
178
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
179
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
180
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
181
ASSERT_NE(0, fdatasync(fd));
tests/sys/fs/fusefs/fsync.cc
184
leak(fd);
tests/sys/fs/fusefs/fsync.cc
199
int fd;
tests/sys/fs/fusefs/fsync.cc
206
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
207
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
208
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
209
EXPECT_EQ(0, fdatasync(fd));
tests/sys/fs/fusefs/fsync.cc
212
EXPECT_EQ(0, fdatasync(fd));
tests/sys/fs/fusefs/fsync.cc
213
leak(fd);
tests/sys/fs/fusefs/fsync.cc
224
int fd;
tests/sys/fs/fusefs/fsync.cc
231
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
232
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
233
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
234
ASSERT_EQ(0, fdatasync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
236
leak(fd);
tests/sys/fs/fusefs/fsync.cc
246
int fd;
tests/sys/fs/fusefs/fsync.cc
253
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/fsync.cc
254
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
255
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
256
ASSERT_EQ(0, fsync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsync.cc
258
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
100
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/fsyncdir.cc
101
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
104
iocb.aio_fildes = fd;
tests/sys/fs/fusefs/fsyncdir.cc
109
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
117
int fd;
tests/sys/fs/fusefs/fsyncdir.cc
123
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/fsyncdir.cc
124
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
125
ASSERT_NE(0, fsync(fd));
tests/sys/fs/fusefs/fsyncdir.cc
128
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
141
int fd;
tests/sys/fs/fusefs/fsyncdir.cc
147
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/fsyncdir.cc
148
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
149
EXPECT_EQ(0, fsync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
152
EXPECT_EQ(0, fsync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
154
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
162
int fd;
tests/sys/fs/fusefs/fsyncdir.cc
168
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/fsyncdir.cc
169
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
170
ASSERT_EQ(0, fdatasync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
172
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
184
int fd;
tests/sys/fs/fusefs/fsyncdir.cc
190
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/fsyncdir.cc
191
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
192
ASSERT_EQ(0, fsync(fd)) << strerror(errno);
tests/sys/fs/fusefs/fsyncdir.cc
194
leak(fd);
tests/sys/fs/fusefs/fsyncdir.cc
94
int fd;
tests/sys/fs/fusefs/interrupt.cc
210
int fd = (int)(intptr_t)arg;
tests/sys/fs/fusefs/interrupt.cc
213
r = read(fd, buf, bufsize);
tests/sys/fs/fusefs/interrupt.cc
587
int fd;
tests/sys/fs/fusefs/interrupt.cc
610
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/interrupt.cc
611
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/interrupt.cc
614
ASSERT_EQ(-1, read(fd, buf, bufsize));
tests/sys/fs/fusefs/interrupt.cc
617
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
102
int fd;
tests/sys/fs/fusefs/ioctl.cc
107
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
108
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
110
EXPECT_EQ(-1, ioctl(fd, req));
tests/sys/fs/fusefs/ioctl.cc
113
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
124
int fd;
tests/sys/fs/fusefs/ioctl.cc
129
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
130
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
132
EXPECT_EQ(0, ioctl(fd, req, buf)) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
135
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
146
int fd;
tests/sys/fs/fusefs/ioctl.cc
151
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
152
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
154
EXPECT_EQ(-1, ioctl(fd, req, buf));
tests/sys/fs/fusefs/ioctl.cc
157
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
163
int fd;
tests/sys/fs/fusefs/ioctl.cc
168
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
169
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
171
EXPECT_EQ(0, ioctl(fd, req, INPUT_DATA)) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
173
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
180
int fd;
tests/sys/fs/fusefs/ioctl.cc
185
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
186
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
189
EXPECT_EQ(0, ioctl(fd, req, buf)) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
192
leak(fd);
tests/sys/fs/fusefs/ioctl.cc
199
int fd, r;
tests/sys/fs/fusefs/ioctl.cc
204
fd = open("mountpoint", O_RDONLY | O_DIRECTORY);
tests/sys/fs/fusefs/ioctl.cc
205
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/ioctl.cc
208
r = ioctl(fd, req, arg);
tests/sys/fs/fusefs/ioctl.cc
212
leak(fd);
tests/sys/fs/fusefs/last_local_modify.cc
108
int fd;
tests/sys/fs/fusefs/last_local_modify.cc
115
fd = open("mountpoint/some_file.txt", O_RDWR);
tests/sys/fs/fusefs/last_local_modify.cc
116
if (fd < 0)
tests/sys/fs/fusefs/last_local_modify.cc
119
r = posix_fallocate(fd, 0, 15);
tests/sys/fs/fusefs/last_local_modify.cc
120
LastLocalModify::leak(fd);
tests/sys/fs/fusefs/last_local_modify.cc
129
int fd;
tests/sys/fs/fusefs/last_local_modify.cc
137
fd = open("mountpoint/some_file.txt", O_RDWR);
tests/sys/fs/fusefs/last_local_modify.cc
138
if (fd < 0)
tests/sys/fs/fusefs/last_local_modify.cc
141
r = copy_file_range(fd, &off_in, fd, &off_out, len, 0);
tests/sys/fs/fusefs/last_local_modify.cc
143
LastLocalModify::leak(fd);
tests/sys/fs/fusefs/last_local_modify.cc
150
int fd;
tests/sys/fs/fusefs/last_local_modify.cc
157
fd = open("mountpoint/some_file.txt", O_RDWR);
tests/sys/fs/fusefs/last_local_modify.cc
158
if (fd < 0)
tests/sys/fs/fusefs/last_local_modify.cc
161
r = ftruncate(fd, 15);
tests/sys/fs/fusefs/last_local_modify.cc
162
LastLocalModify::leak(fd);
tests/sys/fs/fusefs/last_local_modify.cc
171
int fd;
tests/sys/fs/fusefs/last_local_modify.cc
185
fd = open("mountpoint/some_file.txt", O_RDWR | O_DIRECT);
tests/sys/fs/fusefs/last_local_modify.cc
186
if (fd < 0)
tests/sys/fs/fusefs/last_local_modify.cc
189
r = write(fd, BUF, sizeof(BUF));
tests/sys/fs/fusefs/last_local_modify.cc
191
LastLocalModify::leak(fd);
tests/sys/fs/fusefs/locks.cc
139
int fd;
tests/sys/fs/fusefs/locks.cc
144
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
145
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
146
ASSERT_EQ(0, flock(fd, LOCK_EX)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
147
leak(fd);
tests/sys/fs/fusefs/locks.cc
160
int fd;
tests/sys/fs/fusefs/locks.cc
165
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
166
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
167
ASSERT_EQ(0, flock(fd, LOCK_EX)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
168
leak(fd);
tests/sys/fs/fusefs/locks.cc
178
int fd;
tests/sys/fs/fusefs/locks.cc
184
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
185
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
186
ASSERT_EQ(0, flock(fd, LOCK_EX)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
187
leak(fd);
tests/sys/fs/fusefs/locks.cc
197
int fd;
tests/sys/fs/fusefs/locks.cc
203
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
204
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
205
ASSERT_NE(0, flock(fd, LOCK_EX | LOCK_NB));
tests/sys/fs/fusefs/locks.cc
207
leak(fd);
tests/sys/fs/fusefs/locks.cc
220
int fd;
tests/sys/fs/fusefs/locks.cc
225
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
226
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
233
ASSERT_NE(-1, fcntl(fd, F_GETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
234
leak(fd);
tests/sys/fs/fusefs/locks.cc
247
int fd;
tests/sys/fs/fusefs/locks.cc
275
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
276
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
283
ASSERT_NE(-1, fcntl(fd, F_GETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
297
leak(fd);
tests/sys/fs/fusefs/locks.cc
307
int fd;
tests/sys/fs/fusefs/locks.cc
338
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
339
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
346
ASSERT_NE(-1, fcntl(fd, F_GETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
353
leak(fd);
tests/sys/fs/fusefs/locks.cc
365
int fd;
tests/sys/fs/fusefs/locks.cc
395
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
396
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
397
ASSERT_NE(-1, lseek(fd, 500, SEEK_SET));
tests/sys/fs/fusefs/locks.cc
405
ASSERT_NE(-1, fcntl(fd, F_GETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
418
leak(fd);
tests/sys/fs/fusefs/locks.cc
430
int fd;
tests/sys/fs/fusefs/locks.cc
460
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
461
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
462
ASSERT_NE(-1, lseek(fd, 500, SEEK_SET));
tests/sys/fs/fusefs/locks.cc
470
ASSERT_NE(-1, fcntl(fd, F_GETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
483
leak(fd);
tests/sys/fs/fusefs/locks.cc
496
int fd;
tests/sys/fs/fusefs/locks.cc
501
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
502
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
509
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
510
leak(fd);
tests/sys/fs/fusefs/locks.cc
520
int fd;
tests/sys/fs/fusefs/locks.cc
527
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
528
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
535
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
536
leak(fd);
tests/sys/fs/fusefs/locks.cc
546
int fd;
tests/sys/fs/fusefs/locks.cc
553
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
554
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
561
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
562
leak(fd);
tests/sys/fs/fusefs/locks.cc
572
int fd;
tests/sys/fs/fusefs/locks.cc
579
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
580
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
587
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
588
leak(fd);
tests/sys/fs/fusefs/locks.cc
598
int fd;
tests/sys/fs/fusefs/locks.cc
605
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
606
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
607
ASSERT_NE(-1, lseek(fd, 500, SEEK_SET));
tests/sys/fs/fusefs/locks.cc
615
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
617
leak(fd);
tests/sys/fs/fusefs/locks.cc
627
int fd;
tests/sys/fs/fusefs/locks.cc
634
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
635
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
643
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
645
leak(fd);
tests/sys/fs/fusefs/locks.cc
655
int fd;
tests/sys/fs/fusefs/locks.cc
662
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
663
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
670
ASSERT_EQ(-1, fcntl(fd, F_SETLK, &fl));
tests/sys/fs/fusefs/locks.cc
672
leak(fd);
tests/sys/fs/fusefs/locks.cc
685
int fd;
tests/sys/fs/fusefs/locks.cc
690
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
691
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
698
ASSERT_NE(-1, fcntl(fd, F_SETLKW, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
699
leak(fd);
tests/sys/fs/fusefs/locks.cc
713
int fd;
tests/sys/fs/fusefs/locks.cc
720
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/locks.cc
721
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
728
ASSERT_NE(-1, fcntl(fd, F_SETLKW, &fl)) << strerror(errno);
tests/sys/fs/fusefs/locks.cc
729
leak(fd);
tests/sys/fs/fusefs/lookup.cc
226
int fd = open("mountpoint/foo/bar", O_EXEC| O_DIRECTORY);
tests/sys/fs/fusefs/lookup.cc
227
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
228
EXPECT_EQ(0, faccessat(fd, "../..", F_OK, 0)) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
241
int fd;
tests/sys/fs/fusefs/lookup.cc
269
fd = open("mountpoint/foo/bar", O_EXEC| O_DIRECTORY);
tests/sys/fs/fusefs/lookup.cc
270
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
276
EXPECT_NE(0, faccessat(fd, "../..", F_OK, 0));
tests/sys/fs/fusefs/lookup.cc
587
int fd = open("mountpoint/foo/bar", O_EXEC| O_DIRECTORY);
tests/sys/fs/fusefs/lookup.cc
588
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
593
EXPECT_EQ(0, faccessat(fd, "../..", F_OK, 0)) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
606
int fd;
tests/sys/fs/fusefs/lookup.cc
654
fd = open("mountpoint/foo/bar", O_EXEC| O_DIRECTORY);
tests/sys/fs/fusefs/lookup.cc
655
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/lookup.cc
661
EXPECT_EQ(0, faccessat(fd, "../..", F_OK, 0)) << strerror(errno);
tests/sys/fs/fusefs/lseek.cc
108
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
109
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
110
EXPECT_EQ(offset, lseek(fd, offset, SEEK_DATA));
tests/sys/fs/fusefs/lseek.cc
112
EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
114
leak(fd);
tests/sys/fs/fusefs/lseek.cc
163
int fd;
tests/sys/fs/fusefs/lseek.cc
175
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
176
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
178
EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
181
EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
184
leak(fd);
tests/sys/fs/fusefs/lseek.cc
197
int fd;
tests/sys/fs/fusefs/lseek.cc
208
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
209
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
211
EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
214
leak(fd);
tests/sys/fs/fusefs/lseek.cc
258
int fd;
tests/sys/fs/fusefs/lseek.cc
272
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
273
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
274
EXPECT_EQ(offset_initial, lseek(fd, offset_initial, SEEK_SET));
tests/sys/fs/fusefs/lseek.cc
275
EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
277
EXPECT_EQ(offset_initial, lseek(fd, 0, SEEK_CUR));
tests/sys/fs/fusefs/lseek.cc
279
leak(fd);
tests/sys/fs/fusefs/lseek.cc
293
int fd;
tests/sys/fs/fusefs/lseek.cc
306
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
307
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
308
EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
310
EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
312
leak(fd);
tests/sys/fs/fusefs/lseek.cc
324
int fd;
tests/sys/fs/fusefs/lseek.cc
335
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
336
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
337
EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
340
leak(fd);
tests/sys/fs/fusefs/lseek.cc
351
int fd;
tests/sys/fs/fusefs/lseek.cc
368
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
369
EXPECT_EQ(offset_out, lseek(fd, offset_in, SEEK_DATA));
tests/sys/fs/fusefs/lseek.cc
370
EXPECT_EQ(offset_out, lseek(fd, 0, SEEK_CUR));
tests/sys/fs/fusefs/lseek.cc
372
leak(fd);
tests/sys/fs/fusefs/lseek.cc
386
int fd;
tests/sys/fs/fusefs/lseek.cc
400
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
401
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
407
EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA));
tests/sys/fs/fusefs/lseek.cc
408
EXPECT_EQ(-1, lseek(fd, -1, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
410
EXPECT_EQ(-1, lseek(fd, fsize, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
413
leak(fd);
tests/sys/fs/fusefs/lseek.cc
424
int fd;
tests/sys/fs/fusefs/lseek.cc
441
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
442
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
443
EXPECT_EQ(offset_out, lseek(fd, offset_in, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
444
EXPECT_EQ(offset_out, lseek(fd, 0, SEEK_CUR));
tests/sys/fs/fusefs/lseek.cc
446
leak(fd);
tests/sys/fs/fusefs/lseek.cc
460
int fd;
tests/sys/fs/fusefs/lseek.cc
474
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
475
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
481
EXPECT_EQ(fsize, lseek(fd, offset_in, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
482
EXPECT_EQ(-1, lseek(fd, -1, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
484
EXPECT_EQ(-1, lseek(fd, fsize, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
487
leak(fd);
tests/sys/fs/fusefs/lseek.cc
498
int fd;
tests/sys/fs/fusefs/lseek.cc
512
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
513
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
514
EXPECT_EQ(-1, lseek(fd, offset_in, SEEK_HOLE));
tests/sys/fs/fusefs/lseek.cc
517
leak(fd);
tests/sys/fs/fusefs/lseek.cc
62
int fd;
tests/sys/fs/fusefs/lseek.cc
73
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/lseek.cc
74
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/lseek.cc
76
EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA));
tests/sys/fs/fusefs/lseek.cc
77
EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
tests/sys/fs/fusefs/lseek.cc
80
leak(fd);
tests/sys/fs/fusefs/lseek.cc
95
int fd;
tests/sys/fs/fusefs/misc.cc
150
int fd;
tests/sys/fs/fusefs/misc.cc
152
fd = open(FULLPATH, O_EXEC);
tests/sys/fs/fusefs/misc.cc
153
if (fd < 0) {
tests/sys/fs/fusefs/misc.cc
157
fexecve(fd, argv, env);
tests/sys/fs/fusefs/misc.cc
204
int fd;
tests/sys/fs/fusefs/misc.cc
206
fd = open(FULLPATH, O_EXEC);
tests/sys/fs/fusefs/misc.cc
207
if (fd < 0) {
tests/sys/fs/fusefs/misc.cc
211
fexecve(fd, argv, env);
tests/sys/fs/fusefs/misc.cc
284
int fd;
tests/sys/fs/fusefs/misc.cc
287
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/misc.cc
288
if (fd < 0) {
tests/sys/fs/fusefs/misc.cc
293
if (read(fd, cbuf, sizeof(cbuf)) < 0) {
tests/sys/fs/fusefs/misc.cc
297
fexecve(fd, argv, env);
tests/sys/fs/fusefs/mknod.cc
228
int fd;
tests/sys/fs/fusefs/mknod.cc
236
fd = socket(AF_UNIX, SOCK_STREAM, 0);
tests/sys/fs/fusefs/mknod.cc
237
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/mknod.cc
241
ASSERT_EQ(0, bind(fd, (struct sockaddr*)&sa, sizeof(sa)))
tests/sys/fs/fusefs/mknod.cc
244
leak(fd);
tests/sys/fs/fusefs/mknod.cc
260
int fd;
tests/sys/fs/fusefs/mknod.cc
272
fd = socket(AF_UNIX, SOCK_STREAM, 0);
tests/sys/fs/fusefs/mknod.cc
273
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/mknod.cc
277
ASSERT_EQ(-1, bind(fd, (struct sockaddr*)&sa, sizeof(sa)));
tests/sys/fs/fusefs/mknod.cc
280
leak(fd);
tests/sys/fs/fusefs/mockfs.cc
1051
fds[0].fd = m_fuse_fd;
tests/sys/fs/fusefs/mockfs.cc
970
fds[0].fd = m_fuse_fd;
tests/sys/fs/fusefs/nfs.cc
433
int fd;
tests/sys/fs/fusefs/nfs.cc
474
fd = fhopen(&fhp, O_DIRECTORY);
tests/sys/fs/fusefs/nfs.cc
475
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/nfs.cc
476
r = getdirentries(fd, buf, sizeof(buf), 0);
tests/sys/fs/fusefs/nfs.cc
479
leak(fd);
tests/sys/fs/fusefs/notify.cc
346
int fd;
tests/sys/fs/fusefs/notify.cc
367
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/notify.cc
368
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
369
ASSERT_EQ(size0, read(fd, buf, size0)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
388
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
389
ASSERT_EQ(size1, read(fd, buf, size1)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
392
leak(fd);
tests/sys/fs/fusefs/notify.cc
449
int fd;
tests/sys/fs/fusefs/notify.cc
455
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/notify.cc
456
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
469
ASSERT_EQ(size1, read(fd, buf, size1)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
472
leak(fd);
tests/sys/fs/fusefs/notify.cc
486
int fd;
tests/sys/fs/fusefs/notify.cc
492
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/notify.cc
493
ASSERT_LE(0, fd);
tests/sys/fs/fusefs/notify.cc
494
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
513
leak(fd);
tests/sys/fs/fusefs/notify.cc
529
int fd;
tests/sys/fs/fusefs/notify.cc
554
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/notify.cc
555
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
556
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/notify.cc
573
leak(fd);
tests/sys/fs/fusefs/open.cc
285
int fd;
tests/sys/fs/fusefs/open.cc
299
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/open.cc
300
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/open.cc
301
close(fd);
tests/sys/fs/fusefs/open.cc
303
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/open.cc
304
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/open.cc
306
leak(fd);
tests/sys/fs/fusefs/open.cc
52
int fd;
tests/sys/fs/fusefs/open.cc
67
fd = open(FULLPATH, os_flags);
tests/sys/fs/fusefs/open.cc
68
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/open.cc
69
leak(fd);
tests/sys/fs/fusefs/opendir.cc
124
int fd;
tests/sys/fs/fusefs/opendir.cc
132
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/opendir.cc
133
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/opendir.cc
135
leak(fd);
tests/sys/fs/fusefs/opendir.cc
144
int fd;
tests/sys/fs/fusefs/opendir.cc
152
fd = open(FULLPATH, O_EXEC | O_DIRECTORY);
tests/sys/fs/fusefs/opendir.cc
153
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/opendir.cc
155
leak(fd);
tests/sys/fs/fusefs/opendir.cc
184
int fd;
tests/sys/fs/fusefs/opendir.cc
189
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/opendir.cc
190
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/opendir.cc
191
close(fd);
tests/sys/fs/fusefs/opendir.cc
193
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/opendir.cc
194
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/opendir.cc
196
leak(fd);
tests/sys/fs/fusefs/read.cc
1007
int fd;
tests/sys/fs/fusefs/read.cc
1030
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1031
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1033
p = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/read.cc
1039
leak(fd);
tests/sys/fs/fusefs/read.cc
1049
int fd;
tests/sys/fs/fusefs/read.cc
1071
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1072
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1074
ASSERT_EQ(bufsize, read(fd, rbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1085
leak(fd);
tests/sys/fs/fusefs/read.cc
1099
int fd;
tests/sys/fs/fusefs/read.cc
1107
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1108
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1109
ASSERT_EQ(0, fstat(fd, &sb1));
tests/sys/fs/fusefs/read.cc
1113
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1114
ASSERT_EQ(0, fstat(fd, &sb2));
tests/sys/fs/fusefs/read.cc
1121
leak(fd);
tests/sys/fs/fusefs/read.cc
1135
int fd;
tests/sys/fs/fusefs/read.cc
1143
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1144
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1146
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1147
ASSERT_EQ(0, fstat(fd, &sb1));
tests/sys/fs/fusefs/read.cc
1151
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1152
ASSERT_EQ(0, fstat(fd, &sb2));
tests/sys/fs/fusefs/read.cc
1159
leak(fd);
tests/sys/fs/fusefs/read.cc
1170
int fd;
tests/sys/fs/fusefs/read.cc
1188
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1189
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1191
p = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/read.cc
1209
leak(fd);
tests/sys/fs/fusefs/read.cc
1222
int fd;
tests/sys/fs/fusefs/read.cc
1247
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1248
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1250
p = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/read.cc
1255
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1259
leak(fd);
tests/sys/fs/fusefs/read.cc
1275
int fd;
tests/sys/fs/fusefs/read.cc
1316
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1317
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1319
p = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/read.cc
1336
leak(fd);
tests/sys/fs/fusefs/read.cc
1349
int fd;
tests/sys/fs/fusefs/read.cc
1357
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1358
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1361
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1366
ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1367
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1368
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1371
leak(fd);
tests/sys/fs/fusefs/read.cc
1380
int fd;
tests/sys/fs/fusefs/read.cc
1393
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1394
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1396
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, offset)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1398
leak(fd);
tests/sys/fs/fusefs/read.cc
1407
int fd;
tests/sys/fs/fusefs/read.cc
1415
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1416
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1418
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1421
leak(fd);
tests/sys/fs/fusefs/read.cc
1430
int fd;
tests/sys/fs/fusefs/read.cc
1438
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1439
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1441
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1444
leak(fd);
tests/sys/fs/fusefs/read.cc
1457
int fd;
tests/sys/fs/fusefs/read.cc
1472
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1473
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1475
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1479
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1481
leak(fd);
tests/sys/fs/fusefs/read.cc
1492
int fd;
tests/sys/fs/fusefs/read.cc
1516
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1517
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1519
ASSERT_EQ(0, sendfile(fd, sp[1], 0, bufsize, NULL, &sbytes, 0))
tests/sys/fs/fusefs/read.cc
1527
leak(fd);
tests/sys/fs/fusefs/read.cc
1538
int fd;
tests/sys/fs/fusefs/read.cc
1554
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1555
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1557
ASSERT_NE(0, sendfile(fd, sp[1], 0, bufsize, NULL, &sbytes, 0));
tests/sys/fs/fusefs/read.cc
1561
leak(fd);
tests/sys/fs/fusefs/read.cc
1572
int fd, maxcontig, clustersize;
tests/sys/fs/fusefs/read.cc
1593
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1594
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1597
ASSERT_EQ(0, fcntl(fd, F_READAHEAD, 1'000'000'000)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1599
ASSERT_EQ(bufsize, read(fd, rbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1602
leak(fd);
tests/sys/fs/fusefs/read.cc
1623
int fd;
tests/sys/fs/fusefs/read.cc
1639
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
1640
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1645
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1647
close(fd);
tests/sys/fs/fusefs/read.cc
1660
int fd;
tests/sys/fs/fusefs/read.cc
1680
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/read.cc
1681
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1683
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1684
ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
1686
leak(fd);
tests/sys/fs/fusefs/read.cc
184
int fd;
tests/sys/fs/fusefs/read.cc
193
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
194
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
197
iocb.aio_fildes = fd;
tests/sys/fs/fusefs/read.cc
205
leak(fd);
tests/sys/fs/fusefs/read.cc
217
int fd;
tests/sys/fs/fusefs/read.cc
252
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
253
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
261
iocb0.aio_fildes = fd;
tests/sys/fs/fusefs/read.cc
268
iocb1.aio_fildes = fd;
tests/sys/fs/fusefs/read.cc
285
leak(fd);
tests/sys/fs/fusefs/read.cc
297
int fd;
tests/sys/fs/fusefs/read.cc
335
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
336
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
343
iocb0.aio_fildes = fd;
tests/sys/fs/fusefs/read.cc
350
iocb1.aio_fildes = fd;
tests/sys/fs/fusefs/read.cc
364
leak(fd);
tests/sys/fs/fusefs/read.cc
381
int fd;
tests/sys/fs/fusefs/read.cc
394
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
395
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
397
r = pread(fd, buf, bufsize, offset);
tests/sys/fs/fusefs/read.cc
400
ASSERT_EQ(0, fstat(fd, &sb));
tests/sys/fs/fusefs/read.cc
402
leak(fd);
tests/sys/fs/fusefs/read.cc
419
int fd;
tests/sys/fs/fusefs/read.cc
441
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
442
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
444
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
447
leak(fd);
tests/sys/fs/fusefs/read.cc
463
int fd;
tests/sys/fs/fusefs/read.cc
532
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
533
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
535
ASSERT_EQ(static_cast<ssize_t>(size1), read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
540
ASSERT_EQ(static_cast<ssize_t>(size2), pread(fd, buf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
543
leak(fd);
tests/sys/fs/fusefs/read.cc
554
int fd;
tests/sys/fs/fusefs/read.cc
562
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
563
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
564
ASSERT_EQ(0, fstat(fd, &sb1));
tests/sys/fs/fusefs/read.cc
569
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
570
ASSERT_EQ(0, fstat(fd, &sb2));
tests/sys/fs/fusefs/read.cc
577
leak(fd);
tests/sys/fs/fusefs/read.cc
588
int fd;
tests/sys/fs/fusefs/read.cc
596
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
597
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
599
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
600
ASSERT_EQ(0, fstat(fd, &sb1));
tests/sys/fs/fusefs/read.cc
605
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
606
ASSERT_EQ(0, fstat(fd, &sb2));
tests/sys/fs/fusefs/read.cc
613
leak(fd);
tests/sys/fs/fusefs/read.cc
625
int fd;
tests/sys/fs/fusefs/read.cc
652
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
653
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
658
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
659
ASSERT_EQ(0, fstat(fd, &sb));
tests/sys/fs/fusefs/read.cc
661
close(fd);
tests/sys/fs/fusefs/read.cc
675
int fd;
tests/sys/fs/fusefs/read.cc
694
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
695
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
700
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
702
ASSERT_EQ(0, close(fd));
tests/sys/fs/fusefs/read.cc
714
int fd;
tests/sys/fs/fusefs/read.cc
739
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
740
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
745
ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
746
ASSERT_EQ(0, fstat(fd, &sb));
tests/sys/fs/fusefs/read.cc
747
ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
749
leak(fd);
tests/sys/fs/fusefs/read.cc
758
int fd;
tests/sys/fs/fusefs/read.cc
765
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
766
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
768
ASSERT_EQ(0, pread(fd, buf, 0, offset)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
769
leak(fd);
tests/sys/fs/fusefs/read.cc
782
int fd;
tests/sys/fs/fusefs/read.cc
791
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
792
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
794
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, offset)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
800
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, offset)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
802
leak(fd);
tests/sys/fs/fusefs/read.cc
815
int fd;
tests/sys/fs/fusefs/read.cc
825
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
826
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
828
ASSERT_EQ(halfbufsize, pread(fd, buf, bufsize, offset))
tests/sys/fs/fusefs/read.cc
831
leak(fd);
tests/sys/fs/fusefs/read.cc
840
int fd;
tests/sys/fs/fusefs/read.cc
853
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
854
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
856
ASSERT_EQ(-1, read(fd, buf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/read.cc
858
leak(fd);
tests/sys/fs/fusefs/read.cc
872
int fd;
tests/sys/fs/fusefs/read.cc
885
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
886
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
888
r = pread(fd, buf, bufsize, offset);
tests/sys/fs/fusefs/read.cc
891
ASSERT_EQ(0, fstat(fd, &sb));
tests/sys/fs/fusefs/read.cc
893
leak(fd);
tests/sys/fs/fusefs/read.cc
903
int fd;
tests/sys/fs/fusefs/read.cc
915
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/read.cc
916
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/read.cc
919
ASSERT_EQ(bufsize, pread(fd, buf, bufsize, m_maxbcachebuf * 2))
tests/sys/fs/fusefs/read.cc
922
ASSERT_EQ(0, pread(fd, buf, bufsize, m_maxbcachebuf))
tests/sys/fs/fusefs/read.cc
924
ASSERT_EQ(0, fstat(fd, &sb));
tests/sys/fs/fusefs/read.cc
926
leak(fd);
tests/sys/fs/fusefs/readdir.cc
158
int fd;
tests/sys/fs/fusefs/readdir.cc
177
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/readdir.cc
178
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/readdir.cc
179
r = getdirentries(fd, buf, sizeof(buf), 0);
tests/sys/fs/fusefs/readdir.cc
182
leak(fd);
tests/sys/fs/fusefs/readdir.cc
196
int fd;
tests/sys/fs/fusefs/readdir.cc
223
fd = open(FULLPATH, O_DIRECTORY);
tests/sys/fs/fusefs/readdir.cc
224
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/readdir.cc
225
r = getdirentries(fd, buf, sizeof(buf), 0);
tests/sys/fs/fusefs/readdir.cc
233
r = lseek(fd, de0->d_off, SEEK_SET);
tests/sys/fs/fusefs/readdir.cc
235
r = getdirentries(fd, buf, sizeof(buf), 0);
tests/sys/fs/fusefs/release.cc
113
int fd;
tests/sys/fs/fusefs/release.cc
120
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/release.cc
121
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
123
ASSERT_TRUE(0 == close(fd) || errno == EIO) << strerror(errno);
tests/sys/fs/fusefs/release.cc
135
int fd;
tests/sys/fs/fusefs/release.cc
142
fd = open(FULLPATH, O_RDWR | O_APPEND);
tests/sys/fs/fusefs/release.cc
143
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
145
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/release.cc
158
int fd, fd2;
tests/sys/fs/fusefs/release.cc
165
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/release.cc
166
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
173
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/release.cc
181
int fd;
tests/sys/fs/fusefs/release.cc
188
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/release.cc
189
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
191
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/release.cc
208
int fd;
tests/sys/fs/fusefs/release.cc
211
char buf[CMSG_SPACE(sizeof(fd))];
tests/sys/fs/fusefs/release.cc
222
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/release.cc
223
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
236
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
tests/sys/fs/fusefs/release.cc
237
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
tests/sys/fs/fusefs/release.cc
240
close(fd); // Close fd within our process
tests/sys/fs/fusefs/release.cc
251
int fd;
tests/sys/fs/fusefs/release.cc
278
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/release.cc
279
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
286
ASSERT_NE(-1, fcntl(fd, F_SETLK, &fl)) << strerror(errno);
tests/sys/fs/fusefs/release.cc
288
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/release.cc
83
int fd, fd2;
tests/sys/fs/fusefs/release.cc
90
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/release.cc
91
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/release.cc
93
fd2 = dup(fd);
tests/sys/fs/fusefs/release.cc
97
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/releasedir.cc
106
int fd;
tests/sys/fs/fusefs/releasedir.cc
112
fd = open(FULLPATH, O_EXEC | O_DIRECTORY);
tests/sys/fs/fusefs/releasedir.cc
113
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/releasedir.cc
115
ASSERT_EQ(0, close(fd)) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
299
int fd;
tests/sys/fs/fusefs/setattr.cc
337
fd = open(FULLPATH, O_RDONLY);
tests/sys/fs/fusefs/setattr.cc
338
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
339
ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
340
leak(fd);
tests/sys/fs/fusefs/setattr.cc
349
int fd;
tests/sys/fs/fusefs/setattr.cc
391
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/setattr.cc
392
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
393
ASSERT_EQ(0, ftruncate(fd, newsize)) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
394
leak(fd);
tests/sys/fs/fusefs/setattr.cc
463
int fd, r;
tests/sys/fs/fusefs/setattr.cc
534
fd = open(FULLPATH, O_RDWR, 0644);
tests/sys/fs/fusefs/setattr.cc
535
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
539
pwrite(fd, w0buf, w0_size, w0_offset));
tests/sys/fs/fusefs/setattr.cc
543
pread(fd, r0buf, r0_size, r0_offset));
tests/sys/fs/fusefs/setattr.cc
545
EXPECT_EQ(0, ftruncate(fd, trunc0_size)) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
548
EXPECT_EQ(0, ftruncate(fd, trunc1_size)) << strerror(errno);
tests/sys/fs/fusefs/setattr.cc
551
pread(fd, r1buf, r1_size, r1_offset));
tests/sys/fs/fusefs/setattr.cc
561
leak(fd);
tests/sys/fs/fusefs/unlink.cc
219
int fd;
tests/sys/fs/fusefs/unlink.cc
226
fd = open(FULLPATH0, O_RDWR);
tests/sys/fs/fusefs/unlink.cc
227
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/unlink.cc
236
leak(fd);
tests/sys/fs/fusefs/utils.hh
271
static void leak(int fd __unused) {}
tests/sys/fs/fusefs/write.cc
1013
int i, fd;
tests/sys/fs/fusefs/write.cc
1032
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1033
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1036
ASSERT_EQ(bufsize, write(fd, wbuf, bufsize))
tests/sys/fs/fusefs/write.cc
1039
close(fd);
tests/sys/fs/fusefs/write.cc
1056
int fd;
tests/sys/fs/fusefs/write.cc
1064
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
1065
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1067
ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset))
tests/sys/fs/fusefs/write.cc
1069
leak(fd);
tests/sys/fs/fusefs/write.cc
1081
int fd;
tests/sys/fs/fusefs/write.cc
1089
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1090
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1092
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1097
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1098
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1099
leak(fd);
tests/sys/fs/fusefs/write.cc
1113
int fd;
tests/sys/fs/fusefs/write.cc
1123
fd = open(FULLPATH, O_RDWR | O_DIRECT);
tests/sys/fs/fusefs/write.cc
1124
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1126
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1128
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1129
ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1130
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1131
leak(fd);
tests/sys/fs/fusefs/write.cc
1140
int fd;
tests/sys/fs/fusefs/write.cc
1150
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1151
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1153
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1155
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1156
ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1157
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1158
leak(fd);
tests/sys/fs/fusefs/write.cc
1174
int fd;
tests/sys/fs/fusefs/write.cc
1190
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1191
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1193
p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/write.cc
1199
close(fd); // Write mmap'd data on close
tests/sys/fs/fusefs/write.cc
1213
int fd;
tests/sys/fs/fusefs/write.cc
1226
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1227
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1229
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1232
leak(fd);
tests/sys/fs/fusefs/write.cc
1246
int fd;
tests/sys/fs/fusefs/write.cc
1260
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1261
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1265
ASSERT_EQ(bufsize, pwrite(fd, CONTENTS0, bufsize, 0))
tests/sys/fs/fusefs/write.cc
1269
ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1270
ASSERT_EQ(bufsize, pwrite(fd, CONTENTS1, bufsize, m_maxbcachebuf))
tests/sys/fs/fusefs/write.cc
1274
ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1275
ASSERT_EQ(bufsize, pread(fd, readbuf, bufsize, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1278
leak(fd);
tests/sys/fs/fusefs/write.cc
1292
int fd;
tests/sys/fs/fusefs/write.cc
1309
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1310
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1313
ASSERT_EQ(3 * bs, pwrite(fd, zeros, 3 * bs, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1324
ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1325
ASSERT_EQ(2 * bs, pwrite(fd, ones, 2 * bs, bs / 2)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1334
ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1335
ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1337
ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 5 * bs / 2))
tests/sys/fs/fusefs/write.cc
1340
ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, bs / 2))
tests/sys/fs/fusefs/write.cc
1343
ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 2 * bs))
tests/sys/fs/fusefs/write.cc
1347
leak(fd);
tests/sys/fs/fusefs/write.cc
1367
int fd;
tests/sys/fs/fusefs/write.cc
1382
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1383
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1386
ASSERT_EQ(wbufsize, pwrite(fd, CONTENTS1, wbufsize, offset))
tests/sys/fs/fusefs/write.cc
1390
r = pread(fd, readbuf, rbufsize, 0);
tests/sys/fs/fusefs/write.cc
1398
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1400
leak(fd);
tests/sys/fs/fusefs/write.cc
1414
int fd;
tests/sys/fs/fusefs/write.cc
1421
char buf[CMSG_SPACE(sizeof(fd))];
tests/sys/fs/fusefs/write.cc
1446
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1447
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1450
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1465
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
tests/sys/fs/fusefs/write.cc
1466
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
tests/sys/fs/fusefs/write.cc
1469
close(fd); // Close fd within our process
tests/sys/fs/fusefs/write.cc
1490
int fd;
tests/sys/fs/fusefs/write.cc
1523
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1524
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1525
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1527
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1532
leak(fd);
tests/sys/fs/fusefs/write.cc
1544
int fd;
tests/sys/fs/fusefs/write.cc
1562
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1563
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1564
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1565
ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1567
leak(fd);
tests/sys/fs/fusefs/write.cc
1579
int fd;
tests/sys/fs/fusefs/write.cc
1599
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1600
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1601
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1602
ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1604
leak(fd);
tests/sys/fs/fusefs/write.cc
1618
int fd;
tests/sys/fs/fusefs/write.cc
1626
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1627
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1629
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1634
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1635
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1636
leak(fd);
tests/sys/fs/fusefs/write.cc
1647
int fd;
tests/sys/fs/fusefs/write.cc
1654
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
1655
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1657
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1659
ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
1661
leak(fd);
tests/sys/fs/fusefs/write.cc
244
int fd;
tests/sys/fs/fusefs/write.cc
252
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
253
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
256
iocb.aio_fildes = fd;
tests/sys/fs/fusefs/write.cc
262
leak(fd);
tests/sys/fs/fusefs/write.cc
287
int fd;
tests/sys/fs/fusefs/write.cc
294
fd = open(FULLPATH, O_RDWR | O_APPEND);
tests/sys/fs/fusefs/write.cc
295
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
297
ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
298
leak(fd);
tests/sys/fs/fusefs/write.cc
314
int fd;
tests/sys/fs/fusefs/write.cc
325
fd = open(FULLPATH, O_RDWR | O_APPEND);
tests/sys/fs/fusefs/write.cc
326
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
329
ASSERT_EQ((ssize_t)oldsize, read(fd, oldbuf, oldsize))
tests/sys/fs/fusefs/write.cc
333
ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
334
leak(fd);
tests/sys/fs/fusefs/write.cc
347
int fd;
tests/sys/fs/fusefs/write.cc
353
fd = open(FULLPATH, O_WRONLY | O_APPEND);
tests/sys/fs/fusefs/write.cc
354
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
356
ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
357
leak(fd);
tests/sys/fs/fusefs/write.cc
368
int fd;
tests/sys/fs/fusefs/write.cc
377
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
378
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
381
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
384
ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
385
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
386
ASSERT_EQ(bufsize, write(fd, CONTENTS1, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
390
ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
391
ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
392
ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
395
leak(fd);
tests/sys/fs/fusefs/write.cc
410
int fd;
tests/sys/fs/fusefs/write.cc
421
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
422
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
424
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
425
leak(fd);
tests/sys/fs/fusefs/write.cc
435
int fd;
tests/sys/fs/fusefs/write.cc
446
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
447
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
449
ASSERT_EQ(-1, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
456
fstat(fd, &sb);
tests/sys/fs/fusefs/write.cc
459
leak(fd);
tests/sys/fs/fusefs/write.cc
473
int fd;
tests/sys/fs/fusefs/write.cc
481
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
482
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
484
ASSERT_EQ(-1, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
486
leak(fd);
tests/sys/fs/fusefs/write.cc
499
int fd;
tests/sys/fs/fusefs/write.cc
507
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
508
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
510
ASSERT_EQ(halfbufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
511
leak(fd);
tests/sys/fs/fusefs/write.cc
527
int fd;
tests/sys/fs/fusefs/write.cc
537
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
538
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
544
ASSERT_EQ(size0, writev(fd, iov, 2)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
545
leak(fd);
tests/sys/fs/fusefs/write.cc
558
int fd, oflag;
tests/sys/fs/fusefs/write.cc
570
fd = open(FULLPATH, O_WRONLY | oflag);
tests/sys/fs/fusefs/write.cc
572
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
574
ASSERT_EQ(-1, pwrite(fd, CONTENTS, bufsize, offset));
tests/sys/fs/fusefs/write.cc
577
leak(fd);
tests/sys/fs/fusefs/write.cc
595
int fd, oflag;
tests/sys/fs/fusefs/write.cc
608
fd = open(FULLPATH, O_WRONLY | oflag);
tests/sys/fs/fusefs/write.cc
610
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
612
ASSERT_EQ(bufsize / 2, pwrite(fd, CONTENTS, bufsize, offset))
tests/sys/fs/fusefs/write.cc
614
leak(fd);
tests/sys/fs/fusefs/write.cc
636
int fd;
tests/sys/fs/fusefs/write.cc
643
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
644
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
646
ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset))
tests/sys/fs/fusefs/write.cc
648
leak(fd);
tests/sys/fs/fusefs/write.cc
667
int fd;
tests/sys/fs/fusefs/write.cc
718
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
719
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
720
ASSERT_EQ(filesize / 2, write(fd, contents, filesize / 2))
tests/sys/fs/fusefs/write.cc
740
int fd;
tests/sys/fs/fusefs/write.cc
764
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
765
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
767
p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/fs/fusefs/write.cc
773
close(fd); // Write mmap'd data on close
tests/sys/fs/fusefs/write.cc
778
leak(fd);
tests/sys/fs/fusefs/write.cc
788
int fd;
tests/sys/fs/fusefs/write.cc
795
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
796
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
798
ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset))
tests/sys/fs/fusefs/write.cc
800
leak(fd);
tests/sys/fs/fusefs/write.cc
812
int fd;
tests/sys/fs/fusefs/write.cc
818
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
819
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
820
ASSERT_EQ(0, fstat(fd, &sb0)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
821
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
825
ASSERT_EQ(0, fstat(fd, &sb1)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
831
leak(fd);
tests/sys/fs/fusefs/write.cc
840
int fd;
tests/sys/fs/fusefs/write.cc
847
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
848
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
850
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
851
leak(fd);
tests/sys/fs/fusefs/write.cc
861
int fd;
tests/sys/fs/fusefs/write.cc
880
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
881
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
883
ASSERT_EQ(bufsize, write(fd, contents, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
884
leak(fd);
tests/sys/fs/fusefs/write.cc
895
int fd;
tests/sys/fs/fusefs/write.cc
901
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
902
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
904
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
905
leak(fd);
tests/sys/fs/fusefs/write.cc
914
int fd;
tests/sys/fs/fusefs/write.cc
921
fd = open(FULLPATH, O_WRONLY);
tests/sys/fs/fusefs/write.cc
922
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
924
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
925
leak(fd);
tests/sys/fs/fusefs/write.cc
935
int fd;
tests/sys/fs/fusefs/write.cc
953
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
954
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
956
ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno);
tests/sys/fs/fusefs/write.cc
957
close(fd);
tests/sys/fs/fusefs/write.cc
966
int i, fd;
tests/sys/fs/fusefs/write.cc
988
fd = open(FULLPATH, O_RDWR);
tests/sys/fs/fusefs/write.cc
989
ASSERT_LE(0, fd) << strerror(errno);
tests/sys/fs/fusefs/write.cc
992
ASSERT_EQ(bufsize, write(fd, wbuf, bufsize))
tests/sys/fs/fusefs/write.cc
995
close(fd);
tests/sys/fs/tarfs/mktar.c
104
close(fd);
tests/sys/fs/tarfs/mktar.c
71
int fd;
tests/sys/fs/tarfs/mktar.c
73
if ((fd = open(filename, O_RDWR|O_CREAT|O_EXCL, mode)) < 0)
tests/sys/fs/tarfs/mktar.c
77
res = write(fd, buf, sizeof(buf));
tests/sys/fs/tarfs/mktar.c
82
close(fd);
tests/sys/fs/tarfs/mktar.c
90
int fd;
tests/sys/fs/tarfs/mktar.c
92
if ((fd = open(filename, O_RDWR|O_CREAT|O_EXCL, mode)) < 0)
tests/sys/fs/tarfs/mktar.c
96
if (lseek(fd, 1048576LU * (i - 32), SEEK_SET) < 0)
tests/sys/fs/tarfs/mktar.c
98
res = write(fd, buf, sizeof(buf));
tests/sys/geom/class/eli/unaligned_io.c
103
n = pread(fd, buf1, iosz, 0);
tests/sys/geom/class/eli/unaligned_io.c
107
n = pread(fd, buf2 + i, iosz, 0);
tests/sys/geom/class/eli/unaligned_io.c
120
n = pwrite(fd, buf1 + i, iosz, 0);
tests/sys/geom/class/eli/unaligned_io.c
123
n = pread(fd, buf2, iosz, 0);
tests/sys/geom/class/eli/unaligned_io.c
56
int fd;
tests/sys/geom/class/eli/unaligned_io.c
62
fd = open(disk, O_RDWR);
tests/sys/geom/class/eli/unaligned_io.c
63
if (fd < 0)
tests/sys/geom/class/eli/unaligned_io.c
66
if (ioctl(fd, DIOCGSECTORSIZE, &secsz) != 0)
tests/sys/geom/class/eli/unaligned_io.c
70
if (ioctl(fd, DIOCGMEDIASIZE, &disksz) != 0)
tests/sys/geom/class/eli/unaligned_io.c
87
n = pwrite(fd, buf1, bufsz, 0);
tests/sys/kern/copy_file_range.c
30
int fd;
tests/sys/kern/copy_file_range.c
35
fd = mkstemp(file);
tests/sys/kern/copy_file_range.c
36
ATF_REQUIRE(fd != -1);
tests/sys/kern/copy_file_range.c
44
n = write(fd, buf, sizeof(buf) < sz ? sizeof(buf) : sz);
tests/sys/kern/copy_file_range.c
50
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
tests/sys/kern/copy_file_range.c
51
return (fd);
tests/sys/kern/execve_overflow.c
26
int fd;
tests/sys/kern/execve_overflow.c
28
fd = open(SCRIPTNAME, O_WRONLY | O_CREAT | O_TRUNC, 0700);
tests/sys/kern/execve_overflow.c
29
if (fd == -1)
tests/sys/kern/execve_overflow.c
31
if (write(fd, SCRIPTBODY, sizeof(SCRIPTBODY) - 1) !=
tests/sys/kern/execve_overflow.c
34
close(fd);
tests/sys/kern/fdgrowtable_test.c
83
int i, fd;
tests/sys/kern/fdgrowtable_test.c
85
ATF_REQUIRE((fd = open(AFILE, O_CREAT, 0644)) != -1);
tests/sys/kern/fdgrowtable_test.c
86
close(fd);
tests/sys/kern/fdgrowtable_test.c
88
ATF_REQUIRE((fd = open(AFILE, O_RDONLY, 0644)) != -1);
tests/sys/kern/getdirentries_test.c
155
int fd;
tests/sys/kern/getdirentries_test.c
157
ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0);
tests/sys/kern/getdirentries_test.c
158
ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base));
tests/sys/kern/getdirentries_test.c
160
ATF_CHECK_EQ(0, close(fd));
tests/sys/kern/getdirentries_test.c
54
int fd;
tests/sys/kern/getdirentries_test.c
56
ATF_REQUIRE((fd = open("file", O_CREAT | O_WRONLY, 0644)) >= 0);
tests/sys/kern/getdirentries_test.c
57
ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base));
tests/sys/kern/getdirentries_test.c
59
ATF_REQUIRE_EQ(0, close(fd));
tests/sys/kern/getdirentries_test.c
60
ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base));
tests/sys/kern/inotify_test.c
192
int fd, wd;
tests/sys/kern/inotify_test.c
195
fd = mkstemp(path);
tests/sys/kern/inotify_test.c
196
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
197
close_checked(fd);
tests/sys/kern/inotify_test.c
268
int fd, fd1, ifd, n, wd;
tests/sys/kern/inotify_test.c
276
fd = open(file, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
277
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
278
close_checked(fd);
tests/sys/kern/inotify_test.c
279
fd = open(file, O_RDWR);
tests/sys/kern/inotify_test.c
280
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
284
close_checked(fd);
tests/sys/kern/inotify_test.c
334
int dfd, error, fd, ifd, mask, wd;
tests/sys/kern/inotify_test.c
356
fd = openat(dfd, "file", O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
357
close_checked(fd);
tests/sys/kern/inotify_test.c
375
fd = openat(dfd, "file2", O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
376
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
377
close_checked(fd);
tests/sys/kern/inotify_test.c
410
int error, fd, ifd, wd;
tests/sys/kern/inotify_test.c
423
fd = open(path, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
424
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
425
close_checked(fd);
tests/sys/kern/inotify_test.c
463
int error, fd, ifd, wd;
tests/sys/kern/inotify_test.c
479
fd = open(path1, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
480
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
481
close_checked(fd);
tests/sys/kern/inotify_test.c
483
fd = open(path2, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
484
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
485
close_checked(fd);
tests/sys/kern/inotify_test.c
533
int fd;
tests/sys/kern/inotify_test.c
536
fd = openat(dfd, name, O_CREAT | O_RDWR, 0644);
tests/sys/kern/inotify_test.c
537
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
538
close_checked(fd);
tests/sys/kern/inotify_test.c
565
int error, fd, fd1, ifd, s[2], wd;
tests/sys/kern/inotify_test.c
571
fd = open(path, O_RDWR);
tests/sys/kern/inotify_test.c
572
n = write(fd, "test", 4);
tests/sys/kern/inotify_test.c
576
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
tests/sys/kern/inotify_test.c
577
n = read(fd, buf, sizeof(buf));
tests/sys/kern/inotify_test.c
583
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
tests/sys/kern/inotify_test.c
586
n = copy_file_range(fd, NULL, fd1, NULL, 4, 0);
tests/sys/kern/inotify_test.c
594
error = sendfile(fd, s[0], 0, 4, NULL, &nb, 0);
tests/sys/kern/inotify_test.c
601
close_checked(fd);
tests/sys/kern/inotify_test.c
65
close_checked(int fd)
tests/sys/kern/inotify_test.c
653
int error, ifd, fd, wd;
tests/sys/kern/inotify_test.c
659
fd = open(path, O_RDWR);
tests/sys/kern/inotify_test.c
660
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
661
error = fchmod(fd, 0600);
tests/sys/kern/inotify_test.c
665
error = fchown(fd, getuid(), getgid());
tests/sys/kern/inotify_test.c
669
close_checked(fd);
tests/sys/kern/inotify_test.c
67
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/inotify_test.c
677
int ifd, fd, wd1, wd2;
tests/sys/kern/inotify_test.c
684
fd = open(dir, O_DIRECTORY);
tests/sys/kern/inotify_test.c
685
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
686
close_checked(fd);
tests/sys/kern/inotify_test.c
689
fd = open(file, O_RDONLY);
tests/sys/kern/inotify_test.c
690
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
691
close_checked(fd);
tests/sys/kern/inotify_test.c
695
fd = open(file1, O_RDONLY | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
696
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
697
close_checked(fd);
tests/sys/kern/inotify_test.c
707
int ifd, fd, wd;
tests/sys/kern/inotify_test.c
713
fd = open(path, O_RDWR);
tests/sys/kern/inotify_test.c
714
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
715
close_checked(fd);
tests/sys/kern/inotify_test.c
728
int error, ifd, ifd1, fd, s, wd, wd1;
tests/sys/kern/inotify_test.c
737
fd = open(path, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
738
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
74
close_inotify(int fd)
tests/sys/kern/inotify_test.c
746
n = write(fd, &b, sizeof(b));
tests/sys/kern/inotify_test.c
748
close_checked(fd);
tests/sys/kern/inotify_test.c
78
ATF_REQUIRE(ioctl(fd, FIONREAD, &n) == 0);
tests/sys/kern/inotify_test.c
795
int error, fd, ifd, wd, wd2;
tests/sys/kern/inotify_test.c
80
close_checked(fd);
tests/sys/kern/inotify_test.c
802
fd = open(path, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
803
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
807
close_checked(fd);
tests/sys/kern/inotify_test.c
813
fd = open(path, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
814
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
815
close_checked(fd);
tests/sys/kern/inotify_test.c
819
fd = open(file, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
820
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
821
close_checked(fd);
tests/sys/kern/inotify_test.c
864
int error, ifd, fd, wd1, wd2, wd3;
tests/sys/kern/inotify_test.c
873
fd = open(path1, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
874
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
875
close_checked(fd);
tests/sys/kern/inotify_test.c
932
int error, ifd, fd, wd;
tests/sys/kern/inotify_test.c
939
fd = open(path, O_RDWR | O_CREAT, 0644);
tests/sys/kern/inotify_test.c
940
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
941
close_checked(fd);
tests/sys/kern/inotify_test.c
944
fd = open(path, O_PATH);
tests/sys/kern/inotify_test.c
945
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
946
close_checked(fd);
tests/sys/kern/inotify_test.c
949
fd = open(root, O_DIRECTORY);
tests/sys/kern/inotify_test.c
950
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
951
close_checked(fd);
tests/sys/kern/inotify_test.c
957
fd = open(path, O_RDWR);
tests/sys/kern/inotify_test.c
958
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
959
close_checked(fd);
tests/sys/kern/inotify_test.c
972
int error, fd, ifd, wd;
tests/sys/kern/inotify_test.c
986
fd = open("./root/dir", O_RDONLY | O_DIRECTORY);
tests/sys/kern/inotify_test.c
987
ATF_REQUIRE(fd != -1);
tests/sys/kern/inotify_test.c
989
close_checked(fd);
tests/sys/kern/jail_lookup_root.c
66
int error, fd, jid;
tests/sys/kern/jail_lookup_root.c
98
fd = open("..", O_RDONLY | O_DIRECTORY);
tests/sys/kern/jail_lookup_root.c
99
ATF_REQUIRE_ERRNO(ENOENT, fd < 0);
tests/sys/kern/jaildesc.c
97
pfd.fd = *(int *)arg;
tests/sys/kern/kcov.c
101
fd = open_kcov();
tests/sys/kern/kcov.c
104
fd, 0) == MAP_FAILED);
tests/sys/kern/kcov.c
106
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE,
tests/sys/kern/kcov.c
110
fd, 0) == MAP_FAILED);
tests/sys/kern/kcov.c
112
fd, 0) == MAP_FAILED);
tests/sys/kern/kcov.c
114
MAP_SHARED, fd, 0)) != MAP_FAILED);
tests/sys/kern/kcov.c
116
MAP_SHARED, fd, 0)) != MAP_FAILED);
tests/sys/kern/kcov.c
126
close(fd);
tests/sys/kern/kcov.c
138
int fd;
tests/sys/kern/kcov.c
140
fd = open_kcov();
tests/sys/kern/kcov.c
142
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
145
fd, 0) != MAP_FAILED);
tests/sys/kern/kcov.c
147
close(fd);
tests/sys/kern/kcov.c
158
int fd;
tests/sys/kern/kcov.c
160
fd = open_kcov();
tests/sys/kern/kcov.c
162
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
165
fd, 0) != MAP_FAILED);
tests/sys/kern/kcov.c
173
int fd;
tests/sys/kern/kcov.c
175
fd = open_kcov();
tests/sys/kern/kcov.c
176
*(int *)data = fd;
tests/sys/kern/kcov.c
178
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
180
fd, 0) != MAP_FAILED);
tests/sys/kern/kcov.c
181
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
tests/sys/kern/kcov.c
198
int fd;
tests/sys/kern/kcov.c
203
kcov_mmap_enable_thread, &fd);
tests/sys/kern/kcov.c
205
close(fd);
tests/sys/kern/kcov.c
218
int fd;
tests/sys/kern/kcov.c
220
fd = open_kcov();
tests/sys/kern/kcov.c
222
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == -1);
tests/sys/kern/kcov.c
224
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
227
ATF_CHECK(ioctl(fd, KIODISABLE, 0) == -1);
tests/sys/kern/kcov.c
230
ATF_CHECK(ioctl(fd, KIOENABLE, -1) == -1);
tests/sys/kern/kcov.c
231
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
tests/sys/kern/kcov.c
232
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == -1);
tests/sys/kern/kcov.c
233
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_CMP) == -1);
tests/sys/kern/kcov.c
236
ATF_CHECK(ioctl(fd, KIODISABLE, 0) == 0);
tests/sys/kern/kcov.c
237
ATF_CHECK(ioctl(fd, KIODISABLE, 0) == -1);
tests/sys/kern/kcov.c
240
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_CMP) == 0);
tests/sys/kern/kcov.c
241
ATF_CHECK(ioctl(fd, KIODISABLE, 0) == 0);
tests/sys/kern/kcov.c
243
close(fd);
tests/sys/kern/kcov.c
254
int fd;
tests/sys/kern/kcov.c
256
fd = open_kcov();
tests/sys/kern/kcov.c
257
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
258
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
tests/sys/kern/kcov.c
259
close(fd);
tests/sys/kern/kcov.c
270
int fd;
tests/sys/kern/kcov.c
272
fd = open_kcov();
tests/sys/kern/kcov.c
273
ATF_REQUIRE(ioctl(fd, KIOSETBUFSIZE, page_size / KCOV_ENTRY_SIZE) == 0);
tests/sys/kern/kcov.c
274
ATF_CHECK(ioctl(fd, KIOENABLE, KCOV_MODE_TRACE_PC) == 0);
tests/sys/kern/kcov.c
281
int fd;
tests/sys/kern/kcov.c
283
fd = open_kcov();
tests/sys/kern/kcov.c
285
ATF_REQUIRE_MSG(ioctl(fd, KIOSETBUFSIZE,
tests/sys/kern/kcov.c
289
data = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/kern/kcov.c
292
*fdp = fd;
tests/sys/kern/kcov.c
297
common_tail(int fd, void *data)
tests/sys/kern/kcov.c
303
close(fd);
tests/sys/kern/kcov.c
310
int fd;
tests/sys/kern/kcov.c
312
buf = common_head(&fd);
tests/sys/kern/kcov.c
313
ATF_REQUIRE_MSG(ioctl(fd, KIOENABLE, mode) == 0,
tests/sys/kern/kcov.c
322
ATF_REQUIRE_MSG(ioctl(fd, KIODISABLE, 0) == 0,
tests/sys/kern/kcov.c
325
common_tail(fd, buf);
tests/sys/kern/kcov.c
368
int fd;
tests/sys/kern/kcov.c
370
buf = common_head(&fd);
tests/sys/kern/kcov.c
372
ATF_REQUIRE_MSG(ioctl(fd, KIOENABLE, mode) == 0,
tests/sys/kern/kcov.c
379
ATF_REQUIRE_MSG(ioctl(fd, KIODISABLE, 0) == 0,
tests/sys/kern/kcov.c
382
common_tail(fd, buf);
tests/sys/kern/kcov.c
409
int fd;
tests/sys/kern/kcov.c
419
ATF_REQUIRE_MSG(ioctl(data->fd, KIOENABLE, data->mode) == 0,
tests/sys/kern/kcov.c
443
data.buf = common_head(&data.fd);
tests/sys/kern/kcov.c
457
common_tail(data.fd, data.buf);
tests/sys/kern/kcov.c
61
int fd;
tests/sys/kern/kcov.c
63
fd = open("/dev/kcov", O_RDWR);
tests/sys/kern/kcov.c
64
if (fd == -1)
tests/sys/kern/kcov.c
67
return (fd);
tests/sys/kern/kcov.c
78
int fd;
tests/sys/kern/kcov.c
80
fd = open_kcov();
tests/sys/kern/kcov.c
82
ATF_CHECK(ioctl(fd, KIOSETBUFSIZE, 0) == -1);
tests/sys/kern/kcov.c
83
ATF_CHECK(ioctl(fd, KIOSETBUFSIZE, 1) == -1);
tests/sys/kern/kcov.c
84
ATF_CHECK(ioctl(fd, KIOSETBUFSIZE, 2) == 0);
tests/sys/kern/kcov.c
85
ATF_CHECK(ioctl(fd, KIOSETBUFSIZE, 2) == -1);
tests/sys/kern/kcov.c
87
close(fd);
tests/sys/kern/kcov.c
99
int fd;
tests/sys/kern/kern_descrip_test.c
118
int i, fd;
tests/sys/kern/kern_descrip_test.c
121
ATF_REQUIRE((fd = open(AFILE, O_CREAT, 0644)) != -1);
tests/sys/kern/kern_descrip_test.c
122
close(fd);
tests/sys/kern/kern_descrip_test.c
123
ATF_REQUIRE((fd = open(RENDEZVOUS, O_CREAT, 0644)) != -1);
tests/sys/kern/kern_descrip_test.c
124
close(fd);
tests/sys/kern/ktls_test.c
1331
ktls_send_control_message(int fd, uint8_t type, void *data, size_t len)
tests/sys/kern/ktls_test.c
1353
ATF_REQUIRE_INTEQ((ssize_t)len, sendmsg(fd, &msg, 0));
tests/sys/kern/ktls_test.c
1482
ktls_receive_tls_record(struct tls_enable *en, int fd, uint8_t record_type,
tests/sys/kern/ktls_test.c
1502
ATF_REQUIRE((rv = recvmsg(fd, &msg, 0)) > 0);
tests/sys/kern/ktls_test.c
1623
ktls_receive_tls_error(int fd, int expected_error)
tests/sys/kern/ktls_test.c
1641
ATF_REQUIRE(recvmsg(fd, &msg, 0) == -1);
tests/sys/kern/ktls_test.c
230
pfd.fd = cs;
tests/sys/kern/ktls_test.c
319
fd_set_blocking(int fd)
tests/sys/kern/ktls_test.c
323
ATF_REQUIRE((flags = fcntl(fd, F_GETFL)) != -1);
tests/sys/kern/ktls_test.c
325
ATF_REQUIRE(fcntl(fd, F_SETFL, flags) != -1);
tests/sys/kern/ktls_test.c
329
tcp_nodelay(int fd)
tests/sys/kern/ktls_test.c
333
ATF_REQUIRE(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay,
tests/sys/kern/ktrace_test.c
122
int error, fd;
tests/sys/kern/ktrace_test.c
124
ATF_REQUIRE((fd = open("ktrace.out",
tests/sys/kern/ktrace_test.c
134
return (fd);
tests/sys/kern/ktrace_test.c
146
int fd;
tests/sys/kern/ktrace_test.c
148
fd = trace_child(cpid, KTRFAC_CAPFAIL, 0);
tests/sys/kern/ktrace_test.c
152
ATF_REQUIRE((n = read(fd, &header, sizeof(header))) != -1);
tests/sys/kern/ktrace_test.c
157
ATF_REQUIRE((n = read(fd, v + i,
tests/sys/kern/ktrace_test.c
161
ATF_REQUIRE(close(fd) != -1);
tests/sys/kern/ktrace_test.c
551
int error, fd;
tests/sys/kern/ktrace_test.c
567
fd = trace_child(pid, KTRFAC_SYSCALL, 1);
tests/sys/kern/ktrace_test.c
569
n = read(fd, &header, sizeof(header));
tests/sys/kern/ktrace_test.c
576
n = read(fd, syscall, header.ktr_len);
tests/sys/kern/ktrace_test.c
583
n = read(fd, &header, sizeof(header));
tests/sys/kern/ktrace_test.c
590
n = read(fd, syscall, header.ktr_len);
tests/sys/kern/ktrace_test.c
598
off = lseek(fd, 0, SEEK_CUR);
tests/sys/kern/ktrace_test.c
600
off1 = lseek(fd, 0, SEEK_END);
tests/sys/kern/ktrace_test.c
604
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/listener_wakeup.c
166
.fd = s,
tests/sys/kern/pipe/big_pipe_test.c
18
write_frame(int fd, char *buf, unsigned long buflen)
tests/sys/kern/pipe/big_pipe_test.c
25
FD_SET(fd, &wfd);
tests/sys/kern/pipe/big_pipe_test.c
26
i = select(fd+1, NULL, &wfd, NULL, NULL);
tests/sys/kern/pipe/big_pipe_test.c
33
i = write(fd, buf, buflen);
tests/sys/kern/pipe/big_pipe_test.c
49
int i, flags, fd[2];
tests/sys/kern/pipe/big_pipe_test.c
51
if (pipe(fd) < 0)
tests/sys/kern/pipe/big_pipe_test.c
54
flags = fcntl(fd[1], F_GETFL);
tests/sys/kern/pipe/big_pipe_test.c
55
if (flags == -1 || fcntl(fd[1], F_SETFL, flags|O_NONBLOCK) == -1) {
tests/sys/kern/pipe/big_pipe_test.c
65
close(fd[1]);
tests/sys/kern/pipe/big_pipe_test.c
68
i = read(fd[0], buf, 256);
tests/sys/kern/pipe/big_pipe_test.c
79
close(fd[0]);
tests/sys/kern/pipe/big_pipe_test.c
82
write_frame(fd[1], buf, sizeof buf);
tests/sys/kern/procdesc.c
145
pfd.fd = *(int *)arg;
tests/sys/kern/procdesc.c
225
int fd;
tests/sys/kern/procdesc.c
235
fd = pdopenpid(child, 0);
tests/sys/kern/procdesc.c
236
ATF_REQUIRE_MSG(fd >= 0, "pdopenpid: %s", strerror(errno));
tests/sys/kern/procdesc.c
238
ATF_REQUIRE_MSG(pdgetpid(fd, &queried) == 0,
tests/sys/kern/procdesc.c
242
ATF_REQUIRE_MSG(pdkill(fd, SIGKILL) == 0,
tests/sys/kern/procdesc.c
245
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
255
int fd, flags;
tests/sys/kern/procdesc.c
265
fd = pdopenpid(child, PD_CLOEXEC);
tests/sys/kern/procdesc.c
266
ATF_REQUIRE_MSG(fd >= 0, "pdopenpid: %s", strerror(errno));
tests/sys/kern/procdesc.c
268
flags = fcntl(fd, F_GETFD);
tests/sys/kern/procdesc.c
272
ATF_REQUIRE_MSG(pdkill(fd, SIGKILL) == 0,
tests/sys/kern/procdesc.c
275
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
296
int fd;
tests/sys/kern/procdesc.c
310
fd = dup(STDIN_FILENO);
tests/sys/kern/procdesc.c
311
ATF_REQUIRE(fd >= 0);
tests/sys/kern/procdesc.c
312
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
315
rl.rlim_cur = fd;
tests/sys/kern/procdesc.c
408
int fd, status;
tests/sys/kern/procdesc.c
418
fd = pdopenpid(child, 0);
tests/sys/kern/procdesc.c
419
ATF_REQUIRE_MSG(fd >= 0, "pdopenpid: %s", strerror(errno));
tests/sys/kern/procdesc.c
421
ATF_REQUIRE_MSG(pdkill(fd, SIGKILL) == 0,
tests/sys/kern/procdesc.c
423
ATF_REQUIRE_MSG(pdwait(fd, &status, WEXITED, NULL, NULL) == 0,
tests/sys/kern/procdesc.c
428
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
564
int childfd, fd, status;
tests/sys/kern/procdesc.c
577
fd = pdopenpid(getpid(), PD_DAEMON);
tests/sys/kern/procdesc.c
578
if (fd < 0)
tests/sys/kern/procdesc.c
580
if (pdgetpid(fd, &queried) == -1)
tests/sys/kern/procdesc.c
584
if (close(fd) != 0)
tests/sys/kern/procdesc.c
605
int fd, pip[2], status;
tests/sys/kern/procdesc.c
625
fd = pdopenpid(child, 0);
tests/sys/kern/procdesc.c
626
if (fd >= 0) {
tests/sys/kern/procdesc.c
627
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
646
int fd, pip[2];
tests/sys/kern/procdesc.c
663
fd = pdopenpid(child, 0);
tests/sys/kern/procdesc.c
664
ATF_REQUIRE_MSG(fd >= 0, "pdopenpid: %s", strerror(errno));
tests/sys/kern/procdesc.c
672
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/procdesc.c
687
int fd, pp, rfd, status, workfd, r, r1;
tests/sys/kern/procdesc.c
712
fd = pdopenpid(child, 0);
tests/sys/kern/procdesc.c
713
ATF_REQUIRE(fd != -1);
tests/sys/kern/procdesc.c
714
ATF_REQUIRE(pdgetpid(fd, &pp) == 0);
tests/sys/kern/procdesc.c
719
workfd = pddupfd(fd, rfd, 0);
tests/sys/kern/procdesc.c
741
ATF_REQUIRE(pdwait(fd, &status, WEXITED, &wu, &si) != -1);
tests/sys/kern/procdesc.c
742
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/ptrace_test.c
3483
int fd;
tests/sys/kern/ptrace_test.c
3485
fd = *(int *)arg;
tests/sys/kern/ptrace_test.c
3486
(void)flock(fd, LOCK_EX);
tests/sys/kern/ptrace_test.c
3487
(void)flock(fd, LOCK_UN);
tests/sys/kern/ptrace_test.c
3503
int error, fd, i, status;
tests/sys/kern/ptrace_test.c
3511
fd = mkstemp(tmpfile);
tests/sys/kern/ptrace_test.c
3512
ATF_REQUIRE(fd >= 0);
tests/sys/kern/ptrace_test.c
3543
REQUIRE_EQ(flock(fd, LOCK_EX), 0);
tests/sys/kern/ptrace_test.c
3568
REQUIRE_EQ(flock(fd, LOCK_UN), 0);
tests/sys/kern/ptrace_test.c
3570
REQUIRE_EQ(close(fd), 0);
tests/sys/kern/resolve_beneath_test.c
101
int fd;
tests/sys/kern/resolve_beneath_test.c
103
fd = setup();
tests/sys/kern/resolve_beneath_test.c
105
utimensat(fd, "file", NULL, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
107
utimensat(fd, "../outside/target", NULL,
tests/sys/kern/resolve_beneath_test.c
109
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
115
int fd;
tests/sys/kern/resolve_beneath_test.c
117
fd = setup();
tests/sys/kern/resolve_beneath_test.c
119
linkat(fd, "file", fd, "hardlink", AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
121
linkat(fd, "../outside/target", fd, "hardlink2",
tests/sys/kern/resolve_beneath_test.c
123
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
129
int fd;
tests/sys/kern/resolve_beneath_test.c
131
fd = setup();
tests/sys/kern/resolve_beneath_test.c
133
unlinkat(fd, "file", AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
135
unlinkat(fd, "../outside/target",
tests/sys/kern/resolve_beneath_test.c
137
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
143
int fd;
tests/sys/kern/resolve_beneath_test.c
145
fd = setup();
tests/sys/kern/resolve_beneath_test.c
147
unlinkat(fd, "subdir",
tests/sys/kern/resolve_beneath_test.c
150
unlinkat(fd, "../outside/dir",
tests/sys/kern/resolve_beneath_test.c
153
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
159
int fd;
tests/sys/kern/resolve_beneath_test.c
161
fd = setup();
tests/sys/kern/resolve_beneath_test.c
163
funlinkat(fd, "file", FD_NONE, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
165
funlinkat(fd, "../outside/target", FD_NONE,
tests/sys/kern/resolve_beneath_test.c
167
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
173
int fd;
tests/sys/kern/resolve_beneath_test.c
175
fd = setup();
tests/sys/kern/resolve_beneath_test.c
178
funlinkat(fd, "subdir2", FD_NONE,
tests/sys/kern/resolve_beneath_test.c
181
funlinkat(fd, "../outside/dir", FD_NONE,
tests/sys/kern/resolve_beneath_test.c
184
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
195
int fd;
tests/sys/kern/resolve_beneath_test.c
197
fd = setup();
tests/sys/kern/resolve_beneath_test.c
199
getfhat(fd, "file", &fh, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
201
getfhat(fd, "../outside/target", &fh,
tests/sys/kern/resolve_beneath_test.c
203
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
26
int fd, tfd;
tests/sys/kern/resolve_beneath_test.c
37
ATF_REQUIRE((fd = open("base", O_DIRECTORY | O_RDONLY)) >= 0);
tests/sys/kern/resolve_beneath_test.c
38
return (fd);
tests/sys/kern/resolve_beneath_test.c
44
int fd;
tests/sys/kern/resolve_beneath_test.c
46
fd = setup();
tests/sys/kern/resolve_beneath_test.c
48
faccessat(fd, "file", F_OK, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
50
faccessat(fd, "../outside/target", F_OK,
tests/sys/kern/resolve_beneath_test.c
52
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
58
int fd, ret;
tests/sys/kern/resolve_beneath_test.c
60
fd = setup();
tests/sys/kern/resolve_beneath_test.c
61
ret = chflagsat(fd, "file", UF_NODUMP, AT_RESOLVE_BENEATH);
tests/sys/kern/resolve_beneath_test.c
65
chflagsat(fd, "../outside/target", UF_NODUMP,
tests/sys/kern/resolve_beneath_test.c
67
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
73
int fd;
tests/sys/kern/resolve_beneath_test.c
75
fd = setup();
tests/sys/kern/resolve_beneath_test.c
77
fchmodat(fd, "file", 0644, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
79
fchmodat(fd, "../outside/target", 0644,
tests/sys/kern/resolve_beneath_test.c
81
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/resolve_beneath_test.c
87
int fd;
tests/sys/kern/resolve_beneath_test.c
89
fd = setup();
tests/sys/kern/resolve_beneath_test.c
91
fchownat(fd, "file", -1, -1, AT_RESOLVE_BENEATH));
tests/sys/kern/resolve_beneath_test.c
93
fchownat(fd, "../outside/target", 0, 0,
tests/sys/kern/resolve_beneath_test.c
95
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/socket_msg_trunc.c
168
int error, fd, sd[2];
tests/sys/kern/socket_msg_trunc.c
180
fd = open(tracepath, O_RDWR | O_CREAT | O_TRUNC, 0644);
tests/sys/kern/socket_msg_trunc.c
181
ATF_REQUIRE_MSG(fd >= 0, "open failed: %s", strerror(errno));
tests/sys/kern/socket_msg_trunc.c
200
nbytes = read(fd, &ktr, sizeof(ktr));
tests/sys/kern/socket_msg_trunc.c
205
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/socket_splice.c
154
splice_init(struct splice *sp, int fd, off_t max, struct timeval *tv)
tests/sys/kern/socket_splice.c
157
sp->sp_fd = fd;
tests/sys/kern/socket_splice.c
166
unsplice(int fd)
tests/sys/kern/socket_splice.c
172
error = setsockopt(fd, SOL_SOCKET, SO_SPLICE, &sp, sizeof(sp));
tests/sys/kern/socket_splice.c
28
checked_close(int fd)
tests/sys/kern/socket_splice.c
304
remove_rights(int fd, const cap_rights_t *toremove)
tests/sys/kern/socket_splice.c
309
error = cap_rights_get(fd, &rights);
tests/sys/kern/socket_splice.c
313
error = cap_rights_limit(fd, &rights);
tests/sys/kern/socket_splice.c
32
error = close(fd);
tests/sys/kern/socket_splice.c
37
fionread(int fd)
tests/sys/kern/socket_splice.c
392
int error, fd, sd, usd[2];
tests/sys/kern/socket_splice.c
42
error = ioctl(fd, FIONREAD, &data);
tests/sys/kern/socket_splice.c
432
fd = mkstemp(path);
tests/sys/kern/socket_splice.c
433
ATF_REQUIRE_MSG(fd >= 0, "mkstemp failed: %s", strerror(errno));
tests/sys/kern/socket_splice.c
434
splice_init(&sp, fd, 0, NULL);
tests/sys/kern/socket_splice.c
439
checked_close(fd);
tests/sys/kern/socket_splice.c
440
splice_init(&sp, fd, 0, NULL);
tests/sys/kern/socket_splice.c
49
noblocking(int fd)
tests/sys/kern/socket_splice.c
53
flags = fcntl(fd, F_GETFL);
tests/sys/kern/socket_splice.c
56
error = fcntl(fd, F_SETFL, flags);
tests/sys/kern/socket_splice.c
823
int fd;
tests/sys/kern/socket_splice.c
838
error = fcntl(xfer->fd, F_SETFL, O_NONBLOCK);
tests/sys/kern/socket_splice.c
849
n = write(xfer->fd, buf, MIN(sz, xfer->bytes));
tests/sys/kern/socket_splice.c
858
n = read(xfer->fd, buf, sz);
tests/sys/kern/socket_splice.c
894
.fd = sc.left[0]
tests/sys/kern/socket_splice.c
899
.fd = sc.right[1]
tests/sys/kern/ssl_sendfile.c
122
ATF_REQUIRE((c->fd = mkstemp(tempname)) > 0);
tests/sys/kern/ssl_sendfile.c
124
ATF_REQUIRE(ftruncate(c->fd, FSIZE) == 0);
tests/sys/kern/ssl_sendfile.c
126
MAP_SHARED, c->fd, 0)) != MAP_FAILED);
tests/sys/kern/ssl_sendfile.c
225
c->sbytes = SSL_sendfile(ssl, c->fd, c->offset,
tests/sys/kern/ssl_sendfile.c
277
int rv, fd;
tests/sys/kern/ssl_sendfile.c
279
ATF_REQUIRE((fd = SSL_get_fd(ssl)) > 0);
tests/sys/kern/ssl_sendfile.c
282
ATF_REQUIRE(poll(&(struct pollfd){ .fd = fd, .events = POLLIN },
tests/sys/kern/ssl_sendfile.c
368
while (poll(&(struct pollfd){ .fd = c.ss, .events = POLLOUT }, 1, 1)
tests/sys/kern/ssl_sendfile.c
371
ATF_REQUIRE(ftruncate(c.fd, TRUNC) == 0);
tests/sys/kern/ssl_sendfile.c
403
while (poll(&(struct pollfd){ .fd = c.ss, .events = POLLOUT }, 1, 1)
tests/sys/kern/ssl_sendfile.c
407
ATF_REQUIRE(ftruncate(c.fd, FSIZE + GROW) == 0);
tests/sys/kern/ssl_sendfile.c
409
MAP_SHARED, c.fd, FSIZE)) != MAP_FAILED);
tests/sys/kern/ssl_sendfile.c
55
int fd; /* test file descriptor */
tests/sys/kern/sysctl_kern_proc.c
141
int cmd, fd, mib[4];
tests/sys/kern/sysctl_kern_proc.c
181
fd = mkstemp(tmp);
tests/sys/kern/sysctl_kern_proc.c
182
ATF_REQUIRE(fd >= 0);
tests/sys/kern/sysctl_kern_proc.c
186
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/timerfd.c
1020
poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1, -1) == 1);
tests/sys/kern/timerfd.c
1043
ATF_REQUIRE(poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1,
tests/sys/kern/timerfd.c
1070
poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1, -1) == 1);
tests/sys/kern/timerfd.c
1108
poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1, -1) == 1);
tests/sys/kern/timerfd.c
1123
ATF_REQUIRE(poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1,
tests/sys/kern/timerfd.c
1146
poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1, -1) == 1);
tests/sys/kern/timerfd.c
1173
r = poll(&(struct pollfd) { .fd = tfd, .events = POLLIN }, 1, 3000);
tests/sys/kern/timerfd.c
1301
int r = poll(&(struct pollfd) { .fd = tfd, .events = POLLIN },
tests/sys/kern/timerfd.c
265
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
295
int fd;
tests/sys/kern/timerfd.c
299
fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
tests/sys/kern/timerfd.c
300
ATF_REQUIRE(fd >= 0);
tests/sys/kern/timerfd.c
307
ATF_REQUIRE(timerfd_settime(fd, 0, &value, NULL) == 0);
tests/sys/kern/timerfd.c
317
uint64_t exp = wait_for_timerfd(fd);
tests/sys/kern/timerfd.c
327
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/timerfd.c
335
int fd = timerfd_create(CLOCK_MONOTONIC, 0);
tests/sys/kern/timerfd.c
336
ATF_REQUIRE(fd >= 0);
tests/sys/kern/timerfd.c
338
ATF_REQUIRE(timerfd_gettime(fd, &curr_value) == 0);
tests/sys/kern/timerfd.c
353
ATF_REQUIRE(timerfd_settime(fd, 0, &time, &curr_value) == 0);
tests/sys/kern/timerfd.c
359
ATF_REQUIRE(close(fd) == 0);
tests/sys/kern/timerfd.c
582
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
633
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
648
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
681
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
69
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
698
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
734
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
762
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
781
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/timerfd.c
942
struct pollfd pfd = { .fd = timerfd, .events = POLLIN };
tests/sys/kern/unix_dgram.c
105
ATF_REQUIRE(socketpair(PF_UNIX, SOCK_DGRAM, 0, fd) != -1);
tests/sys/kern/unix_dgram.c
117
ATF_REQUIRE(send(fd[0], buf, maxdgram + 1, 0) == -1);
tests/sys/kern/unix_dgram.c
121
ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == (ssize_t)maxdgram);
tests/sys/kern/unix_dgram.c
124
ATF_REQUIRE(recv(fd[1], buf, maxdgram, MSG_PEEK) == (ssize_t)maxdgram);
tests/sys/kern/unix_dgram.c
126
ATF_REQUIRE(recvmsg(fd[1], &msg, MSG_PEEK) == 42);
tests/sys/kern/unix_dgram.c
131
ATF_REQUIRE(recvmsg(fd[1], &msg, 0) == (ssize_t)maxdgram);
tests/sys/kern/unix_dgram.c
135
ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == (ssize_t)maxdgram);
tests/sys/kern/unix_dgram.c
137
ATF_REQUIRE(recvmsg(fd[1], &msg, 0) == (ssize_t)maxdgram / 2);
tests/sys/kern/unix_dgram.c
144
ATF_REQUIRE(recv(fd[1], buf, maxdgram, 0) == -1);
tests/sys/kern/unix_dgram.c
149
ATF_REQUIRE(recv(fd[1], buf, maxdgram, MSG_DONTWAIT) == -1);
tests/sys/kern/unix_dgram.c
153
ATF_REQUIRE(fcntl(fd[1], F_SETFL, O_NONBLOCK) != -1);
tests/sys/kern/unix_dgram.c
154
ATF_REQUIRE(recv(fd[1], buf, maxdgram, 0) == -1);
tests/sys/kern/unix_dgram.c
158
fill(fd[0], buf, maxdgram);
tests/sys/kern/unix_dgram.c
159
ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1);
tests/sys/kern/unix_dgram.c
166
ATF_REQUIRE(fcntl(fd[0], F_SETFL, O_NONBLOCK) != -1);
tests/sys/kern/unix_dgram.c
167
ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1);
tests/sys/kern/unix_dgram.c
171
close(fd[1]);
tests/sys/kern/unix_dgram.c
172
ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1);
tests/sys/kern/unix_dgram.c
287
test42(int fd)
tests/sys/kern/unix_dgram.c
293
ATF_REQUIRE(ioctl(fd, FIONREAD, &data) != -1);
tests/sys/kern/unix_dgram.c
300
FD_SET(fd, &rfds);
tests/sys/kern/unix_dgram.c
301
ATF_REQUIRE(select(fd + 1, &rfds, NULL, NULL, NULL) == 1);
tests/sys/kern/unix_dgram.c
302
ATF_REQUIRE(FD_ISSET(fd, &rfds));
tests/sys/kern/unix_dgram.c
309
EV_SET(&ev, fd, EVFILT_READ, EV_ADD, NOTE_LOWAT, 41, NULL);
tests/sys/kern/unix_dgram.c
319
.aio_fildes = fd,
tests/sys/kern/unix_dgram.c
335
int fd[2];
tests/sys/kern/unix_dgram.c
354
ATF_REQUIRE(socketpair(PF_UNIX, SOCK_DGRAM, 0, fd) != -1);
tests/sys/kern/unix_dgram.c
355
ATF_REQUIRE(sendmsg(fd[0], &msghdr, 0) == 42);
tests/sys/kern/unix_dgram.c
356
test42(fd[1]);
tests/sys/kern/unix_dgram.c
357
close(fd[0]);
tests/sys/kern/unix_dgram.c
358
close(fd[1]);
tests/sys/kern/unix_dgram.c
361
ATF_REQUIRE((fd[0] = socket(PF_UNIX, SOCK_DGRAM, 0)) > 0);
tests/sys/kern/unix_dgram.c
362
ATF_REQUIRE((fd[1] = socket(PF_UNIX, SOCK_DGRAM, 0)) > 0);
tests/sys/kern/unix_dgram.c
363
ATF_REQUIRE(bind(fd[0], (struct sockaddr *)&sun, sizeof(sun)) == 0);
tests/sys/kern/unix_dgram.c
364
ATF_REQUIRE(sendto(fd[1], buf, 42, 0, (struct sockaddr *)&sun,
tests/sys/kern/unix_dgram.c
366
test42(fd[0]);
tests/sys/kern/unix_dgram.c
75
fill(int fd, void *buf, ssize_t len)
tests/sys/kern/unix_dgram.c
86
ATF_REQUIRE(send(fd, buf, len, 0) == len);
tests/sys/kern/unix_dgram.c
96
int fd[2];
tests/sys/kern/unix_passfd_test.c
1000
send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2);
tests/sys/kern/unix_passfd_test.c
1001
recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC);
tests/sys/kern/unix_passfd_test.c
101
*fdp = fd;
tests/sys/kern/unix_passfd_test.c
1015
send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2);
tests/sys/kern/unix_passfd_test.c
1016
recv_cmsg(fd[1], message, CMSG_SPACE(0), MSG_CTRUNC);
tests/sys/kern/unix_passfd_test.c
1029
send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2);
tests/sys/kern/unix_passfd_test.c
1030
recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)) + CMSG_SPACE(0),
tests/sys/kern/unix_passfd_test.c
1044
send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int) * 3));
tests/sys/kern/unix_passfd_test.c
1045
recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC);
tests/sys/kern/unix_passfd_test.c
105
dofstat(int fd, struct stat *sb)
tests/sys/kern/unix_passfd_test.c
1050
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1065
int fd[2], error, nfds, putfd;
tests/sys/kern/unix_passfd_test.c
1068
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1072
len = sendfd_payload(fd[0], putfd, buf, sizeof(buf));
tests/sys/kern/unix_passfd_test.c
108
ATF_REQUIRE_MSG(fstat(fd, sb) == 0,
tests/sys/kern/unix_passfd_test.c
1084
len = recvmsg(fd[1], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1094
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1108
int error, fd[2], putfd;
tests/sys/kern/unix_passfd_test.c
1110
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1132
len = sendmsg(fd[0], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1148
len = sendmsg(fd[0], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1152
len = recvmsg(fd[1], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1174
len = sendmsg(fd[0], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1178
len = recvmsg(fd[1], &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
1198
int fd[2], putfd, getfd;
tests/sys/kern/unix_passfd_test.c
1202
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1206
ATF_REQUIRE(sendfd_payload(fd[0], putfd, buf, 1) == 1);
tests/sys/kern/unix_passfd_test.c
1209
rlen = recvfd_payload(fd[1], &getfd, buf, 2,
tests/sys/kern/unix_passfd_test.c
1215
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1280
int dfd, dfd2, error, fd;
tests/sys/kern/unix_passfd_test.c
1304
fd = openat(dfd, "../c", O_RDONLY | O_DIRECTORY);
tests/sys/kern/unix_passfd_test.c
1305
if (fd >= 0)
tests/sys/kern/unix_passfd_test.c
1311
fd = openat(dfd, "c", O_RDONLY | O_DIRECTORY);
tests/sys/kern/unix_passfd_test.c
1312
if (fd < 0)
tests/sys/kern/unix_passfd_test.c
1354
int fd[2], getfd, putfd, fdflags;
tests/sys/kern/unix_passfd_test.c
1356
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
1364
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
1365
recvfd(fd[1], &getfd, 0);
tests/sys/kern/unix_passfd_test.c
1374
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
141
putfds(char *buf, int fd, int nfds)
tests/sys/kern/unix_passfd_test.c
151
*fdp++ = fd;
tests/sys/kern/unix_passfd_test.c
332
fill(int fd)
tests/sys/kern/unix_passfd_test.c
340
ATF_REQUIRE_MSG(fcntl(fd, F_SETFL, O_NONBLOCK) != -1,
tests/sys/kern/unix_passfd_test.c
344
do {} while (send(fd, buf, sendspace, 0) == (ssize_t)sendspace);
tests/sys/kern/unix_passfd_test.c
351
ATF_REQUIRE(send(fd, buf, sendspace, 0) == (ssize_t)sendspace);
tests/sys/kern/unix_passfd_test.c
365
int fd[2], getfd, putfd;
tests/sys/kern/unix_passfd_test.c
367
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
370
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
371
recvfd(fd[1], &getfd, 0);
tests/sys/kern/unix_passfd_test.c
376
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
387
int fd[2], getfd, putfd;
tests/sys/kern/unix_passfd_test.c
389
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
392
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
393
recvfd(fd[1], &getfd, MSG_CMSG_CLOEXEC);
tests/sys/kern/unix_passfd_test.c
400
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
411
int fd[2], getfd, putfd;
tests/sys/kern/unix_passfd_test.c
413
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
416
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
417
recvfd(fd[1], &getfd, MSG_CMSG_CLOFORK);
tests/sys/kern/unix_passfd_test.c
424
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
435
int fd[2], getfd, putfd;
tests/sys/kern/unix_passfd_test.c
437
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
440
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
442
recvfd(fd[1], &getfd, 0);
tests/sys/kern/unix_passfd_test.c
446
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
456
int fd[2], putfd;
tests/sys/kern/unix_passfd_test.c
458
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
460
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
462
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
474
int fd[2], putfd, nfiles;
tests/sys/kern/unix_passfd_test.c
476
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
478
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
482
shutdown(fd[1], SHUT_RD);
tests/sys/kern/unix_passfd_test.c
484
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
501
int fd[2], nfds;
tests/sys/kern/unix_passfd_test.c
504
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
517
putfds(cmsg, fd[0], MAXFDS + 1);
tests/sys/kern/unix_passfd_test.c
518
ATF_REQUIRE(sendmsg(fd[0], &msghdr, 0) == -1);
tests/sys/kern/unix_passfd_test.c
522
putfds(cmsg, fd[0], MAXFDS);
tests/sys/kern/unix_passfd_test.c
524
ATF_REQUIRE(sendmsg(fd[0], &msghdr, 0) == 1);
tests/sys/kern/unix_passfd_test.c
526
ATF_REQUIRE(recvmsg(fd[1], &msghdr, 0) == 1);
tests/sys/kern/unix_passfd_test.c
535
putfds(cmsg, fd[0], 1);
tests/sys/kern/unix_passfd_test.c
537
ATF_REQUIRE(sendmsg(fd[0], &msghdr, 0) == 1);
tests/sys/kern/unix_passfd_test.c
538
ATF_REQUIRE(recvmsg(fd[1], &msghdr, 0) == -1);
tests/sys/kern/unix_passfd_test.c
549
ATF_REQUIRE(recvmsg(fd[1], &msghdr, 0) == 1);
tests/sys/kern/unix_passfd_test.c
558
ATF_REQUIRE(recvmsg(fd[1], &msghdr, MSG_DONTWAIT) == -1);
tests/sys/kern/unix_passfd_test.c
573
int fd[2], putfd, nfiles;
tests/sys/kern/unix_passfd_test.c
579
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
580
fill(fd[0]);
tests/sys/kern/unix_passfd_test.c
583
len = sendfd_payload(fd[0], putfd, buf, sendspace);
tests/sys/kern/unix_passfd_test.c
593
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
600
int fd[2], optval, putfd, rc;
tests/sys/kern/unix_passfd_test.c
603
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
604
ATF_REQUIRE_MSG(passrights(fd[0]),
tests/sys/kern/unix_passfd_test.c
606
ATF_REQUIRE_MSG(passrights(fd[1]),
tests/sys/kern/unix_passfd_test.c
613
rc = setsockopt(fd[1], SOL_SOCKET, SO_PASSRIGHTS, &optval,
tests/sys/kern/unix_passfd_test.c
618
ATF_REQUIRE_MSG(passrights(fd[0]),
tests/sys/kern/unix_passfd_test.c
621
ATF_REQUIRE_MSG(!passrights(fd[1]),
tests/sys/kern/unix_passfd_test.c
625
len = sendfd_payload(fd[0], putfd, &ch, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
630
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
640
int fd[2], nfds, optval, putfd, rc;
tests/sys/kern/unix_passfd_test.c
644
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
650
len = sendfd_payload(fd[0], putfd, &ch, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
659
rc = setsockopt(fd[1], SOL_SOCKET, SO_PASSRIGHTS, &optval,
tests/sys/kern/unix_passfd_test.c
669
len = recvfd_payload_cmsg(fd[1], &ch, sizeof(ch), &msghdr, 0);
tests/sys/kern/unix_passfd_test.c
679
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
736
int fd[2], getfd, putfd, nfds;
tests/sys/kern/unix_passfd_test.c
738
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
741
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
757
ATF_REQUIRE(1 == recvmsg(fd[1], &msghdr, MSG_PEEK));
tests/sys/kern/unix_passfd_test.c
769
recvfd(fd[1], &getfd, 0);
tests/sys/kern/unix_passfd_test.c
773
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
784
int fd[2], getfd_1, getfd_2, putfd_1, putfd_2;
tests/sys/kern/unix_passfd_test.c
786
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
791
sendfd(fd[0], putfd_1);
tests/sys/kern/unix_passfd_test.c
792
sendfd(fd[0], putfd_2);
tests/sys/kern/unix_passfd_test.c
795
recvfd(fd[1], &getfd_1, 0);
tests/sys/kern/unix_passfd_test.c
796
recvfd(fd[1], &getfd_2, 0);
tests/sys/kern/unix_passfd_test.c
803
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
813
int fd[2], getfd;
tests/sys/kern/unix_passfd_test.c
815
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
817
sendfd(fd[0], fd[0]);
tests/sys/kern/unix_passfd_test.c
818
close(fd[0]);
tests/sys/kern/unix_passfd_test.c
819
recvfd(fd[1], &getfd, 0);
tests/sys/kern/unix_passfd_test.c
821
close(fd[1]);
tests/sys/kern/unix_passfd_test.c
83
int fd;
tests/sys/kern/unix_passfd_test.c
831
int fd[2];
tests/sys/kern/unix_passfd_test.c
833
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
834
sendfd(fd[0], fd[0]);
tests/sys/kern/unix_passfd_test.c
835
sendfd(fd[1], fd[0]);
tests/sys/kern/unix_passfd_test.c
836
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
846
int fd[2], putfd;
tests/sys/kern/unix_passfd_test.c
848
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
85
fd = open("/dev/null", O_RDONLY);
tests/sys/kern/unix_passfd_test.c
850
sendfd(fd[0], putfd);
tests/sys/kern/unix_passfd_test.c
852
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
86
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
tests/sys/kern/unix_passfd_test.c
868
int fd[2], getfd, putfd, rc;
tests/sys/kern/unix_passfd_test.c
87
*fdp = fd;
tests/sys/kern/unix_passfd_test.c
874
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
877
rc = fcntl(fd[0], F_SETFL, O_NONBLOCK);
tests/sys/kern/unix_passfd_test.c
880
rc = setsockopt(fd[1], 0, LOCAL_CREDS, &on, sizeof(on));
tests/sys/kern/unix_passfd_test.c
884
len = sendfd_payload(fd[0], putfd, buf, sendspace);
tests/sys/kern/unix_passfd_test.c
903
rlen = recvfd_payload(fd[1], &getfd, buf, len,
tests/sys/kern/unix_passfd_test.c
910
closesocketpair(fd);
tests/sys/kern/unix_passfd_test.c
94
int fd;
tests/sys/kern/unix_passfd_test.c
974
int fd[2], nfds, putfd, rc;
tests/sys/kern/unix_passfd_test.c
976
domainsocketpair(fd);
tests/sys/kern/unix_passfd_test.c
98
fd = mkstemp(path);
tests/sys/kern/unix_passfd_test.c
986
send_cmsg(fd[0], message, CMSG_LEN(sizeof(int)));
tests/sys/kern/unix_passfd_test.c
987
recv_cmsg(fd[1], message, CMSG_LEN(0), MSG_CTRUNC);
tests/sys/kern/unix_passfd_test.c
99
ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path);
tests/sys/kern/unix_seqpacket_test.c
1230
int fd[2], eor;
tests/sys/kern/unix_seqpacket_test.c
1264
ATF_REQUIRE(socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, fd) == 0);
tests/sys/kern/unix_seqpacket_test.c
1265
params.sock = fd[0];
tests/sys/kern/unix_seqpacket_test.c
1283
len = recvmsg(fd[1], &hdr, waitall);
tests/sys/kern/unix_seqpacket_test.c
1326
int fd = *(int *)args;
tests/sys/kern/unix_seqpacket_test.c
1331
send(fd, buf, sizeof(buf), MSG_EOR));
tests/sys/kern/unix_seqpacket_test.c
1343
int fd = *(int *)args;
tests/sys/kern/unix_seqpacket_test.c
1348
while ((rcvd = recv(fd, buf, sizeof(buf),
tests/sys/kern/unix_seqpacket_test.c
1354
recv(fd, buf, sizeof(buf), 0));
tests/sys/kern/unix_stream.c
150
.fd = ctx->sv[0],
tests/sys/kqueue/libkqueue/main.c
219
kevent_add(int fd, struct kevent *kev,
tests/sys/kqueue/libkqueue/main.c
230
if (kevent(fd, kev, 1, NULL, 0, NULL) < 0) {
tests/sys/kqueue/libkqueue/main.c
71
kevent_get(int fd)
tests/sys/kqueue/libkqueue/main.c
79
nfds = kevent(fd, NULL, 0, kev, 1, NULL);
tests/sys/kqueue/libkqueue/main.c
88
kevent_get_timeout(int fd, int seconds)
tests/sys/kqueue/libkqueue/main.c
97
nfds = kevent(fd, NULL, 0, kev, 1, &timeout);
tests/sys/kqueue/libkqueue/vnode.c
102
fd = open(fifo_path, O_WRONLY);
tests/sys/kqueue/libkqueue/vnode.c
103
if (fd < 0) {
tests/sys/kqueue/libkqueue/vnode.c
108
EV_SET(&kev, fd, EVFILT_VNODE, EV_ADD | EV_ONESHOT, NOTE_DELETE, 0, NULL);
tests/sys/kqueue/libkqueue/vnode.c
118
close(fd);
tests/sys/kqueue/libkqueue/vnode.c
71
int fd;
tests/sys/kqueue/libkqueue/vnode.c
86
fd = open(fifo_path, O_RDONLY);
tests/sys/kqueue/libkqueue/vnode.c
87
if (fd == -1)
tests/sys/kqueue/libkqueue/vnode.c
90
while (read(fd, buf, sizeof(buf)) != 0) {
tests/sys/net/if_ovpn/if_ovpn_c.c
37
create_interface(int fd)
tests/sys/net/if_ovpn/if_ovpn_c.c
46
ret = ioctl(fd, SIOCIFCREATE2, &ifr);
tests/sys/net/if_ovpn/if_ovpn_c.c
57
destroy_interface(int fd)
tests/sys/net/if_ovpn/if_ovpn_c.c
70
ret = ioctl(fd, SIOCIFDESTROY, &ifr);
tests/sys/net/routing/rtsock_common.h
192
int fd = open(path, O_RDWR|O_EXCL);
tests/sys/net/routing/rtsock_common.h
193
if (fd == -1) {
tests/sys/net/routing/rtsock_common.h
198
return (fd);
tests/sys/net/routing/rtsock_common.h
639
int fd;
tests/sys/net/routing/rtsock_common.h
641
fd = socket(PF_ROUTE, SOCK_RAW, af);
tests/sys/net/routing/rtsock_common.h
643
ATF_REQUIRE_MSG(fd != -1, "rtsock open failed: %s", strerror(errno));
tests/sys/net/routing/rtsock_common.h
647
if (setsockopt(fd, SOL_SOCKET,SO_USELOOPBACK, &on, sizeof(on)) < 0)
tests/sys/net/routing/rtsock_common.h
650
return (fd);
tests/sys/net/routing/rtsock_common.h
654
rtsock_send_rtm(int fd, struct rt_msghdr *rtm)
tests/sys/net/routing/rtsock_common.h
661
len = write(fd, rtm, rtm->rtm_msglen);
tests/sys/net/routing/rtsock_common.h
671
rtsock_read_rtm(int fd, char *buffer, size_t buflen)
tests/sys/net/routing/rtsock_common.h
679
pfd.fd = fd;
tests/sys/net/routing/rtsock_common.h
686
len = read(fd, buffer, buflen);
tests/sys/net/routing/rtsock_common.h
695
rtsock_read_rtm_reply(int fd, char *buffer, size_t buflen, int seq)
tests/sys/net/routing/rtsock_common.h
701
rtm = rtsock_read_rtm(fd, buffer, buflen);
tests/sys/netinet/ip6_v4mapped_test.c
116
fd = open(SYSCTLBAKFILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,
tests/sys/netinet/ip6_v4mapped_test.c
118
if (fd < 0) {
tests/sys/netinet/ip6_v4mapped_test.c
122
error = write(fd, &save_ports, sizeof(save_ports));
tests/sys/netinet/ip6_v4mapped_test.c
133
error = close(fd);
tests/sys/netinet/ip6_v4mapped_test.c
137
(void)close(fd);
tests/sys/netinet/ip6_v4mapped_test.c
156
int error, fd;
tests/sys/netinet/ip6_v4mapped_test.c
160
fd = open(SYSCTLBAKFILE, O_RDONLY);
tests/sys/netinet/ip6_v4mapped_test.c
161
if (fd < 0) {
tests/sys/netinet/ip6_v4mapped_test.c
165
error = read(fd, &save_ports, sizeof(save_ports));
tests/sys/netinet/ip6_v4mapped_test.c
176
error = close(fd);
tests/sys/netinet/ip6_v4mapped_test.c
69
int error, fd, first_new, last_new;
tests/sys/netinet/ip_reass_test.c
147
int error, fd;
tests/sys/netinet/ip_reass_test.c
149
fd = open("/dev/bpf0", O_RDWR);
tests/sys/netinet/ip_reass_test.c
150
if (fd < 0 && errno == ENOENT)
tests/sys/netinet/ip_reass_test.c
152
ATF_REQUIRE_MSG(fd >= 0, "open(/dev/bpf0): %s", strerror(errno));
tests/sys/netinet/ip_reass_test.c
165
error = ioctl(fd, BIOCSETIF, &ifr);
tests/sys/netinet/ip_reass_test.c
172
return (fd);
tests/sys/netinet/ip_reass_test.c
210
int error, fd;
tests/sys/netinet/ip_reass_test.c
213
fd = open_lobpf(&addr);
tests/sys/netinet/ip_reass_test.c
240
write_lopacket(fd, packet1);
tests/sys/netinet/ip_reass_test.c
244
write_lopacket(fd, packet2);
tests/sys/netinet/ip_reass_test.c
252
write_lopacket(fd, packet2);
tests/sys/netinet/ip_reass_test.c
258
write_lopacket(fd, packet3);
tests/sys/netinet/ip_reass_test.c
264
write_lopacket(fd, packet4);
tests/sys/netinet/ip_reass_test.c
268
error = close(fd);
tests/sys/netinet/ip_reass_test.c
290
int error, fd;
tests/sys/netinet/ip_reass_test.c
293
fd = open_lobpf(&addr);
tests/sys/netinet/ip_reass_test.c
312
write_lopacket(fd, packet1);
tests/sys/netinet/ip_reass_test.c
318
write_lopacket(fd, packet2);
tests/sys/netinet/ip_reass_test.c
323
error = close(fd);
tests/sys/netinet/ip_reass_test.c
340
int error, fd;
tests/sys/netinet/ip_reass_test.c
343
fd = open_lobpf(&addr);
tests/sys/netinet/ip_reass_test.c
364
write_lopacket(fd, packet1);
tests/sys/netinet/ip_reass_test.c
370
write_lopacket(fd, packet2);
tests/sys/netinet/ip_reass_test.c
375
error = close(fd);
tests/sys/netinet/socket_afinet.c
134
pfd.fd = ss2;
tests/sys/netinet/socket_afinet.c
149
pfd.fd = ss2;
tests/sys/netinet/socket_afinet.c
198
pfd.fd = ss2;
tests/sys/netinet/socket_afinet.c
211
pfd.fd = ss2;
tests/sys/netinet/socket_afinet.c
232
pfd.fd = ss2;
tests/sys/netinet/tcp_connect_port_test.c
101
error = close(fd);
tests/sys/netinet/tcp_connect_port_test.c
105
(void)close(fd);
tests/sys/netinet/tcp_connect_port_test.c
120
int error, fd, random_save;
tests/sys/netinet/tcp_connect_port_test.c
123
fd = open(SYSCTLBAKFILE, O_RDONLY);
tests/sys/netinet/tcp_connect_port_test.c
124
if (fd < 0) {
tests/sys/netinet/tcp_connect_port_test.c
128
error = read(fd, &random_save, sizeof(random_save));
tests/sys/netinet/tcp_connect_port_test.c
139
error = close(fd);
tests/sys/netinet/tcp_connect_port_test.c
54
int error, fd, random_new, random_save;
tests/sys/netinet/tcp_connect_port_test.c
84
fd = open(SYSCTLBAKFILE, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,
tests/sys/netinet/tcp_connect_port_test.c
86
if (fd < 0) {
tests/sys/netinet/tcp_connect_port_test.c
90
error = write(fd, &random_save, sizeof(random_save));
tests/sys/netlink/netlink_socket.c
104
rv = send(fd, &hdr, sizeof(hdr), MSG_DONTWAIT);
tests/sys/netlink/netlink_socket.c
111
ATF_REQUIRE(ioctl(fd, FIONREAD, &recvavail) != -1);
tests/sys/netlink/netlink_socket.c
112
ATF_REQUIRE(ioctl(fd, FIONWRITE, &sendavail) != -1);
tests/sys/netlink/netlink_socket.c
116
return (fd);
tests/sys/netlink/netlink_socket.c
127
int fd;
tests/sys/netlink/netlink_socket.c
129
fd = fullsocket();
tests/sys/netlink/netlink_socket.c
135
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == -1);
tests/sys/netlink/netlink_socket.c
143
ATF_REQUIRE(recv(fd, buf, BUFLEN, 0) > sizeof(hdr));
tests/sys/netlink/netlink_socket.c
146
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
159
int fd;
tests/sys/netlink/netlink_socket.c
161
ATF_REQUIRE((fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1);
tests/sys/netlink/netlink_socket.c
163
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
164
ss = recv(fd, buf, 0, MSG_WAITALL | MSG_PEEK | MSG_TRUNC);
tests/sys/netlink/netlink_socket.c
166
ATF_REQUIRE(recv(fd, buf, ss, MSG_WAITALL) == ss);
tests/sys/netlink/netlink_socket.c
214
int fd, size, msize, rsize;
tests/sys/netlink/netlink_socket.c
220
ATF_REQUIRE((fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1);
tests/sys/netlink/netlink_socket.c
221
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
222
ATF_REQUIRE(recv(fd, buf, sizeof(hdr), MSG_WAITALL | MSG_PEEK) ==
tests/sys/netlink/netlink_socket.c
224
ATF_REQUIRE(ioctl(fd, FIONREAD, &msize) != -1);
tests/sys/netlink/netlink_socket.c
226
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
228
ATF_REQUIRE(ioctl(fd, FIONREAD, &rsize) != -1);
tests/sys/netlink/netlink_socket.c
235
ATF_REQUIRE(setsockopt(fd, SOL_NETLINK, NETLINK_MSG_INFO,
tests/sys/netlink/netlink_socket.c
243
ss = recvmsg(fd, &msg, MSG_WAITALL | MSG_PEEK | MSG_TRUNC);
tests/sys/netlink/netlink_socket.c
246
ATF_REQUIRE(ioctl(fd, FIONREAD, &rsize) != -1);
tests/sys/netlink/netlink_socket.c
250
ATF_REQUIRE(recv(fd, buf, 0, 0) == 0);
tests/sys/netlink/netlink_socket.c
251
ATF_REQUIRE(ioctl(fd, FIONREAD, &size) != -1);
tests/sys/netlink/netlink_socket.c
264
ATF_REQUIRE(recvmsg(fd, &msg, 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
268
ATF_REQUIRE(ioctl(fd, FIONREAD, &rsize) != -1);
tests/sys/netlink/netlink_socket.c
279
ss = recvmsg(fd, &msg, 0);
tests/sys/netlink/netlink_socket.c
333
int fd;
tests/sys/netlink/netlink_socket.c
335
ATF_REQUIRE((fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1);
tests/sys/netlink/netlink_socket.c
336
ATF_REQUIRE(setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
tests/sys/netlink/netlink_socket.c
339
ATF_REQUIRE(send(fd, &msg, sizeof(msg), 0) == sizeof(msg));
tests/sys/netlink/netlink_socket.c
340
ATF_REQUIRE(recv(fd, &reply, sizeof(reply), 0) == sizeof(reply));
tests/sys/netlink/netlink_socket.c
350
ATF_REQUIRE(send(fd, &msg, msg.hdr.nlmsg_len, 0) == msg.hdr.nlmsg_len);
tests/sys/netlink/netlink_socket.c
351
ATF_REQUIRE(recv(fd, &reply, sizeof(reply), 0) == sizeof(reply));
tests/sys/netlink/netlink_socket.c
76
int fd, sendspace, recvspace, sendavail, recvavail, rsize;
tests/sys/netlink/netlink_socket.c
79
ATF_REQUIRE((fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1);
tests/sys/netlink/netlink_socket.c
80
ATF_REQUIRE(getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sendspace,
tests/sys/netlink/netlink_socket.c
82
ATF_REQUIRE(getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &recvspace,
tests/sys/netlink/netlink_socket.c
86
ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
tests/sys/netlink/netlink_socket.c
87
ATF_REQUIRE(recv(fd, buf, sizeof(hdr), MSG_WAITALL | MSG_PEEK) ==
tests/sys/netlink/netlink_socket.c
89
ATF_REQUIRE(ioctl(fd, FIONREAD, &rsize) != -1);
tests/sys/netlink/test_snl.c
109
ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_CAP_ACK, &optval, sizeof(optval)) == 0);
tests/sys/netlink/test_snl.c
111
ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_EXT_ACK, &optval, sizeof(optval)) == 0);
tests/sys/netlink/test_snl.c
150
ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_EXT_ACK, &optval, sizeof(optval)) == 0);
tests/sys/netlink/test_snl.c
68
ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_CAP_ACK, &optval, sizeof(optval)) == 0);
tests/sys/netlink/test_snl.c
71
ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_EXT_ACK, &optval, sizeof(optval)) == 0);
tests/sys/netmap/ctrl-api-test.c
1339
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
1363
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
1566
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
164
int fd; /* netmap file descriptor */
tests/sys/netmap/ctrl-api-test.c
1763
ret = ioctl(ctx->fd, NIOCTXSYNC, 0);
tests/sys/netmap/ctrl-api-test.c
204
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
2117
close(ctx->fd);
tests/sys/netmap/ctrl-api-test.c
2118
ctx->fd = -1;
tests/sys/netmap/ctrl-api-test.c
2304
int fd;
tests/sys/netmap/ctrl-api-test.c
2306
fd = open("/dev/netmap", O_RDWR);
tests/sys/netmap/ctrl-api-test.c
2307
if (fd < 0) {
tests/sys/netmap/ctrl-api-test.c
2309
ret = fd;
tests/sys/netmap/ctrl-api-test.c
2313
ctxcopy.fd = fd;
tests/sys/netmap/ctrl-api-test.c
262
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
335
ret = ioctl(ctx->fd, NIOCREGIF, &req);
tests/sys/netmap/ctrl-api-test.c
565
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
595
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
640
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
653
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
718
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
730
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
756
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
879
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netmap/ctrl-api-test.c
910
ret = ioctl(ctx->fd, NIOCCTRL, &hdr);
tests/sys/netpfil/common/divapp.c
102
n = sendto(c->fd, c->pkt, c->pkt_n, 0,
tests/sys/netpfil/common/divapp.c
47
int fd;
tests/sys/netpfil/common/divapp.c
57
c->fd = socket(PF_DIVERT, SOCK_RAW, 0);
tests/sys/netpfil/common/divapp.c
58
if (c->fd == -1)
tests/sys/netpfil/common/divapp.c
67
if (bind(c->fd, (struct sockaddr *) &c->sin, c->sin_len) != 0)
tests/sys/netpfil/common/divapp.c
79
FD_SET(c->fd, &readfds);
tests/sys/netpfil/common/divapp.c
83
s = select(c->fd + 1, &readfds, 0, 0, &timeout);
tests/sys/netpfil/common/divapp.c
89
c->pkt_n = recvfrom(c->fd, c->pkt, sizeof(c->pkt), 0,
tests/sys/opencrypto/blake2_test.c
108
ATF_REQUIRE_MSG(ioctl(fd, CIOCGSESSION2, &sop) >= 0,
tests/sys/opencrypto/blake2_test.c
115
do_cryptop(int fd, int ses, size_t inlen, void *out)
tests/sys/opencrypto/blake2_test.c
125
ATF_CHECK_MSG(ioctl(fd, CIOCCRYPT, &cop) >= 0, "ioctl(CIOCCRYPT)");
tests/sys/opencrypto/blake2_test.c
132
int crid, fd, ses;
tests/sys/opencrypto/blake2_test.c
136
fd = get_handle_fd();
tests/sys/opencrypto/blake2_test.c
137
crid = lookup_crid(fd, devname);
tests/sys/opencrypto/blake2_test.c
138
ses = create_session(fd, CRYPTO_BLAKE2B, crid, key2b, sizeof(key2b));
tests/sys/opencrypto/blake2_test.c
141
do_cryptop(fd, ses, i, hash);
tests/sys/opencrypto/blake2_test.c
153
int crid, fd, ses;
tests/sys/opencrypto/blake2_test.c
157
fd = get_handle_fd();
tests/sys/opencrypto/blake2_test.c
158
crid = lookup_crid(fd, devname);
tests/sys/opencrypto/blake2_test.c
159
ses = create_session(fd, CRYPTO_BLAKE2S, crid, key2s, sizeof(key2s));
tests/sys/opencrypto/blake2_test.c
162
do_cryptop(fd, ses, i, hash);
tests/sys/opencrypto/blake2_test.c
76
lookup_crid(int fd, const char *devname)
tests/sys/opencrypto/blake2_test.c
82
ATF_REQUIRE(ioctl(fd, CIOCFINDDEV, &find) != -1);
tests/sys/opencrypto/blake2_test.c
89
int fd;
tests/sys/opencrypto/blake2_test.c
91
fd = open("/dev/crypto", O_RDWR);
tests/sys/opencrypto/blake2_test.c
92
ATF_REQUIRE(fd >= 0);
tests/sys/opencrypto/blake2_test.c
93
return (fd);
tests/sys/opencrypto/blake2_test.c
97
create_session(int fd, int alg, int crid, const void *key, size_t klen)
tests/sys/opencrypto/poly1305_test.c
303
int fd;
tests/sys/opencrypto/poly1305_test.c
305
fd = open("/dev/crypto", O_RDWR);
tests/sys/opencrypto/poly1305_test.c
306
ATF_REQUIRE(fd >= 0);
tests/sys/opencrypto/poly1305_test.c
307
return (fd);
tests/sys/opencrypto/poly1305_test.c
311
create_session(int fd, int alg, int crid, const void *key, size_t klen)
tests/sys/opencrypto/poly1305_test.c
322
ATF_REQUIRE_MSG(ioctl(fd, CIOCGSESSION2, &sop) >= 0,
tests/sys/opencrypto/poly1305_test.c
329
destroy_session(int fd, int _ses)
tests/sys/opencrypto/poly1305_test.c
334
ATF_REQUIRE_MSG(ioctl(fd, CIOCFSESSION, &ses) >= 0,
tests/sys/opencrypto/poly1305_test.c
339
do_cryptop(int fd, int ses, const void *inp, size_t inlen, void *out)
tests/sys/opencrypto/poly1305_test.c
349
ATF_CHECK_MSG(ioctl(fd, CIOCCRYPT, &cop) >= 0, "ioctl(CIOCCRYPT)");
tests/sys/opencrypto/poly1305_test.c
357
int fd, ses;
tests/sys/opencrypto/poly1305_test.c
360
fd = get_handle_fd();
tests/sys/opencrypto/poly1305_test.c
368
ses = create_session(fd, CRYPTO_POLY1305, crid, key, sizeof(key));
tests/sys/opencrypto/poly1305_test.c
370
do_cryptop(fd, ses, msg, kat->test_msg_len, comptag);
tests/sys/opencrypto/poly1305_test.c
374
destroy_session(fd, ses);
tests/sys/posixshm/memfd_test.c
102
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
103
ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0);
tests/sys/posixshm/memfd_test.c
106
ATF_REQUIRE(write(fd, buf, BUF_SIZE) == BUF_SIZE);
tests/sys/posixshm/memfd_test.c
107
ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
tests/sys/posixshm/memfd_test.c
109
addr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0);
tests/sys/posixshm/memfd_test.c
113
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == 0);
tests/sys/posixshm/memfd_test.c
115
ATF_REQUIRE(write(fd, buf, BUF_SIZE) == -1);
tests/sys/posixshm/memfd_test.c
119
fd, 0) == MAP_FAILED);
tests/sys/posixshm/memfd_test.c
122
close(fd);
tests/sys/posixshm/memfd_test.c
128
int fd;
tests/sys/posixshm/memfd_test.c
131
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
132
ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0);
tests/sys/posixshm/memfd_test.c
135
addr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
tests/sys/posixshm/memfd_test.c
137
paddr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0);
tests/sys/posixshm/memfd_test.c
139
raddr = mmap(0, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/posixshm/memfd_test.c
143
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1);
tests/sys/posixshm/memfd_test.c
152
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1);
tests/sys/posixshm/memfd_test.c
157
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == 0);
tests/sys/posixshm/memfd_test.c
161
fd, 0) == MAP_FAILED);
tests/sys/posixshm/memfd_test.c
165
paddr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0);
tests/sys/posixshm/memfd_test.c
167
raddr = mmap(0, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/posixshm/memfd_test.c
172
close(fd);
tests/sys/posixshm/memfd_test.c
178
int err, fd;
tests/sys/posixshm/memfd_test.c
180
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
181
ATF_REQUIRE(ftruncate(fd, initial_size) == 0);
tests/sys/posixshm/memfd_test.c
183
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, seals) == 0);
tests/sys/posixshm/memfd_test.c
185
err = ftruncate(fd, dest_size);
tests/sys/posixshm/memfd_test.c
188
close(fd);
tests/sys/posixshm/memfd_test.c
212
int fd;
tests/sys/posixshm/memfd_test.c
215
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
216
ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == 0);
tests/sys/posixshm/memfd_test.c
218
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE | F_SEAL_GROW) == 0);
tests/sys/posixshm/memfd_test.c
219
seals = fcntl(fd, F_GET_SEALS);
tests/sys/posixshm/memfd_test.c
222
close(fd);
tests/sys/posixshm/memfd_test.c
229
int fd, fdx;
tests/sys/posixshm/memfd_test.c
232
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
233
ATF_REQUIRE((fdx = dup(fd)) != -1);
tests/sys/posixshm/memfd_test.c
234
ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == 0);
tests/sys/posixshm/memfd_test.c
236
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE | F_SEAL_GROW) == 0);
tests/sys/posixshm/memfd_test.c
237
seals = fcntl(fd, F_GET_SEALS);
tests/sys/posixshm/memfd_test.c
251
close(fd);
tests/sys/posixshm/memfd_test.c
258
int fd;
tests/sys/posixshm/memfd_test.c
260
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
262
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_SEAL) == 0);
tests/sys/posixshm/memfd_test.c
263
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW) == -1);
tests/sys/posixshm/memfd_test.c
267
close(fd);
tests/sys/posixshm/memfd_test.c
273
ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1);
tests/sys/posixshm/memfd_test.c
275
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW | F_SEAL_SEAL) == 0);
tests/sys/posixshm/memfd_test.c
276
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW) == -1);
tests/sys/posixshm/memfd_test.c
279
close(fd);
tests/sys/posixshm/memfd_test.c
286
int fd, pscnt;
tests/sys/posixshm/memfd_test.c
297
fd = memfd_create("...", MFD_HUGETLB | MFD_HUGE_FLAGS(pgsize));
tests/sys/posixshm/memfd_test.c
298
if (fd == -1 && errno == ENOTTY)
tests/sys/posixshm/memfd_test.c
301
ATF_REQUIRE_MSG(fd != -1,
tests/sys/posixshm/memfd_test.c
305
fd = memfd_create("...", MFD_HUGETLB);
tests/sys/posixshm/memfd_test.c
307
ATF_REQUIRE_MSG(fd == -1,
tests/sys/posixshm/memfd_test.c
311
ATF_REQUIRE_MSG(fd != -1,
tests/sys/posixshm/memfd_test.c
313
close(fd);
tests/sys/posixshm/memfd_test.c
43
int fd;
tests/sys/posixshm/memfd_test.c
46
ATF_REQUIRE((fd = memfd_create("...", 0)) != -1);
tests/sys/posixshm/memfd_test.c
49
ATF_REQUIRE(write(fd, buf, sizeof(buf)) == sizeof(buf));
tests/sys/posixshm/memfd_test.c
50
ATF_REQUIRE(fstat(fd, &sb) == 0);
tests/sys/posixshm/memfd_test.c
54
ATF_REQUIRE(ftruncate(fd, 2 * (sizeof(buf) - 1)) == 0);
tests/sys/posixshm/memfd_test.c
57
ATF_REQUIRE(write(fd, buf, sizeof(buf)) == sizeof(buf));
tests/sys/posixshm/memfd_test.c
60
ATF_REQUIRE(fstat(fd, &sb) == 0);
tests/sys/posixshm/memfd_test.c
63
close(fd);
tests/sys/posixshm/memfd_test.c
84
int fd;
tests/sys/posixshm/memfd_test.c
86
ATF_REQUIRE((fd = memfd_create("...", 0)) != -1);
tests/sys/posixshm/memfd_test.c
87
ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == F_SEAL_SEAL);
tests/sys/posixshm/memfd_test.c
88
ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1);
tests/sys/posixshm/memfd_test.c
91
close(fd);
tests/sys/posixshm/memfd_test.c
99
int fd;
tests/sys/posixshm/posixshm_test.c
1008
int fd;
tests/sys/posixshm/posixshm_test.c
1013
fd = shm_open(SHM_ANON, O_RDWR, 0777);
tests/sys/posixshm/posixshm_test.c
1014
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1015
ATF_REQUIRE((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0);
tests/sys/posixshm/posixshm_test.c
1016
close(fd);
tests/sys/posixshm/posixshm_test.c
1019
fd = shm_open(test_path, O_CREAT | O_RDWR, 0600);
tests/sys/posixshm/posixshm_test.c
102
int fd;
tests/sys/posixshm/posixshm_test.c
1020
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1021
ATF_REQUIRE((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0);
tests/sys/posixshm/posixshm_test.c
1022
close(fd);
tests/sys/posixshm/posixshm_test.c
1029
int fd;
tests/sys/posixshm/posixshm_test.c
1036
fd = shm_open(test_path, O_CREAT | O_RDWR, 0600);
tests/sys/posixshm/posixshm_test.c
1037
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1038
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
104
fd = shm_open(path, flags, mode);
tests/sys/posixshm/posixshm_test.c
1040
close(fd);
tests/sys/posixshm/posixshm_test.c
1043
fd = shm_open(test_path, O_CREAT | O_RDWR, 0660);
tests/sys/posixshm/posixshm_test.c
1044
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1045
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1047
close(fd);
tests/sys/posixshm/posixshm_test.c
105
ATF_CHECK_MSG(fd == -1, "shm_open didn't fail");
tests/sys/posixshm/posixshm_test.c
1050
fd = shm_open(test_path, O_CREAT | O_RDWR, 0666);
tests/sys/posixshm/posixshm_test.c
1051
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1052
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1054
close(fd);
tests/sys/posixshm/posixshm_test.c
1064
int error, fd, sz;
tests/sys/posixshm/posixshm_test.c
1071
fd = shm_open(SHM_ANON, O_RDWR, 0666);
tests/sys/posixshm/posixshm_test.c
1072
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1075
ATF_REQUIRE(ftruncate(fd, sz) == 0);
tests/sys/posixshm/posixshm_test.c
1080
ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, sz)) == 0,
tests/sys/posixshm/posixshm_test.c
1082
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1085
ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, sz / 2)) == 0,
tests/sys/posixshm/posixshm_test.c
1087
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1090
ATF_REQUIRE_MSG((error = posix_fallocate(fd, sz, sz)) == 0,
tests/sys/posixshm/posixshm_test.c
1092
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1095
close(fd);
tests/sys/posixshm/posixshm_test.c
1104
int fd, error;
tests/sys/posixshm/posixshm_test.c
1109
fd = shm_open("/testtest", O_RDWR | O_CREAT, 0666);
tests/sys/posixshm/posixshm_test.c
1110
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno:%d", errno);
tests/sys/posixshm/posixshm_test.c
1111
ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, shm_sz)) == 0,
tests/sys/posixshm/posixshm_test.c
1115
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1119
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1121
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1125
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1129
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1131
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1135
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1138
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1140
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1144
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1147
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1149
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1153
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1156
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1158
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1162
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1165
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1167
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
tests/sys/posixshm/posixshm_test.c
1170
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1180
int fd, error;
tests/sys/posixshm/posixshm_test.c
1185
fd = shm_open("/testtest1", O_RDWR | O_CREAT, 0666);
tests/sys/posixshm/posixshm_test.c
1186
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno:%d", errno);
tests/sys/posixshm/posixshm_test.c
1187
ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, shm_sz)) == 0,
tests/sys/posixshm/posixshm_test.c
1190
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
tests/sys/posixshm/posixshm_test.c
1191
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1197
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
tests/sys/posixshm/posixshm_test.c
1199
ATF_REQUIRE(fstat(fd, &st) == 0);
tests/sys/posixshm/posixshm_test.c
1202
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1209
int fd, pagesize;
tests/sys/posixshm/posixshm_test.c
1214
fd = shm_open(test_path, O_RDONLY | O_CREAT, 0644);
tests/sys/posixshm/posixshm_test.c
1215
ATF_REQUIRE(fd >= 0);
tests/sys/posixshm/posixshm_test.c
1217
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1220
p = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1222
p = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
tests/sys/posixshm/posixshm_test.c
1228
ATF_REQUIRE_MSG(close(fd) == 0,
tests/sys/posixshm/posixshm_test.c
1235
int error, fd;
tests/sys/posixshm/posixshm_test.c
1237
fd = shm_create_largepage(SHM_ANON, O_CREAT | O_RDWR, psind, policy, 0);
tests/sys/posixshm/posixshm_test.c
1238
if (fd < 0 && errno == ENOTTY)
tests/sys/posixshm/posixshm_test.c
1240
ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
1242
error = ftruncate(fd, sz);
tests/sys/posixshm/posixshm_test.c
1251
return (fd);
tests/sys/posixshm/posixshm_test.c
1260
int error, fd, pscnt;
tests/sys/posixshm/posixshm_test.c
1266
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1268
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1302
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1316
int error, fd;
tests/sys/posixshm/posixshm_test.c
132
int fd, pagesize;
tests/sys/posixshm/posixshm_test.c
1320
fd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0);
tests/sys/posixshm/posixshm_test.c
1321
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
1329
error = ioctl(fd, FIOSSHMLPGCNF, &lpc);
tests/sys/posixshm/posixshm_test.c
1333
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1339
fd = __sys_shm_open2(SHM_ANON, O_CREAT | O_RDWR, 0, SHM_LARGEPAGE,
tests/sys/posixshm/posixshm_test.c
1341
if (fd < 0 && errno == ENOTTY)
tests/sys/posixshm/posixshm_test.c
1343
ATF_REQUIRE_MSG(fd >= 0, "shm_open2 failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
1345
error = ftruncate(fd, ps[1]);
tests/sys/posixshm/posixshm_test.c
1349
addr = mmap(NULL, ps[1], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1352
addr = mmap(NULL, 0, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1358
ATF_REQUIRE(write(fd, buf, ps[0]) == -1);
tests/sys/posixshm/posixshm_test.c
136
fd = shm_open(path, O_CREAT|O_EXCL|O_RDWR, 0777);
tests/sys/posixshm/posixshm_test.c
1363
ATF_REQUIRE(write(fd, buf, ps[1]) == -1);
tests/sys/posixshm/posixshm_test.c
1367
error = posix_fallocate(fd, 0, ps[0]);
tests/sys/posixshm/posixshm_test.c
137
if (fd < 0 && errno == EEXIST) {
tests/sys/posixshm/posixshm_test.c
1370
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1378
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
1383
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1388
fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == -1);
tests/sys/posixshm/posixshm_test.c
1390
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1399
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
140
fd = shm_open(test_path, O_CREAT | O_EXCL | O_RDWR, 0777);
tests/sys/posixshm/posixshm_test.c
1403
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1413
fd, 0);
tests/sys/posixshm/posixshm_test.c
142
if (fd < 0)
tests/sys/posixshm/posixshm_test.c
1422
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1439
MAP_SHARED | MAP_FIXED | MAP_EXCL, fd, 0);
tests/sys/posixshm/posixshm_test.c
144
if (ftruncate(fd, pagesize) < 0)
tests/sys/posixshm/posixshm_test.c
1447
MAP_SHARED | MAP_FIXED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1463
MAP_SHARED | MAP_FIXED, fd, 0);
tests/sys/posixshm/posixshm_test.c
147
page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1482
fd, 0);
tests/sys/posixshm/posixshm_test.c
1486
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1495
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
1499
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1502
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1522
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1546
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
155
return (fd);
tests/sys/posixshm/posixshm_test.c
1550
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1551
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1583
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1599
int fd, error, pscnt;
tests/sys/posixshm/posixshm_test.c
1624
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1625
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1643
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1649
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
165
int fd;
tests/sys/posixshm/posixshm_test.c
1658
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
1662
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1663
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1693
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
171
fd = shm_open(path, O_RDONLY, 0777);
tests/sys/posixshm/posixshm_test.c
1717
int fd, pscnt;
tests/sys/posixshm/posixshm_test.c
172
if (fd < 0)
tests/sys/posixshm/posixshm_test.c
1731
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1733
MAP_SHARED | MAP_FIXED, fd, 0);
tests/sys/posixshm/posixshm_test.c
176
page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
1765
MAP_SHARED | MAP_FIXED | MAP_EXCL, fd, 0);
tests/sys/posixshm/posixshm_test.c
1777
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
1787
int fd, pscnt, status;
tests/sys/posixshm/posixshm_test.c
1791
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1792
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1864
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
187
close(fd);
tests/sys/posixshm/posixshm_test.c
1874
int fd, pfd[2], pscnt, status;
tests/sys/posixshm/posixshm_test.c
1880
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
1881
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
1919
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
194
shm_fill(int fd, off_t offset, off_t len)
tests/sys/posixshm/posixshm_test.c
1992
int error, fd, pscnt;
tests/sys/posixshm/posixshm_test.c
2014
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
tests/sys/posixshm/posixshm_test.c
2015
addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/posixshm/posixshm_test.c
209
if (pwrite(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/posixshm/posixshm_test.c
2095
MAP_SHARED | MAP_FIXED, fd, 0);
tests/sys/posixshm/posixshm_test.c
2113
int fd, psind;
tests/sys/posixshm/posixshm_test.c
2119
fd = shm_create_largepage(test_path, O_CREAT | O_RDWR, psind,
tests/sys/posixshm/posixshm_test.c
2121
if (fd < 0 && errno == ENOTTY)
tests/sys/posixshm/posixshm_test.c
2123
ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2125
ATF_REQUIRE_MSG(ftruncate(fd, ps[psind]) == 0,
tests/sys/posixshm/posixshm_test.c
2128
ATF_REQUIRE_MSG(close(fd) == 0, "close failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2130
fd = shm_open(test_path, O_RDWR, 0);
tests/sys/posixshm/posixshm_test.c
2131
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2133
addr = mmap(NULL, ps[psind], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
2148
ATF_REQUIRE_MSG(close(fd) == 0,
tests/sys/posixshm/posixshm_test.c
2166
int error, fd, pscnt, sd[2], status;
tests/sys/posixshm/posixshm_test.c
2173
fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT,
tests/sys/posixshm/posixshm_test.c
2176
MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
2214
error = sendfile(fd, sd[0], 0, ps[i], NULL, &sbytes,
tests/sys/posixshm/posixshm_test.c
222
check_content_dealloc(int fd, off_t hole_start, off_t hole_len, off_t shm_sz)
tests/sys/posixshm/posixshm_test.c
2234
ATF_REQUIRE(close(fd) == 0);
tests/sys/posixshm/posixshm_test.c
2243
int fd, psind;
tests/sys/posixshm/posixshm_test.c
2249
fd = shm_create_largepage(test_path, O_CREAT | O_RDWR, psind,
tests/sys/posixshm/posixshm_test.c
2251
if (fd < 0 && errno == ENOTTY)
tests/sys/posixshm/posixshm_test.c
2253
ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2255
ATF_REQUIRE_MSG(ftruncate(fd, ps[psind]) == 0,
tests/sys/posixshm/posixshm_test.c
2258
ATF_REQUIRE_MSG(close(fd) == 0, "close failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2260
fd = shm_open(test_path, O_RDWR | O_TRUNC, 0);
tests/sys/posixshm/posixshm_test.c
2261
ATF_REQUIRE_MSG(fd == -1, "shm_open(O_TRUNC) should have failed");
tests/sys/posixshm/posixshm_test.c
2262
ATF_REQUIRE_ERRNO(ENOTSUP, fd == -1);
tests/sys/posixshm/posixshm_test.c
2264
fd = shm_open(test_path, O_RDWR, 0);
tests/sys/posixshm/posixshm_test.c
2265
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno);
tests/sys/posixshm/posixshm_test.c
2267
ATF_REQUIRE_MSG(ftruncate(fd, ps[psind]) == 0,
tests/sys/posixshm/posixshm_test.c
2272
ATF_REQUIRE_MSG(close(fd) == 0,
tests/sys/posixshm/posixshm_test.c
249
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/posixshm/posixshm_test.c
270
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/posixshm/posixshm_test.c
289
if (pread(fd, buf, blen, offset) != (ssize_t)blen) {
tests/sys/posixshm/posixshm_test.c
304
if (fstat(fd, &statbuf) == -1)
tests/sys/posixshm/posixshm_test.c
317
int fd, pagesize;
tests/sys/posixshm/posixshm_test.c
322
fd = scribble_object(test_path, '1');
tests/sys/posixshm/posixshm_test.c
324
page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
331
close(fd);
tests/sys/posixshm/posixshm_test.c
399
int fd;
tests/sys/posixshm/posixshm_test.c
406
fd = scribble_object(test_path, expected_value);
tests/sys/posixshm/posixshm_test.c
407
close(fd);
tests/sys/posixshm/posixshm_test.c
505
int fd;
tests/sys/posixshm/posixshm_test.c
511
fd = scribble_object(test_path, expected_value);
tests/sys/posixshm/posixshm_test.c
512
close(fd);
tests/sys/posixshm/posixshm_test.c
523
int fd;
tests/sys/posixshm/posixshm_test.c
529
fd = scribble_object(test_path, 'd');
tests/sys/posixshm/posixshm_test.c
530
close(fd);
tests/sys/posixshm/posixshm_test.c
531
fd = scribble_object(test_path2, 'd');
tests/sys/posixshm/posixshm_test.c
532
close(fd);
tests/sys/posixshm/posixshm_test.c
548
int fd, pagesize;
tests/sys/posixshm/posixshm_test.c
553
fd = scribble_object(test_path, '1');
tests/sys/posixshm/posixshm_test.c
554
close(fd);
tests/sys/posixshm/posixshm_test.c
556
fd = shm_open(test_path, O_RDONLY, 0777);
tests/sys/posixshm/posixshm_test.c
557
if (fd < 0)
tests/sys/posixshm/posixshm_test.c
560
page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
569
close(fd);
tests/sys/posixshm/posixshm_test.c
578
int fd, pagesize;
tests/sys/posixshm/posixshm_test.c
584
fd = shm_open(test_path, O_RDONLY | O_CREAT, 0777);
tests/sys/posixshm/posixshm_test.c
585
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
588
page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
596
close(fd);
tests/sys/posixshm/posixshm_test.c
604
int fd;
tests/sys/posixshm/posixshm_test.c
608
fd = shm_open(test_path, O_RDONLY | O_CREAT, 0777);
tests/sys/posixshm/posixshm_test.c
609
ATF_REQUIRE_MSG(fd >= 0, "shm_open(1) failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
610
close(fd);
tests/sys/posixshm/posixshm_test.c
646
int fd;
tests/sys/posixshm/posixshm_test.c
648
fd = shm_open(SHM_ANON, O_RDWR, 0777);
tests/sys/posixshm/posixshm_test.c
649
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
650
close(fd);
tests/sys/posixshm/posixshm_test.c
689
int fd;
tests/sys/posixshm/posixshm_test.c
693
fd = shm_open(test_path, O_RDONLY|O_CREAT, 0777);
tests/sys/posixshm/posixshm_test.c
694
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
695
close(fd);
tests/sys/posixshm/posixshm_test.c
708
int fd;
tests/sys/posixshm/posixshm_test.c
713
fd = shm_open(test_path, O_RDWR | O_CREAT, 0777);
tests/sys/posixshm/posixshm_test.c
714
ATF_REQUIRE_MSG(fd >= 0, "shm_open(1) failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
715
ATF_REQUIRE_MSG(ftruncate(fd, 1024) != -1,
tests/sys/posixshm/posixshm_test.c
717
ATF_REQUIRE_MSG(fstat(fd, &sb) != -1,
tests/sys/posixshm/posixshm_test.c
720
close(fd);
tests/sys/posixshm/posixshm_test.c
723
fd = shm_open(test_path, O_RDWR | O_TRUNC, 0777);
tests/sys/posixshm/posixshm_test.c
724
ATF_REQUIRE_MSG(fd >= 0, "shm_open(2) failed; errno=%d", errno);
tests/sys/posixshm/posixshm_test.c
725
ATF_REQUIRE_MSG(fstat(fd, &sb) != -1,
tests/sys/posixshm/posixshm_test.c
729
close(fd);
tests/sys/posixshm/posixshm_test.c
759
int fd, pagesize, status;
tests/sys/posixshm/posixshm_test.c
764
fd = shm_open(SHM_ANON, O_CREAT|O_RDWR, 0777);
tests/sys/posixshm/posixshm_test.c
765
if (fd < 0)
tests/sys/posixshm/posixshm_test.c
768
if (ftruncate(fd, pagesize) < 0)
tests/sys/posixshm/posixshm_test.c
771
if (fstat(fd, &sb) < 0)
tests/sys/posixshm/posixshm_test.c
779
page = mmap(0, pagesize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
789
if (ftruncate(fd, pagesize * 2) < 0)
tests/sys/posixshm/posixshm_test.c
792
if (fstat(fd, &sb) < 0)
tests/sys/posixshm/posixshm_test.c
800
page = mmap(0, pagesize * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/posixshm/posixshm_test.c
811
if (ftruncate(fd, pagesize) < 0)
tests/sys/posixshm/posixshm_test.c
814
if (fstat(fd, &sb) < 0)
tests/sys/posixshm/posixshm_test.c
855
if (ftruncate(fd, pagesize * 2) < 0)
tests/sys/posixshm/posixshm_test.c
858
if (fstat(fd, &sb) < 0)
tests/sys/posixshm/posixshm_test.c
878
close(fd);
tests/sys/ses/common.h
26
typedef bool(*ses_cb)(const char *devname, int fd);
tests/sys/ses/common.h
46
int fd;
tests/sys/ses/common.h
48
fd = open(g.gl_pathv[i], oflags);
tests/sys/ses/common.h
49
ATF_REQUIRE(fd >= 0);
tests/sys/ses/common.h
50
cb(g.gl_pathv[i], fd);
tests/sys/ses/common.h
51
close(fd);
tests/sys/ses/destructive.c
106
r = ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t)&elmstat);
tests/sys/ses/destructive.c
130
r = ioctl(fd, ENCIOC_GETELMSTAT,
tests/sys/ses/destructive.c
154
do_setelmstat_cleanup(const char *devname __unused, int fd __unused)
tests/sys/ses/destructive.c
162
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/destructive.c
167
r = ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) map);
tests/sys/ses/destructive.c
184
r = ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t)&elmstat);
tests/sys/ses/destructive.c
193
r = ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t)&elmstat);
tests/sys/ses/destructive.c
225
do_setencstat(const char *devname __unused, int fd)
tests/sys/ses/destructive.c
236
r = ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &encstat);
tests/sys/ses/destructive.c
241
r = ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &encstat);
tests/sys/ses/destructive.c
257
do_setencstat_cleanup(const char *devname __unused, int fd)
tests/sys/ses/destructive.c
267
ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &encstat);
tests/sys/ses/destructive.c
48
int fd, r;
tests/sys/ses/destructive.c
59
fd = open(g.gl_pathv[0], O_RDWR);
tests/sys/ses/destructive.c
60
ATF_REQUIRE(fd >= 0);
tests/sys/ses/destructive.c
61
cb(g.gl_pathv[0], fd);
tests/sys/ses/destructive.c
62
close(fd);
tests/sys/ses/destructive.c
68
do_setelmstat(const char *devname __unused, int fd)
tests/sys/ses/destructive.c
76
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/destructive.c
81
r = ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) map);
tests/sys/ses/destructive.c
97
r = ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t)&elmstat);
tests/sys/ses/nondestructive.c
129
do_getelmdevnames(const char *devname __unused, int fd)
tests/sys/ses/nondestructive.c
138
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/nondestructive.c
145
r = ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) map);
tests/sys/ses/nondestructive.c
160
r = ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t)&e_status);
tests/sys/ses/nondestructive.c
168
r = ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t) &elmdn);
tests/sys/ses/nondestructive.c
247
do_getelmmap(const char *devname, int fd)
tests/sys/ses/nondestructive.c
257
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/nondestructive.c
262
r = ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) map);
tests/sys/ses/nondestructive.c
328
do_getelmstat(const char *devname, int fd)
tests/sys/ses/nondestructive.c
336
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/nondestructive.c
341
r = ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) map);
tests/sys/ses/nondestructive.c
370
r = ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t)&e_status);
tests/sys/ses/nondestructive.c
401
do_getencid(const char *devname, int fd)
tests/sys/ses/nondestructive.c
425
r = ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri);
tests/sys/ses/nondestructive.c
44
do_getelmdesc(const char *devname, int fd)
tests/sys/ses/nondestructive.c
453
do_getencname(const char *devname, int fd)
tests/sys/ses/nondestructive.c
474
r = ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri);
tests/sys/ses/nondestructive.c
501
do_getencstat(const char *devname, int fd)
tests/sys/ses/nondestructive.c
521
r = ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat);
tests/sys/ses/nondestructive.c
546
do_getnelm(const char *devname, int fd)
tests/sys/ses/nondestructive.c
569
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/nondestructive.c
596
do_getstring(const char *devname, int fd)
tests/sys/ses/nondestructive.c
60
r = ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj);
tests/sys/ses/nondestructive.c
623
r = ioctl(fd, ENCIOC_GETSTRING, (caddr_t) &str_in);
tests/sys/ses/nondestructive.c
88
r = ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc);
tests/sys/sound/mmap.c
116
int fd;
tests/sys/sound/mmap.c
118
fd = open("/dev/dsp.dummy", O_RDWR);
tests/sys/sound/mmap.c
119
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/sound/mmap.c
124
fd, 0);
tests/sys/sound/mmap.c
129
close(fd);
tests/sys/sound/mmap.c
31
int fd;
tests/sys/sound/mmap.c
33
fd = open("/dev/dsp.dummy", O_RDWR);
tests/sys/sound/mmap.c
34
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/sound/mmap.c
40
buf = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, off);
tests/sys/sound/mmap.c
45
close(fd);
tests/sys/sound/mmap.c
63
int fd, arg;
tests/sys/sound/mmap.c
65
fd = open("/dev/dsp.dummy", O_RDWR);
tests/sys/sound/mmap.c
66
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/sound/mmap.c
69
ATF_REQUIRE_MSG(ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &arg) == 0,
tests/sys/sound/mmap.c
71
ATF_REQUIRE_MSG(ioctl(fd, SNDCTL_DSP_GETOSPACE, &abi) == 0,
tests/sys/sound/mmap.c
77
buf = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/sound/mmap.c
93
ATF_REQUIRE(close(fd) == 0);
tests/sys/sound/polling.c
100
EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, 0);
tests/sys/sound/polling.c
105
EV_SET(&ev, fd, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0);
tests/sys/sound/polling.c
113
ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) > 0, FMT_ERR("write"));
tests/sys/sound/polling.c
115
EV_SET(&ev, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0);
tests/sys/sound/polling.c
118
close(fd);
tests/sys/sound/polling.c
132
int fd;
tests/sys/sound/polling.c
136
fd = oss_init();
tests/sys/sound/polling.c
139
pfd[0].fd = fd;
tests/sys/sound/polling.c
141
pfd[1].fd = fd;
tests/sys/sound/polling.c
147
ATF_REQUIRE_MSG(read(fd, buf, sizeof(buf)) > 0,
tests/sys/sound/polling.c
152
ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) > 0,
tests/sys/sound/polling.c
157
close(fd);
tests/sys/sound/polling.c
171
int fd;
tests/sys/sound/polling.c
175
fd = oss_init();
tests/sys/sound/polling.c
180
FD_SET(fd, &fds[0]);
tests/sys/sound/polling.c
181
FD_SET(fd, &fds[1]);
tests/sys/sound/polling.c
182
ATF_REQUIRE_MSG(select(fd + 2, &fds[0], &fds[1], NULL, NULL) > 0,
tests/sys/sound/polling.c
184
if (FD_ISSET(fd, &fds[0])) {
tests/sys/sound/polling.c
185
ATF_REQUIRE_MSG(read(fd, buf, sizeof(buf)) > 0,
tests/sys/sound/polling.c
189
if (FD_ISSET(fd, &fds[1])) {
tests/sys/sound/polling.c
190
ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) > 0,
tests/sys/sound/polling.c
195
close(fd);
tests/sys/sound/polling.c
46
int fd, tmp, rc;
tests/sys/sound/polling.c
48
fd = open("/dev/dsp.dummy", O_RDWR);
tests/sys/sound/polling.c
49
ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open"));
tests/sys/sound/polling.c
52
rc = ioctl(fd, SNDCTL_DSP_CHANNELS, &tmp);
tests/sys/sound/polling.c
56
rc = ioctl(fd, SNDCTL_DSP_SETFMT, &tmp);
tests/sys/sound/polling.c
60
rc = ioctl(fd, SNDCTL_DSP_SPEED, &tmp);
tests/sys/sound/polling.c
67
rc = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &tmp);
tests/sys/sound/polling.c
70
return (fd);
tests/sys/sound/polling.c
84
int fd, kq;
tests/sys/sound/polling.c
86
fd = oss_init();
tests/sys/sound/polling.c
90
EV_SET(&ev, fd, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0);
tests/sys/sound/polling.c
98
ATF_REQUIRE_MSG(read(fd, buf, sizeof(buf)) > 0, FMT_ERR("read"));
tests/sys/sound/sndstat.c
199
close(fd);
tests/sys/sound/sndstat.c
228
int fd, rc, pchan, rchan, n;
tests/sys/sound/sndstat.c
230
if ((fd = open("/dev/sndstat", O_RDWR)) < 0)
tests/sys/sound/sndstat.c
264
rc = ioctl(fd, SNDSTIOC_ADD_USER_DEVS, &arg);
tests/sys/sound/sndstat.c
273
rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL);
tests/sys/sound/sndstat.c
278
rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg);
tests/sys/sound/sndstat.c
284
rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg);
tests/sys/sound/sndstat.c
377
close(fd);
tests/sys/sound/sndstat.c
57
int fd, rc, pchan, rchan;
tests/sys/sound/sndstat.c
59
if ((fd = open("/dev/sndstat", O_RDONLY)) < 0)
tests/sys/sound/sndstat.c
62
rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL);
tests/sys/sound/sndstat.c
67
rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg);
tests/sys/sound/sndstat.c
73
rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg);
tests/sys/vfs/lookup_cap_dotdot.c
45
int fd;
tests/sys/vfs/lookup_cap_dotdot.c
47
ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
tests/sys/vfs/lookup_cap_dotdot.c
49
ATF_REQUIRE(close(fd) == 0);
tests/sys/vm/mlock_test.c
122
int fd, i, len;
tests/sys/vm/mlock_test.c
125
fd = mkstemp(filename);
tests/sys/vm/mlock_test.c
126
ATF_REQUIRE(fd >= 0);
tests/sys/vm/mlock_test.c
130
ATF_REQUIRE(ftruncate(fd, len) == 0);
tests/sys/vm/mlock_test.c
132
addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/mlock_test.c
136
ATF_REQUIRE(ftruncate(fd, 0) == 0);
tests/sys/vm/mlock_test.c
137
ATF_REQUIRE(ftruncate(fd, len) == 0);
tests/sys/vm/mlock_test.c
151
int fd, len;
tests/sys/vm/mlock_test.c
154
fd = mkstemp(filename);
tests/sys/vm/mlock_test.c
155
ATF_REQUIRE(fd >= 0);
tests/sys/vm/mlock_test.c
159
ATF_REQUIRE(ftruncate(fd, len) == 0);
tests/sys/vm/mlock_test.c
161
addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/mlock_test.c
164
ATF_REQUIRE(ftruncate(fd, 0) == 0);
tests/sys/vm/mmap_map_32bit_helper.c
21
int fd;
tests/sys/vm/mmap_map_32bit_helper.c
26
fd = open("/dev/zero", O_RDONLY);
tests/sys/vm/mmap_map_32bit_helper.c
27
if (fd <= 0)
tests/sys/vm/mmap_map_32bit_helper.c
30
s32 = mmap(NULL, pagesize, PROT_READ, MAP_32BIT | MAP_PRIVATE, fd, 0);
tests/sys/vm/mmap_map_32bit_helper.c
36
close(fd);
tests/sys/vm/mmap_test.c
113
checked_mmap(int prot, int flags, int fd, int error, const char *msg)
tests/sys/vm/mmap_test.c
119
p = mmap(NULL, pagesize, prot, flags, fd, 0);
tests/sys/vm/mmap_test.c
209
int fd, i, pagesize;
tests/sys/vm/mmap_test.c
212
ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0);
tests/sys/vm/mmap_test.c
214
p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
tests/sys/vm/mmap_test.c
217
p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
tests/sys/vm/mmap_test.c
233
p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
tests/sys/vm/mmap_test.c
241
close(fd);
tests/sys/vm/mmap_test.c
248
int fd, i, pagesize;
tests/sys/vm/mmap_test.c
251
ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0);
tests/sys/vm/mmap_test.c
253
p1 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/mmap_test.c
256
p2 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/mmap_test.c
272
p3 = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd,
tests/sys/vm/mmap_test.c
281
close(fd);
tests/sys/vm/mmap_test.c
326
int error, fd, pagesize;
tests/sys/vm/mmap_test.c
330
fd = shm_open(SHM_ANON, O_RDWR, 0644);
tests/sys/vm/mmap_test.c
331
ATF_REQUIRE(fd >= 0);
tests/sys/vm/mmap_test.c
333
error = ftruncate(fd, pagesize);
tests/sys/vm/mmap_test.c
337
MAP_PRIVATE, fd, 0);
tests/sys/vm/mmap_test.c
351
MAP_SHARED, fd, 0);
tests/sys/vm/mmap_test.c
363
ATF_REQUIRE(close(fd) == 0);
tests/sys/vm/mmap_test.c
371
int fd;
tests/sys/vm/mmap_test.c
373
fd = open("/dev/devstat", O_RDONLY);
tests/sys/vm/mmap_test.c
374
ATF_REQUIRE(fd >= 0);
tests/sys/vm/mmap_test.c
376
p = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd, 0);
tests/sys/vm/page_fault_signal.c
126
int fd;
tests/sys/vm/page_fault_signal.c
130
fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600);
tests/sys/vm/page_fault_signal.c
131
ATF_REQUIRE(fd != -1);
tests/sys/vm/page_fault_signal.c
132
p = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/page_fault_signal.c
139
(void)close(fd);
tests/sys/vm/page_fault_signal.c
148
int fd;
tests/sys/vm/page_fault_signal.c
153
fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600);
tests/sys/vm/page_fault_signal.c
154
ATF_REQUIRE(fd != -1);
tests/sys/vm/page_fault_signal.c
155
r = ftruncate(fd, sz);
tests/sys/vm/page_fault_signal.c
157
p = mmap(NULL, sz * 2, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
tests/sys/vm/page_fault_signal.c
164
(void)close(fd);
tools/boot/smbios/main.c
35
static int fd;
tools/boot/smbios/main.c
52
va = mmap(0, PAGE, PROT_READ, MAP_SHARED, fd, pa2);
tools/boot/smbios/main.c
91
fd = open("/dev/mem", O_RDONLY);
tools/boot/smbios/main.c
92
if (fd < 0)
tools/build/cross-build/capsicum_stubs.c
43
cap_ioctls_limit(int fd __unused, const cap_ioctl_t *cmds __unused,
tools/build/cross-build/capsicum_stubs.c
50
cap_fcntls_limit(int fd __unused, uint32_t fcntlrights __unused)
tools/build/cross-build/capsicum_stubs.c
56
cap_rights_limit(int fd __unused, const cap_rights_t *rights __unused)
tools/build/cross-build/closefrom.c
116
int fd;
tools/build/cross-build/closefrom.c
119
for (fd = lowfd; fd <= pstat.pst_highestfd; fd++)
tools/build/cross-build/closefrom.c
120
(void)close(fd);
tools/build/cross-build/closefrom.c
150
int fd;
tools/build/cross-build/closefrom.c
152
fd = strtonum(dent->d_name, lowfd, INT_MAX, &errstr);
tools/build/cross-build/closefrom.c
153
if (errstr != NULL || fd == dirfd(dirp))
tools/build/cross-build/closefrom.c
172
fd_array[fd_array_used++] = fd;
tools/build/cross-build/closefrom.c
64
closefrom_close(int fd)
tools/build/cross-build/closefrom.c
68
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
tools/build/cross-build/closefrom.c
70
(void)close(fd);
tools/build/cross-build/closefrom.c
81
long fd, maxfd;
tools/build/cross-build/closefrom.c
96
for (fd = lowfd; fd < maxfd; fd++)
tools/build/cross-build/closefrom.c
97
closefrom_close(fd);
tools/build/cross-build/include/mac/sys/stat.h
40
utimensat(int fd, const char *file, const struct timespec *ts, int flag)
tools/build/fspacectl.c
37
fspacectl(int fd __unused, int cmd __unused,
tools/build/futimens.c
40
futimens(int fd, const struct timespec times[2])
tools/build/futimens.c
72
if (fstat(fd, &sb) == -1)
tools/build/futimens.c
93
return (futimes(fd, tvp));
tools/build/utimensat.c
100
(fd == AT_FDCWD || path[0] == '/'))
tools/build/utimensat.c
40
utimensat(int fd, const char *path, const struct timespec times[2], int flag)
tools/build/utimensat.c
76
if (fstatat(fd, path, &sb, flag) == -1)
tools/build/utimensat.c
98
return (futimesat(fd, path, tvp));
tools/bus_space/bus.c
112
r->fd = open(path, O_RDWR);
tools/bus_space/bus.c
113
if (r->fd == -1)
tools/bus_space/bus.c
116
if (ioctl(r->fd, PROTO_IOC_REGION, &region) == -1) {
tools/bus_space/bus.c
117
close(r->fd);
tools/bus_space/bus.c
118
r->fd = -1;
tools/bus_space/bus.c
125
MAP_NOCORE | MAP_SHARED, r->fd, r->ofs);
tools/bus_space/bus.c
162
o = lseek(r->fd, ofs, SEEK_SET);
tools/bus_space/bus.c
165
s = read(r->fd, buf, bufsz);
tools/bus_space/bus.c
191
fd0 = r->fd;
tools/bus_space/bus.c
202
r->fd = fd0;
tools/bus_space/bus.c
221
close(r->fd);
tools/bus_space/bus.c
223
r->fd = -1;
tools/bus_space/bus.c
260
o = lseek(r->fd, ofs, SEEK_SET);
tools/bus_space/bus.c
263
s = write(r->fd, buf, bufsz);
tools/bus_space/bus.c
43
int fd;
tools/bus_space/bus.c
60
if (ridtbl[rid].fd == -1)
tools/bus_space/bus.c
72
ridtbl[rid].fd = INT_MAX;
tools/bus_space/bus.c
86
if (r->fd == -1) {
tools/bus_space/busdma.c
140
bd_tag_new(struct obj *ptag, int fd, u_long align, u_long bndry,
tools/bus_space/busdma.c
163
if (ioctl(fd, PROTO_IOC_BUSDMA, &ioc) == -1) {
tools/bus_space/busdma.c
168
tag->fd = fd;
tools/bus_space/busdma.c
187
int fd, len;
tools/bus_space/busdma.c
194
fd = open(path, O_RDWR);
tools/bus_space/busdma.c
195
if (fd == -1)
tools/bus_space/busdma.c
198
tag = bd_tag_new(NULL, fd, align, bndry, maxaddr, maxsz, nsegs,
tools/bus_space/busdma.c
201
close(fd);
tools/bus_space/busdma.c
217
tag = bd_tag_new(ptag, ptag->fd, align, bndry, maxaddr, maxsz, nsegs,
tools/bus_space/busdma.c
240
if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/bus_space/busdma.c
246
close(tag->fd);
tools/bus_space/busdma.c
301
if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) {
tools/bus_space/busdma.c
307
md->fd = tag->fd;
tools/bus_space/busdma.c
327
if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/bus_space/busdma.c
352
if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/bus_space/busdma.c
375
if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/bus_space/busdma.c
404
if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) {
tools/bus_space/busdma.c
410
md->fd = tag->fd;
tools/bus_space/busdma.c
424
MAP_NOCORE | MAP_SHARED, md->fd, ioc.u.md.phys_addr);
tools/bus_space/busdma.c
435
ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc);
tools/bus_space/busdma.c
454
if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/bus_space/busdma.c
51
int fd;
tools/bus_space/busdma.c
552
if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
tools/regression/aio/aiop/aiop.c
104
set_aio(struct aiocb *a, iot_t iot, int fd, off_t offset, int size, char *buf)
tools/regression/aio/aiop/aiop.c
108
a->aio_fildes = fd;
tools/regression/aio/aiop/aiop.c
123
int fd;
tools/regression/aio/aiop/aiop.c
169
fd = open(fn, O_RDONLY | O_DIRECT);
tools/regression/aio/aiop/aiop.c
171
fd = open(fn, O_WRONLY | O_DIRECT);
tools/regression/aio/aiop/aiop.c
173
fd = open(fn, O_RDWR | O_DIRECT);
tools/regression/aio/aiop/aiop.c
175
if (fd < 0)
tools/regression/aio/aiop/aiop.c
177
if (fstat(fd, &sb) < 0)
tools/regression/aio/aiop/aiop.c
182
file_size = disk_getsize(fd);
tools/regression/aio/aiop/aiop.c
200
set_aio(aio + i, choose_aio(iowhat), fd, offset, io_size, abuf[i]);
tools/regression/aio/aiop/aiop.c
210
set_aio(aio + n, choose_aio(iowhat), fd, offset, io_size, abuf[n]);
tools/regression/aio/aiop/aiop.c
83
disk_getsize(int fd)
tools/regression/aio/aiop/aiop.c
87
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
103
if (ioctl(fd, AUDITPIPE_SET_QLIMIT, &len) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
106
if (ioctl(fd, AUDITPIPE_GET_QLIMIT, &len) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
117
if (ioctl(fd, AUDITPIPE_GET_INSERTS, &astat) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
123
if (ioctl(fd, AUDITPIPE_GET_READS, &astat) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
129
if (ioctl(fd, AUDITPIPE_GET_DROPS, &astat) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
135
if (ioctl(fd, AUDITPIPE_GET_TRUNCATES, &astat) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
48
int fd;
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
50
fd = open("/dev/auditpipe", O_RDONLY);
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
51
if (fd < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
59
if (ioctl(fd, AUDITPIPE_GET_QLEN, &len) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
65
if (ioctl(fd, AUDITPIPE_GET_QLIMIT_MIN, &minlen) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
71
if (ioctl(fd, AUDITPIPE_GET_QLIMIT_MAX, &maxlen) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
77
if (ioctl(fd, AUDITPIPE_GET_QLIMIT, &len) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
93
if (ioctl(fd, AUDITPIPE_SET_QLIMIT, &len) < 0)
tools/regression/audit/audit_pipe_ioctl/audit_pipe_ioctl.c
96
if (ioctl(fd, AUDITPIPE_GET_QLIMIT, &len) < 0)
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
100
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
101
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
102
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
103
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
105
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
107
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
109
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
111
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
113
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
115
CHECK(cap_fcntls_limit(fd, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
117
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
120
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
123
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
126
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
129
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
132
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
133
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
134
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
135
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
136
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
139
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
142
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
145
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
148
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
153
fcntl_tests_1(int fd)
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
158
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
160
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
165
CHECK(cap_rights_limit(fd, &rights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
168
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
172
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
175
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
178
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
181
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
184
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
185
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
186
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
187
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
188
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
191
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
194
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
197
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
200
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
205
fcntl_tests_2(int fd)
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
212
CHECK(cap_rights_limit(fd, &rights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
215
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
219
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
222
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
225
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
228
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
231
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
232
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
233
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
234
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
235
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
238
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
241
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
244
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
247
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
254
int fd;
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
256
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
257
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
258
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
260
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
261
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
262
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
263
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
265
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
266
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
267
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
268
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
270
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
271
CHECK(cap_fcntls_limit(fd, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
272
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
273
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
280
int fd;
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
282
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
285
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
288
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
289
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
290
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
291
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
292
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
294
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
295
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
296
CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
297
CHECK(fcntl(fd, F_SETFL, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
298
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
300
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
302
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
305
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
307
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
309
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
312
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
313
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
314
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
315
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
316
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
318
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
319
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
320
CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
321
CHECK(fcntl(fd, F_SETFL, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
322
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
324
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
326
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
329
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
332
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
335
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
337
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
339
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
342
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
343
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
344
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
345
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
346
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
348
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
350
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
352
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
354
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
356
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
358
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
360
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
363
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
366
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
369
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
372
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
375
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
378
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
381
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
384
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
385
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
386
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
387
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
388
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
391
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
394
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
397
CHECK(fcntl(fd, F_SETFL, 0) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
400
CHECK(fcntl(fd, F_GETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
403
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
409
int fd, pfd, sp[2];
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
414
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
415
fcntl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
416
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
418
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
419
fcntl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
420
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
422
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
423
fcntl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
424
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
427
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
430
fcntl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
431
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
435
fcntl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
437
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
44
fcntl_tests_0(int fd)
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
440
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
444
fcntl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
445
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
448
fcntl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
451
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
454
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
457
fcntl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
465
fcntl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
467
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
470
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
474
fcntl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
477
fcntl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
484
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
487
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
49
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
490
fcntl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
494
fcntl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
496
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
499
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
503
fcntl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
506
fcntl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
509
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
52
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
53
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
54
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
55
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
56
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
58
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
59
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
60
CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
61
CHECK(fcntl(fd, F_SETFL, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
62
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
65
CHECK(cap_fcntls_limit(fd, ~CAP_FCNTL_ALL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
67
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
69
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
71
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
73
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
76
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
77
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
78
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
79
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
80
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
82
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
83
CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
84
CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
85
CHECK(fcntl(fd, F_SETFL, 0) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
86
CHECK(fcntl(fd, F_GETFL) == O_RDWR);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
88
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
90
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
93
CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
96
CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
tools/regression/capsicum/syscalls/cap_fcntls_limit.c
99
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
100
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
101
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
103
CHECK(cap_ioctls_limit(fd, NULL, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
104
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
107
CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
109
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
111
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
113
CHECK(ioctl(fd, FIOCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
115
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
116
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
117
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
119
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
121
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
122
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
123
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
127
ioctl_tests_1(int fd)
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
133
CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
135
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
142
CHECK(cap_rights_limit(fd, &rights) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
143
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
148
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
150
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
153
CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
155
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
157
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
159
CHECK(ioctl(fd, FIOCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
161
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
162
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
163
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
165
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
167
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
168
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
169
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
173
ioctl_tests_2(int fd)
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
181
CHECK(cap_rights_limit(fd, &rights) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
182
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
187
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
189
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
192
CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
194
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
196
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
198
CHECK(ioctl(fd, FIOCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
200
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
201
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
202
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
204
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
206
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
207
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
208
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
215
int fd;
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
217
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
218
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
219
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
221
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
224
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
225
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
226
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
228
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
230
CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
231
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
232
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
234
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
235
CHECK(cap_ioctls_limit(fd, NULL, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
236
CHECK(descriptor_send(sock, fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
237
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
244
int fd;
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
246
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
248
CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
250
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
251
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
252
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
253
CHECK(ioctl(fd, FIONCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
254
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
256
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
258
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
261
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == nitems(cmds));
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
265
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
266
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
267
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
268
CHECK(ioctl(fd, FIONCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
269
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
271
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
273
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
276
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
279
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
280
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
281
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
283
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
285
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
286
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
287
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
289
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
291
CHECK(descriptor_recv(sock, &fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
293
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
295
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
297
CHECK(ioctl(fd, FIOCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
299
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
300
CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
301
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
303
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
305
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
306
CHECK(fcntl(fd, F_SETFD, 0) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
307
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
309
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
315
int fd, pfd, sp[2];
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
320
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
321
ioctl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
322
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
324
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
325
ioctl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
326
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
328
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
329
ioctl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
330
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
333
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
339
ioctl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
340
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
345
ioctl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
347
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
350
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
357
ioctl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
358
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
361
ioctl_tests_0(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
365
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
368
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
374
ioctl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
380
ioctl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
382
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
385
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
392
ioctl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
395
ioctl_tests_1(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
400
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
403
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
409
ioctl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
414
ioctl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
416
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
419
CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
426
ioctl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
429
ioctl_tests_2(fd);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
433
CHECK(close(fd) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
46
ioctl_tests_0(int fd)
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
50
CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
52
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
53
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
54
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
55
CHECK(ioctl(fd, FIONCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
56
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
60
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
62
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == nitems(cmds));
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
67
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
69
CHECK(cap_ioctls_get(fd, cmds, 1) == nitems(cmds));
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
73
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
74
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
75
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
76
CHECK(ioctl(fd, FIONCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
77
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
80
CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
82
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
87
CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
90
CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
93
CHECK(fcntl(fd, F_GETFD) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
94
CHECK(ioctl(fd, FIOCLEX) == 0);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
95
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
97
CHECK(ioctl(fd, FIONCLEX) == -1);
tools/regression/capsicum/syscalls/cap_ioctls_limit.c
99
CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
tools/regression/capsicum/syscalls/misc.c
52
descriptor_send(int sock, int fd)
tools/regression/capsicum/syscalls/misc.c
54
unsigned char ctrl[CMSG_SPACE(sizeof(fd))];
tools/regression/capsicum/syscalls/misc.c
59
assert(fd >= 0);
tools/regression/capsicum/syscalls/misc.c
72
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
tools/regression/capsicum/syscalls/misc.c
73
bcopy(&fd, CMSG_DATA(cmsg), sizeof(fd));
tools/regression/capsicum/syscalls/misc.h
56
int descriptor_send(int sock, int fd);
tools/regression/fsx/fsx.c
101
int fd; /* fd for our test file */
tools/regression/fsx/fsx.c
1156
fd = open(fname, O_RDWR|(lite ? 0 : O_CREAT|O_TRUNC), 0666);
tools/regression/fsx/fsx.c
1157
if (fd < 0) {
tools/regression/fsx/fsx.c
1177
file_size = maxfilelen = lseek(fd, (off_t)0, SEEK_END);
tools/regression/fsx/fsx.c
1183
ret = lseek(fd, (off_t)0, SEEK_SET);
tools/regression/fsx/fsx.c
1200
written = write(fd, good_buf, (size_t)maxfilelen);
tools/regression/fsx/fsx.c
1216
if (close(fd)) {
tools/regression/fsx/fsx.c
402
if (fstat(fd, &statbuf)) {
tools/regression/fsx/fsx.c
406
size_by_seek = lseek(fd, (off_t)0, SEEK_END);
tools/regression/fsx/fsx.c
422
ftruncate(fd, (off_t)0);
tools/regression/fsx/fsx.c
423
ftruncate(fd, (off_t)100000);
tools/regression/fsx/fsx.c
424
fstat(fd, &statbuf);
tools/regression/fsx/fsx.c
429
ftruncate(fd, (off_t)0);
tools/regression/fsx/fsx.c
466
ret = lseek(fd, (off_t)offset, SEEK_SET);
tools/regression/fsx/fsx.c
471
iret = read(fd, temp_buf, size);
tools/regression/fsx/fsx.c
549
if ((p = (char *)mmap(0, map_size, PROT_READ, MAP_FILE | MAP_SHARED, fd,
tools/regression/fsx/fsx.c
617
ret = lseek(fd, (off_t)offset, SEEK_SET);
tools/regression/fsx/fsx.c
622
iret = write(fd, good_buf + offset, size);
tools/regression/fsx/fsx.c
677
if (ftruncate(fd, file_size) == -1) {
tools/regression/fsx/fsx.c
686
MAP_FILE | MAP_SHARED, fd,
tools/regression/fsx/fsx.c
731
if (ftruncate(fd, (off_t)size) == -1) {
tools/regression/fsx/fsx.c
744
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
tools/regression/fsx/fsx.c
748
iret = write(fd, good_buf, file_size);
tools/regression/fsx/fsx.c
757
if (lite ? 0 : ftruncate(fd, file_size) == -1) {
tools/regression/fsx/fsx.c
773
if (close(fd)) {
tools/regression/fsx/fsx.c
777
fd = open(fname, O_RDWR, 0);
tools/regression/fsx/fsx.c
778
if (fd < 0) {
tools/regression/fsx/fsx.c
798
MAP_FILE | MAP_SHARED, fd, 0)) == MAP_FAILED) {
tools/regression/geom/ConfCmp/ConfCmp.c
174
int fd;
tools/regression/geom/ConfCmp/ConfCmp.c
189
fd = open(filename, O_RDONLY);
tools/regression/geom/ConfCmp/ConfCmp.c
190
if (fd < 0)
tools/regression/geom/ConfCmp/ConfCmp.c
192
fstat(fd, &st);
tools/regression/geom/ConfCmp/ConfCmp.c
193
p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0);
tools/regression/geom/ConfCmp/ConfCmp.c
198
close(fd);
tools/regression/geom/MdLoad/MdLoad.c
206
int fd, i;
tools/regression/geom/MdLoad/MdLoad.c
215
fd = open(file, O_RDONLY);
tools/regression/geom/MdLoad/MdLoad.c
216
if (fd < 0)
tools/regression/geom/MdLoad/MdLoad.c
218
fstat(fd, &st);
tools/regression/geom/MdLoad/MdLoad.c
219
p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0);
tools/regression/geom/MdLoad/MdLoad.c
224
close(fd);
tools/regression/geom/MdLoad/MdLoad.c
234
int error, fd;
tools/regression/geom/MdLoad/MdLoad.c
254
fd = open(argv[1], O_RDWR);
tools/regression/geom/MdLoad/MdLoad.c
255
if (fd < 0 && errno == ENOENT) {
tools/regression/geom/MdLoad/MdLoad.c
257
fd = open(buf, O_RDWR);
tools/regression/geom/MdLoad/MdLoad.c
259
if (fd < 0)
tools/regression/geom/MdLoad/MdLoad.c
262
lseek(fd, dsp->offset, SEEK_SET);
tools/regression/geom/MdLoad/MdLoad.c
263
error = write(fd, dsp->data, sc->sectorsize);
tools/regression/geom/MdLoad/MdLoad.c
267
close(fd);
tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
101
pfd[1].fd = u;
tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
107
pfd[0].fd = -1;
tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
115
pfd[0].fd = -1;
tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
122
pfd[1].fd = -1;
tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
99
pfd[0].fd = t;
tools/regression/nfsmmap/test1/test1.c
17
fd = open("test1.data", O_RDWR|O_CREAT, 0666);
tools/regression/nfsmmap/test1/test1.c
18
if (fd < 0)
tools/regression/nfsmmap/test1/test1.c
20
if (write(fd, zeros, sizeof zeros) < 0)
tools/regression/nfsmmap/test1/test1.c
22
close(fd);
tools/regression/nfsmmap/test1/test1.c
25
fd = open("test1.data", O_RDWR);
tools/regression/nfsmmap/test1/test1.c
26
if (fd < 0)
tools/regression/nfsmmap/test1/test1.c
28
if (lseek(fd, 600, SEEK_SET) < 0)
tools/regression/nfsmmap/test1/test1.c
31
if (write(fd, ones, sizeof ones) < 0)
tools/regression/nfsmmap/test1/test1.c
34
fsync(fd);
tools/regression/nfsmmap/test1/test1.c
36
addr = mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
tools/regression/nfsmmap/test1/test1.c
8
int fd, fd2;
tools/regression/nfsmmap/test2/test2.c
17
fd = open("test2.data", O_RDWR|O_CREAT, 0666);
tools/regression/nfsmmap/test2/test2.c
18
if (fd < 0)
tools/regression/nfsmmap/test2/test2.c
20
if (write(fd, zeros, sizeof zeros) < 0)
tools/regression/nfsmmap/test2/test2.c
22
close(fd);
tools/regression/nfsmmap/test2/test2.c
25
fd = open("test2.data", O_RDWR);
tools/regression/nfsmmap/test2/test2.c
26
if (fd < 0)
tools/regression/nfsmmap/test2/test2.c
28
if (lseek(fd, 600, SEEK_SET) < 0)
tools/regression/nfsmmap/test2/test2.c
31
if (write(fd, ones, sizeof ones) < 0)
tools/regression/nfsmmap/test2/test2.c
34
addr = mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
tools/regression/nfsmmap/test2/test2.c
8
int fd, fd2;
tools/regression/p1003_1b/sched.c
215
int fd;
tools/regression/p1003_1b/sched.c
219
fd = mkstemp(nam);
tools/regression/p1003_1b/sched.c
220
if (fd == -1)
tools/regression/p1003_1b/sched.c
227
write(fd, &p, sizeof(p));
tools/regression/p1003_1b/sched.c
230
MAP_SHARED, fd, 0)), "mmap");
tools/regression/poll/pipepoll.c
100
pfd.fd = fd;
tools/regression/poll/pipepoll.c
133
if (read(fd, buf, sizeof buf) != 1)
tools/regression/poll/pipepoll.c
187
if (read(fd, buf, sizeof buf) != 1)
tools/regression/poll/pipepoll.c
200
pfd.fd = fd2;
tools/regression/poll/pipepoll.c
204
pfd.fd = fd;
tools/regression/poll/pipepoll.c
213
close(fd);
tools/regression/poll/pipepoll.c
220
parent(int fd)
tools/regression/poll/pipepoll.c
226
fd = open(FIFONAME, O_WRONLY | O_NONBLOCK);
tools/regression/poll/pipepoll.c
227
if (fd < 0)
tools/regression/poll/pipepoll.c
235
if (write(fd, "", 1) != 1)
tools/regression/poll/pipepoll.c
242
if (close(fd) != 0)
tools/regression/poll/pipepoll.c
251
fd = open(FIFONAME, O_WRONLY | O_NONBLOCK);
tools/regression/poll/pipepoll.c
252
if (fd < 0)
tools/regression/poll/pipepoll.c
259
if (write(fd, "", 1) != 1)
tools/regression/poll/pipepoll.c
266
if (close(fd) != 0)
tools/regression/poll/pipepoll.c
278
int fd[2], num;
tools/regression/poll/pipepoll.c
290
fd[0] = -1;
tools/regression/poll/pipepoll.c
291
fd[1] = -1;
tools/regression/poll/pipepoll.c
295
fd) != 0)
tools/regression/poll/pipepoll.c
299
if (pipe(fd) != 0)
tools/regression/poll/pipepoll.c
308
(void)close(fd[1]);
tools/regression/poll/pipepoll.c
309
child(fd[0], num);
tools/regression/poll/pipepoll.c
312
(void)close(fd[0]);
tools/regression/poll/pipepoll.c
313
parent(fd[1]);
tools/regression/poll/pipepoll.c
89
child(int fd, int num)
tools/regression/poll/pipepoll.c
96
fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);
tools/regression/poll/pipepoll.c
97
if (fd < 0)
tools/regression/poll/pipeselect.c
106
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
107
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
109
report(num++, "1", 0, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
115
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
116
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
118
report(num++, "2", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
119
if (read(fd, buf, sizeof buf) != 1)
tools/regression/poll/pipeselect.c
121
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
122
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
124
report(num++, "2a", 0, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
130
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
131
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
133
report(num++, "3", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
146
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
147
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
149
report(num++, "4", 0, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
155
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
156
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
158
report(num++, "5", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
169
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
170
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
172
report(num++, "6", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
173
if (read(fd, buf, sizeof buf) != 1)
tools/regression/poll/pipeselect.c
175
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
176
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
178
report(num++, "6a", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
19
#define SETUP(fd, rfds, tv) do { \
tools/regression/poll/pipeselect.c
193
fd1 = fd;
tools/regression/poll/pipeselect.c
194
fd = fd2;
tools/regression/poll/pipeselect.c
195
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
196
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
198
report(num++, "6b", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
199
fd = fd1;
tools/regression/poll/pipeselect.c
200
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
201
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
203
report(num++, "6c", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
205
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
206
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
208
report(num++, "6d", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/pipeselect.c
21
FD_SET((fd), &(rfds)); \
tools/regression/poll/pipeselect.c
210
close(fd);
tools/regression/poll/pipeselect.c
217
parent(int fd)
tools/regression/poll/pipeselect.c
223
fd = open(FIFONAME, O_WRONLY | O_NONBLOCK);
tools/regression/poll/pipeselect.c
224
if (fd < 0)
tools/regression/poll/pipeselect.c
232
if (write(fd, "", 1) != 1)
tools/regression/poll/pipeselect.c
239
if (close(fd) != 0)
tools/regression/poll/pipeselect.c
248
fd = open(FIFONAME, O_WRONLY | O_NONBLOCK);
tools/regression/poll/pipeselect.c
249
if (fd < 0)
tools/regression/poll/pipeselect.c
256
if (write(fd, "", 1) != 1)
tools/regression/poll/pipeselect.c
263
if (close(fd) != 0)
tools/regression/poll/pipeselect.c
275
int fd[2], num;
tools/regression/poll/pipeselect.c
287
fd[0] = -1;
tools/regression/poll/pipeselect.c
288
fd[1] = -1;
tools/regression/poll/pipeselect.c
292
fd) != 0)
tools/regression/poll/pipeselect.c
296
if (pipe(fd) != 0)
tools/regression/poll/pipeselect.c
305
(void)close(fd[1]);
tools/regression/poll/pipeselect.c
306
child(fd[0], num);
tools/regression/poll/pipeselect.c
309
(void)close(fd[0]);
tools/regression/poll/pipeselect.c
310
parent(fd[1]);
tools/regression/poll/pipeselect.c
59
child(int fd, int num)
tools/regression/poll/pipeselect.c
67
fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);
tools/regression/poll/pipeselect.c
68
if (fd < 0)
tools/regression/poll/pipeselect.c
71
if (fd >= FD_SETSIZE)
tools/regression/poll/pipeselect.c
72
errx(1, "fd = %d too large for select()", fd);
tools/regression/poll/pipeselect.c
75
SETUP(fd, rfds, tv);
tools/regression/poll/pipeselect.c
76
if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0)
tools/regression/poll/pipeselect.c
90
report(num++, "0", 1, FD_ISSET(fd, &rfds));
tools/regression/poll/sockpoll.c
104
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != 0)
tools/regression/poll/sockpoll.c
106
if (set_nonblocking(fd[0]) == -1)
tools/regression/poll/sockpoll.c
108
if (set_nonblocking(fd[1]) == -1)
tools/regression/poll/sockpoll.c
110
pfd0.fd = fd[0];
tools/regression/poll/sockpoll.c
112
pfd1.fd = fd[1];
tools/regression/poll/sockpoll.c
133
if (write(fd[0], largeblock, sizeof(largeblock)) == -1)
tools/regression/poll/sockpoll.c
141
close(fd[0]);
tools/regression/poll/sockpoll.c
145
if (read(fd[1], largeblock, sizeof(largeblock)) == -1)
tools/regression/poll/sockpoll.c
150
close(fd[1]);
tools/regression/poll/sockpoll.c
154
if (shutdown(fd[0], SHUT_WR) == -1)
tools/regression/poll/sockpoll.c
162
switch (read(fd[1], largeblock, sizeof(largeblock))) {
tools/regression/poll/sockpoll.c
174
if (write(fd[1], largeblock, sizeof(largeblock)) == -1)
tools/regression/poll/sockpoll.c
182
if (shutdown(fd[1], SHUT_WR) == -1)
tools/regression/poll/sockpoll.c
190
close(fd[0]);
tools/regression/poll/sockpoll.c
194
close(fd[1]);
tools/regression/poll/sockpoll.c
202
if (shutdown(fd[0], SHUT_RD) == -1)
tools/regression/poll/sockpoll.c
210
if (shutdown(fd[0], SHUT_WR) == -1)
tools/regression/poll/sockpoll.c
218
close(fd[0]);
tools/regression/poll/sockpoll.c
219
close(fd[1]);
tools/regression/poll/sockpoll.c
224
if (shutdown(fd[0], SHUT_RD) == -1)
tools/regression/poll/sockpoll.c
229
if (write(fd[0], "x", 1) != 1)
tools/regression/poll/sockpoll.c
234
if (shutdown(fd[0], SHUT_WR) == -1)
tools/regression/poll/sockpoll.c
239
close(fd[0]);
tools/regression/poll/sockpoll.c
240
close(fd[1]);
tools/regression/poll/sockpoll.c
97
static int fd[2];
tools/regression/priv/main.c
403
int fd;
tools/regression/priv/main.c
406
fd = mkstemp(fpathp);
tools/regression/priv/main.c
407
if (fd < 0)
tools/regression/priv/main.c
410
if (fchown(fd, uid, gid) < 0)
tools/regression/priv/main.c
414
if (fchmod(fd, mode) < 0)
tools/regression/priv/main.c
417
close(fd);
tools/regression/priv/priv_io.c
81
int error, fd;
tools/regression/priv/priv_io.c
83
fd = open(DEV_IO, O_RDONLY);
tools/regression/priv/priv_io.c
84
if (fd < 0)
tools/regression/priv/priv_io.c
96
if (fd != -1)
tools/regression/priv/priv_io.c
97
close(fd);
tools/regression/priv/priv_netinet_ipsec.c
164
int error, fd;
tools/regression/priv/priv_netinet_ipsec.c
166
fd = socket(PF_KEY, SOCK_RAW, PF_KEY_V2);
tools/regression/priv/priv_netinet_ipsec.c
167
if (fd < 0)
tools/regression/priv/priv_netinet_ipsec.c
187
if (fd >= 0)
tools/regression/priv/priv_netinet_ipsec.c
188
(void)close(fd);
tools/regression/priv/priv_netinet_raw.c
55
int error, fd;
tools/regression/priv/priv_netinet_raw.c
57
fd = socket(PF_INET, SOCK_RAW, 0);
tools/regression/priv/priv_netinet_raw.c
58
if (fd < 0)
tools/regression/priv/priv_netinet_raw.c
72
if (fd >= 0)
tools/regression/priv/priv_netinet_raw.c
73
(void)close(fd);
tools/regression/priv/priv_vfs_clearsugid.c
129
int fd;
tools/regression/priv/priv_vfs_clearsugid.c
131
fd = open(fpath, O_RDWR);
tools/regression/priv/priv_vfs_clearsugid.c
132
if (fd < 0)
tools/regression/priv/priv_vfs_clearsugid.c
135
if (write(fd, EA_DATA, EA_SIZE) < 0)
tools/regression/priv/priv_vfs_clearsugid.c
138
(void)close(fd);
tools/regression/priv/priv_vfs_fhopen.c
67
int errno_saved, error, fd;
tools/regression/priv/priv_vfs_fhopen.c
69
fd = fhopen(&fh, O_RDONLY);
tools/regression/priv/priv_vfs_fhopen.c
70
if (fd >= 0) {
tools/regression/priv/priv_vfs_fhopen.c
73
close(fd);
tools/regression/priv/priv_vfs_read_write.c
63
int fd;
tools/regression/priv/priv_vfs_read_write.c
65
fd = open(fpathp, flags);
tools/regression/priv/priv_vfs_read_write.c
66
if (fd < 0) {
tools/regression/priv/priv_vfs_read_write.c
76
(void)close(fd);
tools/regression/security/cap_test/cap_test.h
37
#define REQUIRE(fd) do { \
tools/regression/security/cap_test/cap_test.h
38
if ((fd) < 0) \
tools/regression/security/cap_test/cap_test.h
40
__FILE__, __LINE__, #fd); \
tools/regression/security/cap_test/cap_test_capabilities.c
391
pollfd.fd = fd_cap;
tools/regression/security/cap_test/cap_test_fcntl.c
101
struct fd f = all[i];
tools/regression/security/cap_test/cap_test_fcntl.c
69
struct fd files[] = {
tools/regression/security/cap_test/cap_test_fcntl.c
78
struct fd caps[] = {
tools/regression/security/cap_test/cap_test_fcntl.c
87
struct fd all[] = {
tools/regression/security/cap_test/cap_test_fcntl.c
92
const size_t len = sizeof(all) / sizeof(struct fd);
tools/regression/security/cap_test/cap_test_relative.c
100
REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
101
CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights);
tools/regression/security/cap_test/cap_test_relative.c
136
REQUIRE(fd = openat(etc, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
137
CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights);
tools/regression/security/cap_test/cap_test_relative.c
142
REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY));
tools/regression/security/cap_test/cap_test_relative.c
143
CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights);
tools/regression/security/cap_test/cap_test_relative.c
54
int fd, etc, etc_cap, etc_cap_ro, etc_cap_base, etc_cap_all;
tools/regression/security/open_to_operation/open_to_operation.c
1015
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
1023
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
1032
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
1033
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
1038
MAP_PRIVATE, fd, 0);
tools/regression/security/open_to_operation/open_to_operation.c
1061
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
1069
int dummy, fd;
tools/regression/security/open_to_operation/open_to_operation.c
1088
fd = mkstemp(file_path);
tools/regression/security/open_to_operation/open_to_operation.c
1089
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
1094
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
203
int dfd, fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
210
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
211
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
215
dfd = dup(fd);
tools/regression/security/open_to_operation/open_to_operation.c
221
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
229
int dfd, fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
236
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
237
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
241
dfd = dup2(fd, 500); /* Arbitrary but high number. */
tools/regression/security/open_to_operation/open_to_operation.c
247
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
255
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
262
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
263
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
267
if (fchdir(fd) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
271
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
279
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
286
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
287
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
291
if (fchflags(fd, UF_NODUMP) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
295
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
303
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
310
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
311
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
315
if (fchmod(fd, setmode) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
319
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
327
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
334
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
335
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
339
if (fchown(fd, -1, -1) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
343
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
351
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
358
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
359
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
363
if (flock(fd, LOCK_EX) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
367
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
375
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
383
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
384
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
388
l = fpathconf(fd, _PC_FILESIZEBITS);
tools/regression/security/open_to_operation/open_to_operation.c
393
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
402
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
409
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
410
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
414
if (fstat(fd, &sb) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
418
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
427
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
434
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
435
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
439
if (fstatfs(fd, &statfs) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
443
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
451
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
458
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
459
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
463
if (fsync(fd) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
467
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
476
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
487
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
488
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
495
if (fstat(fd, &sb) < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
500
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
506
if (ftruncate(fd, sb.st_size + 1) == 0) {
tools/regression/security/open_to_operation/open_to_operation.c
518
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
530
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
537
if (ftruncate(fd, sb.st_size + 1) == 0) {
tools/regression/security/open_to_operation/open_to_operation.c
547
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
557
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
564
if (ftruncate(fd, sb.st_size) == 0) {
tools/regression/security/open_to_operation/open_to_operation.c
580
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
588
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
595
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
596
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
600
if (futimes(fd, NULL) == 0)
tools/regression/security/open_to_operation/open_to_operation.c
604
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
612
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
619
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
620
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
624
if (lseek(fd, 100, SEEK_SET) == 100)
tools/regression/security/open_to_operation/open_to_operation.c
628
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
636
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
645
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
646
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
650
if (getdents(fd, buf, sizeof(buf)) >= 0) {
tools/regression/security/open_to_operation/open_to_operation.c
668
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
676
int fd, i, mode, sv[2];
tools/regression/security/open_to_operation/open_to_operation.c
685
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
686
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
694
if (sendfile(fd, sv[0], 0, 1, NULL, &sent, 0) == 0) {
tools/regression/security/open_to_operation/open_to_operation.c
714
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
772
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
783
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
784
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
788
if (fn(fd, &ch, sizeof(ch)) < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
801
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
858
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
867
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
868
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
872
if (fn(fd, &ch, sizeof(ch)) < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
885
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
893
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
902
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
903
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
907
addr = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd,
tools/regression/security/open_to_operation/open_to_operation.c
931
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
939
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
950
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
951
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
955
addr = mmap(NULL, getpagesize(), PROT_WRITE, MAP_SHARED, fd,
tools/regression/security/open_to_operation/open_to_operation.c
973
close(fd);
tools/regression/security/open_to_operation/open_to_operation.c
981
int fd, i, mode;
tools/regression/security/open_to_operation/open_to_operation.c
990
fd = open(path, mode);
tools/regression/security/open_to_operation/open_to_operation.c
991
if (fd < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
995
addr = mmap(NULL, getpagesize(), PROT_EXEC, MAP_SHARED, fd,
tools/regression/sockets/kqueue/kqueue.c
102
test_evfilt_read(int kq, int fd[2], const char *socktype)
tools/regression/sockets/kqueue/kqueue.c
110
EV_SET(&ke, fd[0], EVFILT_READ, EV_ADD, 0, 0, NULL);
tools/regression/sockets/kqueue/kqueue.c
133
len = write(fd[1], &ch, sizeof(ch));
tools/regression/sockets/kqueue/kqueue.c
158
len = read(fd[0], &ch, sizeof(ch));
tools/regression/sockets/kqueue/kqueue.c
180
EV_SET(&ke, fd[0], EVFILT_READ, EV_DELETE, 0, 0, NULL);
tools/regression/sockets/kqueue/kqueue.c
187
test_evfilt_write(int kq, int fd[2], const char *socktype)
tools/regression/sockets/kqueue/kqueue.c
195
EV_SET(&ke, fd[0], EVFILT_WRITE, EV_ADD, 0, 0, NULL);
tools/regression/sockets/kqueue/kqueue.c
218
while ((len = write(fd[0], &ch, sizeof(ch))) == sizeof(ch)) {};
tools/regression/sockets/kqueue/kqueue.c
240
EV_SET(&ke, fd[0], EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
tools/regression/sockets/listen_kqueue/listen_kqueue.c
104
fd = accept(ev[i].ident,
tools/regression/sockets/listen_kqueue/listen_kqueue.c
106
if (fd == -1)
tools/regression/sockets/listen_kqueue/listen_kqueue.c
52
int kq, sock, opt, pid, nev, fd;
tools/regression/sockets/sblock/sblock.c
112
signaller(pid_t locking_recver_pid, int fd)
tools/regression/sockets/sblock/sblock.c
129
len = send(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/sblock/sblock.c
138
if (close(fd) < 0) {
tools/regression/sockets/sblock/sblock.c
66
blocking_recver(int fd)
tools/regression/sockets/sblock/sblock.c
71
len = recv(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/sblock/sblock.c
91
locking_recver(int fd)
tools/regression/sockets/sblock/sblock.c
98
len = recv(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/udp_pingpong/udp_pingpong.c
178
setup_ts_sockopt(struct test_ctx *tcp, int fd)
tools/regression/sockets/udp_pingpong/udp_pingpong.c
207
rval = setsockopt(fd, SOL_SOCKET, oname1, &sval1,
tools/regression/sockets/udp_pingpong/udp_pingpong.c
211
fd, oname1);
tools/regression/sockets/udp_pingpong/udp_pingpong.c
215
rval = setsockopt(fd, SOL_SOCKET, oname2, &sval2,
tools/regression/sockets/udp_pingpong/udp_pingpong.c
219
tcp->name, fd, oname2, sval2);
tools/regression/sockets/udp_pingpong/udp_pingpong.c
248
tcp->pfds[i].fd = tcp->fds[i];
tools/regression/sockets/udp_pingpong/udp_pingpong.c
293
tcp->pfds[i].fd = tcp->fds[i];
tools/regression/sockets/unix_cmsg/t_cmsg_len.c
44
t_cmsg_len_client(int fd)
tools/regression/sockets/unix_cmsg/t_cmsg_len.c
69
if (uc_socket_connect(fd) < 0)
tools/regression/sockets/unix_cmsg/t_cmsg_len.c
81
if (sendmsg(fd, &msghdr, 0) < 0) {
tools/regression/sockets/unix_cmsg/t_cmsgcred.c
40
t_cmsgcred_client(int fd)
tools/regression/sockets/unix_cmsg/t_cmsgcred.c
62
if (uc_socket_connect(fd) < 0)
tools/regression/sockets/unix_cmsg/t_cmsgcred.c
65
if (uc_message_sendn(fd, &msghdr) < 0)
tools/regression/sockets/unix_cmsg/t_cmsgcred.h
27
int t_cmsgcred_client(int fd);
tools/regression/sockets/unix_cmsg/t_generic.c
39
int fd, rv, rv_client;
tools/regression/sockets/unix_cmsg/t_generic.c
43
fd = uc_socket_create();
tools/regression/sockets/unix_cmsg/t_generic.c
44
if (fd < 0)
tools/regression/sockets/unix_cmsg/t_generic.c
47
rv = client_func(fd);
tools/regression/sockets/unix_cmsg/t_generic.c
48
if (uc_socket_close(fd) < 0)
tools/regression/sockets/unix_cmsg/t_generic.c
54
fd = uc_socket_create();
tools/regression/sockets/unix_cmsg/t_generic.c
55
if (fd < 0)
tools/regression/sockets/unix_cmsg/t_generic.c
58
rv = server_func(fd);
tools/regression/sockets/unix_cmsg/t_generic.c
62
if (uc_socket_close(fd) < 0)
tools/regression/sockets/unix_cmsg/t_peercred.c
102
if (getsockopt(fd, 0, LOCAL_PEERCRED, &xucred, &len) < 0) {
tools/regression/sockets/unix_cmsg/t_peercred.c
90
t_peercred_client(int fd)
tools/regression/sockets/unix_cmsg/t_peercred.c
98
if (uc_socket_connect(fd) < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
155
int fd, rv, rv_client;
tools/regression/sockets/unix_cmsg/t_sockcred.c
161
fd = uc_socket_create();
tools/regression/sockets/unix_cmsg/t_sockcred.c
162
if (fd < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
165
rv = t_sockcred_client(1, fd);
tools/regression/sockets/unix_cmsg/t_sockcred.c
166
if (uc_socket_close(fd) < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
175
fd = uc_socket_create();
tools/regression/sockets/unix_cmsg/t_sockcred.c
176
if (fd < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
179
rv = t_sockcred_server(1, fd);
tools/regression/sockets/unix_cmsg/t_sockcred.c
181
rv = t_sockcred_server(3, fd);
tools/regression/sockets/unix_cmsg/t_sockcred.c
185
if (uc_socket_close(fd) < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
197
t_sockcred_2_client(int fd)
tools/regression/sockets/unix_cmsg/t_sockcred.c
199
return (t_sockcred_client(2, fd));
tools/regression/sockets/unix_cmsg/t_sockcred.c
203
t_sockcred_2_server(int fd)
tools/regression/sockets/unix_cmsg/t_sockcred.c
205
return (t_sockcred_server(2, fd));
tools/regression/sockets/unix_cmsg/t_sockcred.c
40
t_sockcred_client(int type, int fd)
tools/regression/sockets/unix_cmsg/t_sockcred.c
53
if (uc_socket_connect(fd) < 0)
tools/regression/sockets/unix_cmsg/t_sockcred.c
60
if (uc_message_sendn(fd, &msghdr) < 0)
tools/regression/sockets/unix_cmsg/uc_common.c
128
int fd;
tools/regression/sockets/unix_cmsg/uc_common.c
130
fd = socket(PF_LOCAL, uc_cfg.sock_type, 0);
tools/regression/sockets/unix_cmsg/uc_common.c
131
if (fd < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
136
uc_cfg.serv_sock_fd = fd;
tools/regression/sockets/unix_cmsg/uc_common.c
140
if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0 ||
tools/regression/sockets/unix_cmsg/uc_common.c
141
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
147
if (bind(fd, (struct sockaddr *)&uc_cfg.serv_addr_sun,
tools/regression/sockets/unix_cmsg/uc_common.c
156
if (listen(fd, LISTENQ) < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
160
val = fcntl(fd, F_GETFL, 0);
tools/regression/sockets/unix_cmsg/uc_common.c
165
if (fcntl(fd, F_SETFL, val | O_NONBLOCK) < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
172
return (fd);
tools/regression/sockets/unix_cmsg/uc_common.c
175
if (close(fd) < 0)
tools/regression/sockets/unix_cmsg/uc_common.c
185
uc_socket_close(int fd)
tools/regression/sockets/unix_cmsg/uc_common.c
190
if (close(fd) < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
194
if (uc_cfg.server_flag && fd == uc_cfg.serv_sock_fd)
tools/regression/sockets/unix_cmsg/uc_common.c
204
uc_socket_connect(int fd)
tools/regression/sockets/unix_cmsg/uc_common.c
208
if (connect(fd, (struct sockaddr *)&uc_cfg.serv_addr_sun,
tools/regression/sockets/unix_cmsg/uc_common.c
220
int fd;
tools/regression/sockets/unix_cmsg/uc_common.c
225
fd = uc_cfg.sync_fd[uc_cfg.server_flag ? SYNC_SERVER : SYNC_CLIENT][SYNC_RECV];
tools/regression/sockets/unix_cmsg/uc_common.c
227
ssize = read(fd, &buf, 1);
tools/regression/sockets/unix_cmsg/uc_common.c
246
int fd;
tools/regression/sockets/unix_cmsg/uc_common.c
250
fd = uc_cfg.sync_fd[uc_cfg.server_flag ? SYNC_CLIENT : SYNC_SERVER][SYNC_SEND];
tools/regression/sockets/unix_cmsg/uc_common.c
252
ssize = write(fd, "", 1);
tools/regression/sockets/unix_cmsg/uc_common.c
266
uc_message_send(int fd, const struct msghdr *msghdr)
tools/regression/sockets/unix_cmsg/uc_common.c
281
ssize = sendmsg(fd, msghdr, 0);
tools/regression/sockets/unix_cmsg/uc_common.c
300
uc_message_sendn(int fd, struct msghdr *msghdr)
tools/regression/sockets/unix_cmsg/uc_common.c
306
if (uc_message_send(fd, msghdr) < 0)
tools/regression/sockets/unix_cmsg/uc_common.c
313
uc_message_recv(int fd, struct msghdr *msghdr)
tools/regression/sockets/unix_cmsg/uc_common.c
324
ssize = recvmsg(fd, msghdr, MSG_WAITALL);
tools/regression/sockets/unix_cmsg/uc_common.c
356
int fd, rv, val;
tools/regression/sockets/unix_cmsg/uc_common.c
374
fd = accept(listenfd, (struct sockaddr *)NULL, (socklen_t *)NULL);
tools/regression/sockets/unix_cmsg/uc_common.c
375
if (fd < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
380
val = fcntl(fd, F_GETFL, 0);
tools/regression/sockets/unix_cmsg/uc_common.c
385
if (fcntl(fd, F_SETFL, val & ~O_NONBLOCK) < 0) {
tools/regression/sockets/unix_cmsg/uc_common.c
390
return (fd);
tools/regression/sockets/unix_cmsg/uc_common.c
393
if (close(fd) < 0)
tools/regression/sockets/unix_cmsg/uc_common.h
65
int uc_message_recv(int fd, struct msghdr *msghdr);
tools/regression/sockets/unix_cmsg/uc_common.h
66
int uc_message_send(int fd, const struct msghdr *msghdr);
tools/regression/sockets/unix_cmsg/uc_common.h
67
int uc_message_sendn(int fd, struct msghdr *msghdr);
tools/regression/sockets/unix_cmsg/uc_common.h
74
int uc_socket_close(int fd);
tools/regression/sockets/unix_cmsg/uc_common.h
75
int uc_socket_connect(int fd);
tools/regression/sockets/unix_gc/unix_gc.c
105
m.fd = fdtosend;
tools/regression/sockets/unix_gc/unix_gc.c
106
len = sendmsg(fd, &mh, 0);
tools/regression/sockets/unix_gc/unix_gc.c
720
int fd[2], ff[2];
tools/regression/sockets/unix_gc/unix_gc.c
728
my_socketpair(fd);
tools/regression/sockets/unix_gc/unix_gc.c
736
sendfd(ff[0], fd[0]);
tools/regression/sockets/unix_gc/unix_gc.c
737
sendfd(ff[0], fd[1]);
tools/regression/sockets/unix_gc/unix_gc.c
738
close2(fd[1], fd[0]);
tools/regression/sockets/unix_gc/unix_gc.c
739
fd[0] = ff[0];
tools/regression/sockets/unix_gc/unix_gc.c
740
fd[1] = ff[1];
tools/regression/sockets/unix_gc/unix_gc.c
742
close2(fd[0], fd[1]);
tools/regression/sockets/unix_gc/unix_gc.c
89
sendfd(int fd, int fdtosend)
tools/regression/sockets/unix_gc/unix_gc.c
92
struct message { struct cmsghdr msg_hdr; int fd; } m;
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
148
int fd, i;
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
155
fd = socket(PF_UNIX, SOCK_DGRAM, 0);
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
156
if (fd < 0) {
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
160
len = sendto(fd, &c, sizeof(c), 0, (struct sockaddr *)&sun,
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
164
close(fd);
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
72
int fd, i;
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
79
fd = socket(PF_UNIX, SOCK_STREAM, 0);
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
80
if (fd < 0) {
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
84
len = sendto(fd, &c, sizeof(c), 0, (struct sockaddr *)&sun,
tools/regression/sockets/unix_sendtorace/unix_sendtorace.c
88
close(fd);
tools/regression/sockets/zerosend/zerosend.c
245
int fd[2];
tools/regression/sockets/zerosend/zerosend.c
247
setup_udp("udp_0send", fd, PORT1, PORT2);
tools/regression/sockets/zerosend/zerosend.c
248
try_0send("udp_0send", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
249
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
251
setup_udp("udp_0write", fd, PORT1 + 10, PORT2 + 10);
tools/regression/sockets/zerosend/zerosend.c
252
try_0write("udp_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
253
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
255
setup_tcp("tcp_0send", fd, PORT1);
tools/regression/sockets/zerosend/zerosend.c
256
try_0send("tcp_0send", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
257
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
259
setup_tcp("tcp_0write", fd, PORT1 + 10);
tools/regression/sockets/zerosend/zerosend.c
260
try_0write("tcp_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
261
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
263
setup_udsstream("udsstream_0send", fd);
tools/regression/sockets/zerosend/zerosend.c
264
try_0send("udsstream_0send", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
265
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
267
setup_udsstream("udsstream_0write", fd);
tools/regression/sockets/zerosend/zerosend.c
268
try_0write("udsstream_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
269
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
271
setup_udsdgram("udsdgram_0send", fd);
tools/regression/sockets/zerosend/zerosend.c
272
try_0send("udsdgram_0send", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
273
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
275
setup_udsdgram("udsdgram_0write", fd);
tools/regression/sockets/zerosend/zerosend.c
276
try_0write("udsdgram_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
277
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
279
setup_pipe("pipe_0write", fd);
tools/regression/sockets/zerosend/zerosend.c
280
try_0write("pipd_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
281
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
283
setup_fifo("fifo_0write", fd);
tools/regression/sockets/zerosend/zerosend.c
284
try_0write("fifo_0write", fd[0]);
tools/regression/sockets/zerosend/zerosend.c
285
close_both(fd);
tools/regression/sockets/zerosend/zerosend.c
47
try_0send(const char *test, int fd)
tools/regression/sockets/zerosend/zerosend.c
53
len = send(fd, &ch, 0, 0);
tools/regression/sockets/zerosend/zerosend.c
61
try_0write(const char *test, int fd)
tools/regression/sockets/zerosend/zerosend.c
67
len = write(fd, &ch, 0);
tools/regression/tmpfs/h_tools.c
111
int fd;
tools/regression/tmpfs/h_tools.c
113
fd = open(argv[i], O_RDONLY);
tools/regression/tmpfs/h_tools.c
114
if (fd == -1)
tools/regression/tmpfs/h_tools.c
117
EV_SET(&changes[i], fd, EVFILT_VNODE,
tools/regression/tmpfs/h_tools.c
200
int error, fd;
tools/regression/tmpfs/h_tools.c
206
fd = socket(PF_LOCAL, SOCK_STREAM, 0);
tools/regression/tmpfs/h_tools.c
207
if (fd == -1) {
tools/regression/tmpfs/h_tools.c
215
error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
tools/regression/tmpfs/h_tools.c
221
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
107
len = write(fd, block, BLOCKSIZE);
tools/regression/ufs/uprintf/ufs_uprintf.c
110
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
116
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
130
int fd, i, max;
tools/regression/ufs/uprintf/ufs_uprintf.c
138
fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600);
tools/regression/ufs/uprintf/ufs_uprintf.c
139
if (fd < 0)
tools/regression/ufs/uprintf/ufs_uprintf.c
141
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
151
fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600);
tools/regression/ufs/uprintf/ufs_uprintf.c
152
if (fd < 0 && errno != ENOSPC) {
tools/regression/ufs/uprintf/ufs_uprintf.c
156
if (fd >= 0) {
tools/regression/ufs/uprintf/ufs_uprintf.c
158
" %d", path, fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
159
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
70
int fd, i;
tools/regression/ufs/uprintf/ufs_uprintf.c
72
fd = open(BLOCKS_FILENAME, O_CREAT | O_TRUNC | O_RDWR, 0600);
tools/regression/ufs/uprintf/ufs_uprintf.c
73
if (fd < 0)
tools/regression/ufs/uprintf/ufs_uprintf.c
83
len = write(fd, block, BLOCKSIZE);
tools/regression/ufs/uprintf/ufs_uprintf.c
89
close(fd);
tools/regression/ufs/uprintf/ufs_uprintf.c
97
close(fd);
tools/test/gpioevents/gpioevents.c
259
fds.fd = handle;
tools/test/ppsapi/ppsapitest.c
31
int fd;
tools/test/ppsapi/ppsapitest.c
71
fd = open(argv[0], O_RDONLY);
tools/test/ppsapi/ppsapitest.c
72
if (fd < 0)
tools/test/ppsapi/ppsapitest.c
75
fd = 0;
tools/test/ppsapi/ppsapitest.c
77
i = time_pps_create(fd, &ph);
tools/test/stress2/testcases/creat/creat.c
110
int fd, i, j;
tools/test/stress2/testcases/creat/creat.c
117
if ((fd = creat(file, 0660)) == -1) {
tools/test/stress2/testcases/creat/creat.c
123
if (fd != -1 && close(fd) == -1)
tools/test/stress2/testcases/link/link.c
108
int fd, i, j;
tools/test/stress2/testcases/link/link.c
116
if ((fd = creat(file, 0660)) == -1) {
tools/test/stress2/testcases/link/link.c
122
if (fd != -1 && close(fd) == -1)
tools/test/stress2/testcases/lockf/lockf.c
139
if ((fd = open(file,O_CREAT | O_TRUNC | O_RDWR, 0600)) == -1) {
tools/test/stress2/testcases/lockf/lockf.c
145
if (write(fd, &sem, sizeof(sem)) != sizeof(sem))
tools/test/stress2/testcases/lockf/lockf.c
147
if (lseek(fd, 0, SEEK_SET) == -1)
tools/test/stress2/testcases/lockf/lockf.c
177
close(fd);
tools/test/stress2/testcases/lockf/lockf.c
44
static int fd;
tools/test/stress2/testcases/lockf/lockf.c
53
r = lockf(fd, F_LOCK, 0);
tools/test/stress2/testcases/lockf/lockf.c
57
if (lseek(fd, 0, SEEK_SET) == -1) // XXX
tools/test/stress2/testcases/lockf/lockf.c
59
r = read(fd, &sem, sizeof(sem));
tools/test/stress2/testcases/lockf/lockf.c
61
err(1, "get: read(%d)", fd);
tools/test/stress2/testcases/lockf/lockf.c
66
if (lseek(fd, 0, SEEK_SET) == -1)
tools/test/stress2/testcases/lockf/lockf.c
68
if (lockf(fd, F_ULOCK, 0) == -1)
tools/test/stress2/testcases/lockf/lockf.c
78
r = lockf(fd, F_LOCK, 0);
tools/test/stress2/testcases/lockf/lockf.c
82
if (read(fd, &sem, sizeof(sem)) != sizeof(sem))
tools/test/stress2/testcases/lockf/lockf.c
83
err(1, "incr: read(%d)", fd);
tools/test/stress2/testcases/lockf/lockf.c
84
if (lseek(fd, 0, SEEK_SET) == -1)
tools/test/stress2/testcases/lockf/lockf.c
87
if (write(fd, &sem, sizeof(sem)) != sizeof(sem))
tools/test/stress2/testcases/lockf/lockf.c
89
if (lseek(fd, 0, SEEK_SET) == -1)
tools/test/stress2/testcases/lockf/lockf.c
91
if (lockf(fd, F_ULOCK, 0) == -1)
tools/test/stress2/testcases/lockf2/lockf2.c
107
if ((fd = open(file, O_RDWR, 0600)) == -1)
tools/test/stress2/testcases/lockf2/lockf2.c
112
if (lseek(fd, pos, SEEK_SET) == -1)
tools/test/stress2/testcases/lockf2/lockf2.c
118
r = lockf(fd, F_LOCK, size);
tools/test/stress2/testcases/lockf2/lockf2.c
123
if (lockf(fd, F_ULOCK, size) == -1)
tools/test/stress2/testcases/lockf2/lockf2.c
127
close(fd);
tools/test/stress2/testcases/lockf2/lockf2.c
49
static int fd;
tools/test/stress2/testcases/lockf2/lockf2.c
84
if ((fd = open(file,O_CREAT | O_TRUNC | O_RDWR, 0600)) == -1)
tools/test/stress2/testcases/lockf2/lockf2.c
88
if (write(fd, &buf, sizeof(buf)) != sizeof(buf))
tools/test/stress2/testcases/lockf2/lockf2.c
90
close(fd);
tools/test/stress2/testcases/mkfifo/mkfifo.c
49
int *buf, fd, n;
tools/test/stress2/testcases/mkfifo/mkfifo.c
52
if ((fd = open(path, O_RDONLY | O_NONBLOCK)) < 0)
tools/test/stress2/testcases/mkfifo/mkfifo.c
58
FD_SET(fd, &set);
tools/test/stress2/testcases/mkfifo/mkfifo.c
61
if (select(fd + 1, &set, NULL, NULL, &tv) == 1) {
tools/test/stress2/testcases/mkfifo/mkfifo.c
62
if ((n = read(fd, buf, bufsize)) < 0)
tools/test/stress2/testcases/mkfifo/mkfifo.c
65
close(fd);
tools/test/stress2/testcases/mkfifo/mkfifo.c
71
int *buf, fd;
tools/test/stress2/testcases/mkfifo/mkfifo.c
74
if ((fd = open(path, O_WRONLY)) < 0) {
tools/test/stress2/testcases/mkfifo/mkfifo.c
82
if (write(fd, buf, bufsize) < 0)
tools/test/stress2/testcases/mkfifo/mkfifo.c
83
err(1, "write(%d), %s:%d", fd, __FILE__, __LINE__);
tools/test/stress2/testcases/mkfifo/mkfifo.c
84
close(fd);
tools/test/stress2/testcases/openat/openat.c
124
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
tools/test/stress2/testcases/openat/openat.c
146
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
tools/test/stress2/testcases/openat/openat.c
151
if (renameat(fd, file, fd, file2) == -1)
tools/test/stress2/testcases/openat/openat.c
171
if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1)
tools/test/stress2/testcases/openat/openat.c
174
if (unlinkat(fd, file, 0) == -1)
tools/test/stress2/testcases/openat/openat.c
45
static int fd;
tools/test/stress2/testcases/openat/openat.c
95
if ((fd = open(path2, O_RDONLY)) == -1)
tools/test/stress2/testcases/rw/rw.c
130
int fd;
tools/test/stress2/testcases/rw/rw.c
134
if ((fd = creat(file, 0660)) == -1)
tools/test/stress2/testcases/rw/rw.c
147
if (write(fd, buf, to) != to)
tools/test/stress2/testcases/rw/rw.c
150
if (close(fd) == -1)
tools/test/stress2/testcases/rw/rw.c
153
if ((fd = open(file, O_RDONLY)) == -1)
tools/test/stress2/testcases/rw/rw.c
160
if (read(fd, buf, to) != to)
tools/test/stress2/testcases/rw/rw.c
175
if (close(fd) == -1)
tools/test/stress2/tools/bench.c
106
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
109
close(fd);
tools/test/stress2/tools/bench.c
121
int fd, i, j;
tools/test/stress2/tools/bench.c
135
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
138
close(fd);
tools/test/stress2/tools/bench.c
154
int fd, i, j;
tools/test/stress2/tools/bench.c
168
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
171
close(fd);
tools/test/stress2/tools/bench.c
187
int fd, i;
tools/test/stress2/tools/bench.c
200
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
203
if (write(fd, buf, sizeof(buf)) != sizeof(buf))
tools/test/stress2/tools/bench.c
205
close(fd);
tools/test/stress2/tools/bench.c
209
if ((fd = open(file, O_RDONLY)) == -1)
tools/test/stress2/tools/bench.c
211
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
tools/test/stress2/tools/bench.c
213
close(fd);
tools/test/stress2/tools/bench.c
226
int fd, i;
tools/test/stress2/tools/bench.c
240
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
243
if (write(fd, buf, siz) != siz)
tools/test/stress2/tools/bench.c
245
close(fd);
tools/test/stress2/tools/bench.c
249
if ((fd = open(file, O_RDONLY)) == -1)
tools/test/stress2/tools/bench.c
251
if (read(fd, buf, siz) != siz)
tools/test/stress2/tools/bench.c
253
close(fd);
tools/test/stress2/tools/bench.c
62
int fd, i, j;
tools/test/stress2/tools/bench.c
75
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
tools/test/stress2/tools/bench.c
78
close(fd);
tools/test/stress2/tools/bench.c
94
int fd, i, j;
tools/test/stress2/tools/flip.c
116
if ((fd = open(argv[0], O_RDWR)) == -1)
tools/test/stress2/tools/flip.c
120
if (fstat(fd, &st) == -1)
tools/test/stress2/tools/flip.c
131
if (lseek(fd, pos, SEEK_SET) == -1)
tools/test/stress2/tools/flip.c
133
if (read(fd, &ch, 1) != 1)
tools/test/stress2/tools/flip.c
139
if (lseek(fd, pos, SEEK_SET) == -1)
tools/test/stress2/tools/flip.c
141
if (write(fd, &ch, 1) != 1)
tools/test/stress2/tools/flip.c
88
int c, fd, i, times;
tools/test/stress2/tools/fstool.c
50
int fd, i, j, len;
tools/test/stress2/tools/fstool.c
71
if ((fd = creat(file, 0660)) == -1) {
tools/test/stress2/tools/fstool.c
77
if (write(fd, buffer, len) != len)
tools/test/stress2/tools/fstool.c
80
if (fd != -1 && close(fd) == -1)
tools/test/stress2/tools/lsholes.c
100
close(fd);
tools/test/stress2/tools/lsholes.c
45
int fd, n;
tools/test/stress2/tools/lsholes.c
54
if ((fd = open(name, O_RDONLY)) == -1)
tools/test/stress2/tools/lsholes.c
56
if (fstat(fd, &st))
tools/test/stress2/tools/lsholes.c
58
if ((mn = fpathconf(fd, _PC_MIN_HOLE_SIZE)) == -1)
tools/test/stress2/tools/lsholes.c
66
hole = lseek(fd, pos, SEEK_HOLE);
tools/test/stress2/tools/lsholes.c
69
data = lseek(fd, pos, SEEK_DATA);
tools/test/stress2/tools/serial.c
15
int fd;
tools/test/stress2/tools/serial.c
25
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0)
tools/test/stress2/tools/serial.c
28
if (lseek(fd, size - 1, SEEK_SET) == -1)
tools/test/stress2/tools/serial.c
32
if (write(fd, "\0", 1) != 1)
tools/test/stress2/tools/serial.c
35
if ((cp = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED)
tools/test/stress2/tools/serial.c
43
close(fd);
tools/test/stress2/tools/zapsb.c
36
int i, fd;
tools/test/stress2/tools/zapsb.c
44
if ((fd = open(fs, O_RDWR, 0)) < 0)
tools/test/stress2/tools/zapsb.c
47
if (lseek(fd, (off_t)(sblock_try[i]), SEEK_SET) < 0)
tools/test/stress2/tools/zapsb.c
49
if (read(fd, sblock, sizeof(sblock)) != sizeof(sblock))
tools/test/stress2/tools/zapsb.c
69
if (lseek(fd, (off_t)(sblock_try[i]), SEEK_SET) < 0)
tools/test/stress2/tools/zapsb.c
71
if (write(fd, sblock, sizeof(sblock)) != sizeof(sblock))
tools/test/stress2/tools/zapsb.c
73
(void)close(fd);
tools/test/upsdl/upsdl.c
123
int startIO(int fd,char *buffer)
tools/test/upsdl/upsdl.c
126
len = write(fd,buffer,2*pagesize);
tools/test/upsdl/upsdl.c
39
int startIO(int fd,char *buffer);
tools/test/upsdl/upsdl.c
49
int fd;
tools/test/upsdl/upsdl.c
54
fd = open(filename,O_CREAT | O_TRUNC | O_RDWR,S_IRWXU);
tools/test/upsdl/upsdl.c
55
if (fd == -1)
tools/test/upsdl/upsdl.c
58
return fd;
tools/test/upsdl/upsdl.c
61
len = write(fd,wbuffer,FILESIZE);
tools/test/upsdl/upsdl.c
68
status = fsync(fd);
tools/test/upsdl/upsdl.c
75
addr = mmap(NULL,FILESIZE, PROT_READ | PROT_WRITE , MAP_SHARED, fd, 0);
tools/test/upsdl/upsdl.c
91
*fdp = fd;
tools/tools/aac/aac_checkq.c
56
int fd, retval, queue;
tools/tools/aac/aac_checkq.c
61
fd = open("/dev/aac0", O_RDWR);
tools/tools/aac/aac_checkq.c
62
if (fd == -1) {
tools/tools/aac/aac_checkq.c
71
retval = ioctl(fd, AACIO_STATS, &sr);
tools/tools/aac/aac_checkq.c
79
close(fd);
tools/tools/ath/arcode/arcode.c
111
close(fd);
tools/tools/ath/arcode/arcode.c
74
int fd;
tools/tools/ath/arcode/arcode.c
83
fd = open(file, O_RDONLY);
tools/tools/ath/arcode/arcode.c
84
if (fd < 0) {
tools/tools/ath/arcode/arcode.c
90
r = read(fd, &a, sizeof(a));
tools/tools/ath/ath_prom_read/ath_prom_read.c
106
fd = fopen(optarg, "r");
tools/tools/ath/ath_prom_read/ath_prom_read.c
107
if (fd == NULL)
tools/tools/ath/ath_prom_read/ath_prom_read.c
84
FILE *fd = NULL;
tools/tools/ath/athaggrstats/athaggrstats.c
334
ath_print_verbose(struct bsdstat *sf, FILE *fd)
tools/tools/ath/athaggrstats/athaggrstats.c
351
fprintf(fd, "%s%-*s %s\n", indent, width, s,
tools/tools/ath/athaggrstats/athaggrstats.c
356
fprintf(fd, "\nAggregate size profile:\n\n");
tools/tools/ath/athaggrstats/athaggrstats.c
358
fprintf(fd, "%2d: %12u%s",
tools/tools/ath/athaggrstats/athaggrstats.c
363
fprintf(fd, "\n");
tools/tools/ath/athalq/main.c
110
int fd;
tools/tools/ath/athalq/main.c
121
fd = open(file, O_RDONLY);
tools/tools/ath/athalq/main.c
122
if (fd < 0) {
tools/tools/ath/athalq/main.c
134
r = read(fd, buf + buflen, READBUF_SIZE - buflen);
tools/tools/ath/athalq/main.c
221
close(fd);
tools/tools/ath/athdecode/main.c
109
opmark(FILE *fd, int i, const struct athregrec *r)
tools/tools/ath/athdecode/main.c
111
fprintf(fd, "\n%05d: ", i);
tools/tools/ath/athdecode/main.c
114
fprintf(fd, "ar%uReset %s", state.chipnum,
tools/tools/ath/athdecode/main.c
118
fprintf(fd, "ar%u_reset.c; line %u", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
122
fprintf(fd, "ar%uReset (done), FAIL, error %u",
tools/tools/ath/athdecode/main.c
125
fprintf(fd, "ar%uReset (done), OK", state.chipnum);
tools/tools/ath/athdecode/main.c
128
fprintf(fd, "ar%uChipReset, channel %u MHz", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
131
fprintf(fd, "ar%uPerCalibration, channel %u MHz", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
134
fprintf(fd, "ar%uSetChannel, channel %u MHz", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
139
fprintf(fd, "ar%uAniReset, HAL_M_STA", state.chipnum);
tools/tools/ath/athdecode/main.c
142
fprintf(fd, "ar%uAniReset, HAL_M_IBSS", state.chipnum);
tools/tools/ath/athdecode/main.c
145
fprintf(fd, "ar%uAniReset, HAL_M_HOSTAP", state.chipnum);
tools/tools/ath/athdecode/main.c
148
fprintf(fd, "ar%uAniReset, HAL_M_MONITOR", state.chipnum);
tools/tools/ath/athdecode/main.c
151
fprintf(fd, "ar%uAniReset, opmode %u", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
156
fprintf(fd, "ar%uAniPoll, listenTime %u", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
161
fprintf(fd, "ar%uAniControl, PRESENT", state.chipnum);
tools/tools/ath/athdecode/main.c
164
fprintf(fd, "ar%uAniControl, NOISE_IMMUNITY", state.chipnum);
tools/tools/ath/athdecode/main.c
167
fprintf(fd, "ar%uAniControl, OFDM_WEAK_SIGNAL", state.chipnum);
tools/tools/ath/athdecode/main.c
170
fprintf(fd, "ar%uAniControl, CCK_WEAK_SIGNAL", state.chipnum);
tools/tools/ath/athdecode/main.c
173
fprintf(fd, "ar%uAniControl, FIRSTEP_LEVEL", state.chipnum);
tools/tools/ath/athdecode/main.c
176
fprintf(fd, "ar%uAniControl, SPUR_IMMUNITY", state.chipnum);
tools/tools/ath/athdecode/main.c
179
fprintf(fd, "ar%uAniControl, MODE", state.chipnum);
tools/tools/ath/athdecode/main.c
182
fprintf(fd, "ar%uAniControl, PHYERR_RESET", state.chipnum);
tools/tools/ath/athdecode/main.c
185
fprintf(fd, "ar%uAniControl, cmd %u", state.chipnum, r->val);
tools/tools/ath/athdecode/main.c
190
fprintf(fd, "mark #%u value %u/0x%x", r->reg, r->val, r->val);
tools/tools/ath/athdecode/main.c
373
oprw(FILE *fd, int recnum, struct athregrec *r)
tools/tools/ath/athdecode/main.c
380
fprintf(fd, "\n%05d: [%d] ", recnum, r->threadid);
tools/tools/ath/athdecode/main.c
408
fprintf(fd, "%-30s %s 0x%x", buf, r->op ? "<=" : "=>", r->val);
tools/tools/ath/athdecode/main.c
416
putc(tmp ? ',' : '<', fd);
tools/tools/ath/athdecode/main.c
418
putc(n, fd);
tools/tools/ath/athdecode/main.c
425
putc('>', fd);
tools/tools/ath/athdecode/main.c
55
static void oprw(FILE *fd, int recnum, struct athregrec *r);
tools/tools/ath/athdecode/main.c
60
int fd, i, nrecs, same;
tools/tools/ath/athdecode/main.c
68
fd = open(filename, O_RDONLY);
tools/tools/ath/athdecode/main.c
69
if (fd < 0)
tools/tools/ath/athdecode/main.c
71
if (fstat(fd, &sb) < 0)
tools/tools/ath/athdecode/main.c
73
addr = mmap(0, sb.st_size, PROT_READ, MAP_PRIVATE|MAP_NOCORE, fd, 0);
tools/tools/ath/athpow/athpow.c
137
printPcdacTable(FILE *fd, u_int16_t pcdac[], u_int n)
tools/tools/ath/athpow/athpow.c
142
fprintf(fd, "[%2u] %04x %04x [%2u] %04x %04x\n",
tools/tools/ath/athpow/athpow.c
148
printPowerPerRate(FILE *fd, u_int16_t ratesArray[], u_int n)
tools/tools/ath/athpow/athpow.c
159
fprintf(fd, " %s %3d.%1d dBm | %s %3d.%1d dBm\n",
tools/tools/ath/athpow/athpow.c
168
printRevs(FILE *fd, const HAL_REVS *revs)
tools/tools/ath/athpow/athpow.c
172
fprintf(fd, "PCI device id 0x%x subvendor id 0x%x\n",
tools/tools/ath/athpow/athpow.c
174
fprintf(fd, "mac %d.%d phy %d.%d"
tools/tools/ath/athpow/athpow.c
183
fprintf(fd, " 5ghz radio %d.%d 2ghz radio %d.%d (%s)\n"
tools/tools/ath/athpow/athpow.c
191
fprintf(fd, " radio %d.%d (%s)\n"
tools/tools/ath/athpow/athpow.c
60
static void printPcdacTable(FILE *fd, u_int16_t pcdac[], u_int n);
tools/tools/ath/athpow/athpow.c
61
static void printPowerPerRate(FILE *fd, u_int16_t ratesArray[], u_int n);
tools/tools/ath/athpow/athpow.c
62
static void printRevs(FILE *fd, const HAL_REVS *revs);
tools/tools/ath/athprom/athprom.c
114
fd = fopen(optarg, "r");
tools/tools/ath/athprom/athprom.c
115
if (fd == NULL)
tools/tools/ath/athprom/athprom.c
162
if (fd == NULL) {
tools/tools/ath/athprom/athprom.c
163
fd = opentemplate(DIR_TEMPLATE);
tools/tools/ath/athprom/athprom.c
164
if (fd == NULL)
tools/tools/ath/athprom/athprom.c
165
fd = opentemplate(".");
tools/tools/ath/athprom/athprom.c
166
if (fd == NULL)
tools/tools/ath/athprom/athprom.c
171
parseTemplate(fd, stdout);
tools/tools/ath/athprom/athprom.c
172
fclose(fd);
tools/tools/ath/athprom/athprom.c
226
token(FILE *fd, char id[], int maxid, const char *what)
tools/tools/ath/athprom/athprom.c
232
c = getc(fd);
tools/tools/ath/athprom/athprom.c
236
ungetc(c, fd);
tools/tools/ath/athprom/athprom.c
252
skipto(FILE *fd, const char *what)
tools/tools/ath/athprom/athprom.c
258
c = getc(fd);
tools/tools/ath/athprom/athprom.c
262
if (token(fd, id, MAXID, ".directive") == EOF)
tools/tools/ath/athprom/athprom.c
269
c = getc(fd);
tools/tools/ath/athprom/athprom.c
284
skipws(FILE *fd)
tools/tools/ath/athprom/athprom.c
289
while ((c = getc(fd)) != EOF && isblank(c))
tools/tools/ath/athprom/athprom.c
292
ungetc(c, fd);
tools/tools/ath/athprom/athprom.c
378
printAntennaControl(FILE *fd, int ant)
tools/tools/ath/athprom/athprom.c
380
fprintf(fd, "0x%02X", eeprom.ee_antennaControl[ant][curmode]);
tools/tools/ath/athprom/athprom.c
384
printEdge(FILE *fd, int edge)
tools/tools/ath/athprom/athprom.c
390
fprintf(fd, " -- ");
tools/tools/ath/athprom/athprom.c
392
fprintf(fd, "%04d", pRdEdgePwrInfo[edge].rdEdge);
tools/tools/ath/athprom/athprom.c
396
printEdgePower(FILE *fd, int edge)
tools/tools/ath/athprom/athprom.c
402
fprintf(fd, " -- ");
tools/tools/ath/athprom/athprom.c
404
fprintf(fd, "%2d.%d",
tools/tools/ath/athprom/athprom.c
410
printEdgeFlag(FILE *fd, int edge)
tools/tools/ath/athprom/athprom.c
416
fprintf(fd, "--");
tools/tools/ath/athprom/athprom.c
418
fprintf(fd, " %1d", pRdEdgePwrInfo[edge].flag);
tools/tools/ath/athprom/athprom.c
436
printQuarterDbmPower(FILE *fd, int16_t power25dBm)
tools/tools/ath/athprom/athprom.c
438
fprintf(fd, "%2d.%02d", power25dBm / 4, (power25dBm % 4) * 25);
tools/tools/ath/athprom/athprom.c
442
printHalfDbmPower(FILE *fd, int16_t power5dBm)
tools/tools/ath/athprom/athprom.c
444
fprintf(fd, "%2d.%d", power5dBm / 2, (power5dBm % 2) * 5);
tools/tools/ath/athprom/athprom.c
448
printVpd(FILE *fd, int vpd)
tools/tools/ath/athprom/athprom.c
450
fprintf(fd, "[%3d]", vpd);
tools/tools/ath/athprom/athprom.c
454
printPcdacValue(FILE *fd, int v)
tools/tools/ath/athprom/athprom.c
456
fprintf(fd, "%2d.%02d", v / EEP_SCALE, v % EEP_SCALE);
tools/tools/ath/athprom/athprom.c
487
eevar(FILE *fd, const char *var)
tools/tools/ath/athprom/athprom.c
492
fprintf(fd, "%s",
tools/tools/ath/athprom/athprom.c
497
fprintf(fd, "%04x", eeprom.ee_version);
tools/tools/ath/athprom/athprom.c
499
fprintf(fd, "%2d", eeprom.ee_version >> 12);
tools/tools/ath/athprom/athprom.c
501
fprintf(fd, "%2d", eeprom.ee_version & 0xfff);
tools/tools/ath/athprom/athprom.c
503
fprintf(fd, "%03x", eeprom.ee_earStart);
tools/tools/ath/athprom/athprom.c
505
fprintf(fd, "%03x", eeprom.ee_targetPowersStart);
tools/tools/ath/athprom/athprom.c
507
fprintf(fd, "%3d", eeprom.ee_eepMap);
tools/tools/ath/athprom/athprom.c
509
fprintf(fd, "%3d", eeprom.ee_exist32kHzCrystal);
tools/tools/ath/athprom/athprom.c
511
fprintf(fd , "%3d", eeprom.ee_eepMap2PowerCalStart);
tools/tools/ath/athprom/athprom.c
513
fprintf(fd , "%1d", eeprom.ee_Amode);
tools/tools/ath/athprom/athprom.c
515
fprintf(fd , "%1d", eeprom.ee_Bmode);
tools/tools/ath/athprom/athprom.c
517
fprintf(fd , "%1d", eeprom.ee_Gmode);
tools/tools/ath/athprom/athprom.c
520
fprintf(fd, "%03X ", eeprom.ee_regdomain >> 15);
tools/tools/ath/athprom/athprom.c
522
fprintf(fd, "%-3dC", eeprom.ee_regdomain & 0xfff);
tools/tools/ath/athprom/athprom.c
524
fprintf(fd, "%1d", eeprom.ee_turbo2Disable);
tools/tools/ath/athprom/athprom.c
526
fprintf(fd, "%1d", eeprom.ee_turbo5Disable);
tools/tools/ath/athprom/athprom.c
528
fprintf(fd, "%1d", eeprom.ee_rfKill);
tools/tools/ath/athprom/athprom.c
530
fprintf(fd, "%1d", eeprom.ee_disableXr5);
tools/tools/ath/athprom/athprom.c
532
fprintf(fd, "%1d", eeprom.ee_disableXr2);
tools/tools/ath/athprom/athprom.c
534
fprintf(fd, "%2d", eeprom.ee_turbo2WMaxPower5);
tools/tools/ath/athprom/athprom.c
536
fprintf(fd, "%2d", eeprom.ee_cckOfdmPwrDelta);
tools/tools/ath/athprom/athprom.c
538
fprintf(fd, "%2d", eeprom.ee_gainI[curmode]);
tools/tools/ath/athprom/athprom.c
540
fprintf(fd, "%1x",
tools/tools/ath/athprom/athprom.c
543
fprintf(fd, "0x%02x", eeprom.ee_falseDetectBackoff[curmode]);
tools/tools/ath/athprom/athprom.c
545
fprintf(fd, "%1x", eeprom.ee_deviceType);
tools/tools/ath/athprom/athprom.c
548
fprintf(fd, "0x%02x", eeprom.ee_switchSettling[curmode]);
tools/tools/ath/athprom/athprom.c
550
fprintf(fd, "%3d", eepromN.modalHeader[curmode].switchSettling);
tools/tools/ath/athprom/athprom.c
553
fprintf(fd, "%2d", eeprom.ee_adcDesiredSize[curmode]);
tools/tools/ath/athprom/athprom.c
555
fprintf(fd, "%3d", eepromN.modalHeader[curmode].adcDesiredSize);
tools/tools/ath/athprom/athprom.c
557
fprintf(fd, "0x%02x", eeprom.ee_xlnaGain[curmode]);
tools/tools/ath/athprom/athprom.c
559
fprintf(fd, "0x%02x", eeprom.ee_txEndToXLNAOn[curmode]);
tools/tools/ath/athprom/athprom.c
562
fprintf(fd, "0x%02x", eeprom.ee_thresh62[curmode]);
tools/tools/ath/athprom/athprom.c
564
fprintf(fd, "%3d", eepromN.modalHeader[curmode].thresh62);
tools/tools/ath/athprom/athprom.c
566
fprintf(fd, "%3d", eepromN.modalHeader[curmode].txEndToRxOn);
tools/tools/ath/athprom/athprom.c
569
fprintf(fd, "0x%02x", eeprom.ee_txEndToXPAOff[curmode]);
tools/tools/ath/athprom/athprom.c
571
fprintf(fd, "%3d", eepromN.modalHeader[curmode].txEndToXpaOff);
tools/tools/ath/athprom/athprom.c
574
fprintf(fd, "0x%02x", eeprom.ee_txFrameToXPAOn[curmode]);
tools/tools/ath/athprom/athprom.c
576
fprintf(fd, "%3d", eepromN.modalHeader[curmode].txEndToRxOn);
tools/tools/ath/athprom/athprom.c
579
fprintf(fd, "%2d", eeprom.ee_pgaDesiredSize[curmode]);
tools/tools/ath/athprom/athprom.c
581
fprintf(fd, "%3d", eepromN.modalHeader[curmode].pgaDesiredSize);
tools/tools/ath/athprom/athprom.c
583
fprintf(fd, "%3d", eeprom.ee_noiseFloorThresh[curmode]);
tools/tools/ath/athprom/athprom.c
585
fprintf(fd, "%3d", eepromN.modalHeader[curmode].noiseFloorThreshCh[atoi(var+18)]);
tools/tools/ath/athprom/athprom.c
587
fprintf(fd, "%3d", eepromN.modalHeader[curmode].xlnaGainCh[atoi(var+10)]);
tools/tools/ath/athprom/athprom.c
589
fprintf(fd, "0x%02x", eeprom.ee_xgain[curmode]);
tools/tools/ath/athprom/athprom.c
592
fprintf(fd, "%1d", eeprom.ee_xpd[curmode]);
tools/tools/ath/athprom/athprom.c
594
fprintf(fd, "%3d", eepromN.modalHeader[curmode].xpd);
tools/tools/ath/athprom/athprom.c
596
fprintf(fd, "0x%02x", eeprom.ee_txrxAtten[curmode]);
tools/tools/ath/athprom/athprom.c
598
fprintf(fd, "0x%04X", eeprom.ee_capField);
tools/tools/ath/athprom/athprom.c
600
fprintf(fd, "0x%02x",
tools/tools/ath/athprom/athprom.c
603
fprintf(fd, "0x%02X",
tools/tools/ath/athprom/athprom.c
606
fprintf(fd, "%2d",
tools/tools/ath/athprom/athprom.c
609
fprintf(fd, "%2d",
tools/tools/ath/athprom/athprom.c
61
static void parseTemplate(FILE *ftemplate, FILE *fd);
tools/tools/ath/athprom/athprom.c
612
fprintf(fd, "0x%02x",
tools/tools/ath/athprom/athprom.c
615
printAntennaControl(fd, atoi(var+14));
tools/tools/ath/athprom/athprom.c
617
fprintf(fd, "0x%08X",
tools/tools/ath/athprom/athprom.c
620
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
623
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
626
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
629
fprintf(fd, "%3d", eepromN.modalHeader[curmode].xpdGain);
tools/tools/ath/athprom/athprom.c
631
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
634
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
637
printHalfDbmPower(fd, eepromN.modalHeader[curmode].pdGainOverlap);
tools/tools/ath/athprom/athprom.c
639
fprintf(fd, "%1d", eeprom.ee_ob1);
tools/tools/ath/athprom/athprom.c
641
fprintf(fd, "%1d", eeprom.ee_ob2);
tools/tools/ath/athprom/athprom.c
643
fprintf(fd, "%1d", eeprom.ee_ob3);
tools/tools/ath/athprom/athprom.c
645
fprintf(fd, "%1d", eeprom.ee_ob4);
tools/tools/ath/athprom/athprom.c
647
fprintf(fd, "%1d", eeprom.ee_db1);
tools/tools/ath/athprom/athprom.c
649
fprintf(fd, "%1d", eeprom.ee_db2);
tools/tools/ath/athprom/athprom.c
651
fprintf(fd, "%1d", eeprom.ee_db3);
tools/tools/ath/athprom/athprom.c
653
fprintf(fd, "%1d", eeprom.ee_db4);
tools/tools/ath/athprom/athprom.c
655
fprintf(fd, "%1d", eeprom.ee_obFor24);
tools/tools/ath/athprom/athprom.c
657
fprintf(fd, "%1d", eeprom.ee_ob2GHz[0]);
tools/tools/ath/athprom/athprom.c
659
fprintf(fd, "%1d", eeprom.ee_dbFor24);
tools/tools/ath/athprom/athprom.c
661
fprintf(fd, "%1d", eeprom.ee_db2GHz[0]);
tools/tools/ath/athprom/athprom.c
663
fprintf(fd, "%1d", eeprom.ee_obFor24g);
tools/tools/ath/athprom/athprom.c
665
fprintf(fd, "%1d", eeprom.ee_ob2GHz[1]);
tools/tools/ath/athprom/athprom.c
667
fprintf(fd, "%1d", eeprom.ee_dbFor24g);
tools/tools/ath/athprom/athprom.c
669
fprintf(fd, "%1d", eeprom.ee_db2GHz[1]);
tools/tools/ath/athprom/athprom.c
671
fprintf(fd, "%3d", eepromN.modalHeader[curmode].ob);
tools/tools/ath/athprom/athprom.c
673
fprintf(fd, "%3d", eepromN.modalHeader[curmode].db);
tools/tools/ath/athprom/athprom.c
675
fprintf(fd, "%3d", eepromN.modalHeader[curmode].xpaBiasLvl);
tools/tools/ath/athprom/athprom.c
677
printHalfDbmPower(fd, eepromN.modalHeader[curmode].pwrDecreaseFor2Chain);
tools/tools/ath/athprom/athprom.c
679
printHalfDbmPower(fd, eepromN.modalHeader[curmode].pwrDecreaseFor3Chain);
tools/tools/ath/athprom/athprom.c
681
fprintf(fd, "%3d", eepromN.modalHeader[curmode].txFrameToDataStart);
tools/tools/ath/athprom/athprom.c
683
fprintf(fd, "%3d", eepromN.modalHeader[curmode].txFrameToPaOn);
tools/tools/ath/athprom/athprom.c
685
fprintf(fd, "%3d", eepromN.modalHeader[curmode].ht40PowerIncForPdadc);
tools/tools/ath/athprom/athprom.c
687
fprintf(fd, "0x%04X", eepromN.baseEepHeader.checksum);
tools/tools/ath/athprom/athprom.c
689
fprintf(fd, "0x%04X", eepromN.baseEepHeader.length);
tools/tools/ath/athprom/athprom.c
691
fprintf(fd, "0x%04X", eepromN.baseEepHeader.regDmn[0]);
tools/tools/ath/athprom/athprom.c
693
fprintf(fd, "0x%04X", eepromN.baseEepHeader.regDmn[1]);
tools/tools/ath/athprom/athprom.c
695
fprintf(fd, "0x%04X", eepromN.baseEepHeader.txMask);
tools/tools/ath/athprom/athprom.c
697
fprintf(fd, "0x%04X", eepromN.baseEepHeader.rxMask);
tools/tools/ath/athprom/athprom.c
699
fprintf(fd, "0x%04X", eepromN.baseEepHeader.rfSilent);
tools/tools/ath/athprom/athprom.c
701
fprintf(fd, "0x%04X", eepromN.baseEepHeader.blueToothOptions);
tools/tools/ath/athprom/athprom.c
703
fprintf(fd, "0x%04X", eepromN.baseEepHeader.deviceCap);
tools/tools/ath/athprom/athprom.c
705
fprintf(fd, "%02X",
tools/tools/ath/athprom/athprom.c
708
fprintf(fd, "0x%02X", eepromN.baseEepHeader.opCapFlags);
tools/tools/ath/athprom/athprom.c
710
fprintf(fd, "0x%02X", eepromN.baseEepHeader.eepMisc);
tools/tools/ath/athprom/athprom.c
712
fprintf(fd, "%3d",
tools/tools/ath/athprom/athprom.c
716
fprintf(fd, "%2.2X", eepromN.custData[atoi(var+8)]);
tools/tools/ath/athprom/athprom.c
719
fprintf(fd, "0x%02x", pExpnPower->xpdMask);
tools/tools/ath/athprom/athprom.c
721
fprintf(fd, "0x%02x", pRaw->xpd_mask);
tools/tools/ath/athprom/athprom.c
724
fprintf(fd, "%2d", pExpnPower->numChannels);
tools/tools/ath/athprom/athprom.c
726
fprintf(fd, "%2d", pRaw->numChannels);
tools/tools/ath/athprom/athprom.c
729
fprintf(fd, "%4d", pExpnPower->pChannels[curchan]);
tools/tools/ath/athprom/athprom.c
731
fprintf(fd, "%4d", pRaw->pChannels[curchan]);
tools/tools/ath/athprom/athprom.c
741
printQuarterDbmPower(fd, maxPower_t4);
tools/tools/ath/athprom/athprom.c
743
fprintf(fd, "%4d", pRaw->pDataPerChannel[curchan].
tools/tools/ath/athprom/athprom.c
748
printQuarterDbmPower(fd, pRaw->pDataPerChannel[curchan].
tools/tools/ath/athprom/athprom.c
751
fprintf(fd, " ");
tools/tools/ath/athprom/athprom.c
753
printQuarterDbmPower(fd, pExpnPower->pDataPerChannel[curchan].
tools/tools/ath/athprom/athprom.c
758
printVpd(fd, pRaw->pDataPerChannel[curchan].
tools/tools/ath/athprom/athprom.c
76
FILE *fd;
tools/tools/ath/athprom/athprom.c
761
fprintf(fd, " ");
tools/tools/ath/athprom/athprom.c
763
fprintf(fd, "0x%2x", eeprom.ee_ctl[curctl] & 0xff);
tools/tools/ath/athprom/athprom.c
770
fprintf(fd, "%8s", ctlType[eeprom.ee_ctl[curctl] & CTL_MODE_M]);
tools/tools/ath/athprom/athprom.c
776
fprintf(fd, "%s", ctlRD[(eeprom.ee_ctl[curctl] >> 4) & 7]);
tools/tools/ath/athprom/athprom.c
778
printEdgePower(fd, atoi(var+11));
tools/tools/ath/athprom/athprom.c
780
printEdgeFlag(fd, atoi(var+10));
tools/tools/ath/athprom/athprom.c
782
printEdge(fd, atoi(var+6));
tools/tools/ath/athprom/athprom.c
784
fprintf(fd, "%4d", pPowerInfo[atoi(var+11)].testChannel);
tools/tools/ath/athprom/athprom.c
786
printHalfDbmPower(fd, pPowerInfo[atoi(var+8)].twicePwr6_24);
tools/tools/ath/athprom/athprom.c
788
printHalfDbmPower(fd, pPowerInfo[atoi(var+6)].twicePwr36);
tools/tools/ath/athprom/athprom.c
790
printHalfDbmPower(fd, pPowerInfo[atoi(var+6)].twicePwr48);
tools/tools/ath/athprom/athprom.c
792
printHalfDbmPower(fd, pPowerInfo[atoi(var+6)].twicePwr54);
tools/tools/ath/athprom/athprom.c
794
fprintf(fd, "%4d", pDataPerChannel[atoi(var+12)].channelValue);
tools/tools/ath/athprom/athprom.c
796
fprintf(fd, "%02d", pDataPerChannel[atoi(var+8)].pcdacMin);
tools/tools/ath/athprom/athprom.c
798
fprintf(fd, "%02d", pDataPerChannel[atoi(var+8)].pcdacMax);
tools/tools/ath/athprom/athprom.c
801
fprintf(fd, "%02d", pDataPerChannel[atoi(var+5)].
tools/tools/ath/athprom/athprom.c
804
fprintf(fd, "%02d",
tools/tools/ath/athprom/athprom.c
81
fd = fopen(filename, "r");
tools/tools/ath/athprom/athprom.c
810
printPcdacValue(fd,
tools/tools/ath/athprom/athprom.c
813
fprintf(fd, "%2d", singleXpd);
tools/tools/ath/athprom/athprom.c
82
if (fd == NULL && errno == ENOENT) {
tools/tools/ath/athprom/athprom.c
86
fd = fopen(filename, "r");
tools/tools/ath/athprom/athprom.c
868
parseTemplate(FILE *ftemplate, FILE *fd)
tools/tools/ath/athprom/athprom.c
87
if (fd != NULL) /* XXX verbose */
tools/tools/ath/athprom/athprom.c
90
return fd;
tools/tools/ath/athprom/athprom.c
96
FILE *fd = NULL;
tools/tools/ath/athprom/athprom.c
965
eevar(fd, id);
tools/tools/ath/athprom/athprom.c
973
fputc(c, fd);
tools/tools/ath/athregs/dumpregs.c
449
ath_hal_dumpregs(FILE *fd, int what)
tools/tools/ath/athregs/dumpregs.c
463
fprintf(fd, "%s%-8s", sep, dr->name);
tools/tools/ath/athregs/dumpregs.c
465
fprintf(fd, " [%04x]", dr->addr);
tools/tools/ath/athregs/dumpregs.c
467
fprintf(fd, "%s%04x", sep, dr->addr);
tools/tools/ath/athregs/dumpregs.c
468
fprintf(fd, " %08x", OS_REG_READ(ah, dr->addr));
tools/tools/ath/athregs/dumpregs.c
475
fprintf(fd, "\n");
tools/tools/ath/athregs/dumpregs.c
479
ath_hal_dumprange(FILE *fd, u_int a, u_int b)
tools/tools/ath/athregs/dumpregs.c
484
fprintf(fd,
tools/tools/ath/athregs/dumpregs.c
494
fprintf(fd
tools/tools/ath/athregs/dumpregs.c
503
fprintf(fd, "%04x %08x %04x %08x %04x %08x\n"
tools/tools/ath/athregs/dumpregs.c
510
fprintf(fd, "%04x %08x %04x %08x\n"
tools/tools/ath/athregs/dumpregs.c
516
fprintf(fd, "%04x %08x\n"
tools/tools/ath/athregs/dumpregs.c
524
ath_hal_dumpint(FILE *fd, int what)
tools/tools/ath/athregs/dumpregs.c
529
fprintf(fd, "IMR: %08x S0 %08x S1 %08x S2 %08x S3 %08x S4 %08x\n"
tools/tools/ath/athregs/dumpregs.c
537
fprintf(fd, "ISR: %08x S0 %08x S1 %08x S2 %08x S3 %08x S4 %08x\n"
tools/tools/ath/athregs/dumpregs.c
548
ath_hal_dumpqcu(FILE *fd, int what)
tools/tools/ath/athregs/dumpregs.c
553
fprintf(fd, "%-8s %08x %-8s %08x %-8s %08x\n"
tools/tools/ath/athregs/dumpregs.c
558
fprintf(fd, "Q_ONESHOTARM_SC %08x Q_ONESHOTARM_CC %08x\n"
tools/tools/ath/athregs/dumpregs.c
563
fprintf(fd, "Q[%u] TXDP %08x CBR %08x RDYT %08x MISC %08x STS %08x\n"
tools/tools/ath/athregs/dumpregs.c
574
ath_hal_dumpdcu(FILE *fd, int what)
tools/tools/ath/athregs/dumpregs.c
580
fprintf(fd, "D[%u] MASK %08x IFS %08x RTRY %08x CHNT %08x MISC %06x\n"
tools/tools/ath/athregs/dumpregs.c
591
ath_hal_dumpbb(FILE *fd, int what)
tools/tools/ath/athregs/dumpregs.c
607
ath_hal_dumprange(fd, brun, erun);
tools/tools/ath/athregs/dumpregs.c
612
ath_hal_dumprange(fd, brun, erun);
tools/tools/ath/athregs/dumpregs.c
617
ath_hal_dumprange(fd, brun, erun);
tools/tools/ath/athregs/dumpregs.c
63
static void ath_hal_dumpregs(FILE *fd, int what);
tools/tools/ath/athregs/dumpregs.c
64
static void ath_hal_dumprange(FILE *fd, u_int a, u_int b);
tools/tools/ath/athregs/dumpregs.c
65
static void ath_hal_dumpkeycache(FILE *fd, int nkeys);
tools/tools/ath/athregs/dumpregs.c
66
static void ath_hal_dumpint(FILE *fd, int what);
tools/tools/ath/athregs/dumpregs.c
663
ath_hal_dumpkeycache(FILE *fd, int nkeys)
tools/tools/ath/athregs/dumpregs.c
67
static void ath_hal_dumpqcu(FILE *fd, int what);
tools/tools/ath/athregs/dumpregs.c
68
static void ath_hal_dumpdcu(FILE *fd, int what);
tools/tools/ath/athregs/dumpregs.c
69
static void ath_hal_dumpbb(FILE *fd, int what);
tools/tools/ath/athregs/dumpregs.c
710
fprintf(fd, "\n");
tools/tools/ath/athregs/dumpregs.c
713
fprintf(fd, "KEY[%03u] MAC %s %-7s %02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x\n"
tools/tools/ath/athstats/athstats.c
1057
ath_print_verbose(struct bsdstat *sf, FILE *fd)
tools/tools/ath/athstats/athstats.c
1078
fprintf(fd, "%s%-*s %s\n", indent, width, s, athstats[i].desc);
tools/tools/ath/athstats/athstats.c
1081
fprintf(fd, "Antenna profile:\n");
tools/tools/ath/athstats/athstats.c
1084
fprintf(fd, "[%u] tx %8u rx %8u\n", i,
tools/tools/ath/athsurvey/athsurvey.c
165
FILE *fd = NULL;
tools/tools/ath/common/diag.h
56
extern void reportstats(FILE *fd, struct statshandler *sh);
tools/tools/ath/common/diag.h
57
extern void runstats(FILE *fd, struct statshandler *sh);
tools/tools/ath/common/diag.h
58
extern void reportcol(FILE *fd, u_int32_t v, const char *def_fmt,
tools/tools/bootparttest/bootparttest.c
103
disk.fd = open(argv[1], O_RDONLY);
tools/tools/bootparttest/bootparttest.c
104
if (disk.fd < 0)
tools/tools/bootparttest/bootparttest.c
110
disk.fd = g_open(argv[1], 0);
tools/tools/bootparttest/bootparttest.c
111
if (disk.fd < 0)
tools/tools/bootparttest/bootparttest.c
113
disk.mediasize = g_mediasize(disk.fd);
tools/tools/bootparttest/bootparttest.c
114
disk.sectorsize = g_sectorsize(disk.fd);
tools/tools/bootparttest/bootparttest.c
131
close(disk.fd);
tools/tools/bootparttest/bootparttest.c
133
g_close(disk.fd);
tools/tools/bootparttest/bootparttest.c
63
int fd;
tools/tools/bootparttest/bootparttest.c
80
ret = pread(disk.fd, buf, size,
tools/tools/cfi/cfi.c
106
int fd = getfd(O_RDONLY);
tools/tools/cfi/cfi.c
107
if (ioctl(fd, CFIOCGPLR, &plr) < 0)
tools/tools/cfi/cfi.c
109
close(fd);
tools/tools/cfi/cfi.c
116
int fd = getfd(O_WRONLY);
tools/tools/cfi/cfi.c
117
if (ioctl(fd, CFIOCSPLR, 0) < 0)
tools/tools/cfi/cfi.c
119
close(fd);
tools/tools/cfi/cfi.c
65
int fd = open(dvname, mode, 0);
tools/tools/cfi/cfi.c
66
if (fd < 0)
tools/tools/cfi/cfi.c
68
return fd;
tools/tools/cfi/cfi.c
75
int fd = getfd(O_RDONLY);
tools/tools/cfi/cfi.c
76
if (ioctl(fd, CFIOCGFACTORYPR, &v) < 0)
tools/tools/cfi/cfi.c
78
close(fd);
tools/tools/cfi/cfi.c
86
int fd = getfd(O_RDONLY);
tools/tools/cfi/cfi.c
87
if (ioctl(fd, CFIOCGOEMPR, &v) < 0)
tools/tools/cfi/cfi.c
89
close(fd);
tools/tools/cfi/cfi.c
96
int fd = getfd(O_WRONLY);
tools/tools/cfi/cfi.c
97
if (ioctl(fd, CFIOCSOEMPR, &v) < 0)
tools/tools/cfi/cfi.c
99
close(fd);
tools/tools/crypto/cryptocheck.c
1174
if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
tools/tools/crypto/cryptocheck.c
1565
if (ioctl(ses->fd, CIOCCRYPTAEAD, &caead) < 0)
tools/tools/crypto/cryptocheck.c
159
int fd;
tools/tools/crypto/cryptocheck.c
335
static int fd = -1;
tools/tools/crypto/cryptocheck.c
337
if (fd < 0) {
tools/tools/crypto/cryptocheck.c
338
fd = open("/dev/crypto", O_RDWR | O_CLOEXEC, 0);
tools/tools/crypto/cryptocheck.c
339
if (fd < 0)
tools/tools/crypto/cryptocheck.c
342
return (fd);
tools/tools/crypto/cryptocheck.c
475
int fd;
tools/tools/crypto/cryptocheck.c
477
fd = devcrypto();
tools/tools/crypto/cryptocheck.c
478
if (ioctl(fd, CIOCGSESSION2, sop) < 0) {
tools/tools/crypto/cryptocheck.c
481
ses->fd = -1;
tools/tools/crypto/cryptocheck.c
484
ses->fd = fd;
tools/tools/crypto/cryptocheck.c
493
if (ses->fd == -1)
tools/tools/crypto/cryptocheck.c
496
if (ioctl(ses->fd, CIOCFSESSION, &ses->ses) < 0)
tools/tools/crypto/cryptocheck.c
533
if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
tools/tools/crypto/cryptocheck.c
647
if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
tools/tools/crypto/cryptocheck.c
784
if (ioctl(ses->fd, CIOCCRYPT, &cop) < 0) {
tools/tools/crypto/cryptocheck.c
933
ret = ioctl(ses->fd, CIOCCRYPTAEAD, &caead);
tools/tools/crypto/cryptocheck.c
945
ret = ioctl(ses->fd, CIOCCRYPT, &cop);
tools/tools/cxgbtool/cxgbtool.c
1006
len = read(fd, op.buf, MAX_FW_IMAGE_SIZE + 1);
tools/tools/cxgbtool/cxgbtool.c
1016
close(fd);
tools/tools/cxgbtool/cxgbtool.c
1026
int fd, len;
tools/tools/cxgbtool/cxgbtool.c
1032
fd = open(fname, O_RDONLY);
tools/tools/cxgbtool/cxgbtool.c
1033
if (fd < 0)
tools/tools/cxgbtool/cxgbtool.c
1040
len = read(fd, op.buf, MAX_BOOT_IMAGE_SIZE + 1);
tools/tools/cxgbtool/cxgbtool.c
1051
close(fd);
tools/tools/cxgbtool/cxgbtool.c
128
static int fd = 0;
tools/tools/cxgbtool/cxgbtool.c
130
if (fd == 0) {
tools/tools/cxgbtool/cxgbtool.c
134
if ((fd = open(buf, O_RDWR)) < 0)
tools/tools/cxgbtool/cxgbtool.c
138
return ioctl(fd, cmd, data) < 0 ? -1 : 0;
tools/tools/cxgbtool/cxgbtool.c
991
int fd, len;
tools/tools/cxgbtool/cxgbtool.c
997
fd = open(fname, O_RDONLY);
tools/tools/cxgbtool/cxgbtool.c
998
if (fd < 0)
tools/tools/find-sb/find-sb.c
34
int fd;
tools/tools/find-sb/find-sb.c
61
fd = open(argv[0], O_RDONLY, 0);
tools/tools/find-sb/find-sb.c
62
if (fd < 0)
tools/tools/find-sb/find-sb.c
66
end = lseek(fd, offset, SEEK_SET);
tools/tools/find-sb/find-sb.c
76
justread = read(fd, &u.buf[len], DEV_BSIZE);
tools/tools/indent_wrapper/indent_wrapper.c
79
write_block(int fd, block_head_t *ph)
tools/tools/indent_wrapper/indent_wrapper.c
83
if (fd < 0)
tools/tools/indent_wrapper/indent_wrapper.c
87
if (write(fd, ptr->data, ptr->length) != ptr->length)
tools/tools/ioat/ioatcontrol.c
100
(void)ioctl(fd, IOAT_DMATEST, t);
tools/tools/ioat/ioatcontrol.c
101
close(fd);
tools/tools/ioat/ioatcontrol.c
110
int fd, ch;
tools/tools/ioat/ioatcontrol.c
234
fd = open("/dev/ioat_test", O_RDWR);
tools/tools/ioat/ioatcontrol.c
235
if (fd < 0) {
tools/tools/ioat/ioatcontrol.c
240
(void)ioctl(fd, IOAT_DMATEST, &t);
tools/tools/ioat/ioatcontrol.c
241
close(fd);
tools/tools/ioat/ioatcontrol.c
72
int fd;
tools/tools/ioat/ioatcontrol.c
94
fd = open("/dev/ioat_test", O_RDWR);
tools/tools/ioat/ioatcontrol.c
95
if (fd < 0) {
tools/tools/mfi/mfi_checkq.c
53
int fd, retval, queue;
tools/tools/mfi/mfi_checkq.c
58
fd = open("/dev/mfi0", O_RDWR);
tools/tools/mfi/mfi_checkq.c
59
if (fd == -1) {
tools/tools/mfi/mfi_checkq.c
68
retval = ioctl(fd, MFIIO_STATS, &sr);
tools/tools/mfi/mfi_checkq.c
76
close(fd);
tools/tools/mwl/mwlstats/mwlstats.c
513
mwl_print_verbose(struct bsdstat *sf, FILE *fd)
tools/tools/mwl/mwlstats/mwlstats.c
531
fprintf(fd, "%s%-*s %s\n", indent, width, s, f->desc);
tools/tools/mwl/mwlstats/mwlstats.c
534
fprintf(fd, "Antenna profile:\n");
tools/tools/mwl/mwlstats/mwlstats.c
537
fprintf(fd, "[%u] tx %8u rx %8u\n", i,
tools/tools/net80211/stumbler/stumbler.c
304
int fd = -1;
tools/tools/net80211/stumbler/stumbler.c
310
fd = open(buf, O_RDWR);
tools/tools/net80211/stumbler/stumbler.c
311
if(fd < 0) {
tools/tools/net80211/stumbler/stumbler.c
320
if(fd < 0)
tools/tools/net80211/stumbler/stumbler.c
326
if(ioctl(fd, BIOCSETIF, &ifr) < 0)
tools/tools/net80211/stumbler/stumbler.c
329
if (ioctl(fd, BIOCSDLT, &dlt) < 0)
tools/tools/net80211/stumbler/stumbler.c
333
if(ioctl(fd, BIOCIMMEDIATE, &i) < 0)
tools/tools/net80211/stumbler/stumbler.c
336
bpf_s = fd;
tools/tools/net80211/w00t/libw00t/w00t.c
106
if(fd == -1)
tools/tools/net80211/w00t/libw00t/w00t.c
112
if(ioctl(fd, BIOCSETIF, &ifr) < 0)
tools/tools/net80211/w00t/libw00t/w00t.c
115
if (ioctl(fd, BIOCSDLT, &dlt) < 0)
tools/tools/net80211/w00t/libw00t/w00t.c
119
if (ioctl(fd, BIOCIMMEDIATE, &i) < 0)
tools/tools/net80211/w00t/libw00t/w00t.c
122
return fd;
tools/tools/net80211/w00t/libw00t/w00t.c
143
int inject(int fd, void *buf, int len)
tools/tools/net80211/w00t/libw00t/w00t.c
145
return inject_params(fd, buf, len, NULL);
tools/tools/net80211/w00t/libw00t/w00t.c
148
int inject_params(int fd, void *buf, int len,
tools/tools/net80211/w00t/libw00t/w00t.c
171
rc = writev(fd, iov, 2);
tools/tools/net80211/w00t/libw00t/w00t.c
179
int sniff(int fd, void *buf, int len)
tools/tools/net80211/w00t/libw00t/w00t.c
181
return read(fd, buf, len);
tools/tools/net80211/w00t/libw00t/w00t.c
226
int send_ack(int fd, char *mac)
tools/tools/net80211/w00t/libw00t/w00t.c
240
rc = inject(fd, buf, sizeof(buf));
tools/tools/net80211/w00t/libw00t/w00t.c
90
int fd = -1;
tools/tools/net80211/w00t/libw00t/w00t.c
96
fd = open(buf, O_RDWR);
tools/tools/net80211/w00t/libw00t/w00t.c
97
if(fd == -1) {
tools/tools/net80211/w00t/libw00t/w00t.h
37
int inject(int fd, void *buf, int len);
tools/tools/net80211/w00t/libw00t/w00t.h
38
int inject_params(int fd, void *buf, int len,
tools/tools/net80211/w00t/libw00t/w00t.h
40
int sniff(int fd, void *buf, int len);
tools/tools/net80211/w00t/libw00t/w00t.h
43
int send_ack(int fd, char *mac);
tools/tools/net80211/w00t/prga/prga.c
102
rd = read(fd, p->iv, 3);
tools/tools/net80211/w00t/prga/prga.c
110
rd = read(fd, p->prga, sizeof(p->prga));
tools/tools/net80211/w00t/prga/prga.c
116
close(fd);
tools/tools/net80211/w00t/prga/prga.c
121
int fd;
tools/tools/net80211/w00t/prga/prga.c
124
fd = open(p->fname, O_WRONLY | O_CREAT, 0644);
tools/tools/net80211/w00t/prga/prga.c
125
if (fd == -1)
tools/tools/net80211/w00t/prga/prga.c
128
rd = write(fd, p->iv, 3);
tools/tools/net80211/w00t/prga/prga.c
136
rd = write(fd, p->prga, p->prga_len);
tools/tools/net80211/w00t/prga/prga.c
143
close(fd);
tools/tools/net80211/w00t/prga/prga.c
93
int fd;
tools/tools/net80211/w00t/prga/prga.c
96
fd = open(p->fname, O_RDONLY);
tools/tools/net80211/w00t/prga/prga.c
97
if (fd == -1) {
tools/tools/net80211/w00t/redir/redir.c
102
fd = open(p->fname, O_RDONLY);
tools/tools/net80211/w00t/redir/redir.c
103
if (fd == -1) {
tools/tools/net80211/w00t/redir/redir.c
108
rd = read(fd, p->iv, 3);
tools/tools/net80211/w00t/redir/redir.c
116
rd = read(fd, p->prga, sizeof(p->prga));
tools/tools/net80211/w00t/redir/redir.c
122
close(fd);
tools/tools/net80211/w00t/redir/redir.c
99
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
105
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
1216
if (write(weplog.fd, &pkh, sizeof(pkh)) != sizeof(pkh))
tools/tools/net80211/wesside/wesside/wesside.c
1219
rd = write(weplog.fd, wh, len);
tools/tools/net80211/wesside/wesside/wesside.c
1231
if (fsync(weplog.fd) == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
1246
int fd, rd;
tools/tools/net80211/wesside/wesside/wesside.c
1263
fd = open(path, O_RDONLY);
tools/tools/net80211/wesside/wesside/wesside.c
1264
if (fd == -1)
tools/tools/net80211/wesside/wesside/wesside.c
1267
rd = read(fd, &packet[6], sizeof(packet)-6);
tools/tools/net80211/wesside/wesside/wesside.c
1272
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
2081
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
2094
fd = open(KEY_FILE, O_WRONLY | O_CREAT, 0644);
tools/tools/net80211/wesside/wesside/wesside.c
2095
if (fd == -1)
tools/tools/net80211/wesside/wesside/wesside.c
2099
rd = write(fd, k, strlen(k));
tools/tools/net80211/wesside/wesside/wesside.c
2104
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
2131
if (weplog.fd) {
tools/tools/net80211/wesside/wesside/wesside.c
2132
if (fsync(weplog.fd) == -1)
tools/tools/net80211/wesside/wesside/wesside.c
2353
static int read_packet(int fd, unsigned char *dst, int len)
tools/tools/net80211/wesside/wesside/wesside.c
2365
totlen = read(fd, buf, sizeof(buf));
tools/tools/net80211/wesside/wesside/wesside.c
2395
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
2398
weplog.fd = open(WEP_FILE, O_WRONLY | O_APPEND);
tools/tools/net80211/wesside/wesside/wesside.c
2399
if (weplog.fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2411
weplog.fd = open(WEP_FILE, O_WRONLY | O_CREAT,
tools/tools/net80211/wesside/wesside/wesside.c
2413
if (weplog.fd != -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2414
if (write(weplog.fd, &pfh, sizeof(pfh)) != sizeof(pfh))
tools/tools/net80211/wesside/wesside/wesside.c
2422
if (weplog.fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2427
fd = open(PRGA_FILE, O_RDONLY);
tools/tools/net80211/wesside/wesside/wesside.c
2428
if (fd != -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2430
rd = read(fd, buf, sizeof(buf));
tools/tools/net80211/wesside/wesside/wesside.c
2439
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
2442
fd = open(DICT_PATH, O_RDONLY);
tools/tools/net80211/wesside/wesside/wesside.c
2443
if (fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2451
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
262
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
266
fd = open(KEY_FILE, O_RDONLY);
tools/tools/net80211/wesside/wesside/wesside.c
2660
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
2664
fd = open_bpf(dev, DLT_IEEE802_11_RADIO);
tools/tools/net80211/wesside/wesside/wesside.c
2670
own(fd);
tools/tools/net80211/wesside/wesside/wesside.c
268
if (fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2687
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
272
rd = read(fd, buf, sizeof(buf) -1);
tools/tools/net80211/wesside/wesside/wesside.c
280
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
317
if (weplog.fd)
tools/tools/net80211/wesside/wesside/wesside.c
318
close(weplog.fd);
tools/tools/net80211/wesside/wesside/wesside.c
421
int fd = -1;
tools/tools/net80211/wesside/wesside/wesside.c
427
fd = open(buf, O_RDWR);
tools/tools/net80211/wesside/wesside/wesside.c
428
if(fd < 0) {
tools/tools/net80211/wesside/wesside/wesside.c
439
if(fd < 0) {
tools/tools/net80211/wesside/wesside/wesside.c
447
if(ioctl(fd, BIOCSETIF, &ifr) < 0) {
tools/tools/net80211/wesside/wesside/wesside.c
452
if (ioctl(fd, BIOCSDLT, &dlt) < 0) {
tools/tools/net80211/wesside/wesside/wesside.c
458
if(ioctl(fd, BIOCIMMEDIATE, &i) < 0) {
tools/tools/net80211/wesside/wesside/wesside.c
463
return fd;
tools/tools/net80211/wesside/wesside/wesside.c
483
void inject(int fd, void *buf, int len)
tools/tools/net80211/wesside/wesside/wesside.c
502
rc = writev(fd, iov, 2);
tools/tools/net80211/wesside/wesside/wesside.c
829
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
855
fd = open(PRGA_FILE, O_WRONLY | O_CREAT,
tools/tools/net80211/wesside/wesside/wesside.c
858
if (fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
863
i = write(fd, prgainfo.iv, 3);
tools/tools/net80211/wesside/wesside/wesside.c
873
i = write(fd, prgainfo.prga, prgainfo.len);
tools/tools/net80211/wesside/wesside/wesside.c
883
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
890
int fd;
tools/tools/net80211/wesside/wesside/wesside.c
915
fd = open(path, O_RDONLY);
tools/tools/net80211/wesside/wesside/wesside.c
916
if (fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
928
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
935
fd = open(path, O_RDWR);
tools/tools/net80211/wesside/wesside/wesside.c
937
if (fd != -1) {
tools/tools/net80211/wesside/wesside/wesside.c
938
rd = read(fd, file_clear, sizeof(file_clear));
tools/tools/net80211/wesside/wesside/wesside.c
962
close(fd);
tools/tools/net80211/wesside/wesside/wesside.c
969
fd = open(path, O_WRONLY | O_CREAT, 0644);
tools/tools/net80211/wesside/wesside/wesside.c
970
if (fd == -1) {
tools/tools/net80211/wesside/wesside/wesside.c
982
rd = write(fd, file_clear, len);
tools/tools/net80211/wesside/wesside/wesside.c
991
close(fd);
tools/tools/net80211/wlaninject/wlaninject.c
106
if (ioctl(fd, BIOCSETIF, &ifr) == -1)
tools/tools/net80211/wlaninject/wlaninject.c
109
if (ioctl(fd, BIOCSDLT, &dlt) == -1)
tools/tools/net80211/wlaninject/wlaninject.c
113
if (ioctl(fd, BIOCIMMEDIATE, &i) == -1)
tools/tools/net80211/wlaninject/wlaninject.c
116
return fd;
tools/tools/net80211/wlaninject/wlaninject.c
119
void inject(int fd, void *buf, int buflen, struct ieee80211_bpf_params *p)
tools/tools/net80211/wlaninject/wlaninject.c
132
rc = writev(fd, iov, sizeof(iov)/sizeof(struct iovec));
tools/tools/net80211/wlaninject/wlaninject.c
281
int fd;
tools/tools/net80211/wlaninject/wlaninject.c
284
if ((fd = open(fname, O_RDONLY)) == -1)
tools/tools/net80211/wlaninject/wlaninject.c
287
if ((rc = read(fd, buf, len)) == -1)
tools/tools/net80211/wlaninject/wlaninject.c
290
close(fd);
tools/tools/net80211/wlaninject/wlaninject.c
526
int fd, fd2;
tools/tools/net80211/wlaninject/wlaninject.c
754
fd = open_bpf(iface);
tools/tools/net80211/wlaninject/wlaninject.c
761
inject(fd, wh, len, &params);
tools/tools/net80211/wlaninject/wlaninject.c
762
close(fd);
tools/tools/net80211/wlaninject/wlaninject.c
86
int fd;
tools/tools/net80211/wlaninject/wlaninject.c
93
fd = open(buf, O_RDWR);
tools/tools/net80211/wlaninject/wlaninject.c
94
if (fd != -1)
tools/tools/net80211/wlaninject/wlaninject.c
99
if (fd == -1) {
tools/tools/netmap/bridge.c
294
pollfd[0].fd = pa->fd;
tools/tools/netmap/bridge.c
295
pollfd[1].fd = pb->fd;
tools/tools/netmap/bridge.c
328
ioctl(pollfd[0].fd, NIOCRXSYNC, NULL);
tools/tools/netmap/bridge.c
333
ioctl(pollfd[1].fd, NIOCRXSYNC, NULL);
tools/tools/netmap/bridge.c
379
ioctl(pollfd[0].fd, NIOCTXSYNC, NULL);
tools/tools/netmap/bridge.c
386
ioctl(pollfd[1].fd, NIOCTXSYNC, NULL);
tools/tools/netmap/lb.c
1043
ioctl(rxport->nmd->fd, NIOCRXSYNC, NULL);
tools/tools/netmap/lb.c
913
pollfd[polli].fd = ports[i].nmd->fd;
tools/tools/netmap/lb.c
919
pollfd[polli].fd = rxport->nmd->fd;
tools/tools/netmap/nmreplay.c
230
int fd;
tools/tools/netmap/nmreplay.c
266
close(pf->fd);
tools/tools/netmap/nmreplay.c
324
pf->fd = open(fn, O_RDONLY);
tools/tools/netmap/nmreplay.c
325
if (pf->fd < 0) {
tools/tools/netmap/nmreplay.c
330
pf->filesize = lseek(pf->fd, 0, SEEK_END);
tools/tools/netmap/nmreplay.c
331
lseek(pf->fd, 0, SEEK_SET);
tools/tools/netmap/nmreplay.c
335
close(pf->fd);
tools/tools/netmap/nmreplay.c
338
pf->data = mmap(NULL, pf->filesize, PROT_READ, MAP_SHARED, pf->fd, 0);
tools/tools/netmap/nmreplay.c
341
close(pf->fd);
tools/tools/netmap/nmreplay.c
881
ioctl(pa->pb->fd, NIOCTXSYNC, 0); // XXX just in case
tools/tools/netmap/nmreplay.c
892
ioctl(pa->pb->fd, NIOCTXSYNC, 0);
tools/tools/netmap/nmreplay.c
898
ioctl(pa->pb->fd, NIOCTXSYNC, 0);
tools/tools/netmap/pkt-gen.c
1386
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
tools/tools/netmap/pkt-gen.c
1465
rv = ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1471
ioctl(pfd.fd, NIOCRXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1585
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
tools/tools/netmap/pkt-gen.c
1607
ioctl(pfd.fd, NIOCRXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1662
ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1679
struct pollfd pfd = { .fd = targ->fd, .events = POLLOUT };
tools/tools/netmap/pkt-gen.c
1701
D("start, fd %d main_fd %d", targ->fd, targ->g->main_fd);
tools/tools/netmap/pkt-gen.c
1787
if (ioctl(pfd.fd, NIOCTXSYNC, NULL) < 0) {
tools/tools/netmap/pkt-gen.c
1801
D("poll error on %d ring %d-%d", pfd.fd,
tools/tools/netmap/pkt-gen.c
1850
ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1859
ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
1926
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
tools/tools/netmap/pkt-gen.c
1939
targ->g->ifname, targ->fd, targ->g->main_fd);
tools/tools/netmap/pkt-gen.c
1986
if (ioctl(pfd.fd, NIOCRXSYNC, NULL) < 0) {
tools/tools/netmap/pkt-gen.c
2047
struct pollfd pfd = { .fd = targ->fd, .events = POLLOUT };
tools/tools/netmap/pkt-gen.c
2073
D("start, fd %d main_fd %d", targ->fd, targ->g->main_fd);
tools/tools/netmap/pkt-gen.c
2108
if (ioctl(pfd.fd, NIOCTXSYNC, NULL) < 0) {
tools/tools/netmap/pkt-gen.c
2122
D("poll error on %d ring %d-%d", pfd.fd,
tools/tools/netmap/pkt-gen.c
2207
ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
2213
ioctl(pfd.fd, NIOCTXSYNC, NULL);
tools/tools/netmap/pkt-gen.c
2257
struct pollfd pfd = { .fd = targ->fd, .events = POLLIN };
tools/tools/netmap/pkt-gen.c
2281
targ->g->ifname, targ->fd, targ->g->main_fd);
tools/tools/netmap/pkt-gen.c
2299
if (ioctl(pfd.fd, NIOCRXSYNC, NULL) < 0) {
tools/tools/netmap/pkt-gen.c
2632
t->fd = -1; /* default, with pcap */
tools/tools/netmap/pkt-gen.c
2678
t->fd = t->nmd->fd;
tools/tools/netmap/pkt-gen.c
2681
targs[i].fd = g->main_fd;
tools/tools/netmap/pkt-gen.c
2808
close(targs[i].fd);
tools/tools/netmap/pkt-gen.c
2863
int fd, err;
tools/tools/netmap/pkt-gen.c
2883
if( (fd = open(clonedev, O_RDWR)) < 0 ) {
tools/tools/netmap/pkt-gen.c
2884
return fd;
tools/tools/netmap/pkt-gen.c
2907
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
tools/tools/netmap/pkt-gen.c
2909
close(fd);
tools/tools/netmap/pkt-gen.c
2923
return fd;
tools/tools/netmap/pkt-gen.c
3260
g.main_fd = g.nmd->fd;
tools/tools/netmap/pkt-gen.c
330
int fd;
tools/tools/netrate/httpd/httpd.c
152
if (sendfile(fd, sock, 0, 0, &sf_hdtr, NULL, 0) < 0)
tools/tools/netrate/httpd/httpd.c
98
http_serve(int sock, int fd)
tools/tools/netrate/netreceive/netreceive.c
105
fds.fd = t->fd;
tools/tools/netrate/netreceive/netreceive.c
114
y = recv(t->fd, t->buf, t->buflen, MSG_DONTWAIT);
tools/tools/netrate/netreceive/netreceive.c
143
tp[i]->fd = s[si];
tools/tools/netrate/netreceive/netreceive.c
61
int fd;
tools/tools/netrate/tcpp/tcpp_client.c
101
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
tools/tools/netrate/tcpp/tcpp_client.c
105
if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0)
tools/tools/netrate/tcpp/tcpp_client.c
108
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i)) < 0)
tools/tools/netrate/tcpp/tcpp_client.c
112
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)) < 0)
tools/tools/netrate/tcpp/tcpp_client.c
117
if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
tools/tools/netrate/tcpp/tcpp_client.c
121
if (connect(fd, (struct sockaddr *)&remoteip, sizeof(remoteip)) < 0 &&
tools/tools/netrate/tcpp/tcpp_client.c
130
conn->conn_fd = fd;
tools/tools/netrate/tcpp/tcpp_client.c
135
EV_SET(&kev, fd, EVFILT_WRITE, EV_ADD, 0, 0, conn);
tools/tools/netrate/tcpp/tcpp_client.c
87
int fd, i;
tools/tools/netrate/tcpp/tcpp_client.c
97
fd = socket(PF_INET, SOCK_STREAM, 0);
tools/tools/netrate/tcpp/tcpp_client.c
98
if (fd < 0)
tools/tools/netrate/tcpp/tcpp_server.c
101
EV_SET(&kev, fd, EVFILT_READ, EV_ADD, 0, 0, conn);
tools/tools/netrate/tcpp/tcpp_server.c
79
int fd;
tools/tools/netrate/tcpp/tcpp_server.c
81
fd = accept(listen_fd, NULL, NULL);
tools/tools/netrate/tcpp/tcpp_server.c
82
if (fd < 0) {
tools/tools/netrate/tcpp/tcpp_server.c
87
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
tools/tools/netrate/tcpp/tcpp_server.c
95
conn->conn_fd = fd;
tools/tools/nvmf/nvmfd/devices.c
103
int fd;
tools/tools/nvmf/nvmfd/devices.c
111
fd = open(config, O_RDWR);
tools/tools/nvmf/nvmfd/devices.c
112
if (fd == -1)
tools/tools/nvmf/nvmfd/devices.c
114
if (fstat(fd, &sb) == -1)
tools/tools/nvmf/nvmfd/devices.c
118
init_chardevice(config, fd, dev);
tools/tools/nvmf/nvmfd/devices.c
121
init_filedevice(config, fd, &sb, dev);
tools/tools/nvmf/nvmfd/devices.c
214
read_buffer(int fd, void *buf, size_t len, off_t offset)
tools/tools/nvmf/nvmfd/devices.c
221
nread = pread(fd, dst, len, offset);
tools/tools/nvmf/nvmfd/devices.c
266
if (!read_buffer(dev->fd, p, len, off)) {
tools/tools/nvmf/nvmfd/devices.c
280
write_buffer(int fd, const void *buf, size_t len, off_t offset)
tools/tools/nvmf/nvmfd/devices.c
287
nwritten = pwrite(fd, src, len, offset);
tools/tools/nvmf/nvmfd/devices.c
29
int fd; /* FILE, CDEV */
tools/tools/nvmf/nvmfd/devices.c
344
if (!write_buffer(dev->fd, p, len, off)) {
tools/tools/nvmf/nvmfd/devices.c
371
if (fdatasync(dev->fd) == -1) {
tools/tools/nvmf/nvmfd/devices.c
378
if (ioctl(dev->fd, DIOCGFLUSH) == -1) {
tools/tools/nvmf/nvmfd/devices.c
70
init_filedevice(const char *config, int fd, struct stat *sb,
tools/tools/nvmf/nvmfd/devices.c
74
dev->fd = fd;
tools/tools/nvmf/nvmfd/devices.c
84
init_chardevice(const char *config, int fd, struct backing_device *dev)
tools/tools/nvmf/nvmfd/devices.c
89
dev->fd = fd;
tools/tools/nvmf/nvmfd/devices.c
90
if (ioctl(fd, DIOCGSECTORSIZE, &dev->sector_size) != 0)
tools/tools/nvmf/nvmfd/devices.c
92
if (ioctl(fd, DIOCGMEDIASIZE, &len) != 0)
tools/tools/nvmf/nvmfd/discovery.c
293
qparams.tcp.fd = s;
tools/tools/nvmf/nvmfd/io.c
623
qparams.tcp.fd = s;
tools/tools/nvmf/nvmfdd/nvmfdd.c
74
params->tcp.fd = s;
tools/tools/pciroms/pciroms.c
302
int fd, mem_fd, err;
tools/tools/pciroms/pciroms.c
305
fd = err = mem_fd = -1;
tools/tools/pciroms/pciroms.c
317
if ((fd = open(filename, O_CREAT|O_RDWR|O_TRUNC|O_NOFOLLOW,
tools/tools/pciroms/pciroms.c
323
if (write(fd, map_addr, romsize) != romsize)
tools/tools/pciroms/pciroms.c
328
if (fd != -1)
tools/tools/pciroms/pciroms.c
329
close(fd);
tools/tools/syscall_timing/syscall_timing.c
101
close(fd);
tools/tools/syscall_timing/syscall_timing.c
1025
int ch, fd, error, i, j, rv;
tools/tools/syscall_timing/syscall_timing.c
106
close(fd);
tools/tools/syscall_timing/syscall_timing.c
1119
fd = open(tmp_path, O_WRONLY | O_CREAT, 0700);
tools/tools/syscall_timing/syscall_timing.c
1120
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
1122
error = ftruncate(fd, 1000000);
tools/tools/syscall_timing/syscall_timing.c
1125
error = close(fd);
tools/tools/syscall_timing/syscall_timing.c
159
int fd;
tools/tools/syscall_timing/syscall_timing.c
162
fd = open(path, O_RDWR | O_CREAT, 0600);
tools/tools/syscall_timing/syscall_timing.c
163
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
165
close(fd);
tools/tools/syscall_timing/syscall_timing.c
170
fd = open(path, O_RDWR | O_CREAT, 0600);
tools/tools/syscall_timing/syscall_timing.c
171
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
173
close(fd);
tools/tools/syscall_timing/syscall_timing.c
376
int fd;
tools/tools/syscall_timing/syscall_timing.c
378
fd = open(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
379
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
381
close(fd);
tools/tools/syscall_timing/syscall_timing.c
385
fd = open(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
386
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
388
close(fd);
tools/tools/syscall_timing/syscall_timing.c
399
int fd;
tools/tools/syscall_timing/syscall_timing.c
401
fd = open(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
402
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
404
(void)read(fd, buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
405
close(fd);
tools/tools/syscall_timing/syscall_timing.c
409
fd = open(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
410
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
412
(void)read(fd, buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
413
close(fd);
tools/tools/syscall_timing/syscall_timing.c
422
int fd[2];
tools/tools/syscall_timing/syscall_timing.c
431
if (pipe(fd) < 0)
tools/tools/syscall_timing/syscall_timing.c
433
close(fd[0]);
tools/tools/syscall_timing/syscall_timing.c
434
close(fd[1]);
tools/tools/syscall_timing/syscall_timing.c
437
if (pipe(fd) == -1)
tools/tools/syscall_timing/syscall_timing.c
439
close(fd[0]);
tools/tools/syscall_timing/syscall_timing.c
440
close(fd[1]);
tools/tools/syscall_timing/syscall_timing.c
447
readx(int fd, char *buf, size_t size)
tools/tools/syscall_timing/syscall_timing.c
452
ret = read(fd, buf, size);
tools/tools/syscall_timing/syscall_timing.c
462
writex(int fd, const char *buf, size_t size)
tools/tools/syscall_timing/syscall_timing.c
467
ret = write(fd, buf, size);
tools/tools/syscall_timing/syscall_timing.c
482
int fd[2], procfd;
tools/tools/syscall_timing/syscall_timing.c
484
if (pipe(fd) < 0)
tools/tools/syscall_timing/syscall_timing.c
492
close(fd[0]);
tools/tools/syscall_timing/syscall_timing.c
495
readx(fd[1], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
496
writex(fd[1], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
500
close(fd[1]);
tools/tools/syscall_timing/syscall_timing.c
504
writex(fd[0], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
505
readx(fd[0], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
515
int fd;
tools/tools/syscall_timing/syscall_timing.c
523
int fd;
tools/tools/syscall_timing/syscall_timing.c
528
fd = ctxp->fd;
tools/tools/syscall_timing/syscall_timing.c
536
readx(fd, buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
537
writex(fd, buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
548
int error, fd[2];
tools/tools/syscall_timing/syscall_timing.c
550
if (pipe(fd) < 0)
tools/tools/syscall_timing/syscall_timing.c
553
ctx.fd = fd[1];
tools/tools/syscall_timing/syscall_timing.c
562
writex(fd[0], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
563
readx(fd[0], buf, int_arg);
tools/tools/syscall_timing/syscall_timing.c
577
int fd;
tools/tools/syscall_timing/syscall_timing.c
579
fd = open(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
580
if (fd < 0)
tools/tools/syscall_timing/syscall_timing.c
582
(void)pread(fd, buf, int_arg, 0);
tools/tools/syscall_timing/syscall_timing.c
586
(void)pread(fd, buf, int_arg, 0);
tools/tools/syscall_timing/syscall_timing.c
589
close(fd);
tools/tools/syscall_timing/syscall_timing.c
717
int fd, shmfd;
tools/tools/syscall_timing/syscall_timing.c
722
fd = dup(shmfd);
tools/tools/syscall_timing/syscall_timing.c
723
if (fd >= 0)
tools/tools/syscall_timing/syscall_timing.c
724
close(fd);
tools/tools/syscall_timing/syscall_timing.c
727
fd = dup(shmfd);
tools/tools/syscall_timing/syscall_timing.c
728
if (fd >= 0)
tools/tools/syscall_timing/syscall_timing.c
729
close(fd);
tools/tools/syscall_timing/syscall_timing.c
96
int fd;
tools/tools/syscall_timing/syscall_timing.c
98
fd = access(path, O_RDONLY);
tools/tools/syscall_timing/syscall_timing.c
99
if (fd < 0)
tools/tools/tionxcl/tionxcl.c
49
int fd;
tools/tools/tionxcl/tionxcl.c
85
fd = open(ttyname, O_RDWR);
tools/tools/tionxcl/tionxcl.c
86
if (fd == -1) {
tools/tools/tionxcl/tionxcl.c
93
if (0 != ioctl(fd, TIOCNXCL, 0))
tools/tools/zfsboottest/zfsboottest.c
117
int i, failures, *fd;
tools/tools/zfsboottest/zfsboottest.c
138
fd = malloc(sizeof(fd[0]) * (i - 1));
tools/tools/zfsboottest/zfsboottest.c
139
if (fd == NULL)
tools/tools/zfsboottest/zfsboottest.c
144
fd[i - 1] = open(argv[i], O_RDONLY);
tools/tools/zfsboottest/zfsboottest.c
145
if (fd[i - 1] == -1) {
tools/tools/zfsboottest/zfsboottest.c
149
if (vdev_probe(vdev_read, NULL, &fd[i - 1], NULL) != 0) {
tools/tools/zfsboottest/zfsboottest.c
151
close(fd[i - 1]);
tools/tools/zfsboottest/zfsboottest.c
59
int fd;
tools/tools/zfsboottest/zfsboottest.c
61
fd = *(int *)priv;
tools/tools/zfsboottest/zfsboottest.c
62
if (fstat(fd, &sb) != 0)
tools/tools/zfsboottest/zfsboottest.c
64
if (S_ISCHR(sb.st_mode) && ioctl(fd, DIOCGMEDIASIZE, &sb.st_size) != 0)
tools/tools/zfsboottest/zfsboottest.c
78
int fd = *(int *)priv;
tools/tools/zfsboottest/zfsboottest.c
80
if (pread(fd, buf, bytes, off) != bytes)
usr.bin/ar/ar.h
70
int fd; /* file descriptor */
usr.bin/ar/write.c
113
if (fstat(obj->fd, &sb) < 0) {
usr.bin/ar/write.c
158
MAP_PRIVATE, obj->fd, (off_t)0)) == MAP_FAILED) {
usr.bin/ar/write.c
162
if (close(obj->fd) < 0)
usr.bin/ar/write.c
169
if (close(obj->fd) < 0)
usr.bin/ar/write.c
183
if (obj->fd == -1)
usr.bin/ar/write.c
325
obj->fd = -1;
usr.bin/ar/write.c
92
if ((obj->fd = open(name, O_RDONLY, 0)) < 0) {
usr.bin/backlight/backlight.c
105
fd = -1;
usr.bin/backlight/backlight.c
154
if ((fd = open(device_name, O_RDWR)) == -1)
usr.bin/backlight/backlight.c
162
if (caph_rights_limit(fd, &right_ioctl) < 0)
usr.bin/backlight/backlight.c
164
if (caph_ioctls_limit(fd, backlight_ioctls, nitems(backlight_ioctls)) < 0)
usr.bin/backlight/backlight.c
171
if (ioctl(fd, BACKLIGHTGETSTATUS, &props) == -1)
usr.bin/backlight/backlight.c
189
if (ioctl(fd, BACKLIGHTUPDATESTATUS, &props) == -1)
usr.bin/backlight/backlight.c
197
if (ioctl(fd, BACKLIGHTGETSTATUS, &props) == -1)
usr.bin/backlight/backlight.c
206
if (ioctl(fd, BACKLIGHTUPDATESTATUS, &props) == -1)
usr.bin/backlight/backlight.c
210
if (ioctl(fd, BACKLIGHTGETINFO, &info) == -1)
usr.bin/backlight/backlight.c
222
close(fd);
usr.bin/backlight/backlight.c
92
int fd;
usr.bin/bintrans/uudecode.c
187
int flags, fd, mode;
usr.bin/bintrans/uudecode.c
298
if ((fd = open(outfile, flags, mode)) < 0 ||
usr.bin/bintrans/uudecode.c
299
(outfp = fdopen(fd, "w")) == NULL) {
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
183
fd = amaster;
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
189
fd = STDOUT_FILENO;
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
345
if (sppd_write(fd, buf, n) < 0) {
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
348
fd, n, strerror(errno));
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
393
sppd_read(int fd, char *buffer, int size)
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
398
n = read(fd, buffer, size);
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
411
sppd_write(int fd, char *buffer, int size)
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
416
n = write(fd, buffer, size);
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
66
static int sppd_read (int fd, char *buffer, int size);
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
67
static int sppd_write (int fd, char *buffer, int size);
usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
81
s, amaster, aslave, fd, doserver,
usr.bin/brandelf/brandelf.c
142
int fd;
usr.bin/brandelf/brandelf.c
145
if ((fd = fileargs_open(fa, argv[0])) < 0) {
usr.bin/brandelf/brandelf.c
150
if (read(fd, buffer, EI_NIDENT) < EI_NIDENT) {
usr.bin/brandelf/brandelf.c
174
lseek(fd, 0, SEEK_SET);
usr.bin/brandelf/brandelf.c
175
if (write(fd, buffer, EI_NIDENT) != EI_NIDENT) {
usr.bin/brandelf/brandelf.c
176
warn("error writing %s %d", argv[0], fd);
usr.bin/brandelf/brandelf.c
182
close(fd);
usr.bin/bsdiff/bsdiff/bsdiff.c
117
int fd;
usr.bin/bsdiff/bsdiff/bsdiff.c
140
if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) ||
usr.bin/bsdiff/bsdiff/bsdiff.c
141
((oldsize=lseek(fd,0,SEEK_END))==-1))
usr.bin/bsdiff/bsdiff/bsdiff.c
151
old = mmap(NULL, oldsize+1, PROT_READ, MAP_SHARED, fd, 0);
usr.bin/bsdiff/bsdiff/bsdiff.c
152
if (old == MAP_FAILED || close(fd) == -1)
usr.bin/bsdiff/bsdiff/bsdiff.c
161
if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) ||
usr.bin/bsdiff/bsdiff/bsdiff.c
162
((newsize=lseek(fd,0,SEEK_END))==-1))
usr.bin/bsdiff/bsdiff/bsdiff.c
171
new = mmap(NULL, newsize+1, PROT_READ, MAP_SHARED, fd, 0);
usr.bin/bsdiff/bsdiff/bsdiff.c
172
if (new == MAP_FAILED || close(fd) == -1)
usr.bin/calendar/io.c
110
int fd;
usr.bin/calendar/io.c
135
if ((fd = openat(cwdfd, file, O_RDONLY)) != -1) {
usr.bin/calendar/io.c
136
if ((fp = fdopen(fd, "r")) == NULL)
usr.bin/calendar/io.c
666
int fd;
usr.bin/calendar/io.c
674
if ((fd = mkstemp(path)) < 0)
usr.bin/calendar/io.c
676
return (fdopen(fd, "w+"));
usr.bin/cksum/cksum.c
101
if ((fd = open(fn, O_RDONLY, 0)) < 0) {
usr.bin/cksum/cksum.c
107
if (cfncn(fd, &val, &len)) {
usr.bin/cksum/cksum.c
112
(void)close(fd);
usr.bin/cksum/cksum.c
52
int ch, fd, rval;
usr.bin/cksum/cksum.c
95
fd = STDIN_FILENO;
usr.bin/cksum/crc.c
106
crc(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/crc.c
118
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/cksum/crc32.c
107
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/cksum/crc32.c
98
crc32(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/sum1.c
40
csum1(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/sum1.c
53
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/cksum/sum2.c
40
csum2(int fd, uint32_t *cval, off_t *clen)
usr.bin/cksum/sum2.c
56
while ((nr = read(fd, buf, sizeof(buf))) > 0)
usr.bin/cmp/regular.c
174
remmap(u_char *mem, int fd, off_t offset)
usr.bin/cmp/regular.c
178
mem = mmap(NULL, MMAP_CHUNK, PROT_READ, MAP_SHARED, fd, offset);
usr.bin/ctlstat/ctlstat.c
150
static int getstats(int fd, int *alloc_items, int *num_items,
usr.bin/ctlstat/ctlstat.c
170
getstats(int fd, int *alloc_items, int *num_items, struct ctl_io_stats **stats,
usr.bin/ctlstat/ctlstat.c
187
if (ioctl(fd, ports ? CTL_GET_PORT_STATS : CTL_GET_LUN_STATS,
usr.bin/ctlstat/ctlstat.c
547
ctlstat_prometheus(int fd, struct ctlstat_context *ctx, bool ports) {
usr.bin/ctlstat/ctlstat.c
566
if (ioctl(fd, CTL_PORT_LIST, &list) == -1)
usr.bin/ctlstat/ctlstat.c
807
get_and_print_stats(int fd, struct ctlstat_context *ctx, bool ports)
usr.bin/ctlstat/ctlstat.c
823
if (getstats(fd, &ctx->cur_alloc, &ctx->cur_items,
usr.bin/ctlstat/ctlstat.c
838
ctlstat_prometheus(fd, ctx, ports);
usr.bin/ctlstat/ctlstat.c
850
int fd, retval;
usr.bin/ctlstat/ctlstat.c
971
if ((fd = open(CTL_DEFAULT_DEV, O_RDWR)) == -1)
usr.bin/ctlstat/ctlstat.c
990
get_and_print_stats(fd, &ctx, false);
usr.bin/ctlstat/ctlstat.c
991
get_and_print_stats(fd, &ctx, true);
usr.bin/ctlstat/ctlstat.c
994
get_and_print_stats(fd, &ctx, ports);
usr.bin/diff/diffdir.c
70
int fd = -1, ret, serrno;
usr.bin/diff/diffdir.c
72
if ((fd = open(path, O_DIRECTORY | O_RDONLY)) < 0 ||
usr.bin/diff/diffdir.c
74
fstat(fd, &sb) != 0)
usr.bin/diff/diffdir.c
80
close(fd);
usr.bin/diff/diffdir.c
85
if ((ret = fdscandir(fd, dirp, selectf, comparf)) < 0)
usr.bin/diff/diffdir.c
88
close(fd);
usr.bin/diff/diffdir.c
95
if (fd >= 0)
usr.bin/diff/diffdir.c
96
close(fd);
usr.bin/diff/diffreg.c
1025
preadline(int fd, size_t rlen, off_t off)
usr.bin/diff/diffreg.c
1031
if ((nr = pread(fd, line, rlen, off)) == -1)
usr.bin/diff/diffreg.c
556
prepare(int i, FILE *fd, size_t filesize, int flags)
usr.bin/diff/diffreg.c
563
rewind(fd);
usr.bin/diff/diffreg.c
570
while ((r = readhash(fd, flags, &h)) != RH_EOF) {
usr.bin/diff3/diff3.c
150
static int readin(int fd, struct diff **);
usr.bin/diff3/diff3.c
253
readin(int fd, struct diff **dd)
usr.bin/diff3/diff3.c
260
f = fdopen(fd, "r");
usr.bin/diff3/diff3.c
307
diffexec(char **diffargv, int fd[])
usr.bin/diff3/diff3.c
320
posix_spawn_file_actions_adddup2(&fa, fd[1], STDOUT_FILENO);
usr.bin/diff3/diff3.c
328
close(fd[1]);
usr.bin/dtc/dtb.cc
114
binary_writer::write_to_file(int fd)
usr.bin/dtc/dtb.cc
116
write(buffer, fd);
usr.bin/dtc/dtb.cc
245
asm_writer::write_to_file(int fd)
usr.bin/dtc/dtb.cc
247
write(buffer, fd);
usr.bin/dtc/dtb.cc
45
void write(dtc::byte_buffer &buffer, int fd)
usr.bin/dtc/dtb.cc
51
ssize_t r = ::write(fd, data, size);
usr.bin/dtc/dtb.hh
156
virtual void write_to_file(int fd) = 0;
usr.bin/dtc/dtb.hh
203
void write_to_file(int fd) override;
usr.bin/dtc/dtb.hh
256
void write_to_file(int fd) override;
usr.bin/dtc/fdt.cc
1730
device_tree::write(int fd)
usr.bin/dtc/fdt.cc
1791
head_writer.write_to_file(fd);
usr.bin/dtc/fdt.cc
1792
reservation_writer.write_to_file(fd);
usr.bin/dtc/fdt.cc
1793
struct_writer.write_to_file(fd);
usr.bin/dtc/fdt.cc
1795
strings_writer.write_to_file(fd);
usr.bin/dtc/fdt.cc
1813
device_tree::write_binary(int fd)
usr.bin/dtc/fdt.cc
1815
write<dtb::binary_writer>(fd);
usr.bin/dtc/fdt.cc
1819
device_tree::write_asm(int fd)
usr.bin/dtc/fdt.cc
1821
write<dtb::asm_writer>(fd);
usr.bin/dtc/fdt.cc
1825
device_tree::write_dts(int fd)
usr.bin/dtc/fdt.cc
1827
FILE *file = fdopen(fd, "w");
usr.bin/dtc/fdt.hh
924
void write(int fd);
usr.bin/dtc/fdt.hh
940
void write_binary(int fd);
usr.bin/dtc/fdt.hh
946
void write_asm(int fd);
usr.bin/dtc/fdt.hh
950
void write_dts(int fd);
usr.bin/dtc/input_buffer.cc
105
mmap_input_buffer::mmap_input_buffer(int fd, string &&filename)
usr.bin/dtc/input_buffer.cc
109
if (fstat(fd, &sb))
usr.bin/dtc/input_buffer.cc
115
MAP_PREFAULT_READ, fd, 0);
usr.bin/dtc/input_buffer.cc
76
mmap_input_buffer(int fd, string &&filename);
usr.bin/elfctl/elfctl.c
143
if ((fd = open(argv[0],
usr.bin/elfctl/elfctl.c
150
if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
usr.bin/elfctl/elfctl.c
182
if (!print_file_features(elf, ehdr.e_phnum, fd,
usr.bin/elfctl/elfctl.c
187
} else if (!edit_file_features(elf, ehdr.e_phnum, fd,
usr.bin/elfctl/elfctl.c
196
if (fd >= 0)
usr.bin/elfctl/elfctl.c
197
close(fd);
usr.bin/elfctl/elfctl.c
298
edit_file_features(Elf *elf, int phcount, int fd, char *val, bool endian_swap)
usr.bin/elfctl/elfctl.c
303
if (!get_file_features(elf, phcount, fd, &features, &off,
usr.bin/elfctl/elfctl.c
319
if (lseek(fd, off, SEEK_SET) == -1 ||
usr.bin/elfctl/elfctl.c
320
write(fd, &features, sizeof(features)) <
usr.bin/elfctl/elfctl.c
340
print_file_features(Elf *elf, int phcount, int fd, char *filename,
usr.bin/elfctl/elfctl.c
346
if (!get_file_features(elf, phcount, fd, &features, NULL,
usr.bin/elfctl/elfctl.c
365
get_file_features(Elf *elf, int phcount, int fd, uint32_t *features,
usr.bin/elfctl/elfctl.c
387
if (lseek(fd, phdr.p_offset, SEEK_SET) < 0) {
usr.bin/elfctl/elfctl.c
394
if (read(fd, &note, sizeof(note)) <
usr.bin/elfctl/elfctl.c
418
if (read(fd, name, namesz) < namesz) {
usr.bin/elfctl/elfctl.c
429
if (lseek(fd, descsz, SEEK_CUR) < 0) {
usr.bin/elfctl/elfctl.c
452
if (read(fd, features, sizeof(uint32_t)) <
usr.bin/elfctl/elfctl.c
97
int ch, fd, retval;
usr.bin/elfdump/elfdump.c
523
int fd;
usr.bin/elfdump/elfdump.c
583
if ((fd = open(*av, O_RDONLY)) < 0 ||
usr.bin/elfdump/elfdump.c
584
fstat(fd, &sb) < 0)
usr.bin/elfdump/elfdump.c
592
if (caph_rights_limit(fd, &rights) < 0)
usr.bin/elfdump/elfdump.c
601
e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
usr.bin/finger/lprint.c
292
int fd, nr;
usr.bin/finger/lprint.c
297
if ((fd = open(tbuf, O_RDONLY)) < 0 || fstat(fd, &sb) ||
usr.bin/finger/lprint.c
303
nr = read(fd, tbuf, sizeof(tbuf));
usr.bin/finger/lprint.c
305
(void)close(fd);
usr.bin/finger/lprint.c
319
(void)close(fd);
usr.bin/finger/lprint.c
323
(void)lseek(fd, 0L, SEEK_SET);
usr.bin/finger/lprint.c
325
if ((fp = fdopen(fd, "r")) == NULL)
usr.bin/fortune/fortune/fortune.c
1065
if (fp->inf == NULL && (fp->inf = fdopen(fp->fd, "r")) == NULL) {
usr.bin/fortune/fortune/fortune.c
1092
int fd;
usr.bin/fortune/fortune/fortune.c
1097
if ((fd = open(fp->posfile, O_RDONLY)) < 0 ||
usr.bin/fortune/fortune/fortune.c
1098
read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos)
usr.bin/fortune/fortune/fortune.c
1102
if (fd >= 0)
usr.bin/fortune/fortune/fortune.c
1103
close(fd);
usr.bin/fortune/fortune/fortune.c
1120
int fd;
usr.bin/fortune/fortune/fortune.c
1126
if ((fd = open(fp->datfile, O_RDONLY)) < 0) {
usr.bin/fortune/fortune/fortune.c
1130
if (read(fd, (char *) &fp->tbl, sizeof fp->tbl) != sizeof fp->tbl) {
usr.bin/fortune/fortune/fortune.c
1140
(void) close(fd);
usr.bin/fortune/fortune/fortune.c
158
int fd;
usr.bin/fortune/fortune/fortune.c
180
if ((fd = creat(Fortfile->posfile, 0666)) < 0) {
usr.bin/fortune/fortune/fortune.c
189
flock(fd, LOCK_EX);
usr.bin/fortune/fortune/fortune.c
190
write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos);
usr.bin/fortune/fortune/fortune.c
193
flock(fd, LOCK_UN);
usr.bin/fortune/fortune/fortune.c
447
int fd;
usr.bin/fortune/fortune/fortune.c
486
if ((fd = open(path, O_RDONLY)) < 0) {
usr.bin/fortune/fortune/fortune.c
531
fp->fd = fd;
usr.bin/fortune/fortune/fortune.c
592
fp->fd = -1;
usr.bin/fortune/fortune/fortune.c
643
int fd;
usr.bin/fortune/fortune/fortune.c
650
if ((fd = open(offensive, O_RDONLY)) < 0)
usr.bin/fortune/fortune/fortune.c
664
fp->fd = -1;
usr.bin/fortune/fortune/fortune.c
667
obscene->fd = fd;
usr.bin/fortune/fortune/fortune.c
693
(void) close(fp->fd);
usr.bin/fortune/fortune/fortune.c
694
fp->fd = -1;
usr.bin/fortune/fortune/fortune.c
72
int fd, datfd;
usr.bin/fortune/fortune/fortune.c
82
struct fd *child, *parent;
usr.bin/fortune/fortune/fortune.c
83
struct fd *next, *prev;
usr.bin/fstat/fuser.c
86
int fd;
usr.bin/fsync/fsync.c
41
int fd;
usr.bin/fsync/fsync.c
52
if ((fd = open(argv[i], O_RDONLY | O_NONBLOCK)) == -1) {
usr.bin/fsync/fsync.c
59
if (fsync(fd) == -1) {
usr.bin/fsync/fsync.c
64
close(fd);
usr.bin/gcore/elfcore.c
177
elf_coredump(int efd, int fd, pid_t pid)
usr.bin/gcore/elfcore.c
231
n = write(fd, hdr, segoff);
usr.bin/gcore/elfcore.c
261
ngot = write(fd, buf, nwant);
usr.bin/gcore/extern.h
36
void (*dump)(int efd, int fd, pid_t pid);
usr.bin/gcore/gcore.c
103
pc.pc_fd = fd;
usr.bin/gcore/gcore.c
129
int ch, efd, fd, name[4];
usr.bin/gcore/gcore.c
170
fd = open_corefile(corefile);
usr.bin/gcore/gcore.c
171
kcoredump(fd, pid);
usr.bin/gcore/gcore.c
198
fd = open_corefile(corefile);
usr.bin/gcore/gcore.c
200
dumper->dump(efd, fd, pid);
usr.bin/gcore/gcore.c
201
(void)close(fd);
usr.bin/gcore/gcore.c
75
int fd;
usr.bin/gcore/gcore.c
81
fd = open(corefile, O_RDWR | O_CREAT | O_TRUNC, DEFFILEMODE);
usr.bin/gcore/gcore.c
82
if (fd < 0)
usr.bin/gcore/gcore.c
84
return (fd);
usr.bin/gcore/gcore.c
88
kcoredump(int fd, pid_t pid)
usr.bin/gencat/gencat.c
234
get_line(int fd)
usr.bin/gencat/gencat.c
262
buflen = read(fd, buf, BUFSIZ);
usr.bin/gencat/gencat.c
301
getmsg(int fd, char *cptr, char quote)
usr.bin/gencat/gencat.c
337
cptr = get_line(fd);
usr.bin/gencat/gencat.c
389
MCParse(int fd)
usr.bin/gencat/gencat.c
397
while ((cptr = get_line(fd))) {
usr.bin/gencat/gencat.c
458
str = getmsg(fd, cptr, quote);
usr.bin/gencat/gencat.c
475
MCWriteCat(int fd)
usr.bin/gencat/gencat.c
576
write(fd, msgcat, msgcat_size);
usr.bin/genl/genl.c
347
if (setsockopt(ss.fd, SOL_NETLINK,
usr.bin/genl/genl.c
369
pfd.fd = ss.fd;
usr.bin/gprof/elf.c
56
int fd;
usr.bin/gprof/elf.c
69
if ((fd = open(filename, O_RDONLY)) == -1)
usr.bin/gprof/elf.c
71
if (read(fd, &h, sizeof h) != sizeof h || !IS_ELF(h)) {
usr.bin/gprof/elf.c
72
close(fd);
usr.bin/gprof/elf.c
75
if (fstat(fd, &s) == -1)
usr.bin/gprof/elf.c
77
if ((mapbase = mmap(0, s.st_size, PROT_READ, MAP_SHARED, fd, 0)) ==
usr.bin/gprof/elf.c
80
close(fd);
usr.bin/grep/file.c
180
f->fd = STDIN_FILENO;
usr.bin/grep/file.c
181
} else if ((f->fd = open(path, O_RDONLY)) == -1)
usr.bin/grep/file.c
187
if (fstat(f->fd, &st) == -1 || !S_ISREG(st.st_mode))
usr.bin/grep/file.c
196
f->fd, (off_t)0);
usr.bin/grep/file.c
222
close(f->fd);
usr.bin/grep/file.c
235
close(f->fd);
usr.bin/grep/file.c
73
nr = read(f->fd, buffer, MAXBUFSIZ);
usr.bin/grep/grep.h
76
int fd;
usr.bin/gzip/gzip.c
1062
copymodes(int fd, const struct stat *sbp, const char *file)
usr.bin/gzip/gzip.c
1074
(void)fchmod(fd, DEFFILEMODE & ~mask);
usr.bin/gzip/gzip.c
1081
if (fchown(fd, sb.st_uid, sb.st_gid) < 0) {
usr.bin/gzip/gzip.c
1089
if (fchmod(fd, sb.st_mode) < 0)
usr.bin/gzip/gzip.c
1094
if (futimens(fd, times) < 0)
usr.bin/gzip/gzip.c
1098
if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
usr.bin/gzip/gzip.c
1378
int fd, ofd, zfd = -1;
usr.bin/gzip/gzip.c
1387
fd = open(file, O_RDONLY);
usr.bin/gzip/gzip.c
1388
if (fd < 0) {
usr.bin/gzip/gzip.c
1392
if (fstat(fd, &isb) != 0) {
usr.bin/gzip/gzip.c
1408
rbytes = read(fd, fourbytes, sizeof fourbytes);
usr.bin/gzip/gzip.c
1431
rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
usr.bin/gzip/gzip.c
1443
rbytes = pread(fd, name, sizeof(name) - 1, GZIP_ORIGNAME);
usr.bin/gzip/gzip.c
1473
lseek(fd, 0, SEEK_SET);
usr.bin/gzip/gzip.c
1514
size = unbzip2(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1528
if ((in = zdopen(fd)) == NULL) {
usr.bin/gzip/gzip.c
1570
size = unpack(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1577
size = unxz_len(fd);
usr.bin/gzip/gzip.c
1580
close(fd);
usr.bin/gzip/gzip.c
1584
size = unxz(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1594
size = unlz(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1604
size = unzstd(fd, zfd, NULL, 0, NULL);
usr.bin/gzip/gzip.c
1612
size = cat_fd(NULL, 0, NULL, fd);
usr.bin/gzip/gzip.c
1616
print_list(fd, in_size, outfile, isb.st_mtime);
usr.bin/gzip/gzip.c
1618
close(fd);
usr.bin/gzip/gzip.c
1623
size = gz_uncompress(fd, zfd, NULL, 0, NULL, file);
usr.bin/gzip/gzip.c
1627
if (close(fd) != 0)
usr.bin/gzip/gzip.c
1681
if (fd != -1)
usr.bin/gzip/gzip.c
1682
close(fd);
usr.bin/gzip/gzip.c
1708
cat_fd(unsigned char * prepend, size_t count, off_t *gsizep, int fd)
usr.bin/gzip/gzip.c
1723
rv = read(fd, buf, sizeof buf);
usr.bin/gzip/gzip.c
1727
maybe_warn("read from fd %d", fd);
usr.bin/gzip/gzip.c
2084
print_list(int fd, off_t out, const char *outfile, time_t ts)
usr.bin/gzip/gzip.c
2101
if (fd == -1) {
usr.bin/gzip/gzip.c
2107
rv = lseek(fd, (off_t)(-8), SEEK_END);
usr.bin/gzip/gzip.c
2112
rv = read(fd, (char *)buf, sizeof(buf));
usr.bin/gzip/gzip.c
2126
if (vflag && fd == -1)
usr.bin/gzip/gzip.c
2220
read_retry(int fd, void *buf, size_t sz)
usr.bin/gzip/gzip.c
2228
ret = read(fd, cp, left);
usr.bin/gzip/gzip.c
2242
write_retry(int fd, const void *buf, size_t sz)
usr.bin/gzip/gzip.c
2250
ret = write(fd, cp, left);
usr.bin/gzip/gzip.c
244
static void print_list(int fd, off_t, const char *, time_t);
usr.bin/gzip/gzip.c
259
static off_t cat_fd(unsigned char *, size_t, off_t *, int fd);
usr.bin/gzip/gzip.c
264
static void copymodes(int fd, const struct stat *, const char *file);
usr.bin/gzip/unxz.c
185
io_pread(int fd, io_buf *buf, size_t size, off_t pos)
usr.bin/gzip/unxz.c
189
if (lseek(fd, pos, SEEK_SET) != pos) {
usr.bin/gzip/unxz.c
193
const size_t amount = read(fd, buf, size);
usr.bin/gzip/unxz.c
464
unxz_len(int fd)
usr.bin/gzip/unxz.c
467
if (!parse_indexes(&xfi, fd)) {
usr.bin/gzip/zuncompress.c
173
zdopen(int fd)
usr.bin/gzip/zuncompress.c
198
if ((zs->zs_fp = fdopen(fd, "r")) == NULL) {
usr.bin/iscsictl/periphs.c
118
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
usr.bin/iscsictl/periphs.c
200
close(fd);
usr.bin/iscsictl/periphs.c
68
int bufsize, fd;
usr.bin/iscsictl/periphs.c
73
if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
usr.bin/iscsictl/periphs.c
94
close(fd);
usr.bin/kdump/kdump.c
2336
printf("{ fd=%d", pfd->fd);
usr.bin/ktrace/ktrace.c
136
if ((fd = open(tracefile, O_CREAT | O_WRONLY | O_NONBLOCK,
usr.bin/ktrace/ktrace.c
139
if (fstat(fd, &sb) != 0 || sb.st_uid != getuid())
usr.bin/ktrace/ktrace.c
147
if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY,
usr.bin/ktrace/ktrace.c
152
(void)close(fd);
usr.bin/ktrace/ktrace.c
60
int append, ch, fd, inherit, ops, trpoints;
usr.bin/ldd/ldd.c
136
int aflag, c, fd, rval, status, is_shlib, rv, type;
usr.bin/ldd/ldd.c
169
if ((fd = open(*argv, O_RDONLY | O_VERIFY, 0)) < 0) {
usr.bin/ldd/ldd.c
174
rv = is_executable(*argv, fd, &is_shlib, &type);
usr.bin/ldd/ldd.c
175
close(fd);
usr.bin/ldd/ldd.c
390
is_executable(const char *fname, int fd, int *is_shlib, int *type)
usr.bin/ldd/ldd.c
408
elf = elf_begin(fd, ELF_C_READ, NULL);
usr.bin/ldd/ldd.c
72
static int is_executable(const char *fname, int fd, int *is_shlib,
usr.bin/locate/locate/locate.c
267
int fd;
usr.bin/locate/locate/locate.c
279
if ((fd = open(db, O_RDONLY)) == -1) {
usr.bin/locate/locate/locate.c
287
fd, (off_t)0)) == MAP_FAILED)
usr.bin/locate/locate/locate.c
302
(void)close(fd);
usr.bin/lockf/lockf.c
320
int fd;
usr.bin/lockf/lockf.c
326
fd = (int)subj->subj_fd;
usr.bin/lockf/lockf.c
330
if (flock(fd, lflags) == -1) {
usr.bin/lockf/lockf.c
333
err(EX_CANTCREAT, "cannot lock fd %d", fd);
usr.bin/lockf/lockf.c
335
} else if ((fd = open(subj->subj_name, O_EXLOCK|flags, 0666)) == -1) {
usr.bin/lockf/lockf.c
345
return (fd);
usr.bin/lockf/lockf.c
425
int fd;
usr.bin/lockf/lockf.c
427
if ((fd = open(name, O_RDONLY|O_EXLOCK, 0666)) == -1) {
usr.bin/lockf/lockf.c
432
close(fd);
usr.bin/lockf/lockf.c
80
long fd;
usr.bin/lockf/lockf.c
88
fd = strtol(name, &endp, 10);
usr.bin/lockf/lockf.c
92
*ofd = fd;
usr.bin/look/look.c
136
if ((fd = open(file, O_RDONLY, 0)) < 0 || fstat(fd, &sb))
usr.bin/look/look.c
141
close(fd);
usr.bin/look/look.c
144
if ((front = mmap(NULL, (size_t)sb.st_size, PROT_READ, MAP_SHARED, fd, (off_t)0)) == MAP_FAILED)
usr.bin/look/look.c
148
close(fd);
usr.bin/look/look.c
92
int ch, fd, match;
usr.bin/m4/eval.c
399
int fd;
usr.bin/m4/eval.c
404
fd = mkstemp(temp);
usr.bin/m4/eval.c
405
if (fd == -1)
usr.bin/m4/eval.c
409
close(fd);
usr.bin/m4/eval.c
819
int fd;
usr.bin/m4/eval.c
834
if ((fd = mkstemp(fname)) == -1 ||
usr.bin/m4/eval.c
836
(outfile[n] = fdopen(fd, "w+")) == NULL)
usr.bin/mail/collect.c
105
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
106
(collf = Fdopen(fd, "w+")) == NULL) {
usr.bin/mail/collect.c
564
int fd;
usr.bin/mail/collect.c
570
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/collect.c
571
(nf = Fdopen(fd, "w+")) == NULL) {
usr.bin/mail/collect.c
70
int lc, cc, escape, eofcount, fd, c, t;
usr.bin/mail/lex.c
126
if ((fd = mkstemp(tempname)) == -1 || (otf = fdopen(fd, "w")) == NULL)
usr.bin/mail/lex.c
62
int checkmode, i, fd;
usr.bin/mail/names.c
304
int fd;
usr.bin/mail/names.c
309
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/names.c
310
(fout = Fdopen(fd, "a")) == NULL) {
usr.bin/mail/popen.c
76
Fdopen(int fd, const char *mode)
usr.bin/mail/popen.c
80
if ((fp = fdopen(fd, mode)) != NULL) {
usr.bin/mail/quit.c
106
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
107
(rbuf = Fdopen(fd, "w")) == NULL)
usr.bin/mail/quit.c
198
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
199
(obuf = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/quit.c
225
if ((fd = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= 0)
usr.bin/mail/quit.c
226
(void)close(fd);
usr.bin/mail/quit.c
418
int fd;
usr.bin/mail/quit.c
422
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/quit.c
423
(obuf = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/quit.c
68
int c, fd;
usr.bin/mail/send.c
453
int c, fd;
usr.bin/mail/send.c
458
if ((fd = mkstemp(tempname)) == -1 ||
usr.bin/mail/send.c
459
(nfo = Fdopen(fd, "w")) == NULL) {
usr.bin/mail/tests/mailx_signal_test.c
100
fds[0].fd = opd[0];
usr.bin/mail/tests/mailx_signal_test.c
102
fds[1].fd = epd[0];
usr.bin/mail/v7.local.c
65
int fd;
usr.bin/mail/v7.local.c
68
if ((fd = open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >=
usr.bin/mail/v7.local.c
70
(void)close(fd);
usr.bin/mididump/mididump.c
144
read_byte(int fd)
usr.bin/mididump/mididump.c
148
if (read(fd, &byte, sizeof(byte)) < (ssize_t)sizeof(byte))
usr.bin/mididump/mididump.c
159
int fd, ch, tflag = 0;
usr.bin/mididump/mididump.c
178
if ((fd = open(*argv, O_RDONLY)) < 0)
usr.bin/mididump/mididump.c
182
event = read_byte(fd);
usr.bin/mididump/mididump.c
190
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
191
b2 = read_byte(fd);
usr.bin/mididump/mididump.c
205
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
206
b2 = read_byte(fd);
usr.bin/mididump/mididump.c
212
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
213
b2 = read_byte(fd);
usr.bin/mididump/mididump.c
234
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
240
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
247
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
248
b2 = read_byte(fd);
usr.bin/mididump/mididump.c
254
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
258
read_byte(fd), read_byte(fd));
usr.bin/mididump/mididump.c
262
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
271
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
272
b2 = read_byte(fd);
usr.bin/mididump/mididump.c
277
b1 = read_byte(fd);
usr.bin/mididump/mididump.c
317
close(fd);
usr.bin/mkimg/format.c
87
format_write(int fd)
usr.bin/mkimg/format.c
93
error = format->write(fd);
usr.bin/mkimg/image.c
251
image_chunk_append(lba_t blk, size_t sz, off_t ofs, int fd)
usr.bin/mkimg/image.c
257
if (fd == ch->ch_u.file.fd &&
usr.bin/mkimg/image.c
275
ch->ch_u.file.fd = fd;
usr.bin/mkimg/image.c
282
image_chunk_copyin(lba_t blk, void *buf, size_t sz, off_t ofs, int fd)
usr.bin/mkimg/image.c
293
error = image_chunk_append(blk, secsz, ofs, fd);
usr.bin/mkimg/image.c
307
image_file_map(int fd, off_t ofs, size_t sz, off_t *iofp)
usr.bin/mkimg/image.c
326
prot = PROT_READ | ((fd == image_swap_fd) ? PROT_WRITE : 0);
usr.bin/mkimg/image.c
328
ptr = mmap(NULL, sz, prot, flags, fd, ofs);
usr.bin/mkimg/image.c
350
image_copyin_stream(lba_t blk, int fd, uint64_t *sizep)
usr.bin/mkimg/image.c
376
rdsz = read(fd, &buffer[iof], iosz);
usr.bin/mkimg/image.c
399
image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep)
usr.bin/mkimg/image.c
413
end = lseek(fd, 0L, SEEK_END);
usr.bin/mkimg/image.c
415
return (image_copyin_stream(blk, fd, sizep));
usr.bin/mkimg/image.c
422
fd = dup(fd);
usr.bin/mkimg/image.c
423
if (fd == -1)
usr.bin/mkimg/image.c
432
hole = lseek(fd, cur, SEEK_HOLE);
usr.bin/mkimg/image.c
435
data = lseek(fd, cur, SEEK_DATA);
usr.bin/mkimg/image.c
463
buf = mp = image_file_map(fd, data, sz, &iof);
usr.bin/mkimg/image.c
467
sz, data, fd);
usr.bin/mkimg/image.c
486
close(fd);
usr.bin/mkimg/image.c
493
image_copyin(lba_t blk, int fd, uint64_t *sizep)
usr.bin/mkimg/image.c
500
if (fstat(fd, &sb) == -1 || !S_ISREG(sb.st_mode))
usr.bin/mkimg/image.c
501
error = image_copyin_stream(blk, fd, sizep);
usr.bin/mkimg/image.c
503
error = image_copyin_mapped(blk, fd, sizep);
usr.bin/mkimg/image.c
513
image_copyout(int fd)
usr.bin/mkimg/image.c
517
error = image_copyout_region(fd, 0, image_size);
usr.bin/mkimg/image.c
519
error = image_copyout_done(fd);
usr.bin/mkimg/image.c
524
image_copyout_done(int fd)
usr.bin/mkimg/image.c
529
ofs = lseek(fd, 0L, SEEK_CUR);
usr.bin/mkimg/image.c
532
error = (ftruncate(fd, ofs) == -1) ? errno : 0;
usr.bin/mkimg/image.c
537
image_copyout_memory(int fd, size_t size, void *ptr)
usr.bin/mkimg/image.c
540
if (write(fd, ptr, size) == -1)
usr.bin/mkimg/image.c
546
image_copyout_zeroes(int fd, size_t count)
usr.bin/mkimg/image.c
552
if (lseek(fd, (off_t)count, SEEK_CUR) != -1)
usr.bin/mkimg/image.c
567
error = image_copyout_memory(fd, sz, zeroes);
usr.bin/mkimg/image.c
576
image_copyout_file(int fd, size_t size, int ifd, off_t iofs)
usr.bin/mkimg/image.c
592
error = image_copyout_memory(fd, sz, buf);
usr.bin/mkimg/image.c
603
image_copyout_region(int fd, lba_t blk, lba_t size)
usr.bin/mkimg/image.c
623
error = image_copyout_zeroes(fd, sz);
usr.bin/mkimg/image.c
626
error = image_copyout_file(fd, sz, ch->ch_u.file.fd,
usr.bin/mkimg/image.c
630
error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr);
usr.bin/mkimg/image.c
67
int fd; /* FD of backing file. */
usr.bin/mkimg/image.c
717
if (ch->ch_u.file.fd != -1)
usr.bin/mkimg/image.c
718
close(ch->ch_u.file.fd);
usr.bin/mkimg/image.h
36
int image_copyin(lba_t blk, int fd, uint64_t *sizep);
usr.bin/mkimg/image.h
37
int image_copyout(int fd);
usr.bin/mkimg/image.h
38
int image_copyout_done(int fd);
usr.bin/mkimg/image.h
39
int image_copyout_region(int fd, lba_t blk, lba_t size);
usr.bin/mkimg/image.h
40
int image_copyout_zeroes(int fd, size_t count);
usr.bin/mkimg/mkimg.c
333
sparse_write(int fd, const void *ptr, size_t sz)
usr.bin/mkimg/mkimg.c
349
wr = write(fd, buf, len);
usr.bin/mkimg/mkimg.c
359
ofs = lseek(fd, len, SEEK_CUR);
usr.bin/mkimg/mkimg.c
455
int error, fd;
usr.bin/mkimg/mkimg.c
523
fd = open(part->contents, O_RDONLY, 0);
usr.bin/mkimg/mkimg.c
524
if (fd != -1) {
usr.bin/mkimg/mkimg.c
525
error = image_copyin(block, fd, &bytesize);
usr.bin/mkimg/mkimg.c
526
close(fd);
usr.bin/mkimg/mkimg.c
533
fd = fileno(fp);
usr.bin/mkimg/mkimg.c
534
error = image_copyin(block, fd, &bytesize);
usr.bin/mkimg/qcow.c
130
qcow_write(int fd, u_int version)
usr.bin/mkimg/qcow.c
206
if (sparse_write(fd, hdr, clstrsz) < 0) {
usr.bin/mkimg/qcow.c
236
if (sparse_write(fd, l1tbl, clstrsz * clstr_l1tblsz) < 0) {
usr.bin/mkimg/qcow.c
258
if (sparse_write(fd, rctbl, clstrsz * clstr_rctblsz) < 0) {
usr.bin/mkimg/qcow.c
286
if (sparse_write(fd, l2tbl, clstrsz) < 0) {
usr.bin/mkimg/qcow.c
305
if (sparse_write(fd, rcblk, clstrsz * clstr_rcblks) < 0) {
usr.bin/mkimg/qcow.c
317
error = image_copyout_region(fd, blk, blk_clstrsz);
usr.bin/mkimg/qcow.c
323
error = image_copyout_done(fd);
usr.bin/mkimg/qcow.c
340
qcow1_write(int fd)
usr.bin/mkimg/qcow.c
343
return (qcow_write(fd, QCOW_VERSION_1));
usr.bin/mkimg/qcow.c
347
qcow2_write(int fd)
usr.bin/mkimg/qcow.c
350
return (qcow_write(fd, QCOW_VERSION_2));
usr.bin/mkimg/raw.c
44
raw_write(int fd)
usr.bin/mkimg/raw.c
47
return (image_copyout(fd));
usr.bin/mkimg/scheme.c
123
scheme_bootcode(int fd)
usr.bin/mkimg/scheme.c
130
if (fstat(fd, &sb) == -1)
usr.bin/mkimg/scheme.c
139
if (read(fd, bootcode, sb.st_size) != sb.st_size) {
usr.bin/mkimg/scheme.h
94
int scheme_bootcode(int fd);
usr.bin/mkimg/vhd.c
274
vhd_dyn_write(int fd)
usr.bin/mkimg/vhd.c
290
if (sparse_write(fd, &footer, sizeof(footer)) < 0)
usr.bin/mkimg/vhd.c
302
if (sparse_write(fd, &header, sizeof(header)) < 0)
usr.bin/mkimg/vhd.c
320
if (sparse_write(fd, bat, batsz) < 0) {
usr.bin/mkimg/vhd.c
340
if (sparse_write(fd, bitmap, VHD_SECTOR_SIZE) < 0) {
usr.bin/mkimg/vhd.c
347
error = image_copyout_region(fd, blk, blkcnt);
usr.bin/mkimg/vhd.c
355
error = image_copyout_zeroes(fd, imgsz - rawsz);
usr.bin/mkimg/vhd.c
358
if (sparse_write(fd, &footer, sizeof(footer)) < 0)
usr.bin/mkimg/vhd.c
391
vhd_fix_write(int fd)
usr.bin/mkimg/vhd.c
397
error = image_copyout(fd);
usr.bin/mkimg/vhd.c
403
error = (sparse_write(fd, &footer, sizeof(footer)) < 0) ? errno : 0;
usr.bin/mkimg/vhdx.c
221
vhdx_write_and_pad(int fd, const void *data, size_t data_size, size_t align)
usr.bin/mkimg/vhdx.c
225
if (sparse_write(fd, data, data_size) < 0)
usr.bin/mkimg/vhdx.c
232
return image_copyout_zeroes(fd, pad_size);
usr.bin/mkimg/vhdx.c
236
vhdx_write_headers(int fd)
usr.bin/mkimg/vhdx.c
252
error = vhdx_write_and_pad(fd, &header, sizeof(header), SIZE_64KB);
usr.bin/mkimg/vhdx.c
261
return vhdx_write_and_pad(fd, &header, sizeof(header), SIZE_64KB);
usr.bin/mkimg/vhdx.c
265
vhdx_write_region_tables(int fd)
usr.bin/mkimg/vhdx.c
301
if (sparse_write(fd, region_table, SIZE_64KB) < 0) {
usr.bin/mkimg/vhdx.c
308
if (sparse_write(fd, region_table, SIZE_64KB) < 0) {
usr.bin/mkimg/vhdx.c
319
vhdx_write_metadata(int fd, uint64_t image_size)
usr.bin/mkimg/vhdx.c
395
if (sparse_write(fd, metadata, SIZE_1MB) < 0) {
usr.bin/mkimg/vhdx.c
406
vhdx_write_bat(int fd, uint64_t image_size)
usr.bin/mkimg/vhdx.c
440
if (sparse_write(fd, bat, SIZE_1MB) < 0) {
usr.bin/mkimg/vhdx.c
457
if (sparse_write(fd, bat, SIZE_1MB) < 0) {
usr.bin/mkimg/vhdx.c
469
if (sparse_write(fd, bat, SIZE_1MB) < 0) {
usr.bin/mkimg/vhdx.c
481
vhdx_write(int fd)
usr.bin/mkimg/vhdx.c
492
error = vhdx_write_and_pad(fd, &identifier, sizeof(identifier), SIZE_64KB);
usr.bin/mkimg/vhdx.c
496
error = vhdx_write_headers(fd);
usr.bin/mkimg/vhdx.c
501
error = vhdx_write_region_tables(fd);
usr.bin/mkimg/vhdx.c
506
error = image_copyout_zeroes(fd, SIZE_1MB - 5*SIZE_64KB);
usr.bin/mkimg/vhdx.c
509
error = image_copyout_zeroes(fd, SIZE_1MB);
usr.bin/mkimg/vhdx.c
513
error = vhdx_write_metadata(fd, imgsz);
usr.bin/mkimg/vhdx.c
517
error = vhdx_write_bat(fd, imgsz);
usr.bin/mkimg/vhdx.c
521
error = image_copyout(fd);
usr.bin/mkimg/vmdk.c
108
vmdk_write(int fd)
usr.bin/mkimg/vmdk.c
204
if (!error && sparse_write(fd, &hdr, VMDK_SECTOR_SIZE) < 0)
usr.bin/mkimg/vmdk.c
206
if (!error && sparse_write(fd, desc, desc_len) < 0)
usr.bin/mkimg/vmdk.c
208
if (!error && sparse_write(fd, gd, gdsz) < 0)
usr.bin/mkimg/vmdk.c
210
if (!error && sparse_write(fd, gt, gtsz) < 0)
usr.bin/mkimg/vmdk.c
212
if (!error && sparse_write(fd, rgd, gdsz) < 0)
usr.bin/mkimg/vmdk.c
214
if (!error && sparse_write(fd, gt, gtsz) < 0)
usr.bin/mkimg/vmdk.c
230
if (sparse_write(fd, buf, VMDK_SECTOR_SIZE) < 0)
usr.bin/mkimg/vmdk.c
244
error = image_copyout_region(fd, blkofs, blkcnt);
usr.bin/mkimg/vmdk.c
249
return (image_copyout_done(fd));
usr.bin/mktemp/mktemp.c
175
fd = mkstemp(name);
usr.bin/mktemp/mktemp.c
176
if (fd < 0) {
usr.bin/mktemp/mktemp.c
181
close(fd);
usr.bin/mktemp/mktemp.c
61
int c, fd, ret;
usr.bin/mkuzip/mkuz_blockcache.c
103
assert((unsigned)lseek(fd, 0, SEEK_CUR) == bp->info.offset);
usr.bin/mkuzip/mkuz_blockcache.c
118
rval = verify_match(fd, bp, bcep);
usr.bin/mkuzip/mkuz_blockcache.c
52
verify_match(int fd, const struct mkuz_blk *cbp, struct mkuz_blkcache_itm *bcep)
usr.bin/mkuzip/mkuz_blockcache.c
63
if (lseek(fd, bcep->hit.offset, SEEK_SET) < 0) {
usr.bin/mkuzip/mkuz_blockcache.c
66
rlen = read(fd, vbuf, cbp->info.len);
usr.bin/mkuzip/mkuz_blockcache.c
72
lseek(fd, cbp->info.offset, SEEK_SET);
usr.bin/mkuzip/mkuz_blockcache.c
96
mkuz_blkcache_regblock(int fd, const struct mkuz_blk *bp)
usr.bin/mkuzip/mkuzip.c
424
readblock(int fd, u_int32_t clstsize)
usr.bin/mkuzip/mkuzip.c
435
cpos = lseek(fd, 0, SEEK_CUR);
usr.bin/mkuzip/mkuzip.c
442
numread = read(fd, rval->data, clstsize);
usr.bin/msgs/msgs.c
727
int n, cmsg, fd;
usr.bin/msgs/msgs.c
771
fd = open(fname, O_RDWR|O_EXCL|O_CREAT|O_APPEND);
usr.bin/msgs/msgs.c
775
fd = mkstemp(fname);
usr.bin/msgs/msgs.c
776
if (fd != -1) {
usr.bin/msgs/msgs.c
782
if (fd == -1 || (cpto = fdopen(fd, "a")) == NULL) {
usr.bin/msgs/msgs.c
783
if (fd != -1)
usr.bin/msgs/msgs.c
784
close(fd);
usr.bin/nohup/nohup.c
103
fd = open(p = path, O_RDWR | O_CREAT | O_APPEND,
usr.bin/nohup/nohup.c
105
if (fd != -1)
usr.bin/nohup/nohup.c
111
if (dup2(fd, STDOUT_FILENO) == -1)
usr.bin/nohup/nohup.c
85
int fd;
usr.bin/nohup/nohup.c
97
fd = open(p, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
usr.bin/nohup/nohup.c
98
if (fd != -1)
usr.bin/patch/patch.c
152
int error = 0, hunk, failed, i, fd;
usr.bin/patch/patch.c
177
if ((fd = mkstemp(TMPOUTNAME)) < 0)
usr.bin/patch/patch.c
179
close(fd);
usr.bin/patch/patch.c
183
if ((fd = mkstemp(TMPINNAME)) < 0)
usr.bin/patch/patch.c
185
close(fd);
usr.bin/patch/patch.c
189
if ((fd = mkstemp(TMPREJNAME)) < 0)
usr.bin/patch/patch.c
191
close(fd);
usr.bin/patch/patch.c
195
if ((fd = mkstemp(TMPPATNAME)) < 0)
usr.bin/patch/patch.c
197
close(fd);
usr.bin/posixmqcontrol/posixmqcontrol.c
468
int fd = mq_getfd_np(handle);
usr.bin/posixmqcontrol/posixmqcontrol.c
470
if (fd < 0) {
usr.bin/posixmqcontrol/posixmqcontrol.c
478
int result = fstat(fd, &status);
usr.bin/posixmqcontrol/posixmqcontrol.c
493
result = fchown(fd, q_creation.user, q_creation.group);
usr.bin/posixmqcontrol/posixmqcontrol.c
506
result = fchmod(fd, q_creation.mode);
usr.bin/posixmqcontrol/posixmqcontrol.c
586
int fd = mq_getfd_np(handle);
usr.bin/posixmqcontrol/posixmqcontrol.c
589
result = fstat(fd, &status);
usr.bin/posixshmcontrol/posixshmcontrol.c
226
int c, error, fd, jid, mib[3], ret;
usr.bin/posixshmcontrol/posixshmcontrol.c
306
fd = shm_open(kif->kf_path, O_RDONLY, 0);
usr.bin/posixshmcontrol/posixshmcontrol.c
307
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
314
error = fstat(fd, &st);
usr.bin/posixshmcontrol/posixshmcontrol.c
315
close(fd);
usr.bin/posixshmcontrol/posixshmcontrol.c
350
int fd, ret;
usr.bin/posixshmcontrol/posixshmcontrol.c
353
fd = shm_open(path, O_RDONLY, 0);
usr.bin/posixshmcontrol/posixshmcontrol.c
354
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
359
size = read(fd, buf, sizeof(buf));
usr.bin/posixshmcontrol/posixshmcontrol.c
377
close(fd);
usr.bin/posixshmcontrol/posixshmcontrol.c
405
int error, fd, ret;
usr.bin/posixshmcontrol/posixshmcontrol.c
409
fd = shm_open(path, O_RDONLY, 0);
usr.bin/posixshmcontrol/posixshmcontrol.c
410
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
415
error = fstat(fd, &st);
usr.bin/posixshmcontrol/posixshmcontrol.c
446
error = ioctl(fd, FIOGSHMLPGCNF, &conf_dummy);
usr.bin/posixshmcontrol/posixshmcontrol.c
454
close(fd);
usr.bin/posixshmcontrol/posixshmcontrol.c
500
int error, fd, ret;
usr.bin/posixshmcontrol/posixshmcontrol.c
503
fd = shm_open(path, O_RDWR, 0);
usr.bin/posixshmcontrol/posixshmcontrol.c
504
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
508
error = ftruncate(fd, newsize);
usr.bin/posixshmcontrol/posixshmcontrol.c
513
close(fd);
usr.bin/posixshmcontrol/posixshmcontrol.c
64
int fd;
usr.bin/posixshmcontrol/posixshmcontrol.c
67
fd = shm_open(path, O_RDWR | O_CREAT, mode);
usr.bin/posixshmcontrol/posixshmcontrol.c
68
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
73
fd = shm_create_largepage(path, O_RDWR, idx,
usr.bin/posixshmcontrol/posixshmcontrol.c
75
if (fd == -1) {
usr.bin/posixshmcontrol/posixshmcontrol.c
80
close(fd);
usr.bin/procstat/procstat_kqueue.c
233
procstat_kqueue(struct procstat *procstat, struct kinfo_proc *kipp, int fd,
usr.bin/procstat/procstat_kqueue.c
242
knis = procstat_get_kqueue_info(procstat, kipp, fd, &count, errbuf);
usr.bin/procstat/procstat_kqueue.c
258
xo_emit("{:kqueue_fd/%10d} ", fd);
usr.bin/random/random.c
139
if ((fd = open(filename, O_RDONLY, 0)) < 0)
usr.bin/random/random.c
141
ret = randomize_fd(fd, random_type, unique_output, denom);
usr.bin/random/random.c
56
int ch, fd, random_exit, randomize_lines, random_type, ret,
usr.bin/random/randomize_fd.c
119
len = read(fd, buf, buflen);
usr.bin/random/randomize_fd.c
139
len = read(fd, &buf[i], buflen - i);
usr.bin/random/randomize_fd.c
158
len = read(fd, &buf[i], buflen - i);
usr.bin/random/randomize_fd.c
207
(void)close(fd);
usr.bin/random/randomize_fd.c
94
randomize_fd(int fd, int type, int unique, double denom)
usr.bin/random/randomize_fd.h
41
int randomize_fd(int fd, int type, int unique, double denom);
usr.bin/resizewin/resizewin.c
102
if (tcsetattr(fd, TCSAFLUSH, &new) == -1)
usr.bin/resizewin/resizewin.c
105
if (write(fd, query, sizeof(query) - 1) != sizeof(query) - 1) {
usr.bin/resizewin/resizewin.c
115
ret = read(fd, data + cnt, 1);
usr.bin/resizewin/resizewin.c
152
if (ioctl(fd, TIOCSWINSZ, &w) == -1)
usr.bin/resizewin/resizewin.c
156
tcsetattr(fd, TCSANOW, &old);
usr.bin/resizewin/resizewin.c
158
close(fd);
usr.bin/resizewin/resizewin.c
67
int ch, cnt, error, fd, ret, zflag;
usr.bin/resizewin/resizewin.c
85
if ((fd = open("/dev/tty", O_RDWR | O_NONBLOCK)) == -1)
usr.bin/resizewin/resizewin.c
89
if (ioctl(fd, TIOCGWINSZ, &w) == -1)
usr.bin/resizewin/resizewin.c
96
if (tcgetattr(fd, &old) == -1)
usr.bin/rpcinfo/rpcinfo.c
1247
static int fd = RPC_ANYFD;
usr.bin/rpcinfo/rpcinfo.c
1249
if (fd == RPC_ANYFD) {
usr.bin/rpcinfo/rpcinfo.c
1250
if ((fd = __rpc_nconf2fd(nconf)) == -1) {
usr.bin/rpcinfo/rpcinfo.c
1260
client = clnt_tli_create(fd, nconf, nbuf, prog, vers, 0, 0);
usr.bin/rpcinfo/rpcinfo.c
1284
int fd;
usr.bin/rpcinfo/rpcinfo.c
1318
(void) CLNT_CONTROL(client, CLGET_FD, (char *)&fd);
usr.bin/rpcinfo/rpcinfo.c
1364
(void) close(fd);
usr.bin/rpcinfo/rpcinfo.c
366
int fd = RPC_ANYFD;
usr.bin/rpcinfo/rpcinfo.c
390
client = clnt_com_create(&addr, prognum, vers, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
414
client = clnt_com_create(&addr, prognum, MAX_VERS, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
442
client = clnt_com_create(&addr, prognum, vers, &fd, trans);
usr.bin/rpcinfo/rpcinfo.c
452
(void) close(fd);
usr.bin/ruptime/ruptime.c
184
int fd, hostnamewidth, i, loadavwidth[3], userswidth, w;
usr.bin/ruptime/ruptime.c
199
if ((fd = open(dp->d_name, O_RDONLY, 0)) < 0) {
usr.bin/ruptime/ruptime.c
212
cc = read(fd, wd, sizeof(*wd));
usr.bin/ruptime/ruptime.c
213
(void)close(fd);
usr.bin/rwall/rwall.c
121
int fd;
usr.bin/rwall/rwall.c
127
if ((fd = mkstemp(tmpname)) == -1 || (fp = fdopen(fd, "r+")) == NULL)
usr.bin/rwall/rwall.c
163
if (fstat(fd, &sbuf))
usr.bin/rwall/rwall.c
171
close(fd);
usr.bin/sdiff/edit.c
143
if ((fd = mkstemp(filename)) == -1)
usr.bin/sdiff/edit.c
150
if ((nwritten = write(fd, text, len)) == -1 ||
usr.bin/sdiff/edit.c
156
close(fd);
usr.bin/sdiff/edit.c
88
int fd;
usr.bin/sdiff/sdiff.c
212
int ch, fd[2], i, ret, status;
usr.bin/sdiff/sdiff.c
379
if (pipe(fd))
usr.bin/sdiff/sdiff.c
387
close(fd[0]);
usr.bin/sdiff/sdiff.c
388
if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO)
usr.bin/sdiff/sdiff.c
391
close(fd[1]);
usr.bin/sdiff/sdiff.c
398
close(fd[1]);
usr.bin/sdiff/sdiff.c
401
if ((diffpipe = fdopen(fd[0], "r")) == NULL)
usr.bin/sdiotool/sdiotool.c
429
int fd = open(fw_path, O_RDONLY);
usr.bin/sdiotool/sdiotool.c
430
if (fd < 0)
usr.bin/sdiotool/sdiotool.c
432
if (fstat(fd, &sb) < 0)
usr.bin/sdiotool/sdiotool.c
434
fw_ptr = mmap(NULL, sb.st_size, PROT_READ, 0, fd, 0);
usr.bin/sed/compile.c
283
cmd->u.fd = -1;
usr.bin/sed/compile.c
284
else if ((cmd->u.fd = open(p,
usr.bin/sed/defs.h
100
int fd; /* File descriptor for w */
usr.bin/sed/process.c
240
if (cp->u.fd == -1 && (cp->u.fd = open(cp->t,
usr.bin/sed/process.c
244
if (write(cp->u.fd, ps, psl) != (ssize_t)psl ||
usr.bin/sed/process.c
245
write(cp->u.fd, "\n", 1) != 1)
usr.bin/sed/process.c
776
if (cp->u.fd != -1 && close(cp->u.fd))
usr.bin/sed/process.c
778
cp->u.fd = -1;
usr.bin/sockstat/main.c
1186
int fd;
usr.bin/sockstat/main.c
1352
cw->fd = MAX(cw->fd, len);
usr.bin/sockstat/main.c
1574
cw->command, "??", cw->pid, "??", cw->fd, "??",
usr.bin/sockstat/main.c
1618
.fd = strlen(__HDR_FD),
usr.bin/sockstat/main.c
1643
__HDR_COMMAND, cw.pid, __HDR_PID, cw.fd, __HDR_FD, cw.proto,
usr.bin/sockstat/main.c
1696
xo_emit(" {:fd/%*d}", cw.fd, xf->xf_fd);
usr.bin/sockstat/main.c
1710
cw.pid, "??", cw.fd, "??");
usr.bin/sockstat/main.c
1723
cw.pid, "??", cw.fd, "??");
usr.bin/sort/file.c
189
int fd;
usr.bin/sort/file.c
193
if ((fd = mkstemp(ret)) == -1)
usr.bin/sort/file.c
195
close(fd);
usr.bin/sort/file.c
610
int fd, flags;
usr.bin/sort/file.c
614
fd = open(fsrc, O_RDONLY);
usr.bin/sort/file.c
615
if (fd < 0)
usr.bin/sort/file.c
618
if (fstat(fd, &stat_buf) < 0) {
usr.bin/sort/file.c
619
close(fd);
usr.bin/sort/file.c
629
addr = mmap(NULL, sz, PROT_READ, flags, fd, 0);
usr.bin/sort/file.c
631
close(fd);
usr.bin/sort/file.c
635
ret->fd = fd;
usr.bin/sort/file.c
705
if (fr->fd)
usr.bin/sort/file.c
706
close(fr->fd);
usr.bin/sort/file.c
75
int fd;
usr.bin/stat/stat.c
1071
fdlistholes(int fd, const char *fn)
usr.bin/stat/stat.c
1077
if (fstat(fd, &sb) < 0)
usr.bin/stat/stat.c
1080
if ((l = fpathconf(fd, _PC_MIN_HOLE_SIZE)) < 0)
usr.bin/stat/stat.c
1088
if ((off = lseek(fd, pos, SEEK_HOLE)) < 0) {
usr.bin/stat/stat.c
1102
if ((off = lseek(fd, pos, SEEK_DATA)) < 0) {
usr.bin/stat/stat.c
1110
if ((off = lseek(fd, 0, SEEK_END)) > pos)
usr.bin/stat/stat.c
1127
int fd, ret;
usr.bin/stat/stat.c
1129
if ((fd = open(fn, O_RDONLY)) < 0)
usr.bin/stat/stat.c
1131
ret = fdlistholes(fd, fn);
usr.bin/stat/stat.c
1132
close(fd);
usr.bin/tail/extern.h
50
int fd;
usr.bin/tail/forward.c
199
map.fd = fileno(fp);
usr.bin/tail/misc.c
110
mip->fd, mip->mapoff)) == MAP_FAILED)
usr.bin/tail/reverse.c
116
map.fd = fileno(fp);
usr.bin/talk/ctl_transact.c
58
pfd[0].fd = ctl_sockt;
usr.bin/talk/io.c
107
fds[0].fd = fileno(stdin);
usr.bin/talk/io.c
109
fds[1].fd = sockt;
usr.bin/tcopy/tcopy.cc
108
retval = read(fd, dst, (size_t)max_read_size);
usr.bin/tcopy/tcopy.cc
128
ssize_t nwrite = write(fd, src, len);
usr.bin/tcopy/tcopy.cc
150
if (ioctl(fd, MTIOCTOP, (char *)&op) < 0)
usr.bin/tcopy/tcopy.cc
161
if (ioctl(fd, MTIOCTOP, (char *)&op) < 0)
usr.bin/tcopy/tcopy.cc
178
ssize_t full_read(int fd, void *dst, size_t len)
usr.bin/tcopy/tcopy.cc
182
ssize_t retval = read(fd, dst, len);
usr.bin/tcopy/tcopy.cc
189
retval = read(fd, ptr, left);
usr.bin/tcopy/tcopy.cc
203
ssize_t nread = full_read(fd, lbuf, sizeof lbuf);
usr.bin/tcopy/tcopy.cc
220
ssize_t retval = full_read(fd, dst, alen);
usr.bin/tcopy/tcopy.cc
224
nread = full_read(fd, lbuf, sizeof lbuf);
usr.bin/tcopy/tcopy.cc
269
ssize_t nwrite = writev(fd, iov, niov);
usr.bin/tcopy/tcopy.cc
279
ssize_t nwrite = write(fd, tbuf, sizeof tbuf);
usr.bin/tcopy/tcopy.cc
291
ssize_t nwrite = write(fd, tbuf, sizeof tbuf);
usr.bin/tcopy/tcopy.cc
296
where = lseek(fd, 0L, SEEK_SET);
usr.bin/tcopy/tcopy.cc
320
if (fd >= 0) {
usr.bin/tcopy/tcopy.cc
321
assert(close(fd) >= 0);
usr.bin/tcopy/tcopy.cc
322
fd = -1;
usr.bin/tcopy/tcopy.cc
338
fd = open(name, O_RDWR|O_CREAT, DEFFILEMODE);
usr.bin/tcopy/tcopy.cc
339
if (fd < 0)
usr.bin/tcopy/tcopy.cc
342
fd = open(name, O_RDONLY, 0);
usr.bin/tcopy/tcopy.cc
358
if (fd < 0)
usr.bin/tcopy/tcopy.cc
360
if (fd < 0)
usr.bin/tcopy/tcopy.cc
362
ssize_t retval = read(fd, dst, expected);
usr.bin/tcopy/tcopy.cc
364
assert(close(fd) >= 0);
usr.bin/tcopy/tcopy.cc
365
fd = -1;
usr.bin/tcopy/tcopy.cc
373
if (fd < 0)
usr.bin/tcopy/tcopy.cc
375
ssize_t nwrite = write(fd, src, len);
usr.bin/tcopy/tcopy.cc
383
if (fd < 0)
usr.bin/tcopy/tcopy.cc
386
off_t where = lseek(fd, 0UL, SEEK_CUR);
usr.bin/tcopy/tcopy.cc
388
int i = ftruncate(fd, where);
usr.bin/tcopy/tcopy.cc
391
assert(close(fd) >= 0);
usr.bin/tcopy/tcopy.cc
392
fd = -1;
usr.bin/tcopy/tcopy.cc
430
return (read(fd, dst, expected));
usr.bin/tcopy/tcopy.cc
436
ssize_t nwrite = write(fd, src, len);
usr.bin/tcopy/tcopy.cc
460
int fd;
usr.bin/tcopy/tcopy.cc
463
fd = STDOUT_FILENO;
usr.bin/tcopy/tcopy.cc
465
fd = STDIN_FILENO;
usr.bin/tcopy/tcopy.cc
467
fd = open(arg, O_RDWR|O_CREAT, DEFFILEMODE);
usr.bin/tcopy/tcopy.cc
469
fd = open(arg, O_RDONLY);
usr.bin/tcopy/tcopy.cc
471
if (fd < 0)
usr.bin/tcopy/tcopy.cc
477
int i = ioctl(fd, MTIOCTOP, &mt);
usr.bin/tcopy/tcopy.cc
480
return (new tape_dev(fd, arg, how == H_OUTPUT));
usr.bin/tcopy/tcopy.cc
487
return (new file_set(fd, arg, how == H_OUTPUT));
usr.bin/tcopy/tcopy.cc
491
return (new flat_file(fd, arg, how == H_OUTPUT));
usr.bin/tcopy/tcopy.cc
493
return (new tap_file(fd, arg, how == H_OUTPUT));
usr.bin/tcopy/tcopy.cc
66
int fd;
usr.bin/tcopy/tcopy.cc
82
fd = file_handle;
usr.bin/tcopy/tcopy.cc
97
retval = read(fd, dst, max_read_size);
usr.bin/tee/tee.c
103
add(fd, *argv);
usr.bin/tee/tee.c
114
if ((wval = write(p->fd, bp, n)) == -1) {
usr.bin/tee/tee.c
135
add(int fd, const char *name)
usr.bin/tee/tee.c
140
if (fd == STDOUT_FILENO) {
usr.bin/tee/tee.c
145
if (caph_rights_limit(fd, &rights) < 0)
usr.bin/tee/tee.c
151
p->fd = fd;
usr.bin/tee/tee.c
161
int fd;
usr.bin/tee/tee.c
163
if ((fd = open(path, oflags, DEFFILEMODE)) >= 0)
usr.bin/tee/tee.c
164
return (fd);
usr.bin/tee/tee.c
178
fd = socket(PF_UNIX, SOCK_STREAM, 0);
usr.bin/tee/tee.c
179
if (fd < 0)
usr.bin/tee/tee.c
185
if (connect(fd, (const struct sockaddr *)&sun, sun.sun_len) == 0)
usr.bin/tee/tee.c
186
return (fd);
usr.bin/tee/tee.c
189
if (fd >= 0)
usr.bin/tee/tee.c
190
close(fd);
usr.bin/tee/tee.c
50
int fd;
usr.bin/tee/tee.c
65
int append, ch, exitval, fd, n, oflags, rval, wval;
usr.bin/tee/tee.c
99
if ((fd = tee_open(*argv, oflags)) < 0) {
usr.bin/tftp/main.c
424
int fd, n;
usr.bin/tftp/main.c
461
fd = open(cp, O_RDONLY);
usr.bin/tftp/main.c
462
if (fd < 0) {
usr.bin/tftp/main.c
467
if (fstat(fd, &sb) < 0) {
usr.bin/tftp/main.c
469
close(fd);
usr.bin/tftp/main.c
477
if (xmitfile(peer, port, fd, targ, mode))
usr.bin/tftp/main.c
479
close(fd);
usr.bin/tftp/main.c
488
fd = open(argv[n], O_RDONLY);
usr.bin/tftp/main.c
489
if (fd < 0) {
usr.bin/tftp/main.c
495
if (fstat(fd, &sb) < 0) {
usr.bin/tftp/main.c
497
close(fd);
usr.bin/tftp/main.c
506
if (xmitfile(peer, port, fd, path, mode) != 0)
usr.bin/tftp/main.c
508
close(fd);
usr.bin/tftp/main.c
531
int fd, n;
usr.bin/tftp/main.c
572
fd = creat(cp, 0644);
usr.bin/tftp/main.c
573
if (fd < 0) {
usr.bin/tftp/main.c
580
if (recvfile(peer, port, fd, src, mode) != 0) {
usr.bin/tftp/main.c
584
close(fd);
usr.bin/tftp/main.c
588
fd = creat(cp, 0644);
usr.bin/tftp/main.c
589
if (fd < 0) {
usr.bin/tftp/main.c
596
if (recvfile(peer, port, fd, src, mode) != 0) {
usr.bin/tftp/main.c
600
close(fd);
usr.bin/tftp/tftp.c
149
if (read_init(fd, NULL, mode) < 0) {
usr.bin/tftp/tftp.c
168
recvfile(int peer, char *port, int fd, char *name, char *mode)
usr.bin/tftp/tftp.c
237
if (write_init(fd, NULL, mode) < 0) {
usr.bin/tftp/tftp.c
64
xmitfile(int peer, char *port, int fd, char *name, char *mode)
usr.bin/tftp/tftp.h
32
int recvfile(int peer, char *port, int fd, char *name, char *mode);
usr.bin/tftp/tftp.h
33
int xmitfile(int peer, char *port, int fd, char *name, char *mode);
usr.bin/tip/libacu/biz31.c
210
bizsync(int fd)
usr.bin/tip/libacu/biz31.c
226
if (ioctl(fd, IOCTL, (caddr_t)&b) >= 0 && chars(b) > 0)
usr.bin/tip/libacu/biz31.c
228
write(fd, "\rp>\r", 4);
usr.bin/tip/libacu/biz31.c
230
if (ioctl(fd, IOCTL, (caddr_t)&b) >= 0) {
usr.bin/tip/libacu/biz31.c
235
write(fd, DISCONNECT_CMD, 4);
usr.bin/tip/libacu/biz31.c
240
read(fd, buf, 10);
usr.bin/tip/libacu/courier.c
304
cour_write(int fd, char *cp, int n)
usr.bin/tip/libacu/courier.c
310
tcdrain(fd);
usr.bin/tip/libacu/courier.c
313
write(fd, cp, 1);
usr.bin/tip/libacu/courier.c
314
tcdrain(fd);
usr.bin/tip/libacu/t3000.c
322
t3000_write(int fd, char *cp, int n)
usr.bin/tip/libacu/t3000.c
328
tcdrain(fd);
usr.bin/tip/libacu/t3000.c
331
write(fd, cp, 1);
usr.bin/tip/libacu/t3000.c
332
tcdrain(fd);
usr.bin/tip/libacu/ventel.c
211
vensync(int fd)
usr.bin/tip/libacu/ventel.c
233
write(fd, "\r", 1);
usr.bin/tip/libacu/ventel.c
235
write(fd, "\r", 1);
usr.bin/tip/libacu/ventel.c
237
if (ioctl(fd, FIONREAD, (caddr_t)&nread) < 0) {
usr.bin/tip/libacu/ventel.c
242
read(fd, buf, min(nread, 60));
usr.bin/tip/tip/acu.c
112
if ((fd = fopen(PH, "r")) == NOFILE) {
usr.bin/tip/tip/acu.c
116
while (fgets(string, sizeof(string), fd) != NOSTR) {
usr.bin/tip/tip/acu.c
138
fclose(fd);
usr.bin/tip/tip/acu.c
63
FILE *fd;
usr.bin/tip/tip/cmds.c
102
int fd, argc;
usr.bin/tip/tip/cmds.c
115
if ((fd = creat(cp, 0666)) < 0) {
usr.bin/tip/tip/cmds.c
120
transfer(line, fd, "\01");
usr.bin/tip/tip/cmds.c
130
transfer(char *buf, int fd, char *eofchars)
usr.bin/tip/tip/cmds.c
142
close(fd);
usr.bin/tip/tip/cmds.c
180
if ((size_t)write(fd, buffer, cnt) != cnt) {
usr.bin/tip/tip/cmds.c
188
if ((size_t)write(fd, buffer, cnt) != cnt)
usr.bin/tip/tip/cmds.c
196
close(fd);
usr.bin/tip/tip/tip.c
572
parwrite(int fd, char *buf, size_t n)
usr.bin/tip/tip/tip.c
583
if (write(fd, buf, n) < 0) {
usr.bin/tip/tip/uucplock.c
105
if (write(fd, text_pid, len) != len) {
usr.bin/tip/tip/uucplock.c
106
(void)close(fd);
usr.bin/tip/tip/uucplock.c
111
(void)close(fd);
usr.bin/tip/tip/uucplock.c
56
int fd, len;
usr.bin/tip/tip/uucplock.c
62
fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660);
usr.bin/tip/tip/uucplock.c
63
if (fd < 0) {
usr.bin/tip/tip/uucplock.c
68
fd = open(tbuf, O_RDWR, 0);
usr.bin/tip/tip/uucplock.c
69
if (fd < 0) {
usr.bin/tip/tip/uucplock.c
74
len = read(fd, text_pid, sizeof(text_pid)-1);
usr.bin/tip/tip/uucplock.c
77
(void)close(fd);
usr.bin/tip/tip/uucplock.c
85
(void)close(fd); /* process is still running */
usr.bin/tip/tip/uucplock.c
94
if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
usr.bin/tip/tip/uucplock.c
96
(void)close(fd);
usr.bin/touch/touch.c
164
fd = open(*argv,
usr.bin/touch/touch.c
166
if (fd < 0 || fstat(fd, &sb) < 0) {
usr.bin/touch/touch.c
169
if (fd >= 0)
usr.bin/touch/touch.c
170
(void)close(fd);
usr.bin/touch/touch.c
173
(void)close(fd);
usr.bin/touch/touch.c
60
int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset;
usr.bin/truncate/truncate.c
153
if (fd != -1)
usr.bin/truncate/truncate.c
154
close(fd);
usr.bin/truncate/truncate.c
155
if ((fd = open(fname, oflags, omode)) == -1) {
usr.bin/truncate/truncate.c
163
if (fstat(fd, &sb) == -1) {
usr.bin/truncate/truncate.c
178
if (fstat(fd, &sb) == -1) {
usr.bin/truncate/truncate.c
204
r = fspacectl(fd, SPACECTL_DEALLOC, &sr, 0, &sr);
usr.bin/truncate/truncate.c
207
r = ftruncate(fd, tsize);
usr.bin/truncate/truncate.c
213
if (fd != -1)
usr.bin/truncate/truncate.c
214
close(fd);
usr.bin/truncate/truncate.c
56
int ch, error, fd, oflags, r;
usr.bin/truncate/truncate.c
66
fd = -1;
usr.bin/truss/setup.c
588
f->fd = (int)psr.sr_retval[0];
usr.bin/truss/setup.c
601
if (f->fd == (int)t->cs.args[0]) {
usr.bin/truss/syscalls.c
1583
if (f->fd == num_fd && f->domain == AF_NETLINK)
usr.bin/truss/syscalls.c
1996
fprintf(fp, " %d/%s", pfd[i].fd,
usr.bin/truss/truss.h
101
int fd;
usr.bin/usbhidaction/usbhidaction.c
150
fd = open(dev, O_RDWR);
usr.bin/usbhidaction/usbhidaction.c
151
if (fd < 0)
usr.bin/usbhidaction/usbhidaction.c
153
repd = hid_get_report_desc(fd);
usr.bin/usbhidaction/usbhidaction.c
183
n = read(fd, buf, sz);
usr.bin/usbhidaction/usbhidaction.c
89
int fd, fp, ch, n, val, i;
usr.bin/wall/ttymsg.c
107
wret = writev(fd, iov, iovcnt);
usr.bin/wall/ttymsg.c
130
(void) close(fd);
usr.bin/wall/ttymsg.c
136
(void) close(fd);
usr.bin/wall/ttymsg.c
141
(void) close(fd);
usr.bin/wall/ttymsg.c
150
(void) fcntl(fd, F_SETFL, 0); /* clear O_NONBLOCK */
usr.bin/wall/ttymsg.c
160
(void) close(fd);
usr.bin/wall/ttymsg.c
167
(void) close(fd);
usr.bin/wall/ttymsg.c
64
int cnt, dd, fd, serrno;
usr.bin/wall/ttymsg.c
76
fd = openat(dd, tty, O_WRONLY | O_NONBLOCK | O_RESOLVE_BENEATH);
usr.bin/wall/ttymsg.c
77
if (fd < 0) {
usr.bin/wall/ttymsg.c
91
if (fstat(fd, &sb) != 0) {
usr.bin/wall/ttymsg.c
93
close(fd);
usr.bin/wall/ttymsg.c
98
close(fd);
usr.bin/wall/wall.c
184
int fd;
usr.bin/wall/wall.c
192
if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+")))
usr.bin/wall/wall.c
272
if (fstat(fd, &sbuf))
usr.bin/wc/wc.c
212
int fd;
usr.bin/wc/wc.c
218
fd = STDIN_FILENO;
usr.bin/wc/wc.c
220
} else if ((fd = fileargs_open(fa, file)) < 0) {
usr.bin/wc/wc.c
231
if (fstat(fd, &sb)) {
usr.bin/wc/wc.c
233
(void)close(fd);
usr.bin/wc/wc.c
242
(void)close(fd);
usr.bin/wc/wc.c
252
while ((len = read(fd, buf, sizeof(buf))) != 0) {
usr.bin/wc/wc.c
255
(void)close(fd);
usr.bin/wc/wc.c
282
(void)close(fd);
usr.bin/wc/wc.c
289
while ((len = read(fd, buf, sizeof(buf))) != 0) {
usr.bin/wc/wc.c
292
(void)close(fd);
usr.bin/wc/wc.c
349
(void)close(fd);
usr.bin/whois/whois.c
332
fds[i].fd = s;
usr.bin/whois/whois.c
397
if (fds[j].fd == -1 || fds[j].events == 0 ||
usr.bin/whois/whois.c
401
close(fds[j].fd);
usr.bin/whois/whois.c
402
fds[j].fd = -1;
usr.bin/whois/whois.c
408
s = fds[j].fd;
usr.bin/whois/whois.c
409
fds[j].fd = -1;
usr.bin/whois/whois.c
426
if (fds[j].fd != -1)
usr.bin/whois/whois.c
427
close(fds[j].fd);
usr.bin/write/write.c
286
int fd;
usr.bin/write/write.c
288
fd = openat(devfd, tty, O_WRONLY);
usr.bin/write/write.c
289
if (fd < 0)
usr.bin/write/write.c
292
stdout = fdopen(fd, "w");
usr.bin/xargs/xargs.c
559
int fd;
usr.bin/xargs/xargs.c
600
if ((fd = open(_PATH_TTY, O_RDONLY)) == -1)
usr.bin/xargs/xargs.c
603
fd = open(_PATH_DEVNULL, O_RDONLY);
usr.bin/xargs/xargs.c
605
if (fd > STDIN_FILENO) {
usr.bin/xargs/xargs.c
606
if (dup2(fd, STDIN_FILENO) != 0)
usr.bin/xargs/xargs.c
608
close(fd);
usr.bin/xinstall/xinstall.c
558
int fd;
usr.bin/xinstall/xinstall.c
560
if ((fd = mkstemp(template)) == -1)
usr.bin/xinstall/xinstall.c
562
close (fd);
usr.sbin/acpi/acpidb/acpidb.c
388
int dounlink, error, fd;
usr.sbin/acpi/acpidb/acpidb.c
390
fd = open(dsdtfile, O_RDONLY, 0);
usr.sbin/acpi/acpidb/acpidb.c
391
if (fd == -1) {
usr.sbin/acpi/acpidb/acpidb.c
395
if (fstat(fd, &sb) == -1) {
usr.sbin/acpi/acpidb/acpidb.c
397
close(fd);
usr.sbin/acpi/acpidb/acpidb.c
400
code = mmap(NULL, (size_t)sb.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t)0);
usr.sbin/acpi/acpidb/acpidb.c
401
close(fd);
usr.sbin/acpi/acpidb/acpidb.c
427
fd = open(filetmp, O_WRONLY | O_CREAT | O_TRUNC, mode);
usr.sbin/acpi/acpidb/acpidb.c
428
if (fd == -1) {
usr.sbin/acpi/acpidb/acpidb.c
433
write(fd, &dummy_dsdt_table, sizeof(ACPI_TABLE_HEADER));
usr.sbin/acpi/acpidb/acpidb.c
435
write(fd, code, sb.st_size);
usr.sbin/acpi/acpidb/acpidb.c
436
close(fd);
usr.sbin/acpi/acpidump/acpi.c
2847
write_dsdt(int fd, ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdt)
usr.sbin/acpi/acpidump/acpi.c
2871
write(fd, &sdt, sizeof(ACPI_TABLE_HEADER));
usr.sbin/acpi/acpidump/acpi.c
2872
write(fd, dsdt + 1, dsdt->Length - sizeof(ACPI_TABLE_HEADER));
usr.sbin/acpi/acpidump/acpi.c
2878
write(fd, ssdt + 1, ssdt->Length -
usr.sbin/acpi/acpidump/acpi.c
2889
int fd;
usr.sbin/acpi/acpidump/acpi.c
2894
fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, mode);
usr.sbin/acpi/acpidump/acpi.c
2895
if (fd == -1) {
usr.sbin/acpi/acpidump/acpi.c
2899
write_dsdt(fd, rsdt, dsdp);
usr.sbin/acpi/acpidump/acpi.c
2900
close(fd);
usr.sbin/acpi/acpidump/acpi.c
2912
int fd, status;
usr.sbin/acpi/acpidump/acpi.c
2933
fd = open(tmpstr, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
usr.sbin/acpi/acpidump/acpi.c
2934
if (fd < 0) {
usr.sbin/acpi/acpidump/acpi.c
2938
write_dsdt(fd, rsdt, dsdp);
usr.sbin/acpi/acpidump/acpi.c
2939
close(fd);
usr.sbin/acpi/einj/einj.c
108
if (ioctl(fd, ACPIIO_EINJ_GET_INFO, &info) == -1)
usr.sbin/acpi/einj/einj.c
233
if (ioctl(fd, ACPIIO_EINJ_SET_ERROR, &einj) == -1)
usr.sbin/acpi/einj/einj.c
243
fd = open("/dev/acpi", O_RDWR);
usr.sbin/acpi/einj/einj.c
244
if (fd == -1)
usr.sbin/acpi/einj/einj.c
25
static int fd;
usr.sbin/acpi/einj/einj.c
254
close(fd);
usr.sbin/acpi/einj/einj.c
84
if (ioctl(fd, ACPIIO_EINJ_GET_VENDOR, &vi) == -1) {
usr.sbin/apm/apm.c
114
apm_suspend(int fd)
usr.sbin/apm/apm.c
116
if (ioctl(fd, APMIO_SUSPEND, NULL) == -1)
usr.sbin/apm/apm.c
121
apm_standby(int fd)
usr.sbin/apm/apm.c
123
if (ioctl(fd, APMIO_STANDBY, NULL) == -1)
usr.sbin/apm/apm.c
128
apm_getinfo(int fd, apm_info_t aip)
usr.sbin/apm/apm.c
130
if (ioctl(fd, APMIO_GETINFO, aip) == -1)
usr.sbin/apm/apm.c
135
apm_enable(int fd, int enable)
usr.sbin/apm/apm.c
138
if (ioctl(fd, APMIO_ENABLE) == -1)
usr.sbin/apm/apm.c
141
if (ioctl(fd, APMIO_DISABLE) == -1)
usr.sbin/apm/apm.c
191
print_all_info(int fd, apm_info_t aip, int bioscall_available)
usr.sbin/apm/apm.c
223
if (ioctl(fd, APMIO_GETPWSTATUS, &aps) == -1)
usr.sbin/apm/apm.c
248
if (ioctl(fd, APMIO_BIOS, &args)) {
usr.sbin/apm/apm.c
297
if (ioctl(fd, APMIO_BIOS, &args) == 0) {
usr.sbin/apm/apm.c
332
apm_display(int fd, int newstate)
usr.sbin/apm/apm.c
334
if (ioctl(fd, APMIO_DISPLAY, &newstate) == -1)
usr.sbin/apm/apm.c
339
apm_haltcpu(int fd, int enable)
usr.sbin/apm/apm.c
342
if (ioctl(fd, APMIO_HALTCPU, NULL) == -1)
usr.sbin/apm/apm.c
345
if (ioctl(fd, APMIO_NOTHALTCPU, NULL) == -1)
usr.sbin/apm/apm.c
351
apm_set_timer(int fd, int delta)
usr.sbin/apm/apm.c
373
if (ioctl(fd, APMIO_BIOS, &args)) {
usr.sbin/apm/apm.c
381
int c, fd;
usr.sbin/apm/apm.c
449
fd = open(APMDEV, O_RDWR);
usr.sbin/apm/apm.c
451
} else if ((fd = open(APMDEV, O_RDWR)) >= 0)
usr.sbin/apm/apm.c
454
fd = open(APMDEV, O_RDONLY);
usr.sbin/apm/apm.c
455
if (fd == -1)
usr.sbin/apm/apm.c
458
apm_enable(fd, enable);
usr.sbin/apm/apm.c
460
apm_haltcpu(fd, haltcpu);
usr.sbin/apm/apm.c
462
apm_set_timer(fd, delta);
usr.sbin/apm/apm.c
464
apm_suspend(fd);
usr.sbin/apm/apm.c
466
apm_standby(fd);
usr.sbin/apm/apm.c
470
apm_getinfo(fd, &info);
usr.sbin/apm/apm.c
472
print_all_info(fd, &info, bioscall_available);
usr.sbin/apm/apm.c
484
apm_display(fd, display);
usr.sbin/apm/apm.c
486
close(fd);
usr.sbin/apmd/apmd.c
461
proc_signal(int fd)
usr.sbin/apmd/apmd.c
466
while (read(fd, &sig, sizeof sig) == sizeof sig) {
usr.sbin/apmd/apmd.c
488
proc_apmevent(int fd)
usr.sbin/apmd/apmd.c
492
while (ioctl(fd, APMIO_NEXTEVENT, &apmevent) == 0) {
usr.sbin/autofs/common.c
1182
int error, fd;
usr.sbin/autofs/common.c
1188
fd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/autofs/common.c
1189
if (fd < 0) {
usr.sbin/autofs/common.c
1194
error = dup2(fd, STDIN_FILENO);
usr.sbin/autofs/common.c
1198
error = close(fd);
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
217
int fd;
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
219
fd = open(path, O_RDONLY);
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
220
if (fd < 0)
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
222
if (fstat(fd, &sb) != 0)
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
230
data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
usr.sbin/bhyve/aarch64/bhyverun_machdep.c
233
(void)close(fd);
usr.sbin/bhyve/acpi.c
110
int fd;
usr.sbin/bhyve/acpi.c
312
bf->fd = mkstemps(bf->f_name, strlen(BHYVE_ASL_SUFFIX));
usr.sbin/bhyve/acpi.c
315
bf->fd = mkstemp(bf->f_name);
usr.sbin/bhyve/acpi.c
318
if (bf->fd > 0) {
usr.sbin/bhyve/acpi.c
319
bf->fp = fdopen(bf->fd, "w+");
usr.sbin/bhyve/acpi.c
322
close(bf->fd);
usr.sbin/bhyve/acpi.c
365
basl_load(struct vmctx *ctx, int fd)
usr.sbin/bhyve/acpi.c
370
if (fstat(fd, &sb) < 0)
usr.sbin/bhyve/acpi.c
377
if (read(fd, addr, sb.st_size) < 0)
usr.sbin/bhyve/acpi.c
426
err = basl_load(ctx, io[1].fd);
usr.sbin/bhyve/amd64/ps2kbd.c
441
int fd;
usr.sbin/bhyve/amd64/ps2kbd.c
459
fd = open(path, O_RDONLY);
usr.sbin/bhyve/amd64/ps2kbd.c
460
if (fd == -1)
usr.sbin/bhyve/amd64/ps2kbd.c
463
sz = read(fd, buf, sb.st_size);
usr.sbin/bhyve/amd64/ps2kbd.c
465
close(fd);
usr.sbin/bhyve/audio.c
102
aud->fd = open(aud->dev_name, aud->dir ? O_WRONLY : O_RDONLY, 0);
usr.sbin/bhyve/audio.c
103
if (aud->fd == -1) {
usr.sbin/bhyve/audio.c
112
if (caph_rights_limit(aud->fd, &rights) == -1)
usr.sbin/bhyve/audio.c
114
if (caph_ioctls_limit(aud->fd, cmds, nitems(cmds)) == -1)
usr.sbin/bhyve/audio.c
139
if ((audio_fd = aud->fd) < 0) {
usr.sbin/bhyve/audio.c
150
aud->fd, errno);
usr.sbin/bhyve/audio.c
234
audio_fd = aud->fd;
usr.sbin/bhyve/audio.c
268
audio_fd = aud->fd;
usr.sbin/bhyve/audio.c
54
int fd;
usr.sbin/bhyve/block_if.c
486
int extra, fd, i, sectsz;
usr.sbin/bhyve/block_if.c
499
fd = -1;
usr.sbin/bhyve/block_if.c
548
fd = open(path, (ro ? O_RDONLY : O_RDWR) | extra);
usr.sbin/bhyve/block_if.c
549
if (fd < 0 && !ro) {
usr.sbin/bhyve/block_if.c
551
fd = open(path, O_RDONLY | extra);
usr.sbin/bhyve/block_if.c
555
if (fd < 0) {
usr.sbin/bhyve/block_if.c
560
if (fstat(fd, &sbuf) < 0) {
usr.sbin/bhyve/block_if.c
571
if (caph_rights_limit(fd, &rights) == -1)
usr.sbin/bhyve/block_if.c
583
if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 ||
usr.sbin/bhyve/block_if.c
584
ioctl(fd, DIOCGSECTORSIZE, &sectsz)) {
usr.sbin/bhyve/block_if.c
590
if (ioctl(fd, DIOCGSTRIPESIZE, &psectsz) == 0 && psectsz > 0)
usr.sbin/bhyve/block_if.c
591
ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff);
usr.sbin/bhyve/block_if.c
594
if (nodelete == 0 && ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/bhyve/block_if.c
596
if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0)
usr.sbin/bhyve/block_if.c
601
candelete = fpathconf(fd, _PC_DEALLOC_PRESENT) == 1;
usr.sbin/bhyve/block_if.c
605
if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1)
usr.sbin/bhyve/block_if.c
645
bc->bc_fd = fd;
usr.sbin/bhyve/block_if.c
699
if (fd >= 0)
usr.sbin/bhyve/block_if.c
700
close(fd);
usr.sbin/bhyve/block_if.c
705
blockif_resized(int fd, enum ev_type type __unused, void *arg)
usr.sbin/bhyve/block_if.c
711
if (fstat(fd, &sb) != 0)
usr.sbin/bhyve/block_if.c
715
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) {
usr.sbin/bhyve/bootrom.c
202
int fd, varfd, i, rv;
usr.sbin/bhyve/bootrom.c
224
fd = open(romfile, O_RDONLY);
usr.sbin/bhyve/bootrom.c
225
if (fd < 0) {
usr.sbin/bhyve/bootrom.c
231
if (fstat(fd, &sbuf) < 0) {
usr.sbin/bhyve/bootrom.c
282
rlen = read(fd, ptr + i * PAGE_SIZE, PAGE_SIZE);
usr.sbin/bhyve/bootrom.c
313
if (fd >= 0)
usr.sbin/bhyve/bootrom.c
314
close(fd);
usr.sbin/bhyve/gdb.c
101
static void check_command(int fd);
usr.sbin/bhyve/gdb.c
1795
int fd;
usr.sbin/bhyve/gdb.c
1822
fd = openat(xml_dfd, path, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/bhyve/gdb.c
1823
if (fd < 0) {
usr.sbin/bhyve/gdb.c
1827
if (fstat(fd, &sb) < 0) {
usr.sbin/bhyve/gdb.c
1829
close(fd);
usr.sbin/bhyve/gdb.c
1832
xml = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
usr.sbin/bhyve/gdb.c
1835
close(fd);
usr.sbin/bhyve/gdb.c
1838
close(fd);
usr.sbin/bhyve/gdb.c
1971
check_command(int fd)
usr.sbin/bhyve/gdb.c
1996
send_pending_data(fd);
usr.sbin/bhyve/gdb.c
2011
send_pending_data(fd);
usr.sbin/bhyve/gdb.c
2038
send_pending_data(fd);
usr.sbin/bhyve/gdb.c
2047
send_pending_data(fd);
usr.sbin/bhyve/gdb.c
2059
gdb_readable(int fd, enum ev_type event __unused, void *arg __unused)
usr.sbin/bhyve/gdb.c
2065
if (ioctl(fd, FIONREAD, &n) == -1) {
usr.sbin/bhyve/gdb.c
2083
nread = read(fd, io_buffer_tail(&cur_comm), io_buffer_avail(&cur_comm));
usr.sbin/bhyve/gdb.c
2095
check_command(fd);
usr.sbin/bhyve/gdb.c
2101
gdb_writable(int fd, enum ev_type event __unused, void *arg __unused)
usr.sbin/bhyve/gdb.c
2104
send_pending_data(fd);
usr.sbin/bhyve/gdb.c
2108
new_connection(int fd, enum ev_type event __unused, void *arg)
usr.sbin/bhyve/gdb.c
2112
s = accept4(fd, NULL, NULL, SOCK_NONBLOCK);
usr.sbin/bhyve/gdb.c
548
send_pending_data(int fd)
usr.sbin/bhyve/gdb.c
556
nwritten = write(fd, io_buffer_head(&cur_resp), cur_resp.len);
usr.sbin/bhyve/mevent.c
105
mevent_pipe_read(int fd, enum ev_type type __unused, void *param __unused)
usr.sbin/bhyve/mevent.c
115
status = read(fd, buf, sizeof(buf));
usr.sbin/bhyve/mevent.h
45
struct mevent *mevent_add(int fd, enum ev_type type,
usr.sbin/bhyve/mevent.h
48
struct mevent *mevent_add_flags(int fd, enum ev_type type, int fflags,
usr.sbin/bhyve/mevent.h
51
struct mevent *mevent_add_disabled(int fd, enum ev_type type,
usr.sbin/bhyve/mevent_test.c
117
echoer_callback(int fd, enum ev_type type, void *param)
usr.sbin/bhyve/mevent_test.c
132
int fd = (int)(uintptr_t) param;
usr.sbin/bhyve/mevent_test.c
140
mev = mevent_add(fd, EVF_READ, echoer_callback, &sync);
usr.sbin/bhyve/mevent_test.c
147
len = read(fd, buf, sizeof(buf));
usr.sbin/bhyve/mevent_test.c
149
write(fd, buf, len);
usr.sbin/bhyve/mevent_test.c
171
int fd = (int)(uintptr_t) param;
usr.sbin/bhyve/mevent_test.c
174
while ((len = read(fd, buf, sizeof(buf))) > 0) {
usr.sbin/bhyve/mevent_test.c
183
acceptor_callback(int fd, enum ev_type type, void *param)
usr.sbin/bhyve/mevent_test.c
94
timer_callback(int fd, enum ev_type type, void *param)
usr.sbin/bhyve/net_backend_netgraph.c
111
flags = fcntl(be->fd, F_GETFL);
usr.sbin/bhyve/net_backend_netgraph.c
118
if (fcntl(be->fd, F_SETFL, flags | O_NONBLOCK) < 0) {
usr.sbin/bhyve/net_backend_netgraph.c
143
if (setsockopt(be->fd, SOL_SOCKET, SO_SNDBUF, &sbsz,
usr.sbin/bhyve/net_backend_netgraph.c
149
if (setsockopt(be->fd, SOL_SOCKET, SO_RCVBUF, &sbsz,
usr.sbin/bhyve/net_backend_netgraph.c
157
if (caph_rights_limit(be->fd, &rights) == -1)
usr.sbin/bhyve/net_backend_netgraph.c
164
p->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param);
usr.sbin/bhyve/net_backend_netgraph.c
71
be->fd = -1;
usr.sbin/bhyve/net_backend_netgraph.c
96
&ctrl_sock, &be->fd) < 0) {
usr.sbin/bhyve/net_backend_netmap.c
146
be->fd = priv->nmd->fd;
usr.sbin/bhyve/net_backend_netmap.c
148
priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param);
usr.sbin/bhyve/net_backend_netmap.c
168
be->fd = -1;
usr.sbin/bhyve/net_backend_netmap.c
246
ioctl(be->fd, NIOCTXSYNC, NULL);
usr.sbin/bhyve/net_backend_netmap.c
78
err = ioctl(be->fd, NIOCREGIF, &req);
usr.sbin/bhyve/net_backend_slirp.c
159
be->fd = s[0];
usr.sbin/bhyve/net_backend_slirp.c
160
priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param);
usr.sbin/bhyve/net_backends.c
107
be->fd = open(tbuf, O_RDWR);
usr.sbin/bhyve/net_backends.c
108
if (be->fd == -1) {
usr.sbin/bhyve/net_backends.c
117
if (ioctl(be->fd, FIONBIO, &opt) < 0) {
usr.sbin/bhyve/net_backends.c
123
ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) {
usr.sbin/bhyve/net_backends.c
130
if (caph_rights_limit(be->fd, &rights) == -1)
usr.sbin/bhyve/net_backends.c
137
priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param);
usr.sbin/bhyve/net_backends.c
156
return (writev(be->fd, iov, iovcnt));
usr.sbin/bhyve/net_backends.c
178
ret = read(be->fd, priv->bbuf, sizeof(priv->bbuf));
usr.sbin/bhyve/net_backends.c
209
ret = readv(be->fd, iov, iovcnt);
usr.sbin/bhyve/net_backends.c
376
nbe->fd = -1;
usr.sbin/bhyve/net_backends.c
81
if (be->fd != -1) {
usr.sbin/bhyve/net_backends.c
82
close(be->fd);
usr.sbin/bhyve/net_backends.c
83
be->fd = -1;
usr.sbin/bhyve/net_backends_priv.h
102
int fd;
usr.sbin/bhyve/pci_e82545.c
361
static void e82545_rx_callback(int fd, enum ev_type type, void *param);
usr.sbin/bhyve/pci_e82545.c
556
e82545_itr_callback(int fd __unused, enum ev_type type __unused, void *param)
usr.sbin/bhyve/pci_e82545.c
832
e82545_rx_callback(int fd __unused, enum ev_type type __unused, void *param)
usr.sbin/bhyve/pci_passthru.c
137
int fd;
usr.sbin/bhyve/pci_passthru.c
139
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/bhyve/pci_passthru.c
140
if (fd < 0) {
usr.sbin/bhyve/pci_passthru.c
144
return (fd);
usr.sbin/bhyve/pci_passthru.c
170
host_read_config(int fd, const struct pcisel *sel, long reg, int width)
usr.sbin/bhyve/pci_passthru.c
179
if (ioctl(fd, PCIOCREAD, &pi) < 0)
usr.sbin/bhyve/pci_passthru.c
195
int fd;
usr.sbin/bhyve/pci_passthru.c
197
fd = pcifd_open();
usr.sbin/bhyve/pci_passthru.c
198
if (fd < 0)
usr.sbin/bhyve/pci_passthru.c
200
ret = host_read_config(fd, sel, reg, width);
usr.sbin/bhyve/pci_passthru.c
201
(void)close(fd);
usr.sbin/bhyve/pci_passthru.c
206
host_write_config(int fd, const struct pcisel *sel, long reg, int width,
usr.sbin/bhyve/pci_passthru.c
217
(void)ioctl(fd, PCIOCWRITE, &pi); /* XXX */
usr.sbin/bhyve/pci_passthru.c
231
int fd;
usr.sbin/bhyve/pci_passthru.c
233
fd = pcifd_open();
usr.sbin/bhyve/pci_passthru.c
234
if (fd < 0)
usr.sbin/bhyve/pci_passthru.c
236
host_write_config(fd, sel, reg, width, data);
usr.sbin/bhyve/pci_passthru.c
237
(void)close(fd);
usr.sbin/bhyve/pci_passthru.c
839
const int fd = open(romfile, O_RDONLY);
usr.sbin/bhyve/pci_passthru.c
840
if (fd < 0) {
usr.sbin/bhyve/pci_passthru.c
846
if (fstat(fd, &sbuf) < 0) {
usr.sbin/bhyve/pci_passthru.c
848
close(fd);
usr.sbin/bhyve/pci_passthru.c
853
void *const rom_data = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, fd,
usr.sbin/bhyve/pci_passthru.c
858
close(fd);
usr.sbin/bhyve/pci_passthru.c
867
close(fd);
usr.sbin/bhyve/pci_passthru.c
877
close(fd);
usr.sbin/bhyve/pci_virtio_console.c
278
int s = -1, fd = -1, error = 0;
usr.sbin/bhyve/pci_virtio_console.c
315
fd = open(dirname(pathcopy), O_RDONLY | O_DIRECTORY);
usr.sbin/bhyve/pci_virtio_console.c
316
if (fd < 0) {
usr.sbin/bhyve/pci_virtio_console.c
328
if (bindat(fd, s, (struct sockaddr *)&sun, sun.sun_len) < 0) {
usr.sbin/bhyve/pci_virtio_console.c
373
if (fd != -1)
usr.sbin/bhyve/pci_virtio_console.c
374
close(fd);
usr.sbin/bhyve/pci_virtio_console.c
386
pci_vtcon_sock_accept(int fd __unused, enum ev_type t __unused, void *arg)
usr.sbin/bhyve/pci_virtio_console.c
408
pci_vtcon_sock_rx(int fd __unused, enum ev_type t __unused, void *arg)
usr.sbin/bhyve/pci_virtio_input.c
570
vtinput_read_event_from_host(int fd, struct input_event *event)
usr.sbin/bhyve/pci_virtio_input.c
572
const int len = read(fd, event, sizeof(struct input_event));
usr.sbin/bhyve/pci_virtio_input.c
587
vtinput_read_event(int fd __attribute((unused)),
usr.sbin/bhyve/pci_virtio_net.c
397
pci_vtnet_rx_callback(int fd __unused, enum ev_type type __unused, void *param)
usr.sbin/bhyve/pci_virtio_rnd.c
143
int fd;
usr.sbin/bhyve/pci_virtio_rnd.c
153
fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
usr.sbin/bhyve/pci_virtio_rnd.c
155
assert(fd >= 0);
usr.sbin/bhyve/pci_virtio_rnd.c
159
if (caph_rights_limit(fd, &rights) == -1)
usr.sbin/bhyve/pci_virtio_rnd.c
166
len = read(fd, &v, sizeof(v));
usr.sbin/bhyve/pci_virtio_rnd.c
169
close(fd);
usr.sbin/bhyve/pci_virtio_rnd.c
183
sc->vrsc_fd = fd;
usr.sbin/bhyve/pci_virtio_scsi.c
178
int fd;
usr.sbin/bhyve/pci_virtio_scsi.c
194
fd = sc->vss_targets[target].vst_fd;
usr.sbin/bhyve/pci_virtio_scsi.c
201
iolen = pci_vtscsi_request_handle(sc, fd, req);
usr.sbin/bhyve/pci_virtio_scsi.c
520
int fd;
usr.sbin/bhyve/pci_virtio_scsi.c
541
fd = sc->vss_targets[target].vst_fd;
usr.sbin/bhyve/pci_virtio_scsi.c
580
sc->vss_backend->vsb_tmf_hdl(sc, fd, tmf);
usr.sbin/bhyve/pci_virtio_scsi.c
627
int fd;
usr.sbin/bhyve/pci_virtio_scsi.c
640
fd = sc->vss_targets[target].vst_fd;
usr.sbin/bhyve/pci_virtio_scsi.c
645
sc->vss_backend->vsb_an_hdl(sc, fd, an);
usr.sbin/bhyve/pci_virtio_scsi.c
907
pci_vtscsi_request_handle(struct pci_vtscsi_softc *sc, int fd,
usr.sbin/bhyve/pci_virtio_scsi.c
910
return (sc->vss_backend->vsb_req_hdl(sc, fd, req));
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
197
vtscsi_ctl_tmf_hdl(struct pci_vtscsi_softc *sc, int fd,
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
262
err = ioctl(fd, CTL_IO, io);
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
273
vtscsi_ctl_an_hdl(struct pci_vtscsi_softc *sc __unused, int fd __unused,
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
280
vtscsi_ctl_req_hdl(struct pci_vtscsi_softc *sc, int fd,
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
344
err = ioctl(fd, CTL_IO, io);
usr.sbin/bhyve/qemu_fwcfg.c
547
int fd;
usr.sbin/bhyve/qemu_fwcfg.c
595
fd = open(opt_ptr, O_RDONLY);
usr.sbin/bhyve/qemu_fwcfg.c
596
if (fd < 0) {
usr.sbin/bhyve/qemu_fwcfg.c
602
if (fstat(fd, &sb) < 0) {
usr.sbin/bhyve/qemu_fwcfg.c
604
close(fd);
usr.sbin/bhyve/qemu_fwcfg.c
613
close(fd);
usr.sbin/bhyve/qemu_fwcfg.c
616
bytes_read = read(fd, fwcfg_file->data, sb.st_size);
usr.sbin/bhyve/qemu_fwcfg.c
620
close(fd);
usr.sbin/bhyve/qemu_fwcfg.c
625
close(fd);
usr.sbin/bhyve/riscv/bhyverun_machdep.c
215
int fd;
usr.sbin/bhyve/riscv/bhyverun_machdep.c
217
fd = open(path, O_RDONLY);
usr.sbin/bhyve/riscv/bhyverun_machdep.c
218
if (fd < 0)
usr.sbin/bhyve/riscv/bhyverun_machdep.c
220
if (fstat(fd, &sb) != 0)
usr.sbin/bhyve/riscv/bhyverun_machdep.c
228
data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
usr.sbin/bhyve/riscv/bhyverun_machdep.c
231
(void)close(fd);
usr.sbin/bhyve/rtc_pl031.c
166
rtc_pl031_callback(int fd __unused, enum ev_type type __unused, void *param)
usr.sbin/bhyve/rtc_pl031.c
81
static void rtc_pl031_callback(int fd, enum ev_type type, void *param);
usr.sbin/bhyve/slirp/libslirp.h
116
void (*register_poll_fd)(int fd, void *opaque);
usr.sbin/bhyve/slirp/libslirp.h
118
void (*unregister_poll_fd)(int fd, void *opaque);
usr.sbin/bhyve/slirp/libslirp.h
79
typedef int (*SlirpAddPollCb)(int fd, int events, void *opaque);
usr.sbin/bhyve/slirp/slirp-helper.c
119
slirp_cb_unregister_poll_fd(int fd __unused, void *opaque __unused)
usr.sbin/bhyve/slirp/slirp-helper.c
171
slirp_addpoll(struct slirp_priv *priv, int fd, int events)
usr.sbin/bhyve/slirp/slirp-helper.c
177
if (priv->pollfds[i].fd == -1)
usr.sbin/bhyve/slirp/slirp-helper.c
188
pollfds[i].fd = -1;
usr.sbin/bhyve/slirp/slirp-helper.c
194
pollfd->fd = fd;
usr.sbin/bhyve/slirp/slirp-helper.c
203
slirp_addpoll_cb(int fd, int events, void *param)
usr.sbin/bhyve/slirp/slirp-helper.c
208
return (slirp_addpoll(priv, fd, events));
usr.sbin/bhyve/slirp/slirp-helper.c
222
assert(pollfd->fd != -1);
usr.sbin/bhyve/slirp/slirp-helper.c
246
priv->pollfds[i].fd = -1;
usr.sbin/bhyve/slirp/slirp-helper.c
463
int ch, fd, sd;
usr.sbin/bhyve/slirp/slirp-helper.c
489
fd = open("/dev/null", O_RDWR);
usr.sbin/bhyve/slirp/slirp-helper.c
490
if (fd == -1)
usr.sbin/bhyve/slirp/slirp-helper.c
492
if (dup2(fd, STDIN_FILENO) == -1)
usr.sbin/bhyve/slirp/slirp-helper.c
494
if (dup2(fd, STDOUT_FILENO) == -1)
usr.sbin/bhyve/slirp/slirp-helper.c
496
if (dup2(fd, STDERR_FILENO) == -1)
usr.sbin/bhyve/slirp/slirp-helper.c
92
slirp_cb_register_poll_fd(int fd, void *param __unused)
usr.sbin/bhyve/slirp/slirp-helper.c
96
(void)setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int));
usr.sbin/bhyve/snapshot.c
1358
int fd;
usr.sbin/bhyve/snapshot.c
1365
while ((fd = accept(thread_info->socket_fd, NULL, NULL)) != -1) {
usr.sbin/bhyve/snapshot.c
1366
nvl = nvlist_recv(fd, 0);
usr.sbin/bhyve/snapshot.c
1372
close(fd);
usr.sbin/bhyve/sockstream.c
37
stream_read(int fd, void *buf, ssize_t nbytes)
usr.sbin/bhyve/sockstream.c
46
n = read(fd, p + len, nbytes - len);
usr.sbin/bhyve/sockstream.c
61
stream_write(int fd, const void *buf, ssize_t nbytes)
usr.sbin/bhyve/sockstream.c
70
n = write(fd, p + len, nbytes - len);
usr.sbin/bhyve/sockstream.h
32
ssize_t stream_read(int fd, void *buf, ssize_t nbytes);
usr.sbin/bhyve/sockstream.h
33
ssize_t stream_write(int fd, const void *buf, ssize_t nbytes);
usr.sbin/bhyve/tpm_emul_passthru.c
22
int fd;
usr.sbin/bhyve/tpm_emul_passthru.c
44
tpm->fd = open(path, O_RDWR);
usr.sbin/bhyve/tpm_emul_passthru.c
45
if (tpm->fd < 0) {
usr.sbin/bhyve/tpm_emul_passthru.c
69
len = write(tpm->fd, cmd, cmd_size);
usr.sbin/bhyve/tpm_emul_passthru.c
76
len = read(tpm->fd, rsp, rsp_size);
usr.sbin/bhyve/tpm_emul_passthru.c
95
if (tpm->fd >= 0)
usr.sbin/bhyve/tpm_emul_passthru.c
96
close(tpm->fd);
usr.sbin/bhyve/tpm_emul_swtpm.c
120
if (tpm->fd >= 0)
usr.sbin/bhyve/tpm_emul_swtpm.c
121
close(tpm->fd);
usr.sbin/bhyve/tpm_emul_swtpm.c
26
int fd;
usr.sbin/bhyve/tpm_emul_swtpm.c
54
tpm->fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
usr.sbin/bhyve/tpm_emul_swtpm.c
55
if (tpm->fd < 0) {
usr.sbin/bhyve/tpm_emul_swtpm.c
64
if (connect(tpm->fd, (struct sockaddr *)&tpm_addr, sizeof (tpm_addr)) ==
usr.sbin/bhyve/tpm_emul_swtpm.c
90
len = send(tpm->fd, cmd, cmd_size, MSG_NOSIGNAL|MSG_DONTWAIT);
usr.sbin/bhyve/tpm_emul_swtpm.c
99
len = recv(tpm->fd, rsp, rsp_size, 0);
usr.sbin/bhyve/uart_backend.c
294
uart_tcp_listener(int fd, enum ev_type type __unused, void *arg)
usr.sbin/bhyve/uart_backend.c
302
conn_fd = accept(fd, NULL, NULL);
usr.sbin/bhyve/uart_backend.c
386
int fd;
usr.sbin/bhyve/uart_backend.c
388
fd = open(path, O_RDWR | O_NONBLOCK);
usr.sbin/bhyve/uart_backend.c
389
if (fd < 0)
usr.sbin/bhyve/uart_backend.c
392
if (!isatty(fd)) {
usr.sbin/bhyve/uart_backend.c
393
close(fd);
usr.sbin/bhyve/uart_backend.c
397
sc->tty.rfd = sc->tty.wfd = fd;
usr.sbin/bhyve/uart_backend.c
402
if (caph_rights_limit(fd, &rights) == -1)
usr.sbin/bhyve/uart_backend.c
404
if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1)
usr.sbin/bhyve/uart_emul.c
192
uart_drain(int fd __unused, enum ev_type ev, void *arg)
usr.sbin/bhyve/uart_pl011.c
170
uart_drain(int fd __unused, enum ev_type ev, void *arg)
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
401
int error, fd, map_size;
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
406
fd = open("/dev/mem", O_RDONLY, 0);
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
407
if (fd < 0) {
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
417
bitmap = mmap(NULL, map_size, PROT_READ, MAP_SHARED, fd, addr);
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
432
if (fd >= 0)
usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
433
close(fd);
usr.sbin/bhyvectl/bhyvectl.c
305
int fd;
usr.sbin/bhyvectl/bhyvectl.c
311
fd = open(path, O_DIRECTORY);
usr.sbin/bhyvectl/bhyvectl.c
314
return (fd);
usr.sbin/bhyvectl/bhyvectl.c
321
int fd;
usr.sbin/bhyvectl/bhyvectl.c
323
if ((fd = open_directory(file)) < 0)
usr.sbin/bhyvectl/bhyvectl.c
330
nvlist_move_descriptor(nvl, "fddir", fd);
usr.sbin/bhyveload/bhyveload.c
162
int fd;
usr.sbin/bhyveload/bhyveload.c
172
int fd;
usr.sbin/bhyveload/bhyveload.c
187
fd = openat(hostbase_fd, filename, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/bhyveload/bhyveload.c
188
if (fd < 0)
usr.sbin/bhyveload/bhyveload.c
191
if (fstat(fd, &sb) < 0) {
usr.sbin/bhyveload/bhyveload.c
194
close(fd);
usr.sbin/bhyveload/bhyveload.c
197
close(fd);
usr.sbin/bhyveload/bhyveload.c
203
close(fd);
usr.sbin/bhyveload/bhyveload.c
212
cf->cf_u.dir = fdopendir(fd);
usr.sbin/bhyveload/bhyveload.c
214
close(fd);
usr.sbin/bhyveload/bhyveload.c
220
cf->cf_u.fd = fd;
usr.sbin/bhyveload/bhyveload.c
234
close(cf->cf_u.fd);
usr.sbin/bhyveload/bhyveload.c
256
sz = read(cf->cf_u.fd, buf, size);
usr.sbin/bhyveload/bhyveload.c
297
if (lseek(cf->cf_u.fd, offset, whence) < 0)
usr.sbin/bhyveload/bhyveload.c
688
int fd;
usr.sbin/bhyveload/bhyveload.c
703
fd = open(path, O_RDWR | O_NONBLOCK);
usr.sbin/bhyveload/bhyveload.c
704
if (fd < 0)
usr.sbin/bhyveload/bhyveload.c
707
consin_fd = consout_fd = fd;
usr.sbin/bhyveload/bhyveload.c
717
int fd;
usr.sbin/bhyveload/bhyveload.c
722
fd = open(path, O_RDWR);
usr.sbin/bhyveload/bhyveload.c
723
if (fd < 0)
usr.sbin/bhyveload/bhyveload.c
724
fd = open(path, O_RDONLY);
usr.sbin/bhyveload/bhyveload.c
725
if (fd < 0)
usr.sbin/bhyveload/bhyveload.c
728
disk_fd[ndisks] = fd;
usr.sbin/bhyveload/bhyveload.c
765
int fd;
usr.sbin/bhyveload/bhyveload.c
775
fd = explicit_loader_fd;
usr.sbin/bhyveload/bhyveload.c
777
fd = openat(bootfd, loader, O_RDONLY | O_RESOLVE_BENEATH);
usr.sbin/bhyveload/bhyveload.c
778
if (fd == -1)
usr.sbin/bhyveload/bhyveload.c
781
loader_hdl = fdlopen(fd, RTLD_LOCAL);
usr.sbin/bhyveload/bhyveload.c
784
if (fd != explicit_loader_fd)
usr.sbin/bhyveload/bhyveload.c
785
close(fd);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
46
int fd;
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
51
fd = open(fwname, O_RDONLY);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
52
if (fd < 0) {
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
57
if (fstat(fd, &sb) != 0) {
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
59
close(fd);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
66
close(fd);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
71
r = read(fd, buf, sb.st_size);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
75
close(fd);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
85
close(fd);
usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
98
close(fd);
usr.sbin/bluetooth/bcmfw/bcmfw.c
122
int fd = -1, error = -1;
usr.sbin/bluetooth/bcmfw/bcmfw.c
126
if ((fd = open(path, O_WRONLY)) < 0) {
usr.sbin/bluetooth/bcmfw/bcmfw.c
132
if (ioctl(fd, USB_GET_DEVICE_DESC, &desc) < 0) {
usr.sbin/bluetooth/bcmfw/bcmfw.c
134
fd, USB_GET_DEVICE_DESC, &desc,
usr.sbin/bluetooth/bcmfw/bcmfw.c
148
if (fd != -1)
usr.sbin/bluetooth/bcmfw/bcmfw.c
149
close(fd);
usr.sbin/bluetooth/bcmfw/bcmfw.c
162
int intr = -1, bulk = -1, fd = -1, error = -1, len;
usr.sbin/bluetooth/bcmfw/bcmfw.c
184
if ((fd = open(md, O_RDONLY)) < 0) {
usr.sbin/bluetooth/bcmfw/bcmfw.c
191
len = read(fd, buf, sizeof(buf));
usr.sbin/bluetooth/bcmfw/bcmfw.c
209
close(fd);
usr.sbin/bluetooth/bcmfw/bcmfw.c
210
fd = -1;
usr.sbin/bluetooth/bcmfw/bcmfw.c
239
if ((fd = open(fw, O_RDONLY)) < 0) {
usr.sbin/bluetooth/bcmfw/bcmfw.c
246
len = read(fd, buf, sizeof(buf));
usr.sbin/bluetooth/bcmfw/bcmfw.c
264
close(fd);
usr.sbin/bluetooth/bcmfw/bcmfw.c
265
fd = -1;
usr.sbin/bluetooth/bcmfw/bcmfw.c
282
if (fd != -1)
usr.sbin/bluetooth/bcmfw/bcmfw.c
283
close(fd);
usr.sbin/bluetooth/bthidd/bthidd.h
89
int32_t client_connect (bthid_server_p srv, int fd);
usr.sbin/bluetooth/bthidd/bthidd.h
93
bthid_session_p session_by_fd (bthid_server_p srv, int32_t fd);
usr.sbin/bluetooth/bthidd/btuinput.c
305
int32_t fd;
usr.sbin/bluetooth/bthidd/btuinput.c
324
fd = open("/dev/uinput", O_RDWR | O_NONBLOCK);
usr.sbin/bluetooth/bthidd/btuinput.c
326
if (ioctl(fd, UI_SET_PHYS, phys) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
327
ioctl(fd, UI_SET_BSDUNIQ, uniq) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
328
ioctl(fd, UI_DEV_SETUP, &uisetup) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
331
return (fd);
usr.sbin/bluetooth/bthidd/btuinput.c
342
int32_t fd;
usr.sbin/bluetooth/bthidd/btuinput.c
346
if ((fd = uinput_open_common(p, local, "Bluetooth Mouse")) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
350
if (ioctl(fd, UI_SET_EVBIT, EV_SYN) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
351
ioctl(fd, UI_SET_EVBIT, EV_KEY) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
352
ioctl(fd, UI_SET_EVBIT, EV_REL) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
353
ioctl(fd, UI_SET_RELBIT, REL_X) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
354
ioctl(fd, UI_SET_RELBIT, REL_Y) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
355
(p->has_wheel && ioctl(fd, UI_SET_RELBIT, REL_WHEEL) < 0) ||
usr.sbin/bluetooth/bthidd/btuinput.c
356
(p->has_hwheel && ioctl(fd, UI_SET_RELBIT, REL_HWHEEL) < 0) ||
usr.sbin/bluetooth/bthidd/btuinput.c
357
ioctl(fd, UI_SET_PROPBIT, INPUT_PROP_POINTER) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
362
if (ioctl(fd, UI_SET_KEYBIT, mbuttons[i]) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
365
if (ioctl(fd, UI_DEV_CREATE) >= 0)
usr.sbin/bluetooth/bthidd/btuinput.c
366
return (fd); /* SUCCESS */
usr.sbin/bluetooth/bthidd/btuinput.c
369
if (fd >= 0)
usr.sbin/bluetooth/bthidd/btuinput.c
370
close(fd);
usr.sbin/bluetooth/bthidd/btuinput.c
381
int32_t fd;
usr.sbin/bluetooth/bthidd/btuinput.c
385
if ((fd = uinput_open_common(p, local, "Bluetooth Keyboard")) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
389
if (ioctl(fd, UI_SET_EVBIT, EV_KEY) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
390
ioctl(fd, UI_SET_EVBIT, EV_LED) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
391
ioctl(fd, UI_SET_EVBIT, EV_SYN) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
392
ioctl(fd, UI_SET_EVBIT, EV_REP) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
393
ioctl(fd, UI_SET_LEDBIT, LED_CAPSL) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
394
ioctl(fd, UI_SET_LEDBIT, LED_NUML) < 0 ||
usr.sbin/bluetooth/bthidd/btuinput.c
395
ioctl(fd, UI_SET_LEDBIT, LED_SCROLLL))
usr.sbin/bluetooth/bthidd/btuinput.c
401
ioctl(fd, UI_SET_KEYBIT, keymap[i]) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
408
ioctl(fd, UI_SET_KEYBIT, consmap[i]) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
413
if (ioctl(fd, UI_DEV_CREATE) >= 0)
usr.sbin/bluetooth/bthidd/btuinput.c
414
return (fd); /* SUCCESS */
usr.sbin/bluetooth/bthidd/btuinput.c
417
if (fd >= 0)
usr.sbin/bluetooth/bthidd/btuinput.c
418
close(fd);
usr.sbin/bluetooth/bthidd/btuinput.c
460
uinput_write_event(int32_t fd, uint16_t type, uint16_t code, int32_t value)
usr.sbin/bluetooth/bthidd/btuinput.c
464
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/btuinput.c
470
return (write(fd, &ie, sizeof(ie)));
usr.sbin/bluetooth/bthidd/btuinput.c
474
uinput_rep_mouse(int32_t fd, int32_t x, int32_t y, int32_t z, int32_t t,
usr.sbin/bluetooth/bthidd/btuinput.c
480
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/btuinput.c
486
if ((x != 0 && uinput_write_event(fd, EV_REL, REL_X, x) < 0) ||
usr.sbin/bluetooth/bthidd/btuinput.c
487
(y != 0 && uinput_write_event(fd, EV_REL, REL_Y, y) < 0) ||
usr.sbin/bluetooth/bthidd/btuinput.c
488
(z != 0 && uinput_write_event(fd, EV_REL, REL_WHEEL, -z) < 0) ||
usr.sbin/bluetooth/bthidd/btuinput.c
489
(t != 0 && uinput_write_event(fd, EV_REL, REL_HWHEEL, t) < 0))
usr.sbin/bluetooth/bthidd/btuinput.c
496
if (uinput_write_event(fd, EV_KEY, mbuttons[i],
usr.sbin/bluetooth/bthidd/btuinput.c
501
if (uinput_write_event(fd, EV_SYN, SYN_REPORT, 0) < 0)
usr.sbin/bluetooth/bthidd/btuinput.c
511
uinput_rep_key(int32_t fd, int32_t key, int32_t make)
usr.sbin/bluetooth/bthidd/btuinput.c
515
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/btuinput.c
523
if (uinput_write_event(fd, EV_KEY, keymap[key], make) > 0 &&
usr.sbin/bluetooth/bthidd/btuinput.c
524
uinput_write_event(fd, EV_SYN, SYN_REPORT, 0) > 0)
usr.sbin/bluetooth/bthidd/btuinput.c
534
uinput_rep_cons(int32_t fd, int32_t key, int32_t make)
usr.sbin/bluetooth/bthidd/btuinput.c
538
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/btuinput.c
546
if (uinput_write_event(fd, EV_KEY, consmap[key], make) > 0 &&
usr.sbin/bluetooth/bthidd/btuinput.c
547
uinput_write_event(fd, EV_SYN, SYN_REPORT, 0) > 0)
usr.sbin/bluetooth/bthidd/btuinput.c
557
uinput_rep_leds(int32_t fd, int state, int mask)
usr.sbin/bluetooth/bthidd/btuinput.c
562
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/btuinput.c
570
uinput_write_event(fd, EV_LED, led_codes[i],
usr.sbin/bluetooth/bthidd/btuinput.h
34
int32_t uinput_rep_mouse(int32_t fd, int32_t x, int32_t y, int32_t z,
usr.sbin/bluetooth/bthidd/btuinput.h
36
int32_t uinput_rep_key(int32_t fd, int32_t key, int32_t make);
usr.sbin/bluetooth/bthidd/btuinput.h
37
int32_t uinput_rep_cons(int32_t fd, int32_t key, int32_t make);
usr.sbin/bluetooth/bthidd/btuinput.h
38
int32_t uinput_rep_leds(int32_t fd, int state, int mask);
usr.sbin/bluetooth/bthidd/client.c
120
client_connect(bthid_server_p srv, int32_t fd)
usr.sbin/bluetooth/bthidd/client.c
128
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/client.c
130
s = session_by_fd(srv, fd);
usr.sbin/bluetooth/bthidd/client.c
138
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
usr.sbin/bluetooth/bthidd/client.c
158
assert(s->ctrl == fd);
usr.sbin/bluetooth/bthidd/client.c
185
assert(s->intr == fd);
usr.sbin/bluetooth/bthidd/client.c
203
FD_CLR(fd, &srv->wfdset);
usr.sbin/bluetooth/bthidd/client.c
204
FD_SET(fd, &srv->rfdset);
usr.sbin/bluetooth/bthidd/kbd.c
419
uinput_kbd_write(bitstr_t *m, int32_t fb, int32_t make, int32_t fd)
usr.sbin/bluetooth/bthidd/kbd.c
423
if (fd >= 0) {
usr.sbin/bluetooth/bthidd/kbd.c
426
uinput_rep_key(fd, i, make);
usr.sbin/bluetooth/bthidd/kbd.c
436
kbd_write(bitstr_t *m, int32_t fb, int32_t make, int32_t fd)
usr.sbin/bluetooth/bthidd/kbd.c
448
write(fd, buf, (b - buf) * sizeof(buf[0]));
usr.sbin/bluetooth/bthidd/kbd.c
460
write(fd, buf, (b - buf) * sizeof(buf[0]));
usr.sbin/bluetooth/bthidd/kbd.c
62
static void kbd_write(bitstr_t *m, int32_t fb, int32_t make, int32_t fd);
usr.sbin/bluetooth/bthidd/kbd.c
64
static void uinput_kbd_write(bitstr_t *m, int32_t fb, int32_t make, int32_t fd);
usr.sbin/bluetooth/bthidd/server.c
181
int32_t n, fd;
usr.sbin/bluetooth/bthidd/server.c
204
for (fd = 0; fd < srv->maxfd + 1 && n > 0; fd ++) {
usr.sbin/bluetooth/bthidd/server.c
205
if (FD_ISSET(fd, &rfdset)) {
usr.sbin/bluetooth/bthidd/server.c
208
if (fd == srv->ctrl || fd == srv->intr)
usr.sbin/bluetooth/bthidd/server.c
209
server_accept(srv, fd);
usr.sbin/bluetooth/bthidd/server.c
211
server_process(srv, fd);
usr.sbin/bluetooth/bthidd/server.c
212
} else if (FD_ISSET(fd, &wfdset)) {
usr.sbin/bluetooth/bthidd/server.c
215
client_connect(srv, fd);
usr.sbin/bluetooth/bthidd/server.c
227
server_accept(bthid_server_p srv, int32_t fd)
usr.sbin/bluetooth/bthidd/server.c
236
if ((new_fd = accept(fd, (struct sockaddr *) &l2addr, &len)) < 0) {
usr.sbin/bluetooth/bthidd/server.c
238
(fd == srv->ctrl)? "control" : "interrupt",
usr.sbin/bluetooth/bthidd/server.c
247
(fd == srv->ctrl)? "control" : "interrupt",
usr.sbin/bluetooth/bthidd/server.c
268
if (fd == srv->ctrl) {
usr.sbin/bluetooth/bthidd/server.c
283
(fd == srv->ctrl)? "control" : "interrupt",
usr.sbin/bluetooth/bthidd/server.c
300
server_process(bthid_server_p srv, int32_t fd)
usr.sbin/bluetooth/bthidd/server.c
302
bthid_session_p s = session_by_fd(srv, fd);
usr.sbin/bluetooth/bthidd/server.c
315
if (fd == s->ctrl) {
usr.sbin/bluetooth/bthidd/server.c
318
} else if (fd == s->intr) {
usr.sbin/bluetooth/bthidd/server.c
321
} else if (fd == s->ukbd) {
usr.sbin/bluetooth/bthidd/server.c
325
assert(fd == s->vkbd);
usr.sbin/bluetooth/bthidd/server.c
332
len = read(fd, &data, to_read);
usr.sbin/bluetooth/bthidd/server.c
338
(fd == s->ctrl)? "control" : "interrupt",
usr.sbin/bluetooth/bthidd/server.c
347
(fd == s->ctrl)? "control" : "interrupt");
usr.sbin/bluetooth/bthidd/server.c
57
static int32_t server_accept (bthid_server_p srv, int32_t fd);
usr.sbin/bluetooth/bthidd/server.c
58
static int32_t server_process(bthid_server_p srv, int32_t fd);
usr.sbin/bluetooth/bthidd/session.c
178
session_by_fd(bthid_server_p srv, int32_t fd)
usr.sbin/bluetooth/bthidd/session.c
183
assert(fd >= 0);
usr.sbin/bluetooth/bthidd/session.c
186
if (s->ctrl == fd || s->intr == fd ||
usr.sbin/bluetooth/bthidd/session.c
187
s->vkbd == fd || s->ukbd == fd)
usr.sbin/bluetooth/btpand/bnep.c
716
nw = writev(chan->fd, iov, __arraycount(iov));
usr.sbin/bluetooth/btpand/btpand.c
245
int fd;
usr.sbin/bluetooth/btpand/btpand.c
253
fd = open(_PATH_DEVNULL, O_RDWR, 0);
usr.sbin/bluetooth/btpand/btpand.c
254
if (fd == -1) {
usr.sbin/bluetooth/btpand/btpand.c
257
(void)dup2(fd, STDIN_FILENO);
usr.sbin/bluetooth/btpand/btpand.c
258
(void)dup2(fd, STDOUT_FILENO);
usr.sbin/bluetooth/btpand/btpand.c
259
(void)dup2(fd, STDERR_FILENO);
usr.sbin/bluetooth/btpand/btpand.c
260
close(fd);
usr.sbin/bluetooth/btpand/btpand.h
100
int fd;
usr.sbin/bluetooth/btpand/channel.c
101
event_set(&chan->rd_ev, fd, EV_READ | EV_PERSIST, channel_read, chan);
usr.sbin/bluetooth/btpand/channel.c
107
event_set(&chan->wr_ev, fd, EV_WRITE, channel_start, chan);
usr.sbin/bluetooth/btpand/channel.c
110
chan->fd = fd;
usr.sbin/bluetooth/btpand/channel.c
112
log_debug("(fd#%d)", chan->fd);
usr.sbin/bluetooth/btpand/channel.c
124
log_debug("(fd#%d)", chan->fd);
usr.sbin/bluetooth/btpand/channel.c
129
close(chan->fd);
usr.sbin/bluetooth/btpand/channel.c
172
channel_start(int fd, short ev, void *arg)
usr.sbin/bluetooth/btpand/channel.c
201
channel_read(int fd, short ev, void *arg)
usr.sbin/bluetooth/btpand/channel.c
213
nr = read(fd, pkt->buf, chan->mru);
usr.sbin/bluetooth/btpand/channel.c
221
log_debug("(fd#%d) EOF", fd);
usr.sbin/bluetooth/btpand/channel.c
289
channel_start(chan->fd, EV_WRITE, chan);
usr.sbin/bluetooth/btpand/channel.c
313
channel_watchdog(int fd, short ev, void *arg)
usr.sbin/bluetooth/btpand/channel.c
80
channel_open(channel_t *chan, int fd)
usr.sbin/bluetooth/btpand/channel.c
96
if (ioctl(fd, FIONBIO, &n) == -1) {
usr.sbin/bluetooth/btpand/client.c
106
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) {
usr.sbin/bluetooth/btpand/client.c
112
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1)
usr.sbin/bluetooth/btpand/client.c
117
if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) {
usr.sbin/bluetooth/btpand/client.c
127
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, &len) == -1) {
usr.sbin/bluetooth/btpand/client.c
129
close(fd);
usr.sbin/bluetooth/btpand/client.c
134
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) == -1) {
usr.sbin/bluetooth/btpand/client.c
136
close(fd);
usr.sbin/bluetooth/btpand/client.c
141
if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, &n, sizeof(n)) == -1) {
usr.sbin/bluetooth/btpand/client.c
143
close(fd);
usr.sbin/bluetooth/btpand/client.c
159
if (!channel_open(chan, fd))
usr.sbin/bluetooth/btpand/client.c
52
int fd, n;
usr.sbin/bluetooth/btpand/client.c
61
fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BLUETOOTH_PROTO_L2CAP);
usr.sbin/bluetooth/btpand/client.c
62
if (fd == -1) {
usr.sbin/bluetooth/btpand/client.c
74
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/bluetooth/btpand/client.c
80
if (setsockopt(fd, SOL_L2CAP, SO_L2CAP_IMTU, &mru, sizeof(mru)) == -1) {
usr.sbin/bluetooth/btpand/client.c
90
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
usr.sbin/bluetooth/btpand/client.c
96
if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_IMTU, &mru, &len) == -1) {
usr.sbin/bluetooth/btpand/event.c
126
if (ev->fd >= 0) {
usr.sbin/bluetooth/btpand/event.c
128
FD_SET(ev->fd, &r);
usr.sbin/bluetooth/btpand/event.c
129
nfd = (nfd > ev->fd) ? nfd : ev->fd;
usr.sbin/bluetooth/btpand/event.c
133
FD_SET(ev->fd, &w);
usr.sbin/bluetooth/btpand/event.c
134
nfd = (nfd > ev->fd) ? nfd : ev->fd;
usr.sbin/bluetooth/btpand/event.c
160
if (nfd > 0 && ev->fd >= 0) {
usr.sbin/bluetooth/btpand/event.c
161
if (FD_ISSET(ev->fd, &r) || FD_ISSET(ev->fd, &w)) {
usr.sbin/bluetooth/btpand/event.c
172
"ev=%p", __func__, ev->cb, ev->fd,
usr.sbin/bluetooth/btpand/event.c
175
(ev->cb)(ev->fd,
usr.sbin/bluetooth/btpand/event.c
195
__func__, ev->cb, ev->fd, ev->cbarg, ev);
usr.sbin/bluetooth/btpand/event.c
197
(ev->cb)(ev->fd,
usr.sbin/bluetooth/btpand/event.c
212
__event_set(struct event *ev, int fd, short flags,
usr.sbin/bluetooth/btpand/event.c
215
ev->fd = fd;
usr.sbin/bluetooth/btpand/event.h
102
__event_set(ev, fd, flags, cb, cbarg);
usr.sbin/bluetooth/btpand/event.h
109
"timeout=%p", file, line, ev, ev->fd, ev->flags, ev->cb,
usr.sbin/bluetooth/btpand/event.h
122
file, line, ev, ev->fd, ev->flags, ev->cb, ev->cbarg);
usr.sbin/bluetooth/btpand/event.h
135
#define event_set(ev, fd, flags, cb, cbarg) \
usr.sbin/bluetooth/btpand/event.h
136
__event_set(ev, fd, flags, cb, cbarg)
usr.sbin/bluetooth/btpand/event.h
51
int fd;
usr.sbin/bluetooth/btpand/event.h
80
#define event_set(ev, fd, flags, cb, cbarg) \
usr.sbin/bluetooth/btpand/event.h
81
_event_set(__FILE__, __LINE__, ev, fd, flags, cb, cbarg)
usr.sbin/bluetooth/btpand/event.h
93
_event_set(char const *file, int line, struct event *ev, int fd, short flags,
usr.sbin/bluetooth/btpand/event.h
97
file, line, ev, fd, flags, cb, cbarg);
usr.sbin/bluetooth/btpand/server.c
158
int fd, n;
usr.sbin/bluetooth/btpand/server.c
162
fd = accept(s, (struct sockaddr *)&ra, &len);
usr.sbin/bluetooth/btpand/server.c
163
if (fd == -1)
usr.sbin/bluetooth/btpand/server.c
167
if (ioctl(fd, FIONBIO, &n) == -1) {
usr.sbin/bluetooth/btpand/server.c
169
close(fd);
usr.sbin/bluetooth/btpand/server.c
174
if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_IMTU, &mru, &len) == -1) {
usr.sbin/bluetooth/btpand/server.c
176
close(fd);
usr.sbin/bluetooth/btpand/server.c
181
close(fd);
usr.sbin/bluetooth/btpand/server.c
186
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) {
usr.sbin/bluetooth/btpand/server.c
188
close(fd);
usr.sbin/bluetooth/btpand/server.c
193
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1)
usr.sbin/bluetooth/btpand/server.c
198
if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_OMTU, &mtu, &len) == -1) {
usr.sbin/bluetooth/btpand/server.c
200
close(fd);
usr.sbin/bluetooth/btpand/server.c
205
close(fd);
usr.sbin/bluetooth/btpand/server.c
210
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, &len) == -1) {
usr.sbin/bluetooth/btpand/server.c
212
close(fd);
usr.sbin/bluetooth/btpand/server.c
218
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) == -1) {
usr.sbin/bluetooth/btpand/server.c
220
close(fd);
usr.sbin/bluetooth/btpand/server.c
226
if (setsockopt(fd, SOL_SOCKET, SO_SNDLOWAT, &n, sizeof(n)) == -1) {
usr.sbin/bluetooth/btpand/server.c
228
close(fd);
usr.sbin/bluetooth/btpand/server.c
233
if (getsockname(fd, (struct sockaddr *)&la, &len) == -1) {
usr.sbin/bluetooth/btpand/server.c
235
close(fd);
usr.sbin/bluetooth/btpand/server.c
243
close(fd);
usr.sbin/bluetooth/btpand/server.c
255
if (!channel_open(chan, fd)) {
usr.sbin/bluetooth/btpand/server.c
258
close(fd);
usr.sbin/bluetooth/btpand/tap.c
117
if (!channel_open(chan, fd))
usr.sbin/bluetooth/btpand/tap.c
148
nw = writev(chan->fd, iov, __arraycount(iov));
usr.sbin/bluetooth/btpand/tap.c
58
int fd, s;
usr.sbin/bluetooth/btpand/tap.c
61
fd = open(interface_name, O_RDWR);
usr.sbin/bluetooth/btpand/tap.c
62
if (fd == -1) {
usr.sbin/bluetooth/btpand/tap.c
68
if (ioctl(fd, TAPGIFNAME, &ifr) == -1) {
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
49
int fd;
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
54
fd = open(fwname, O_RDONLY);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
55
if (fd < 0) {
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
60
if (fstat(fd, &sb) != 0) {
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
62
close(fd);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
69
close(fd);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
74
r = read(fd, buf, sb.st_size);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
78
close(fd);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
87
close(fd);
usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
99
close(fd);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
168
int fd;
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
172
fd = open(fwname, O_RDONLY);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
173
if (fd < 0) {
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
178
if (fstat(fd, &sb) != 0) {
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
180
close(fd);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
187
close(fd);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
191
mmap_addr = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
195
close(fd);
usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c
210
close(fd);
usr.sbin/bluetooth/sdpd/provider.c
112
provider->fd = fd;
usr.sbin/bluetooth/sdpd/provider.c
51
provider_register_sd(int32_t fd)
usr.sbin/bluetooth/sdpd/provider.c
71
sd->fd = fd;
usr.sbin/bluetooth/sdpd/provider.c
76
sd->fd = fd;
usr.sbin/bluetooth/sdpd/provider.c
89
provider_register(profile_p const profile, bdaddr_p const bdaddr, int32_t fd,
usr.sbin/bluetooth/sdpd/provider.h
48
int32_t fd; /* session descriptor */
usr.sbin/bluetooth/sdpd/provider.h
60
int32_t provider_register_sd (int32_t fd);
usr.sbin/bluetooth/sdpd/provider.h
63
int32_t fd,
usr.sbin/bluetooth/sdpd/sar.c
145
server_prepare_service_attribute_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/sar.c
149
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/sar.c
211
if (srv->fdidx[fd].rsp_cs != cs)
usr.sbin/bluetooth/sdpd/sar.c
213
if (srv->fdidx[fd].rsp_size > 0)
usr.sbin/bluetooth/sdpd/sar.c
234
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t) - 2;
usr.sbin/bluetooth/sdpd/sar.c
235
if (srv->fdidx[fd].rsp_limit > rsp_limit)
usr.sbin/bluetooth/sdpd/sar.c
236
srv->fdidx[fd].rsp_limit = rsp_limit;
usr.sbin/bluetooth/sdpd/sar.c
238
srv->fdidx[fd].rsp_size = cs;
usr.sbin/bluetooth/sdpd/sar.c
239
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/sar.c
249
server_send_service_attribute_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/sar.c
251
uint8_t *rsp = srv->fdidx[fd].rsp + srv->fdidx[fd].rsp_cs;
usr.sbin/bluetooth/sdpd/sar.c
252
uint8_t *rsp_end = srv->fdidx[fd].rsp + srv->fdidx[fd].rsp_size;
usr.sbin/bluetooth/sdpd/sar.c
262
srv->fdidx[fd].rsp_cs += size;
usr.sbin/bluetooth/sdpd/sar.c
264
if (size + 1 > srv->fdidx[fd].rsp_limit) {
usr.sbin/bluetooth/sdpd/sar.c
270
while ((rsp_end - rsp) + 3 > srv->fdidx[fd].rsp_limit) {
usr.sbin/bluetooth/sdpd/sar.c
272
srv->fdidx[fd].rsp_cs --;
usr.sbin/bluetooth/sdpd/sar.c
276
cs[1] = srv->fdidx[fd].rsp_cs >> 8;
usr.sbin/bluetooth/sdpd/sar.c
277
cs[2] = srv->fdidx[fd].rsp_cs & 0xff;
usr.sbin/bluetooth/sdpd/sar.c
308
size = writev(fd, (struct iovec const *) &iov, nitems(iov));
usr.sbin/bluetooth/sdpd/sar.c
312
if (srv->fdidx[fd].rsp_cs == srv->fdidx[fd].rsp_size) {
usr.sbin/bluetooth/sdpd/sar.c
313
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/sar.c
314
srv->fdidx[fd].rsp_size = 0;
usr.sbin/bluetooth/sdpd/sar.c
315
srv->fdidx[fd].rsp_limit = 0;
usr.sbin/bluetooth/sdpd/scr.c
48
server_prepare_service_change_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/scr.c
52
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/scr.c
63
if (!srv->fdidx[fd].control ||
usr.sbin/bluetooth/sdpd/scr.c
64
!srv->fdidx[fd].priv || req_end - req < 4)
usr.sbin/bluetooth/sdpd/scr.c
72
if (provider == NULL || provider->fd != fd)
usr.sbin/bluetooth/sdpd/scr.c
88
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t);
usr.sbin/bluetooth/sdpd/scr.c
89
srv->fdidx[fd].rsp_size = rsp - srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/scr.c
90
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/server.c
230
int fd;
usr.sbin/bluetooth/sdpd/server.c
234
for (fd = 0; fd < srv->maxfd + 1; fd ++)
usr.sbin/bluetooth/sdpd/server.c
235
if (srv->fdidx[fd].valid)
usr.sbin/bluetooth/sdpd/server.c
236
server_close_fd(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
252
int32_t n, fd;
usr.sbin/bluetooth/sdpd/server.c
270
for (fd = 0; fd < srv->maxfd + 1 && n > 0; fd ++) {
usr.sbin/bluetooth/sdpd/server.c
271
if (!FD_ISSET(fd, &fdset))
usr.sbin/bluetooth/sdpd/server.c
274
assert(srv->fdidx[fd].valid);
usr.sbin/bluetooth/sdpd/server.c
277
if (srv->fdidx[fd].server)
usr.sbin/bluetooth/sdpd/server.c
278
server_accept_client(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
279
else if (server_process_request(srv, fd) != 0)
usr.sbin/bluetooth/sdpd/server.c
280
server_close_fd(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
292
server_accept_client(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/server.c
300
cfd = accept(fd, NULL, NULL);
usr.sbin/bluetooth/sdpd/server.c
305
srv->fdidx[fd].control? "control" : "L2CAP",
usr.sbin/bluetooth/sdpd/server.c
315
if (!srv->fdidx[fd].control) {
usr.sbin/bluetooth/sdpd/server.c
371
omtu = srv->fdidx[fd].omtu;
usr.sbin/bluetooth/sdpd/server.c
392
srv->fdidx[cfd].control = srv->fdidx[fd].control;
usr.sbin/bluetooth/sdpd/server.c
406
server_process_request(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/server.c
413
assert(FD_ISSET(fd, &srv->fdset));
usr.sbin/bluetooth/sdpd/server.c
414
assert(srv->fdidx[fd].valid);
usr.sbin/bluetooth/sdpd/server.c
415
assert(!srv->fdidx[fd].server);
usr.sbin/bluetooth/sdpd/server.c
416
assert(srv->fdidx[fd].rsp != NULL);
usr.sbin/bluetooth/sdpd/server.c
417
assert(srv->fdidx[fd].omtu >= NG_L2CAP_MTU_MINIMUM);
usr.sbin/bluetooth/sdpd/server.c
420
len = read(fd, srv->req, srv->imtu);
usr.sbin/bluetooth/sdpd/server.c
425
srv->fdidx[fd].control? "control" : "L2CAP",
usr.sbin/bluetooth/sdpd/server.c
431
srv->fdidx[fd].control? "control" : "L2CAP");
usr.sbin/bluetooth/sdpd/server.c
439
error = server_prepare_service_search_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
443
error = server_prepare_service_attribute_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
447
error = server_prepare_service_search_attribute_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
451
error = server_prepare_service_register_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
455
error = server_prepare_service_unregister_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
459
error = server_prepare_service_change_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
472
error = server_send_service_search_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
476
error = server_send_service_attribute_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
480
error = server_send_service_search_attribute_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
484
error = server_send_service_register_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
488
error = server_send_service_unregister_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
492
error = server_send_service_change_response(srv, fd);
usr.sbin/bluetooth/sdpd/server.c
503
srv->fdidx[fd].control? "control" : "L2CAP",
usr.sbin/bluetooth/sdpd/server.c
509
srv->fdidx[fd].control? "control" : "L2CAP",
usr.sbin/bluetooth/sdpd/server.c
512
error = server_send_error_response(srv, fd, error);
usr.sbin/bluetooth/sdpd/server.c
516
srv->fdidx[fd].control? "control" : "L2CAP",
usr.sbin/bluetooth/sdpd/server.c
522
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/server.c
523
srv->fdidx[fd].rsp_size = 0;
usr.sbin/bluetooth/sdpd/server.c
524
srv->fdidx[fd].rsp_limit = 0;
usr.sbin/bluetooth/sdpd/server.c
535
server_send_error_response(server_p srv, int32_t fd, uint16_t error)
usr.sbin/bluetooth/sdpd/server.c
551
size = write(fd, &rsp, sizeof(rsp));
usr.sbin/bluetooth/sdpd/server.c
56
static void server_accept_client (server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.c
562
server_close_fd(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/server.c
566
assert(FD_ISSET(fd, &srv->fdset));
usr.sbin/bluetooth/sdpd/server.c
567
assert(srv->fdidx[fd].valid);
usr.sbin/bluetooth/sdpd/server.c
569
close(fd);
usr.sbin/bluetooth/sdpd/server.c
57
static int32_t server_process_request (server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.c
571
FD_CLR(fd, &srv->fdset);
usr.sbin/bluetooth/sdpd/server.c
572
if (fd == srv->maxfd)
usr.sbin/bluetooth/sdpd/server.c
575
if (srv->fdidx[fd].rsp != NULL)
usr.sbin/bluetooth/sdpd/server.c
576
free(srv->fdidx[fd].rsp);
usr.sbin/bluetooth/sdpd/server.c
578
memset(&srv->fdidx[fd], 0, sizeof(srv->fdidx[fd]));
usr.sbin/bluetooth/sdpd/server.c
58
static int32_t server_send_error_response (server_p srv, int32_t fd,
usr.sbin/bluetooth/sdpd/server.c
585
if (provider->fd == fd)
usr.sbin/bluetooth/sdpd/server.c
60
static void server_close_fd (server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
82
int32_t server_prepare_service_search_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
83
int32_t server_send_service_search_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
85
int32_t server_prepare_service_attribute_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
86
int32_t server_send_service_attribute_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
88
int32_t server_prepare_service_search_attribute_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
92
int32_t server_prepare_service_register_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
93
int32_t server_send_service_register_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
95
int32_t server_prepare_service_unregister_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/server.h
99
int32_t server_prepare_service_change_response(server_p srv, int32_t fd);
usr.sbin/bluetooth/sdpd/srr.c
102
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t);
usr.sbin/bluetooth/sdpd/srr.c
103
srv->fdidx[fd].rsp_size = rsp - srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/srr.c
104
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/srr.c
114
server_send_service_register_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/srr.c
120
assert(srv->fdidx[fd].rsp_size < srv->fdidx[fd].rsp_limit);
usr.sbin/bluetooth/sdpd/srr.c
124
pdu.len = htons(srv->fdidx[fd].rsp_size);
usr.sbin/bluetooth/sdpd/srr.c
129
iov[1].iov_base = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/srr.c
130
iov[1].iov_len = srv->fdidx[fd].rsp_size;
usr.sbin/bluetooth/sdpd/srr.c
133
size = writev(fd, (struct iovec const *) &iov, nitems(iov));
usr.sbin/bluetooth/sdpd/srr.c
136
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/srr.c
137
srv->fdidx[fd].rsp_size = 0;
usr.sbin/bluetooth/sdpd/srr.c
138
srv->fdidx[fd].rsp_limit = 0;
usr.sbin/bluetooth/sdpd/srr.c
53
server_prepare_service_register_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/srr.c
57
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/srr.c
71
if (!srv->fdidx[fd].control ||
usr.sbin/bluetooth/sdpd/srr.c
72
!srv->fdidx[fd].priv || req_end - req < 8)
usr.sbin/bluetooth/sdpd/srr.c
94
provider = provider_register(profile, bdaddr, fd, req, req_end - req);
usr.sbin/bluetooth/sdpd/ssar.c
178
server_prepare_service_search_attribute_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/ssar.c
182
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/ssar.c
284
if (srv->fdidx[fd].rsp_cs != cs)
usr.sbin/bluetooth/sdpd/ssar.c
286
if (srv->fdidx[fd].rsp_size > 0)
usr.sbin/bluetooth/sdpd/ssar.c
366
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t) - 2;
usr.sbin/bluetooth/sdpd/ssar.c
367
if (srv->fdidx[fd].rsp_limit > rsp_limit)
usr.sbin/bluetooth/sdpd/ssar.c
368
srv->fdidx[fd].rsp_limit = rsp_limit;
usr.sbin/bluetooth/sdpd/ssar.c
370
srv->fdidx[fd].rsp_size = ptr - rsp;
usr.sbin/bluetooth/sdpd/ssar.c
371
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/ssar.c
376
SDP_PUT16(srv->fdidx[fd].rsp_size - 3, ptr);
usr.sbin/bluetooth/sdpd/ssr.c
121
if (srv->fdidx[fd].rsp_cs != cs)
usr.sbin/bluetooth/sdpd/ssr.c
123
if (srv->fdidx[fd].rsp_size > 0)
usr.sbin/bluetooth/sdpd/ssr.c
204
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t) - 4;
usr.sbin/bluetooth/sdpd/ssr.c
205
srv->fdidx[fd].rsp_size = ptr - rsp;
usr.sbin/bluetooth/sdpd/ssr.c
206
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/ssr.c
216
server_send_service_search_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/ssr.c
218
uint8_t *rsp = srv->fdidx[fd].rsp + srv->fdidx[fd].rsp_cs;
usr.sbin/bluetooth/sdpd/ssr.c
219
uint8_t *rsp_end = srv->fdidx[fd].rsp + srv->fdidx[fd].rsp_size;
usr.sbin/bluetooth/sdpd/ssr.c
229
srv->fdidx[fd].rsp_cs += size;
usr.sbin/bluetooth/sdpd/ssr.c
231
if (size + 1 > srv->fdidx[fd].rsp_limit) {
usr.sbin/bluetooth/sdpd/ssr.c
237
while ((rsp_end - rsp) + 3 > srv->fdidx[fd].rsp_limit) {
usr.sbin/bluetooth/sdpd/ssr.c
239
srv->fdidx[fd].rsp_cs -= 4;
usr.sbin/bluetooth/sdpd/ssr.c
243
cs[1] = srv->fdidx[fd].rsp_cs >> 8;
usr.sbin/bluetooth/sdpd/ssr.c
244
cs[2] = srv->fdidx[fd].rsp_cs & 0xff;
usr.sbin/bluetooth/sdpd/ssr.c
250
rcounts[0] = srv->fdidx[fd].rsp_size / 4; /* TotalServiceRecordCount */
usr.sbin/bluetooth/sdpd/ssr.c
273
size = writev(fd, (struct iovec const *) &iov, nitems(iov));
usr.sbin/bluetooth/sdpd/ssr.c
277
if (srv->fdidx[fd].rsp_cs == srv->fdidx[fd].rsp_size) {
usr.sbin/bluetooth/sdpd/ssr.c
278
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/bluetooth/sdpd/ssr.c
279
srv->fdidx[fd].rsp_size = 0;
usr.sbin/bluetooth/sdpd/ssr.c
280
srv->fdidx[fd].rsp_limit = 0;
usr.sbin/bluetooth/sdpd/ssr.c
54
server_prepare_service_search_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/ssr.c
58
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/sur.c
48
server_prepare_service_unregister_response(server_p srv, int32_t fd)
usr.sbin/bluetooth/sdpd/sur.c
52
uint8_t *rsp = srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/sur.c
63
if (!srv->fdidx[fd].control ||
usr.sbin/bluetooth/sdpd/sur.c
64
!srv->fdidx[fd].priv || req_end - req < 4)
usr.sbin/bluetooth/sdpd/sur.c
72
if (provider == NULL || provider->fd != fd)
usr.sbin/bluetooth/sdpd/sur.c
79
srv->fdidx[fd].rsp_limit = srv->fdidx[fd].omtu - sizeof(sdp_pdu_t);
usr.sbin/bluetooth/sdpd/sur.c
80
srv->fdidx[fd].rsp_size = rsp - srv->fdidx[fd].rsp;
usr.sbin/bluetooth/sdpd/sur.c
81
srv->fdidx[fd].rsp_cs = 0;
usr.sbin/boot0cfg/boot0cfg.c
317
int mbr_size, fd;
usr.sbin/boot0cfg/boot0cfg.c
321
if ((fd = open(disk, O_RDONLY)) == -1)
usr.sbin/boot0cfg/boot0cfg.c
323
if ((n = read(fd, buf, MBRSIZE)) == -1)
usr.sbin/boot0cfg/boot0cfg.c
337
if (lseek(fd, 0, SEEK_SET) == -1 ||
usr.sbin/boot0cfg/boot0cfg.c
338
(n = read(fd, *mbr, mbr_size)) == -1)
usr.sbin/boot0cfg/boot0cfg.c
342
close(fd);
usr.sbin/boot0cfg/boot0cfg.c
348
close(fd);
usr.sbin/boot0cfg/boot0cfg.c
387
int fd;
usr.sbin/boot0cfg/boot0cfg.c
389
fd = open(fname, O_WRONLY | flags, 0666);
usr.sbin/boot0cfg/boot0cfg.c
390
if (fd != -1) {
usr.sbin/boot0cfg/boot0cfg.c
391
n = write(fd, mbr, mbr_size);
usr.sbin/boot0cfg/boot0cfg.c
392
close(fd);
usr.sbin/boot0cfg/boot0cfg.c
409
fd = open(fname, O_RDONLY);
usr.sbin/boot0cfg/boot0cfg.c
410
if (fd == -1) {
usr.sbin/boot0cfg/boot0cfg.c
419
if (fstat(fd, &sb) == 0 && S_ISREG(sb.st_mode)) {
usr.sbin/boot0cfg/boot0cfg.c
420
close(fd);
usr.sbin/boot0cfg/boot0cfg.c
421
fd = open(fname, O_WRONLY);
usr.sbin/boot0cfg/boot0cfg.c
422
if (fd == -1)
usr.sbin/boot0cfg/boot0cfg.c
424
n = write(fd, mbr, mbr_size);
usr.sbin/boot0cfg/boot0cfg.c
425
close(fd);
usr.sbin/boot0cfg/boot0cfg.c
431
pname = g_providername(fd);
usr.sbin/boot0cfg/boot0cfg.c
432
close(fd);
usr.sbin/bsdinstall/partedit/part_wizard.c
133
int i, button, fd, selected, n = 0;
usr.sbin/bsdinstall/partedit/part_wizard.c
168
fd = g_open(pp->lg_name, 1);
usr.sbin/bsdinstall/partedit/part_wizard.c
169
if (fd == -1) {
usr.sbin/bsdinstall/partedit/part_wizard.c
172
g_close(fd);
usr.sbin/bsdinstall/runconsoles/child.c
221
child_leader_run(const char *name, int fd, bool new_session, const char **argv,
usr.sbin/bsdinstall/runconsoles/child.c
313
error = dup2(fd, STDIN_FILENO);
usr.sbin/bsdinstall/runconsoles/child.c
316
error = dup2(fd, STDOUT_FILENO);
usr.sbin/bsdinstall/runconsoles/child.c
319
error = dup2(fd, STDERR_FILENO);
usr.sbin/bsdinstall/runconsoles/child.h
28
void child_leader_run(const char *name, int fd, bool new_session,
usr.sbin/bsdinstall/runconsoles/common.h
59
int fd;
usr.sbin/bsdinstall/runconsoles/common.h
61
fd = p->fds[0];
usr.sbin/bsdinstall/runconsoles/common.h
64
ret = read(fd, &temp, 1);
usr.sbin/bsdinstall/runconsoles/common.h
66
close(fd);
usr.sbin/bsdinstall/runconsoles/common.h
72
int fd;
usr.sbin/bsdinstall/runconsoles/common.h
74
fd = p->fds[1];
usr.sbin/bsdinstall/runconsoles/common.h
76
close(fd);
usr.sbin/bsdinstall/runconsoles/common.h
82
int fd;
usr.sbin/bsdinstall/runconsoles/common.h
84
fd = p->fds[i];
usr.sbin/bsdinstall/runconsoles/common.h
85
if (fd != -1) {
usr.sbin/bsdinstall/runconsoles/common.h
87
close(fd);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
154
error = tcsetpgrp(controlling_consinfo->fd,
usr.sbin/bsdinstall/runconsoles/runconsoles.c
300
int fd, error, flags;
usr.sbin/bsdinstall/runconsoles/runconsoles.c
330
fd = open(dev, O_RDWR | O_NONBLOCK);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
331
if (fd == -1)
usr.sbin/bsdinstall/runconsoles/runconsoles.c
334
flags = fcntl(fd, F_GETFL);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
338
error = fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
342
if (tcgetsid(fd) != -1) {
usr.sbin/bsdinstall/runconsoles/runconsoles.c
347
pgrp = tcgetpgrp(fd);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
365
consinfo->fd = fd;
usr.sbin/bsdinstall/runconsoles/runconsoles.c
417
child_leader_run(consinfo->name, consinfo->fd,
usr.sbin/bsdinstall/runconsoles/runconsoles.c
80
int fd;
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
440
devd_socket_callback(int fd, void *arg __unused)
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
445
assert(fd == devd_sock);
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
450
read_len = read(fd, buf, sizeof(buf));
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
214
int fd;
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
225
if ((fd = open(dev_path, O_RDONLY|O_NONBLOCK)) == -1) {
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
230
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) {
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
233
(void)close(fd);
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
241
(void)close(fd);
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
147
int fd;
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
157
fd = open(lockfile, O_RDONLY);
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
158
if (fd < 0 || flock(fd, LOCK_SH | LOCK_NB) == 0) {
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
193
if (fd >= 0)
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
194
(void)close(fd); /* unlocks as well */
usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
305
csock_input(int fd __unused, void *udata __unused)
usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
450
dsock_input(int fd __unused, void *udata __unused)
usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
460
(void)NgRecvData(fd, embuf, sizeof(embuf), hook);
usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
464
if ((len = NgRecvData(fd, resbuf, resbufsiz + 1, hook)) == -1) {
usr.sbin/btxld/btxld.c
304
getbtx(int fd, struct btx_hdr * btx)
usr.sbin/btxld/btxld.c
306
if (readx(fd, btx, sizeof(*btx), 0) != sizeof(*btx) ||
usr.sbin/btxld/btxld.c
320
gethdr(int fd, struct hdr *hdr)
usr.sbin/btxld/btxld.c
330
if (fstat(fd, &sb))
usr.sbin/btxld/btxld.c
337
if ((p = mmap(NULL, hdr->size, PROT_READ, MAP_SHARED, fd,
usr.sbin/btxld/btxld.c
398
puthdr(int fd, struct hdr *hdr)
usr.sbin/btxld/btxld.c
412
writex(fd, &ex, sizeof(ex));
usr.sbin/btxld/btxld.c
414
seekx(fd, hdr->size);
usr.sbin/btxld/btxld.c
433
writex(fd, &eh, sizeof(eh));
usr.sbin/btxld/btxld.c
462
readx(int fd, void *buf, size_t nbyte, off_t offset)
usr.sbin/btxld/btxld.c
466
if (offset != -1 && lseek(fd, offset, SEEK_SET) != offset)
usr.sbin/btxld/btxld.c
468
if ((n = read(fd, buf, nbyte)) == -1)
usr.sbin/btxld/btxld.c
477
writex(int fd, const void *buf, size_t nbyte)
usr.sbin/btxld/btxld.c
481
if ((n = write(fd, buf, nbyte)) == -1)
usr.sbin/btxld/btxld.c
491
seekx(int fd, off_t offset)
usr.sbin/btxld/btxld.c
493
if (lseek(fd, offset, SEEK_SET) != offset)
usr.sbin/camdd/camdd.c
1021
camdd_probe_file(int fd, struct camdd_io_opts *io_opts, int retry_count,
usr.sbin/camdd/camdd.c
1033
file_dev->fd = fd;
usr.sbin/camdd/camdd.c
1059
if ((fd != STDIN_FILENO)
usr.sbin/camdd/camdd.c
1060
&& (fd != STDOUT_FILENO)) {
usr.sbin/camdd/camdd.c
1063
retval = fstat(fd, &file_dev->sb);
usr.sbin/camdd/camdd.c
1073
if (ioctl(fd, FIODTYPE, &type) == -1)
usr.sbin/camdd/camdd.c
1112
retval = camdd_probe_tape(fd, dev->device_name,
usr.sbin/camdd/camdd.c
1173
if (ioctl(fd, DIOCGSECTORSIZE, &sector_size) == -1) {
usr.sbin/camdd/camdd.c
1184
if (ioctl(fd, DIOCGMEDIASIZE, &media_size) == -1) {
usr.sbin/camdd/camdd.c
1538
EV_SET(&ke, cam_dev->fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
usr.sbin/camdd/camdd.c
2306
while ((retval = ioctl(pass_dev->dev->fd, CAMIOGET, &ccb)) != -1) {
usr.sbin/camdd/camdd.c
2474
retval = pread(file_dev->fd, data->buf,
usr.sbin/camdd/camdd.c
2478
retval = pwrite(file_dev->fd, file_dev->tmp_buf,
usr.sbin/camdd/camdd.c
2481
retval = pwrite(file_dev->fd, data->buf,
usr.sbin/camdd/camdd.c
2484
retval = pwritev(file_dev->fd, data->iovec,
usr.sbin/camdd/camdd.c
2494
retval = read(file_dev->fd, data->buf, buf->len);
usr.sbin/camdd/camdd.c
2497
retval = write(file_dev->fd, file_dev->tmp_buf,
usr.sbin/camdd/camdd.c
2500
retval = write(file_dev->fd, data->buf,
usr.sbin/camdd/camdd.c
2503
retval = writev(file_dev->fd, data->iovec,
usr.sbin/camdd/camdd.c
2537
"offset %ju\n", __func__, file_dev->fd,
usr.sbin/camdd/camdd.c
2542
"offset %ju\n", __func__, file_dev->fd, data->buf,
usr.sbin/camdd/camdd.c
2549
"offset %ju\n", __func__, file_dev->fd,
usr.sbin/camdd/camdd.c
2714
if (ioctl(pass_dev->dev->fd, CAMIOQUEUE, ccb) == -1) {
usr.sbin/camdd/camdd.c
278
int fd;
usr.sbin/camdd/camdd.c
287
int fd;
usr.sbin/camdd/camdd.c
3275
int fd = -1;
usr.sbin/camdd/camdd.c
3279
fd = STDOUT_FILENO;
usr.sbin/camdd/camdd.c
3281
fd = STDIN_FILENO;
usr.sbin/camdd/camdd.c
3284
fd = open(io_opts[i].dev_name,
usr.sbin/camdd/camdd.c
3287
fd = open(io_opts[i].dev_name,
usr.sbin/camdd/camdd.c
3291
if (fd == -1) {
usr.sbin/camdd/camdd.c
3298
devs[i] = camdd_probe_file(fd, &io_opts[i],
usr.sbin/camdd/camdd.c
452
int camdd_probe_tape(int fd, char *filename, uint64_t *max_iosize,
usr.sbin/camdd/camdd.c
460
struct camdd_dev *camdd_probe_file(int fd, struct camdd_io_opts *io_opts,
usr.sbin/camdd/camdd.c
549
if (file_dev->fd != -1)
usr.sbin/camdd/camdd.c
550
close(file_dev->fd);
usr.sbin/camdd/camdd.c
970
camdd_probe_tape(int fd, char *filename, uint64_t *max_iosize,
usr.sbin/camdd/camdd.c
978
retval = mt_get_xml_str(fd, MTIOCEXTGET, &xml_str);
usr.sbin/cdcontrol/cdcontrol.c
1061
return ioctl (fd, CDIOCPLAYTRACKS, &t);
usr.sbin/cdcontrol/cdcontrol.c
1072
return ioctl (fd, CDIOCPLAYBLOCKS, &t);
usr.sbin/cdcontrol/cdcontrol.c
1088
return ioctl (fd, CDIOCSETVOL, &v);
usr.sbin/cdcontrol/cdcontrol.c
1101
return (ioctl (fd, CDIOREADTOCENTRYS, (char *) &t));
usr.sbin/cdcontrol/cdcontrol.c
1117
return ioctl (fd, CDIOCPLAYMSF, (char *) &a);
usr.sbin/cdcontrol/cdcontrol.c
1133
if (ioctl (fd, CDIOCREADSUBCHANNEL, (char *) &s) < 0)
usr.sbin/cdcontrol/cdcontrol.c
123
static int fd = -1;
usr.sbin/cdcontrol/cdcontrol.c
1279
if (fd > -1)
usr.sbin/cdcontrol/cdcontrol.c
1288
fd = open (dev = devbuf, O_RDONLY);
usr.sbin/cdcontrol/cdcontrol.c
1290
fd = open(dev = "/dev/cdrom", O_RDONLY);
usr.sbin/cdcontrol/cdcontrol.c
1291
if (fd < 0 && errno == ENOENT)
usr.sbin/cdcontrol/cdcontrol.c
1292
fd = open(dev = "/dev/cd0", O_RDONLY);
usr.sbin/cdcontrol/cdcontrol.c
1295
if (fd < 0) {
usr.sbin/cdcontrol/cdcontrol.c
281
close (fd);
usr.sbin/cdcontrol/cdcontrol.c
282
fd = -1;
usr.sbin/cdcontrol/cdcontrol.c
300
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
306
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
312
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
319
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
328
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
331
return ioctl (fd, CDIOCPAUSE);
usr.sbin/cdcontrol/cdcontrol.c
334
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
337
return ioctl (fd, CDIOCRESUME);
usr.sbin/cdcontrol/cdcontrol.c
340
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
343
rc = ioctl (fd, CDIOCSTOP);
usr.sbin/cdcontrol/cdcontrol.c
345
(void) ioctl (fd, CDIOCALLOW);
usr.sbin/cdcontrol/cdcontrol.c
350
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
353
rc = ioctl (fd, CDIOCRESET);
usr.sbin/cdcontrol/cdcontrol.c
356
close(fd);
usr.sbin/cdcontrol/cdcontrol.c
357
fd = -1;
usr.sbin/cdcontrol/cdcontrol.c
361
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
365
return ioctl (fd, CDIOCSETDEBUG);
usr.sbin/cdcontrol/cdcontrol.c
368
return ioctl (fd, CDIOCCLRDEBUG);
usr.sbin/cdcontrol/cdcontrol.c
375
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
378
(void) ioctl (fd, CDIOCALLOW);
usr.sbin/cdcontrol/cdcontrol.c
379
rc = ioctl (fd, CDIOCEJECT);
usr.sbin/cdcontrol/cdcontrol.c
385
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
388
(void) ioctl (fd, CDIOCALLOW);
usr.sbin/cdcontrol/cdcontrol.c
389
rc = ioctl (fd, CDIOCCLOSE);
usr.sbin/cdcontrol/cdcontrol.c
392
close(fd);
usr.sbin/cdcontrol/cdcontrol.c
393
fd = -1;
usr.sbin/cdcontrol/cdcontrol.c
397
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
415
if (fd < 0 && !open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
425
return ioctl (fd, CDIOCSETLEFT);
usr.sbin/cdcontrol/cdcontrol.c
428
return ioctl (fd, CDIOCSETRIGHT);
usr.sbin/cdcontrol/cdcontrol.c
431
return ioctl (fd, CDIOCSETMONO);
usr.sbin/cdcontrol/cdcontrol.c
434
return ioctl (fd, CDIOCSETSTERIO);
usr.sbin/cdcontrol/cdcontrol.c
437
return ioctl (fd, CDIOCSETMUTE);
usr.sbin/cdcontrol/cdcontrol.c
448
if (fd < 0 && ! open_cd ())
usr.sbin/cdcontrol/cdcontrol.c
460
return ioctl(fd, CDRIOCREADSPEED, &speed);
usr.sbin/cdcontrol/cdcontrol.c
477
rc = ioctl (fd, CDIOREADTOCHEADER, &h);
usr.sbin/cdcontrol/cdcontrol.c
761
rc = ioctl (fd, CDIOREADTOCHEADER, &h);
usr.sbin/cdcontrol/cdcontrol.c
841
rc = ioctl (fd, CDIOCREADSUBCHANNEL, (char *) &ss);
usr.sbin/cdcontrol/cdcontrol.c
857
rc = ioctl (fd, CDIOCGETVOL, &v);
usr.sbin/cdcontrol/cdcontrol.c
919
rc = ioctl (fd, CDIOREADTOCHEADER, &h);
usr.sbin/cdcontrol/cdcontrol.c
963
rc = ioctl (fd, CDIOREADTOCHEADER, &h);
usr.sbin/certctl/certctl.c
427
int cmp, d, fd, ndents, ret = 0;
usr.sbin/certctl/certctl.c
508
fd = open(_PATH_DEVNULL, O_WRONLY);
usr.sbin/certctl/certctl.c
511
fd = openat(d, tmppath,
usr.sbin/certctl/certctl.c
513
if (!unprivileged && fd >= 0)
usr.sbin/certctl/certctl.c
514
(void)fchmod(fd, mode);
usr.sbin/certctl/certctl.c
521
fd = open(_PATH_DEVNULL, O_WRONLY);
usr.sbin/certctl/certctl.c
524
fd = openat(d, tmppath,
usr.sbin/certctl/certctl.c
526
if (!unprivileged && fd >= 0)
usr.sbin/certctl/certctl.c
527
(void)fchmod(fd, mode);
usr.sbin/certctl/certctl.c
531
if (fd < 0 ||
usr.sbin/certctl/certctl.c
532
(f = fdopen(fd, "w")) == NULL ||
usr.sbin/certctl/certctl.c
534
if (tmppath != NULL && fd >= 0) {
usr.sbin/certctl/certctl.c
583
int d, fd, ret = 0;
usr.sbin/certctl/certctl.c
595
fd = open(_PATH_DEVNULL, O_WRONLY);
usr.sbin/certctl/certctl.c
598
fd = openat(d, tmpfile, O_WRONLY | O_CREAT | O_EXCL, mode);
usr.sbin/certctl/certctl.c
599
if (!unprivileged && fd >= 0)
usr.sbin/certctl/certctl.c
600
(void)fchmod(fd, mode);
usr.sbin/certctl/certctl.c
602
if (fd < 0 || (f = fdopen(fd, "w")) == NULL) {
usr.sbin/certctl/certctl.c
603
if (tmpfile != NULL && fd >= 0) {
usr.sbin/ckdist/ckdist.c
225
int rval, error, c, fd;
usr.sbin/ckdist/ckdist.c
243
if ((fd = open(dname, O_RDONLY)) == -1)
usr.sbin/ckdist/ckdist.c
245
else if (close(fd))
usr.sbin/ckdist/ckdist.c
273
int rval, error, c, pieces, cnt, fd;
usr.sbin/ckdist/ckdist.c
278
fd = -1;
usr.sbin/ckdist/ckdist.c
293
else if ((fd = open(dname, O_RDONLY)) == -1)
usr.sbin/ckdist/ckdist.c
295
else if (fstat(fd, &sb))
usr.sbin/ckdist/ckdist.c
300
if (crc(fd, &chk, &len))
usr.sbin/ckdist/ckdist.c
305
if (fd != -1 && close(fd))
usr.sbin/ckdist/ckdist.c
44
extern int crc(int fd, uint32_t *cval, off_t *clen);
usr.sbin/cpucontrol/amd.c
51
amd_probe(int fd)
usr.sbin/cpucontrol/amd.c
59
error = ioctl(fd, CPUCTL_CPUID, &idargs);
usr.sbin/cpucontrol/amd10h.c
50
amd10h_probe(int fd)
usr.sbin/cpucontrol/amd10h.c
59
error = ioctl(fd, CPUCTL_CPUID, &idargs);
usr.sbin/cpucontrol/amd10h.c
72
error = ioctl(fd, CPUCTL_CPUID, &idargs);
usr.sbin/cpucontrol/cpucontrol.c
137
int fd, error;
usr.sbin/cpucontrol/cpucontrol.c
154
fd = open(dev, O_RDONLY);
usr.sbin/cpucontrol/cpucontrol.c
155
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
159
error = ioctl(fd, CPUCTL_CPUID, &args);
usr.sbin/cpucontrol/cpucontrol.c
162
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
167
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
177
int fd, error;
usr.sbin/cpucontrol/cpucontrol.c
204
fd = open(dev, O_RDONLY);
usr.sbin/cpucontrol/cpucontrol.c
205
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
209
error = ioctl(fd, CPUCTL_CPUID_COUNT, &args);
usr.sbin/cpucontrol/cpucontrol.c
212
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
218
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
231
int fd, error;
usr.sbin/cpucontrol/cpucontrol.c
318
fd = open(dev, op == OP_READ ? O_RDONLY : O_WRONLY);
usr.sbin/cpucontrol/cpucontrol.c
319
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
324
error = ioctl(fd, command, &args);
usr.sbin/cpucontrol/cpucontrol.c
327
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
333
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
340
int fd, error;
usr.sbin/cpucontrol/cpucontrol.c
344
fd = open(dev, O_RDWR);
usr.sbin/cpucontrol/cpucontrol.c
345
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
349
error = ioctl(fd, CPUCTL_EVAL_CPU_FEATURES, NULL);
usr.sbin/cpucontrol/cpucontrol.c
352
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
423
int fd, fwdfd;
usr.sbin/cpucontrol/cpucontrol.c
431
fd = open(dev, O_RDONLY);
usr.sbin/cpucontrol/cpucontrol.c
432
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
441
if (handlers[i].probe(fd) == 0)
usr.sbin/cpucontrol/cpucontrol.c
447
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
450
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
452
fd = open(dev, O_RDWR);
usr.sbin/cpucontrol/cpucontrol.c
453
if (fd < 0) {
usr.sbin/cpucontrol/cpucontrol.c
471
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
481
error = try_a_fw_image(dev, fd, fwdfd, dir->path,
usr.sbin/cpucontrol/cpucontrol.c
485
close(fd);
usr.sbin/cpucontrol/cpucontrol.c
493
close(fd);
usr.sbin/cpucontrol/cpucontrol.h
33
typedef int ucode_probe_t(int fd);
usr.sbin/cpucontrol/intel.c
54
intel_probe(int fd)
usr.sbin/cpucontrol/intel.c
62
error = ioctl(fd, CPUCTL_CPUID, &idargs);
usr.sbin/cpucontrol/via.c
52
via_probe(int fd)
usr.sbin/cpucontrol/via.c
60
error = ioctl(fd, CPUCTL_CPUID, &idargs);
usr.sbin/crunch/crunchgen/crunchgen.c
706
int fd, rc;
usr.sbin/crunch/crunchgen/crunchgen.c
723
if ((fd = open(tempfname, O_CREAT | O_EXCL | O_RDWR, 0600)) == -1) {
usr.sbin/crunch/crunchgen/crunchgen.c
726
} else if ((fd = mkstemp(tempfname)) == -1) {
usr.sbin/crunch/crunchgen/crunchgen.c
730
if ((f = fdopen(fd, "w")) == NULL) {
usr.sbin/crunch/crunchide/crunchide.c
221
int fd, i, n, rv;
usr.sbin/crunch/crunchide/crunchide.c
223
fd = open(filename, O_RDWR, 0);
usr.sbin/crunch/crunchide/crunchide.c
224
if (fd == -1) {
usr.sbin/crunch/crunchide/crunchide.c
233
if (lseek(fd, 0, SEEK_SET) != 0) {
usr.sbin/crunch/crunchide/crunchide.c
237
if ((*exec_formats[i].check)(fd, filename) != 0)
usr.sbin/crunch/crunchide/crunchide.c
249
if (lseek(fd, 0, SEEK_SET) != 0) {
usr.sbin/crunch/crunchide/crunchide.c
253
rv = (*exec_formats[i].hide)(fd, filename);
usr.sbin/crunch/crunchide/crunchide.c
256
close (fd);
usr.sbin/crunch/crunchide/exec_elf32.c
100
if (lseek(fd, off, SEEK_SET) != off) {
usr.sbin/crunch/crunchide/exec_elf32.c
104
if ((size_t)(rv = read(fd, buf, size)) != size) {
usr.sbin/crunch/crunchide/exec_elf32.c
113
xwriteatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
usr.sbin/crunch/crunchide/exec_elf32.c
117
if (lseek(fd, off, SEEK_SET) != off) {
usr.sbin/crunch/crunchide/exec_elf32.c
121
if ((size_t)(rv = write(fd, buf, size)) != size) {
usr.sbin/crunch/crunchide/exec_elf32.c
156
ELFNAMEEND(check)(int fd, const char *fn __unused)
usr.sbin/crunch/crunchide/exec_elf32.c
166
if (fstat(fd, &sb) == -1)
usr.sbin/crunch/crunchide/exec_elf32.c
170
if (read(fd, &eh, sizeof eh) != sizeof eh)
usr.sbin/crunch/crunchide/exec_elf32.c
222
ELFNAMEEND(hide)(int fd, const char *fn)
usr.sbin/crunch/crunchide/exec_elf32.c
242
if (xreadatoff(fd, &ehdr, 0, sizeof ehdr, fn) != sizeof ehdr)
usr.sbin/crunch/crunchide/exec_elf32.c
251
if (xreadatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) !=
usr.sbin/crunch/crunchide/exec_elf32.c
340
if ((size_t)xreadatoff(fd, shstrtabp, xewtoh(shstrtabshdr->sh_offset),
usr.sbin/crunch/crunchide/exec_elf32.c
370
if ((size_t)xreadatoff(fd, layoutp[i].bufp, off, size, fn) !=
usr.sbin/crunch/crunchide/exec_elf32.c
468
if ((size_t)xwriteatoff(fd, &ehdr.e_shoff, off, size,
usr.sbin/crunch/crunchide/exec_elf32.c
475
if ((size_t)xwriteatoff(fd, buf, off, size, fn) != size)
usr.sbin/crunch/crunchide/exec_elf32.c
96
xreadatoff(int fd, void *buf, off_t off, size_t size, const char *fn)
usr.sbin/ctladm/ctladm.c
1060
if (ioctl(fd, CTL_ERROR_INJECT, &err_desc) == -1) {
usr.sbin/ctladm/ctladm.c
1073
cctl_lunlist(int fd)
usr.sbin/ctladm/ctladm.c
1089
if ((retval = cctl_get_luns(fd, /*lun*/ 0, initid,
usr.sbin/ctladm/ctladm.c
1126
if ((retval = cctl_get_inquiry(fd, lun_val, initid,
usr.sbin/ctladm/ctladm.c
1147
cctl_sync_cache(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
1215
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1231
cctl_start_stop(int fd, int lun, int iid, int retries, int start,
usr.sbin/ctladm/ctladm.c
1275
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1294
cctl_mode_sense(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
1440
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1509
cctl_read_capacity(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
1590
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1632
cctl_read_write(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
1779
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1812
cctl_get_luns(int fd, int lun, int iid, int retries, struct
usr.sbin/ctladm/ctladm.c
1854
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1882
cctl_report_luns(int fd, int lun, int iid, int retries)
usr.sbin/ctladm/ctladm.c
1890
if ((retval = cctl_get_luns(fd, lun, iid, retries, &lun_data,
usr.sbin/ctladm/ctladm.c
1935
cctl_tur(int fd, int lun, int iid, int retries)
usr.sbin/ctladm/ctladm.c
1952
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
1966
cctl_get_inquiry(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
1992
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
2010
cctl_inquiry(int fd, int lun, int iid, int retries)
usr.sbin/ctladm/ctladm.c
2023
if ((retval = cctl_get_inquiry(fd, lun, iid, retries, scsi_path,
usr.sbin/ctladm/ctladm.c
2038
cctl_req_sense(int fd, int lun, int iid, int retries)
usr.sbin/ctladm/ctladm.c
2064
if (cctl_do_io(fd, retries, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
2085
cctl_report_target_port_group(int fd, int lun, int iid)
usr.sbin/ctladm/ctladm.c
2121
if (cctl_do_io(fd, 0, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
214
static int cctl_dump_ooa(int fd, int argc, char **argv);
usr.sbin/ctladm/ctladm.c
215
static int cctl_port(int fd, int argc, char **argv, char *combinedopt);
usr.sbin/ctladm/ctladm.c
2150
cctl_inquiry_vpd_devid(int fd, int lun, int iid)
usr.sbin/ctladm/ctladm.c
216
static int cctl_do_io(int fd, int retries, union ctl_io *io, const char *func);
usr.sbin/ctladm/ctladm.c
217
static int cctl_delay(int fd, int lun, int argc, char **argv,
usr.sbin/ctladm/ctladm.c
2187
if (cctl_do_io(fd, 0, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
219
static int cctl_lunlist(int fd);
usr.sbin/ctladm/ctladm.c
220
static int cctl_sync_cache(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
2216
cctl_persistent_reserve_in(int fd, int lun, int iid,
usr.sbin/ctladm/ctladm.c
222
static int cctl_start_stop(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
224
static int cctl_mode_sense(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
226
static int cctl_read_capacity(int fd, int lun, int iid,
usr.sbin/ctladm/ctladm.c
2273
if (cctl_do_io(fd, retry_count, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
229
static int cctl_read_write(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
2317
cctl_persistent_reserve_out(int fd, int lun, int iid,
usr.sbin/ctladm/ctladm.c
232
static int cctl_get_luns(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
235
static int cctl_report_luns(int fd, int lun, int iid, int retries);
usr.sbin/ctladm/ctladm.c
236
static int cctl_tur(int fd, int lun, int iid, int retries);
usr.sbin/ctladm/ctladm.c
237
static int cctl_get_inquiry(int fd, int lun, int iid, int retries,
usr.sbin/ctladm/ctladm.c
2393
if (cctl_do_io(fd, retry_count, io, __func__) != 0) {
usr.sbin/ctladm/ctladm.c
240
static int cctl_inquiry(int fd, int lun, int iid, int retries);
usr.sbin/ctladm/ctladm.c
241
static int cctl_req_sense(int fd, int lun, int iid, int retries);
usr.sbin/ctladm/ctladm.c
2415
cctl_create_lun(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
242
static int cctl_persistent_reserve_in(int fd, int lun,
usr.sbin/ctladm/ctladm.c
245
static int cctl_persistent_reserve_out(int fd, int lun,
usr.sbin/ctladm/ctladm.c
248
static int cctl_create_lun(int fd, int argc, char **argv, char *combinedopt);
usr.sbin/ctladm/ctladm.c
249
static int cctl_inquiry_vpd_devid(int fd, int lun, int initiator);
usr.sbin/ctladm/ctladm.c
250
static int cctl_report_target_port_group(int fd, int lun, int initiator);
usr.sbin/ctladm/ctladm.c
251
static int cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt);
usr.sbin/ctladm/ctladm.c
252
static int cctl_portlist(int fd, int argc, char **argv, char *combinedopt);
usr.sbin/ctladm/ctladm.c
2542
retval = ioctl(fd, CTL_LUN_REQ, &req);
usr.sbin/ctladm/ctladm.c
2583
cctl_rm_lun(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
2653
retval = ioctl(fd, CTL_LUN_REQ, &req);
usr.sbin/ctladm/ctladm.c
2685
cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
2773
retval = ioctl(fd, CTL_LUN_REQ, &req);
usr.sbin/ctladm/ctladm.c
283
cctl_dump_ooa(int fd, int argc, char **argv)
usr.sbin/ctladm/ctladm.c
2970
cctl_islist(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
3008
if (ioctl(fd, CTL_ISCSI, &req) == -1) {
usr.sbin/ctladm/ctladm.c
3085
cctl_islogout(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
309
if (ioctl(fd, CTL_GET_OOA, &ooa) == -1) {
usr.sbin/ctladm/ctladm.c
3138
if (ioctl(fd, CTL_ISCSI, &req) == -1) {
usr.sbin/ctladm/ctladm.c
3158
cctl_isterminate(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
3211
if (ioctl(fd, CTL_ISCSI, &req) == -1) {
usr.sbin/ctladm/ctladm.c
3383
cctl_devlist(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
3426
if (ioctl(fd, CTL_LUN_LIST, &list) == -1) {
usr.sbin/ctladm/ctladm.c
3674
cctl_portlist(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
371
cctl_dump_structs(int fd, ctladm_cmdargs cmdargs __unused)
usr.sbin/ctladm/ctladm.c
373
if (ioctl(fd, CTL_DUMP_STRUCTS) == -1) {
usr.sbin/ctladm/ctladm.c
3730
if (ioctl(fd, CTL_PORT_LIST, &list) == -1) {
usr.sbin/ctladm/ctladm.c
3817
cctl_lunmap(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
3843
if (ioctl(fd, CTL_LUN_MAP, &lm) == -1) {
usr.sbin/ctladm/ctladm.c
3990
cctl_nvlist(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
402
cctl_port(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
4028
if (ioctl(fd, CTL_NVMF, &req) == -1) {
usr.sbin/ctladm/ctladm.c
4096
cctl_nvterminate(int fd, int argc, char **argv, char *combinedopt)
usr.sbin/ctladm/ctladm.c
4140
if (ioctl(fd, CTL_NVMF, &req) == -1) {
usr.sbin/ctladm/ctladm.c
4318
int retval, fd;
usr.sbin/ctladm/ctladm.c
4327
fd = -1;
usr.sbin/ctladm/ctladm.c
4466
fd = open(device, O_RDWR);
usr.sbin/ctladm/ctladm.c
4467
if (fd == -1 && errno == ENOENT) {
usr.sbin/ctladm/ctladm.c
4471
fd = open(device, O_RDWR);
usr.sbin/ctladm/ctladm.c
4475
if (fd == -1) {
usr.sbin/ctladm/ctladm.c
4504
retval = cctl_tur(fd, lun, initid, retries);
usr.sbin/ctladm/ctladm.c
4507
retval = cctl_inquiry(fd, lun, initid, retries);
usr.sbin/ctladm/ctladm.c
4510
retval = cctl_req_sense(fd, lun, initid, retries);
usr.sbin/ctladm/ctladm.c
4513
retval = cctl_report_luns(fd, lun, initid, retries);
usr.sbin/ctladm/ctladm.c
4516
retval = cctl_create_lun(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4519
retval = cctl_rm_lun(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4522
retval = cctl_devlist(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4526
retval = cctl_read_write(fd, lun, initid, retries,
usr.sbin/ctladm/ctladm.c
4530
retval = cctl_port(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4533
retval = cctl_portlist(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4536
retval = cctl_lunmap(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4539
retval = cctl_read_capacity(fd, lun, initid, retries,
usr.sbin/ctladm/ctladm.c
4543
retval = cctl_mode_sense(fd, lun, initid, retries,
usr.sbin/ctladm/ctladm.c
4548
retval = cctl_start_stop(fd, lun, initid, retries,
usr.sbin/ctladm/ctladm.c
4553
retval = cctl_sync_cache(fd, lun, initid, retries,
usr.sbin/ctladm/ctladm.c
4557
retval = cctl_lunlist(fd);
usr.sbin/ctladm/ctladm.c
4560
retval = cctl_delay(fd, lun, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4563
retval = cctl_error_inject(fd, lun, argc, argv,
usr.sbin/ctladm/ctladm.c
4567
retval = cctl_dump_ooa(fd, argc, argv);
usr.sbin/ctladm/ctladm.c
4570
retval = cctl_dump_structs(fd, cmdargs);
usr.sbin/ctladm/ctladm.c
4573
retval = cctl_persistent_reserve_in(fd, lun, initid,
usr.sbin/ctladm/ctladm.c
4578
retval = cctl_persistent_reserve_out(fd, lun, initid,
usr.sbin/ctladm/ctladm.c
4583
retval = cctl_inquiry_vpd_devid(fd, lun, initid);
usr.sbin/ctladm/ctladm.c
4586
retval = cctl_report_target_port_group(fd, lun, initid);
usr.sbin/ctladm/ctladm.c
4589
retval = cctl_modify_lun(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4592
retval = cctl_islist(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4595
retval = cctl_islogout(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4598
retval = cctl_isterminate(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4601
retval = cctl_nvlist(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4604
retval = cctl_nvterminate(fd, argc, argv, combinedopt);
usr.sbin/ctladm/ctladm.c
4613
if (fd != -1)
usr.sbin/ctladm/ctladm.c
4614
close(fd);
usr.sbin/ctladm/ctladm.c
590
cctl_portlist(fd, argcx, argvx, opts);
usr.sbin/ctladm/ctladm.c
616
retval = ioctl(fd, CTL_PORT_REQ, &req);
usr.sbin/ctladm/ctladm.c
672
if (ioctl(fd, CTL_SET_PORT_WWNS, &entry) == -1) {
usr.sbin/ctladm/ctladm.c
679
if (ioctl(fd, CTL_ENABLE_PORT, &entry) == -1) {
usr.sbin/ctladm/ctladm.c
687
if (ioctl(fd, CTL_DISABLE_PORT, &entry) == -1) {
usr.sbin/ctladm/ctladm.c
713
cctl_do_io(int fd, int retries, union ctl_io *io, const char *func)
usr.sbin/ctladm/ctladm.c
716
if (ioctl(fd, CTL_IO, io) == -1) {
usr.sbin/ctladm/ctladm.c
727
cctl_delay(int fd, int lun, int argc, char **argv,
usr.sbin/ctladm/ctladm.c
785
if (ioctl(fd, CTL_DELAY_IO, &delay_info) == -1) {
usr.sbin/ctladm/ctladm.c
853
cctl_error_inject(int fd, uint32_t lun, int argc, char **argv,
usr.sbin/ctladm/ctladm.c
987
if (ioctl(fd, CTL_ERROR_INJECT_DELETE, &err_desc) == -1) {
usr.sbin/ctld/ctld.cc
2385
handle_connection(struct portal *portal, freebsd::fd_up fd,
usr.sbin/ctld/ctld.cc
2429
portal->handle_connection(std::move(fd), host, client_sa);
usr.sbin/ctld/ctld.hh
158
virtual void handle_connection(freebsd::fd_up fd, const char *host,
usr.sbin/ctld/iscsi.cc
413
iscsi_connection::iscsi_connection(struct portal *portal, freebsd::fd_up fd,
usr.sbin/ctld/iscsi.cc
415
conn_portal(portal), conn_fd(std::move(fd)), conn_initiator_addr(host),
usr.sbin/ctld/iscsi.cc
499
iscsi_portal::handle_connection(freebsd::fd_up fd, const char *host,
usr.sbin/ctld/iscsi.cc
504
iscsi_connection conn(this, std::move(fd), host, client_sa);
usr.sbin/ctld/iscsi.cc
64
void handle_connection(freebsd::fd_up fd, const char *host,
usr.sbin/ctld/iscsi.hh
39
iscsi_connection(struct portal *portal, freebsd::fd_up fd,
usr.sbin/ctld/nvmf.cc
40
void handle_connection(freebsd::fd_up fd, const char *host,
usr.sbin/ctld/nvmf.cc
428
nvmf_io_portal::handle_connection(freebsd::fd_up fd, const char *host __unused,
usr.sbin/ctld/nvmf.cc
433
qparams.tcp.fd = fd;
usr.sbin/ctld/nvmf.hh
63
void handle_connection(freebsd::fd_up fd, const char *host,
usr.sbin/ctld/nvmf_discovery.cc
201
build_discovery_log_page(const struct portal_group *pg, int fd,
usr.sbin/ctld/nvmf_discovery.cc
209
if (getsockname(fd, (struct sockaddr *)&ss, &len) == -1) {
usr.sbin/ctld/nvmf_discovery.cc
469
discovery_controller::discovery_controller(freebsd::fd_up fd,
usr.sbin/ctld/nvmf_discovery.cc
471
qp(qp), discovery_log(discovery_log), s(std::move(fd))
usr.sbin/ctld/nvmf_discovery.cc
479
nvmf_discovery_portal::handle_connection(freebsd::fd_up fd,
usr.sbin/ctld/nvmf_discovery.cc
484
qparams.tcp.fd = fd;
usr.sbin/ctld/nvmf_discovery.cc
514
fd, client_sa, data);
usr.sbin/ctld/nvmf_discovery.cc
516
discovery_controller controller(std::move(fd), qp.get(), discovery_log);
usr.sbin/cxgbetool/cxgbetool.c
149
if (ioctl(g.fd, cmd, data) < 0) {
usr.sbin/cxgbetool/cxgbetool.c
1524
show_struct(const uint32_t *words, int nwords, const struct field_desc *fd)
usr.sbin/cxgbetool/cxgbetool.c
1529
for (p = fd; p->name; p++)
usr.sbin/cxgbetool/cxgbetool.c
1532
while (fd->name) {
usr.sbin/cxgbetool/cxgbetool.c
1534
int first_word = fd->start / 32;
usr.sbin/cxgbetool/cxgbetool.c
1535
int shift = fd->start % 32;
usr.sbin/cxgbetool/cxgbetool.c
1536
int width = fd->end - fd->start + 1;
usr.sbin/cxgbetool/cxgbetool.c
1544
if (fd->islog2)
usr.sbin/cxgbetool/cxgbetool.c
1546
printf("%-*s ", w, fd->name);
usr.sbin/cxgbetool/cxgbetool.c
1547
printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift);
usr.sbin/cxgbetool/cxgbetool.c
1548
fd++;
usr.sbin/cxgbetool/cxgbetool.c
2175
int rc, fd, n;
usr.sbin/cxgbetool/cxgbetool.c
2187
fd = open(fname, O_RDONLY);
usr.sbin/cxgbetool/cxgbetool.c
2188
if (fd < 0) {
usr.sbin/cxgbetool/cxgbetool.c
2193
if (fstat(fd, &st) < 0) {
usr.sbin/cxgbetool/cxgbetool.c
2195
close(fd);
usr.sbin/cxgbetool/cxgbetool.c
2201
data.data = mmap(0, data.len, PROT_READ, MAP_PRIVATE, fd, 0);
usr.sbin/cxgbetool/cxgbetool.c
2213
n = read(fd, data.data + data.len, bufsz - data.len);
usr.sbin/cxgbetool/cxgbetool.c
2217
close(fd);
usr.sbin/cxgbetool/cxgbetool.c
2238
close(fd);
usr.sbin/cxgbetool/cxgbetool.c
2273
int rc, fd;
usr.sbin/cxgbetool/cxgbetool.c
2294
fd = open(fname, O_CREAT | O_TRUNC | O_EXCL | O_WRONLY,
usr.sbin/cxgbetool/cxgbetool.c
2296
if (fd < 0) {
usr.sbin/cxgbetool/cxgbetool.c
2301
write(fd, dump.data, dump.len);
usr.sbin/cxgbetool/cxgbetool.c
2302
close(fd);
usr.sbin/cxgbetool/cxgbetool.c
3870
if ((g.fd = open(buf, O_RDWR)) < 0)
usr.sbin/cxgbetool/cxgbetool.c
67
int fd;
usr.sbin/dconschat/dconschat.c
1095
dc->fd = open(devname, O_RDWR);
usr.sbin/dconschat/dconschat.c
1096
if (dc->fd >= 0)
usr.sbin/dconschat/dconschat.c
1101
error = ioctl(dc->fd, FW_SDEUI64, &eui);
usr.sbin/dconschat/dconschat.c
136
return (pread(dc->fd, buf, n, offset));
usr.sbin/dconschat/dconschat.c
151
return (pwrite(dc->fd, buf, n, offset));
usr.sbin/dconschat/dconschat.c
607
dconschat_write_socket(int fd, char *buf, int len)
usr.sbin/dconschat/dconschat.c
609
write(fd, buf, len);
usr.sbin/dconschat/dconschat.c
91
int fd;
usr.sbin/diskinfo/diskinfo.c
150
fd = open(argv[i], (opt_w ? O_RDWR : O_RDONLY) | O_DIRECT);
usr.sbin/diskinfo/diskinfo.c
151
if (fd < 0 && errno == ENOENT && *argv[i] != '/') {
usr.sbin/diskinfo/diskinfo.c
153
fd = open(tstr, O_RDONLY);
usr.sbin/diskinfo/diskinfo.c
155
if (fd < 0) {
usr.sbin/diskinfo/diskinfo.c
159
error = fstat(fd, &sb);
usr.sbin/diskinfo/diskinfo.c
182
if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) {
usr.sbin/diskinfo/diskinfo.c
190
if (ioctl(fd, DIOCGIDENT, ident) == 0) {
usr.sbin/diskinfo/diskinfo.c
197
error = ioctl(fd, DIOCGMEDIASIZE, &mediasize);
usr.sbin/diskinfo/diskinfo.c
203
error = ioctl(fd, DIOCGSECTORSIZE, &sectorsize);
usr.sbin/diskinfo/diskinfo.c
209
error = ioctl(fd, DIOCGFWSECTORS, &fwsectors);
usr.sbin/diskinfo/diskinfo.c
212
error = ioctl(fd, DIOCGFWHEADS, &fwheads);
usr.sbin/diskinfo/diskinfo.c
215
error = ioctl(fd, DIOCGSTRIPESIZE, &stripesize);
usr.sbin/diskinfo/diskinfo.c
218
error = ioctl(fd, DIOCGSTRIPEOFFSET, &stripeoffset);
usr.sbin/diskinfo/diskinfo.c
221
error = zonecheck(fd, &zone_mode, zone_desc, sizeof(zone_desc));
usr.sbin/diskinfo/diskinfo.c
257
if (ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/diskinfo/diskinfo.c
259
if (ioctl(fd, DIOCGIDENT, ident) == 0)
usr.sbin/diskinfo/diskinfo.c
263
if (ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/diskinfo/diskinfo.c
265
if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0)
usr.sbin/diskinfo/diskinfo.c
268
candelete(fd) ? "Yes" : "No");
usr.sbin/diskinfo/diskinfo.c
269
rotationrate(fd, rrate, sizeof(rrate));
usr.sbin/diskinfo/diskinfo.c
276
commandtime(fd, mediasize, sectorsize);
usr.sbin/diskinfo/diskinfo.c
278
speeddisk(fd, mediasize, sectorsize);
usr.sbin/diskinfo/diskinfo.c
280
iopsbench(fd, mediasize, sectorsize);
usr.sbin/diskinfo/diskinfo.c
282
slogbench(fd, isreg, mediasize, sectorsize);
usr.sbin/diskinfo/diskinfo.c
284
close(fd);
usr.sbin/diskinfo/diskinfo.c
291
candelete(int fd)
usr.sbin/diskinfo/diskinfo.c
297
if (ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/diskinfo/diskinfo.c
304
rotationrate(int fd, char *rate, size_t buflen)
usr.sbin/diskinfo/diskinfo.c
312
ret = ioctl(fd, DIOCGATTR, &arg);
usr.sbin/diskinfo/diskinfo.c
324
rdsect(int fd, off_t blockno, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
328
if (lseek(fd, (off_t)blockno * sectorsize, SEEK_SET) == -1)
usr.sbin/diskinfo/diskinfo.c
330
error = read(fd, buf, sectorsize);
usr.sbin/diskinfo/diskinfo.c
338
rdmega(int fd)
usr.sbin/diskinfo/diskinfo.c
342
error = read(fd, buf, MEGATX);
usr.sbin/diskinfo/diskinfo.c
416
speeddisk(int fd, off_t mediasize, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
443
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
445
rdsect(fd, b1, sectorsize);
usr.sbin/diskinfo/diskinfo.c
455
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
457
rdsect(fd, b1, sectorsize);
usr.sbin/diskinfo/diskinfo.c
466
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
468
rdsect(fd, b1, sectorsize);
usr.sbin/diskinfo/diskinfo.c
477
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
486
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
495
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
504
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
511
rdsect(fd, 0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
514
rdmega(fd);
usr.sbin/diskinfo/diskinfo.c
520
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
523
rdmega(fd);
usr.sbin/diskinfo/diskinfo.c
529
rdsect(fd, b0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
532
rdmega(fd);
usr.sbin/diskinfo/diskinfo.c
540
commandtime(int fd, off_t mediasize, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
547
rdsect(fd, 0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
550
rdmega(fd);
usr.sbin/diskinfo/diskinfo.c
556
rdsect(fd, 0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
559
rdsect(fd, 0, sectorsize);
usr.sbin/diskinfo/diskinfo.c
571
iops(int fd, off_t mediasize, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
592
aiop->aio_fildes = fd;
usr.sbin/diskinfo/diskinfo.c
614
aiop->aio_fildes = fd;
usr.sbin/diskinfo/diskinfo.c
632
iopsbench(int fd, off_t mediasize, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
637
iops(fd, mediasize, sectorsize);
usr.sbin/diskinfo/diskinfo.c
641
iops(fd, mediasize, 4096);
usr.sbin/diskinfo/diskinfo.c
645
iops(fd, mediasize, 32 * 1024);
usr.sbin/diskinfo/diskinfo.c
648
iops(fd, mediasize, 128 * 1024);
usr.sbin/diskinfo/diskinfo.c
651
iops(fd, mediasize, 1024 * 1024);
usr.sbin/diskinfo/diskinfo.c
660
parwrite(int fd, size_t size, off_t off)
usr.sbin/diskinfo/diskinfo.c
672
aiop->aio_fildes = fd;
usr.sbin/diskinfo/diskinfo.c
680
error = pwrite(fd, &buf[o], size, off + o);
usr.sbin/diskinfo/diskinfo.c
691
slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize)
usr.sbin/diskinfo/diskinfo.c
70
static bool candelete(int fd);
usr.sbin/diskinfo/diskinfo.c
705
parwrite(fd, size, off * size);
usr.sbin/diskinfo/diskinfo.c
709
error = fsync(fd);
usr.sbin/diskinfo/diskinfo.c
71
static void speeddisk(int fd, off_t mediasize, u_int sectorsize);
usr.sbin/diskinfo/diskinfo.c
711
error = ioctl(fd, DIOCGFLUSH);
usr.sbin/diskinfo/diskinfo.c
72
static void commandtime(int fd, off_t mediasize, u_int sectorsize);
usr.sbin/diskinfo/diskinfo.c
726
zonecheck(int fd, uint32_t *zone_mode, char *zone_str, size_t zone_str_len)
usr.sbin/diskinfo/diskinfo.c
73
static void iopsbench(int fd, off_t mediasize, u_int sectorsize);
usr.sbin/diskinfo/diskinfo.c
734
error = ioctl(fd, DIOCZONECMD, &zone_args);
usr.sbin/diskinfo/diskinfo.c
74
static void rotationrate(int fd, char *buf, size_t buflen);
usr.sbin/diskinfo/diskinfo.c
75
static void slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize);
usr.sbin/diskinfo/diskinfo.c
76
static int zonecheck(int fd, uint32_t *zone_mode, char *zone_str,
usr.sbin/diskinfo/diskinfo.c
85
int i, ch, fd, error, exitval = 0;
usr.sbin/dumpcis/main.c
36
int fd;
usr.sbin/dumpcis/main.c
39
fd = open(name, O_RDONLY);
usr.sbin/dumpcis/main.c
40
if (fd < 0)
usr.sbin/dumpcis/main.c
42
tl = readcis(fd);
usr.sbin/dumpcis/main.c
49
close(fd);
usr.sbin/dumpcis/readcis.c
111
readcis(int fd)
usr.sbin/dumpcis/readcis.c
114
return (read_tuples(fd));
usr.sbin/dumpcis/readcis.c
192
read_tuples(int fd)
usr.sbin/dumpcis/readcis.c
200
last_tl = tlist = read_one_tuplelist(fd, MDF_ATTR, (off_t) 0);
usr.sbin/dumpcis/readcis.c
222
if (offs > 0 && offs < 32 * 1024 && ck_linktarget(fd, offs, flag)) {
usr.sbin/dumpcis/readcis.c
223
tl = read_one_tuplelist(fd, flag, offs);
usr.sbin/dumpcis/readcis.c
235
ck_linktarget(fd, (off_t) 0, 0)) {
usr.sbin/dumpcis/readcis.c
239
tlist->next = read_one_tuplelist(fd, 0, 0);
usr.sbin/dumpcis/readcis.c
248
read_one_tuplelist(int fd, int flags, off_t offs)
usr.sbin/dumpcis/readcis.c
263
if (ioctl(fd, PIOCRWFLAG, &flags) < 0)
usr.sbin/dumpcis/readcis.c
266
if (lseek(fd, offs, SEEK_SET) < 0)
usr.sbin/dumpcis/readcis.c
270
if (read(fd, &code, 1) != 1)
usr.sbin/dumpcis/readcis.c
280
if (read(fd, &length, 1) != 1)
usr.sbin/dumpcis/readcis.c
314
if (read(fd, tp->data, length) != length)
usr.sbin/dumpcis/readcis.c
333
ck_linktarget(int fd, off_t offs, int flag)
usr.sbin/dumpcis/readcis.c
337
if (ioctl(fd, PIOCRWFLAG, &flag) < 0)
usr.sbin/dumpcis/readcis.c
340
if (lseek(fd, offs, SEEK_SET) < 0)
usr.sbin/dumpcis/readcis.c
343
if (read(fd, blk, 5) != 5)
usr.sbin/edquota/edquota.c
465
FILE *fd;
usr.sbin/edquota/edquota.c
469
if ((fd = fdopen(dup(outfd), "w")) == NULL)
usr.sbin/edquota/edquota.c
471
fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name);
usr.sbin/edquota/edquota.c
473
fprintf(fd, "%s: in use: %s, ", qup->fsname,
usr.sbin/edquota/edquota.c
475
fprintf(fd, "limits (soft = %s, ",
usr.sbin/edquota/edquota.c
477
fprintf(fd, "hard = %s)\n",
usr.sbin/edquota/edquota.c
479
fprintf(fd, "\tinodes in use: %s, ",
usr.sbin/edquota/edquota.c
481
fprintf(fd, "limits (soft = %s, ",
usr.sbin/edquota/edquota.c
483
fprintf(fd, "hard = %s)\n",
usr.sbin/edquota/edquota.c
486
fclose(fd);
usr.sbin/edquota/edquota.c
525
FILE *fd;
usr.sbin/edquota/edquota.c
533
fd = fopen(inname, "r");
usr.sbin/edquota/edquota.c
534
if (fd == NULL) {
usr.sbin/edquota/edquota.c
541
(void) fgets(line1, sizeof (line1), fd);
usr.sbin/edquota/edquota.c
542
while (fgets(line1, sizeof (line1), fd) != NULL &&
usr.sbin/edquota/edquota.c
543
fgets(line2, sizeof (line2), fd) != NULL) {
usr.sbin/edquota/edquota.c
655
fclose(fd);
usr.sbin/edquota/edquota.c
679
FILE *fd;
usr.sbin/edquota/edquota.c
683
if ((fd = fdopen(dup(outfd), "w")) == NULL)
usr.sbin/edquota/edquota.c
685
fprintf(fd, "Time units may be: days, hours, minutes, or seconds\n");
usr.sbin/edquota/edquota.c
686
fprintf(fd, "Grace period before enforcing soft limits for %ss:\n",
usr.sbin/edquota/edquota.c
689
fprintf(fd, "%s: block grace period: %s, ",
usr.sbin/edquota/edquota.c
691
fprintf(fd, "file grace period: %s\n",
usr.sbin/edquota/edquota.c
694
fclose(fd);
usr.sbin/edquota/edquota.c
705
FILE *fd;
usr.sbin/edquota/edquota.c
711
fd = fopen(inname, "r");
usr.sbin/edquota/edquota.c
712
if (fd == NULL) {
usr.sbin/edquota/edquota.c
719
(void) fgets(line1, sizeof (line1), fd);
usr.sbin/edquota/edquota.c
720
(void) fgets(line1, sizeof (line1), fd);
usr.sbin/edquota/edquota.c
721
while (fgets(line1, sizeof (line1), fd) != NULL) {
usr.sbin/edquota/edquota.c
750
fclose(fd);
usr.sbin/efidp/efidp.c
61
read_file(int fd, void **rv)
usr.sbin/efidp/efidp.c
72
red = read(fd, retval + off, len - off);
usr.sbin/efivar/efivar.c
230
int fd;
usr.sbin/efivar/efivar.c
232
fd = open(fromfile, O_RDONLY);
usr.sbin/efivar/efivar.c
233
if (fd < 0)
usr.sbin/efivar/efivar.c
238
datalen = read(fd, data, 64 * 1024);
usr.sbin/efivar/efivar.c
243
close(fd);
usr.sbin/extattrctl/extattrctl.c
159
int i, fd;
usr.sbin/extattrctl/extattrctl.c
164
fd = open(argv[0], O_RDONLY);
usr.sbin/extattrctl/extattrctl.c
165
if (fd == -1) {
usr.sbin/extattrctl/extattrctl.c
170
i = read(fd, &uef, sizeof(uef));
usr.sbin/extattrctl/extattrctl.c
173
close(fd);
usr.sbin/extattrctl/extattrctl.c
178
close(fd);
usr.sbin/extattrctl/extattrctl.c
184
close(fd);
usr.sbin/extattrctl/extattrctl.c
191
close(fd);
usr.sbin/fdcontrol/fdcontrol.c
120
if((fd = open(argv[0], O_RDONLY | O_NONBLOCK)) < 0)
usr.sbin/fdcontrol/fdcontrol.c
123
if (ioctl(fd, FD_GDTYPE, &type) == -1)
usr.sbin/fdcontrol/fdcontrol.c
125
if (ioctl(fd, FD_GTYPE, &ft) == -1)
usr.sbin/fdcontrol/fdcontrol.c
204
if (ioctl(fd, FD_STYPE, &ft) == -1)
usr.sbin/fdcontrol/fdcontrol.c
75
int fd, i, autofmt;
usr.sbin/fdformat/fdformat.c
100
if (lseek (fd, (long) track * tracksize, 0) < 0)
usr.sbin/fdformat/fdformat.c
103
else if (read (fd, buf, tracksize) != tracksize
usr.sbin/fdformat/fdformat.c
104
&& read (fd, buf, tracksize) != tracksize)
usr.sbin/fdformat/fdformat.c
107
(void)ioctl(fd, FD_SOPTS, &ofdopts);
usr.sbin/fdformat/fdformat.c
147
int fd, c, i, track, error, tracks_per_dot, bytes_per_track, errs;
usr.sbin/fdformat/fdformat.c
220
if ((fd = open(device, O_RDWR | O_NONBLOCK)) < 0)
usr.sbin/fdformat/fdformat.c
248
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
usr.sbin/fdformat/fdformat.c
250
if (ioctl(fd, FD_GDTYPE, &type) == -1)
usr.sbin/fdformat/fdformat.c
265
if (ioctl(fd, FD_STYPE, &fdt) < 0)
usr.sbin/fdformat/fdformat.c
267
if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
usr.sbin/fdformat/fdformat.c
270
if (fcntl(fd, F_SETFL, flags) == -1)
usr.sbin/fdformat/fdformat.c
309
format_track(fd, track / fdt.heads, fdt.sectrac,
usr.sbin/fdformat/fdformat.c
319
if (verify_track(fd, track, bytes_per_track) < 0) {
usr.sbin/fdformat/fdformat.c
322
if (ioctl(fd, FD_GSTAT, fdcs + errs) ==
usr.sbin/fdformat/fdformat.c
48
format_track(int fd, int cyl, int secs, int head, int rate,
usr.sbin/fdformat/fdformat.c
78
(void)ioctl(fd, FD_FORM, (caddr_t)&f);
usr.sbin/fdformat/fdformat.c
82
verify_track(int fd, int track, int tracksize)
usr.sbin/fdformat/fdformat.c
88
if (ioctl(fd, FD_GOPTS, &fdopts) < 0)
usr.sbin/fdformat/fdformat.c
93
(void)ioctl(fd, FD_SOPTS, &fdopts);
usr.sbin/fdread/fdread.c
152
if ((fd = open(_devname, O_RDONLY)) == -1)
usr.sbin/fdread/fdread.c
155
return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname));
usr.sbin/fdread/fdread.c
159
doread(int fd, FILE *of, const char *_devname)
usr.sbin/fdread/fdread.c
167
if (ioctl(fd, FD_GTYPE, &fdt) == -1)
usr.sbin/fdread/fdread.c
181
if (lseek(fd, nbytes, SEEK_SET) != nbytes)
usr.sbin/fdread/fdread.c
183
rv = read(fd, trackbuf, tracksize);
usr.sbin/fdread/fdread.c
201
if (lseek(fd, nbytes, SEEK_SET) != nbytes)
usr.sbin/fdread/fdread.c
203
rv = read(fd, trackbuf, secsize);
usr.sbin/fdread/fdread.c
222
if (ioctl(fd, FD_GSTAT, &fdcs) == -1)
usr.sbin/fdread/fdread.c
244
if (ioctl(fd, FD_SOPTS,
usr.sbin/fdread/fdread.c
248
rv = read(fd, trackbuf,
usr.sbin/fdread/fdread.c
254
(void)ioctl(fd, FD_SOPTS,
usr.sbin/fdread/fdread.c
303
doreadid(int fd, unsigned int numids, unsigned int trackno)
usr.sbin/fdread/fdread.c
311
if (ioctl(fd, FD_GTYPE, &fdt) == -1)
usr.sbin/fdread/fdread.c
317
if (ioctl(fd, FD_READID, &info) == 0) {
usr.sbin/fdread/fdread.c
325
if (ioctl(fd, FD_GSTAT, &fdcs) == -1)
usr.sbin/fdread/fdread.c
50
static int doread(int fd, FILE *of, const char *_devname);
usr.sbin/fdread/fdread.c
51
static int doreadid(int fd, unsigned int numids, unsigned int trackno);
usr.sbin/fdread/fdread.c
72
int fd;
usr.sbin/fdwrite/fdwrite.c
127
if((fd = open(device, O_RDWR)) < 0)
usr.sbin/fdwrite/fdwrite.c
130
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
usr.sbin/fdwrite/fdwrite.c
163
format_track(fd, track / fdt.heads, fdt.sectrac, track % fdt.heads,
usr.sbin/fdwrite/fdwrite.c
168
if (lseek (fd, (long) track*bpt, 0) < 0) err(1, "lseek");
usr.sbin/fdwrite/fdwrite.c
169
if (write (fd, trackbuf, bpt) != bpt) err(1, "write");
usr.sbin/fdwrite/fdwrite.c
172
if (lseek (fd, (long) track*bpt, 0) < 0) err(1, "lseek");
usr.sbin/fdwrite/fdwrite.c
173
if (read (fd, vrfybuf, bpt) != bpt) err(1, "read");
usr.sbin/fdwrite/fdwrite.c
189
close(fd);
usr.sbin/fdwrite/fdwrite.c
24
format_track(int fd, int cyl, int secs, int head, int rate,
usr.sbin/fdwrite/fdwrite.c
53
return ioctl(fd, FD_FORM, (caddr_t)&f);
usr.sbin/fdwrite/fdwrite.c
66
int inputfd = -1, c, fdn = 0, i,j,fd;
usr.sbin/fifolog/fifolog_writer/fifolog_writer.c
97
pfd[0].fd = 0;
usr.sbin/fifolog/lib/fifolog_create.c
108
if (recsize != pwrite(fd, buf, recsize, 0)) {
usr.sbin/fifolog/lib/fifolog_create.c
115
if ((int)recsize != pwrite(fd, buf, recsize, recsize)) {
usr.sbin/fifolog/lib/fifolog_create.c
122
assert(0 == close(fd));
usr.sbin/fifolog/lib/fifolog_create.c
46
int i, fd;
usr.sbin/fifolog/lib/fifolog_create.c
54
fd = open(fn, O_WRONLY | O_TRUNC | O_EXCL | O_CREAT, 0644);
usr.sbin/fifolog/lib/fifolog_create.c
55
if (fd < 0) {
usr.sbin/fifolog/lib/fifolog_create.c
57
fd = open(fn, O_WRONLY);
usr.sbin/fifolog/lib/fifolog_create.c
58
if (fd < 0)
usr.sbin/fifolog/lib/fifolog_create.c
68
i = fstat(fd, &st);
usr.sbin/fifolog/lib/fifolog_create.c
73
assert(!close (fd));
usr.sbin/fifolog/lib/fifolog_create.c
78
assert(!close (fd));
usr.sbin/fifolog/lib/fifolog_create.c
83
i = ioctl(fd, DIOCGSECTORSIZE, &uu);
usr.sbin/fifolog/lib/fifolog_create.c
89
i = ioctl(fd, DIOCGMEDIASIZE, &ms);
usr.sbin/fifolog/lib/fifolog_create.c
99
if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0)
usr.sbin/fifolog/lib/fifolog_int.c
144
f->fd = -1;
usr.sbin/fifolog/lib/fifolog_int.c
170
if (f->fd >= 0)
usr.sbin/fifolog/lib/fifolog_int.c
171
(void)close(f->fd);
usr.sbin/fifolog/lib/fifolog_int.c
183
assert(ff->fd >= 0);
usr.sbin/fifolog/lib/fifolog_int.c
203
i = pread(ff->fd, ff->recbuf, ff->recsize, recno * ff->recsize);
usr.sbin/fifolog/lib/fifolog_int.c
62
f->fd = open(fname, mode ? O_RDWR : O_RDONLY);
usr.sbin/fifolog/lib/fifolog_int.c
63
if (f->fd < 0)
usr.sbin/fifolog/lib/fifolog_int.c
67
i = ioctl(f->fd, DIOCGSECTORSIZE, &f->recsize);
usr.sbin/fifolog/lib/fifolog_int.c
72
i = fstat(f->fd, &st);
usr.sbin/fifolog/lib/fifolog_int.c
81
i = ioctl(f->fd, DIOCGMEDIASIZE, &f->logsize);
usr.sbin/fifolog/lib/fifolog_int.c
92
i = pread(f->fd, f->recbuf, f->recsize, 0);
usr.sbin/fifolog/lib/fifolog_write_poll.c
223
i = pwrite(f->ff->fd, f->obuf, f->ff->recsize,
usr.sbin/fifolog/lib/libfifolog_int.h
35
int fd;
usr.sbin/fstyp/fstyp.c
180
int error, fd;
usr.sbin/fstyp/fstyp.c
184
fd = fileno(fp);
usr.sbin/fstyp/fstyp.c
186
error = fstat(fd, &sb);
usr.sbin/fstyp/fstyp.c
193
error = ioctl(fd, DIOCGMEDIASIZE, &mediasize);
usr.sbin/fwcamctl/fwcamctl.c
155
do_snap(int fd, const char *outpath, int skip)
usr.sbin/fwcamctl/fwcamctl.c
164
if (ioctl(fd, FWCAM_GINFO, &info) < 0)
usr.sbin/fwcamctl/fwcamctl.c
191
n = read(fd, frame_buf, info.frame_size);
usr.sbin/fwcamctl/fwcamctl.c
235
do_info(int fd)
usr.sbin/fwcamctl/fwcamctl.c
240
if (ioctl(fd, FWCAM_GINFO, &info) < 0)
usr.sbin/fwcamctl/fwcamctl.c
302
do_mode(int fd, int argc, char **argv)
usr.sbin/fwcamctl/fwcamctl.c
315
if (ioctl(fd, FWCAM_SMODE, &mode) < 0)
usr.sbin/fwcamctl/fwcamctl.c
323
do_feat_get(int fd, int feat_id)
usr.sbin/fwcamctl/fwcamctl.c
333
if (ioctl(fd, FWCAM_GFEAT, &feat) < 0)
usr.sbin/fwcamctl/fwcamctl.c
354
do_feat_set(int fd, int feat_id, uint32_t value, uint32_t value2)
usr.sbin/fwcamctl/fwcamctl.c
366
if (ioctl(fd, FWCAM_SFEAT, &feat) < 0)
usr.sbin/fwcamctl/fwcamctl.c
377
int fd, ch;
usr.sbin/fwcamctl/fwcamctl.c
394
fd = open(devpath, O_RDWR);
usr.sbin/fwcamctl/fwcamctl.c
395
if (fd < 0)
usr.sbin/fwcamctl/fwcamctl.c
399
do_info(fd);
usr.sbin/fwcamctl/fwcamctl.c
420
do_snap(fd, out, skip);
usr.sbin/fwcamctl/fwcamctl.c
423
do_mode(fd, argc - 1, argv + 1);
usr.sbin/fwcamctl/fwcamctl.c
432
do_feat_get(fd, feat_id);
usr.sbin/fwcamctl/fwcamctl.c
438
do_feat_set(fd, feat_id, val, val2);
usr.sbin/fwcamctl/fwcamctl.c
448
close(fd);
usr.sbin/fwcontrol/fwcontrol.c
1004
set_pri_req(fd, priority_budget);
usr.sbin/fwcontrol/fwcontrol.c
1010
send_phy_config(fd, set_root_node, -1);
usr.sbin/fwcontrol/fwcontrol.c
1016
send_phy_config(fd, -1, set_gap_count);
usr.sbin/fwcontrol/fwcontrol.c
1045
link_on(fd, send_link_on);
usr.sbin/fwcontrol/fwcontrol.c
1051
reset_start(fd, send_reset_start);
usr.sbin/fwcontrol/fwcontrol.c
1057
show_topology_map(fd);
usr.sbin/fwcontrol/fwcontrol.c
1066
recvfn = detect_recv_fn(fd, TAG | CHANNEL);
usr.sbin/fwcontrol/fwcontrol.c
1067
close(fd);
usr.sbin/fwcontrol/fwcontrol.c
1068
fd = -1;
usr.sbin/fwcontrol/fwcontrol.c
1071
if (open_dev(&fd, devbase) < 0)
usr.sbin/fwcontrol/fwcontrol.c
1073
(*recvfn)(fd, recv_data, TAG | CHANNEL, -1);
usr.sbin/fwcontrol/fwcontrol.c
1081
dvsend(fd, send_data, TAG | CHANNEL, -1);
usr.sbin/fwcontrol/fwcontrol.c
1085
if (fd > 0) {
usr.sbin/fwcontrol/fwcontrol.c
1086
close(fd);
usr.sbin/fwcontrol/fwcontrol.c
1087
fd = -1;
usr.sbin/fwcontrol/fwcontrol.c
114
get_dev(int fd, struct fw_devlstreq *data)
usr.sbin/fwcontrol/fwcontrol.c
118
if( ioctl(fd, FW_GDEVLST, data) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
124
str2node(int fd, const char *nodestr)
usr.sbin/fwcontrol/fwcontrol.c
150
get_dev(fd,data);
usr.sbin/fwcontrol/fwcontrol.c
174
list_dev(int fd)
usr.sbin/fwcontrol/fwcontrol.c
185
get_dev(fd, data);
usr.sbin/fwcontrol/fwcontrol.c
205
read_write_quad(int fd, struct fw_eui64 eui, u_int32_t addr_lo, int readmode, u_int32_t data)
usr.sbin/fwcontrol/fwcontrol.c
234
if (ioctl(fd, FW_ASYREQ, asyreq) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
261
send_phy_config(int fd, int root_node, int gap_count)
usr.sbin/fwcontrol/fwcontrol.c
282
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwcontrol/fwcontrol.c
288
link_on(int fd, int node)
usr.sbin/fwcontrol/fwcontrol.c
301
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwcontrol/fwcontrol.c
307
reset_start(int fd, int node)
usr.sbin/fwcontrol/fwcontrol.c
325
if (ioctl(fd, FW_ASYREQ, asyreq) < 0)
usr.sbin/fwcontrol/fwcontrol.c
331
set_pri_req(int fd, u_int32_t pri_req)
usr.sbin/fwcontrol/fwcontrol.c
343
get_dev(fd, data);
usr.sbin/fwcontrol/fwcontrol.c
349
reg = read_write_quad(fd, devinfo->eui, BUGET_REG, 1, 0);
usr.sbin/fwcontrol/fwcontrol.c
360
read_write_quad(fd, devinfo->eui, BUGET_REG, 0, pri_req);
usr.sbin/fwcontrol/fwcontrol.c
391
get_crom(int fd, int node, void *crom_buf, int len)
usr.sbin/fwcontrol/fwcontrol.c
400
get_dev(fd, data);
usr.sbin/fwcontrol/fwcontrol.c
415
if ((error = ioctl(fd, FW_GCROM, &buf)) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
515
show_topology_map(int fd)
usr.sbin/fwcontrol/fwcontrol.c
527
if (ioctl(fd, FW_GTPMAP, tmap) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
560
read_phy_registers(int fd, u_int8_t *buf, int offset, int len)
usr.sbin/fwcontrol/fwcontrol.c
567
if (ioctl(fd, FWOHCI_RDPHYREG, &reg) < 0)
usr.sbin/fwcontrol/fwcontrol.c
576
read_phy_page(int fd, u_int8_t *buf, int page, int port)
usr.sbin/fwcontrol/fwcontrol.c
582
if (ioctl(fd, FWOHCI_WRPHYREG, &reg) < 0)
usr.sbin/fwcontrol/fwcontrol.c
584
read_phy_registers(fd, buf, 8, 8);
usr.sbin/fwcontrol/fwcontrol.c
588
dump_phy_registers(int fd)
usr.sbin/fwcontrol/fwcontrol.c
596
read_phy_registers(fd, (u_int8_t *)&b, 0, 8);
usr.sbin/fwcontrol/fwcontrol.c
618
read_phy_page(fd, (u_int8_t *)&p, 0, i);
usr.sbin/fwcontrol/fwcontrol.c
635
read_phy_page(fd, (u_int8_t *)&v, 1, 0);
usr.sbin/fwcontrol/fwcontrol.c
647
open_dev(int *fd, char *devname)
usr.sbin/fwcontrol/fwcontrol.c
649
if (*fd < 0) {
usr.sbin/fwcontrol/fwcontrol.c
650
*fd = open(devname, O_RDWR);
usr.sbin/fwcontrol/fwcontrol.c
651
if (*fd < 0)
usr.sbin/fwcontrol/fwcontrol.c
666
detect_recv_fn(int fd, char ich)
usr.sbin/fwcontrol/fwcontrol.c
685
if (ioctl(fd, FW_SSTBUF, &bufreq) < 0)
usr.sbin/fwcontrol/fwcontrol.c
691
if (ioctl(fd, FW_SRSTREAM, &isoreq) < 0)
usr.sbin/fwcontrol/fwcontrol.c
706
len = read(fd, buf, RECV_NUM_PACKET * RECV_PACKET_SZ);
usr.sbin/fwcontrol/fwcontrol.c
736
int fd = -1, ch, len=1024;
usr.sbin/fwcontrol/fwcontrol.c
775
if (open_dev(&fd, devbase) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
783
list_dev(fd);
usr.sbin/fwcontrol/fwcontrol.c
784
close(fd);
usr.sbin/fwcontrol/fwcontrol.c
785
fd = -1;
usr.sbin/fwcontrol/fwcontrol.c
856
send_link_on = str2node(fd, optarg);
usr.sbin/fwcontrol/fwcontrol.c
876
send_reset_start = str2node(fd, optarg);
usr.sbin/fwcontrol/fwcontrol.c
958
if (open_dev(&fd, devbase) < 0) {
usr.sbin/fwcontrol/fwcontrol.c
967
list_dev(fd);
usr.sbin/fwcontrol/fwcontrol.c
973
dump_phy_registers(fd);
usr.sbin/fwcontrol/fwcontrol.c
979
if(ioctl(fd, FW_IBUSRST, &tmp) < 0)
usr.sbin/fwcontrol/fwcontrol.c
986
tmp = str2node(fd, crom_string);
usr.sbin/fwcontrol/fwcontrol.c
987
get_crom(fd, tmp, crom_buf, len);
usr.sbin/fwcontrol/fwcontrol.c
995
tmp = str2node(fd, crom_string_hex);
usr.sbin/fwcontrol/fwcontrol.c
996
get_crom(fd, tmp, crom_buf_hex, len);
usr.sbin/fwcontrol/fwdv.c
100
int len, tlen, npad, fd, k, m, vec, system = -1, nb;
usr.sbin/fwcontrol/fwdv.c
105
fd = STDOUT_FILENO;
usr.sbin/fwcontrol/fwdv.c
107
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/fwcontrol/fwdv.c
108
if (fd == -1)
usr.sbin/fwcontrol/fwdv.c
219
writev(fd, wbuf, vec);
usr.sbin/fwcontrol/fwdv.c
234
writev(fd, wbuf, vec);
usr.sbin/fwcontrol/fwdv.c
243
writev(fd, wbuf, vec);
usr.sbin/fwcontrol/fwdv.c
245
if (fd != STDOUT_FILENO)
usr.sbin/fwcontrol/fwdv.c
246
close(fd);
usr.sbin/fwcontrol/fwdv.c
258
int len, tlen, header, fd, frames, packets, vec, offset, nhdr, i;
usr.sbin/fwcontrol/fwdv.c
267
fd = open(filename, O_RDONLY);
usr.sbin/fwcontrol/fwdv.c
268
if (fd == -1)
usr.sbin/fwcontrol/fwdv.c
322
len = read(fd, pbuf + tlen, DSIZE * TNBUF - tlen);
usr.sbin/fwcontrol/fwdv.c
414
close(fd);
usr.sbin/fwcontrol/fwmpegts.c
157
int fd, k, len, m, pkt_size, startwr, tlen;
usr.sbin/fwcontrol/fwmpegts.c
163
fd = STDOUT_FILENO;
usr.sbin/fwcontrol/fwmpegts.c
165
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
usr.sbin/fwcontrol/fwmpegts.c
166
if (fd == -1)
usr.sbin/fwcontrol/fwmpegts.c
252
write(fd, pld->payload,
usr.sbin/fwcontrol/fwmpegts.c
268
if (fd != STDOUT_FILENO)
usr.sbin/fwcontrol/fwmpegts.c
269
close(fd);
usr.sbin/i2c/i2c.c
101
i = ioctl(fd, I2CSTART, cmd);
usr.sbin/i2c/i2c.c
109
i2c_do_repeatstart(int fd, struct iiccmd *cmd)
usr.sbin/i2c/i2c.c
113
i = ioctl(fd, I2CRPTSTART, cmd);
usr.sbin/i2c/i2c.c
121
i2c_do_write(int fd, struct iiccmd *cmd)
usr.sbin/i2c/i2c.c
125
i = ioctl(fd, I2CWRITE, cmd);
usr.sbin/i2c/i2c.c
133
i2c_do_read(int fd, struct iiccmd *cmd)
usr.sbin/i2c/i2c.c
137
i = ioctl(fd, I2CREAD, cmd);
usr.sbin/i2c/i2c.c
145
i2c_do_reset(int fd)
usr.sbin/i2c/i2c.c
151
i = ioctl(fd, I2CRSTCARD, &cmd);
usr.sbin/i2c/i2c.c
208
scan_bus(const char *dev, int fd, const char *skip, int verbose)
usr.sbin/i2c/i2c.c
233
if (i2c_do_reset(fd))
usr.sbin/i2c/i2c.c
243
error = ioctl(fd, I2CRDWR, &rdwrdata);
usr.sbin/i2c/i2c.c
245
error = ioctl(fd, I2CSTART, &cmd);
usr.sbin/i2c/i2c.c
248
(void)ioctl(fd, I2CSTOP);
usr.sbin/i2c/i2c.c
272
return (i2c_do_reset(fd));
usr.sbin/i2c/i2c.c
276
reset_bus(const char *dev, int fd, int verbose)
usr.sbin/i2c/i2c.c
281
return (i2c_do_reset(fd));
usr.sbin/i2c/i2c.c
315
write_offset(int fd, struct options i2c_opt, struct iiccmd *cmd)
usr.sbin/i2c/i2c.c
321
return (i2c_do_write(fd, cmd));
usr.sbin/i2c/i2c.c
327
i2c_write(int fd, struct options i2c_opt, uint8_t *i2c_buf)
usr.sbin/i2c/i2c.c
335
if (i2c_do_start(fd, &cmd))
usr.sbin/i2c/i2c.c
336
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
340
if (write_offset(fd, i2c_opt, &cmd))
usr.sbin/i2c/i2c.c
341
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
343
if (i2c_do_stop(fd))
usr.sbin/i2c/i2c.c
346
if (i2c_do_start(fd, &cmd))
usr.sbin/i2c/i2c.c
347
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
355
if (i2c_do_write(fd, &cmd))
usr.sbin/i2c/i2c.c
356
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
360
if (write_offset(fd, i2c_opt, &cmd))
usr.sbin/i2c/i2c.c
361
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
363
if (i2c_do_repeatstart(fd, &cmd))
usr.sbin/i2c/i2c.c
364
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
372
if (i2c_do_write(fd, &cmd))
usr.sbin/i2c/i2c.c
373
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
386
if (i2c_do_write(fd, &cmd))
usr.sbin/i2c/i2c.c
387
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
391
return (i2c_do_stop(fd));
usr.sbin/i2c/i2c.c
395
i2c_read(int fd, struct options i2c_opt, uint8_t *i2c_buf)
usr.sbin/i2c/i2c.c
407
if (i2c_do_start(fd, &cmd))
usr.sbin/i2c/i2c.c
408
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
410
if (write_offset(fd, i2c_opt, &cmd))
usr.sbin/i2c/i2c.c
411
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
413
if (i2c_opt.mode == I2C_MODE_STOP_START && i2c_do_stop(fd))
usr.sbin/i2c/i2c.c
421
if (i2c_do_start(fd, &cmd))
usr.sbin/i2c/i2c.c
422
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
424
if (i2c_do_repeatstart(fd, &cmd))
usr.sbin/i2c/i2c.c
425
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
431
if (i2c_do_read(fd, &cmd))
usr.sbin/i2c/i2c.c
432
return (i2c_do_stop(fd) | 1);
usr.sbin/i2c/i2c.c
434
return (i2c_do_stop(fd));
usr.sbin/i2c/i2c.c
449
i2c_rdwr_transfer(int fd, struct options i2c_opt, uint8_t *i2c_buf)
usr.sbin/i2c/i2c.c
483
if (ioctl(fd, I2CRDWR, &xfer) == -1 )
usr.sbin/i2c/i2c.c
490
access_bus(int fd, struct options i2c_opt)
usr.sbin/i2c/i2c.c
508
error = i2c_rdwr_transfer(fd, i2c_opt, i2c_buf);
usr.sbin/i2c/i2c.c
510
error = i2c_write(fd, i2c_opt, i2c_buf);
usr.sbin/i2c/i2c.c
512
error = i2c_read(fd, i2c_opt, i2c_buf);
usr.sbin/i2c/i2c.c
547
int error, fd;
usr.sbin/i2c/i2c.c
667
fd = fd_cache[bus];
usr.sbin/i2c/i2c.c
668
if (fd < 0) {
usr.sbin/i2c/i2c.c
670
fd = open(devbuf, O_RDWR);
usr.sbin/i2c/i2c.c
671
if (fd == -1) {
usr.sbin/i2c/i2c.c
676
fd_cache[bus] = fd;
usr.sbin/i2c/i2c.c
679
error = i2c_rdwr_transfer(fd, i2c_opt, dbuf);
usr.sbin/i2c/i2c.c
744
int fd, error = 0, ch;
usr.sbin/i2c/i2c.c
85
i2c_do_stop(int fd)
usr.sbin/i2c/i2c.c
879
fd = open(dev, O_RDWR);
usr.sbin/i2c/i2c.c
880
if (fd == -1) {
usr.sbin/i2c/i2c.c
89
i = ioctl(fd, I2CSTOP);
usr.sbin/i2c/i2c.c
893
error = access_bus(fd, i2c_opt);
usr.sbin/i2c/i2c.c
896
error = scan_bus(dev, fd, i2c_opt.skip, i2c_opt.verbose);
usr.sbin/i2c/i2c.c
899
error = reset_bus(dev, fd, i2c_opt.verbose);
usr.sbin/i2c/i2c.c
905
ch = close(fd);
usr.sbin/i2c/i2c.c
97
i2c_do_start(int fd, struct iiccmd *cmd)
usr.sbin/inetd/builtins.c
745
#define strwrite(fd, buf) (void) write(fd, buf, sizeof(buf)-1)
usr.sbin/inetd/builtins.c
748
get_line(int fd, char *buf, int len)
usr.sbin/inetd/builtins.c
759
n = read(fd, buf, len-count);
usr.sbin/inetd/inetd.c
1256
#define turnon(fd, opt) \
usr.sbin/inetd/inetd.c
1257
setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on))
usr.sbin/inetd/inetd.c
2059
nextline(FILE *fd)
usr.sbin/inetd/inetd.c
2063
if (fgets(line, sizeof (line), fd) == NULL)
usr.sbin/iovctl/iovctl.c
110
error = ioctl(fd, IOV_CONFIG, &arg);
usr.sbin/iovctl/iovctl.c
122
int fd;
usr.sbin/iovctl/iovctl.c
144
fd = open(dev, O_RDWR);
usr.sbin/iovctl/iovctl.c
145
if (fd < 0)
usr.sbin/iovctl/iovctl.c
149
return (fd);
usr.sbin/iovctl/iovctl.c
276
int fd;
usr.sbin/iovctl/iovctl.c
279
fd = open(dev, O_RDWR);
usr.sbin/iovctl/iovctl.c
280
if (fd < 0)
usr.sbin/iovctl/iovctl.c
283
schema = get_schema(fd);
usr.sbin/iovctl/iovctl.c
288
config_iov(fd, dev, config, dryrun);
usr.sbin/iovctl/iovctl.c
293
close(fd);
usr.sbin/iovctl/iovctl.c
299
int fd, error;
usr.sbin/iovctl/iovctl.c
301
fd = open_device(dev_name);
usr.sbin/iovctl/iovctl.c
307
error = ioctl(fd, IOV_DELETE);
usr.sbin/iovctl/iovctl.c
312
close(fd);
usr.sbin/iovctl/iovctl.c
387
int fd;
usr.sbin/iovctl/iovctl.c
389
fd = open_device(dev_name);
usr.sbin/iovctl/iovctl.c
390
schema = get_schema(fd);
usr.sbin/iovctl/iovctl.c
409
close(fd);
usr.sbin/iovctl/iovctl.c
53
get_schema(int fd)
usr.sbin/iovctl/iovctl.c
63
error = ioctl(fd, IOV_GET_SCHEMA, &arg);
usr.sbin/iovctl/iovctl.c
73
error = ioctl(fd, IOV_GET_SCHEMA, &arg);
usr.sbin/iovctl/iovctl.c
92
config_iov(int fd, const char *dev_name, const nvlist_t *config, int dryrun)
usr.sbin/ipfwpcap/ipfwpcap.c
106
if (write(fd, numbuf, strlen(numbuf)) < 0) {
usr.sbin/ipfwpcap/ipfwpcap.c
110
(void) close(fd);
usr.sbin/ipfwpcap/ipfwpcap.c
82
int fd;
usr.sbin/ipfwpcap/ipfwpcap.c
93
fd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0644);
usr.sbin/ipfwpcap/ipfwpcap.c
94
if (fd < 0) {
usr.sbin/kbdcontrol/kbdcontrol.c
1148
int fd;
usr.sbin/kbdcontrol/kbdcontrol.c
1150
fd = open(device, O_RDONLY);
usr.sbin/kbdcontrol/kbdcontrol.c
1151
if (fd < 0) {
usr.sbin/kbdcontrol/kbdcontrol.c
1155
if (ioctl(fd, KDGKBINFO, &info) == -1) {
usr.sbin/kbdcontrol/kbdcontrol.c
1157
close(fd);
usr.sbin/kbdcontrol/kbdcontrol.c
1165
ioctl(fd, CONS_RELKBD, 0);
usr.sbin/kbdcontrol/kbdcontrol.c
1166
close(fd);
usr.sbin/kldxref/kldxref.c
720
int fd;
usr.sbin/kldxref/kldxref.c
728
fd = mkstemp(dest);
usr.sbin/kldxref/kldxref.c
729
if (fd < 0)
usr.sbin/kldxref/kldxref.c
731
fchmod(fd, 0644); /* nothing secret in the file */
usr.sbin/kldxref/kldxref.c
732
return (fdopen(fd, "w+"));
usr.sbin/lpr/common_source/common.c
332
int chres, errsav, fd, res, statres;
usr.sbin/lpr/common_source/common.c
423
fd = open(lfname, O_WRONLY|O_CREAT, newbits);
usr.sbin/lpr/common_source/common.c
428
if (fd >= 0) {
usr.sbin/lpr/common_source/common.c
430
close(fd);
usr.sbin/lpr/common_source/displayq.c
131
fd = open(pp->status_file, O_RDONLY|O_SHLOCK);
usr.sbin/lpr/common_source/displayq.c
133
if (fd >= 0) {
usr.sbin/lpr/common_source/displayq.c
134
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
136
(void) close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
188
fd = open(pp->status_file, O_RDONLY|O_SHLOCK);
usr.sbin/lpr/common_source/displayq.c
190
if (fd >= 0) {
usr.sbin/lpr/common_source/displayq.c
191
while ((i = read(fd, line,
usr.sbin/lpr/common_source/displayq.c
194
close(fd); /* unlocks as well */
usr.sbin/lpr/common_source/displayq.c
241
fd = getport(pp, pp->remote_host, 0);
usr.sbin/lpr/common_source/displayq.c
244
if (fd < 0) {
usr.sbin/lpr/common_source/displayq.c
251
if (write(fd, line, i) != i)
usr.sbin/lpr/common_source/displayq.c
253
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/common_source/displayq.c
256
(void) close(fd);
usr.sbin/lpr/common_source/displayq.c
95
register int i, nitems, fd, ret;
usr.sbin/lpr/lpc/cmds.c
1054
register int fd, i;
usr.sbin/lpr/lpc/cmds.c
1088
fd = open(file, O_RDONLY);
usr.sbin/lpr/lpc/cmds.c
1089
if (fd < 0 || flock(fd, LOCK_SH|LOCK_NB) == 0) {
usr.sbin/lpr/lpc/cmds.c
1090
(void) close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
1094
(void) close(fd);
usr.sbin/lpr/lpc/cmds.c
1097
fd = open(file, O_RDONLY|O_SHLOCK);
usr.sbin/lpr/lpc/cmds.c
1098
if (fd >= 0) {
usr.sbin/lpr/lpc/cmds.c
1099
(void) fstat(fd, &stbuf);
usr.sbin/lpr/lpc/cmds.c
1102
while ((i = read(fd, line, sizeof(line))) > 0)
usr.sbin/lpr/lpc/cmds.c
1105
(void) close(fd); /* unlocks as well */
usr.sbin/lpr/lpc/cmds.c
363
int fd;
usr.sbin/lpr/lpc/cmds.c
369
fd = open(statfile, O_WRONLY|O_CREAT|O_EXLOCK, STAT_FILE_MODE);
usr.sbin/lpr/lpc/cmds.c
371
if (fd < 0) {
usr.sbin/lpr/lpc/cmds.c
375
(void) ftruncate(fd, 0);
usr.sbin/lpr/lpc/cmds.c
377
(void) write(fd, "\n", 1);
usr.sbin/lpr/lpc/cmds.c
379
(void) write(fd, msg, strlen(msg));
usr.sbin/lpr/lpc/cmds.c
380
(void) close(fd);
usr.sbin/lpr/lpd/printjob.c
1987
int fd;
usr.sbin/lpr/lpd/printjob.c
1990
fd = open(pp->status_file, O_WRONLY | O_CREAT | O_EXLOCK,
usr.sbin/lpr/lpd/printjob.c
1992
if (fd < 0) {
usr.sbin/lpr/lpd/printjob.c
1997
ftruncate(fd, 0);
usr.sbin/lpr/lpd/printjob.c
2001
writel(fd, buf, "\n", NULL);
usr.sbin/lpr/lpd/printjob.c
2002
close(fd);
usr.sbin/lpr/lpd/recvjob.c
314
int err, f0, fd, j;
usr.sbin/lpr/lpd/recvjob.c
316
fd = open(file, O_CREAT|O_EXCL|O_WRONLY, FILMOD);
usr.sbin/lpr/lpd/recvjob.c
317
if (fd < 0) {
usr.sbin/lpr/lpd/recvjob.c
341
wlen = write(fd, buf, rlen);
usr.sbin/lpr/lpd/recvjob.c
352
if (close(fd) != 0) {
usr.sbin/lpr/lpr/lpr.c
526
register int fd, i, nr, nc;
usr.sbin/lpr/lpr/lpr.c
535
fd = nfile(dfname);
usr.sbin/lpr/lpr/lpr.c
538
if (write(fd, buf, i) != i) {
usr.sbin/lpr/lpr/lpr.c
553
(void) close(fd);
usr.sbin/lpr/lpr/lpr.c
692
int fd;
usr.sbin/lpr/lpr/lpr.c
711
if ((fd = open(file, O_RDONLY)) < 0) {
usr.sbin/lpr/lpr/lpr.c
715
(void) close(fd);
usr.sbin/lpr/lpr/lpr.c
727
fd = checkwriteperm(file,"/");
usr.sbin/lpr/lpr/lpr.c
733
fd = checkwriteperm(file, dirpath);
usr.sbin/lpr/lpr/lpr.c
736
if (fd == 0)
usr.sbin/lpr/lpr/lpr.c
817
register int len, fd, n;
usr.sbin/lpr/lpr/lpr.c
823
if ((fd = open(buf, O_RDWR|O_CREAT, 0664)) < 0) {
usr.sbin/lpr/lpr/lpr.c
827
if (flock(fd, LOCK_EX)) {
usr.sbin/lpr/lpr/lpr.c
833
if ((len = read(fd, buf, sizeof(buf))) > 0) {
usr.sbin/lpr/lpr/lpr.c
846
(void) lseek(fd, (off_t)0, 0);
usr.sbin/lpr/lpr/lpr.c
848
(void) write(fd, buf, strlen(buf));
usr.sbin/lpr/lpr/lpr.c
849
(void) close(fd); /* unlocks as well */
usr.sbin/lptcontrol/lptcontrol.c
101
if (ioctl(fd, LPT_IRQ, &irq_status) < 0)
usr.sbin/lptcontrol/lptcontrol.c
103
close(fd);
usr.sbin/lptcontrol/lptcontrol.c
60
int fd;
usr.sbin/lptcontrol/lptcontrol.c
99
if ((fd = open(device, O_WRONLY)) < 0)
usr.sbin/makefs/cd9660/cd9660_debug.c
193
debug_dump_to_xml_path_table(FILE *fd, off_t sector, int size, int mode)
usr.sbin/makefs/cd9660/cd9660_debug.c
199
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
204
fread(&pttemp, 1, 8, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
207
fread(((unsigned char*)&pttemp) + 8, 1, pttemp.length[0], fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
222
debug_dump_to_xml(FILE *fd)
usr.sbin/makefs/cd9660/cd9660_debug.c
235
if (fseeko(fd, CD9660_SECTOR_SIZE * sector, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_debug.c
237
fread(buf, 1, CD9660_SECTOR_SIZE, fd);
usr.sbin/makefs/cd9660/cd9660_debug.c
256
debug_dump_to_xml_path_table(fd, t, t2, 721);
usr.sbin/makefs/cd9660/cd9660_debug.c
260
debug_dump_to_xml_path_table(fd, t, t2, 722);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
549
cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
555
if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
559
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
562
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
567
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
570
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
571
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
572
fwrite(&val, sizeof(val), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
576
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
578
fwrite(&lba, sizeof(lba), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
584
cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
594
if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
599
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
601
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
605
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
608
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
610
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
612
fwrite(part_name, strlen(part_name) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
613
fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
614
fwrite(part_type, strlen(part_type) + 1, 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
615
fseek(fd, 32 - strlen(part_type) - 1, SEEK_CUR);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
619
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
622
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
625
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
631
cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_eltorito.c
639
if (fseeko(fd, (off_t)diskStructure->boot_catalog_sector *
usr.sbin/makefs/cd9660/cd9660_eltorito.c
656
fwrite(&(e->entry_data.VE), 1, 32, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
667
cd9660_copy_file(diskStructure, fd, t->sector, t->filename);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
679
fseek(fd, 0x1fe, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
681
fwrite(&sig, sizeof(sig), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
687
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
695
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
708
fseek(fd, 0, SEEK_SET);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
710
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
713
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
717
fwrite(&apm32, sizeof(apm32), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
720
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
721
fwrite(&apm16, sizeof(apm16), 1, fd);
usr.sbin/makefs/cd9660/cd9660_eltorito.c
727
cd9660_write_apm_partition_entry(fd, 0, total_parts, 1,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
736
cd9660_write_apm_partition_entry(fd,
usr.sbin/makefs/cd9660/cd9660_eltorito.c
744
cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
usr.sbin/makefs/cd9660/cd9660_write.c
100
status = cd9660_write_path_tables(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
110
status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode);
usr.sbin/makefs/cd9660/cd9660_write.c
117
cd9660_write_boot(diskStructure, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
122
cd9660_write_filedata(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
127
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
134
fclose(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
143
cd9660_write_volume_descriptors(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
148
cd9660_write_filedata(diskStructure, fd, vd_temp->sector,
usr.sbin/makefs/cd9660/cd9660_write.c
164
cd9660_write_path_table(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
213
ret = cd9660_write_filedata(diskStructure, fd, sector, buffer_head,
usr.sbin/makefs/cd9660/cd9660_write.c
235
cd9660_write_path_tables(iso9660_disk *diskStructure, FILE *fd)
usr.sbin/makefs/cd9660/cd9660_write.c
237
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
241
if (cd9660_write_path_table(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
261
cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode)
usr.sbin/makefs/cd9660/cd9660_write.c
290
ret = cd9660_copy_file(diskStructure, fd,
usr.sbin/makefs/cd9660/cd9660_write.c
310
if (fseeko(fd, working_sector * diskStructure->sectorSize,
usr.sbin/makefs/cd9660/cd9660_write.c
335
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
341
temp->isoDirRecord->length[0], fd);
usr.sbin/makefs/cd9660/cd9660_write.c
343
cd9660_write_rr(diskStructure, fd, temp,
usr.sbin/makefs/cd9660/cd9660_write.c
346
if (fseeko(fd, working_sector *
usr.sbin/makefs/cd9660/cd9660_write.c
353
temp->su_tail_size, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
354
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
366
if ((ret = cd9660_write_file(diskStructure, fd, temp)) == 0)
usr.sbin/makefs/cd9660/cd9660_write.c
391
cd9660_write_filedata(iso9660_disk *diskStructure, FILE *fd, off_t sector,
usr.sbin/makefs/cd9660/cd9660_write.c
397
curpos = ftello(fd);
usr.sbin/makefs/cd9660/cd9660_write.c
399
if (fseeko(fd, sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
402
success = fwrite(buf, diskStructure->sectorSize * numsecs, 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
404
if (fseeko(fd, curpos, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
414
cd9660_write_buffered(FILE *fd, off_t offset, int buff_len,
usr.sbin/makefs/cd9660/cd9660_write.c
425
cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd, off_t start_sector,
usr.sbin/makefs/cd9660/cd9660_write.c
443
if (fseeko(fd, start_sector * diskStructure->sectorSize, SEEK_SET) == -1)
usr.sbin/makefs/cd9660/cd9660_write.c
455
fwrite(buf,1,bytes_read,fd);
usr.sbin/makefs/cd9660/cd9660_write.c
456
if (ferror(fd)) {
usr.sbin/makefs/cd9660/cd9660_write.c
470
cd9660_write_rr(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode,
usr.sbin/makefs/cd9660/cd9660_write.c
477
if (fseeko(fd, sector * diskStructure->sectorSize + offset, SEEK_SET) ==
usr.sbin/makefs/cd9660/cd9660_write.c
482
fwrite(&(myattr->attr), CD9660_SUSP_ENTRY_SIZE(myattr), 1, fd);
usr.sbin/makefs/cd9660/cd9660_write.c
491
if (fseeko(fd, ((off_t)diskStructure->
usr.sbin/makefs/cd9660/cd9660_write.c
507
if (fseeko(fd, sector * diskStructure->sectorSize + offset,
usr.sbin/makefs/cd9660/cd9660_write.c
63
FILE *fd;
usr.sbin/makefs/cd9660/cd9660_write.c
67
if ((fd = fopen(image, "w+")) == NULL) {
usr.sbin/makefs/cd9660/cd9660_write.c
76
status = cd9660_copy_file(diskStructure, fd, 0,
usr.sbin/makefs/cd9660/cd9660_write.c
86
status = cd9660_write_volume_descriptors(diskStructure, fd);
usr.sbin/makefs/ffs.c
311
if (close(fsopts->fd) == -1)
usr.sbin/makefs/ffs.c
313
fsopts->fd = -1;
usr.sbin/makefs/ffs.c
502
if ((fsopts->fd = open(image, oflags, 0666)) == -1) {
usr.sbin/makefs/ffs.c
509
if (fstatvfs(fsopts->fd, &sfs) == -1) {
usr.sbin/makefs/ffs.c
520
if (ftruncate(fsopts->fd, bufrem) == -1) {
usr.sbin/makefs/ffs.c
538
if (lseek(fsopts->fd, fsopts->offset, SEEK_SET) == -1) {
usr.sbin/makefs/ffs.c
545
i = write(fsopts->fd, buf, MIN(bufsize, bufrem));
usr.sbin/makefs/ffs.c
591
return (fsopts->fd);
usr.sbin/makefs/ffs/buf.c
137
if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1) {
usr.sbin/makefs/ffs/buf.c
141
rv = write(bp->b_fs->fd, bp->b_data, bytes);
usr.sbin/makefs/ffs/buf.c
75
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1)
usr.sbin/makefs/ffs/buf.c
78
rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
usr.sbin/makefs/ffs/mkfs.c
824
if (lseek(fsopts->fd, offset, SEEK_SET) < 0)
usr.sbin/makefs/ffs/mkfs.c
827
n = read(fsopts->fd, bf, size);
usr.sbin/makefs/ffs/mkfs.c
848
if (lseek(fsopts->fd, offset, SEEK_SET) < 0)
usr.sbin/makefs/ffs/mkfs.c
851
n = write(fsopts->fd, bf, size);
usr.sbin/makefs/makefs.c
120
fsoptions.fd = -1;
usr.sbin/makefs/makefs.h
161
int fd; /* file descriptor of image */
usr.sbin/makefs/msdos.c
180
fsopts->fd = open(image, O_RDWR);
usr.sbin/makefs/msdos/msdosfs_vnops.c
432
int error, fd;
usr.sbin/makefs/msdos/msdosfs_vnops.c
461
if ((fd = open(path, O_RDONLY)) == -1) {
usr.sbin/makefs/msdos/msdosfs_vnops.c
467
if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
usr.sbin/makefs/msdos/msdosfs_vnops.c
472
close(fd);
usr.sbin/makefs/msdos/msdosfs_vnops.c
475
close(fd);
usr.sbin/makefs/zfs/fs.c
169
eclose(int fd)
usr.sbin/makefs/zfs/fs.c
171
if (close(fd) != 0)
usr.sbin/makefs/zfs/fs.c
295
int fd;
usr.sbin/makefs/zfs/fs.c
297
fs_populate_path(cur, arg, path, sizeof(path), &fd);
usr.sbin/makefs/zfs/fs.c
299
fd = openat(fd, path, flags);
usr.sbin/makefs/zfs/fs.c
300
if (fd < 0)
usr.sbin/makefs/zfs/fs.c
302
return (fd);
usr.sbin/makefs/zfs/fs.c
308
int fd;
usr.sbin/makefs/zfs/fs.c
311
fs_populate_path(cur, arg, path, sizeof(path), &fd);
usr.sbin/makefs/zfs/fs.c
313
return (openat(fd, path, flags));
usr.sbin/makefs/zfs/fs.c
321
int fd;
usr.sbin/makefs/zfs/fs.c
331
fs_populate_path(cur, arg, path, sizeof(path), &fd);
usr.sbin/makefs/zfs/fs.c
333
n = readlinkat(fd, path, buf, bufsz - 1);
usr.sbin/makefs/zfs/fs.c
547
int fd;
usr.sbin/makefs/zfs/fs.c
571
fd = fs_open(cur, arg, O_RDONLY);
usr.sbin/makefs/zfs/fs.c
586
n = read(fd, buf + sofar, nbytes);
usr.sbin/makefs/zfs/fs.c
603
eclose(fd);
usr.sbin/makefs/zfs/vdev.c
104
n = pwrite(zfs->fd, (const char *)buf + sofar, len - sofar,
usr.sbin/makefs/zfs/vdev.c
212
n = pwrite(zfs->fd, label, sizeof(*label), loff);
usr.sbin/makefs/zfs/vdev.c
418
zfs->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0644);
usr.sbin/makefs/zfs/vdev.c
419
if (zfs->fd == -1)
usr.sbin/makefs/zfs/vdev.c
421
if (ftruncate(zfs->fd, zfs->vdevsize) != 0)
usr.sbin/makefs/zfs/vdev.c
432
if (zfs->fd != -1) {
usr.sbin/makefs/zfs/vdev.c
433
if (close(zfs->fd) != 0)
usr.sbin/makefs/zfs/vdev.c
435
zfs->fd = -1;
usr.sbin/makefs/zfs/zfs.h
107
int fd; /* vdev disk fd */
usr.sbin/mfiutil/mfi_bbu.c
101
mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp)
usr.sbin/mfiutil/mfi_bbu.c
104
return (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_PROP, props,
usr.sbin/mfiutil/mfi_bbu.c
109
mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp)
usr.sbin/mfiutil/mfi_bbu.c
112
return (mfi_dcmd_command(fd, MFI_DCMD_BBU_SET_PROP, props,
usr.sbin/mfiutil/mfi_bbu.c
120
int error, fd;
usr.sbin/mfiutil/mfi_bbu.c
130
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_bbu.c
131
if (fd < 0) {
usr.sbin/mfiutil/mfi_bbu.c
137
if (mfi_dcmd_command(fd, MFI_DCMD_BBU_START_LEARN, NULL, 0, NULL, 0,
usr.sbin/mfiutil/mfi_bbu.c
156
int error, fd;
usr.sbin/mfiutil/mfi_bbu.c
167
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_bbu.c
168
if (fd < 0) {
usr.sbin/mfiutil/mfi_bbu.c
174
if (mfi_bbu_get_props(fd, &props, &status) < 0) {
usr.sbin/mfiutil/mfi_bbu.c
229
if (mfi_bbu_set_props(fd, &props, &status) < 0) {
usr.sbin/mfiutil/mfi_bbu.c
240
close(fd);
usr.sbin/mfiutil/mfi_cmd.c
168
mfi_query_disk(int fd, uint8_t target_id, struct mfi_query_disk *info)
usr.sbin/mfiutil/mfi_cmd.c
173
if (ioctl(fd, MFIIO_QUERY_DISK, info) < 0)
usr.sbin/mfiutil/mfi_cmd.c
183
mfi_volume_name(int fd, uint8_t target_id)
usr.sbin/mfiutil/mfi_cmd.c
188
if (mfi_query_disk(fd, target_id, &info) < 0) {
usr.sbin/mfiutil/mfi_cmd.c
196
mfi_volume_busy(int fd, uint8_t target_id)
usr.sbin/mfiutil/mfi_cmd.c
201
if (mfi_query_disk(fd, target_id, &info) < 0)
usr.sbin/mfiutil/mfi_cmd.c
232
mfi_lookup_volume(int fd, const char *name, uint8_t *target_id)
usr.sbin/mfiutil/mfi_cmd.c
247
if (mfi_dcmd_command(fd, MFI_DCMD_LD_GET_LIST, &list, sizeof(list),
usr.sbin/mfiutil/mfi_cmd.c
252
if (mfi_query_disk(fd, list.ld_list[i].ld.v.target_id,
usr.sbin/mfiutil/mfi_cmd.c
265
mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize,
usr.sbin/mfiutil/mfi_cmd.c
290
r = ioctl(fd, MFIIO_PASSTHRU, &ioc);
usr.sbin/mfiutil/mfi_cmd.c
306
mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp)
usr.sbin/mfiutil/mfi_cmd.c
309
return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_GETINFO, info,
usr.sbin/mfiutil/mfi_config.c
1034
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_MAKE_SPARE, spare,
usr.sbin/mfiutil/mfi_config.c
104
if (mfi_dcmd_command(fd, opcode, config,
usr.sbin/mfiutil/mfi_config.c
1045
close(fd);
usr.sbin/mfiutil/mfi_config.c
1055
int error, fd;
usr.sbin/mfiutil/mfi_config.c
1064
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
1065
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
1071
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_config.c
1073
close(fd);
usr.sbin/mfiutil/mfi_config.c
1078
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
1081
close(fd);
usr.sbin/mfiutil/mfi_config.c
1087
close(fd);
usr.sbin/mfiutil/mfi_config.c
1092
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_REMOVE_SPARE, NULL, 0, mbox,
usr.sbin/mfiutil/mfi_config.c
1096
close(fd);
usr.sbin/mfiutil/mfi_config.c
1100
close(fd);
usr.sbin/mfiutil/mfi_config.c
1108
dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix)
usr.sbin/mfiutil/mfi_config.c
1142
if (mfi_pd_get_info(fd, device_id, &pinfo,
usr.sbin/mfiutil/mfi_config.c
1159
mfi_volume_name(fd, ld->properties.ld.v.target_id));
usr.sbin/mfiutil/mfi_config.c
1206
int error, fd;
usr.sbin/mfiutil/mfi_config.c
1213
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
1214
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
1221
if (mfi_config_read(fd, &config) < 0) {
usr.sbin/mfiutil/mfi_config.c
1224
close(fd);
usr.sbin/mfiutil/mfi_config.c
1229
dump_config(fd, config, NULL);
usr.sbin/mfiutil/mfi_config.c
1231
close(fd);
usr.sbin/mfiutil/mfi_config.c
1243
int error, fd;
usr.sbin/mfiutil/mfi_config.c
1250
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
1251
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
1264
close(fd);
usr.sbin/mfiutil/mfi_config.c
1271
close(fd);
usr.sbin/mfiutil/mfi_config.c
1278
close(fd);
usr.sbin/mfiutil/mfi_config.c
1281
dump_config(fd, config, NULL);
usr.sbin/mfiutil/mfi_config.c
1283
close(fd);
usr.sbin/mfiutil/mfi_config.c
161
int ch, error, fd;
usr.sbin/mfiutil/mfi_config.c
164
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
165
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
174
close(fd);
usr.sbin/mfiutil/mfi_config.c
178
if (mfi_ld_get_list(fd, &list, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
181
close(fd);
usr.sbin/mfiutil/mfi_config.c
186
if (mfi_volume_busy(fd, list.ld_list[i].ld.v.target_id)) {
usr.sbin/mfiutil/mfi_config.c
188
mfi_volume_name(fd, list.ld_list[i].ld.v.target_id));
usr.sbin/mfiutil/mfi_config.c
189
close(fd);
usr.sbin/mfiutil/mfi_config.c
200
close(fd);
usr.sbin/mfiutil/mfi_config.c
204
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
207
close(fd);
usr.sbin/mfiutil/mfi_config.c
212
close(fd);
usr.sbin/mfiutil/mfi_config.c
289
parse_array(int fd, int raid_type, char *array_str, struct array_info *info)
usr.sbin/mfiutil/mfi_config.c
351
error = mfi_lookup_drive(fd, cp, &device_id);
usr.sbin/mfiutil/mfi_config.c
358
if (mfi_pd_get_info(fd, device_id, pinfo, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
424
build_array(int fd __unused, char *arrayp, struct array_info *array_info,
usr.sbin/mfiutil/mfi_config.c
554
int error, fd, i, raid_type;
usr.sbin/mfiutil/mfi_config.c
589
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
590
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
692
error = parse_array(fd, raid_type, av[i], &arrays[i]);
usr.sbin/mfiutil/mfi_config.c
716
if (mfi_config_read(fd, &config) < 0) {
usr.sbin/mfiutil/mfi_config.c
802
build_array(fd, cfg_arrays, &arrays[i], &state, verbose);
usr.sbin/mfiutil/mfi_config.c
81
mfi_config_read(int fd, struct mfi_config_data **configp)
usr.sbin/mfiutil/mfi_config.c
817
dump_config(fd, config, NULL);
usr.sbin/mfiutil/mfi_config.c
821
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_ADD, config, config_size,
usr.sbin/mfiutil/mfi_config.c
83
return mfi_config_read_opcode(fd, MFI_DCMD_CFG_READ, configp, NULL, 0);
usr.sbin/mfiutil/mfi_config.c
838
close(fd);
usr.sbin/mfiutil/mfi_config.c
848
int error, fd;
usr.sbin/mfiutil/mfi_config.c
87
mfi_config_read_opcode(int fd, uint32_t opcode, struct mfi_config_data **configp,
usr.sbin/mfiutil/mfi_config.c
871
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
872
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
881
close(fd);
usr.sbin/mfiutil/mfi_config.c
885
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
usr.sbin/mfiutil/mfi_config.c
888
close(fd);
usr.sbin/mfiutil/mfi_config.c
892
if (mfi_ld_get_info(fd, target_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
895
close(fd);
usr.sbin/mfiutil/mfi_config.c
899
if (mfi_volume_busy(fd, target_id)) {
usr.sbin/mfiutil/mfi_config.c
901
mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_config.c
902
close(fd);
usr.sbin/mfiutil/mfi_config.c
907
if (mfi_dcmd_command(fd, MFI_DCMD_LD_DELETE, NULL, 0, mbox,
usr.sbin/mfiutil/mfi_config.c
911
close(fd);
usr.sbin/mfiutil/mfi_config.c
915
close(fd);
usr.sbin/mfiutil/mfi_config.c
932
int error, fd, i;
usr.sbin/mfiutil/mfi_config.c
939
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_config.c
940
if (fd < 0) {
usr.sbin/mfiutil/mfi_config.c
948
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_config.c
952
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_config.c
965
if (mfi_lookup_volume(fd, av[2], &target_id) < 0) {
usr.sbin/mfiutil/mfi_config.c
972
if (mfi_config_read(fd, &config) < 0) {
usr.sbin/mfiutil/mfi_drive.c
152
mfi_lookup_drive(int fd, char *drive, uint16_t *device_id)
usr.sbin/mfiutil/mfi_drive.c
194
if (mfi_pd_get_list(fd, &list, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
242
mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp)
usr.sbin/mfiutil/mfi_drive.c
257
if (mfi_dcmd_command(fd, MFI_DCMD_PD_GET_LIST, list, list_size, NULL,
usr.sbin/mfiutil/mfi_drive.c
273
mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
usr.sbin/mfiutil/mfi_drive.c
279
return (mfi_dcmd_command(fd, MFI_DCMD_PD_GET_INFO, info,
usr.sbin/mfiutil/mfi_drive.c
342
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
344
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
345
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
351
error = mfi_lookup_drive(fd, drive, &device_id);
usr.sbin/mfiutil/mfi_drive.c
353
close(fd);
usr.sbin/mfiutil/mfi_drive.c
358
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
361
close(fd);
usr.sbin/mfiutil/mfi_drive.c
368
close(fd);
usr.sbin/mfiutil/mfi_drive.c
375
if (mfi_dcmd_command(fd, MFI_DCMD_PD_STATE_SET, NULL, 0, mbox, 6,
usr.sbin/mfiutil/mfi_drive.c
380
close(fd);
usr.sbin/mfiutil/mfi_drive.c
384
close(fd);
usr.sbin/mfiutil/mfi_drive.c
451
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
459
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
460
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
466
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_drive.c
468
close(fd);
usr.sbin/mfiutil/mfi_drive.c
473
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
476
close(fd);
usr.sbin/mfiutil/mfi_drive.c
483
close(fd);
usr.sbin/mfiutil/mfi_drive.c
489
if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_START, NULL, 0, mbox, 4,
usr.sbin/mfiutil/mfi_drive.c
493
close(fd);
usr.sbin/mfiutil/mfi_drive.c
496
close(fd);
usr.sbin/mfiutil/mfi_drive.c
508
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
516
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
517
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
523
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_drive.c
525
close(fd);
usr.sbin/mfiutil/mfi_drive.c
530
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
533
close(fd);
usr.sbin/mfiutil/mfi_drive.c
540
close(fd);
usr.sbin/mfiutil/mfi_drive.c
546
if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_ABORT, NULL, 0, mbox, 4,
usr.sbin/mfiutil/mfi_drive.c
550
close(fd);
usr.sbin/mfiutil/mfi_drive.c
553
close(fd);
usr.sbin/mfiutil/mfi_drive.c
564
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
572
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
573
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
579
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_drive.c
581
close(fd);
usr.sbin/mfiutil/mfi_drive.c
586
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
589
close(fd);
usr.sbin/mfiutil/mfi_drive.c
592
close(fd);
usr.sbin/mfiutil/mfi_drive.c
619
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
63
int fd;
usr.sbin/mfiutil/mfi_drive.c
638
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
639
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
645
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_drive.c
647
close(fd);
usr.sbin/mfiutil/mfi_drive.c
652
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
655
close(fd);
usr.sbin/mfiutil/mfi_drive.c
660
if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
665
close(fd);
usr.sbin/mfiutil/mfi_drive.c
669
close(fd);
usr.sbin/mfiutil/mfi_drive.c
679
int error, fd;
usr.sbin/mfiutil/mfi_drive.c
698
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
699
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
705
error = mfi_lookup_drive(fd, av[1], &device_id);
usr.sbin/mfiutil/mfi_drive.c
707
close(fd);
usr.sbin/mfiutil/mfi_drive.c
715
if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
720
close(fd);
usr.sbin/mfiutil/mfi_drive.c
723
close(fd);
usr.sbin/mfiutil/mfi_drive.c
77
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_drive.c
78
if (fd < 0) {
usr.sbin/mfiutil/mfi_drive.c
84
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_drive.c
86
close(fd);
usr.sbin/mfiutil/mfi_drive.c
90
close(fd);
usr.sbin/mfiutil/mfi_evt.c
356
volume_name(int fd, struct mfi_evt_ld *ld)
usr.sbin/mfiutil/mfi_evt.c
359
return (mfi_volume_name(fd, ld->target_id));
usr.sbin/mfiutil/mfi_evt.c
364
mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose)
usr.sbin/mfiutil/mfi_evt.c
387
printf("VOL %s event: ", volume_name(fd, &detail->args.ld));
usr.sbin/mfiutil/mfi_evt.c
390
printf("VOL %s", volume_name(fd, &detail->args.ld_count.ld));
usr.sbin/mfiutil/mfi_evt.c
398
printf("VOL %s", volume_name(fd, &detail->args.ld_lba.ld));
usr.sbin/mfiutil/mfi_evt.c
406
printf("VOL %s", volume_name(fd, &detail->args.ld_owner.ld));
usr.sbin/mfiutil/mfi_evt.c
415
printf("VOL %s", volume_name(fd, &detail->args.ld_lba_pd_lba.ld));
usr.sbin/mfiutil/mfi_evt.c
425
printf("VOL %s", volume_name(fd, &detail->args.ld_prog.ld));
usr.sbin/mfiutil/mfi_evt.c
434
printf("VOL %s", volume_name(fd, &detail->args.ld_state.ld));
usr.sbin/mfiutil/mfi_evt.c
443
printf("VOL %s", volume_name(fd, &detail->args.ld_strip.ld));
usr.sbin/mfiutil/mfi_evt.c
45
mfi_event_get_info(int fd, struct mfi_evt_log_state *info, uint8_t *statusp)
usr.sbin/mfiutil/mfi_evt.c
475
volume_name(fd, &detail->args.pd_lba_ld.ld));
usr.sbin/mfiutil/mfi_evt.c
48
return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_EVENT_GETINFO, info,
usr.sbin/mfiutil/mfi_evt.c
53
mfi_get_events(int fd, struct mfi_evt_list *list, int num_events,
usr.sbin/mfiutil/mfi_evt.c
545
int ch, error, fd, num_events, verbose;
usr.sbin/mfiutil/mfi_evt.c
548
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_evt.c
549
if (fd < 0) {
usr.sbin/mfiutil/mfi_evt.c
555
if (mfi_event_get_info(fd, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_evt.c
558
close(fd);
usr.sbin/mfiutil/mfi_evt.c
579
close(fd);
usr.sbin/mfiutil/mfi_evt.c
587
close(fd);
usr.sbin/mfiutil/mfi_evt.c
596
close(fd);
usr.sbin/mfiutil/mfi_evt.c
606
close(fd);
usr.sbin/mfiutil/mfi_evt.c
618
close(fd);
usr.sbin/mfiutil/mfi_evt.c
625
close(fd);
usr.sbin/mfiutil/mfi_evt.c
63
return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_EVENT_GET, list, size,
usr.sbin/mfiutil/mfi_evt.c
631
close(fd);
usr.sbin/mfiutil/mfi_evt.c
637
close(fd);
usr.sbin/mfiutil/mfi_evt.c
644
close(fd);
usr.sbin/mfiutil/mfi_evt.c
650
if (mfi_get_events(fd, list, num_events, filter, seq,
usr.sbin/mfiutil/mfi_evt.c
655
close(fd);
usr.sbin/mfiutil/mfi_evt.c
664
close(fd);
usr.sbin/mfiutil/mfi_evt.c
682
mfi_decode_evt(fd, &list->event[i], verbose);
usr.sbin/mfiutil/mfi_evt.c
699
close(fd);
usr.sbin/mfiutil/mfi_evt.c
71
int error, fd;
usr.sbin/mfiutil/mfi_evt.c
78
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_evt.c
79
if (fd < 0) {
usr.sbin/mfiutil/mfi_evt.c
85
if (mfi_event_get_info(fd, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_evt.c
88
close(fd);
usr.sbin/mfiutil/mfi_evt.c
99
close(fd);
usr.sbin/mfiutil/mfi_flash.c
110
fd = -1;
usr.sbin/mfiutil/mfi_flash.c
123
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_flash.c
124
if (fd < 0) {
usr.sbin/mfiutil/mfi_flash.c
132
if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4,
usr.sbin/mfiutil/mfi_flash.c
157
if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE,
usr.sbin/mfiutil/mfi_flash.c
166
if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_DOWNLOAD, buf, nread,
usr.sbin/mfiutil/mfi_flash.c
175
mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL,
usr.sbin/mfiutil/mfi_flash.c
187
if (mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_FLASH, &dummy, sizeof(dummy),
usr.sbin/mfiutil/mfi_flash.c
199
error = display_pending_firmware(fd);
usr.sbin/mfiutil/mfi_flash.c
203
if (fd >= 0)
usr.sbin/mfiutil/mfi_flash.c
204
close(fd);
usr.sbin/mfiutil/mfi_flash.c
46
display_pending_firmware(int fd)
usr.sbin/mfiutil/mfi_flash.c
53
if (mfi_ctrl_get_info(fd, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_flash.c
94
int error, fd, flash;
usr.sbin/mfiutil/mfi_foreign.c
104
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
110
foreign_show_cfg(int fd, uint32_t opcode, uint8_t cfgidx, int diagnostic)
usr.sbin/mfiutil/mfi_foreign.c
119
if (mfi_config_read_opcode(fd, opcode, &config, mbox, sizeof(mbox)) < 0) {
usr.sbin/mfiutil/mfi_foreign.c
122
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
137
dump_config(fd, config, prefix);
usr.sbin/mfiutil/mfi_foreign.c
216
int error, fd;
usr.sbin/mfiutil/mfi_foreign.c
223
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_foreign.c
224
if (fd < 0) {
usr.sbin/mfiutil/mfi_foreign.c
230
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
usr.sbin/mfiutil/mfi_foreign.c
234
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
240
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
246
error = foreign_show_cfg(fd,
usr.sbin/mfiutil/mfi_foreign.c
249
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
256
error = foreign_show_cfg(fd,
usr.sbin/mfiutil/mfi_foreign.c
259
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
264
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
286
int ch, error, fd;
usr.sbin/mfiutil/mfi_foreign.c
295
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_foreign.c
296
if (fd < 0) {
usr.sbin/mfiutil/mfi_foreign.c
302
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
usr.sbin/mfiutil/mfi_foreign.c
306
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
312
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
331
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
341
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
347
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_IMPORT, NULL, 0, mbox,
usr.sbin/mfiutil/mfi_foreign.c
351
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
361
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
47
int ch, error, fd;
usr.sbin/mfiutil/mfi_foreign.c
49
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_foreign.c
50
if (fd < 0) {
usr.sbin/mfiutil/mfi_foreign.c
63
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
67
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_CLEAR, NULL, 0, NULL,
usr.sbin/mfiutil/mfi_foreign.c
71
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
76
close(fd);
usr.sbin/mfiutil/mfi_foreign.c
85
int error, fd;
usr.sbin/mfiutil/mfi_foreign.c
87
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_foreign.c
88
if (fd < 0) {
usr.sbin/mfiutil/mfi_foreign.c
94
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
usr.sbin/mfiutil/mfi_foreign.c
98
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
101
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
130
if (mfi_dcmd_command(fd, MFI_DCMD_PR_GET_STATUS, &status,
usr.sbin/mfiutil/mfi_patrol.c
134
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
157
if (mfi_pd_get_list(fd, &list, NULL) < 0) {
usr.sbin/mfiutil/mfi_patrol.c
160
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
168
if (mfi_pd_get_info(fd, list->addr[i].device_id, &info,
usr.sbin/mfiutil/mfi_patrol.c
174
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
189
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
198
int error, fd;
usr.sbin/mfiutil/mfi_patrol.c
200
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_patrol.c
201
if (fd < 0) {
usr.sbin/mfiutil/mfi_patrol.c
207
if (mfi_dcmd_command(fd, MFI_DCMD_PR_START, NULL, 0, NULL, 0, NULL) <
usr.sbin/mfiutil/mfi_patrol.c
211
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
215
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
224
int error, fd;
usr.sbin/mfiutil/mfi_patrol.c
226
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_patrol.c
227
if (fd < 0) {
usr.sbin/mfiutil/mfi_patrol.c
233
if (mfi_dcmd_command(fd, MFI_DCMD_PR_STOP, NULL, 0, NULL, 0, NULL) <
usr.sbin/mfiutil/mfi_patrol.c
237
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
241
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
253
int error, fd;
usr.sbin/mfiutil/mfi_patrol.c
296
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_patrol.c
297
if (fd < 0) {
usr.sbin/mfiutil/mfi_patrol.c
303
error = patrol_get_props(fd, &prop);
usr.sbin/mfiutil/mfi_patrol.c
305
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
314
mfi_get_time(fd, &at);
usr.sbin/mfiutil/mfi_patrol.c
316
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
324
if (mfi_dcmd_command(fd, MFI_DCMD_PR_SET_PROPERTIES, &prop,
usr.sbin/mfiutil/mfi_patrol.c
328
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
332
close(fd);
usr.sbin/mfiutil/mfi_patrol.c
53
mfi_get_time(int fd, uint32_t *at)
usr.sbin/mfiutil/mfi_patrol.c
56
if (mfi_dcmd_command(fd, MFI_DCMD_TIME_SECS_GET, at, sizeof(*at), NULL,
usr.sbin/mfiutil/mfi_patrol.c
64
patrol_get_props(int fd, struct mfi_pr_properties *prop)
usr.sbin/mfiutil/mfi_patrol.c
68
if (mfi_dcmd_command(fd, MFI_DCMD_PR_GET_PROPERTIES, prop,
usr.sbin/mfiutil/mfi_patrol.c
87
int error, fd;
usr.sbin/mfiutil/mfi_patrol.c
90
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_patrol.c
91
if (fd < 0) {
usr.sbin/mfiutil/mfi_patrol.c
98
mfi_get_time(fd, &at);
usr.sbin/mfiutil/mfi_patrol.c
99
error = patrol_get_props(fd, &prop);
usr.sbin/mfiutil/mfi_properties.c
102
close(fd);
usr.sbin/mfiutil/mfi_properties.c
106
error = mfi_ctrl_get_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_properties.c
110
close(fd);
usr.sbin/mfiutil/mfi_properties.c
123
int error, fd;
usr.sbin/mfiutil/mfi_properties.c
131
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_properties.c
132
if (fd < 0) {
usr.sbin/mfiutil/mfi_properties.c
138
error = mfi_ctrl_get_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_properties.c
142
close(fd);
usr.sbin/mfiutil/mfi_properties.c
150
error = mfi_ctrl_set_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_properties.c
154
close(fd);
usr.sbin/mfiutil/mfi_properties.c
158
error = mfi_ctrl_get_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_properties.c
162
close(fd);
usr.sbin/mfiutil/mfi_properties.c
49
mfi_ctrl_get_properties(int fd, struct mfi_ctrl_props *info)
usr.sbin/mfiutil/mfi_properties.c
52
return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_GET_PROPS, info,
usr.sbin/mfiutil/mfi_properties.c
57
mfi_ctrl_set_properties(int fd, struct mfi_ctrl_props *info)
usr.sbin/mfiutil/mfi_properties.c
60
return (mfi_dcmd_command(fd, MFI_DCMD_CTRL_SET_PROPS, info,
usr.sbin/mfiutil/mfi_properties.c
71
int error, fd;
usr.sbin/mfiutil/mfi_properties.c
79
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_properties.c
80
if (fd < 0) {
usr.sbin/mfiutil/mfi_properties.c
86
error = mfi_ctrl_get_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_properties.c
90
close(fd);
usr.sbin/mfiutil/mfi_properties.c
98
error = mfi_ctrl_set_properties(fd, &ctrl_props);
usr.sbin/mfiutil/mfi_show.c
134
close(fd);
usr.sbin/mfiutil/mfi_show.c
148
int comma, error, fd, show_capacity, show_props;
usr.sbin/mfiutil/mfi_show.c
156
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
157
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
163
if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_CAPACITY_INFO, &cap,
usr.sbin/mfiutil/mfi_show.c
167
close(fd);
usr.sbin/mfiutil/mfi_show.c
172
close(fd);
usr.sbin/mfiutil/mfi_show.c
177
if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_DESIGN_INFO, &design,
usr.sbin/mfiutil/mfi_show.c
181
close(fd);
usr.sbin/mfiutil/mfi_show.c
185
if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat),
usr.sbin/mfiutil/mfi_show.c
189
close(fd);
usr.sbin/mfiutil/mfi_show.c
193
if (mfi_bbu_get_props(fd, &props, &status) < 0) {
usr.sbin/mfiutil/mfi_show.c
196
close(fd);
usr.sbin/mfiutil/mfi_show.c
292
close(fd);
usr.sbin/mfiutil/mfi_show.c
353
int error, fd, i, j;
usr.sbin/mfiutil/mfi_show.c
360
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
361
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
368
if (mfi_config_read(fd, &config) < 0) {
usr.sbin/mfiutil/mfi_show.c
371
close(fd);
usr.sbin/mfiutil/mfi_show.c
391
if (mfi_pd_get_info(fd, device_id, &pinfo,
usr.sbin/mfiutil/mfi_show.c
406
mfi_volume_name(fd, ld->properties.ld.v.target_id));
usr.sbin/mfiutil/mfi_show.c
407
if (mfi_ld_get_info(fd, ld->properties.ld.v.target_id, &linfo,
usr.sbin/mfiutil/mfi_show.c
429
if (mfi_pd_get_info(fd, sp->ref.v.device_id, &pinfo, NULL) < 0)
usr.sbin/mfiutil/mfi_show.c
442
close(fd);
usr.sbin/mfiutil/mfi_show.c
453
int error, fd;
usr.sbin/mfiutil/mfi_show.c
461
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
462
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
469
if (mfi_ld_get_list(fd, &list, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
472
close(fd);
usr.sbin/mfiutil/mfi_show.c
493
if (mfi_ld_get_info(fd, list.ld_list[i].ld.v.target_id, &info,
usr.sbin/mfiutil/mfi_show.c
498
close(fd);
usr.sbin/mfiutil/mfi_show.c
502
mfi_volume_name(fd, list.ld_list[i].ld.v.target_id));
usr.sbin/mfiutil/mfi_show.c
525
close(fd);
usr.sbin/mfiutil/mfi_show.c
537
int error, fd;
usr.sbin/mfiutil/mfi_show.c
544
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
545
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
552
if (mfi_pd_get_list(fd, &list, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
564
if (mfi_pd_get_info(fd, list->addr[i].device_id, &info,
usr.sbin/mfiutil/mfi_show.c
587
if (mfi_pd_get_info(fd, list->addr[i].device_id, &info,
usr.sbin/mfiutil/mfi_show.c
60
int error, fd, comma;
usr.sbin/mfiutil/mfi_show.c
605
close(fd);
usr.sbin/mfiutil/mfi_show.c
616
int error, fd;
usr.sbin/mfiutil/mfi_show.c
624
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
625
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
631
if (mfi_ctrl_get_info(fd, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
634
close(fd);
usr.sbin/mfiutil/mfi_show.c
661
close(fd);
usr.sbin/mfiutil/mfi_show.c
67
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
674
int busy, error, fd;
usr.sbin/mfiutil/mfi_show.c
68
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
684
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_show.c
685
if (fd < 0) {
usr.sbin/mfiutil/mfi_show.c
691
if (mfi_ld_get_list(fd, &llist, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
694
close(fd);
usr.sbin/mfiutil/mfi_show.c
697
if (mfi_pd_get_list(fd, &plist, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
700
close(fd);
usr.sbin/mfiutil/mfi_show.c
707
if (mfi_ld_get_info(fd, target_id, &linfo, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
710
mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_show.c
712
close(fd);
usr.sbin/mfiutil/mfi_show.c
716
printf("volume %s ", mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_show.c
722
printf("volume %s ", mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_show.c
728
printf("volume %s ", mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_show.c
734
printf("volume %s ", mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_show.c
74
if (mfi_ctrl_get_info(fd, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
746
if (mfi_pd_get_info(fd, device_id, &pinfo, NULL) < 0) {
usr.sbin/mfiutil/mfi_show.c
750
close(fd);
usr.sbin/mfiutil/mfi_show.c
77
close(fd);
usr.sbin/mfiutil/mfi_show.c
776
close(fd);
usr.sbin/mfiutil/mfi_volume.c
100
return (mfi_dcmd_command(fd, MFI_DCMD_LD_GET_PROP, props,
usr.sbin/mfiutil/mfi_volume.c
105
mfi_ld_set_props(int fd, struct mfi_ld_props *props)
usr.sbin/mfiutil/mfi_volume.c
110
return (mfi_dcmd_command(fd, MFI_DCMD_LD_SET_PROP, props,
usr.sbin/mfiutil/mfi_volume.c
115
update_cache_policy(int fd, struct mfi_ld_props *old, struct mfi_ld_props *new)
usr.sbin/mfiutil/mfi_volume.c
160
if (mfi_ld_set_props(fd, new) < 0) {
usr.sbin/mfiutil/mfi_volume.c
290
int error, fd, consumed;
usr.sbin/mfiutil/mfi_volume.c
298
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_volume.c
299
if (fd < 0) {
usr.sbin/mfiutil/mfi_volume.c
305
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
usr.sbin/mfiutil/mfi_volume.c
308
close(fd);
usr.sbin/mfiutil/mfi_volume.c
312
if (mfi_ld_get_props(fd, target_id, &props) < 0) {
usr.sbin/mfiutil/mfi_volume.c
315
close(fd);
usr.sbin/mfiutil/mfi_volume.c
321
mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_volume.c
376
close(fd);
usr.sbin/mfiutil/mfi_volume.c
382
error = update_cache_policy(fd, &props, &new);
usr.sbin/mfiutil/mfi_volume.c
384
close(fd);
usr.sbin/mfiutil/mfi_volume.c
394
int error, fd;
usr.sbin/mfiutil/mfi_volume.c
407
fd = mfi_open(mfi_device, O_RDWR);
usr.sbin/mfiutil/mfi_volume.c
408
if (fd < 0) {
usr.sbin/mfiutil/mfi_volume.c
414
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
usr.sbin/mfiutil/mfi_volume.c
417
close(fd);
usr.sbin/mfiutil/mfi_volume.c
421
if (mfi_ld_get_props(fd, target_id, &props) < 0) {
usr.sbin/mfiutil/mfi_volume.c
424
close(fd);
usr.sbin/mfiutil/mfi_volume.c
429
mfi_volume_name(fd, target_id), props.name, av[2]);
usr.sbin/mfiutil/mfi_volume.c
432
if (mfi_ld_set_props(fd, &props) < 0) {
usr.sbin/mfiutil/mfi_volume.c
435
close(fd);
usr.sbin/mfiutil/mfi_volume.c
439
close(fd);
usr.sbin/mfiutil/mfi_volume.c
449
int error, fd;
usr.sbin/mfiutil/mfi_volume.c
458
fd = mfi_open(mfi_device, O_RDONLY);
usr.sbin/mfiutil/mfi_volume.c
459
if (fd < 0) {
usr.sbin/mfiutil/mfi_volume.c
465
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
usr.sbin/mfiutil/mfi_volume.c
468
close(fd);
usr.sbin/mfiutil/mfi_volume.c
473
if (mfi_ld_get_info(fd, target_id, &info, NULL) < 0) {
usr.sbin/mfiutil/mfi_volume.c
476
mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_volume.c
477
close(fd);
usr.sbin/mfiutil/mfi_volume.c
493
mfi_volume_name(fd, target_id));
usr.sbin/mfiutil/mfi_volume.c
494
close(fd);
usr.sbin/mfiutil/mfi_volume.c
76
mfi_ld_get_list(int fd, struct mfi_ld_list *list, uint8_t *statusp)
usr.sbin/mfiutil/mfi_volume.c
79
return (mfi_dcmd_command(fd, MFI_DCMD_LD_GET_LIST, list,
usr.sbin/mfiutil/mfi_volume.c
84
mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info,
usr.sbin/mfiutil/mfi_volume.c
90
return (mfi_dcmd_command(fd, MFI_DCMD_LD_GET_INFO, info,
usr.sbin/mfiutil/mfi_volume.c
95
mfi_ld_get_props(int fd, uint8_t target_id, struct mfi_ld_props *props)
usr.sbin/mfiutil/mfiutil.h
149
const char *mfi_volume_name(int fd, uint8_t target_id);
usr.sbin/mfiutil/mfiutil.h
150
int mfi_volume_busy(int fd, uint8_t target_id);
usr.sbin/mfiutil/mfiutil.h
151
int mfi_config_read(int fd, struct mfi_config_data **configp);
usr.sbin/mfiutil/mfiutil.h
152
int mfi_config_read_opcode(int fd, uint32_t opcode,
usr.sbin/mfiutil/mfiutil.h
154
int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id);
usr.sbin/mfiutil/mfiutil.h
155
int mfi_lookup_volume(int fd, const char *name, uint8_t *target_id);
usr.sbin/mfiutil/mfiutil.h
156
int mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize,
usr.sbin/mfiutil/mfiutil.h
159
int mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp);
usr.sbin/mfiutil/mfiutil.h
160
int mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info,
usr.sbin/mfiutil/mfiutil.h
162
int mfi_ld_get_list(int fd, struct mfi_ld_list *list, uint8_t *statusp);
usr.sbin/mfiutil/mfiutil.h
163
int mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
usr.sbin/mfiutil/mfiutil.h
165
int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp);
usr.sbin/mfiutil/mfiutil.h
173
void dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix);
usr.sbin/mfiutil/mfiutil.h
174
int mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props,
usr.sbin/mfiutil/mfiutil.h
176
int mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props,
usr.sbin/mlx5tool/mlx5tool.c
152
int error, fd, res;
usr.sbin/mlx5tool/mlx5tool.c
155
fd = open(img_fw_path, O_RDONLY);
usr.sbin/mlx5tool/mlx5tool.c
156
if (fd == -1) {
usr.sbin/mlx5tool/mlx5tool.c
161
error = fstat(fd, &st);
usr.sbin/mlx5tool/mlx5tool.c
170
fd, 0);
usr.sbin/mlx5tool/mlx5tool.c
185
close(fd);
usr.sbin/mlxcontrol/command.c
186
int fd, result, ctrlr, sysdrive, statvalid;
usr.sbin/mlxcontrol/command.c
197
if ((fd = open(ctrlrpath(ctrlr), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
200
if (ioctl(fd, MLX_REBUILDSTAT, &rs) < 0) {
usr.sbin/mlxcontrol/command.c
206
close(fd);
usr.sbin/mlxcontrol/command.c
212
if ((fd = open(drivepath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
218
if (ioctl(fd, MLXD_STATUS, &result) < 0) {
usr.sbin/mlxcontrol/command.c
267
close(fd);
usr.sbin/mlxcontrol/command.c
426
int fd;
usr.sbin/mlxcontrol/command.c
429
if ((fd = open(ctrlrpath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
434
if (ioctl(fd, MLX_RESCAN_DRIVES) < 0)
usr.sbin/mlxcontrol/command.c
436
close(fd);
usr.sbin/mlxcontrol/command.c
484
int fd;
usr.sbin/mlxcontrol/command.c
487
if ((fd = open(ctrlrpath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
492
if (ioctl(fd, MLX_DETACH_DRIVE, &unit) < 0)
usr.sbin/mlxcontrol/command.c
494
close(fd);
usr.sbin/mlxcontrol/command.c
549
int unit, fd, result;
usr.sbin/mlxcontrol/command.c
559
if ((fd = open(drivepath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
563
if ((ioctl(fd, MLXD_CHECKASYNC, &result)) < 0) {
usr.sbin/mlxcontrol/command.c
594
int unit, fd;
usr.sbin/mlxcontrol/command.c
611
if ((fd = open(ctrlrpath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
616
if ((ioctl(fd, MLX_REBUILDASYNC, &rb)) < 0) {
usr.sbin/mlxcontrol/command.c
651
int unit, i, ch, fd, cancel = 0;
usr.sbin/mlxcontrol/command.c
687
if ((fd = open(ctrlrpath(unit), 0)) < 0) {
usr.sbin/mlxcontrol/command.c
706
if ((ioctl(fd, MLX_PAUSE_CHANNEL, &mp)) < 0)
usr.sbin/mlxcontrol/command.c
708
close(fd);
usr.sbin/mlxcontrol/interface.c
129
int i, fd;
usr.sbin/mlxcontrol/interface.c
132
if ((fd = open(ctrlrpath(unit), 0)) >= 0) {
usr.sbin/mlxcontrol/interface.c
135
if (ioctl(fd, MLX_NEXT_CHILD, &i) < 0)
usr.sbin/mlxcontrol/interface.c
141
if (ioctl(fd, MLX_GET_SYSDRIVE, &i) == 0)
usr.sbin/mlxcontrol/interface.c
145
close(fd);
usr.sbin/mlxcontrol/interface.c
171
mlx_command(int fd, void *arg)
usr.sbin/mlxcontrol/interface.c
176
error = ioctl(fd, MLX_COMMAND, cmd);
usr.sbin/mlxcontrol/interface.c
47
int i, fd;
usr.sbin/mlxcontrol/interface.c
52
if ((fd = open(ctrlrpath(i), 0)) >= 0)
usr.sbin/mlxcontrol/interface.c
53
close(fd);
usr.sbin/mlxcontrol/interface.c
55
if (fd >= 0) {
usr.sbin/mlxcontrol/interface.c
65
mlx_perform(int unit, void (*func)(int fd, void *arg), void *arg)
usr.sbin/mlxcontrol/interface.c
67
int fd;
usr.sbin/mlxcontrol/interface.c
69
if ((fd = open(ctrlrpath(unit), 0)) >= 0) {
usr.sbin/mlxcontrol/interface.c
70
func(fd, arg);
usr.sbin/mlxcontrol/interface.c
71
close(fd);
usr.sbin/mlxcontrol/interface.c
82
int i, fd, ctrlfd;
usr.sbin/mlxcontrol/interface.c
96
if ((fd = open(drivepath(i), 0)) >= 0)
usr.sbin/mlxcontrol/interface.c
97
close(fd);
usr.sbin/mlxcontrol/interface.c
99
if (fd >= 0) {
usr.sbin/mlxcontrol/mlxcontrol.h
43
extern void mlx_perform(int unit, void (*func)(int fd, void *arg), void *arg);
usr.sbin/mlxcontrol/mlxcontrol.h
44
extern void mlx_command(int fd, void *arg);
usr.sbin/mlxcontrol/mlxcontrol.h
48
extern int mlx_get_device_state(int fd, int channel, int target, struct mlx_phys_drv *drv);
usr.sbin/mountd/mountd.c
1043
int aicode, fd, nhostsbak;
usr.sbin/mountd/mountd.c
1068
fd = sock_fd[sock_fdpos++];
usr.sbin/mountd/mountd.c
1069
if (fd < 0)
usr.sbin/mountd/mountd.c
1077
listen(fd, -1);
usr.sbin/mountd/mountd.c
1080
transp = svc_dg_create(fd, 0, 0);
usr.sbin/mountd/mountd.c
1082
transp = svc_vc_create(fd, RPC_MAXDATASIZE,
usr.sbin/mountd/mountd.c
826
int fd;
usr.sbin/mountd/mountd.c
870
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/mountd/mountd.c
894
close(fd);
usr.sbin/mountd/mountd.c
909
close(fd);
usr.sbin/mountd/mountd.c
919
if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one,
usr.sbin/mountd/mountd.c
977
close(fd);
usr.sbin/mountd/mountd.c
987
close(fd);
usr.sbin/mountd/mountd.c
993
sock_fd[sock_fdcnt - 1] = fd;
usr.sbin/mountd/mountd.c
996
r = bindresvport_sa(fd, res->ai_addr);
usr.sbin/moused/moused/moused.c
1175
int fd;
usr.sbin/moused/moused/moused.c
1177
fd = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
usr.sbin/moused/moused/moused.c
1178
if (fd < 0)
usr.sbin/moused/moused/moused.c
1180
if (connect(fd, (const struct sockaddr *) &sa, sizeof(sa)) < 0) {
usr.sbin/moused/moused/moused.c
1181
close(fd);
usr.sbin/moused/moused/moused.c
1184
EV_SET(&kev, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
usr.sbin/moused/moused/moused.c
1186
close(fd);
usr.sbin/moused/moused/moused.c
1190
return (fd);
usr.sbin/moused/moused/moused.c
1296
r_identify_if(int fd)
usr.sbin/moused/moused/moused.c
1301
ioctl(fd, EVIOCGVERSION, &dummy) >= 0)
usr.sbin/moused/moused/moused.c
1304
ioctl(fd, MOUSE_GETLEVEL, &dummy) >= 0)
usr.sbin/moused/moused/moused.c
1311
r_identify_evdev(int fd)
usr.sbin/moused/moused/moused.c
1322
if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(rel_bits)), rel_bits) < 0 ||
usr.sbin/moused/moused/moused.c
1323
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits) < 0 ||
usr.sbin/moused/moused/moused.c
1324
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits) < 0 ||
usr.sbin/moused/moused/moused.c
1325
ioctl(fd, EVIOCGPROP(sizeof(prop_bits)), prop_bits) < 0) {
usr.sbin/moused/moused/moused.c
1381
r_identify_sysmouse(int fd __unused)
usr.sbin/moused/moused/moused.c
1406
r_init_dev_evdev(int fd, struct device *dev)
usr.sbin/moused/moused/moused.c
1408
if (ioctl(fd, EVIOCGNAME(sizeof(dev->name) - 1), dev->name) < 0) {
usr.sbin/moused/moused/moused.c
1416
if (ioctl(fd, EVIOCGID, &dev->id) < 0) {
usr.sbin/moused/moused/moused.c
1420
(void)ioctl(fd, EVIOCGUNIQ(sizeof(dev->uniq) - 1), dev->uniq);
usr.sbin/moused/moused/moused.c
1426
r_init_dev_sysmouse(int fd, struct device *dev)
usr.sbin/moused/moused/moused.c
1432
if (ioctl(fd, MOUSE_SETLEVEL, &level) < 0) {
usr.sbin/moused/moused/moused.c
1436
if (ioctl(fd, MOUSE_GETLEVEL, &level) < 0) {
usr.sbin/moused/moused/moused.c
1445
if (ioctl(fd, MOUSE_GETMODE, mode) < 0) {
usr.sbin/moused/moused/moused.c
1601
r_init_touchpad_hw(int fd, struct quirks *q, struct tpcaps *tphw,
usr.sbin/moused/moused/moused.c
1612
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits);
usr.sbin/moused/moused/moused.c
1613
ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits);
usr.sbin/moused/moused/moused.c
1616
ioctl(fd, EVIOCGABS(ABS_X), &ai) >= 0) {
usr.sbin/moused/moused/moused.c
1623
ioctl(fd, EVIOCGABS(ABS_Y), &ai) >= 0) {
usr.sbin/moused/moused/moused.c
1643
ioctl(fd, EVIOCGABS(ABS_PRESSURE), &ai) >= 0) {
usr.sbin/moused/moused/moused.c
1675
if ( ioctl(fd, EVIOCGPROP(sizeof(prop_bits)), prop_bits) >= 0 &&
usr.sbin/moused/moused/moused.c
1858
int fd, err;
usr.sbin/moused/moused/moused.c
1863
fd = open(path, O_RDWR | O_NONBLOCK);
usr.sbin/moused/moused/moused.c
1864
if (fd == -1) {
usr.sbin/moused/moused/moused.c
1869
iftype = r_identify_if(fd);
usr.sbin/moused/moused/moused.c
1873
close(fd);
usr.sbin/moused/moused/moused.c
1877
type = r_identify_evdev(fd);
usr.sbin/moused/moused/moused.c
1880
type = r_identify_sysmouse(fd);
usr.sbin/moused/moused/moused.c
1885
close(fd);
usr.sbin/moused/moused/moused.c
1893
close(fd);
usr.sbin/moused/moused/moused.c
1902
close(fd);
usr.sbin/moused/moused/moused.c
1913
err = r_init_dev_evdev(fd, &dev);
usr.sbin/moused/moused/moused.c
1916
err = r_init_dev_sysmouse(fd, &dev);
usr.sbin/moused/moused/moused.c
1926
close(fd);
usr.sbin/moused/moused/moused.c
1939
close(fd);
usr.sbin/moused/moused/moused.c
1950
if (qvalid && grab && ioctl(fd, EVIOCGRAB, 1) == -1) {
usr.sbin/moused/moused/moused.c
1962
if (ioctl(fd, MOUSE_SETMODE, &dev.mode) < 0)
usr.sbin/moused/moused/moused.c
1973
close(fd);
usr.sbin/moused/moused/moused.c
1981
r->mfd = fd;
usr.sbin/moused/moused/moused.c
1983
EV_SET(&kev, fd, EVFILT_READ, EV_ADD, 0, 0, r);
usr.sbin/moused/moused/moused.c
1987
close(fd);
usr.sbin/moused/moused/moused.c
2000
r_init_touchpad_hw(fd, q, &r->tp.hw, &r->ev);
usr.sbin/moused/moused/moused.c
495
static enum device_if r_identify_if(int fd);
usr.sbin/moused/moused/moused.c
496
static enum device_type r_identify_evdev(int fd);
usr.sbin/moused/moused/moused.c
497
static enum device_type r_identify_sysmouse(int fd);
usr.sbin/moused/msconvd/msconvd.c
2576
int fd;
usr.sbin/moused/msconvd/msconvd.c
2584
fd = accept(rodent.mremsfd, (struct sockaddr *) &ad, &ad_len);
usr.sbin/moused/msconvd/msconvd.c
2585
if (fd < 0)
usr.sbin/moused/msconvd/msconvd.c
2589
rodent.mremcfd = fd;
usr.sbin/moused/msconvd/msconvd.c
2593
close(fd);
usr.sbin/moused/msconvd/msconvd.c
398
static int r_uinput_report(int fd, mousestatus_t *act);
usr.sbin/moused/msconvd/msconvd.c
790
int fd;
usr.sbin/moused/msconvd/msconvd.c
793
fd = open("/dev/uinput", O_RDWR | O_NONBLOCK);
usr.sbin/moused/msconvd/msconvd.c
794
if (fd < 0)
usr.sbin/moused/msconvd/msconvd.c
806
if (ioctl(fd, UI_SET_PHYS, phys) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
807
ioctl(fd, UI_DEV_SETUP, &uisetup) < 0)
usr.sbin/moused/msconvd/msconvd.c
811
if (ioctl(fd, UI_SET_EVBIT, EV_SYN) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
812
ioctl(fd, UI_SET_EVBIT, EV_KEY) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
813
ioctl(fd, UI_SET_EVBIT, EV_REL) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
814
ioctl(fd, UI_SET_RELBIT, REL_X) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
815
ioctl(fd, UI_SET_RELBIT, REL_Y) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
816
ioctl(fd, UI_SET_RELBIT, REL_WHEEL) < 0 ||
usr.sbin/moused/msconvd/msconvd.c
817
ioctl(fd, UI_SET_PROPBIT, INPUT_PROP_POINTER) < 0)
usr.sbin/moused/msconvd/msconvd.c
822
if (ioctl(fd, UI_SET_KEYBIT, evdev_buttons[i]) < 0)
usr.sbin/moused/msconvd/msconvd.c
825
if (ioctl(fd, UI_DEV_CREATE) >= 0)
usr.sbin/moused/msconvd/msconvd.c
826
return (fd); /* SUCCESS */
usr.sbin/moused/msconvd/msconvd.c
829
close (fd);
usr.sbin/moused/msconvd/msconvd.c
834
uinput_event(int fd, uint16_t type, uint16_t code, int32_t value)
usr.sbin/moused/msconvd/msconvd.c
845
return (write(fd, &ie, sizeof(ie)));
usr.sbin/moused/msconvd/msconvd.c
849
r_uinput_report(int fd, mousestatus_t *act)
usr.sbin/moused/msconvd/msconvd.c
854
if ((act->dx != 0 && uinput_event(fd, EV_REL, REL_X, act->dx) < 0) ||
usr.sbin/moused/msconvd/msconvd.c
855
(act->dy != 0 && uinput_event(fd, EV_REL, REL_Y, act->dy) < 0) ||
usr.sbin/moused/msconvd/msconvd.c
856
(act->dz != 0 && uinput_event(fd, EV_REL, REL_WHEEL, -act->dz) < 0))
usr.sbin/moused/msconvd/msconvd.c
863
if (uinput_event(fd, EV_KEY, evdev_buttons[i],
usr.sbin/moused/msconvd/msconvd.c
868
if (uinput_event(fd, EV_SYN, SYN_REPORT, 0) < 0)
usr.sbin/mpsutil/mps_cmd.c
259
mps_map_btdh(int fd, uint16_t *devhandle, uint16_t *bus, uint16_t *target)
usr.sbin/mpsutil/mps_cmd.c
268
if ((error = ioctl(fd, MPTIOCTL_BTDH_MAPPING, &map)) != 0) {
usr.sbin/mpsutil/mps_cmd.c
282
mps_set_slot_status(int fd, U16 handle, U16 slot, U32 status)
usr.sbin/mpsutil/mps_cmd.c
295
if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
305
mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mpsutil/mps_cmd.c
318
if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
334
mps_read_ext_config_page_header(int fd, U8 ExtPageType, U8 PageNumber, U32 PageAddress, MPI2_CONFIG_PAGE_HEADER *header, U16 *ExtPageLength, U16 *IOCStatus)
usr.sbin/mpsutil/mps_cmd.c
347
if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
364
mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mpsutil/mps_cmd.c
374
error = mps_read_config_page_header(fd, PageType, PageNumber,
usr.sbin/mpsutil/mps_cmd.c
391
if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
413
mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion,
usr.sbin/mpsutil/mps_cmd.c
426
error = mps_read_ext_config_page_header(fd, ExtPageType, PageNumber,
usr.sbin/mpsutil/mps_cmd.c
445
if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
467
mps_firmware_send(int fd, unsigned char *fw, uint32_t len, bool bios)
usr.sbin/mpsutil/mps_cmd.c
479
if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
487
mps_firmware_get(int fd, unsigned char **firmware, bool bios)
usr.sbin/mpsutil/mps_cmd.c
499
if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
513
if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_cmd.c
525
mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mpsutil/mps_cmd.c
538
if (ioctl(fd, MPSIO_READ_CFG_HEADER, &req) < 0)
usr.sbin/mpsutil/mps_cmd.c
550
mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mpsutil/mps_cmd.c
557
error = mps_read_config_page_header(fd, PageType, PageNumber,
usr.sbin/mpsutil/mps_cmd.c
570
if (ioctl(fd, MPSIO_READ_CFG_PAGE, &req) < 0) {
usr.sbin/mpsutil/mps_cmd.c
591
mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion,
usr.sbin/mpsutil/mps_cmd.c
605
if (ioctl(fd, MPSIO_READ_EXT_CFG_HEADER, &req) < 0)
usr.sbin/mpsutil/mps_cmd.c
621
if (ioctl(fd, MPSIO_READ_EXT_CFG_PAGE, &req) < 0) {
usr.sbin/mpsutil/mps_cmd.c
652
mps_user_command(int fd, void *req, uint32_t req_len, void *reply,
usr.sbin/mpsutil/mps_cmd.c
666
if (ioctl(fd, is_mps ? MPSIO_MPS_COMMAND : MPRIO_MPR_COMMAND, &cmd) < 0)
usr.sbin/mpsutil/mps_cmd.c
672
mps_pass_command(int fd, void *req, uint32_t req_len, void *reply,
usr.sbin/mpsutil/mps_cmd.c
718
if (ioctl(fd, MPTIOCTL_PASS_THRU, &pass) < 0)
usr.sbin/mpsutil/mps_cmd.c
725
mps_get_ioc_factslen(int fd)
usr.sbin/mpsutil/mps_cmd.c
735
error = mps_pass_command(fd, &req, sizeof(MPI2_IOC_FACTS_REQUEST),
usr.sbin/mpsutil/mps_cmd.c
746
mps_get_iocfacts(int fd)
usr.sbin/mpsutil/mps_cmd.c
753
factslen = mps_get_ioc_factslen(fd);
usr.sbin/mpsutil/mps_cmd.c
767
error = mps_pass_command(fd, &req, sizeof(MPI2_IOC_FACTS_REQUEST),
usr.sbin/mpsutil/mps_cmd.c
770
error = mps_user_command(fd, &req, sizeof(MPI2_IOC_FACTS_REQUEST),
usr.sbin/mpsutil/mps_flash.c
103
close(fd);
usr.sbin/mpsutil/mps_flash.c
108
close(fd);
usr.sbin/mpsutil/mps_flash.c
121
int error, fd;
usr.sbin/mpsutil/mps_flash.c
156
fd = open(argv[2], O_RDONLY);
usr.sbin/mpsutil/mps_flash.c
157
if (fd < 0) {
usr.sbin/mpsutil/mps_flash.c
163
mem = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
usr.sbin/mpsutil/mps_flash.c
167
close(fd);
usr.sbin/mpsutil/mps_flash.c
170
close(fd);
usr.sbin/mpsutil/mps_flash.c
172
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_flash.c
173
if (fd < 0) {
usr.sbin/mpsutil/mps_flash.c
180
if ((facts = mps_get_iocfacts(fd)) == NULL) {
usr.sbin/mpsutil/mps_flash.c
183
close(fd);
usr.sbin/mpsutil/mps_flash.c
192
close(fd);
usr.sbin/mpsutil/mps_flash.c
199
close(fd);
usr.sbin/mpsutil/mps_flash.c
211
close(fd);
usr.sbin/mpsutil/mps_flash.c
221
close(fd);
usr.sbin/mpsutil/mps_flash.c
228
if (mps_firmware_send(fd, mem, st.st_size, bios) < 0) {
usr.sbin/mpsutil/mps_flash.c
231
close(fd);
usr.sbin/mpsutil/mps_flash.c
237
close(fd);
usr.sbin/mpsutil/mps_flash.c
50
int error, fd, size;
usr.sbin/mpsutil/mps_flash.c
76
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_flash.c
77
if (fd < 0) {
usr.sbin/mpsutil/mps_flash.c
83
if ((size = mps_firmware_get(fd, &firmware_buffer, bios)) < 0) {
usr.sbin/mpsutil/mps_flash.c
85
close(fd);
usr.sbin/mpsutil/mps_flash.c
89
close(fd);
usr.sbin/mpsutil/mps_flash.c
91
fd = open(firmware_file, O_CREAT | O_TRUNC | O_RDWR, 0644);
usr.sbin/mpsutil/mps_flash.c
92
if (fd <0) {
usr.sbin/mpsutil/mps_flash.c
99
if ((ret = write(fd, firmware_buffer + written, size - written)) <0) {
usr.sbin/mpsutil/mps_set.c
120
close(fd);
usr.sbin/mpsutil/mps_set.c
48
int error, fd;
usr.sbin/mpsutil/mps_set.c
54
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_set.c
55
if (fd < 0) {
usr.sbin/mpsutil/mps_set.c
61
error = mps_read_config_page_header(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 1, 0,
usr.sbin/mpsutil/mps_set.c
69
iounit1 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 1, 0, NULL);
usr.sbin/mpsutil/mps_set.c
98
if (mps_pass_command(fd, &req, sizeof(req) - sizeof(req.PageBufferSGE), &reply, sizeof(reply),
usr.sbin/mpsutil/mps_show.c
105
bios3 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_BIOS, 3, 0, NULL);
usr.sbin/mpsutil/mps_show.c
117
if ((facts = mps_get_iocfacts(fd)) == NULL) {
usr.sbin/mpsutil/mps_show.c
119
close(fd);
usr.sbin/mpsutil/mps_show.c
131
iounit1 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 1, 0, NULL);
usr.sbin/mpsutil/mps_show.c
142
iounit7 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 7, 0, NULL);
usr.sbin/mpsutil/mps_show.c
159
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
160
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
166
sas0 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
173
close(fd);
usr.sbin/mpsutil/mps_show.c
177
sas1 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
184
close(fd);
usr.sbin/mpsutil/mps_show.c
226
close(fd);
usr.sbin/mpsutil/mps_show.c
238
int error, fd;
usr.sbin/mpsutil/mps_show.c
240
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
241
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
247
if ((facts = mps_get_iocfacts(fd)) == NULL) {
usr.sbin/mpsutil/mps_show.c
249
close(fd);
usr.sbin/mpsutil/mps_show.c
321
int unit, fd, error;
usr.sbin/mpsutil/mps_show.c
325
fd = mps_open(unit);
usr.sbin/mpsutil/mps_show.c
326
if (fd < 0)
usr.sbin/mpsutil/mps_show.c
328
facts = mps_get_iocfacts(fd);
usr.sbin/mpsutil/mps_show.c
332
close(fd);
usr.sbin/mpsutil/mps_show.c
335
man0 = mps_read_man_page(fd, 0, NULL);
usr.sbin/mpsutil/mps_show.c
339
close(fd);
usr.sbin/mpsutil/mps_show.c
345
close(fd);
usr.sbin/mpsutil/mps_show.c
355
close(fd);
usr.sbin/mpsutil/mps_show.c
518
int fd, error, nphys;
usr.sbin/mpsutil/mps_show.c
520
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
521
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
527
sas0 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
542
device = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
552
close(fd);
usr.sbin/mpsutil/mps_show.c
564
error = mps_map_btdh(fd, &handle, &bus, &target);
usr.sbin/mpsutil/mps_show.c
583
exp1 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
595
close(fd);
usr.sbin/mpsutil/mps_show.c
628
close(fd);
usr.sbin/mpsutil/mps_show.c
639
int fd, error, issep;
usr.sbin/mpsutil/mps_show.c
641
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
642
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
651
enc = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
661
close(fd);
usr.sbin/mpsutil/mps_show.c
677
close(fd);
usr.sbin/mpsutil/mps_show.c
690
int fd, error, nphys, i;
usr.sbin/mpsutil/mps_show.c
692
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
693
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
702
exp0 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
712
close(fd);
usr.sbin/mpsutil/mps_show.c
734
exp1 = mps_read_extended_config_page(fd,
usr.sbin/mpsutil/mps_show.c
74
int error, fd, v, i;
usr.sbin/mpsutil/mps_show.c
769
close(fd);
usr.sbin/mpsutil/mps_show.c
784
int fd, error, len, attrs;
usr.sbin/mpsutil/mps_show.c
787
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
788
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
81
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_show.c
813
data = mps_read_extended_config_page(fd, page, 0, num, addr,
usr.sbin/mpsutil/mps_show.c
816
data = mps_read_config_page(fd, page, num, addr, &IOCStatus);
usr.sbin/mpsutil/mps_show.c
82
if (fd < 0) {
usr.sbin/mpsutil/mps_show.c
850
close(fd);
usr.sbin/mpsutil/mps_show.c
88
man0 = mps_read_man_page(fd, 0, NULL);
usr.sbin/mpsutil/mps_slot.c
101
if (mps_set_slot_status(fd, htole16(handle), htole16(slot),
usr.sbin/mpsutil/mps_slot.c
104
close(fd);
usr.sbin/mpsutil/mps_slot.c
108
close(fd);
usr.sbin/mpsutil/mps_slot.c
54
int fd;
usr.sbin/mpsutil/mps_slot.c
94
fd = mps_open(mps_unit);
usr.sbin/mpsutil/mps_slot.c
95
if (fd < 0) {
usr.sbin/mpsutil/mpsutil.h
110
int mps_user_command(int fd, void *req, uint32_t req_len, void *reply,
usr.sbin/mpsutil/mpsutil.h
112
int mps_pass_command(int fd, void *req, uint32_t req_len, void *reply,
usr.sbin/mpsutil/mpsutil.h
115
int mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber,
usr.sbin/mpsutil/mpsutil.h
117
int mps_read_ext_config_page_header(int fd, U8 ExtPageType, U8 PageNumber,
usr.sbin/mpsutil/mpsutil.h
120
void *mps_read_config_page(int fd, U8 PageType, U8 PageNumber,
usr.sbin/mpsutil/mpsutil.h
122
void *mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion,
usr.sbin/mpsutil/mpsutil.h
124
int mps_map_btdh(int fd, uint16_t *devhandle, uint16_t *bus,
usr.sbin/mpsutil/mpsutil.h
127
int mps_firmware_send(int fd, unsigned char *buf, uint32_t len, bool bios);
usr.sbin/mpsutil/mpsutil.h
128
int mps_firmware_get(int fd, unsigned char **buf, bool bios);
usr.sbin/mpsutil/mpsutil.h
129
int mps_set_slot_status(int fd, U16 handle, U16 slot, U32 status);
usr.sbin/mpsutil/mpsutil.h
132
mps_read_man_page(int fd, U8 PageNumber, U16 *IOCStatus)
usr.sbin/mpsutil/mpsutil.h
135
return (mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_MANUFACTURING,
usr.sbin/mpsutil/mpsutil.h
140
mps_read_ioc_page(int fd, U8 PageNumber, U16 *IOCStatus)
usr.sbin/mpsutil/mpsutil.h
143
return (mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IOC, PageNumber,
usr.sbin/mpsutil/mpsutil.h
154
MPI2_IOC_FACTS_REPLY * mps_get_iocfacts(int fd);
usr.sbin/mptutil/mpt_cam.c
388
mpt_fetch_disks(int fd, int *ndisks, struct mpt_standalone_disk **disksp)
usr.sbin/mptutil/mpt_cam.c
481
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_cmd.c
294
mpt_lookup_volume(int fd, const char *name, U8 *VolumeBus, U8 *VolumeID)
usr.sbin/mptutil/mpt_cmd.c
326
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_cmd.c
346
mpt_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mptutil/mpt_cmd.c
357
if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0)
usr.sbin/mptutil/mpt_cmd.c
372
mpt_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress,
usr.sbin/mptutil/mpt_cmd.c
385
if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0)
usr.sbin/mptutil/mpt_cmd.c
400
if (ioctl(fd, MPTIO_READ_CFG_PAGE, &req) < 0) {
usr.sbin/mptutil/mpt_cmd.c
420
mpt_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion,
usr.sbin/mptutil/mpt_cmd.c
434
if (ioctl(fd, MPTIO_READ_EXT_CFG_HEADER, &req) < 0)
usr.sbin/mptutil/mpt_cmd.c
449
if (ioctl(fd, MPTIO_READ_EXT_CFG_PAGE, &req) < 0) {
usr.sbin/mptutil/mpt_cmd.c
469
mpt_write_config_page(int fd, void *buf, U16 *IOCStatus)
usr.sbin/mptutil/mpt_cmd.c
480
if (ioctl(fd, MPTIO_WRITE_CFG_PAGE, &req) < 0)
usr.sbin/mptutil/mpt_cmd.c
495
mpt_raid_action(int fd, U8 Action, U8 VolumeBus, U8 VolumeID, U8 PhysDiskNum,
usr.sbin/mptutil/mpt_cmd.c
517
if (ioctl(fd, MPTIO_RAID_ACTION, &raid_act) < 0)
usr.sbin/mptutil/mpt_config.c
1000
error = mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS, 0,
usr.sbin/mptutil/mpt_config.c
1005
close(fd);
usr.sbin/mptutil/mpt_config.c
1010
close(fd);
usr.sbin/mptutil/mpt_config.c
1022
int error, fd;
usr.sbin/mptutil/mpt_config.c
1029
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
1030
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
1036
list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_config.c
1038
close(fd);
usr.sbin/mptutil/mpt_config.c
1045
close(fd);
usr.sbin/mptutil/mpt_config.c
1051
info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_config.c
1055
close(fd);
usr.sbin/mptutil/mpt_config.c
1062
close(fd);
usr.sbin/mptutil/mpt_config.c
1066
if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_config.c
1070
close(fd);
usr.sbin/mptutil/mpt_config.c
1078
close(fd);
usr.sbin/mptutil/mpt_config.c
1091
int error, fd, i, ndisks;
usr.sbin/mptutil/mpt_config.c
1099
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
1100
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
1106
error = mpt_fetch_disks(fd, &ndisks, &disks);
usr.sbin/mptutil/mpt_config.c
1121
if (mpt_create_physdisk(fd, &disks[i], &PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_config.c
1130
close(fd);
usr.sbin/mptutil/mpt_config.c
1141
int error, fd;
usr.sbin/mptutil/mpt_config.c
1149
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
1150
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
1156
list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_config.c
1167
info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_config.c
1174
if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_config.c
1184
close(fd);
usr.sbin/mptutil/mpt_config.c
1225
int error, fd;
usr.sbin/mptutil/mpt_config.c
1232
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
1233
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
1239
error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_config.c
1245
vol = mpt_vol_info(fd, VolumeBus, VolumeID, NULL);
usr.sbin/mptutil/mpt_config.c
1254
close(fd);
usr.sbin/mptutil/mpt_config.c
179
mpt_create_physdisk(int fd, struct mpt_standalone_disk *disk, U8 *PhysDiskNum)
usr.sbin/mptutil/mpt_config.c
186
error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK,
usr.sbin/mptutil/mpt_config.c
205
error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0,
usr.sbin/mptutil/mpt_config.c
215
mpt_delete_physdisk(int fd, U8 PhysDiskNum)
usr.sbin/mptutil/mpt_config.c
218
return (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_PHYSDISK, 0, 0,
usr.sbin/mptutil/mpt_config.c
235
int ch, error, fd, i;
usr.sbin/mptutil/mpt_config.c
237
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
238
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
244
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_config.c
248
close(fd);
usr.sbin/mptutil/mpt_config.c
259
close(fd);
usr.sbin/mptutil/mpt_config.c
271
close(fd);
usr.sbin/mptutil/mpt_config.c
278
error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME,
usr.sbin/mptutil/mpt_config.c
290
ioc5 = mpt_read_ioc_page(fd, 5, NULL);
usr.sbin/mptutil/mpt_config.c
296
if (mpt_delete_physdisk(fd, spare->PhysDiskNum) < 0)
usr.sbin/mptutil/mpt_config.c
303
ioc3 = mpt_read_ioc_page(fd, 3, NULL);
usr.sbin/mptutil/mpt_config.c
309
if (mpt_delete_physdisk(fd, disk->PhysDiskNum) < 0)
usr.sbin/mptutil/mpt_config.c
317
close(fd);
usr.sbin/mptutil/mpt_config.c
361
parse_volume(int fd, int raid_type, struct config_id_state *state,
usr.sbin/mptutil/mpt_config.c
414
dinfo->info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_config.c
442
add_drives(int fd, struct volume_info *info, int verbose)
usr.sbin/mptutil/mpt_config.c
451
if (mpt_create_physdisk(fd, dinfo->sdisk,
usr.sbin/mptutil/mpt_config.c
463
dinfo->info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_config.c
504
build_volume(int fd, struct volume_info *info, int raid_type, long stripe_size,
usr.sbin/mptutil/mpt_config.c
516
error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME,
usr.sbin/mptutil/mpt_config.c
627
int ch, error, fd, i, quick, raid_type, verbose;
usr.sbin/mptutil/mpt_config.c
637
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
638
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
654
close(fd);
usr.sbin/mptutil/mpt_config.c
681
close(fd);
usr.sbin/mptutil/mpt_config.c
690
close(fd);
usr.sbin/mptutil/mpt_config.c
698
state.ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_config.c
702
close(fd);
usr.sbin/mptutil/mpt_config.c
705
state.list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_config.c
707
close(fd);
usr.sbin/mptutil/mpt_config.c
710
error = mpt_fetch_disks(fd, &state.nsdisks, &state.sdisks);
usr.sbin/mptutil/mpt_config.c
713
close(fd);
usr.sbin/mptutil/mpt_config.c
721
close(fd);
usr.sbin/mptutil/mpt_config.c
726
close(fd);
usr.sbin/mptutil/mpt_config.c
729
error = parse_volume(fd, raid_type, &state, av[0], info);
usr.sbin/mptutil/mpt_config.c
732
close(fd);
usr.sbin/mptutil/mpt_config.c
737
error = add_drives(fd, info, verbose);
usr.sbin/mptutil/mpt_config.c
740
close(fd);
usr.sbin/mptutil/mpt_config.c
745
vol = build_volume(fd, info, raid_type, stripe_size, &state, verbose);
usr.sbin/mptutil/mpt_config.c
748
close(fd);
usr.sbin/mptutil/mpt_config.c
760
error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus,
usr.sbin/mptutil/mpt_config.c
767
close(fd);
usr.sbin/mptutil/mpt_config.c
782
close(fd);
usr.sbin/mptutil/mpt_config.c
792
int error, fd;
usr.sbin/mptutil/mpt_config.c
799
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
800
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
806
error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_config.c
809
close(fd);
usr.sbin/mptutil/mpt_config.c
814
close(fd);
usr.sbin/mptutil/mpt_config.c
818
error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, VolumeBus,
usr.sbin/mptutil/mpt_config.c
824
close(fd);
usr.sbin/mptutil/mpt_config.c
829
close(fd);
usr.sbin/mptutil/mpt_config.c
836
find_volume_spare_pool(int fd, const char *name, int *pool)
usr.sbin/mptutil/mpt_config.c
844
error = mpt_lookup_volume(fd, name, &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_config.c
850
info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL);
usr.sbin/mptutil/mpt_config.c
871
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_config.c
880
info = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL);
usr.sbin/mptutil/mpt_config.c
898
info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL);
usr.sbin/mptutil/mpt_config.c
902
error = mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS,
usr.sbin/mptutil/mpt_config.c
924
int error, fd, i, nsdisks, pool;
usr.sbin/mptutil/mpt_config.c
935
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_config.c
936
if (fd < 0) {
usr.sbin/mptutil/mpt_config.c
943
error = find_volume_spare_pool(fd, av[2], &pool);
usr.sbin/mptutil/mpt_config.c
945
close(fd);
usr.sbin/mptutil/mpt_config.c
951
list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_config.c
957
error = mpt_fetch_disks(fd, &nsdisks, &sdisks);
usr.sbin/mptutil/mpt_config.c
961
close(fd);
usr.sbin/mptutil/mpt_config.c
970
close(fd);
usr.sbin/mptutil/mpt_config.c
976
close(fd);
usr.sbin/mptutil/mpt_config.c
980
if (mpt_create_physdisk(fd, &sdisks[i], &PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_config.c
984
close(fd);
usr.sbin/mptutil/mpt_config.c
991
info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_config.c
995
close(fd);
usr.sbin/mptutil/mpt_drive.c
108
mpt_pd_insert(int fd, struct mpt_drive_list *list, U8 PhysDiskNum)
usr.sbin/mptutil/mpt_drive.c
129
list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_drive.c
137
mpt_pd_list(int fd)
usr.sbin/mptutil/mpt_drive.c
151
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_drive.c
159
ioc3 = mpt_read_ioc_page(fd, 3, NULL);
usr.sbin/mptutil/mpt_drive.c
168
ioc5 = mpt_read_ioc_page(fd, 5, NULL);
usr.sbin/mptutil/mpt_drive.c
186
volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID,
usr.sbin/mptutil/mpt_drive.c
210
if (mpt_pd_insert(fd, list, rdisk->PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_drive.c
225
if (mpt_pd_insert(fd, list, spare->PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_drive.c
235
if (mpt_pd_insert(fd, list, disk->PhysDiskNum) < 0) {
usr.sbin/mptutil/mpt_drive.c
331
int error, fd;
usr.sbin/mptutil/mpt_drive.c
333
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_drive.c
334
if (fd < 0) {
usr.sbin/mptutil/mpt_drive.c
340
list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_drive.c
342
close(fd);
usr.sbin/mptutil/mpt_drive.c
349
close(fd);
usr.sbin/mptutil/mpt_drive.c
355
info = mpt_pd_info(fd, PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_drive.c
359
close(fd);
usr.sbin/mptutil/mpt_drive.c
367
close(fd);
usr.sbin/mptutil/mpt_drive.c
371
error = mpt_raid_action(fd, Action, 0, 0, PhysDiskNum, 0, NULL, 0, NULL,
usr.sbin/mptutil/mpt_drive.c
376
close(fd);
usr.sbin/mptutil/mpt_drive.c
381
close(fd);
usr.sbin/mptutil/mpt_evt.c
105
log = mpt_get_events(fd, NULL);
usr.sbin/mptutil/mpt_evt.c
125
close(fd);
usr.sbin/mptutil/mpt_evt.c
136
close(fd);
usr.sbin/mptutil/mpt_evt.c
160
close(fd);
usr.sbin/mptutil/mpt_evt.c
43
mpt_get_events(int fd, U16 *IOCStatus)
usr.sbin/mptutil/mpt_evt.c
46
return (mpt_read_extended_config_page(fd, MPI_CONFIG_EXTPAGETYPE_LOG,
usr.sbin/mptutil/mpt_evt.c
96
int ch, error, fd, i, num_events, verbose;
usr.sbin/mptutil/mpt_evt.c
98
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_evt.c
99
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
105
close(fd);
usr.sbin/mptutil/mpt_show.c
116
ioc2 = mpt_read_ioc_page(fd, 2, &IOCStatus);
usr.sbin/mptutil/mpt_show.c
163
ioc6 = mpt_read_ioc_page(fd, 6, &IOCStatus);
usr.sbin/mptutil/mpt_show.c
188
close(fd);
usr.sbin/mptutil/mpt_show.c
290
int error, fd, i, j, nsdisks;
usr.sbin/mptutil/mpt_show.c
297
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_show.c
298
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
305
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_show.c
306
ioc5 = mpt_read_ioc_page(fd, 5, NULL);
usr.sbin/mptutil/mpt_show.c
311
close(fd);
usr.sbin/mptutil/mpt_show.c
314
if (mpt_fetch_disks(fd, &nsdisks, &sdisks) < 0) {
usr.sbin/mptutil/mpt_show.c
319
close(fd);
usr.sbin/mptutil/mpt_show.c
331
vinfo = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL);
usr.sbin/mptutil/mpt_show.c
336
vnames = mpt_vol_names(fd, vol->VolumeBus, vol->VolumeID, NULL);
usr.sbin/mptutil/mpt_show.c
350
pinfo = mpt_pd_info(fd, disk->PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_show.c
368
pinfo = mpt_pd_info(fd, spare->PhysDiskNum, NULL);
usr.sbin/mptutil/mpt_show.c
383
close(fd);
usr.sbin/mptutil/mpt_show.c
396
int error, fd, i, len, state_len;
usr.sbin/mptutil/mpt_show.c
403
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_show.c
404
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
411
ioc2 = mpt_read_ioc_page(fd, 2, NULL);
usr.sbin/mptutil/mpt_show.c
426
volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID,
usr.sbin/mptutil/mpt_show.c
463
vnames = mpt_vol_names(fd, vol->VolumeBus, vol->VolumeID, NULL);
usr.sbin/mptutil/mpt_show.c
473
close(fd);
usr.sbin/mptutil/mpt_show.c
484
int error, fd, i, len, nsdisks, state_len;
usr.sbin/mptutil/mpt_show.c
491
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_show.c
492
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
499
list = mpt_pd_list(fd);
usr.sbin/mptutil/mpt_show.c
502
close(fd);
usr.sbin/mptutil/mpt_show.c
509
if (mpt_fetch_disks(fd, &nsdisks, &sdisks) != 0) {
usr.sbin/mptutil/mpt_show.c
538
close(fd);
usr.sbin/mptutil/mpt_show.c
550
int error, fd, i;
usr.sbin/mptutil/mpt_show.c
557
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_show.c
558
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
566
pinfo = mpt_pd_info(fd, i, &IOCStatus);
usr.sbin/mptutil/mpt_show.c
579
close(fd);
usr.sbin/mptutil/mpt_show.c
81
int comma, error, fd;
usr.sbin/mptutil/mpt_show.c
88
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_show.c
89
if (fd < 0) {
usr.sbin/mptutil/mpt_show.c
95
man0 = mpt_read_man_page(fd, 0, NULL);
usr.sbin/mptutil/mpt_show.c
99
close(fd);
usr.sbin/mptutil/mpt_volume.c
100
close(fd);
usr.sbin/mptutil/mpt_volume.c
107
close(fd);
usr.sbin/mptutil/mpt_volume.c
116
if (mpt_write_config_page(fd, vnames, NULL) < 0) {
usr.sbin/mptutil/mpt_volume.c
120
close(fd);
usr.sbin/mptutil/mpt_volume.c
125
close(fd);
usr.sbin/mptutil/mpt_volume.c
139
int error, fd;
usr.sbin/mptutil/mpt_volume.c
147
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_volume.c
148
if (fd < 0) {
usr.sbin/mptutil/mpt_volume.c
154
error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_volume.c
157
close(fd);
usr.sbin/mptutil/mpt_volume.c
161
error = mpt_raid_action(fd, MPI_RAID_ACTION_INDICATOR_STRUCT, VolumeBus,
usr.sbin/mptutil/mpt_volume.c
166
close(fd);
usr.sbin/mptutil/mpt_volume.c
195
close(fd);
usr.sbin/mptutil/mpt_volume.c
207
int error, fd;
usr.sbin/mptutil/mpt_volume.c
224
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_volume.c
225
if (fd < 0) {
usr.sbin/mptutil/mpt_volume.c
231
error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_volume.c
234
close(fd);
usr.sbin/mptutil/mpt_volume.c
238
volume = mpt_vol_info(fd, VolumeBus, VolumeID, NULL);
usr.sbin/mptutil/mpt_volume.c
240
close(fd);
usr.sbin/mptutil/mpt_volume.c
255
close(fd);
usr.sbin/mptutil/mpt_volume.c
260
error = mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS,
usr.sbin/mptutil/mpt_volume.c
266
close(fd);
usr.sbin/mptutil/mpt_volume.c
71
int error, fd;
usr.sbin/mptutil/mpt_volume.c
83
fd = mpt_open(mpt_unit);
usr.sbin/mptutil/mpt_volume.c
84
if (fd < 0) {
usr.sbin/mptutil/mpt_volume.c
90
error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID);
usr.sbin/mptutil/mpt_volume.c
96
vnames = mpt_vol_names(fd, VolumeBus, VolumeID, NULL);
usr.sbin/mptutil/mptutil.h
100
int mpt_read_config_page_header(int fd, U8 PageType, U8 PageNumber,
usr.sbin/mptutil/mptutil.h
102
void *mpt_read_config_page(int fd, U8 PageType, U8 PageNumber,
usr.sbin/mptutil/mptutil.h
104
void *mpt_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion,
usr.sbin/mptutil/mptutil.h
106
int mpt_write_config_page(int fd, void *buf, U16 *IOCStatus);
usr.sbin/mptutil/mptutil.h
108
int mpt_raid_action(int fd, U8 Action, U8 VolumeBus, U8 VolumeID,
usr.sbin/mptutil/mptutil.h
118
struct mpt_drive_list *mpt_pd_list(int fd);
usr.sbin/mptutil/mptutil.h
122
int mpt_fetch_disks(int fd, int *ndisks,
usr.sbin/mptutil/mptutil.h
127
int mpt_lookup_volume(int fd, const char *name, U8 *VolumeBus,
usr.sbin/mptutil/mptutil.h
132
mpt_read_man_page(int fd, U8 PageNumber, U16 *IOCStatus)
usr.sbin/mptutil/mptutil.h
135
return (mpt_read_config_page(fd, MPI_CONFIG_PAGETYPE_MANUFACTURING,
usr.sbin/mptutil/mptutil.h
140
mpt_read_ioc_page(int fd, U8 PageNumber, U16 *IOCStatus)
usr.sbin/mptutil/mptutil.h
143
return (mpt_read_config_page(fd, MPI_CONFIG_PAGETYPE_IOC, PageNumber,
usr.sbin/mptutil/mptutil.h
155
mpt_vol_info(int fd, U8 VolumeBus, U8 VolumeID, U16 *IOCStatus)
usr.sbin/mptutil/mptutil.h
158
return (mpt_read_config_page(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, 0,
usr.sbin/mptutil/mptutil.h
163
mpt_vol_names(int fd, U8 VolumeBus, U8 VolumeID, U16 *IOCStatus)
usr.sbin/mptutil/mptutil.h
166
return (mpt_read_config_page(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, 1,
usr.sbin/mptutil/mptutil.h
171
mpt_pd_info(int fd, U8 PhysDiskNum, U16 *IOCStatus)
usr.sbin/mptutil/mptutil.h
174
return (mpt_read_config_page(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, 0,
usr.sbin/newsyslog/newsyslog.c
1588
validate_old_timelog(int fd, const struct dirent *dp, const char *logfname,
usr.sbin/newsyslog/newsyslog.c
1605
fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 ||
usr.sbin/newsyslog/newsyslog.c
2746
int fd, failed;
usr.sbin/newsyslog/newsyslog.c
2750
fd = -1;
usr.sbin/newsyslog/newsyslog.c
2785
fd = mkstemp(tempfile);
usr.sbin/newsyslog/newsyslog.c
2786
if (fd < 0)
usr.sbin/newsyslog/newsyslog.c
2804
failed = fchown(fd, ent->uid, ent->gid);
usr.sbin/newsyslog/newsyslog.c
2815
failed = fchflags(fd, UF_NODUMP);
usr.sbin/newsyslog/newsyslog.c
2836
failed = fchmod(fd, ent->permissions);
usr.sbin/newsyslog/newsyslog.c
2844
if (fd >= 0)
usr.sbin/newsyslog/newsyslog.c
2845
close(fd);
usr.sbin/ngctl/main.c
277
{ .fd = csock, .events = POLLIN },
usr.sbin/ngctl/main.c
278
{ .fd = dsock, .events = POLLIN },
usr.sbin/ngctl/main.c
383
{ .fd = csock, .events = POLLIN },
usr.sbin/ngctl/main.c
384
{ .fd = dsock, .events = POLLIN },
usr.sbin/ngctl/main.c
385
{ .fd = STDIN_FILENO, .events = POLLIN },
usr.sbin/ngctl/msg.c
67
{ .fd = csock, .events = POLLIN },
usr.sbin/nscd/nscd.c
230
int fd;
usr.sbin/nscd/nscd.c
237
fd = accept(event_data->ident, NULL, NULL);
usr.sbin/nscd/nscd.c
238
if (fd == -1) {
usr.sbin/nscd/nscd.c
245
if (getpeereid(fd, &euid, &egid) != 0) {
usr.sbin/nscd/nscd.c
252
qstate = init_query_state(fd, sizeof(int), euid, egid);
usr.sbin/nscd/nscd.c
260
EV_SET(&eventlist[0], fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT,
usr.sbin/nscd/nscd.c
262
EV_SET(&eventlist[1], fd, EVFILT_READ, EV_ADD | EV_ONESHOT,
usr.sbin/nvram/nvram.c
103
fd = open(DEVICE_NAME, O_RDWR);
usr.sbin/nvram/nvram.c
104
if (fd == -1)
usr.sbin/nvram/nvram.c
107
res = read(fd, buf + i, sizeof(buf) - i);
usr.sbin/nvram/nvram.c
160
res = write(fd, buf + i, sizeof(buf) - i);
usr.sbin/nvram/nvram.c
170
if (close(fd) == -1)
usr.sbin/nvram/nvram.c
60
int opt, dump, fd, res, i, size;
usr.sbin/ofwdump/ofw_util.c
102
ofw_finddevice(int fd, const char *name)
usr.sbin/ofwdump/ofw_util.c
111
if (ioctl(fd, OFIOCFINDDEVICE, &d) == -1) {
usr.sbin/ofwdump/ofw_util.c
122
ofw_firstprop(int fd, phandle_t node, char *buf, int buflen)
usr.sbin/ofwdump/ofw_util.c
125
return (ofw_nextprop(fd, node, NULL, buf, buflen));
usr.sbin/ofwdump/ofw_util.c
129
ofw_nextprop(int fd, phandle_t node, const char *prev, char *buf, int buflen)
usr.sbin/ofwdump/ofw_util.c
138
if (ioctl(fd, OFIOCNEXTPROP, &d) == -1) {
usr.sbin/ofwdump/ofw_util.c
158
ofw_getprop(int fd, phandle_t node, const char *name, void *buf, int buflen)
usr.sbin/ofwdump/ofw_util.c
167
OFW_IOCTL(fd, OFIOCGET, &d);
usr.sbin/ofwdump/ofw_util.c
172
ofw_setprop(int fd, phandle_t node, const char *name, const void *buf,
usr.sbin/ofwdump/ofw_util.c
183
OFW_IOCTL(fd, OFIOCSET, &d);
usr.sbin/ofwdump/ofw_util.c
189
ofw_getproplen(int fd, phandle_t node, const char *name)
usr.sbin/ofwdump/ofw_util.c
196
OFW_IOCTL(fd, OFIOCGETPROPLEN, &d);
usr.sbin/ofwdump/ofw_util.c
201
ofw_getprop_alloc(int fd, phandle_t node, const char *name, void **buf,
usr.sbin/ofwdump/ofw_util.c
208
len = ofw_getproplen(fd, node, name);
usr.sbin/ofwdump/ofw_util.c
222
rv = ioctl(fd, OFIOCGET, &d);
usr.sbin/ofwdump/ofw_util.c
43
#define OFW_IOCTL(fd, cmd, val) do { \
usr.sbin/ofwdump/ofw_util.c
44
if (ioctl(fd, cmd, val) == -1) \
usr.sbin/ofwdump/ofw_util.c
51
int fd;
usr.sbin/ofwdump/ofw_util.c
53
if ((fd = open(PATH_DEV_OPENFIRM, mode)) == -1)
usr.sbin/ofwdump/ofw_util.c
55
return (fd);
usr.sbin/ofwdump/ofw_util.c
59
ofw_close(int fd)
usr.sbin/ofwdump/ofw_util.c
62
close(fd);
usr.sbin/ofwdump/ofw_util.c
66
ofw_root(int fd)
usr.sbin/ofwdump/ofw_util.c
69
return (ofw_peer(fd, 0));
usr.sbin/ofwdump/ofw_util.c
73
ofw_optnode(int fd)
usr.sbin/ofwdump/ofw_util.c
77
OFW_IOCTL(fd, OFIOCGETOPTNODE, &rv);
usr.sbin/ofwdump/ofw_util.c
82
ofw_peer(int fd, phandle_t node)
usr.sbin/ofwdump/ofw_util.c
87
OFW_IOCTL(fd, OFIOCGETNEXT, &rv);
usr.sbin/ofwdump/ofw_util.c
92
ofw_child(int fd, phandle_t node)
usr.sbin/ofwdump/ofw_util.c
97
OFW_IOCTL(fd, OFIOCGETCHILD, &rv);
usr.sbin/ofwdump/ofwdump.c
116
fd = ofw_open(O_RDONLY);
usr.sbin/ofwdump/ofwdump.c
120
ofw_dump(fd, NULL, rflag, pflag, Parg, Rflag, Sflag);
usr.sbin/ofwdump/ofwdump.c
127
ofw_dump(fd, argv[i], rflag, pflag, Parg, Rflag, Sflag);
usr.sbin/ofwdump/ofwdump.c
129
ofw_close(fd);
usr.sbin/ofwdump/ofwdump.c
143
ofw_dump_properties(int fd, phandle_t n, int level, bool raw, bool str)
usr.sbin/ofwdump/ofwdump.c
148
for (nlen = ofw_firstprop(fd, n, prop, sizeof(prop)); nlen != 0;
usr.sbin/ofwdump/ofwdump.c
149
nlen = ofw_nextprop(fd, n, prop, prop, sizeof(prop)))
usr.sbin/ofwdump/ofwdump.c
150
ofw_dump_property(fd, n, level, prop, raw, str);
usr.sbin/ofwdump/ofwdump.c
154
ofw_dump_property(int fd, phandle_t n, int level, const char *prop, bool raw,
usr.sbin/ofwdump/ofwdump.c
163
len = ofw_getprop_alloc(fd, n, prop, &pbuf, &pblen, 1);
usr.sbin/ofwdump/ofwdump.c
210
ofw_dump_node(int fd, phandle_t n, int level, int rec, int prop,
usr.sbin/ofwdump/ofwdump.c
221
plen = ofw_getprop_alloc(fd, n, "name", &nbuf, &nblen, 1);
usr.sbin/ofwdump/ofwdump.c
229
ofw_dump_property(fd, n, level, pmatch, raw, str);
usr.sbin/ofwdump/ofwdump.c
231
ofw_dump_properties(fd, n, level, raw, str);
usr.sbin/ofwdump/ofwdump.c
234
for (c = ofw_child(fd, n); c != 0; c = ofw_peer(fd, c)) {
usr.sbin/ofwdump/ofwdump.c
235
ofw_dump_node(fd, c, level + 1, rec, prop, pmatch,
usr.sbin/ofwdump/ofwdump.c
242
ofw_dump(int fd, const char *start, bool rec, bool prop, const char *pmatch,
usr.sbin/ofwdump/ofwdump.c
247
n = start == NULL ? ofw_root(fd) : ofw_finddevice(fd, start);
usr.sbin/ofwdump/ofwdump.c
248
ofw_dump_node(fd, n, 0, rec, prop, pmatch, raw, str);
usr.sbin/ofwdump/ofwdump.c
52
static void ofw_dump_property(int fd, phandle_t n, int level,
usr.sbin/ofwdump/ofwdump.c
69
int opt, i, fd;
usr.sbin/pciconf/cap.c
1000
cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4);
usr.sbin/pciconf/cap.c
1009
ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
1018
low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4);
usr.sbin/pciconf/cap.c
1019
high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
usr.sbin/pciconf/cap.c
1024
ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
1030
val = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
1032
hdr = read_config(fd, &p->pc_sel, ptr + PCIR_VSEC_HEADER, 4);
usr.sbin/pciconf/cap.c
1045
val = read_config(fd, &p->pc_sel, ptr + i, 4);
usr.sbin/pciconf/cap.c
1058
ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
1067
val = read_config(fd, &p->pc_sel, ptr + 8, 4);
usr.sbin/pciconf/cap.c
1079
ecap_sriov(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
1088
iov_ctl = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_CTL, 2);
usr.sbin/pciconf/cap.c
1094
total_vfs = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_TOTAL_VFS, 2);
usr.sbin/pciconf/cap.c
1095
num_vfs = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_NUM_VFS, 2);
usr.sbin/pciconf/cap.c
1099
vf_offset = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_OFF, 2);
usr.sbin/pciconf/cap.c
1100
vf_stride = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_STRIDE, 2);
usr.sbin/pciconf/cap.c
1105
vf_did = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_VF_DID, 2);
usr.sbin/pciconf/cap.c
1108
page_caps = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_PAGE_CAP, 4);
usr.sbin/pciconf/cap.c
1109
page_size = read_config(fd, &p->pc_sel, ptr + PCIR_SRIOV_PAGE_SIZE, 4);
usr.sbin/pciconf/cap.c
1130
print_bar(fd, p, "iov bar ", ptr + PCIR_SRIOV_BAR(i));
usr.sbin/pciconf/cap.c
1144
ecap_acs(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
1159
acs_cap = read_config(fd, &p->pc_sel, ptr + PCIR_ACS_CAP, 2);
usr.sbin/pciconf/cap.c
1160
acs_ctl = read_config(fd, &p->pc_sel, ptr + PCIR_ACS_CTL, 2);
usr.sbin/pciconf/cap.c
119
cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)
usr.sbin/pciconf/cap.c
1242
list_ecaps(int fd, struct pci_conf *p)
usr.sbin/pciconf/cap.c
1250
ecap = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
1257
ecap_aer(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
126
cap_msi(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
1260
ecap_vc(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1263
ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1266
ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1269
ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1272
ecap_sriov(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1275
ecap_acs(fd, p, ptr, PCI_EXTCAP_VER(ecap));
usr.sbin/pciconf/cap.c
1290
ecap = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
1296
pci_find_cap(int fd, struct pci_conf *p, uint8_t id)
usr.sbin/pciconf/cap.c
1302
sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2);
usr.sbin/pciconf/cap.c
131
ctrl = read_config(fd, &p->pc_sel, ptr + PCIR_MSI_CTRL, 2);
usr.sbin/pciconf/cap.c
1318
ptr = read_config(fd, &p->pc_sel, ptr, 1);
usr.sbin/pciconf/cap.c
1320
cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1);
usr.sbin/pciconf/cap.c
1323
ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1);
usr.sbin/pciconf/cap.c
1330
pcie_find_cap(int fd, struct pci_conf *p, uint16_t id)
usr.sbin/pciconf/cap.c
1336
ecap = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
1345
ecap = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
145
cap_pcix(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
150
status = read_config(fd, &p->pc_sel, ptr + PCIXR_STATUS, 4);
usr.sbin/pciconf/cap.c
221
cap_ht(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
226
command = read_config(fd, &p->pc_sel, ptr + PCIR_HT_COMMAND, 2);
usr.sbin/pciconf/cap.c
260
reg = read_config(fd, &p->pc_sel,
usr.sbin/pciconf/cap.c
264
reg = read_config(fd, &p->pc_sel,
usr.sbin/pciconf/cap.c
300
cap_vendor(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
304
length = read_config(fd, &p->pc_sel, ptr + PCIR_VENDOR_LENGTH, 1);
usr.sbin/pciconf/cap.c
310
version = read_config(fd, &p->pc_sel, ptr + PCIR_VENDOR_DATA,
usr.sbin/pciconf/cap.c
319
fvec = read_config(fd, &p->pc_sel, ptr +
usr.sbin/pciconf/cap.c
326
fvec = read_config(fd, &p->pc_sel, ptr +
usr.sbin/pciconf/cap.c
358
cap_debug(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
362
debug_port = read_config(fd, &p->pc_sel, ptr + PCIR_DEBUG_PORT, 2);
usr.sbin/pciconf/cap.c
368
cap_subvendor(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
373
id = read_config(fd, &p->pc_sel, ptr + PCIR_SUBVENDCAP_ID, 4);
usr.sbin/pciconf/cap.c
425
cap_secdev(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
434
cap_h = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_CAP_HEADER, 4);
usr.sbin/pciconf/cap.c
443
base_low = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_BASE_LOW,
usr.sbin/pciconf/cap.c
445
base_high = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_BASE_HIGH,
usr.sbin/pciconf/cap.c
46
static void list_ecaps(int fd, struct pci_conf *p);
usr.sbin/pciconf/cap.c
465
range = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_RANGE, 4);
usr.sbin/pciconf/cap.c
474
misc0 = read_config(fd, &p->pc_sel, ptr + PCIR_AMDIOMMU_MISC0, 4);
usr.sbin/pciconf/cap.c
480
misc1 = read_config(fd, &p->pc_sel,
usr.sbin/pciconf/cap.c
51
cap_power(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
55
cap = read_config(fd, &p->pc_sel, ptr + PCIR_POWER_CAP, 2);
usr.sbin/pciconf/cap.c
56
status = read_config(fd, &p->pc_sel, ptr + PCIR_POWER_STATUS, 2);
usr.sbin/pciconf/cap.c
576
cap_express(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
582
flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2);
usr.sbin/pciconf/cap.c
619
cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4);
usr.sbin/pciconf/cap.c
620
ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2);
usr.sbin/pciconf/cap.c
631
cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP2, 4);
usr.sbin/pciconf/cap.c
633
ctl = read_config(fd, &p->pc_sel,
usr.sbin/pciconf/cap.c
641
cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4);
usr.sbin/pciconf/cap.c
642
sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2);
usr.sbin/pciconf/cap.c
65
cap_agp(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
654
ctl = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CTL, 2);
usr.sbin/pciconf/cap.c
659
ctl = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CTL, 2);
usr.sbin/pciconf/cap.c
665
cap = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CAP, 4);
usr.sbin/pciconf/cap.c
666
sta = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_STA, 2);
usr.sbin/pciconf/cap.c
667
ctl = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CTL, 2);
usr.sbin/pciconf/cap.c
689
cap_msix(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
69
status = read_config(fd, &p->pc_sel, ptr + AGP_STATUS, 4);
usr.sbin/pciconf/cap.c
695
ctrl = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_CTRL, 2);
usr.sbin/pciconf/cap.c
698
val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_TABLE, 4);
usr.sbin/pciconf/cap.c
70
command = read_config(fd, &p->pc_sel, ptr + AGP_CAPID, 4);
usr.sbin/pciconf/cap.c
702
val = read_config(fd, &p->pc_sel, ptr + PCIR_MSIX_PBA, 4);
usr.sbin/pciconf/cap.c
716
cap_sata(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)
usr.sbin/pciconf/cap.c
723
cap_pciaf(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
727
cap = read_config(fd, &p->pc_sel, ptr + PCIR_PCIAF_CAP, 1);
usr.sbin/pciconf/cap.c
794
cap_ea(int fd, struct pci_conf *p, uint8_t ptr)
usr.sbin/pciconf/cap.c
807
num_ent = read_config(fd, &p->pc_sel, ptr + PCIR_EA_NUM_ENT, 2);
usr.sbin/pciconf/cap.c
817
val = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
829
val = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
834
dw[b] = read_config(fd, &p->pc_sel, ptr, 4);
usr.sbin/pciconf/cap.c
869
list_caps(int fd, struct pci_conf *p, int level)
usr.sbin/pciconf/cap.c
876
sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2);
usr.sbin/pciconf/cap.c
896
ptr = read_config(fd, &p->pc_sel, ptr, 1);
usr.sbin/pciconf/cap.c
898
cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1);
usr.sbin/pciconf/cap.c
902
cap_power(fd, p, ptr);
usr.sbin/pciconf/cap.c
905
cap_agp(fd, p, ptr);
usr.sbin/pciconf/cap.c
908
cap_vpd(fd, p, ptr);
usr.sbin/pciconf/cap.c
911
cap_msi(fd, p, ptr);
usr.sbin/pciconf/cap.c
914
cap_pcix(fd, p, ptr);
usr.sbin/pciconf/cap.c
917
cap_ht(fd, p, ptr);
usr.sbin/pciconf/cap.c
920
cap_vendor(fd, p, ptr);
usr.sbin/pciconf/cap.c
923
cap_debug(fd, p, ptr);
usr.sbin/pciconf/cap.c
926
cap_subvendor(fd, p, ptr);
usr.sbin/pciconf/cap.c
929
cap_secdev(fd, p, ptr);
usr.sbin/pciconf/cap.c
933
cap_express(fd, p, ptr);
usr.sbin/pciconf/cap.c
936
cap_msix(fd, p, ptr);
usr.sbin/pciconf/cap.c
939
cap_sata(fd, p, ptr);
usr.sbin/pciconf/cap.c
942
cap_pciaf(fd, p, ptr);
usr.sbin/pciconf/cap.c
945
cap_ea(fd, p, ptr);
usr.sbin/pciconf/cap.c
952
ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1);
usr.sbin/pciconf/cap.c
956
list_ecaps(fd, p);
usr.sbin/pciconf/cap.c
973
ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/cap.c
982
sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
usr.sbin/pciconf/cap.c
983
mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
usr.sbin/pciconf/cap.c
986
sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_COR_STATUS, 4);
usr.sbin/pciconf/cap.c
991
ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
usr.sbin/pciconf/err.c
137
list_errors(int fd, struct pci_conf *p)
usr.sbin/pciconf/err.c
144
sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2);
usr.sbin/pciconf/err.c
148
pcie = pci_find_cap(fd, p, PCIY_EXPRESS);
usr.sbin/pciconf/err.c
153
sta = read_config(fd, &p->pc_sel, pcie + PCIER_DEVICE_STA, 2);
usr.sbin/pciconf/err.c
157
aer = pcie_find_cap(fd, p, PCIZ_AER);
usr.sbin/pciconf/err.c
162
mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_STATUS, 4);
usr.sbin/pciconf/err.c
163
severity = read_config(fd, &p->pc_sel, aer + PCIR_AER_UC_SEVERITY, 4);
usr.sbin/pciconf/err.c
168
mask = read_config(fd, &p->pc_sel, aer + PCIR_AER_COR_STATUS, 4);
usr.sbin/pciconf/pciconf.c
1202
read_config(int fd, struct pcisel *sel, long reg, int width)
usr.sbin/pciconf/pciconf.c
1210
if (ioctl(fd, PCIOCREAD, &pi) < 0)
usr.sbin/pciconf/pciconf.c
1223
int fd;
usr.sbin/pciconf/pciconf.c
1225
fd = open(_PATH_DEVPCI, O_RDONLY, 0);
usr.sbin/pciconf/pciconf.c
1226
if (fd < 0)
usr.sbin/pciconf/pciconf.c
1260
if (ioctl(fd, PCIOCGETCONF, &pc) == -1)
usr.sbin/pciconf/pciconf.c
1265
close(fd);
usr.sbin/pciconf/pciconf.c
1328
int fd;
usr.sbin/pciconf/pciconf.c
1331
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
1332
if (fd < 0)
usr.sbin/pciconf/pciconf.c
1343
printf("%0*x", width * 2, read_config(fd, &sel, r, width));
usr.sbin/pciconf/pciconf.c
1353
close(fd);
usr.sbin/pciconf/pciconf.c
1359
int fd;
usr.sbin/pciconf/pciconf.c
1367
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
1368
if (fd < 0)
usr.sbin/pciconf/pciconf.c
1371
if (ioctl(fd, PCIOCWRITE, &pi) < 0)
usr.sbin/pciconf/pciconf.c
1373
close(fd);
usr.sbin/pciconf/pciconf.c
1379
int fd;
usr.sbin/pciconf/pciconf.c
1384
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
1385
if (fd < 0)
usr.sbin/pciconf/pciconf.c
1388
if (ioctl(fd, PCIOCATTACHED, &pi) < 0)
usr.sbin/pciconf/pciconf.c
1393
close(fd);
usr.sbin/pciconf/pciconf.c
1399
int fd;
usr.sbin/pciconf/pciconf.c
1410
fd = open(_PATH_DEVPCI, O_RDWR, 0);
usr.sbin/pciconf/pciconf.c
1411
if (fd < 0)
usr.sbin/pciconf/pciconf.c
1414
if (ioctl(fd, PCIOCBARMMAP, pbm) < 0)
usr.sbin/pciconf/pciconf.c
1417
close(fd);
usr.sbin/pciconf/pciconf.c
260
fetch_devs(int fd, const char *name, struct pci_conf **confp, size_t *countp)
usr.sbin/pciconf/pciconf.c
284
if (ioctl(fd, PCIOCGETCONF, &pc) == -1)
usr.sbin/pciconf/pciconf.c
319
int fd;
usr.sbin/pciconf/pciconf.c
327
fd = open(_PATH_DEVPCI, (bridge || caps || errors) ? O_RDWR : O_RDONLY,
usr.sbin/pciconf/pciconf.c
329
if (fd < 0)
usr.sbin/pciconf/pciconf.c
332
if (!fetch_devs(fd, name, &conf, &count)) {
usr.sbin/pciconf/pciconf.c
334
close(fd);
usr.sbin/pciconf/pciconf.c
372
list_bars(fd, p);
usr.sbin/pciconf/pciconf.c
374
list_bridge(fd, p);
usr.sbin/pciconf/pciconf.c
376
list_caps(fd, p, caps);
usr.sbin/pciconf/pciconf.c
378
list_errors(fd, p);
usr.sbin/pciconf/pciconf.c
380
list_vpd(fd, p);
usr.sbin/pciconf/pciconf.c
384
close(fd);
usr.sbin/pciconf/pciconf.c
558
int fd;
usr.sbin/pciconf/pciconf.c
564
fd = open(_PATH_DEVPCI, O_RDONLY);
usr.sbin/pciconf/pciconf.c
565
if (fd < 0)
usr.sbin/pciconf/pciconf.c
568
if (!fetch_devs(fd, NULL, &conf, &count)) {
usr.sbin/pciconf/pciconf.c
616
close(fd);
usr.sbin/pciconf/pciconf.c
658
print_bridge_windows(int fd, struct pci_conf *p)
usr.sbin/pciconf/pciconf.c
672
val = read_config(fd, &p->pc_sel, PCIR_IOBASEL_1, 1);
usr.sbin/pciconf/pciconf.c
673
if (val != 0 || read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1) != 0) {
usr.sbin/pciconf/pciconf.c
676
read_config(fd, &p->pc_sel, PCIR_IOBASEH_1, 2),
usr.sbin/pciconf/pciconf.c
679
read_config(fd, &p->pc_sel, PCIR_IOLIMITH_1, 2),
usr.sbin/pciconf/pciconf.c
680
read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1));
usr.sbin/pciconf/pciconf.c
685
read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1));
usr.sbin/pciconf/pciconf.c
692
read_config(fd, &p->pc_sel, PCIR_MEMBASE_1, 2));
usr.sbin/pciconf/pciconf.c
694
read_config(fd, &p->pc_sel, PCIR_MEMLIMIT_1, 2));
usr.sbin/pciconf/pciconf.c
697
val = read_config(fd, &p->pc_sel, PCIR_PMBASEL_1, 2);
usr.sbin/pciconf/pciconf.c
698
if (val != 0 || read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2) != 0) {
usr.sbin/pciconf/pciconf.c
701
read_config(fd, &p->pc_sel, PCIR_PMBASEH_1, 4),
usr.sbin/pciconf/pciconf.c
704
read_config(fd, &p->pc_sel, PCIR_PMLIMITH_1, 4),
usr.sbin/pciconf/pciconf.c
705
read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2));
usr.sbin/pciconf/pciconf.c
710
read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2));
usr.sbin/pciconf/pciconf.c
731
bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_1, 2);
usr.sbin/pciconf/pciconf.c
737
print_cardbus_mem_window(int fd, struct pci_conf *p, int basereg, int limitreg,
usr.sbin/pciconf/pciconf.c
742
PCI_CBBMEMBASE(read_config(fd, &p->pc_sel, basereg, 4)),
usr.sbin/pciconf/pciconf.c
743
PCI_CBBMEMLIMIT(read_config(fd, &p->pc_sel, limitreg, 4)));
usr.sbin/pciconf/pciconf.c
747
print_cardbus_io_window(int fd, struct pci_conf *p, int basereg, int limitreg)
usr.sbin/pciconf/pciconf.c
753
val = read_config(fd, &p->pc_sel, basereg, 2);
usr.sbin/pciconf/pciconf.c
755
base = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, basereg, 4));
usr.sbin/pciconf/pciconf.c
756
limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 4));
usr.sbin/pciconf/pciconf.c
760
limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 2));
usr.sbin/pciconf/pciconf.c
767
print_cardbus_windows(int fd, struct pci_conf *p)
usr.sbin/pciconf/pciconf.c
771
bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_2, 2);
usr.sbin/pciconf/pciconf.c
772
print_cardbus_mem_window(fd, p, PCIR_MEMBASE0_2, PCIR_MEMLIMIT0_2,
usr.sbin/pciconf/pciconf.c
774
print_cardbus_mem_window(fd, p, PCIR_MEMBASE1_2, PCIR_MEMLIMIT1_2,
usr.sbin/pciconf/pciconf.c
776
print_cardbus_io_window(fd, p, PCIR_IOBASE0_2, PCIR_IOLIMIT0_2);
usr.sbin/pciconf/pciconf.c
777
print_cardbus_io_window(fd, p, PCIR_IOBASE1_2, PCIR_IOLIMIT1_2);
usr.sbin/pciconf/pciconf.c
783
list_bridge(int fd, struct pci_conf *p)
usr.sbin/pciconf/pciconf.c
789
print_bridge_windows(fd, p);
usr.sbin/pciconf/pciconf.c
79
static void list_bridge(int fd, struct pci_conf *p);
usr.sbin/pciconf/pciconf.c
793
print_cardbus_windows(fd, p);
usr.sbin/pciconf/pciconf.c
799
list_bars(int fd, struct pci_conf *p)
usr.sbin/pciconf/pciconf.c
80
static void list_bars(int fd, struct pci_conf *p);
usr.sbin/pciconf/pciconf.c
818
print_bar(fd, p, "bar ", PCIR_BAR(i));
usr.sbin/pciconf/pciconf.c
822
print_bar(int fd, struct pci_conf *p, const char *label, uint16_t bar_offset)
usr.sbin/pciconf/pciconf.c
831
if (ioctl(fd, PCIOCGETBAR, &bar) < 0)
usr.sbin/pciconf/pciconf.c
85
static void list_vpd(int fd, struct pci_conf *p);
usr.sbin/pciconf/pciconf.c
893
list_vpd(int fd, struct pci_conf *p)
usr.sbin/pciconf/pciconf.c
901
if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0)
usr.sbin/pciconf/pciconf.c
905
if (ioctl(fd, PCIOCLISTVPD, &list) < 0) {
usr.sbin/pciconf/pciconf.h
36
void list_caps(int fd, struct pci_conf *p, int level);
usr.sbin/pciconf/pciconf.h
37
void list_errors(int fd, struct pci_conf *p);
usr.sbin/pciconf/pciconf.h
38
uint8_t pci_find_cap(int fd, struct pci_conf *p, uint8_t id);
usr.sbin/pciconf/pciconf.h
39
uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id);
usr.sbin/pciconf/pciconf.h
40
void print_bar(int fd, struct pci_conf *p, const char *label, uint16_t bar);
usr.sbin/pciconf/pciconf.h
41
uint32_t read_config(int fd, struct pcisel *sel, long reg, int width);
usr.sbin/pkg/ecc.c
556
ecc_verify_cert(const struct pkgsign_ctx *sctx, int fd,
usr.sbin/pkg/ecc.c
564
if (lseek(fd, 0, SEEK_SET) == -1) {
usr.sbin/pkg/ecc.c
569
if ((sha256 = sha256_fd(fd)) != NULL) {
usr.sbin/pkg/hash.c
43
sha256_fd(int fd)
usr.sbin/pkg/hash.c
46
return (SHA256_Fd(fd, NULL));
usr.sbin/pkg/hash.h
32
char *sha256_fd(int fd);
usr.sbin/pkg/pkg.c
147
pkgsign_verify_cert(const struct pkgsign_ctx *ctx, int fd, const char *sigfile,
usr.sbin/pkg/pkg.c
151
return ((*ctx->impl->pi_ops->pkgsign_verify_cert)(ctx, fd, sigfile,
usr.sbin/pkg/pkg.c
167
extract_pkg_static(int fd, char *p, int sz)
usr.sbin/pkg/pkg.c
183
if (lseek(fd, 0, 0) == -1) {
usr.sbin/pkg/pkg.c
188
if (archive_read_open_fd(a, fd, 4096) != ARCHIVE_OK) {
usr.sbin/pkg/pkg.c
261
int fd;
usr.sbin/pkg/pkg.c
271
if ((fd = mkstemp(path)) == -1) {
usr.sbin/pkg/pkg.c
313
if (write(fd, buf, r) != r) {
usr.sbin/pkg/pkg.c
330
if (fd != -1) {
usr.sbin/pkg/pkg.c
331
close(fd);
usr.sbin/pkg/pkg.c
332
fd = -1;
usr.sbin/pkg/pkg.c
346
return fd;
usr.sbin/pkg/pkg.c
475
pkg_read_fd(int fd, size_t *osz)
usr.sbin/pkg/pkg.c
488
while ((r = read(fd, buf, sizeof(buf))) >0) {
usr.sbin/pkg/pkg.c
531
read_pubkey(int fd)
usr.sbin/pkg/pkg.c
537
if (lseek(fd, 0, 0) == -1) {
usr.sbin/pkg/pkg.c
542
osigb = sigb = pkg_read_fd(fd, &sigsz);
usr.sbin/pkg/pkg.c
556
parse_cert(int fd) {
usr.sbin/pkg/pkg.c
572
if (lseek(fd, 0, 0) == -1) {
usr.sbin/pkg/pkg.c
578
if ((my_fd = dup(fd)) == -1) {
usr.sbin/pkg/pkg.h
73
char *pkg_read_fd(int fd, size_t *osz);
usr.sbin/pkg/rsa.c
146
rsa_verify_cert(const struct pkgsign_ctx *ctx __unused, int fd,
usr.sbin/pkg/rsa.c
156
if (lseek(fd, 0, 0) == -1) {
usr.sbin/pkg/rsa.c
160
if ((sha256 = sha256_fd(fd)) == NULL) {
usr.sbin/pmc/cmd_pmc_filter.cc
178
pmc_log_event(int fd, struct pmclog_ev *ev, bool json)
usr.sbin/pmc/cmd_pmc_filter.cc
192
if (write(fd, buf, len) != (ssize_t)len)
usr.sbin/pmc/view.cc
448
int fd, i;
usr.sbin/pmc/view.cc
465
fd = open(fullpath.c_str(), O_RDONLY, 0);
usr.sbin/pmc/view.cc
466
if (fd < 0) {
usr.sbin/pmc/view.cc
472
e = elf_begin(fd, ELF_C_READ, NULL);
usr.sbin/pmc/view.cc
476
close(fd);
usr.sbin/pmc/view.cc
589
close(fd);
usr.sbin/pmc/view.cc
646
int fd;
usr.sbin/pmc/view.cc
655
fd = open(im->path.c_str(), O_RDONLY, 0);
usr.sbin/pmc/view.cc
656
if (fd < 0) {
usr.sbin/pmc/view.cc
662
e = elf_begin(fd, ELF_C_READ, NULL);
usr.sbin/pmc/view.cc
666
close(fd);
usr.sbin/pmc/view.cc
697
close(fd);
usr.sbin/pmcstat/pmcpl_gprof.c
126
int fd;
usr.sbin/pmcstat/pmcpl_gprof.c
133
if ((fd = open(pathname, O_RDWR|O_NOFOLLOW|O_CREAT,
usr.sbin/pmcstat/pmcpl_gprof.c
149
if (write(fd, &gm, sizeof(gm)) < 0)
usr.sbin/pmcstat/pmcpl_gprof.c
157
if (write(fd, &buffer, sizeof(buffer)) < 0)
usr.sbin/pmcstat/pmcpl_gprof.c
162
if (write(fd, &buffer, count) < 0)
usr.sbin/pmcstat/pmcpl_gprof.c
165
(void) close(fd);
usr.sbin/pmcstat/pmcpl_gprof.c
204
int fd;
usr.sbin/pmcstat/pmcpl_gprof.c
210
if ((fd = open(pathname, O_RDWR | O_NOFOLLOW, 0)) < 0)
usr.sbin/pmcstat/pmcpl_gprof.c
214
PROT_READ|PROT_WRITE, MAP_NOSYNC|MAP_SHARED, fd, 0);
usr.sbin/pmcstat/pmcpl_gprof.c
219
(void) close(fd);
usr.sbin/pmcstat/pmcstat_log.c
247
int fd;
usr.sbin/pmcstat/pmcstat_log.c
255
fd = open(imagepath, O_RDONLY);
usr.sbin/pmcstat/pmcstat_log.c
256
if (fd < 0) {
usr.sbin/pmcstat/pmcstat_log.c
261
fd = open(imagepath, O_RDONLY);
usr.sbin/pmcstat/pmcstat_log.c
262
if (fd < 0) {
usr.sbin/pmcstat/pmcstat_log.c
269
if (fd >= 0)
usr.sbin/pmcstat/pmcstat_log.c
270
close(fd);
usr.sbin/powerd/powerd.c
480
if (setsockopt(ss.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group,
usr.sbin/powerd/powerd.c
775
FD_SET(ss.fd, &fdset);
usr.sbin/powerd/powerd.c
776
nfds = ss.fd + 1;
usr.sbin/ppp/bundle.c
1088
prompt_Printf(arg->prompt, "%s\n", server.fd == -1 ? " (not open)" : "");
usr.sbin/ppp/bundle.c
1091
server.fd == -1 ? " (not open)" : "");
usr.sbin/ppp/bundle.c
1378
int niov, expect, f, *fd, nfd, onfd;
usr.sbin/ppp/bundle.c
1446
fd = (int *)CMSG_DATA(cmsg);
usr.sbin/ppp/bundle.c
1447
nfd = ((caddr_t)cmsg + cmsg->cmsg_len - (caddr_t)fd) / sizeof(int);
usr.sbin/ppp/bundle.c
1453
close(fd[nfd]);
usr.sbin/ppp/bundle.c
1469
close(fd[nfd]);
usr.sbin/ppp/bundle.c
1481
if ((got = write(fd[1], &pid, sizeof pid)) != sizeof pid) {
usr.sbin/ppp/bundle.c
1488
close(fd[nfd]);
usr.sbin/ppp/bundle.c
1494
if ((got = readv(fd[1], iov + 1, niov - 1)) != expect) {
usr.sbin/ppp/bundle.c
1500
close(fd[nfd]);
usr.sbin/ppp/bundle.c
1505
close(fd[1]);
usr.sbin/ppp/bundle.c
1510
dl = iov2datalink(bundle, iov, &niov, sizeof iov / sizeof *iov, fd[0],
usr.sbin/ppp/bundle.c
1511
fd + 2, &nfd);
usr.sbin/ppp/bundle.c
1519
close(fd[onfd--]);
usr.sbin/ppp/bundle.c
1520
close(fd[0]);
usr.sbin/ppp/bundle.c
1528
close(fd[onfd--]);
usr.sbin/ppp/bundle.c
1529
close(fd[0]);
usr.sbin/ppp/bundle.c
1530
close(fd[1]);
usr.sbin/ppp/bundle.c
1545
int niov, f, expect, newsid, fd[SEND_MAXFD], nfd, reply[2];
usr.sbin/ppp/bundle.c
1568
fd[0] = datalink2iov(dl, iov, &niov, SCATTER_SEGMENTS, fd + 2, &nfd);
usr.sbin/ppp/bundle.c
1570
if (fd[0] != -1 && socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, reply) != -1) {
usr.sbin/ppp/bundle.c
1575
fd[1] = reply[1];
usr.sbin/ppp/bundle.c
1599
*((int *)CMSG_DATA(cmsg) + f) = fd[f];
usr.sbin/ppp/bundle.c
1652
tcgetpgrp(fd[0]) == getpgrp();
usr.sbin/ppp/bundle.c
1654
close(fd[--nfd]);
usr.sbin/ppp/bundle.c
176
if (bundle->notify.fd != -1) {
usr.sbin/ppp/bundle.c
179
ret = write(bundle->notify.fd, &c, 1);
usr.sbin/ppp/bundle.c
1793
int fd, status;
usr.sbin/ppp/bundle.c
1802
for (fd = getdtablesize(); fd >= 0; fd--)
usr.sbin/ppp/bundle.c
1803
close(fd);
usr.sbin/ppp/bundle.c
1843
bundle_Exception(struct bundle *bundle, int fd)
usr.sbin/ppp/bundle.c
1848
if (dl->physical->fd == fd) {
usr.sbin/ppp/bundle.c
186
close(bundle->notify.fd);
usr.sbin/ppp/bundle.c
187
bundle->notify.fd = -1;
usr.sbin/ppp/bundle.c
2005
ioctl(bundle->dev.fd, TUNSIFPID, 0);
usr.sbin/ppp/bundle.c
477
FD_SET(bundle->dev.fd, r);
usr.sbin/ppp/bundle.c
478
if (*n < bundle->dev.fd + 1)
usr.sbin/ppp/bundle.c
479
*n = bundle->dev.fd + 1;
usr.sbin/ppp/bundle.c
480
log_Printf(LogTIMER, "%s: fdset(r) %d\n", TUN_NAME, bundle->dev.fd);
usr.sbin/ppp/bundle.c
528
return FD_ISSET(bundle->dev.fd, fdset);
usr.sbin/ppp/bundle.c
551
if (FD_ISSET(bundle->dev.fd, fdset)) {
usr.sbin/ppp/bundle.c
567
n = read(bundle->dev.fd, data, sz);
usr.sbin/ppp/bundle.c
599
write(bundle->dev.fd, data, n);
usr.sbin/ppp/bundle.c
726
bundle.dev.fd = ID0open(bundle.dev.Name, O_RDWR);
usr.sbin/ppp/bundle.c
727
if (bundle.dev.fd >= 0)
usr.sbin/ppp/bundle.c
749
if (bundle.dev.fd < 0) {
usr.sbin/ppp/bundle.c
768
close(bundle.dev.fd);
usr.sbin/ppp/bundle.c
775
if (ID0ioctl(bundle.dev.fd, TUNSIFMODE, &iff) < 0)
usr.sbin/ppp/bundle.c
783
if (ID0ioctl(bundle.dev.fd, TUNSLMODE, &iff) < 0)
usr.sbin/ppp/bundle.c
791
if (ID0ioctl(bundle.dev.fd, TUNSIFHEAD, &iff) < 0) {
usr.sbin/ppp/bundle.c
851
close(bundle.dev.fd);
usr.sbin/ppp/bundle.c
883
bundle.notify.fd = -1;
usr.sbin/ppp/bundle.c
932
close(bundle->dev.fd);
usr.sbin/ppp/bundle.h
144
int fd; /* write status here */
usr.sbin/ppp/bundle.h
81
int fd; /* The /dev/XXXX descriptor */
usr.sbin/ppp/chap.c
259
int argc, fd;
usr.sbin/ppp/chap.c
263
if (chap->child.fd != -1) {
usr.sbin/ppp/chap.c
314
for (fd = getdtablesize(); fd > STDERR_FILENO; fd--)
usr.sbin/ppp/chap.c
315
fcntl(fd, F_SETFD, 1);
usr.sbin/ppp/chap.c
328
chap->child.fd = out[0];
usr.sbin/ppp/chap.c
347
close(chap->child.fd);
usr.sbin/ppp/chap.c
348
chap->child.fd = -1;
usr.sbin/ppp/chap.c
401
if (r && chap && chap->child.fd != -1) {
usr.sbin/ppp/chap.c
402
FD_SET(chap->child.fd, r);
usr.sbin/ppp/chap.c
403
if (*n < chap->child.fd + 1)
usr.sbin/ppp/chap.c
404
*n = chap->child.fd + 1;
usr.sbin/ppp/chap.c
405
log_Printf(LogTIMER, "Chap: fdset(r) %d\n", chap->child.fd);
usr.sbin/ppp/chap.c
417
return chap && chap->child.fd != -1 && FD_ISSET(chap->child.fd, fdset);
usr.sbin/ppp/chap.c
427
got = read(chap->child.fd, chap->child.buf.ptr + chap->child.buf.len,
usr.sbin/ppp/chap.c
677
chap->child.fd = -1;
usr.sbin/ppp/chap.h
43
int fd;
usr.sbin/ppp/chat.c
742
dup2(physical->fd, STDIN_FILENO);
usr.sbin/ppp/command.c
652
int i, fd;
usr.sbin/ppp/command.c
660
fd = arg->prompt->fd_out;
usr.sbin/ppp/command.c
661
else if ((fd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
usr.sbin/ppp/command.c
666
dup2(fd, STDIN_FILENO);
usr.sbin/ppp/command.c
667
dup2(fd, STDOUT_FILENO);
usr.sbin/ppp/command.c
668
dup2(fd, STDERR_FILENO);
usr.sbin/ppp/datalink.c
118
dl->physical->fd != -1) {
usr.sbin/ppp/datalink.c
1293
int fd, int *auxfd, int *nauxfd)
usr.sbin/ppp/datalink.c
1358
dl->physical = iov2physical(dl, iov, niov, maxiov, fd, auxfd, nauxfd);
usr.sbin/ppp/defs.c
68
fullread(int fd, void *v, size_t n)
usr.sbin/ppp/defs.c
73
switch ((got = read(fd, (char *)v + total, n - total))) {
usr.sbin/ppp/ether.c
124
return NgSendData(p->fd, dev->hook, v, n) == -1 ? -1 : (ssize_t)n;
usr.sbin/ppp/ether.c
132
return NgRecvData(p->fd, v, n, hook);
usr.sbin/ppp/ether.c
432
close(p->fd);
usr.sbin/ppp/ether.c
433
p->fd = -2; /* Nobody else need try.. */
usr.sbin/ppp/ether.c
455
if (p->fd < 0 && !strncasecmp(p->name.full, NG_PPPOE_NODE_TYPE,
usr.sbin/ppp/ether.c
467
p->fd--; /* We own the device - change fd */
usr.sbin/ppp/ether.c
510
if (ID0NgMkSockNode(NULL, &dev->cs, &p->fd) == -1) {
usr.sbin/ppp/ether.c
514
p->fd = -2;
usr.sbin/ppp/ether.c
683
if (fstat(p->fd, &st) != -1 && (st.st_mode & S_IFSOCK)) {
usr.sbin/ppp/ether.c
689
if (getsockname(p->fd, sock, &sz) == -1) {
usr.sbin/ppp/ether.c
691
close(p->fd);
usr.sbin/ppp/ether.c
692
p->fd = -1;
usr.sbin/ppp/exec.c
147
int fd = dev->fd_out == -1 ? p->fd : dev->fd_out;
usr.sbin/ppp/exec.c
149
return write(fd, v, n);
usr.sbin/ppp/exec.c
246
if (p->fd < 0) {
usr.sbin/ppp/exec.c
257
p->fd--; /* We own the device but maybe can't use it - change fd */
usr.sbin/ppp/exec.c
376
p->fd = fids[0];
usr.sbin/ppp/exec.c
377
log_Printf(LogDEBUG, "Using descriptor %d for child\n", p->fd);
usr.sbin/ppp/exec.c
384
if (fstat(p->fd, &st) != -1 && (st.st_mode & S_IFIFO)) {
usr.sbin/ppp/exec.c
388
else if (p->fd == STDIN_FILENO) {
usr.sbin/ppp/id.c
159
ID0write(int fd, const void *data, size_t len)
usr.sbin/ppp/id.c
164
ret = write(fd, data, len);
usr.sbin/ppp/id.c
165
log_Printf(LogID0, "%d = write(%d, data, %ld)\n", ret, fd, (long)len);
usr.sbin/ppp/id.c
93
ID0ioctl(int fd, unsigned long req, void *arg)
usr.sbin/ppp/id.c
98
ret = ioctl(fd, req, arg);
usr.sbin/ppp/id.c
99
log_Printf(LogID0, "%d = ioctl(%d, %lu, %p)\n", ret, fd, req, arg);
usr.sbin/ppp/ip.c
944
nw = write(bundle->dev.fd, data, nb);
usr.sbin/ppp/ipcp.c
177
int fd;
usr.sbin/ppp/ipcp.c
191
if ((fd = open(_PATH_RESCONF, O_RDONLY)) != -1) {
usr.sbin/ppp/ipcp.c
194
if (fstat(fd, &st) == 0) {
usr.sbin/ppp/ipcp.c
209
} else if ((got = read(fd, ipcp->ns.resolv, st.st_size)) != st.st_size) {
usr.sbin/ppp/ipcp.c
279
close(fd);
usr.sbin/ppp/ipcp.c
336
int fd;
usr.sbin/ppp/ipcp.c
338
if ((fd = ID0open(_PATH_RESCONF, O_WRONLY|O_TRUNC, 0644)) != -1) {
usr.sbin/ppp/ipcp.c
340
if ((got = write(fd, ipcp->ns.resolv, len)) != len) {
usr.sbin/ppp/ipcp.c
348
close(fd);
usr.sbin/ppp/main.c
498
bundle->notify.fd = bgpipe[1];
usr.sbin/ppp/mp.c
1054
bundle_SendDatalink(s->send.dl, s->fd, &s->socket);
usr.sbin/ppp/mp.c
1056
s->fd = -1;
usr.sbin/ppp/mp.c
1060
} else if (r && s->fd >= 0) {
usr.sbin/ppp/mp.c
1061
if (*n < s->fd + 1)
usr.sbin/ppp/mp.c
1062
*n = s->fd + 1;
usr.sbin/ppp/mp.c
1063
FD_SET(s->fd, r);
usr.sbin/ppp/mp.c
1064
log_Printf(LogTIMER, "mp: fdset(r) %d\n", s->fd);
usr.sbin/ppp/mp.c
1074
return s->fd >= 0 && FD_ISSET(s->fd, fdset);
usr.sbin/ppp/mp.c
1083
bundle_ReceiveDatalink(bundle, s->fd);
usr.sbin/ppp/mp.c
1104
s->fd = -1;
usr.sbin/ppp/mp.c
1114
if (s->fd != -1) {
usr.sbin/ppp/mp.c
1136
s->fd = ID0socket(PF_LOCAL, SOCK_DGRAM, 0);
usr.sbin/ppp/mp.c
1137
if (s->fd < 0) {
usr.sbin/ppp/mp.c
1142
setsockopt(s->fd, SOL_SOCKET, SO_REUSEADDR, (struct sockaddr *)&s->socket,
usr.sbin/ppp/mp.c
1151
if (ID0bind_un(s->fd, &s->socket) < 0) {
usr.sbin/ppp/mp.c
1156
close(s->fd);
usr.sbin/ppp/mp.c
1157
s->fd = -1;
usr.sbin/ppp/mp.c
1163
if (ID0connect_un(s->fd, &s->socket) < 0) {
usr.sbin/ppp/mp.c
1168
close(s->fd);
usr.sbin/ppp/mp.c
1169
s->fd = -1;
usr.sbin/ppp/mp.c
1184
bundle_SendDatalink(s->send.dl, s->fd, &s->socket);
usr.sbin/ppp/mp.c
1186
s->fd = -1;
usr.sbin/ppp/mp.c
1187
} else if (s->fd >= 0) {
usr.sbin/ppp/mp.c
1188
close(s->fd);
usr.sbin/ppp/mp.c
1193
s->fd = -1;
usr.sbin/ppp/mp.h
125
#define mpserver_IsOpen(s) ((s)->fd != -1)
usr.sbin/ppp/mp.h
64
int fd; /* listen()ing or connect()ing here */
usr.sbin/ppp/netgraph.c
230
return NgSendData(p->fd, dev->hook, v, n) == -1 ? -1 : (ssize_t)n;
usr.sbin/ppp/netgraph.c
244
return NgRecvData(p->fd, v, n, hook);
usr.sbin/ppp/netgraph.c
410
close(p->fd);
usr.sbin/ppp/netgraph.c
411
p->fd = -2; /* Nobody else need try.. */
usr.sbin/ppp/netgraph.c
476
if (p->fd < 0 && !strncasecmp(p->name.full, NETGRAPH_PREFIX,
usr.sbin/ppp/netgraph.c
478
p->fd--; /* We own the device - change fd */
usr.sbin/ppp/netgraph.c
486
if (ID0NgMkSockNode(NULL, &dev->cs, &p->fd) == -1) {
usr.sbin/ppp/netgraph.c
490
p->fd = -2;
usr.sbin/ppp/netgraph.c
718
if (getsockname(p->fd, sock, &sz) != -1 && sock->sa_family == AF_NETGRAPH) {
usr.sbin/ppp/physical.c
1000
p->fd = STDIN_FILENO;
usr.sbin/ppp/physical.c
1001
for (h = 0; h < NDEVICES && p->handler == NULL && p->fd >= 0; h++)
usr.sbin/ppp/physical.c
1004
if (p->fd >= 0) {
usr.sbin/ppp/physical.c
1014
while (devno < p->cfg.ndev && p->fd < 0) {
usr.sbin/ppp/physical.c
1020
p->fd = ID0open(p->name.full, O_RDWR | O_NONBLOCK);
usr.sbin/ppp/physical.c
1021
if (p->fd < 0)
usr.sbin/ppp/physical.c
1025
wasfd = p->fd;
usr.sbin/ppp/physical.c
1027
if ((p->handler = (*devices[h].create)(p)) == NULL && wasfd != p->fd)
usr.sbin/ppp/physical.c
1030
if (p->fd < 0) {
usr.sbin/ppp/physical.c
1049
return p->fd;
usr.sbin/ppp/physical.c
186
p->fd = -1;
usr.sbin/ppp/physical.c
245
if (p->fd >= 0) {
usr.sbin/ppp/physical.c
246
tcgetattr(p->fd, &rstio);
usr.sbin/ppp/physical.c
249
tcsetattr(p->fd, TCSADRAIN, &rstio);
usr.sbin/ppp/physical.c
328
if (p->fd < 0)
usr.sbin/ppp/physical.c
345
newsid = tcgetpgrp(p->fd) == getpgrp();
usr.sbin/ppp/physical.c
346
close(p->fd);
usr.sbin/ppp/physical.c
347
p->fd = -1;
usr.sbin/ppp/physical.c
398
p->link.name, nw, (unsigned long)p->out->m_len, p->fd);
usr.sbin/ppp/physical.c
410
p->fd, p->out->m_len, strerror(errno));
usr.sbin/ppp/physical.c
430
if (p->fd < 0)
usr.sbin/ppp/physical.c
455
if (p->fd >= 0 && ioctl(p->fd, TIOCOUTQ, &n) >= 0)
usr.sbin/ppp/physical.c
530
p->link.name, n, (int)(sizeof p->input.buf - p->input.sz), p->fd);
usr.sbin/ppp/physical.c
533
log_Printf(LogPHASE, "%s: read (%d): %s\n", p->link.name, p->fd,
usr.sbin/ppp/physical.c
537
p->link.name, p->fd);
usr.sbin/ppp/physical.c
572
int fd, int *auxfd, int *nauxfd)
usr.sbin/ppp/physical.c
616
p->fd = fd;
usr.sbin/ppp/physical.c
685
tcgetpgrp(p->fd) == getpgrp())
usr.sbin/ppp/physical.c
731
return p ? p->fd : 0;
usr.sbin/ppp/physical.c
737
if (p->fd >= 0 && *p->name.full == '/' && p->type != PHYS_DIRECT)
usr.sbin/ppp/physical.c
808
ret = read(p->fd, buf, nbytes);
usr.sbin/ppp/physical.c
823
return write(p->fd, buf, nbytes);
usr.sbin/ppp/physical.c
834
if (p->fd >= 0) {
usr.sbin/ppp/physical.c
836
FD_SET(p->fd, r);
usr.sbin/ppp/physical.c
837
log_Printf(LogTIMER, "%s: fdset(r) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
841
FD_SET(p->fd, e);
usr.sbin/ppp/physical.c
842
log_Printf(LogTIMER, "%s: fdset(e) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
846
FD_SET(p->fd, w);
usr.sbin/ppp/physical.c
847
log_Printf(LogTIMER, "%s: fdset(w) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
850
if (sets && *n < p->fd + 1)
usr.sbin/ppp/physical.c
851
*n = p->fd + 1;
usr.sbin/ppp/physical.c
866
if (p->fd >= 0) {
usr.sbin/ppp/physical.c
867
if (r && FD_ISSET(p->fd, r)) {
usr.sbin/ppp/physical.c
868
FD_CLR(p->fd, r);
usr.sbin/ppp/physical.c
869
log_Printf(LogTIMER, "%s: fdunset(r) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
872
if (e && FD_ISSET(p->fd, e)) {
usr.sbin/ppp/physical.c
873
FD_CLR(p->fd, e);
usr.sbin/ppp/physical.c
874
log_Printf(LogTIMER, "%s: fdunset(e) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
877
if (w && FD_ISSET(p->fd, w)) {
usr.sbin/ppp/physical.c
878
FD_CLR(p->fd, w);
usr.sbin/ppp/physical.c
879
log_Printf(LogTIMER, "%s: fdunset(w) %d\n", p->link.name, p->fd);
usr.sbin/ppp/physical.c
892
return p->fd >= 0 && FD_ISSET(p->fd, fdset);
usr.sbin/ppp/physical.c
995
if (p->fd >= 0)
usr.sbin/ppp/physical.h
83
int fd; /* File descriptor for this device */
usr.sbin/ppp/prompt.c
314
prompt_Create(struct server *s, struct bundle *bundle, int fd)
usr.sbin/ppp/prompt.c
325
if (fd == PROMPT_STD) {
usr.sbin/ppp/prompt.c
342
p->fd_in = p->fd_out = fd;
usr.sbin/ppp/prompt.c
343
p->Term = fdopen(fd, "a+");
usr.sbin/ppp/prompt.c
420
int stat, fd = p ? p->fd_in : STDIN_FILENO;
usr.sbin/ppp/prompt.c
423
stat = fcntl(fd, F_GETFL, 0);
usr.sbin/ppp/prompt.c
426
fcntl(fd, F_SETFL, stat);
usr.sbin/ppp/prompt.c
432
tcgetattr(fd, &newtio);
usr.sbin/ppp/prompt.c
442
tcsetattr(fd, TCSANOW, &newtio);
usr.sbin/ppp/radius.c
1056
if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))
usr.sbin/ppp/radius.c
1109
if (r->cx.fd != -1)
usr.sbin/ppp/radius.c
1284
if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))
usr.sbin/ppp/radius.c
265
r->cx.fd = -1; /* Stop select()ing */
usr.sbin/ppp/radius.c
661
if ((got = rad_continue_send_request(r->cx.rad, sel, &r->cx.fd, &tv)) == 0) {
usr.sbin/ppp/radius.c
700
while (r->cx.fd != -1) {
usr.sbin/ppp/radius.c
702
FD_SET(r->cx.fd, &s);
usr.sbin/ppp/radius.c
705
select(r->cx.fd + 1, &s, NULL, NULL, &tv);
usr.sbin/ppp/radius.c
719
if (r && rad->cx.fd != -1) {
usr.sbin/ppp/radius.c
720
FD_SET(rad->cx.fd, r);
usr.sbin/ppp/radius.c
721
if (*n < rad->cx.fd + 1)
usr.sbin/ppp/radius.c
722
*n = rad->cx.fd + 1;
usr.sbin/ppp/radius.c
723
log_Printf(LogTIMER, "Radius: fdset(r) %d\n", rad->cx.fd);
usr.sbin/ppp/radius.c
738
return r && r->cx.fd != -1 && FD_ISSET(r->cx.fd, fdset);
usr.sbin/ppp/radius.c
764
r->cx.fd = -1;
usr.sbin/ppp/radius.c
822
if (r->cx.fd != -1) {
usr.sbin/ppp/radius.c
823
r->cx.fd = -1;
usr.sbin/ppp/radius.c
913
if (r->cx.fd != -1)
usr.sbin/ppp/radius.h
43
int fd; /* We're selecting on this */
usr.sbin/ppp/server.c
102
if (s->fd >= 0 && FD_ISSET(s->fd, fdset)) {
usr.sbin/ppp/server.c
103
wfd = accept(s->fd, sa, &ssize);
usr.sbin/ppp/server.c
288
server.fd = s;
usr.sbin/ppp/server.c
298
if (server.fd == -1) {
usr.sbin/ppp/server.c
299
server.fd = -1;
usr.sbin/ppp/server.c
369
server.fd = s;
usr.sbin/ppp/server.c
377
if (server.fd == -1) {
usr.sbin/ppp/server.c
378
server.fd = -1;
usr.sbin/ppp/server.c
389
if (server.fd >= 0) {
usr.sbin/ppp/server.c
394
if (getsockname(server.fd, (struct sockaddr *)&un, &sz) == 0 &&
usr.sbin/ppp/server.c
398
close(server.fd);
usr.sbin/ppp/server.c
399
server.fd = -1;
usr.sbin/ppp/server.c
416
server.fd = -1;
usr.sbin/ppp/server.c
58
if (r && s->fd >= 0) {
usr.sbin/ppp/server.c
59
if (*n < s->fd + 1)
usr.sbin/ppp/server.c
60
*n = s->fd + 1;
usr.sbin/ppp/server.c
61
FD_SET(s->fd, r);
usr.sbin/ppp/server.c
62
log_Printf(LogTIMER, "server: fdset(r) %d\n", s->fd);
usr.sbin/ppp/server.c
78
if (s->fd >= 0 && FD_ISSET(s->fd, fdset))
usr.sbin/ppp/server.h
33
int fd;
usr.sbin/ppp/tcp.c
139
if (p->fd < 0) {
usr.sbin/ppp/tcp.c
150
p->fd--; /* We own the device but maybe can't use it - change fd */
usr.sbin/ppp/tcp.c
154
p->fd = tcp_OpenConnection(p->link.name, host, port);
usr.sbin/ppp/tcp.c
158
if (p->fd >= 0)
usr.sbin/ppp/tcp.c
169
if (p->fd >= 0) {
usr.sbin/ppp/tcp.c
173
if (fstat(p->fd, &st) != -1 && (st.st_mode & S_IFSOCK)) {
usr.sbin/ppp/tcp.c
177
if (getsockopt(p->fd, SOL_SOCKET, SO_TYPE, &type, &sz) == -1) {
usr.sbin/ppp/tcp.c
179
close(p->fd);
usr.sbin/ppp/tcp.c
180
p->fd = -1;
usr.sbin/ppp/tcp.c
190
if (getpeername(p->fd, sockp, &sz) != 0 ||
usr.sbin/ppp/tty.c
128
if (p->fd >= 0) {
usr.sbin/ppp/tty.c
129
if (ioctl(p->fd, TIOCMGET, &dev->mbits) < 0) {
usr.sbin/ppp/tty.c
223
return dev->real.fd != -1;
usr.sbin/ppp/tty.c
281
if (ioctl(p->fd, TIOCGETD, &dev->real.disc) < 0) {
usr.sbin/ppp/tty.c
287
if (ID0ioctl(p->fd, TIOCSETD, &ldisc) < 0) {
usr.sbin/ppp/tty.c
294
if (ioctl(p->fd, NGIOCGINFO, info) < 0) {
usr.sbin/ppp/tty.c
297
ID0ioctl(p->fd, TIOCSETD, &dev->real.disc);
usr.sbin/ppp/tty.c
306
ID0ioctl(p->fd, TIOCSETD, &dev->real.disc);
usr.sbin/ppp/tty.c
361
dev->real.fd = p->fd;
usr.sbin/ppp/tty.c
362
p->fd = ds;
usr.sbin/ppp/tty.c
374
ID0ioctl(p->fd, TIOCSETD, &dev->real.disc);
usr.sbin/ppp/tty.c
390
close(p->fd);
usr.sbin/ppp/tty.c
391
p->fd = dev->real.fd;
usr.sbin/ppp/tty.c
392
dev->real.fd = -1;
usr.sbin/ppp/tty.c
396
if (ID0ioctl(p->fd, TIOCSETD, &dev->real.disc) == 0) {
usr.sbin/ppp/tty.c
412
return NgSendData(p->fd, dev->hook, v, n) == -1 ? -1 : (ssize_t)n;
usr.sbin/ppp/tty.c
414
return write(p->fd, v, n);
usr.sbin/ppp/tty.c
424
return NgRecvData(p->fd, v, n, hook);
usr.sbin/ppp/tty.c
426
return read(p->fd, v, n);
usr.sbin/ppp/tty.c
440
if (p->type != PHYS_DIRECT && p->fd >= 0 && !Online(dev))
usr.sbin/ppp/tty.c
442
p->link.name, p->fd, dev->mbits);
usr.sbin/ppp/tty.c
449
tcgetattr(p->fd, &ios);
usr.sbin/ppp/tty.c
459
if (tcsetattr(p->fd, TCSANOW, &ios) == -1)
usr.sbin/ppp/tty.c
465
oldflag = fcntl(p->fd, F_GETFL, 0);
usr.sbin/ppp/tty.c
468
fcntl(p->fd, F_SETFL, oldflag | O_NONBLOCK);
usr.sbin/ppp/tty.c
478
if (p->fd >= 0) {
usr.sbin/ppp/tty.c
484
tcgetattr(p->fd, &tio);
usr.sbin/ppp/tty.c
485
if (cfsetspeed(&tio, B0) == -1 || tcsetattr(p->fd, TCSANOW, &tio) == -1)
usr.sbin/ppp/tty.c
500
tcflush(p->fd, TCIOFLUSH);
usr.sbin/ppp/tty.c
502
if (!physical_IsSync(p) && tcsetattr(p->fd, TCSAFLUSH, &dev->ios) == -1)
usr.sbin/ppp/tty.c
510
if ((oldflag = fcntl(p->fd, F_GETFL, 0)) != -1)
usr.sbin/ppp/tty.c
511
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
usr.sbin/ppp/tty.c
536
if (tcgetattr(p->fd, &ios) == -1)
usr.sbin/ppp/tty.c
681
if (p->fd < 0 || !isatty(p->fd))
usr.sbin/ppp/tty.c
686
physical_SetDevice(p, ttyname(p->fd));
usr.sbin/ppp/tty.c
696
close(p->fd);
usr.sbin/ppp/tty.c
697
p->fd = -1;
usr.sbin/ppp/tty.c
706
dev->real.fd = -1;
usr.sbin/ppp/tty.c
710
tcgetattr(p->fd, &ios);
usr.sbin/ppp/tty.c
718
" iflag = %lx, oflag = %lx, cflag = %lx\n", p->link.name, p->fd,
usr.sbin/ppp/tty.c
741
if (tcsetattr(p->fd, TCSADRAIN, &ios) == -1) {
usr.sbin/ppp/tty.c
753
oldflag = fcntl(p->fd, F_GETFL, 0);
usr.sbin/ppp/tty.c
760
close(p->fd);
usr.sbin/ppp/tty.c
761
p->fd = -1;
usr.sbin/ppp/tty.c
765
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
usr.sbin/ppp/tty.c
95
int fd; /* Pre-line-discipline fd */
usr.sbin/ppp/tun.c
115
if (ID0ioctl(bundle->dev.fd, TUNSIFINFO, &info) < 0)
usr.sbin/ppp/udp.c
102
ret = write(p->fd, v, n);
usr.sbin/ppp/udp.c
117
return read(p->fd, v, n);
usr.sbin/ppp/udp.c
120
ret = recvfrom(p->fd, v, n, 0, (struct sockaddr *)&dev->sock, &sz);
usr.sbin/ppp/udp.c
233
p->fd = socket(PF_INET, SOCK_DGRAM, 0);
usr.sbin/ppp/udp.c
234
if (p->fd >= 0) {
usr.sbin/ppp/udp.c
237
if (connect(p->fd, (struct sockaddr *)&dev->sock, sizeof dev->sock) == 0) {
usr.sbin/ppp/udp.c
245
close(p->fd);
usr.sbin/ppp/udp.c
246
p->fd = -1;
usr.sbin/ppp/udp.c
259
if (p->fd < 0) {
usr.sbin/ppp/udp.c
270
p->fd--; /* We own the device but maybe can't use it - change fd */
usr.sbin/ppp/udp.c
285
if (fstat(p->fd, &st) != -1 && (st.st_mode & S_IFSOCK)) {
usr.sbin/ppp/udp.c
289
if (getsockopt(p->fd, SOL_SOCKET, SO_TYPE, &type, &sz) == -1) {
usr.sbin/ppp/udp.c
291
close(p->fd);
usr.sbin/ppp/udp.c
292
p->fd = -1;
usr.sbin/ppp/udp.c
306
if (getpeername(p->fd, sockp, &sz) == 0) {
usr.sbin/ppp/udp.c
90
ret = write(p->fd, v, n);
usr.sbin/ppp/udp.c
95
ret = sendto(p->fd, v, n, 0, (struct sockaddr *)&dev->sock,
usr.sbin/pppctl/pppctl.c
118
Receive(int fd, int display)
usr.sbin/pppctl/pppctl.c
130
FD_SET(fd, &f);
usr.sbin/pppctl/pppctl.c
136
while (Result = read(fd, Buffer+len, sizeof(Buffer)-len-1), Result != -1) {
usr.sbin/pppctl/pppctl.c
168
write(fd, Buffer, strlen(Buffer));
usr.sbin/pppctl/pppctl.c
170
return Receive(fd, display & ~REC_PASSWD);
usr.sbin/pppctl/pppctl.c
190
if ((Result = select(fd + 1, &f, NULL, NULL, &t)) <= 0) {
usr.sbin/pppctl/pppctl.c
245
SmartGets(EditLine *e, int *count, int fd)
usr.sbin/pppctl/pppctl.c
252
data = fd;
usr.sbin/pppctl/pppctl.c
373
int n, arg, fd, len, verbose, save_errno, hide1, hide1off, hide2;
usr.sbin/pppctl/pppctl.c
460
if (fd = socket(AF_LOCAL, SOCK_STREAM, 0), fd < 0) {
usr.sbin/pppctl/pppctl.c
464
if (connect(fd, (struct sockaddr *)&ifsun, sizeof(ifsun)) < 0) {
usr.sbin/pppctl/pppctl.c
469
close(fd);
usr.sbin/pppctl/pppctl.c
515
if (fd = socket(pai->ai_family, pai->ai_socktype,
usr.sbin/pppctl/pppctl.c
516
pai->ai_protocol), fd < 0) {
usr.sbin/pppctl/pppctl.c
528
if (connect(fd, pai->ai_addr, pai->ai_addrlen) == 0)
usr.sbin/pppctl/pppctl.c
547
close(fd);
usr.sbin/pppctl/pppctl.c
567
switch (Receive(fd, verbose | REC_PASSWD)) {
usr.sbin/pppctl/pppctl.c
607
td.ppp = fd;
usr.sbin/pppctl/pppctl.c
632
close(fd);
usr.sbin/pppctl/pppctl.c
633
fd = -1;
usr.sbin/pppctl/pppctl.c
654
write(fd, Buffer, strlen(Buffer));
usr.sbin/pppctl/pppctl.c
655
if (Receive(fd, verbose | REC_SHOW) != 0) {
usr.sbin/pppctl/pppctl.c
664
write(fd, "quit\n", 5);
usr.sbin/pppctl/pppctl.c
665
while (Receive(fd, verbose | REC_SHOW) == 0)
usr.sbin/pppctl/pppctl.c
677
if (fd != -1)
usr.sbin/pppctl/pppctl.c
678
close(fd);
usr.sbin/pw/cpdir.c
100
if (fd == -1) {
usr.sbin/pw/cpdir.c
104
copymkdir(rootfd, path, fd, st.st_mode & _DEF_DIRMODE,
usr.sbin/pw/cpdir.c
97
int fd;
usr.sbin/pw/cpdir.c
99
fd = openat(skelfd, e->d_name, O_DIRECTORY);
usr.sbin/pw/pw.c
123
conf.fd = -1;
usr.sbin/pw/pw.c
172
int fd;
usr.sbin/pw/pw.c
180
fd = open(optarg,
usr.sbin/pw/pw.c
183
if (fd == -1)
usr.sbin/pw/pw.c
187
conf.metalog = fdopen(fd, "ae");
usr.sbin/pw/pw.h
99
int groupadd(struct userconf *, char *name, gid_t id, char *members, int fd,
usr.sbin/pw/pw_conf.c
413
int fd;
usr.sbin/pw/pw_conf.c
427
if ((fd = open(file, O_CREAT|O_RDWR|O_TRUNC|O_EXLOCK, 0644)) == -1)
usr.sbin/pw/pw_conf.c
430
if ((fp = fdopen(fd, "w")) == NULL) {
usr.sbin/pw/pw_conf.c
431
close(fd);
usr.sbin/pw/pw_group.c
457
groupadd(struct userconf *cnf, char *name, gid_t id, char *members, int fd,
usr.sbin/pw/pw_group.c
48
grp_set_passwd(struct group *grp, bool update, int fd, bool precrypted)
usr.sbin/pw/pw_group.c
482
grp_set_passwd(grp, false, fd, precrypted);
usr.sbin/pw/pw_group.c
509
int ch, rc, fd = -1;
usr.sbin/pw/pw_group.c
536
if (fd != -1)
usr.sbin/pw/pw_group.c
539
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_group.c
541
if (fd == '-')
usr.sbin/pw/pw_group.c
545
if (fd != -1)
usr.sbin/pw/pw_group.c
548
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_group.c
56
if (fd == -1)
usr.sbin/pw/pw_group.c
581
rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun,
usr.sbin/pw/pw_group.c
59
if (fd == '-') {
usr.sbin/pw/pw_group.c
601
int ch, rc, fd = -1;
usr.sbin/pw/pw_group.c
634
if (fd != -1)
usr.sbin/pw/pw_group.c
637
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_group.c
639
if (fd == '-')
usr.sbin/pw/pw_group.c
64
if ((istty = isatty(fd))) {
usr.sbin/pw/pw_group.c
643
if (fd != -1)
usr.sbin/pw/pw_group.c
646
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_group.c
65
if (tcgetattr(fd, &t) == -1)
usr.sbin/pw/pw_group.c
684
grp_set_passwd(grp, true, fd, precrypted);
usr.sbin/pw/pw_group.c
71
tcsetattr(fd, TCSANOW, &n);
usr.sbin/pw/pw_group.c
78
b = read(fd, line, sizeof(line) - 1);
usr.sbin/pw/pw_group.c
80
tcsetattr(fd, TCSANOW, &t);
usr.sbin/pw/pw_group.c
91
conf.fd);
usr.sbin/pw/pw_log.c
46
int fd, i, rlen;
usr.sbin/pw/pw_log.c
55
fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600);
usr.sbin/pw/pw_log.c
56
if (fd == -1) {
usr.sbin/pw/pw_log.c
59
logfile = fdopen(fd, "a");
usr.sbin/pw/pw_user.c
1209
int rc, ch, fd = -1;
usr.sbin/pw/pw_user.c
1304
if (fd != -1)
usr.sbin/pw/pw_user.c
1307
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_user.c
1309
if (fd == '-')
usr.sbin/pw/pw_user.c
1313
if (fd != -1)
usr.sbin/pw/pw_user.c
1316
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_user.c
1425
if (fd != -1)
usr.sbin/pw/pw_user.c
1426
pw_set_passwd(pwd, fd, precrypted, false);
usr.sbin/pw/pw_user.c
1542
int ch, fd = -1;
usr.sbin/pw/pw_user.c
1627
if (fd != -1)
usr.sbin/pw/pw_user.c
1630
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_user.c
1632
if (fd == '-')
usr.sbin/pw/pw_user.c
1636
if (fd != -1)
usr.sbin/pw/pw_user.c
1639
fd = pw_checkfd(optarg);
usr.sbin/pw/pw_user.c
166
pw_set_passwd(struct passwd *pwd, int fd, bool precrypted, bool update)
usr.sbin/pw/pw_user.c
174
if (fd == '-') {
usr.sbin/pw/pw_user.c
1767
if (passwd && conf.fd == -1) {
usr.sbin/pw/pw_user.c
1783
if (fd != -1)
usr.sbin/pw/pw_user.c
1784
edited = pw_set_passwd(pwd, fd, precrypted, true);
usr.sbin/pw/pw_user.c
182
if ((istty = isatty(fd))) {
usr.sbin/pw/pw_user.c
183
if (tcgetattr(fd, &t) == -1)
usr.sbin/pw/pw_user.c
188
tcsetattr(fd, TCSANOW, &n);
usr.sbin/pw/pw_user.c
196
b = read(fd, line, sizeof(line) - 1);
usr.sbin/pw/pw_user.c
198
tcsetattr(fd, TCSANOW, &t);
usr.sbin/pw/pw_user.c
211
fd);
usr.sbin/pw/pw_user.c
527
if (conf.fd == -1) {
usr.sbin/pw/pw_utils.c
42
int fd = -1;
usr.sbin/pw/pw_utils.c
46
fd = strtonum(nptr, 0, INT_MAX, &errstr);
usr.sbin/pw/pw_utils.c
50
return (fd);
usr.sbin/pw/pwupd.h
80
int fd;
usr.sbin/pwm/pwm.c
144
if ((fd = open(device_name, O_RDWR)) == -1) {
usr.sbin/pwm/pwm.c
159
if (caph_rights_limit(fd, &right_ioctl) < 0) {
usr.sbin/pwm/pwm.c
163
if (caph_ioctls_limit(fd, pwm_ioctls, nitems(pwm_ioctls)) < 0) {
usr.sbin/pwm/pwm.c
173
if (ioctl(fd, PWMGETSTATE, &state) == -1) {
usr.sbin/pwm/pwm.c
202
if (ioctl(fd, PWMSETSTATE, &state) == -1) {
usr.sbin/pwm/pwm.c
209
close(fd);
usr.sbin/pwm/pwm.c
213
close(fd);
usr.sbin/pwm/pwm.c
76
int fd;
usr.sbin/pwm/pwm.c
86
fd = -1;
usr.sbin/quot/quot.c
104
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
127
if (lseek(fd, (off_t)cgtod(super, cg) << super->fs_fshift, 0) < 0)
usr.sbin/quot/quot.c
129
if (read(fd, cgp, super->fs_cgsize) != super->fs_cgsize)
usr.sbin/quot/quot.c
138
if (lseek(fd, off, SEEK_SET) != off ||
usr.sbin/quot/quot.c
139
read(fd, ipbuf, INOSZ(super)) != (ssize_t)INOSZ(super))
usr.sbin/quot/quot.c
307
dofsizes(int fd, struct fs *super)
usr.sbin/quot/quot.c
317
if ((dp = get_inode(fd, super, inode)) != NULL &&
usr.sbin/quot/quot.c
355
douser(int fd, struct fs *super)
usr.sbin/quot/quot.c
364
if ((dp = get_inode(fd, super, inode)) != NULL &&
usr.sbin/quot/quot.c
392
donames(int fd, struct fs *super)
usr.sbin/quot/quot.c
418
if ((dp = get_inode(fd, super, inode)) != NULL &&
usr.sbin/quot/quot.c
443
int fd;
usr.sbin/quot/quot.c
449
if ((fd = open(name, 0)) < 0) {
usr.sbin/quot/quot.c
451
close(fd);
usr.sbin/quot/quot.c
454
switch (errno = sbget(fd, &fs, UFS_STDSB, UFS_NOCSUM)) {
usr.sbin/quot/quot.c
459
close(fd);
usr.sbin/quot/quot.c
463
close(fd);
usr.sbin/quot/quot.c
470
(*func)(fd, fs);
usr.sbin/quot/quot.c
472
close(fd);
usr.sbin/rarpd/rarpd.c
375
int fd;
usr.sbin/rarpd/rarpd.c
384
fd = open(device, O_RDWR);
usr.sbin/rarpd/rarpd.c
385
} while ((fd == -1) && (errno == EBUSY));
usr.sbin/rarpd/rarpd.c
387
if (fd == -1) {
usr.sbin/rarpd/rarpd.c
392
return fd;
usr.sbin/rarpd/rarpd.c
402
int fd;
usr.sbin/rarpd/rarpd.c
421
fd = bpf_open();
usr.sbin/rarpd/rarpd.c
426
if (ioctl(fd, BIOCIMMEDIATE, &immediate) == -1) {
usr.sbin/rarpd/rarpd.c
431
if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) == -1) {
usr.sbin/rarpd/rarpd.c
439
if (ioctl(fd, BIOCGDLT, (caddr_t)&dlt) == -1) {
usr.sbin/rarpd/rarpd.c
450
if (ioctl(fd, BIOCSETF, (caddr_t)&filter) == -1) {
usr.sbin/rarpd/rarpd.c
454
return fd;
usr.sbin/rarpd/rarpd.c
506
int cc, fd;
usr.sbin/rarpd/rarpd.c
545
fd = ii->ii_fd;
usr.sbin/rarpd/rarpd.c
546
if (!FD_ISSET(fd, &listeners))
usr.sbin/rarpd/rarpd.c
549
cc = read(fd, (char *)buf, bufsize);
usr.sbin/route6d/route6d.c
703
set[0].fd = ripsock;
usr.sbin/route6d/route6d.c
715
set[1].fd = rtsock;
usr.sbin/route6d/route6d.c
723
set[1].fd = -1;
usr.sbin/rpc.lockd/lockd.c
272
int fd, oldmask;
usr.sbin/rpc.lockd/lockd.c
280
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
usr.sbin/rpc.lockd/lockd.c
281
if (!fd) {
usr.sbin/rpc.lockd/lockd.c
285
if (bind(fd, (struct sockaddr *) &sun, sun.sun_len) < 0) {
usr.sbin/rpc.lockd/lockd.c
289
if (listen(fd, SOMAXCONN) < 0) {
usr.sbin/rpc.lockd/lockd.c
292
xprt = svc_vc_create(fd, RPC_MAXDATASIZE, RPC_MAXDATASIZE);
usr.sbin/rpc.lockd/lockd.c
506
int fd;
usr.sbin/rpc.lockd/lockd.c
550
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpc.lockd/lockd.c
569
close(fd);
usr.sbin/rpc.lockd/lockd.c
585
close(fd);
usr.sbin/rpc.lockd/lockd.c
642
close(fd);
usr.sbin/rpc.lockd/lockd.c
653
close(fd);
usr.sbin/rpc.lockd/lockd.c
677
sock_fd[sock_fdcnt - 1] = fd;
usr.sbin/rpc.lockd/lockd.c
680
r = bindresvport_sa(fd, res->ai_addr);
usr.sbin/rpc.lockd/lockd.c
729
int aicode, fd, nhostsbak;
usr.sbin/rpc.lockd/lockd.c
754
fd = sock_fd[sock_fdpos++];
usr.sbin/rpc.lockd/lockd.c
755
if (fd < 0)
usr.sbin/rpc.lockd/lockd.c
759
listen(fd, SOMAXCONN);
usr.sbin/rpc.lockd/lockd.c
761
transp = svc_tli_create(fd, nconf, NULL,
usr.sbin/rpc.lockd/lockd_lock.c
1062
nmf->fd = fhopen(&fl->filehandle, O_RDWR);
usr.sbin/rpc.lockd/lockd_lock.c
1063
if (nmf->fd < 0) {
usr.sbin/rpc.lockd/lockd_lock.c
1085
flerror = flock(nmf->fd, lflags);
usr.sbin/rpc.lockd/lockd_lock.c
1090
close(nmf->fd);
usr.sbin/rpc.lockd/lockd_lock.c
1145
close(imf->fd);
usr.sbin/rpc.lockd/lockd_lock.c
126
int fd; /* file descriptor: remains open until unlock! */
usr.sbin/rpc.statd/statd.c
333
int fd;
usr.sbin/rpc.statd/statd.c
375
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpc.statd/statd.c
391
close(fd);
usr.sbin/rpc.statd/statd.c
406
close(fd);
usr.sbin/rpc.statd/statd.c
462
close(fd);
usr.sbin/rpc.statd/statd.c
472
close(fd);
usr.sbin/rpc.statd/statd.c
478
sock_fd[sock_fdcnt - 1] = fd;
usr.sbin/rpc.statd/statd.c
481
r = bindresvport_sa(fd, res->ai_addr);
usr.sbin/rpc.statd/statd.c
528
int aicode, fd, nhostsbak;
usr.sbin/rpc.statd/statd.c
553
fd = sock_fd[sock_fdpos++];
usr.sbin/rpc.statd/statd.c
554
if (fd < 0)
usr.sbin/rpc.statd/statd.c
558
listen(fd, SOMAXCONN);
usr.sbin/rpc.statd/statd.c
560
transp = svc_tli_create(fd, nconf, NULL,
usr.sbin/rpcbind/check_bound.c
59
int fd;
usr.sbin/rpcbind/check_bound.c
79
int fd;
usr.sbin/rpcbind/check_bound.c
90
fd = __rpc_nconf2fd(fdl->nconf);
usr.sbin/rpcbind/check_bound.c
91
if (fd < 0) {
usr.sbin/rpcbind/check_bound.c
97
ans = bind(fd, (struct sockaddr *)na->buf, na->len);
usr.sbin/rpcbind/check_bound.c
99
close(fd);
usr.sbin/rpcbind/rpcb_svc_com.c
1092
p->fd = terminate_rfd;
usr.sbin/rpcbind/rpcb_svc_com.c
1097
p->fd = n;
usr.sbin/rpcbind/rpcb_svc_com.c
1110
fprintf(stderr, "%d ", p->fd);
usr.sbin/rpcbind/rpcb_svc_com.c
1153
p->fd, p->revents);
usr.sbin/rpcbind/rpcb_svc_com.c
1189
if ((xprt = find_rmtcallxprt_by_fd(pfds[j].fd)) != NULL) {
usr.sbin/rpcbind/rpcb_svc_com.c
1196
__func__, pfds[j].fd, xprt->xp_netid);
usr.sbin/rpcbind/rpcb_svc_com.c
1198
handle_reply(pfds[j].fd, xprt);
usr.sbin/rpcbind/rpcb_svc_com.c
1232
handle_reply(int fd, SVCXPRT *xprt)
usr.sbin/rpcbind/rpcb_svc_com.c
1253
inlen = recvfrom(fd, buffer, RPC_BUF_MAX, 0,
usr.sbin/rpcbind/rpcb_svc_com.c
397
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
399
if ((fd = open("/dev/null", O_RDONLY)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
489
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
493
if ((fd = __rpc_nconf2fd(nconf)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
499
xprt = svc_tli_create(fd, 0, NULL, 0, 0);
usr.sbin/rpcbind/rpcb_svc_com.c
514
rmt->fd = fd;
usr.sbin/rpcbind/rpcb_svc_com.c
524
if (fd > svc_maxfd)
usr.sbin/rpcbind/rpcb_svc_com.c
525
svc_maxfd = fd;
usr.sbin/rpcbind/rpcb_svc_com.c
526
FD_SET(fd, &svc_fdset);
usr.sbin/rpcbind/rpcb_svc_com.c
527
return (fd);
usr.sbin/rpcbind/rpcb_svc_com.c
537
return (rmt->fd);
usr.sbin/rpcbind/rpcb_svc_com.c
544
find_rmtcallxprt_by_fd(int fd)
usr.sbin/rpcbind/rpcb_svc_com.c
549
if (fd == rmt->fd) {
usr.sbin/rpcbind/rpcb_svc_com.c
612
int fd = -1;
usr.sbin/rpcbind/rpcb_svc_com.c
71
int fd;
usr.sbin/rpcbind/rpcb_svc_com.c
755
if ((fd = find_rmtcallfd_by_netid(nconf->nc_netid)) == -1) {
usr.sbin/rpcbind/rpcb_svc_com.c
761
switch (forward_register(*xidp, caller, fd, m_uaddr, reply_type,
usr.sbin/rpcbind/rpcb_svc_com.c
884
if (sendto(fd, outbufp, outlen, 0, (struct sockaddr *)na->buf, na->len)
usr.sbin/rpcbind/rpcbind.c
302
int fd = -1;
usr.sbin/rpcbind/rpcbind.c
347
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpcbind/rpcbind.c
407
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
usr.sbin/rpcbind/rpcbind.c
427
close(fd);
usr.sbin/rpcbind/rpcbind.c
442
close(fd);
usr.sbin/rpcbind/rpcbind.c
446
if (setsockopt(fd, IPPROTO_IPV6,
usr.sbin/rpcbind/rpcbind.c
472
if (bind(fd, sa, addrlen) != 0) {
usr.sbin/rpcbind/rpcbind.c
514
listen(fd, SOMAXCONN);
usr.sbin/rpcbind/rpcbind.c
516
my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
usr.sbin/rpcbind/rpcbind.c
521
if (bind(fd, sa, addrlen) < 0) {
usr.sbin/rpcbind/rpcbind.c
556
listen(fd, SOMAXCONN);
usr.sbin/rpcbind/rpcbind.c
558
my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
usr.sbin/rpcbind/rpcbind.c
708
if (fd != -1)
usr.sbin/rpcbind/rpcbind.c
709
close(fd);
usr.sbin/rtadvd/control.c
147
n = read(fd, msg, msglen);
usr.sbin/rtadvd/control.c
167
close(fd);
usr.sbin/rtadvd/control.c
172
cm_send(int fd, char *buf)
usr.sbin/rtadvd/control.c
199
len = writev(fd, iov, iovcnt);
usr.sbin/rtadvd/control.c
207
close(fd);
usr.sbin/rtadvd/control.c
217
close(fd);
usr.sbin/rtadvd/control.c
229
int fd;
usr.sbin/rtadvd/control.c
232
if ((fd = accept(s->si_fd, (struct sockaddr *)&sun,
usr.sbin/rtadvd/control.c
239
if ((flags = fcntl(fd, F_GETFL, 0)) == -1) {
usr.sbin/rtadvd/control.c
244
if ((flags = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1) {
usr.sbin/rtadvd/control.c
249
fd, s->si_fd);
usr.sbin/rtadvd/control.c
251
return (fd);
usr.sbin/rtadvd/control.c
60
cm_recv(int fd, char *buf)
usr.sbin/rtadvd/control.c
68
syslog(LOG_DEBUG, "<%s> enter, fd=%d", __func__, fd);
usr.sbin/rtadvd/control.c
74
pfds[0].fd = fd;
usr.sbin/rtadvd/control.c
91
n = read(fd, cm, sizeof(*cm));
usr.sbin/rtadvd/control_client.c
103
error = cm_recv(fd, buf);
usr.sbin/rtadvd/control_client.c
107
close(fd);
usr.sbin/rtadvd/control_client.c
118
close(fd);
usr.sbin/rtadvd/control_client.c
123
close(fd);
usr.sbin/rtadvd/control_client.c
131
close(fd);
usr.sbin/rtadvd/control_client.c
58
cm_handler_client(int fd, int state, char *buf_orig)
usr.sbin/rtadvd/control_client.c
77
close(fd);
usr.sbin/rtadvd/control_client.c
94
error = cm_send(fd, buf);
usr.sbin/rtadvd/control_server.c
686
cm_handler_server(int fd)
usr.sbin/rtadvd/control_server.c
713
error = cm_send(fd, buf);
usr.sbin/rtadvd/control_server.c
720
error = cm_recv(fd, buf);
usr.sbin/rtadvd/control_server.c
724
close(fd);
usr.sbin/rtadvd/control_server.c
734
close(fd);
usr.sbin/rtadvd/control_server.c
739
close(fd);
usr.sbin/rtadvd/control_server.c
745
error = cm_recv(fd, buf);
usr.sbin/rtadvd/control_server.c
750
close(fd);
usr.sbin/rtadvd/rtadvd.c
278
set[PFD_RAWSOCK].fd = sock.si_fd;
usr.sbin/rtadvd/rtadvd.c
282
set[PFD_RTSOCK].fd = rtsock.si_fd;
usr.sbin/rtadvd/rtadvd.c
285
set[PFD_RTSOCK].fd = -1;
usr.sbin/rtadvd/rtadvd.c
286
set[PFD_CSOCK].fd = ctrlsock.si_fd;
usr.sbin/rtadvd/rtadvd.c
354
int fd;
usr.sbin/rtadvd/rtadvd.c
356
fd = csock_accept(&ctrlsock);
usr.sbin/rtadvd/rtadvd.c
357
if (fd == -1)
usr.sbin/rtadvd/rtadvd.c
362
cm_handler_server(fd);
usr.sbin/rtadvd/rtadvd.c
363
close(fd);
usr.sbin/rtsold/cap_script.c
162
int error, fd, status;
usr.sbin/rtsold/cap_script.c
197
fd = script_run(argv);
usr.sbin/rtsold/cap_script.c
200
if (fd < 0)
usr.sbin/rtsold/cap_script.c
203
(void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE));
usr.sbin/rtsold/cap_script.c
204
nvlist_move_descriptor(nvlout, "fd", fd);
usr.sbin/rtsold/cap_script.c
60
int fd[2], null;
usr.sbin/rtsold/cap_script.c
62
if (pipe(fd) != 0)
usr.sbin/rtsold/cap_script.c
67
(void)close(fd[1]);
usr.sbin/rtsold/cap_script.c
71
if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO)
usr.sbin/rtsold/cap_script.c
78
(void)close(fd[0]);
usr.sbin/rtsold/cap_script.c
80
return (fd[1]);
usr.sbin/sesutil/sesutil.c
127
do_led(int fd, unsigned int idx, elm_type_t type, bool onoff, bool setfault)
usr.sbin/sesutil/sesutil.c
134
if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &o) < 0) {
usr.sbin/sesutil/sesutil.c
135
close(fd);
usr.sbin/sesutil/sesutil.c
152
if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &o) < 0) {
usr.sbin/sesutil/sesutil.c
153
close(fd);
usr.sbin/sesutil/sesutil.c
182
int fd;
usr.sbin/sesutil/sesutil.c
234
if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) {
usr.sbin/sesutil/sesutil.c
246
if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) {
usr.sbin/sesutil/sesutil.c
247
close(fd);
usr.sbin/sesutil/sesutil.c
253
close(fd);
usr.sbin/sesutil/sesutil.c
257
if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) {
usr.sbin/sesutil/sesutil.c
259
close(fd);
usr.sbin/sesutil/sesutil.c
266
close(fd);
usr.sbin/sesutil/sesutil.c
270
do_led(fd, sesid, objp[sesid].elm_type, onoff, setfault);
usr.sbin/sesutil/sesutil.c
273
close(fd);
usr.sbin/sesutil/sesutil.c
284
if (ioctl(fd, ENCIOC_GETELMSTAT, &es) < 0) {
usr.sbin/sesutil/sesutil.c
285
close(fd);
usr.sbin/sesutil/sesutil.c
291
do_led(fd, objp[j].elm_idx, objp[j].elm_type,
usr.sbin/sesutil/sesutil.c
300
if (ioctl(fd, ENCIOC_GETELMDEVNAMES,
usr.sbin/sesutil/sesutil.c
306
do_led(fd, objdn.elm_idx, objp[j].elm_type,
usr.sbin/sesutil/sesutil.c
314
close(fd);
usr.sbin/sesutil/sesutil.c
418
int fd;
usr.sbin/sesutil/sesutil.c
452
if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) {
usr.sbin/sesutil/sesutil.c
464
if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) {
usr.sbin/sesutil/sesutil.c
465
close(fd);
usr.sbin/sesutil/sesutil.c
471
close(fd);
usr.sbin/sesutil/sesutil.c
475
if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) e_ptr) < 0) {
usr.sbin/sesutil/sesutil.c
476
close(fd);
usr.sbin/sesutil/sesutil.c
484
if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0)
usr.sbin/sesutil/sesutil.c
488
if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0)
usr.sbin/sesutil/sesutil.c
496
if (ioctl(fd, ENCIOC_GETELMSTAT,
usr.sbin/sesutil/sesutil.c
498
close(fd);
usr.sbin/sesutil/sesutil.c
504
if (ioctl(fd, ENCIOC_GETELMDESC,
usr.sbin/sesutil/sesutil.c
506
close(fd);
usr.sbin/sesutil/sesutil.c
512
if (ioctl(fd, ENCIOC_GETELMDEVNAMES,
usr.sbin/sesutil/sesutil.c
537
close(fd);
usr.sbin/sesutil/sesutil.c
585
int fd;
usr.sbin/sesutil/sesutil.c
591
fd = open(tmp, O_RDONLY);
usr.sbin/sesutil/sesutil.c
593
if (fd < 0) {
usr.sbin/sesutil/sesutil.c
601
close(fd);
usr.sbin/sesutil/sesutil.c
607
if (ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/sesutil/sesutil.c
612
if (ioctl(fd, DIOCGIDENT, ident) == 0)
usr.sbin/sesutil/sesutil.c
617
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) == 0)
usr.sbin/sesutil/sesutil.c
621
close(fd);
usr.sbin/sesutil/sesutil.c
625
show_device(int fd, int elm_idx, encioc_elm_status_t e_status, encioc_elm_desc_t e_desc)
usr.sbin/sesutil/sesutil.c
637
close(fd);
usr.sbin/sesutil/sesutil.c
641
if (ioctl(fd, ENCIOC_GETELMDEVNAMES,
usr.sbin/sesutil/sesutil.c
725
int fd;
usr.sbin/sesutil/sesutil.c
755
if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) {
usr.sbin/sesutil/sesutil.c
767
if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) {
usr.sbin/sesutil/sesutil.c
768
close(fd);
usr.sbin/sesutil/sesutil.c
774
close(fd);
usr.sbin/sesutil/sesutil.c
778
if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) e_ptr) < 0) {
usr.sbin/sesutil/sesutil.c
779
close(fd);
usr.sbin/sesutil/sesutil.c
793
if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0)
usr.sbin/sesutil/sesutil.c
797
if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0)
usr.sbin/sesutil/sesutil.c
807
if (ioctl(fd, ENCIOC_GETELMSTAT,
usr.sbin/sesutil/sesutil.c
809
close(fd);
usr.sbin/sesutil/sesutil.c
824
if (ioctl(fd, ENCIOC_GETELMDESC,
usr.sbin/sesutil/sesutil.c
826
close(fd);
usr.sbin/sesutil/sesutil.c
837
show_device(fd, e_ptr[j].elm_idx, e_status, e_desc);
usr.sbin/sesutil/sesutil.c
868
close(fd);
usr.sbin/sesutil/sesutil.c
884
int fd, status;
usr.sbin/sesutil/sesutil.c
908
if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) {
usr.sbin/sesutil/sesutil.c
920
if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) {
usr.sbin/sesutil/sesutil.c
922
close(fd);
usr.sbin/sesutil/sesutil.c
961
close(fd);
usr.sbin/smbmsg/smbmsg.c
115
if (ioctl(fd, SMB_RECVB, &c) != -1)
usr.sbin/smbmsg/smbmsg.c
117
if (ioctl(fd, SMB_QUICK_WRITE, &c) != -1)
usr.sbin/smbmsg/smbmsg.c
148
return (ioctl(fd, SMB_QUICK_WRITE, &c));
usr.sbin/smbmsg/smbmsg.c
151
return (ioctl(fd, SMB_QUICK_READ, &c));
usr.sbin/smbmsg/smbmsg.c
154
if (ioctl(fd, SMB_RECVB, &c) == -1)
usr.sbin/smbmsg/smbmsg.c
162
return (ioctl(fd, SMB_SENDB, &c));
usr.sbin/smbmsg/smbmsg.c
168
if (ioctl(fd, SMB_READB, &c) == -1)
usr.sbin/smbmsg/smbmsg.c
176
return (ioctl(fd, SMB_WRITEB, &c));
usr.sbin/smbmsg/smbmsg.c
179
if (ioctl(fd, SMB_READW, &c) == -1)
usr.sbin/smbmsg/smbmsg.c
187
return (ioctl(fd, SMB_WRITEW, &c));
usr.sbin/smbmsg/smbmsg.c
194
if (ioctl(fd, SMB_PCALL, &c) == -1)
usr.sbin/smbmsg/smbmsg.c
203
if (ioctl(fd, SMB_BREAD, &c) == -1)
usr.sbin/smbmsg/smbmsg.c
216
return (ioctl(fd, SMB_BWRITE, &c));
usr.sbin/smbmsg/smbmsg.c
324
if ((fd = open(dev, O_RDWR)) == -1)
usr.sbin/smbmsg/smbmsg.c
334
close(fd);
usr.sbin/smbmsg/smbmsg.c
54
static int fd; /* file descriptor for /dev/smbX */
usr.sbin/sndctl/sndctl.c
447
int fd, caps, unit, t1, t2, t3;
usr.sbin/sndctl/sndctl.c
449
if ((fd = open("/dev/sndstat", O_RDONLY)) < 0)
usr.sbin/sndctl/sndctl.c
452
if (ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL) < 0)
usr.sbin/sndctl/sndctl.c
457
if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0)
usr.sbin/sndctl/sndctl.c
463
if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0)
usr.sbin/sndctl/sndctl.c
651
close(fd);
usr.sbin/syslogd/syslogd.c
1857
int fd;
usr.sbin/syslogd/syslogd.c
1859
fd = f->f_addr_fds[i];
usr.sbin/syslogd/syslogd.c
1860
lsent = sendmsg(fd, &msg, 0);
usr.sbin/syslogd/syslogd.c
1865
error = cap_connect(cap_net, fd,
usr.sbin/syslogd/syslogd.c
1869
fd = find_forw_fd(&f->f_addrs[i].raddr,
usr.sbin/syslogd/syslogd.c
1871
if (fd != -1) {
usr.sbin/syslogd/syslogd.c
1872
(void)dup2(fd,
usr.sbin/syslogd/syslogd.c
1874
fd = f->f_addr_fds[i];
usr.sbin/syslogd/syslogd.c
1888
lsent = sendmsg(fd, &msg, 0);
usr.sbin/syslogd/syslogd.c
3051
int fd;
usr.sbin/syslogd/syslogd.c
3057
fd = dup(fdp[j]);
usr.sbin/syslogd/syslogd.c
3058
if (fd < 0)
usr.sbin/syslogd/syslogd.c
3060
return (fd);
usr.sbin/syslogd/syslogd.c
3442
pollfd.fd = pipefd[0];
usr.sbin/syslogd/syslogd.c
4017
increase_rcvbuf(int fd)
usr.sbin/syslogd/syslogd.c
4021
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len,
usr.sbin/syslogd/syslogd.c
4025
setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len, sizeof(len));
usr.sbin/syslogd/syslogd.c
475
addfile(int fd)
usr.sbin/syslogd/syslogd.c
480
sl->sl_socket = fd;
usr.sbin/traceroute/ifaddrlist.c
116
if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifr) < 0) {
usr.sbin/traceroute/ifaddrlist.c
122
(void)close(fd);
usr.sbin/traceroute/ifaddrlist.c
137
if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) {
usr.sbin/traceroute/ifaddrlist.c
140
(void)close(fd);
usr.sbin/traceroute/ifaddrlist.c
147
(void)close(fd);
usr.sbin/traceroute/ifaddrlist.c
156
(void)close(fd);
usr.sbin/traceroute/ifaddrlist.c
65
register int fd, nipaddr;
usr.sbin/traceroute/ifaddrlist.c
76
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/traceroute/ifaddrlist.c
77
if (fd < 0) {
usr.sbin/traceroute/ifaddrlist.c
84
if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 ||
usr.sbin/traceroute/ifaddrlist.c
93
(void)close(fd);
usr.sbin/traceroute6/traceroute6.c
1058
pfd[0].fd = sock;
usr.sbin/trim/trim.c
141
candelete(int fd)
usr.sbin/trim/trim.c
147
if (ioctl(fd, DIOCGATTR, &arg) == 0)
usr.sbin/trim/trim.c
156
int fd;
usr.sbin/trim/trim.c
159
if ((fd = open(path, flags)) < 0) {
usr.sbin/trim/trim.c
163
fd = open(tstr, flags);
usr.sbin/trim/trim.c
168
if (fd < 0)
usr.sbin/trim/trim.c
171
return (fd);
usr.sbin/trim/trim.c
179
int fd;
usr.sbin/trim/trim.c
181
fd = opendev(path, O_RDONLY | O_DIRECT);
usr.sbin/trim/trim.c
183
if (fstat(fd, &sb) < 0)
usr.sbin/trim/trim.c
187
close(fd);
usr.sbin/trim/trim.c
197
if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0)
usr.sbin/trim/trim.c
202
close(fd);
usr.sbin/trim/trim.c
210
int error, fd;
usr.sbin/trim/trim.c
222
fd = opendev(path, O_RDWR | O_DIRECT);
usr.sbin/trim/trim.c
226
error = ioctl(fd, DIOCGDELETE, arg);
usr.sbin/trim/trim.c
228
if (errno == EOPNOTSUPP && verbose && !candelete(fd))
usr.sbin/trim/trim.c
233
close(fd);
usr.sbin/trim/trim.c
48
static bool candelete(int fd);
usr.sbin/tzsetup/tzsetup.c
827
int fd;
usr.sbin/tzsetup/tzsetup.c
966
fd = open(path_wall_cmos_clock,
usr.sbin/tzsetup/tzsetup.c
969
if (fd < 0) {
usr.sbin/tzsetup/tzsetup.c
974
close(fd);
usr.sbin/uefisign/child.c
54
int error, fd;
usr.sbin/uefisign/child.c
59
fd = fileno(x->x_fp);
usr.sbin/uefisign/child.c
61
error = fstat(fd, &sb);
usr.sbin/uhsoctl/uhsoctl.c
1145
ctx->fd = open(tty, O_RDWR);
usr.sbin/uhsoctl/uhsoctl.c
1146
if (ctx->fd < 0) {
usr.sbin/uhsoctl/uhsoctl.c
1153
tcgetattr(ctx->fd, &t);
usr.sbin/uhsoctl/uhsoctl.c
1158
tcsetattr(ctx->fd, TCSAFLUSH, &t);
usr.sbin/uhsoctl/uhsoctl.c
1252
at_cmd_async(ctx->fd, "AT+CGREG?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
1253
at_cmd_async(ctx->fd, "AT+CREG?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
1267
close(ctx->fd);
usr.sbin/uhsoctl/uhsoctl.c
1502
FD_SET(ctx.fd, &set);
usr.sbin/uhsoctl/uhsoctl.c
1506
error = select(ctx.fd + 1, &set, NULL, NULL, NULL);
usr.sbin/uhsoctl/uhsoctl.c
1523
if (FD_ISSET(ctx.fd, &set)) {
usr.sbin/uhsoctl/uhsoctl.c
1529
FD_SET(ctx.fd, &set);
usr.sbin/uhsoctl/uhsoctl.c
270
at_cmd_async(ctx->fd, "AT+CREG?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
279
at_cmd_async(ctx->fd, "AT+CGREG?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
288
at_cmd_async(ctx->fd, "AT+CSQ\r\n");
usr.sbin/uhsoctl/uhsoctl.c
366
int fd, error;
usr.sbin/uhsoctl/uhsoctl.c
372
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/uhsoctl/uhsoctl.c
373
if (fd < 0)
usr.sbin/uhsoctl/uhsoctl.c
376
error = ioctl(fd, SIOCGIFFLAGS, &ifr);
usr.sbin/uhsoctl/uhsoctl.c
389
error = ioctl(fd, SIOCSIFFLAGS, &ifr);
usr.sbin/uhsoctl/uhsoctl.c
393
close(fd);
usr.sbin/uhsoctl/uhsoctl.c
401
int error, fd;
usr.sbin/uhsoctl/uhsoctl.c
408
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/uhsoctl/uhsoctl.c
409
if (fd < 0)
usr.sbin/uhsoctl/uhsoctl.c
412
error = ioctl(fd, SIOCAIFADDR, (caddr_t)&ifra);
usr.sbin/uhsoctl/uhsoctl.c
416
close(fd);
usr.sbin/uhsoctl/uhsoctl.c
424
int error, fd;
usr.sbin/uhsoctl/uhsoctl.c
430
fd = socket(AF_INET, SOCK_DGRAM, 0);
usr.sbin/uhsoctl/uhsoctl.c
431
if (fd < 0)
usr.sbin/uhsoctl/uhsoctl.c
434
error = ioctl(fd, SIOCDIFADDR, (caddr_t)&ifr);
usr.sbin/uhsoctl/uhsoctl.c
438
close(fd);
usr.sbin/uhsoctl/uhsoctl.c
445
int i, n, fd;
usr.sbin/uhsoctl/uhsoctl.c
460
fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666);
usr.sbin/uhsoctl/uhsoctl.c
461
if (fd < 0)
usr.sbin/uhsoctl/uhsoctl.c
467
ftruncate(fd, 0);
usr.sbin/uhsoctl/uhsoctl.c
468
lseek(fd, 0, SEEK_SET);
usr.sbin/uhsoctl/uhsoctl.c
469
write(fd, ctx->resolv, ctx->resolv_sz);
usr.sbin/uhsoctl/uhsoctl.c
474
close(fd);
usr.sbin/uhsoctl/uhsoctl.c
481
close(fd);
usr.sbin/uhsoctl/uhsoctl.c
495
i = fstat(fd, &sb);
usr.sbin/uhsoctl/uhsoctl.c
500
n = read(fd, ctx->resolv, sb.st_size);
usr.sbin/uhsoctl/uhsoctl.c
510
ftruncate(fd, 0);
usr.sbin/uhsoctl/uhsoctl.c
511
lseek(fd, 0, SEEK_SET);
usr.sbin/uhsoctl/uhsoctl.c
512
fp = fdopen(fd, "w");
usr.sbin/uhsoctl/uhsoctl.c
557
readline(int fd, char *buf, size_t bufsz)
usr.sbin/uhsoctl/uhsoctl.c
563
n = read(fd, p, 1);
usr.sbin/uhsoctl/uhsoctl.c
599
n = write(ctx->fd, cmd, l);
usr.sbin/uhsoctl/uhsoctl.c
616
FD_SET(ctx->fd, &set);
usr.sbin/uhsoctl/uhsoctl.c
617
error = select(ctx->fd + 1, &set, NULL, NULL, NULL);
usr.sbin/uhsoctl/uhsoctl.c
630
n = readline(ctx->fd, buf, sizeof(buf));
usr.sbin/uhsoctl/uhsoctl.c
671
at_cmd_async(int fd, const char *cf, ...)
usr.sbin/uhsoctl/uhsoctl.c
685
return (write(fd, cmd, l));
usr.sbin/uhsoctl/uhsoctl.c
745
at_cmd_async(ctx->fd, "AT+COPS?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
772
at_cmd_async(ctx->fd, "AT+COPS?\r\n");
usr.sbin/uhsoctl/uhsoctl.c
803
at_cmd_async(ctx->fd, "AT_OWANCALL=%d,1,1\r\n",
usr.sbin/uhsoctl/uhsoctl.c
857
at_cmd_async(ctx->fd, "AT_OWANDATA=%d\r\n", ctx->pdp_ctx);
usr.sbin/uhsoctl/uhsoctl.c
96
int fd;
usr.sbin/uhsoctl/uhsoctl.c
996
n = readline(ctx->fd, buf, sizeof(buf));
usr.sbin/usbdump/usbdump.c
701
cc = read(p->fd, (uint8_t *)p->buffer, p->bufsize);
usr.sbin/usbdump/usbdump.c
79
int fd; /* fd for /dev/usbpf */
usr.sbin/usbdump/usbdump.c
812
int fd;
usr.sbin/usbdump/usbdump.c
934
p->fd = fd = open("/dev/bpf", O_RDONLY);
usr.sbin/usbdump/usbdump.c
935
if (p->fd < 0)
usr.sbin/usbdump/usbdump.c
938
if (ioctl(fd, BIOCVERSION, (caddr_t)&bv) < 0)
usr.sbin/usbdump/usbdump.c
952
(void)ioctl(fd, BIOCSBLEN, (caddr_t)&v);
usr.sbin/usbdump/usbdump.c
954
if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) >= 0)
usr.sbin/usbdump/usbdump.c
960
if (ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0)
usr.sbin/usbdump/usbdump.c
970
if (ioctl(p->fd, BIOCSETF, (caddr_t)&total_prog) < 0)
usr.sbin/usbdump/usbdump.c
978
if (ioctl(p->fd, BIOCSRTIMEOUT, (caddr_t)&tv) < 0)
usr.sbin/usbdump/usbdump.c
985
if (ioctl(fd, BIOCGSTATS, (caddr_t)&us) < 0)
usr.sbin/usbdump/usbdump.c
994
if (p->fd > 0)
usr.sbin/usbdump/usbdump.c
995
close(p->fd);
usr.sbin/valectl/valectl.c
179
list_all(int fd, struct nmreq_header *hdr)
usr.sbin/valectl/valectl.c
187
error = ioctl(fd, NIOCCTRL, hdr);
usr.sbin/valectl/valectl.c
213
int fd;
usr.sbin/valectl/valectl.c
217
fd = open("/dev/netmap", O_RDWR);
usr.sbin/valectl/valectl.c
218
if (fd == -1) {
usr.sbin/valectl/valectl.c
278
return list_all(fd, &hdr);
usr.sbin/valectl/valectl.c
300
error = ioctl(fd, NIOCCTRL, &hdr);
usr.sbin/valectl/valectl.c
333
close(fd);
usr.sbin/vidcontrol/decode.c
35
int decode(FILE *fd, char *buffer, int len)
usr.sbin/vidcontrol/decode.c
45
if (!fgets(temp, sizeof(temp), fd))
usr.sbin/vidcontrol/decode.c
51
if (!fgets(p = temp, sizeof(temp), fd))
usr.sbin/vidcontrol/decode.c
93
if (!fgets(temp, sizeof(temp), fd) || strcmp(temp, "end\n"))
usr.sbin/vidcontrol/decode.h
2
int decode(FILE *fd, char *buffer, int len);
usr.sbin/vidcontrol/vidcontrol.c
272
FILE *fd;
usr.sbin/vidcontrol/vidcontrol.c
281
fd = openguess(a, b, c, d, &name);
usr.sbin/vidcontrol/vidcontrol.c
283
if (fd == NULL) {
usr.sbin/vidcontrol/vidcontrol.c
290
if (decode(fd, (char *)&scrnmap, size) != size) {
usr.sbin/vidcontrol/vidcontrol.c
291
rewind(fd);
usr.sbin/vidcontrol/vidcontrol.c
293
if (fread(&scrnmap, 1, size, fd) != (size_t)size) {
usr.sbin/vidcontrol/vidcontrol.c
294
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
305
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
468
FILE *fd;
usr.sbin/vidcontrol/vidcontrol.c
499
fd = openguess((vt4_mode == 0) ? a : vt4a, b, c, d, &name);
usr.sbin/vidcontrol/vidcontrol.c
501
if (fd == NULL) {
usr.sbin/vidcontrol/vidcontrol.c
507
load_vt4font(fd);
usr.sbin/vidcontrol/vidcontrol.c
508
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
524
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
536
dsize[0] = decode(fd, fontmap, size);
usr.sbin/vidcontrol/vidcontrol.c
537
dsize[1] = fsize(fd);
usr.sbin/vidcontrol/vidcontrol.c
554
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
559
rewind(fd);
usr.sbin/vidcontrol/vidcontrol.c
564
if (decode(fd, fontmap, size) != size) {
usr.sbin/vidcontrol/vidcontrol.c
565
rewind(fd);
usr.sbin/vidcontrol/vidcontrol.c
566
if (fsize(fd) != size ||
usr.sbin/vidcontrol/vidcontrol.c
567
fread(fontmap, 1, size, fd) != (size_t)size) {
usr.sbin/vidcontrol/vidcontrol.c
568
fclose(fd);
usr.sbin/vidcontrol/vidcontrol.c
580
fclose(fd);
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
155
if (c->cfg.fd != -1)
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
156
close(c->cfg.fd);
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
174
c->cfg.fd = -1;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
271
pfd[0].fd = c->r->fd_listen;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
275
pfd[1].fd = c->cfg.hc;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
279
pfd[2].fd = c->cfg.fd;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
283
if (c->cfg.fd != -1)
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
303
int fd = accept4(c->r->fd_listen,
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
307
if (fd < 0)
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
310
if (c->cfg.fd < 0) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
313
c->cfg.fd = fd;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
315
if (getsockopt(c->cfg.fd, SOL_L2CAP, SO_L2CAP_IMTU, &c->cfg.mtu, &mtusize) == -1) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
322
if (setsockopt(c->cfg.fd, SOL_SOCKET, SO_RCVBUF, &temp, sizeof(temp)) == -1) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
328
if (setsockopt(c->cfg.fd, SOL_SOCKET, SO_RCVLOWAT, &temp, sizeof(temp)) == -1) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
332
message("Accepted data connection, %d\n", c->cfg.fd);
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
335
close(fd);
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
362
int fd = open(dsp, O_RDWR);
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
364
if (fd < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
368
if (ioctl(fd, VIRTUAL_OSS_GET_SAMPLE_RATE, &rate) < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
372
if (ioctl(fd, cmd_fir_get, &fir) < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
378
if (ioctl(fd, cmd_fir_set, &fir) < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
392
if (ioctl(fd, cmd_info, &info) < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
422
if (ioctl(fd, cmd_fir_set, &fir) < 0) {
usr.sbin/virtual_oss/virtual_equalizer/equalizer.c
429
close(fd);
usr.sbin/virtual_oss/virtual_oss/backend.h
37
int fd;
usr.sbin/virtual_oss/virtual_oss/httpd.c
115
int fd;
usr.sbin/virtual_oss/virtual_oss/httpd.c
117
fd = socket(AF_LOCAL, SOCK_DGRAM, 0);
usr.sbin/virtual_oss/virtual_oss/httpd.c
118
if (fd < 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
126
if (ioctl(fd, SIOCGETVLAN, &ifr) == 0)
usr.sbin/virtual_oss/virtual_oss/httpd.c
131
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
135
*pfd = fd = open("/dev/bpf", O_RDWR);
usr.sbin/virtual_oss/virtual_oss/httpd.c
136
if (fd < 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
141
if (ioctl(fd, BIOCSETIF, &ifr) != 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
146
if (perr != NULL && fd > -1)
usr.sbin/virtual_oss/virtual_oss/httpd.c
147
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
190
voss_httpd_send_rtp_sub(vclient_t *pvc, int fd, void *ptr, size_t len, uint32_t ts)
usr.sbin/virtual_oss/virtual_oss/httpd.c
241
(void)writev(fd, iov, 2);
usr.sbin/virtual_oss/virtual_oss/httpd.c
245
voss_httpd_send_rtp(vclient_t *pvc, int fd, void *ptr, size_t len, uint32_t ts)
usr.sbin/virtual_oss/virtual_oss/httpd.c
251
voss_httpd_send_rtp_sub(pvc, fd, ptr, max, ts);
usr.sbin/virtual_oss/virtual_oss/httpd.c
257
voss_httpd_send_rtp_sub(pvc, fd, ptr, len, ts);
usr.sbin/virtual_oss/virtual_oss/httpd.c
267
usage += (pvc->profile->http.state[x].fd != -1);
usr.sbin/virtual_oss/virtual_oss/httpd.c
458
voss_httpd_handle_connection(vclient_t *pvc, int fd, const struct sockaddr_in *sa)
usr.sbin/virtual_oss/virtual_oss/httpd.c
469
io = fdopen(fd, "r+");
usr.sbin/virtual_oss/virtual_oss/httpd.c
540
if (pvc->profile->http.state[x].fd >= 0)
usr.sbin/virtual_oss/virtual_oss/httpd.c
548
if (ioctl(fd, FIONBIO, &enable) != 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
549
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
554
pvc->profile->http.state[x].fd = fd;
usr.sbin/virtual_oss/virtual_oss/httpd.c
603
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
644
pfd[ns++].fd = s;
usr.sbin/virtual_oss/virtual_oss/httpd.c
66
int fd;
usr.sbin/virtual_oss/virtual_oss/httpd.c
702
f = accept(fds[c].fd, &sa, &socklen);
usr.sbin/virtual_oss/virtual_oss/httpd.c
745
int fd = pvc->profile->http.state[x].fd;
usr.sbin/virtual_oss/virtual_oss/httpd.c
750
if (fd < 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
754
pvc->profile->http.state[x].fd = -1;
usr.sbin/virtual_oss/virtual_oss/httpd.c
755
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
756
} else if (read(fd, buf, sizeof(buf)) != -1 || errno != EWOULDBLOCK) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
757
pvc->profile->http.state[x].fd = -1;
usr.sbin/virtual_oss/virtual_oss/httpd.c
758
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
759
} else if (ioctl(fd, FIONWRITE, &write_len) < 0) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
760
pvc->profile->http.state[x].fd = -1;
usr.sbin/virtual_oss/virtual_oss/httpd.c
761
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
764
} else if (write(fd, ptr, len) != (ssize_t)len) {
usr.sbin/virtual_oss/virtual_oss/httpd.c
765
pvc->profile->http.state[x].fd = -1;
usr.sbin/virtual_oss/virtual_oss/httpd.c
766
close(fd);
usr.sbin/virtual_oss/virtual_oss/httpd.c
794
pvp->http.state[x].fd = -1;
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
104
close(fd);
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
54
int fd;
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
60
fd = open(argv[1], O_RDWR);
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
61
if (fd < 0)
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
76
if (ioctl(fd, VIRTUAL_OSS_GET_SYSTEM_INFO, &info) < 0)
usr.sbin/virtual_oss/virtual_oss_cmd/command.c
97
if (ioctl(fd, VIRTUAL_OSS_ADD_OPTIONS, options) < 0)
usr.sbin/watch/watch.c
205
int fd;
usr.sbin/watch/watch.c
207
fd = -1;
usr.sbin/watch/watch.c
208
ioctl(snp_io, SNPSTTY, &fd);
usr.sbin/watchdogd/watchdogd.c
244
fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
usr.sbin/watchdogd/watchdogd.c
245
if (fd >= 0)
usr.sbin/watchdogd/watchdogd.c
379
return ioctl(fd, WDIOC_SETTIMEOUT, &sbt);
usr.sbin/watchdogd/watchdogd.c
388
return ioctl(fd, WDIOC_CONTROL, &control);
usr.sbin/watchdogd/watchdogd.c
410
error = ioctl(fd, WDIOC_SETSOFT, &softtimeout_set);
usr.sbin/watchdogd/watchdogd.c
421
error = ioctl(fd, WDIOC_SETSOFTTIMEOUTACT,
usr.sbin/watchdogd/watchdogd.c
430
error = ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout);
usr.sbin/watchdogd/watchdogd.c
438
error = ioctl(fd, WDIOC_SETPRETIMEOUTACT,
usr.sbin/watchdogd/watchdogd.c
91
static int fd = -1;
usr.sbin/wlanstat/main.c
107
fprintf(fd, "%s:\n", ether_ntoa((const struct ether_addr*) macaddr));
usr.sbin/wlanstat/main.c
129
fprintf(fd, "\n");
usr.sbin/wlanstat/main.c
140
fprintf(fd, "\n");
usr.sbin/wlanstat/main.c
151
fprintf(fd, "\n");
usr.sbin/wlanstat/main.c
88
print_sta_stats(FILE *fd, const u_int8_t macaddr[IEEE80211_ADDR_LEN])
usr.sbin/wlanstat/main.c
91
if (ns->ns_##x) { fprintf(fd, "%s" #x " " fmt, sep, ns->ns_##x); sep = " "; }
usr.sbin/ypbind/ypbind.c
831
int fd;
usr.sbin/ypbind/ypbind.c
933
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) {
usr.sbin/ypbind/ypbind.c
935
if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1)
usr.sbin/ypbind/ypbind.c
939
if ((fd = open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1) {
usr.sbin/ypbind/ypbind.c
941
if ((fd = open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1)
usr.sbin/ypbind/ypbind.c
944
flock(fd, LOCK_SH);
usr.sbin/ypbind/ypbind.c
951
ypdb->dom_lockfd = fd;
usr.sbin/ypldap/aldap.c
220
c.fd = -1;
usr.sbin/ypldap/aldap.c
325
b.fd = -1;
usr.sbin/ypldap/aldap.c
61
if (close(al->ber.fd) == -1)
usr.sbin/ypldap/aldap.c
71
aldap_init(int fd)
usr.sbin/ypldap/aldap.c
77
a->ber.fd = fd;
usr.sbin/ypldap/aldap.h
192
struct aldap *aldap_init(int fd);
usr.sbin/ypldap/ber.c
1089
if (ber->fd == -1 && len > ber->br_rend - ber->br_rptr) {
usr.sbin/ypldap/ber.c
1241
if (b->fd == -1)
usr.sbin/ypldap/ber.c
1244
r = read(b->fd, c, 1);
usr.sbin/ypldap/ber.c
1261
if (ber->fd == -1)
usr.sbin/ypldap/ber.c
1264
r = read(ber->fd, b, remain);
usr.sbin/ypldap/ber.c
787
if (ber->fd != -1)
usr.sbin/ypldap/ber.c
788
return write(ber->fd, ber->br_wbuf, len);
usr.sbin/ypldap/ber.h
38
int fd;
usr.sbin/ypldap/ldapclient.c
152
client_dispatch_dns(int fd, short events, void *p)
usr.sbin/ypldap/ldapclient.c
253
client_dispatch_parent(int fd, short events, void *p)
usr.sbin/ypldap/ldapclient.c
413
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ldapclient.c
421
event_set(&env.sc_iev_dns->ev, env.sc_iev_dns->ibuf.fd,
usr.sbin/ypldap/ldapclient.c
643
client_periodic_update(int fd, short event, void *p)
usr.sbin/ypldap/ldapclient.c
67
int fd = -1;
usr.sbin/ypldap/ldapclient.c
78
if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) < 0)
usr.sbin/ypldap/ldapclient.c
81
if (connect(fd, sa, sa->sa_len) == 0)
usr.sbin/ypldap/ldapclient.c
85
close(fd);
usr.sbin/ypldap/ldapclient.c
88
if (fd == -1)
usr.sbin/ypldap/ldapclient.c
91
return aldap_init(fd);
usr.sbin/ypldap/parse.y
658
check_file_secrecy(int fd, const char *fname)
usr.sbin/ypldap/parse.y
662
if (fstat(fd, &st)) {
usr.sbin/ypldap/yp.c
97
yp_fd_event(int fd, short event, void *p)
usr.sbin/ypldap/yp.c
99
svc_getreq_common(fd);
usr.sbin/ypldap/ypldap.c
350
main_dispatch_client(int fd, short events, void *p)
usr.sbin/ypldap/ypldap.c
479
main_init_timer(int fd, short event, void *p)
usr.sbin/ypldap/ypldap.c
595
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ypldap.c
637
event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
usr.sbin/ypldap/ypldap.c
643
pid_t pid, int fd, void *data, u_int16_t datalen)
usr.sbin/ypldap/ypldap.c
648
pid, fd, data, datalen)) != -1)
usr.sbin/ypldap/ypldap_dns.c
115
event_set(&env.sc_iev->ev, env.sc_iev->ibuf.fd, env.sc_iev->events,
usr.sbin/ypldap/ypldap_dns.c
126
dns_dispatch_imsg(int fd, short events, void *p)
usr.sbin/zonectl/zonectl.c
393
int fd = -1;
usr.sbin/zonectl/zonectl.c
551
fd = open(filename, open_flags);
usr.sbin/zonectl/zonectl.c
552
if (fd == -1) {
usr.sbin/zonectl/zonectl.c
558
error = ioctl(fd, DIOCZONECMD, &zone_args);
usr.sbin/zonectl/zonectl.c
594
if (fd != -1)
usr.sbin/zonectl/zonectl.c
595
close(fd);