Searched refs:fd (Results 251 - 275 of 1892) sorted by relevance

<<11121314151617181920>>

/openbsd-current/lib/libc/stdio/
H A Dfdopen.c43 fdopen(int fd, const char *mode) argument
49 if (fd > SHRT_MAX) {
58 if ((fdflags = fcntl(fd, F_GETFL)) == -1)
81 if ((oflags & O_CLOEXEC) && !((tmp = fcntl(fd, F_GETFD)) & FD_CLOEXEC))
82 fcntl(fd, F_SETFD, tmp | FD_CLOEXEC);
84 fp->_file = fd;
/openbsd-current/regress/sys/kern/kqueue/
H A Dkqueue-random.c22 int n, fd, kq; local
27 ASS((fd = open("/dev/random", O_RDONLY)) >= 0,
29 ASS(fcntl(fd, F_SETFL, O_NONBLOCK) == 0,
36 ev.ident = fd;
48 ASSX(read(fd, buf, n) > 0);
51 close(fd);
/openbsd-current/libexec/ld.so/
H A Ddir.c55 int fd; local
58 if ((fd = _dl_open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) < 0)
60 if (_dl_fstat(fd, &sb) || (dirp = _dl_malloc(sizeof(*dirp))) == NULL) {
61 _dl_close(fd);
65 dirp->dd_fd = fd;
72 _dl_close(fd);
/openbsd-current/gnu/usr.bin/perl/t/op/
H A Dsyscall_emulator.t48 my $fd;
60 (($fd = syscall(SYS_open(), $file, O_CREAT|O_WRONLY, $perms)) < 0),
64 (syscall(SYS_write(), $fd, $out, length $out) <= 0),
68 (syscall(SYS_close(), $fd) != 0),
87 (($fd = syscall(SYS_open(), $file, O_RDONLY)) < 0),
91 (syscall(SYS_read(), $fd, $in, length $in) <= 0),
102 (syscall(SYS_lseek(), $fd, 0, SEEK_SET) < 0),
103 "lseek on fd"
107 (syscall(SYS_pread(), $fd, $in = "\0" x 32, 5, 3) < 0),
108 "pread on fd"
[all...]
/openbsd-current/gnu/usr.bin/perl/dist/IO/lib/IO/
H A DPoll.pm33 # [0] maps fd's to requested masks
34 # [1] maps fd's to returned masks
35 # [2] maps fd's to handles
47 my $fd = fileno($io);
48 return unless defined $fd;
52 $self->[0]{$fd}{$io} = $mask; # the error events are always returned
53 $self->[1]{$fd} = 0; # output mask
56 delete $self->[0]{$fd}{$io};
57 unless(%{$self->[0]{$fd}}) {
59 delete $self->[1]{$fd};
[all...]
/openbsd-current/usr.bin/ssh/
H A Dmsg.c43 ssh_msg_send(int fd, u_char type, struct sshbuf *m) argument
52 if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
56 if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) {
65 ssh_msg_recv(int fd, struct sshbuf *m) argument
73 if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) {
88 if (atomicio(read, fd, p, msg_len) != msg_len) {
H A Dsshlogin.c77 int fd; local
83 fd = open(lastlog, O_RDONLY);
84 if (fd == -1)
88 r = lseek(fd, pos, SEEK_SET);
91 close(fd);
96 close(fd);
99 if (read(fd, &ll, sizeof(ll)) != sizeof(ll)) {
100 close(fd);
103 close(fd);
150 int fd; local
[all...]
/openbsd-current/regress/sys/kern/pledge/sendrecvfd/
H A Dsendrecvfd.c40 static void do_sender(enum testtype type, int sock, int fd);
87 int fd = *(int *)CMSG_DATA(cmsg); local
90 /* test received fd */
91 if (fstat(fd, &sb) == -1)
98 do_sender(enum testtype type, int sock, int fd) argument
132 *(int *)CMSG_DATA(cmsg) = fd;
151 int fd; local
187 if ((fd = open("/etc/passwd", O_RDONLY)) == -1)
191 if ((fd = open("/dev", O_RDONLY)) == -1)
195 if ((fd
[all...]
/openbsd-current/usr.sbin/dvmrpd/
H A Dkmroute.c42 kmr_init(int fd) argument
84 kmr_recv_msg(int fd, short event, void *bula) argument
97 if ((r = recvfrom(fd, buf, IBUF_READ_SIZE, 0, NULL, NULL)) == -1) {
151 mrt_init(int fd) argument
155 if (setsockopt(fd, IPPROTO_IP, MRT_INIT, &flag,
165 mrt_done(int fd) argument
169 if (setsockopt(fd, IPPROTO_IP, MRT_DONE, &flag,
179 mrt_add_vif(int fd, struct iface *iface) argument
190 if (setsockopt(fd, IPPROTO_IP, MRT_ADD_VIF, &vc,
200 mrt_del_vif(int fd, struc argument
212 mrt_add_mfc(int fd, struct mfc *mfc) argument
239 mrt_del_mfc(int fd, struct mfc *mfc) argument
[all...]
/openbsd-current/sys/arch/octeon/stand/rdboot/
H A Drdboot.c60 int fd, hasboot, isupgrade = 0; local
62 fd = open(_PATH_CONSOLE, O_RDWR);
63 login_tty(fd);
124 int fd, ret = 0; local
129 fd = open(BOOTRANDOM, O_RDONLY);
130 if (fd == -1) {
136 if (fstat(fd, &sb) == 0) {
141 if (read(fd, buf, sizeof(buf)) != sizeof(buf))
143 fchmod(fd, sb.st_mode | S_ISTXT);
147 close(fd);
177 int argc, fd = -1, ret; local
[all...]
/openbsd-current/sys/arch/powerpc64/stand/rdboot/
H A Drdboot.c60 int fd, hasboot, isupgrade = 0; local
62 fd = open(_PATH_CONSOLE, O_RDWR);
63 login_tty(fd);
122 int fd, ret = 0; local
127 fd = open(BOOTRANDOM, O_RDONLY);
128 if (fd == -1) {
134 if (fstat(fd, &sb) == 0) {
139 if (read(fd, buf, sizeof(buf)) != sizeof(buf))
141 fchmod(fd, sb.st_mode | S_ISTXT);
145 close(fd);
173 int fd = -1, ret; local
[all...]
/openbsd-current/sys/lib/libsa/
H A Dcread.c66 int fd; member in struct:sd
102 s->stream.avail_in = oread(s->fd, s->inbuf, Z_BUFSIZE);
197 int fd; local
200 if (((fd = oopen(fname, mode)) == -1) ||
202 return(fd);
204 ss[fd] = s = alloc(sizeof(struct sd));
218 s->fd = fd;
220 return(fd);
225 oclose(fd);
230 close(int fd) argument
256 read(int fd, void *buf, size_t len) argument
359 lseek(int fd, off_t offset, int where) argument
[all...]
/openbsd-current/bin/ksh/
H A Dio.c219 /* test if we can seek backwards fd (returns 0 or SHF_UNBUF) */
221 can_seek(int fd) argument
225 return fstat(fd, &statb) == 0 && !S_ISREG(statb.st_mode) ?
254 * move fd from user space (0<=fd<10) to shell space (fd>=10),
258 savefd(int fd) argument
262 if (fd < FDBASE) {
263 nfd = fcntl(fd, F_DUPFD_CLOEXEC, FDBASE);
271 nfd = fd;
278 restfd(int fd, int ofd) argument
318 int fd, fl; local
360 coproc_read_close(int fd) argument
373 coproc_readw_close(int fd) argument
385 coproc_write_close(int fd) argument
399 int fd = (mode & R_OK) ? coproc.read : coproc.write; local
441 int fd; local
[all...]
/openbsd-current/regress/sys/kern/flock/
H A Dflock.c76 test1(int fd) argument
85 if (fcntl(fd, F_GETLK, &fl1) < 0)
105 test2(int fd) argument
135 if (fcntl(fd, F_SETLK, &fl) < 0)
155 res = fcntl(fd, F_SETLK, &fl);
176 test3(int fd) argument
206 if (fcntl(fd, F_SETLK, &fl) < 0)
229 res = fcntl(fd, F_SETLKW, &fl);
246 test4(int fd) argument
275 if (fcntl(fd, F_SETL
320 test5(int fd) argument
414 test6(int fd) argument
517 test7(int fd) argument
589 test8(int fd) argument
666 test9(int fd) argument
738 test10(int fd) argument
805 test11(int fd) argument
885 test12(int fd) argument
962 test13(int fd) argument
1047 test14(int fd) argument
1240 test15(int fd) argument
1333 test16(int fd) argument
1373 test17(int fd) argument
1459 test18(int fd) argument
1483 test19(int fd) argument
1569 test20(int fd) argument
1599 test21(int fd) argument
1629 test22(int fd) argument
1657 test23(int fd) argument
1678 test24(int fd) argument
1725 test25(int fd) argument
1770 test26(int fd) argument
1895 int c, fd, i; local
[all...]
/openbsd-current/regress/sys/kern/pledge/generic/
H A Dmain.c52 int fd = socket(AF_INET, SOCK_STREAM, 0); local
54 close(fd);
74 int fd; local
77 if ((fd = open("/dev/zero", O_RDONLY)) == -1)
80 if (read(fd, data, sizeof(data)) == -1)
83 close(fd);
89 int fd; local
92 if ((fd = open("/dev/null", O_WRONLY)) == -1)
95 if (write(fd, data, sizeof(data)) == -1)
98 close(fd);
[all...]
/openbsd-current/gnu/usr.bin/perl/dist/IO/t/
H A Dio_sel.t64 my($fd, $msg) = @{shift @a};
65 print $fd $msg;
78 $fd = $w->[0];
79 print $fd "ok 15\n";
89 $fd = $sel->exists(\*STDOUT);
90 if ($fd) {
91 print $fd "ok 18\n";
96 $fd = $sel->exists([1, 'foo']);
97 if ($fd) {
98 print $fd "o
[all...]
/openbsd-current/games/hack/
H A Dhack.bones.c77 int fd; local
86 if((fd = open(bones, O_RDONLY)) >= 0){
87 (void) close(fd);
134 if((fd = open(bones, O_CREAT | O_TRUNC | O_WRONLY, FMASK)) == -1) return;
135 savelev(fd,dlevel);
136 (void) close(fd);
142 int fd,x,y; local
147 if((fd = open(bones, O_RDONLY)) == -1) return(0);
148 getlev(fd, 0, dlevel);
151 (void) close(fd);
[all...]
/openbsd-current/gnu/usr.bin/binutils/gdb/osf-share/RIOS/
H A Dcma_thread_io.h110 #define cma__issue_io_call(fd) \
111 ( (cma__g_file[fd]->non_blocking) || \
112 (cma__g_file[fd]->user_fl.user_non_blocking) )
183 * To increment count for each bit set in fd - mask
285 #define cma__ts_func(func,fd,arglist,type,post_process) { \
288 if ((fd < 0) || (fd >= cma__g_mx_file)) return (cma__set_errno (EBADF), -1); \
289 if (!cma__is_open(fd)) return (cma__set_errno (EBADF), -1); \
290 cma__fd_reserve (fd); \
291 if (!cma__is_open(fd)) retur
[all...]
/openbsd-current/gnu/usr.bin/binutils/gdb/testsuite/config/
H A Dnetware.exp67 set fd [open $lnk w]
68 puts $fd "description \"[file tail $nlm]\""
69 puts $fd "screenname \"System Console\""
70 puts $fd "module clib.nlm"
71 puts $fd "module mathlib.nlm"
72 puts $fd "stack 32768"
73 # puts $fd "stack 64512"
74 puts $fd "debug"
76 puts $fd "input /s1/cygnus/dejagnu/i386-netware/lib/prelude.o"
77 puts $fd "inpu
[all...]
/openbsd-current/gnu/usr.bin/perl/ext/POSIX/t/
H A Dsysconf.t85 my $fd = POSIX::open($testdir, O_RDONLY)
92 _check_and_report(sub { fpathconf($fd, shift) }, $constant,
93 "calling fpathconf($fd, $constant)");
97 POSIX::close($fd);
119 my $fd = fileno($LEXTTY);
123 _check_and_report(sub { fpathconf($fd, shift) }, $constant,
124 "calling fpathconf($fd, $constant) ($TTY)");
142 my $fd = POSIX::open($fifo, O_RDONLY | O_NONBLOCK)
146 _check_and_report(sub { fpathconf($fd, shift) }, $constant,
147 "calling fpathconf($fd,
[all...]
/openbsd-current/gnu/llvm/lldb/source/Host/posix/
H A DProcessLauncherPosixFork.cpp73 static void DupDescriptor(int error_fd, const char *file, int fd, int flags) { argument
79 if (target_fd == fd)
82 if (::dup2(target_fd, fd) == -1)
93 int fd; member in struct:__anon1329::ForkFileAction
109 bool has_action(int fd) const {
111 if (action.fd == fd)
128 if (close(action.fd) != 0)
132 if (dup2(action.fd, action.arg) == -1)
136 DupDescriptor(error_fd, action.path.c_str(), action.fd, actio
178 int fd = std::stoi(iter->path().substr(proc_fd_path.size() + 1)); local
[all...]
/openbsd-current/sbin/unwind/
H A Ddns64_synth.c97 packed_rrset_data* fd, struct ub_packed_rrset_key *dk, struct
110 if(fd->count > RR_COUNT_MAX) {
115 packed_rrset_data) + fd->count * dns64_prefix_count *
122 dd->ttl = fd->ttl;
123 dd->count = fd->count * dns64_prefix_count;
125 dd->trust = fd->trust;
126 dd->security = fd->security;
132 for(i = 0, pos = 0; i < fd->count; ++i) {
133 if (fd->rr_len[i] != 6 || fd
96 dns64_synth_aaaa_data(const struct ub_packed_rrset_key* fk, const struct packed_rrset_data* fd, struct ub_packed_rrset_key *dk, struct packed_rrset_data **dd_out, struct regional *region) argument
[all...]
/openbsd-current/gnu/usr.bin/binutils/gdb/
H A Devent-loop.c56 int fd; /* File descriptor that is ready. */ member in struct:gdb_event
65 int fd; /* File descriptor. */ member in struct:file_handler
69 handler_func *proc; /* Procedure to call when fd is ready. */
71 int error; /* Was an error detected on this fd? */
121 in, for each fd. */
156 /* Number of valid bits (highest fd value + 1). (for select) */
209 static void create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data);
215 static gdb_event *create_file_event (int fd);
262 create_file_event (int fd)
268 file_event_ptr->fd
261 create_file_event(int fd) argument
285 int fd; local
434 add_file_handler(int fd, handler_func * proc, gdb_client_data client_data) argument
481 create_file_handler(int fd, int mask, handler_func * proc, gdb_client_data client_data) argument
554 delete_file_handler(int fd) argument
[all...]
/openbsd-current/regress/lib/libpthread/blocked_close/
H A Dblocked_close.c46 int fd = *(int *)arg; local
51 n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len);
65 int fd, i, j; local
81 CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0));
82 CHECKr(bind(fd, (struct sockaddr *)&addr, sizeof(addr)));
85 waiting_read, (void *)&fd));
87 CHECKr(close(fd));
/openbsd-current/usr.sbin/mopd/otherOS/
H A Dloop-linux2.c123 if (ii->fd != -1) {
124 FD_SET(ii->fd, &fds);
125 if (ii->fd > maxfd)
126 maxfd = ii->fd;
137 if (ii->fd != -1) {
138 if (!FD_ISSET(ii->fd, &listeners))
142 cc = read(ii->fd, (char *) buf, bufsize);

Completed in 317 milliseconds

<<11121314151617181920>>