/openbsd-current/usr.sbin/apm/ |
H A D | apm.c | 77 send_command(int fd, struct apm_command *cmd, struct apm_reply *reply) argument 82 if (send(fd, cmd, sizeof(*cmd), 0) == sizeof(*cmd)) { 83 if (recv(fd, reply, sizeof(*reply), 0) != sizeof(*reply)) { 95 do_zzz(int fd, enum apm_action action) argument 123 ret = send_command(fd, &command, &reply); 160 int ch, fd, rval; local 252 fd = open_socket(sockname); 254 if (fd != -1) { 260 if (fd < 0) 263 return (do_zzz(fd, actio [all...] |
/openbsd-current/regress/sys/kern/getpeereid/ |
H A D | getpeereid_test.c | 20 check_id(int fd) argument 26 if (getpeereid(fd, &sockuid, &sockgid) == -1) { 76 int s, fd; local 93 fd = accept(s, (struct sockaddr *)&client_addr, &client_len); 94 if (fd == -1) { 100 problem = check_id(fd);
|
/openbsd-current/regress/sys/uvm/minherit_zero/ |
H A D | minherit_zero.c | 68 dotest(int fd, size_t len, int flags) argument 73 p = mmap(NULL, len, PROT_READ|PROT_WRITE, flags, fd, 0); 124 int fd = open(_PATH_BSHELL, O_RDONLY); local 125 CHECK_GE(fd, 0); 126 dotest(fd, len, MAP_FILE|MAP_PRIVATE); 127 CHECK_EQ(0, close(fd));
|
/openbsd-current/regress/lib/libssl/interop/ |
H A D | util.c | 90 int fd; local 92 if (BIO_get_fd(bio, &fd) <= 0) 95 if (getsockname(fd, (struct sockaddr *)&ss, &slen) == -1) 111 int fd; local 113 if (BIO_get_fd(bio, &fd) <= 0) 116 if (getpeername(fd, (struct sockaddr *)&ss, &slen) == -1)
|
/openbsd-current/libexec/rpc.rusersd/ |
H A D | rusers_proc.c | 107 int fd; local 109 fd = dup(utmp_fd); 110 if (fd == -1) { 114 lseek(fd, 0, SEEK_SET); 115 ufp = fdopen(fd, "r"); 117 close(fd); 136 int fd, nusers = 0; local 141 fd = dup(utmp_fd); 142 if (fd == -1) { 146 lseek(fd, 199 int fd, nusers = 0; local 263 int fd, nusers = 0; local [all...] |
/openbsd-current/usr.sbin/installboot/ |
H A D | bootstrap.c | 44 int fd, i; local 62 fd = open(bootfile, O_RDONLY); 63 if (fd == -1) 65 if (fstat(fd, &sb) == -1) 76 if (read(fd, boot, bootsize) != (ssize_t)sb.st_size) 78 close(fd);
|
H A D | i386_nlist.c | 94 __elf_fdnlist(int fd, struct nlist *list) argument 111 if (pread(fd, &ehdr, sizeof(Elf_Ehdr), (off_t)0) != sizeof(Elf_Ehdr) || 112 !__elf_is_okay__(&ehdr) || fstat(fd, &st) == -1) 127 MAP_SHARED|MAP_FILE, fd, (off_t) ehdr.e_shoff); 133 if (pread(fd, shdr, shdr_size, (off_t)ehdr.e_shoff) != 204 if (pread(fd, strtab, symstrsize, (off_t)symstroff) != 211 MAP_SHARED|MAP_FILE, fd, (off_t) symstroff); 218 if (pread(fd, sbuf, cc, (off_t)symoff) != cc) 301 int fd, n; local 303 fd [all...] |
/openbsd-current/usr.bin/cvs/ |
H A D | init.c | 146 int fd, rcsflags; local 153 if ((fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0444)) == -1) 159 if (atomicio(vwrite, fd, *p, len) != len) 170 (void)fchmod(fd, 0666); 171 (void)close(fd); 191 (void)close(fd);
|
/openbsd-current/usr.sbin/unbound/testcode/ |
H A D | streamtcp.c | 92 int fd = -1; local 99 fd = socket(addr_is_ip6(addr, *addrlen)?PF_INET6:PF_INET, 101 if(fd == -1) { 109 if(connect(fd, (struct sockaddr*)addr, *addrlen) < 0) { 117 return fd; 143 /** write a query over the TCP fd */ 145 write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id, argument 250 if(send(fd, (void*)&len, sizeof(len), 0) < 269 if(send(fd, (void*)sldns_buffer_begin(buf), 289 recv_one(int fd, in argument 377 print_any_answers(int fd, int udp, SSL* ssl, sldns_buffer* buf, int* num_answers, int wait_all) argument 444 int fd = open_svr(svr, udp, &svr_addr, &svr_addrlen); local [all...] |
/openbsd-current/usr.bin/ssh/ |
H A D | authfile.c | 88 sshkey_perm_ok(int fd, const char *filename) argument 92 if (fstat(fd, &st) == -1) 116 int fd, r; local 123 if ((fd = open(filename, O_RDONLY)) == -1) 126 r = sshkey_perm_ok(fd, filename); 130 r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp); 134 close(fd); 147 sshkey_load_private_type_fd(int fd, int type, const char *passphrase, argument 155 if ((r = sshbuf_load_fd(fd, &buffer)) != 0 || 173 int r, fd; local 493 int fd, oerrno; local [all...] |
/openbsd-current/sys/arch/sparc64/stand/ofwboot/ |
H A D | boot.c | 215 loadfile(int fd, char *args, int isupgrade) argument 232 if ((rval = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) { 246 rval = elf64_exec(fd, &hdr.elf64, &entry, &ssym, &esym); 261 if (fstat(fd, &st) == 0) { 263 if (fchmod(fd, st.st_mode) == -1) 267 close(fd); 278 close(fd); 300 int fd, error = 0; local 302 fd = open(path, O_RDONLY); 303 if (fd 433 int fd; local [all...] |
/openbsd-current/lib/libkeynote/ |
H A D | keynote-verify.c | 58 int fd, i, ch, se = 0, cl = 8192, sk = 0, sl = 0, p, ac = argc; local 107 if ((fd = open(optarg, O_RDONLY)) == -1) 113 if (fstat(fd, &sb) == -1) 131 i = read(fd, buf, sb.st_size); 138 close(fd); 227 if ((fd = open(optarg, O_RDONLY)) == -1) 233 if (fstat(fd, &sb) == -1) 251 i = read(fd, buf, sb.st_size); 258 close(fd); 311 if ((fd [all...] |
/openbsd-current/lib/libc/gen/ |
H A D | nlist.c | 87 __fdnlist(int fd, struct nlist *list) argument 104 if (pread(fd, &ehdr, sizeof(Elf_Ehdr), 0) != sizeof(Elf_Ehdr) || 105 !__elf_is_okay__(&ehdr) || fstat(fd, &st) == -1) 119 shdr = mmap(NULL, shdr_size, PROT_READ, MAP_SHARED|MAP_FILE, fd, 126 if (pread(fd, shdr, shdr_size, ehdr.e_shoff) != shdr_size) { 196 if (pread(fd, strtab, symstrsize, symstroff) != symstrsize) { 202 fd, symstroff); 209 if (pread(fd, sbuf, cc, symoff) != cc) 293 int fd, n; local 295 fd [all...] |
/openbsd-current/usr.sbin/eeprom/ |
H A D | ophandlers.c | 80 int fd, optnode; local 82 if ((fd = open(path_openprom, arg ? O_RDWR : O_RDONLY)) == -1) 90 if (ioctl(fd, OPIOCGETOPTNODE, (char *)&optnode) == -1) 105 if (ioctl(fd, OPIOCGET, (char *)&opio) == -1) 126 if (ioctl(fd, OPIOCSET, (char *)&opio) == -1) 139 if (ioctl(fd, OPIOCGET, (char *)&opio) == -1) 157 (void)close(fd); 178 int fd, optnode; local 180 if ((fd = open(path_openprom, O_RDONLY)) == -1) 183 if (ioctl(fd, OPIOCGETOPTNOD [all...] |
/openbsd-current/gnu/llvm/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_coverage_libcdep_new.cpp | 34 fd_t fd = OpenFile(path, WrOnly, &err); local 35 if (fd == kInvalidFd) 38 return fd; 52 fd_t fd = OpenFile(file_path); local 53 WriteToFile(fd, &Magic, sizeof(Magic)); 54 WriteToFile(fd, pcs, len * sizeof(*pcs)); 55 CloseFile(fd); 171 fd_t fd = OpenFile(file_path); local 172 FileCloser file_closer(fd); 174 WriteToFile(fd, counters_be 181 fd_t fd = OpenFile(file_path); local [all...] |
/openbsd-current/usr.sbin/relayd/ |
H A D | control.c | 47 int fd; local 53 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) { 62 close(fd); 69 close(fd); 81 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { 83 close(fd); 91 close(fd); 96 cs->cs_fd = fd; 171 event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, 179 control_connbyfd(int fd) argument 192 control_close(int fd, struct control_sock *cs) argument 217 control_dispatch_imsg(int fd, short event, void *arg) argument [all...] |
/openbsd-current/usr.sbin/lpd/ |
H A D | engine_lpr.c | 370 int fd; local 377 if ((fd = mkstemp(path)) == -1) { 382 return fd; 391 int fd, i; local 398 fd = lpr_mkstemp(); 399 if (fd != -1) { 401 lp_displayq(fd, &lp, lng, jf); 402 if (lseek(fd, 0, SEEK_SET) == -1) 417 lpr_displayq_res(connid, fd, lp.lp_host, cmd); 420 lpr_displayq_res(connid, fd, NUL 426 lpr_displayq_res(uint32_t connid, int fd, const char *host, const char *cmd) argument 440 int fd, i, restart = 0; local 479 lpr_rmjob_res(uint32_t connid, int fd, const char *host, const char *cmd) argument 542 int fd; local 597 int fd; local [all...] |
/openbsd-current/gnu/gcc/gcc/config/ |
H A D | host-openbsd.c | 39 openbsd_gt_pch_get_address (size_t size, int fd ATTRIBUTE_UNUSED) 77 openbsd_gt_pch_use_address (void *base, size_t size, int fd ATTRIBUTE_UNUSED, size_t off ATTRIBUTE_UNUSED)
|
/openbsd-current/gnu/usr.bin/gcc/gcc/testsuite/lib/ |
H A D | g77-dg.exp | 128 set fd [open $file r] 129 while { [gets $fd cur_line]>=0 } { 131 close $fd 135 close $fd
|
H A D | gcc-dg.exp | 123 set fd [open $file r] 124 while { [gets $fd cur_line]>=0 } { 126 close $fd 130 close $fd
|
H A D | objc-dg.exp | 125 set fd [open $file r] 126 while { [gets $fd cur_line]>=0 } { 128 close $fd 132 close $fd
|
/openbsd-current/sbin/reboot/ |
H A D | reboot.c | 187 int fd, status; local 197 fd = open(_PATH_CONSOLE, O_RDWR); 198 if (fd == -1) 200 dup2(fd, 0); 201 dup2(fd, 1); 202 dup2(fd, 2); 203 if (fd > 2) 204 close(fd);
|
/openbsd-current/regress/lib/libpthread/sleep/ |
H A D | sleep.c | 51 int fd = 1; variable 59 write(fd, buf + (long) arg, 1);
|
/openbsd-current/regress/sys/kern/kqueue/ |
H A D | kqueue-tun.c | 69 tunnel_write(int fd, short which, void *arg) argument 74 int fdkey = (fd == tunfd[0]) ? 0 : 1; 82 if ((rlen = writev(fd, iv, 2)) > 0) 90 tunnel_read(int fd, short which, void *arg) argument 95 int fdkey = (fd == tunfd[0]) ? 0 : 1; 96 int oppfdkey = (fd == tunfd[0]) ? 1 : 0; 104 if ((rlen = readv(fd, iv, 2)) > 0) { 116 tunnel_ping(int fd, short which, void *arg) argument
|
/openbsd-current/usr.sbin/ldapd/ |
H A D | imsgev.c | 36 imsgev_init(struct imsgev *iev, int fd, void *data, argument 40 imsg_init(&iev->ibuf, fd); 49 event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev); 55 uint32_t pid, int fd, void *data, u_int16_t datalen) 59 r = imsg_compose(&iev->ibuf, type, peerid, pid, fd, data, datalen); 78 close(iev->ibuf.fd); 97 event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev); 102 imsgev_dispatch(int fd, short ev, void *humppa) argument 54 imsgev_compose(struct imsgev *iev, u_int16_t type, u_int32_t peerid, uint32_t pid, int fd, void *data, u_int16_t datalen) argument
|