/openbsd-current/regress/lib/libpthread/select/ |
H A D | select.c | 79 int fd = fileno((FILE *) arg); local 80 int tty = isatty(fd); 88 flags = fcntl(fd, F_GETFL); 89 CHECKr(fcntl(fd, F_SETFL, flags | O_NONBLOCK)); 101 FD_SET(fd, &r); 102 maxfd = fd; 110 while ((nb = read(fd, buf, sizeof(buf) - 1)) > 0) {
|
/openbsd-current/usr.bin/nohup/ |
H A D | nohup.c | 108 int fd; local 113 if ((fd = open(p, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0) 120 if ((fd = open(p = path, O_RDWR|O_CREAT|O_APPEND, S_IRUSR|S_IWUSR)) >= 0) 126 (void)lseek(fd, (off_t)0, SEEK_END); 127 if (dup2(fd, STDOUT_FILENO) == -1) 129 if (fd > STDERR_FILENO) 130 (void)close(fd);
|
/openbsd-current/sys/lib/libsa/ |
H A D | loadfile.c | 101 * Open 'filename', read in program and return -1 on error otherwise fd, 118 int fd, rval; local 121 if ((fd = open(fname, O_RDONLY)) < 0) { 127 if ((nr = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) { 135 rval = elf32_exec(fd, &hdr.elf32, marks, flags); 141 rval = elf64_exec(fd, &hdr.elf64, marks, flags); 152 return fd; 155 (void)close(fd);
|
/openbsd-current/sys/arch/alpha/stand/ |
H A D | bootxx.c | 48 open_dev(fd) 49 int *fd; 67 *fd = ret.u.retval; 81 int i, n, fd, rv; local 109 if (!open_dev(&fd)) { 118 ret.bits = prom_read(fd, bbinfop->bsize, cp, 128 prom_close(fd);
|
/openbsd-current/gnu/usr.bin/binutils/gdb/osf-share/AT386/ |
H A D | cma_thread_io.h | 139 #define cma__issue_io_call(fd) \ 140 ( (cma__g_file[fd]->non_blocking) || \ 141 (cma__g_file[fd]->user_fl.user_non_blocking) ) 212 * To increment count for each bit set in fd - mask 312 #define cma__ts_func(func,fd,arglist,type,post_process) { \ 315 if ((fd < 0) || (fd >= cma__g_mx_file)) return (cma__set_errno (EBADF), -1); \ 316 if (!cma__is_open(fd)) return (cma__set_errno (EBADF), -1); \ 317 cma__fd_reserve (fd); \ 318 if (!cma__is_open(fd)) retur [all...] |
/openbsd-current/gnu/usr.bin/binutils/gdb/osf-share/HP800/ |
H A D | cma_thread_io.h | 113 #define cma__issue_io_call(fd) \ 114 ( (cma__g_file[fd]->non_blocking) || \ 115 (cma__g_file[fd]->user_fl.user_non_blocking) ) 186 * To increment count for each bit set in fd - mask 288 #define cma__ts_func(func,fd,arglist,type,post_process) { \ 291 if ((fd < 0) || (fd >= cma__g_mx_file)) return (cma__set_errno (EBADF), -1); \ 292 if (!cma__is_open(fd)) return (cma__set_errno (EBADF), -1); \ 293 cma__fd_reserve (fd); \ 294 if (!cma__is_open(fd)) retur [all...] |
/openbsd-current/games/hack/ |
H A D | hack.o_init.c | 172 savenames(int fd) argument 178 bwrite(fd, bases, sizeof bases); 179 bwrite(fd, objects, sizeof objects); 183 bwrite(fd, &len, sizeof len); 184 bwrite(fd, objects[i].oc_name, len); 186 bwrite(fd, &zero, sizeof len); 189 bwrite(fd, &len, sizeof len); 190 bwrite(fd, objects[i].oc_descr, len); 192 bwrite(fd, &zero, sizeof len); 195 bwrite(fd, 203 restnames(int fd) argument [all...] |
/openbsd-current/usr.bin/cvs/ |
H A D | buf.c | 85 int fd; local 88 if ((fd = open(path, O_RDONLY)) == -1) 92 bp = buf_load_fd(fd); 93 (void)close(fd); 98 buf_load_fd(int fd) argument 103 if (fstat(fd, &st) == -1) 106 if (lseek(fd, 0, SEEK_SET) == -1) 112 if (atomicio(read, fd, buf->cb_buf, buf->cb_size) != buf->cb_size) 197 * Write the contents of the buffer <b> to the specified <fd> 200 buf_write_fd(BUF *b, int fd) argument 214 int fd; local 245 int fd; local [all...] |
/openbsd-current/usr.sbin/ldpd/ |
H A D | control.c | 48 int fd; local 51 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 64 close(fd); 69 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { 71 close(fd); 79 close(fd); 84 control_fd = fd; 139 event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, 147 control_connbyfd(int fd) argument 152 if (c->iev.ibuf.fd 173 control_close(int fd) argument 192 control_dispatch_imsg(int fd, short event, void *bula) argument [all...] |
/openbsd-current/usr.sbin/ldapd/ |
H A D | control.c | 53 int fd; local 59 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) 68 if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) 82 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { 93 cs->cs_fd = fd; 156 log_debug("accepted control fd %d", connfd); 162 control_connbyfd(int fd) argument 167 if (c->iev.ibuf.fd == fd) 175 control_close(int fd, struc argument 232 int fd, verbose; local [all...] |
/openbsd-current/usr.bin/vi/common/ |
H A D | recover.c | 128 int fd; local 156 if ((fd = rcv_mktemp(sp, path, dp, S_IRWXU)) == -1) 158 (void)close(fd); 245 int fd, rval; local 289 if ((fd = rcv_mktemp(sp, buf, dp, S_IRUSR | S_IWUSR)) == -1) 293 if (rcv_copy(sp, fd, ep->rcv_path) || 294 close(fd) || rcv_mailfile(sp, 1, buf)) { 296 (void)close(fd); 325 int fd; local 341 if ((fd 466 int fd, dummy; local 525 int fd; local 608 int fd, found, lck, requested, sv_fd; local 773 rcv_gets(char *buf, size_t len, int fd) argument 794 int fd; local 821 rcv_email(SCR *sp, int fd) argument [all...] |
/openbsd-current/gnu/usr.bin/binutils/gdb/ |
H A D | ser-tcp.c | 97 scb->fd = socket (PF_INET, SOCK_DGRAM, 0); 99 scb->fd = socket (PF_INET, SOCK_STREAM, 0); 101 if (scb->fd < 0) 111 ioctl (scb->fd, FIONBIO, &tmp); 114 n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)); 145 FD_SET (scb->fd, &rset); 150 n = select (scb->fd + 1, &rset, &wset, NULL, &t); 167 res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, &err, &len); 179 ioctl (scb->fd, FIONBIO, &tmp); 185 setsockopt (scb->fd, IPPROTO_TC [all...] |
/openbsd-current/usr.bin/grep/ |
H A D | file.c | 96 grep_fdopen(int fd) argument 101 if (fd == STDIN_FILENO) 104 snprintf(fname, sizeof fname, "(fd %d)", fd); 106 if (fstat(fd, &sb) == -1) 118 f->noseek = lseek(fd, 0L, SEEK_SET) == -1; 119 if ((f->gzf = gzdopen(fd, "r")) != NULL) 123 f->noseek = isatty(fd); 126 if (!f->noseek && (f->mmf = mmopen(fd, &sb)) != NULL) { 132 if ((f->f = fdopen(fd, " 143 int fd; local [all...] |
/openbsd-current/sbin/clri/ |
H A D | clri.c | 71 int i, fd; local 81 if ((fd = opendev(fs, O_RDWR, 0, NULL)) == -1) 89 if (pread(fd, sblock, sizeof(sblock), offset) != sizeof(sblock)) 115 if (pwrite(fd, sblock, sizeof(sblock), offset) != sizeof(sblock)) 117 (void)fsync(fd); 132 if (pread(fd, ibuf, bsize, offset) != bsize) 154 if (pwrite(fd, ibuf, bsize, offset) != bsize) 156 (void)fsync(fd); 158 (void)close(fd);
|
/openbsd-current/gnu/llvm/lldb/third_party/Python/module/pexpect-4.6/pexpect/ |
H A D | fdpexpect.py | 36 def __init__ (self, fd, args=None, timeout=30, maxread=2000, searchwindowsize=None, 42 if type(fd) != type(0) and hasattr(fd, 'fileno'): 43 fd = fd.fileno() 45 if type(fd) != type(0): 46 raise ExceptionPexpect('The fd argument is not an int. If this is a command string then maybe you want to use pexpect.spawn.') 48 try: # make sure fd is a valid file descriptor 49 os.fstat(fd) 51 raise ExceptionPexpect('The fd argumen [all...] |
/openbsd-current/usr.bin/ssh/ |
H A D | monitor_fdpass.c | 40 mm_send_fd(int sock, int fd) argument 61 *(int *)CMSG_DATA(cmsg) = fd; 68 pfd.fd = sock; 72 debug3_f("sendmsg(%d): %s", fd, strerror(errno)); 76 error_f("sendmsg(%d): %s", fd, strerror(errno)); 99 int fd; local 111 pfd.fd = sock; 138 fd = (*(int *)CMSG_DATA(cmsg)); 139 return fd;
|
/openbsd-current/usr.sbin/vmd/ |
H A D | control.c | 77 * recvfd - for the proc fd exchange. 85 control_dispatch_vmd(int fd, struct privsep_proc *p, struct imsg *imsg) argument 104 log_warnx("%s: lost control connection: fd %d", 116 log_warnx("%s: lost control connection: fd %d", 182 int fd; local 188 if ((fd = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) { 197 close(fd); 204 close(fd); 216 if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { 218 close(fd); 325 control_connbyfd(int fd) argument 338 control_close(int fd, struct control_sock *cs) argument 372 control_dispatch_imsg(int fd, short event, void *arg) argument [all...] |
/openbsd-current/usr.sbin/nsd/ |
H A D | nsd-control.c | 246 int fd; local 316 fd = socket(addrfamily, SOCK_STREAM, 0); 317 if(fd == -1) { 321 if(fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { 325 if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) { 334 FD_SET(fd, &rset); 336 FD_SET(fd, &wset); 338 FD_SET(fd, &eset); 341 if(select(fd+1, &rset, &wset, &eset, &tv) == -1) { 345 if(!FD_ISSET(fd, 375 setup_ssl(SSL_CTX* ctx, int fd) argument 412 remote_read(SSL* ssl, int fd, char* buf, size_t len) argument 445 remote_write(SSL* ssl, int fd, const char* buf, size_t len) argument 463 send_file(SSL* ssl, int fd, FILE* in, char* buf, size_t sz) argument 475 go_cmd(SSL* ssl, int fd, int argc, char* argv[]) argument 514 int fd, ret; local [all...] |
/openbsd-current/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/ |
H A D | coremaker.c | 57 int j, fd; local 70 fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666); 71 if (fd == -1) 77 write (fd, buf1, MAPSIZE); 81 buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
/openbsd-current/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/ |
H A D | asmreg-1.c | 25 __syscall_getdents64 (int fd, unsigned char * dirp, unsigned count) argument 28 register unsigned long __r10 __asm__ ("r10") = (unsigned long) fd; 48 __getdents64 (int fd, char *buf, unsigned nbytes) argument 56 retval = __syscall_getdents64(fd, (char *)kdp, nbytes); 63 lseek64(fd, last_offset, 0);
|
/openbsd-current/regress/lib/libpthread/dup2_race/ |
H A D | dup2_race.c | 43 int fd = *(int *)arg; local 46 while(fcntl(fd, F_GETFD, NULL) != -1); 55 int fd, newfd, i, j; local 65 CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0)); 73 CHECKe(dup2(fd, newfd));
|
/openbsd-current/sys/dev/microcode/atmel/ |
H A D | build.c | 37 int fd; local 40 fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644); 41 if (fd == -1) 44 rlen = write(fd, buf, buflen); 49 close(fd);
|
/openbsd-current/sys/dev/microcode/fxp/ |
H A D | build.c | 44 int fd, i; local 49 fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644); 50 if (fd == -1) 54 rlen = write(fd, &dword, sizeof(dword)); 60 close(fd);
|
/openbsd-current/sys/dev/microcode/kue/ |
H A D | build.c | 34 int len, fd; local 59 fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); 60 if (fd == -1) 63 rlen = write(fd, kf, len); 69 close(fd);
|
/openbsd-current/regress/sys/kern/flock/ |
H A D | util.c | 39 int fd, n; local 46 fd = mkstemp(template); 47 if (fd == -1) 49 if (ftruncate(fd, size) == -1) 54 return (fd);
|