/openbsd-current/regress/lib/libpthread/socket/1/ |
H A D | socket1.c | 67 int fd; local 73 CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0)); 78 CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout))); 79 CHECKe(close(fd)); 81 CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0)); 85 CHECKe(connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout))); 93 CHECKe(read(fd, buf, 1024)); 96 write(fd, "6", 1); 98 CHECKe(close(fd)); 108 int fd local 119 int a_sin_size, a_fd, fd; local [all...] |
/openbsd-current/lib/libutil/ |
H A D | uucplock.c | 54 static int put_pid(int fd, pid_t pid); 55 static pid_t get_pid(int fd,int *err); 65 int fd, tmpfd, i, err, uuerr; local 86 if ((fd = open(lckname, O_RDONLY | O_CLOEXEC)) == -1) 89 if ((pid_old = get_pid(fd, &err)) == -1) 92 close(fd); 113 (void)close(fd); 126 int fd, err, ret; local 130 if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) == -1) 132 if (get_pid(fd, 194 put_pid(int fd, pid_t pid) argument 212 get_pid(int fd, int *err) argument [all...] |
/openbsd-current/usr.bin/ssh/ |
H A D | sshpty.c | 75 int fd; local 79 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY); 80 if (fd >= 0) { 81 (void) ioctl(fd, TIOCNOTTY, NULL); 82 close(fd); 92 fd = open(_PATH_TTY, O_RDWR | O_NOCTTY); 93 if (fd >= 0) { 95 close(fd); 103 fd = open(tty, O_RDWR); 104 if (fd 189 int fd; local [all...] |
H A D | atomicio.c | 43 atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, argument 51 pfd.fd = fd; 54 res = (f) (fd, s + pos, n - pos); 84 atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) argument 86 return atomicio6(f, fd, _s, n, NULL, NULL); 93 atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd, argument 109 pfd.fd = fd; 112 res = (f) (fd, io 159 atomiciov(ssize_t (f) int, const struct iovec *, int), int fd, const struct iovec *_iov, int iovcnt) argument [all...] |
/openbsd-current/sys/arch/amd64/stand/pxeboot/ |
H A D | open.c | 80 int fd, i, error; local 84 for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++) 106 return fd; 113 return fd; 122 return (fd);
|
/openbsd-current/sys/arch/i386/stand/pxeboot/ |
H A D | open.c | 80 int fd, i, error; local 84 for (fd = 0, f = files; fd < SOPEN_MAX; fd++, f++) 106 return fd; 113 return fd; 122 return (fd);
|
/openbsd-current/regress/sys/uvm/mmap_mod/ |
H A D | mmap_mod.c | 25 int fd; local 29 if ((fd = mkstemp(name)) == -1) 35 if (ftruncate(fd, ps)) 43 if (pwrite(fd, pat, ps, 0) != ps) 46 buf = mmap(NULL, ps, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0); 58 buf = mmap(NULL, ps, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0); 68 if (pread(fd, pat, ps, 0) != ps)
|
/openbsd-current/lib/libevent/ |
H A D | evutil.c | 47 evutil_socketpair(int family, int type, int protocol, int fd[2]) argument 49 return socketpair(family, type, protocol, fd); 53 evutil_make_socket_nonblocking(int fd) argument 57 if ((flags = fcntl(fd, F_GETFL)) == -1) { 58 event_warn("fcntl(%d, F_GETFL)", fd); 61 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) { 62 event_warn("fcntl(%d, F_SETFL)", fd);
|
/openbsd-current/regress/sys/nfs/ |
H A D | mmap-sysctl-copyin.c | 33 int fd, val; local 41 if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0777)) == -1) 48 if (write(fd, &val, len) == -1) 50 if (close(fd) == -1) 58 if ((fd = open(path, O_RDWR)) == -1) 60 p = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); 65 if (close(fd) == -1)
|
/openbsd-current/gnu/llvm/lldb/source/Utility/ |
H A D | SelectHelper.cpp | 49 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...] |
/openbsd-current/sys/sys/ |
H A D | select.h | 79 __fd_set(int fd, fd_set *p) argument 81 p->fds_bits[fd / __NFDBITS] |= (1U << (fd % __NFDBITS)); 86 __fd_clr(int fd, fd_set *p) argument 88 p->fds_bits[fd / __NFDBITS] &= ~(1U << (fd % __NFDBITS)); 93 __fd_isset(int fd, const fd_set *p) argument 95 return (p->fds_bits[fd / __NFDBITS] & (1U << (fd % __NFDBITS)));
|
/openbsd-current/usr.bin/sndiod/ |
H A D | fdpass.c | 69 int fd; member in struct:fdpass 79 fdpass_send(struct fdpass *f, int cmd, int num, int mode, int fd) argument 99 if (fd >= 0) { 106 *(int *)CMSG_DATA(cmsg) = fd; 108 n = sendmsg(f->fd, &msg, 0); 134 log_puts(", fd = "); 135 log_puti(fd); 139 if (fd >= 0) 140 close(fd); 145 fdpass_recv(struct fdpass *f, int *cmd, int *num, int *mode, int *fd) argument 255 int fd; local 271 int fd; local 287 int fd; local 316 int cmd, num, mode, fd; local [all...] |
/openbsd-current/usr.sbin/installboot/ |
H A D | sparc64_installboot.c | 55 int fd; local 58 if ((fd = open(stage1, O_RDONLY)) == -1) 60 if (fstat(fd, &sb) == -1) 74 if (read(fd, blkstore, sb.st_size) != (ssize_t)sb.st_size) 76 close(fd); 79 if ((fd = open(stage2, O_RDONLY)) == -1) 81 if (fstat(fd, &sb) == -1) 87 if (read(fd, ldrstore, ldrsize) != (ssize_t)sb.st_size) 89 close(fd);
|
/openbsd-current/usr.bin/tee/ |
H A D | tee.c | 50 int fd; member in struct:list 56 add(int fd, char *name) argument 62 p->fd = fd; 71 int fd; local 102 if ((fd = open(*argv, O_WRONLY | O_CREAT | 107 add(fd, *argv); 120 wval = write(p->fd, buf + n, rval - n); 136 if (close(p->fd) == -1) {
|
/openbsd-current/usr.sbin/vmd/ |
H A D | vioraw.c | 61 * Initializes a raw disk image backing file from an fd. Stores the 65 virtio_raw_init(struct virtio_backing *file, off_t *szp, int *fd, size_t nfd) argument 73 sz = lseek(fd[0], 0, SEEK_END); 80 *fdp = fd[0]; 108 int fd, ret; local 111 fd = open(imgfile_path, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 113 if (fd == -1) 117 if (ftruncate(fd, (off_t)imgsize) == -1) { 119 close(fd); 124 ret = close(fd); [all...] |
H A D | atomicio.c | 43 atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, argument 51 pfd.fd = fd; 54 res = (f) (fd, s + pos, n - pos); 79 atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) argument 81 return atomicio6(f, fd, _s, n, NULL, NULL); 88 atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd, argument 104 pfd.fd = fd; 107 res = (f) (fd, io 149 atomiciov(ssize_t (f) int, const struct iovec *, int), int fd, const struct iovec *_iov, int iovcnt) argument [all...] |
/openbsd-current/sbin/ipsecctl/ |
H A D | ike.c | 64 ike_section_general(struct ipsec_rule *r, FILE *fd) argument 67 fprintf(fd, SET "[General]:Check-interval=%d force\n", 69 fprintf(fd, SET "[General]:DPD-check-interval=%d force\n", 75 ike_section_peer(struct ipsec_rule *r, FILE *fd) argument 78 fprintf(fd, SET "[Phase 1]:%s=%s force\n", r->peer->name, 81 fprintf(fd, SET "[Phase 1]:Default=%s force\n", r->p1name); 82 fprintf(fd, SET "[%s]:Phase=1 force\n", r->p1name); 84 fprintf(fd, SET "[%s]:Address=%s force\n", r->p1name, 87 fprintf(fd, SET "[%s]:Local-address=%s force\n", r->p1name, 90 fprintf(fd, SE 95 ike_section_ids(struct ipsec_rule *r, FILE *fd) argument 138 ike_section_ipsec(struct ipsec_rule *r, FILE *fd) argument 158 ike_section_p2(struct ipsec_rule *r, FILE *fd) argument 443 ike_section_p1(struct ipsec_rule *r, FILE *fd) argument 638 ike_section_p2ids_net(struct ipsec_addr *iamask, sa_family_t af, char *name, char *p2xid, FILE *fd) argument 680 ike_section_p2ids(struct ipsec_rule *r, FILE *fd) argument 736 ike_connect(struct ipsec_rule *r, FILE *fd) argument 754 ike_gen_config(struct ipsec_rule *r, FILE *fd) argument 775 ike_delete_config(struct ipsec_rule *r, FILE *fd) argument 898 int fd, ret = 0; local [all...] |
/openbsd-current/regress/lib/libpthread/close/ |
H A D | close.c | 52 int fd; variable 105 FD_SET(fd, &r); 107 printf("child: writing some garbage to fd %d\n", fd); 108 CHECKe(write(fd, garbage, sizeof garbage)); 109 printf("child: calling select() with fd %d\n", fd); 110 ASSERT((ret = select(fd + 1, &r, NULL, NULL, NULL)) == -1); 142 CHECKe(fd = socket(AF_INET, SOCK_STREAM, 0)); 143 printf("main: connecting to test port with fd [all...] |
/openbsd-current/sys/lib/libsa/ |
H A D | write.c | 68 write(int fd, void *dest, size_t bcount) argument 70 struct open_file *f = &files[fd]; 73 if ((unsigned)fd >= SOPEN_MAX || !(f->f_flags & F_WRITE)) {
|
/openbsd-current/usr.sbin/mopd/otherOS/ |
H A D | pf-snit.c | 84 int fd; local 93 if ((fd = open(DEV_NIT, mode)) < 0) { 102 if (setup_pf(fd, protocol, trans) < 0) 116 if (ioctl(fd, I_STR, (caddr_t)&si) < 0) { 127 if (ioctl(fd, I_STR, (caddr_t)&si) < 0) { 134 if (ioctl(fd, I_SRDOPT, (char *)RMSGD) < 0) { /* want messages */ 140 if (ioctl(fd, I_FLUSH, (char *)FLUSHR) < 0) { 145 return(fd); 204 pfEthAddr(fd, addr) 205 int fd; 231 int fd; local 267 int fd; local [all...] |
/openbsd-current/usr.bin/nm/ |
H A D | util.h | 8 #define MMAP(ptr, len, prot, flags, fd, off) do { \ 9 if ((ptr = mmap(NULL, len, prot, flags, fd, off)) == MAP_FAILED) { \ 16 } else if (pread(fd, ptr, len, off) != len) { \
|
/openbsd-current/regress/lib/libc/sys/ |
H A D | t_chroot.c | 57 int fd, sta; local 83 fd = open("file", O_RDONLY | O_CREAT, 0600); 85 if (fd < 0) 88 if (close(fd) != 0) 102 fd = open(buf, O_RDONLY); 104 if (fd < 0) 107 ATF_REQUIRE(close(fd) == 0); 182 int fd, sta; local 192 fd = open(buf, O_RDONLY); 193 ATF_REQUIRE(fd > 243 int fd; local 268 int fd, sta; local [all...] |
/openbsd-current/gnu/llvm/lldb/include/lldb/Host/ |
H A D | FileAction.h | 30 bool Close(int fd); 32 bool Duplicate(int fd, int dup_fd); 34 bool Open(int fd, const FileSpec &file_spec, bool read, bool write);
|
/openbsd-current/gnu/llvm/lldb/tools/lldb-fuzzer/utils/ |
H A D | TempFile.cpp | 21 int fd; local 23 std::error_code ec = sys::fs::createTemporaryFile("lldb-fuzzer", "input", fd, 28 raw_fd_ostream os(fd, true);
|
/openbsd-current/regress/usr.sbin/rpki-client/ |
H A D | test-http.c | 59 http_request(unsigned int id, const char *uri, const char *last_mod, int fd) argument 67 /* pass file as fd */ 68 b->fd = fd; 88 http_response(int fd) argument 95 while ((b = io_buf_read(fd, &httpbuf)) == NULL) 114 int error, fd[2], outfd, http; local 127 if (socketpair(AF_UNIX, fl, 0, fd) == -1) 134 close(fd[1]); 139 proc_http(NULL, fd[ [all...] |