Searched refs:fd (Results 226 - 250 of 2846) sorted by relevance

1234567891011>>

/freebsd-current/share/examples/ses/srcs/
H A Dchpmon.c51 int fd, delay, dev; local
69 fd = open(v[dev], O_RDWR);
70 if (fd < 0) {
79 if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
82 (void) close(fd);
88 if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
91 (void) close(fd);
101 (void) close(fd);
116 if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
120 (void) close(fd);
[all...]
/freebsd-current/usr.bin/resizewin/
H A Dresizewin.c65 int ch, cnt, error, fd, ret, zflag; local
83 if ((fd = open("/dev/tty", O_RDWR | O_NONBLOCK)) == -1)
87 if (ioctl(fd, TIOCGWINSZ, &w) == -1)
94 if (tcgetattr(fd, &old) == -1)
100 if (tcsetattr(fd, TCSAFLUSH, &new) == -1)
103 if (write(fd, query, sizeof(query) - 1) != sizeof(query) - 1) {
113 ret = read(fd, data + cnt, 1);
150 if (ioctl(fd, TIOCSWINSZ, &w) == -1)
154 tcsetattr(fd, TCSANOW, &old);
156 close(fd);
[all...]
/freebsd-current/stand/kboot/kboot/
H A Dkbootfdt.c36 int child_offset, fd, pfd, error, dentsize; local
45 fd = host_open(path, O_RDONLY, 0);
47 dentsize = host_getdents64(fd, dents, sizeof(dents));
86 host_close(fd);
94 int fd, err = 0; local
103 fd = host_open("/sys/firmware/fdt", O_RDONLY, 0);
104 if (fd >= 0) {
105 err = host_read(fd, buffer, buflen);
106 close(fd);
108 if (fd <
[all...]
/freebsd-current/tools/regression/security/open_to_operation/
H A Dopen_to_operation.c203 int dfd, fd, i, mode; local
210 fd = open(path, mode);
211 if (fd < 0) {
215 dfd = dup(fd);
221 close(fd);
229 int dfd, fd, i, mode; local
236 fd = open(path, mode);
237 if (fd < 0) {
241 dfd = dup2(fd, 500); /* Arbitrary but high number. */
247 close(fd);
255 int fd, i, mode; local
279 int fd, i, mode; local
303 int fd, i, mode; local
327 int fd, i, mode; local
351 int fd, i, mode; local
375 int fd, i, mode; local
402 int fd, i, mode; local
427 int fd, i, mode; local
451 int fd, i, mode; local
476 int fd, i, mode; local
588 int fd, i, mode; local
612 int fd, i, mode; local
636 int fd, i, mode; local
676 int fd, i, mode, sv[2]; local
772 int fd, i, mode; local
858 int fd, i, mode; local
893 int fd, i, mode; local
939 int fd, i, mode; local
981 int fd, i, mode; local
1023 int fd, i, mode; local
1069 int dummy, fd; local
[all...]
/freebsd-current/usr.sbin/ofwdump/
H A Dofw_util.c43 #define OFW_IOCTL(fd, cmd, val) do { \
44 if (ioctl(fd, cmd, val) == -1) \
51 int fd; local
53 if ((fd = open(PATH_DEV_OPENFIRM, mode)) == -1)
55 return (fd);
59 ofw_close(int fd) argument
62 close(fd);
66 ofw_root(int fd) argument
69 return (ofw_peer(fd, 0));
73 ofw_optnode(int fd) argument
82 ofw_peer(int fd, phandle_t node) argument
92 ofw_child(int fd, phandle_t node) argument
102 ofw_finddevice(int fd, const char *name) argument
122 ofw_firstprop(int fd, phandle_t node, char *buf, int buflen) argument
129 ofw_nextprop(int fd, phandle_t node, const char *prev, char *buf, int buflen) argument
158 ofw_getprop(int fd, phandle_t node, const char *name, void *buf, int buflen) argument
172 ofw_setprop(int fd, phandle_t node, const char *name, const void *buf, int buflen) argument
189 ofw_getproplen(int fd, phandle_t node, const char *name) argument
201 ofw_getprop_alloc(int fd, phandle_t node, const char *name, void **buf, int *buflen, int reserve) argument
[all...]
/freebsd-current/tools/test/stress2/misc/
H A Dfcntl.sh64 int fd;
95 while (fcntl(fd, F_SETLK, &fl) < 0) {
101 if (lseek(fd, pos, SEEK_SET) == -1)
104 while ((r = read(fd, &val, sizeof(val)) != sizeof(val))) {
107 if (lseek(fd, pos, SEEK_SET) == -1)
115 if (lseek(fd, pos, SEEK_SET) == -1)
117 while ((r = write(fd, &val, sizeof(val)) != sizeof(val))) {
120 if (lseek(fd, pos, SEEK_SET) == -1)
125 if (fcntl(fd, F_SETLK, &fl) < 0)
136 close(fd);
[all...]
H A Dnamecache.sh117 int fd, n;
124 if ((fd = open(".", O_RDONLY)) == -1)
128 if ((n = getdirentries(fd, bp, space, &base)) == -1)
133 close(fd);
162 int fd;
164 if ((fd = open(path, O_RDWR, 0600)) < 0) {
169 close(fd);
175 int fd;
177 if ((fd = open(path, O_RDWR, 0600)) < 0) {
182 close(fd);
[all...]
/freebsd-current/contrib/netbsd-tests/lib/libc/c063/
H A Dt_o_search.c79 int fd; local
82 ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
83 ATF_REQUIRE(close(fd) == 0);
87 ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1);
88 ATF_REQUIRE(close(fd) == 0);
92 ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
109 int fd; local
112 ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
113 ATF_REQUIRE(close(fd) == 0);
117 ATF_REQUIRE((fd
141 int fd; local
175 int fd; local
203 int fd; local
233 int fd; local
265 int fd; local
283 int dfd, fd; local
323 int dfd, fd; local
[all...]
/freebsd-current/tests/sys/fs/fusefs/
H A Dwrite.cc242 int fd; local
250 fd = open(FULLPATH, O_WRONLY);
251 ASSERT_LE(0, fd) << strerror(errno);
254 iocb.aio_fildes = fd;
260 leak(fd);
285 int fd; local
292 fd = open(FULLPATH, O_RDWR | O_APPEND);
293 ASSERT_LE(0, fd) << strerror(errno);
295 ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno);
296 leak(fd);
312 int fd; local
345 int fd; local
366 int fd; local
408 int fd; local
433 int fd; local
471 int fd; local
497 int fd; local
525 int fd; local
556 int fd, oflag; local
593 int fd, oflag; local
634 int fd; local
665 int fd; local
738 int fd; local
786 int fd; local
810 int fd; local
838 int fd; local
859 int fd; local
893 int fd; local
912 int fd; local
933 int fd; local
964 int i, fd; local
1011 int i, fd; local
1054 int fd; local
1079 int fd; local
1111 int fd; local
1138 int fd; local
1172 int fd; local
1211 int fd; local
1244 int fd; local
1290 int fd; local
1365 int fd; local
1417 int fd; local
1471 int fd; local
1506 int fd; local
1545 int fd; local
1574 int fd; local
[all...]
H A Dlseek.cc62 int fd; local
73 fd = open(FULLPATH, O_RDONLY);
75 EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA));
76 EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
79 leak(fd);
94 int fd; local
107 fd = open(FULLPATH, O_RDONLY);
108 EXPECT_EQ(offset, lseek(fd, offset, SEEK_DATA));
110 EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE));
112 leak(fd);
125 int fd; local
157 int fd; local
189 int fd; local
215 int fd; local
250 int fd; local
287 int fd; local
322 int fd; local
359 int fd; local
[all...]
/freebsd-current/tests/sys/kern/
H A Dunix_passfd_test.c79 int fd; local
81 fd = open("/dev/null", O_RDONLY);
82 ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
83 *fdp = fd;
90 int fd; local
94 fd = mkstemp(path);
95 ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path);
97 *fdp = fd;
101 dofstat(int fd, struct stat *sb) argument
104 ATF_REQUIRE_MSG(fstat(fd, s
137 putfds(char *buf, int fd, int nfds) argument
307 fill(int fd) argument
340 int fd[2], getfd, putfd; local
362 int fd[2], getfd, putfd; local
386 int fd[2], getfd, putfd; local
407 int fd[2], putfd; local
425 int fd[2], putfd, nfiles; local
452 int fd[2], nfds; local
524 int fd[2], putfd, nfiles; local
556 int fd[2], getfd_1, getfd_2, putfd_1, putfd_2; local
585 int fd[2], getfd; local
603 int fd[2]; local
618 int fd[2], putfd; local
640 int fd[2], getfd, putfd, rc; local
746 int fd[2], nfds, putfd, rc; local
837 int fd[2], error, nfds, putfd; local
880 int error, fd[2], putfd; local
970 int fd[2], putfd, getfd; local
[all...]
/freebsd-current/usr.sbin/trim/
H A Dtrim.c48 static bool candelete(int fd);
138 candelete(int fd) argument
144 if (ioctl(fd, DIOCGATTR, &arg) == 0)
153 int fd; local
156 if ((fd = open(path, flags)) < 0) {
160 fd = open(tstr, flags);
165 if (fd < 0)
168 return (fd);
176 int fd; local
178 fd
207 int error, fd; local
[all...]
/freebsd-current/contrib/ncurses/include/
H A Dnc_termios.h58 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
61 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
70 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
149 #define tcsetattr(fd, opt, arg) _nc_mingw_tcsetattr(fd, opt, arg)
153 #define tcgetattr(fd, arg) _nc_mingw_tcgetattr(fd, ar
[all...]
/freebsd-current/sbin/ipf/ipsend/
H A Dsbpf.c58 int fd; local
60 if ((fd = open(bpfname, O_RDWR)) < 0)
67 int fd = 0, i; local
72 if ((fd = open(bpfname, O_RDWR)) >= 0)
82 if (ioctl(fd, BIOCVERSION, (caddr_t)&bv) < 0)
98 if (ioctl(fd, BIOCSETIF, &ifr) == -1)
100 fprintf(stderr, "%s(%d):", ifr.ifr_name, fd);
107 if (ioctl(fd, BIOCGBLEN, &bufsize) == -1)
119 if (ioctl(fd, BIOCSRTIMEOUT, (caddr_t)&to) == -1)
125 (void) ioctl(fd, BIOCFLUS
134 sendip(int fd, char *pkt, int len) argument
[all...]
/freebsd-current/contrib/netbsd-tests/fs/ffs/
H A Dh_quota2_tests.c35 int fd; local
61 fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
62 if (fd < 0) {
66 while (rump_sys_write(fd, buf, sizeof(buf)) == sizeof(buf))
70 rump_sys_close(fd);
80 int fd; local
94 fd = rump_sys_open("test_fillup", O_CREAT | O_RDWR, 0644);
95 if (fd < 0) {
107 error = rump_sys_write(fd, buf, sizeof(buf));
113 if (rump_sys_write(fd, bu
128 int fd; local
165 int fd; local
213 int fd, fssfd; local
280 int fd; local
[all...]
/freebsd-current/tests/sys/netlink/
H A Dnetlink_socket.c76 int fd, sendspace, recvspace, sendavail, recvavail, rsize; local
79 ATF_REQUIRE((fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1);
80 ATF_REQUIRE(getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sendspace,
82 ATF_REQUIRE(getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &recvspace,
86 ATF_REQUIRE(send(fd, &hdr, sizeof(hdr), 0) == sizeof(hdr));
87 ATF_REQUIRE(recv(fd, buf, sizeof(hdr), MSG_WAITALL | MSG_PEEK) ==
89 ATF_REQUIRE(ioctl(fd, FIONREAD, &rsize) != -1);
104 rv = send(fd, &hdr, sizeof(hdr), MSG_DONTWAIT);
111 ATF_REQUIRE(ioctl(fd, FIONREAD, &recvavail) != -1);
112 ATF_REQUIRE(ioctl(fd, FIONWRIT
123 int fd; local
151 int fd; local
202 int fd, size, rsize; local
303 int fd; local
[all...]
/freebsd-current/tools/regression/poll/
H A Dpipepoll.c89 child(int fd, int num) argument
96 fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);
97 if (fd < 0)
100 pfd.fd = fd;
133 if (read(fd, buf, sizeof buf) != 1)
151 * start quite from scratch since the read fd is not new. Check
187 if (read(fd, buf, sizeof buf) != 1)
200 pfd.fd = fd2;
204 pfd.fd
220 parent(int fd) argument
278 int fd[2], num; local
[all...]
/freebsd-current/usr.sbin/i2c/
H A Di2c.c85 i2c_do_stop(int fd) argument
89 i = ioctl(fd, I2CSTOP);
97 i2c_do_start(int fd, struct iiccmd *cmd) argument
101 i = ioctl(fd, I2CSTART, cmd);
109 i2c_do_repeatstart(int fd, struct iiccmd *cmd) argument
113 i = ioctl(fd, I2CRPTSTART, cmd);
121 i2c_do_write(int fd, struct iiccmd *cmd) argument
125 i = ioctl(fd, I2CWRITE, cmd);
133 i2c_do_read(int fd, struct iiccmd *cmd) argument
137 i = ioctl(fd, I2CREA
145 i2c_do_reset(int fd) argument
208 scan_bus(const char *dev, int fd, const char *skip, int verbose) argument
276 reset_bus(const char *dev, int fd, int verbose) argument
315 write_offset(int fd, struct options i2c_opt, struct iiccmd *cmd) argument
327 i2c_write(int fd, struct options i2c_opt, uint8_t *i2c_buf) argument
395 i2c_read(int fd, struct options i2c_opt, uint8_t *i2c_buf) argument
449 i2c_rdwr_transfer(int fd, struct options i2c_opt, uint8_t *i2c_buf) argument
490 access_bus(int fd, struct options i2c_opt) argument
547 int error, fd; local
744 int fd, error = 0, ch; local
[all...]
/freebsd-current/tools/test/stress2/testcases/lockf/
H A Dlockf.c44 static int fd; variable
53 r = lockf(fd, F_LOCK, 0);
57 if (lseek(fd, 0, SEEK_SET) == -1) // XXX
59 r = read(fd, &sem, sizeof(sem));
61 err(1, "get: read(%d)", fd);
66 if (lseek(fd, 0, SEEK_SET) == -1)
68 if (lockf(fd, F_ULOCK, 0) == -1)
78 r = lockf(fd, F_LOCK, 0);
82 if (read(fd, &sem, sizeof(sem)) != sizeof(sem))
83 err(1, "incr: read(%d)", fd);
[all...]
/freebsd-current/crypto/openssh/
H A Dsshpty.c102 int fd; local
106 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
107 if (fd >= 0) {
108 (void) ioctl(fd, TIOCNOTTY, NULL);
109 close(fd);
119 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY);
120 if (fd >= 0) {
122 close(fd);
134 fd = open(tty, O_RDWR);
135 if (fd
225 int fd; local
[all...]
/freebsd-current/contrib/capsicum-test/
H A Dselect.cc13 int AddFDToSet(fd_set* fset, int fd, int maxfd) { argument
14 FD_SET(fd, fset);
15 if (fd > maxfd) maxfd = fd;
31 int fd = open(TmpFile("cap_select"), O_RDWR | O_CREAT, 0644); local
32 EXPECT_OK(fd);
33 if (fd < 0) return;
41 cap_fd[ii] = dup(fd);
47 int cap_rw = dup(fd);
60 maxfd = AddFDToSet(&rset, fd, maxf
100 int fd = open(TmpFile("cap_poll"), O_RDWR | O_CREAT, 0644); local
[all...]
/freebsd-current/contrib/netbsd-tests/kernel/
H A Dt_filedesc.c53 static int fd; variable
62 rump_sys_write(fd, &fd, sizeof(fd));
83 fd = fd_wrk = rump_sys_open("/dev/null", O_RDWR, 0);
84 if (fd == -1)
96 assert(fd == fd_wrk);
/freebsd-current/tools/test/stress2/tools/
H A Dzapsb.c36 int i, fd; local
44 if ((fd = open(fs, O_RDWR, 0)) < 0)
47 if (lseek(fd, (off_t)(sblock_try[i]), SEEK_SET) < 0)
49 if (read(fd, sblock, sizeof(sblock)) != sizeof(sblock))
69 if (lseek(fd, (off_t)(sblock_try[i]), SEEK_SET) < 0)
71 if (write(fd, sblock, sizeof(sblock)) != sizeof(sblock))
73 (void)close(fd);
/freebsd-current/contrib/llvm-project/lldb/source/Utility/
H A DSelectHelper.cpp49 void SelectHelper::FDSetRead(lldb::socket_t fd) { argument
50 m_fd_map[fd].read_set = true;
53 void SelectHelper::FDSetWrite(lldb::socket_t fd) { argument
54 m_fd_map[fd].write_set = true;
57 void SelectHelper::FDSetError(lldb::socket_t fd) { argument
58 m_fd_map[fd].error_set = true;
61 bool SelectHelper::FDIsSetRead(lldb::socket_t fd) const {
62 auto pos = m_fd_map.find(fd);
69 bool SelectHelper::FDIsSetWrite(lldb::socket_t fd) const {
70 auto pos = m_fd_map.find(fd);
109 const lldb::socket_t fd = pair.first; local
179 const lldb::socket_t fd = pair.first; local
235 const int fd = pair.first; local
[all...]
/freebsd-current/tests/sys/cddl/zfs/bin/
H A Dlargest_file.c53 int fd = 0; local
69 fd = open(testfile, O_CREAT | O_RDWR);
70 if (fd < 0) {
76 lseek_ret = lseek(fd, offset, SEEK_SET);
83 write_ret = write(fd, mybuf, 1);
91 lseek_ret = lseek(fd, offset, SEEK_CUR);
98 write_ret = write(fd, mybuf, 1);

Completed in 387 milliseconds

1234567891011>>