Searched refs:fd (Results 51 - 75 of 1889) sorted by relevance

1234567891011>>

/openbsd-current/lib/libc/gen/
H A Disfdtype.c27 isfdtype(int fd, int fdtype) argument
31 if (fstat(fd, &sb) != 0)
/openbsd-current/regress/sys/uvm/mmap_4g/
H A Dmmap_4g.c23 int fd; local
29 fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
30 if (fd == -1)
36 if (lseek(fd, offset, SEEK_SET) != offset)
39 if (write(fd, buf, sz) != sz)
41 close(fd);
43 fd = open(file, O_RDWR);
44 if (fd == -1)
47 fd, offset);
54 close(fd);
[all...]
/openbsd-current/gnu/usr.bin/gcc/gcc/testsuite/gcc.c-torture/execute/
H A D980612-1.c1 struct fd struct
7 struct fd *g() { return &f; }
12 struct fd *f = g();
/openbsd-current/lib/libc/termios/
H A Dtcsendbreak.c36 tcsendbreak(int fd, int len) argument
43 if (ioctl(fd, TIOCSBRK, 0) == -1)
46 if (ioctl(fd, TIOCCBRK, 0) == -1)
H A Dtcflow.c37 tcflow(int fd, int action) argument
44 return (ioctl(fd, TIOCSTOP, 0));
46 return (ioctl(fd, TIOCSTART, 0));
49 if (tcgetattr(fd, &term) == -1)
53 HIDDEN(write)(fd, &c, sizeof(c)) == -1)
/openbsd-current/sys/lib/libsa/
H A Dfstat.c38 fstat(int fd, struct stat *sb) argument
40 struct open_file *f = &files[fd];
42 if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
H A Dgetfile.c43 int fd; local
51 } while ((fd = open(buf, mode)) < 0);
53 return (fd);
H A Dioctl.c67 ioctl(int fd, u_long cmd, char *arg) argument
69 struct open_file *f = &files[fd];
71 if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
/openbsd-current/regress/lib/libpthread/blocked_fifo/
H A Dblocked_fifo.c49 int fd; local
55 CHECKe(fd = open(FILE, O_RDONLY));
56 CHECKe(close(fd));
59 CHECKe(fd = open(FIFO, O_WRONLY));
60 CHECKe(write(fd, "test", 4));
61 CHECKe(close(fd));
69 int fd; local
75 CHECKe(fd = open(FILE, O_RDONLY));
76 CHECKe(dup2(fd, expected_fd));
77 CHECKe(close(fd));
94 int fd; local
[all...]
/openbsd-current/regress/sys/kern/kqueue/
H A Dkqueue-flock.c24 check_lock(int fd, const char *msg) argument
36 if (fcntl(fd, F_SETLK, &fl) == 0) {
42 if (fcntl(fd, F_GETLK, &fl))
48 close(fd);
60 int fd, kq; local
64 fd = open(FILE, O_CREAT|O_RDWR, 0666);
65 if (fd < 0)
69 if (fcntl(fd, F_SETLK, &fl))
72 check_lock(fd, "before");
75 EV_SET(&kev, fd, EVFILT_VNOD
[all...]
/openbsd-current/sys/dev/microcode/afb/
H A Dbuild.c34 int fd; local
37 fd = open(AFB_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
41 len = write(fd, afb_fw, sizeof(afb_fw));
47 close(fd);
/openbsd-current/sys/dev/microcode/rum/
H A Dbuild.c33 int fd; local
37 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
41 rlen = write(fd, ucode, size);
47 close(fd);
/openbsd-current/sys/dev/microcode/tht/
H A Dbuild.c34 int fd; local
37 fd = open(THT_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
44 len = write(fd, tht_fw, sizeof(tht_fw));
50 close(fd);
/openbsd-current/sys/dev/microcode/zydas/
H A Dbuild.c33 int fd; local
37 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
41 rlen = write(fd, ucode, size);
47 close(fd);
/openbsd-current/sys/dev/microcode/cirruslogic/
H A Dbuild.c31 int fd; local
34 fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
35 if (fd == -1)
38 rlen = write(fd, &BA1Struct, sizeof BA1Struct);
43 close(fd);
/openbsd-current/sys/dev/microcode/rsu/
H A Dbuild.c33 int fd; local
37 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
41 rlen = write(fd, ucode, size);
47 close(fd);
/openbsd-current/sys/dev/microcode/typhoon/
H A Dbuild.c28 fullwrite(int fd, const void *buf, size_t nbytes) argument
32 r = write(fd, buf, nbytes);
42 int fd; local
46 fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644);
47 if (fd == -1)
50 rlen = write(fd, tc990image, sizeof tc990image);
55 close(fd);
/openbsd-current/regress/sys/kern/preadv/
H A Dpreadv.c21 int fd, ret; local
24 if ((fd = mkstemp(temp)) < 0)
28 if (write(fd, magic, sizeof(magic)) != sizeof(magic))
31 if (lseek(fd, 0, SEEK_SET) != 0)
34 if (read(fd, &c, 1) != 1)
45 if (preadv(fd, iv, 2, 7) != 2)
54 if (read(fd, &c, 1) != 1)
60 if ((ret = preadv(fd, iv, 2, -1)) != -1)
66 if ((ret = preadv(fd, iv, 2, LLONG_MAX)) != -1)
72 if (read(fd,
[all...]
/openbsd-current/lib/libutil/
H A Dopendev.c54 int fd; local
57 fd = -1;
67 fd = open(namebuf, oflags);
70 if ((fd = open("/dev/diskmap", oflags)) != -1) {
73 dm.fd = fd;
79 if (ioctl(fd, DIOCMAP, &dm) == -1) {
80 close(fd);
81 fd = -1;
86 if (!slash && fd
[all...]
/openbsd-current/sys/arch/octeon/dev/
H A Dcn30xxfau.c113 cn30xxfau_op_init(struct cn30xxfau_desc *fd, size_t scroff, size_t regno) argument
115 fd->fd_scroff = scroff;
116 fd->fd_regno = regno;
120 cn30xxfau_op_save(struct cn30xxfau_desc *fd) argument
123 return octeon_cvmseg_read_8(fd->fd_scroff);
127 cn30xxfau_op_restore(struct cn30xxfau_desc *fd, uint64_t backup) argument
129 octeon_cvmseg_write_8(fd->fd_scroff, backup);
133 cn30xxfau_op_inc_8(struct cn30xxfau_desc *fd, int64_t v) argument
135 cn30xxfau_op_iobdma_store_data(fd->fd_scroff, v, 0, OCT_FAU_OP_SIZE_64/* XXX */,
136 fd
142 cn30xxfau_op_incwait_8(struct cn30xxfau_desc *fd, int v) argument
151 cn30xxfau_op_add_8(struct cn30xxfau_desc *fd, int64_t v) argument
157 cn30xxfau_op_set_8(struct cn30xxfau_desc *fd, int64_t v) argument
[all...]
/openbsd-current/regress/sys/dev/wscons/
H A Dsigio.c52 test_getown_fcntl(int fd) argument
54 return test_common_getown(fd, 1);
58 test_getown_ioctl(int fd) argument
60 return test_common_getown(fd, 0);
64 test_gpgrp(int fd) argument
68 if (ioctl(fd, TIOCGPGRP, &pgrp) == -1)
74 if (ioctl(fd, TIOCSPGRP, &arg) == -1)
76 if (ioctl(fd, TIOCGPGRP, &pgrp) == -1)
85 test_setown_fcntl(int fd) argument
87 return test_common_setown(fd,
91 test_setown_ioctl(int fd) argument
97 test_sigio(int fd) argument
173 test_spgrp(int fd) argument
194 test_common_getown(int fd, int dofcntl) argument
233 test_common_setown(int fd, int dofcntl) argument
287 syncrecv(int fd, int id) argument
298 syncsend(int fd, int id) argument
[all...]
/openbsd-current/libexec/ld.so/
H A Ddl_printf.c75 putcharfd(int c, int fd) argument
80 if (fd != lastfd) {
82 lastfd = fd;
112 _dl_dprintf(int fd, const char *fmt, ...) argument
117 kdoprnt(fd, fmt, ap);
128 kdoprnt(int fd, const char *fmt, va_list ap) argument
140 putcharfd(ch, fd);
154 kprintn(fd, ul, *p++);
161 putcharfd(set ? ',' : '<', fd);
163 putcharfd(n, fd);
230 kprintn(int fd, unsigned long ul, int base) argument
[all...]
/openbsd-current/gnu/usr.bin/perl/dist/IO/
H A Dpoll.c65 int fd = fds[i].fd; local
69 if(fd < 0 || FD_ISSET(fd, &ifd))
72 if(fd > n)
73 n = fd;
76 FD_SET(fd, &rfd);
79 FD_SET(fd, &wfd);
82 FD_SET(fd, &efd);
98 if((fstat(fds[i].fd,
112 int fd = fds[i].fd; local
[all...]
/openbsd-current/regress/sys/kern/mmap/
H A Dmmaptest.c43 int fd; local
50 fd = mkstemp(nm);
51 if (fd == -1)
56 if (ftruncate(fd, sz) == -1)
58 v = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
66 if (close(fd) == -1)
68 fd = open(nm, O_RDONLY);
69 if (fd == -1)
73 n = read(fd, &i, sizeof i);
78 if (close(fd)
[all...]
/openbsd-current/regress/sys/kern/pledge/generic/
H A Dtest_tty.c33 int amaster, fd; local
38 if (openpty(&amaster, &fd, NULL, NULL, NULL) == -1)
47 if ((tcsetpgrp(fd, 1) == -1) && (errno != ENOTTY))
57 if (ioctl(fd, TIOCGETA, &ts) == -1)
61 if (ioctl(fd, TIOCGWINSZ, &ws) == -1)
65 if ((ioctl(fd, TIOCSBRK, NULL) == -1) && (errno != ENOTTY))
70 if ((ioctl(fd, TIOCCDTR, NULL) == -1) && (errno != ENOTTY))
75 if (tcsetattr(fd, TCSANOW, &ts) == -1)
79 if (tcsetattr(fd, TCSADRAIN, &ts) == -1)
83 if (tcsetattr(fd, TCSAFLUS
[all...]

Completed in 376 milliseconds

1234567891011>>