| /openbsd-src/usr.sbin/mopd/common/ |
| H A D | print.c | 40 mopPrintHWA(FILE *fd, u_char *ap) in mopPrintHWA() argument 42 fprintf(fd, "%x:%x:%x:%x:%x:%x", ap[0], ap[1], ap[2], ap[3], ap[4], in mopPrintHWA() 44 if (ap[0] < 16) fprintf(fd, " "); in mopPrintHWA() 45 if (ap[1] < 16) fprintf(fd, " "); in mopPrintHWA() 46 if (ap[2] < 16) fprintf(fd, " "); in mopPrintHWA() 47 if (ap[3] < 16) fprintf(fd, " "); in mopPrintHWA() 48 if (ap[4] < 16) fprintf(fd, " "); in mopPrintHWA() 49 if (ap[5] < 16) fprintf(fd, " "); in mopPrintHWA() 53 mopPrintBPTY(FILE *fd, u_char bpty) in mopPrintBPTY() argument 57 fprintf(fd, "Syste in mopPrintBPTY() 69 mopPrintPGTY(FILE * fd,u_char pgty) mopPrintPGTY() argument 91 mopPrintOneline(FILE * fd,u_char * pkt,int trans) mopPrintOneline() argument 236 mopPrintHeader(FILE * fd,u_char * pkt,int trans) mopPrintHeader() argument 295 mopPrintMopHeader(FILE * fd,u_char * pkt,int trans) mopPrintMopHeader() argument 401 mopPrintDevice(FILE * fd,u_char device) mopPrintDevice() argument 412 mopPrintTime(FILE * fd,u_char * ap) mopPrintTime() argument 420 mopPrintInfo(FILE * fd,u_char * pkt,int * idx,u_short moplen,u_char mopcode,int trans) mopPrintInfo() argument [all...] |
| H A D | rc.c | 33 mopDumpRC(FILE *fd, u_char *pkt, int trans) in mopDumpRC() argument 57 fprintf(fd, "Reserved : %02x\n", tmpc); in mopDumpRC() 60 fprintf(fd, "Receipt Nbr : %04x\n", tmps); in mopDumpRC() 67 fprintf(fd, "Verification : %04x\n", tmps); in mopDumpRC() 71 fprintf(fd, "Verification : %08lx\n", tmpl); in mopDumpRC() 74 fprintf(fd, "Processor : %02x ", tmpc); in mopDumpRC() 75 mopPrintBPTY(fd, tmpc); fprintf(fd, "\n"); in mopDumpRC() 78 fprintf(fd, "Control : %02x ", control); in mopDumpRC() 80 fprintf(fd, "Bootserver Requesting system "); in mopDumpRC() 82 fprintf(fd, "Bootserver System default "); in mopDumpRC() [all …]
|
| H A D | dl.c | 33 mopDumpDL(FILE *fd, u_char *pkt, int trans) in mopDumpDL() argument 56 fprintf(fd, "Load Number : %02x\n", tmpc); in mopDumpDL() 60 fprintf(fd, "Load Address : %08lx\n", tmpl); in mopDumpDL() 67 fprintf(fd, in mopDumpDL() 71 fprintf(fd, in mopDumpDL() 75 fprintf(fd, "%02x ", mopGetChar(pkt, &idx)); in mopDumpDL() 77 fprintf(fd, "\n"); in mopDumpDL() 81 fprintf(fd, "\n"); in mopDumpDL() 85 fprintf(fd, "Xfer Address : %08lx\n", tmpl); in mopDumpDL() 92 fprintf(fd, "Load Number : %02x\n", tmpc); in mopDumpDL() [all …]
|
| /openbsd-src/usr.sbin/ldpd/ |
| H A D | socket.c | 37 int fd, domain, proto; in ldp_create_socket() local 56 fd = socket(af, domain | SOCK_NONBLOCK | SOCK_CLOEXEC, proto); in ldp_create_socket() 57 if (fd == -1) { in ldp_create_socket() 75 if (sock_set_bindany(fd, 1) == -1) { in ldp_create_socket() 76 close(fd); in ldp_create_socket() 81 if (sock_set_reuse(fd, 1) == -1) { in ldp_create_socket() 82 close(fd); in ldp_create_socket() 85 if (bind(fd, (struct sockaddr *)&local_sa, local_sa.ss_len) == -1) { in ldp_create_socket() 87 close(fd); in ldp_create_socket() 94 if (sock_set_ipv4_tos(fd, IPTOS_PREC_INTERNETCONTROL) == -1) { in ldp_create_socket() [all …]
|
| /openbsd-src/sys/dev/isa/ |
| H A D | fd.c | 148 void fdfinish(struct fd_softc *fd, struct buf *bp); 155 fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, in fdgetdisklabel() argument 161 lp->d_secsize = FD_BSIZE(fd); in fdgetdisklabel() 162 lp->d_secpercyl = fd->sc_type->seccyl; in fdgetdisklabel() 163 lp->d_nsectors = fd->sc_type->sectrac; in fdgetdisklabel() 164 lp->d_ncylinders = fd->sc_type->tracks; in fdgetdisklabel() 165 lp->d_ntracks = fd->sc_type->heads; /* Go figure... */ in fdgetdisklabel() 166 DL_SETDSIZE(lp, fd->sc_type->size); in fdgetdisklabel() 247 struct fd_softc *fd = (void *)self; in fdattach() local 289 fd->sc_cylin = -1; in fdattach() [all …]
|
| /openbsd-src/regress/sys/kern/select/ |
| H A D | select_iocond.c | 299 proc_barrier(int fd) in proc_barrier() argument 304 ret = write(fd, &b, 1); in proc_barrier() 306 ret = read(fd, &b, 1); in proc_barrier() 311 fdset_init(fd_set *rfd, fd_set *wfd, fd_set *efd, int fd) in fdset_init() argument 316 FD_SET(fd, rfd); in fdset_init() 317 FD_SET(fd, wfd); in fdset_init() 318 FD_SET(fd, efd); in fdset_init() 322 proc_child(int fd, int bfd) in proc_child() argument 334 fdset_init(&rfd, &wfd, &efd, fd); in proc_child() 335 ret = select(fd + 1, &rfd, &wfd, &efd, &tv); in proc_child() [all …]
|
| /openbsd-src/games/hack/ |
| H A D | hack.lev.c | 83 savelev(int fd, xchar lev) in savelev() argument 90 if (fd < 0) in savelev() 95 bwrite(fd, &hackpid,sizeof(hackpid)); in savelev() 96 bwrite(fd, &lev,sizeof(lev)); in savelev() 97 bwrite(fd, levl,sizeof(levl)); in savelev() 98 bwrite(fd, &moves,sizeof(long)); in savelev() 99 bwrite(fd, &xupstair,sizeof(xupstair)); in savelev() 100 bwrite(fd, &yupstair,sizeof(yupstair)); in savelev() 101 bwrite(fd, &xdnstair,sizeof(xdnstair)); in savelev() 102 bwrite(fd, &ydnstair,sizeof(ydnstair)); in savelev() [all …]
|
| H A D | hack.save.c | 99 int fd, ofd; in dosave0() local 104 if((fd = open(SAVEF, O_CREAT | O_TRUNC | O_WRONLY, FMASK)) == -1) { in dosave0() 111 savelev(fd,dlevel); in dosave0() 112 saveobjchn(fd, invent); in dosave0() 113 saveobjchn(fd, fcobj); in dosave0() 114 savemonchn(fd, fallen_down); in dosave0() 116 bwrite(fd, &tmp, sizeof tmp); in dosave0() 117 bwrite(fd, &flags, sizeof(struct flag)); in dosave0() 118 bwrite(fd, &dlevel, sizeof dlevel); in dosave0() 119 bwrite(fd, &maxdlevel, sizeof maxdlevel); in dosave0() [all …]
|
| /openbsd-src/sys/miscfs/fuse/ |
| H A D | fuse_device.c | 133 struct fuse_d *fd; in fuse_lookup() local 135 LIST_FOREACH(fd, &fuse_d_list, fd_list) in fuse_lookup() 136 if (fd->fd_unit == unit) in fuse_lookup() 137 return (fd); in fuse_lookup() 147 struct fuse_d *fd; in fuse_device_cleanup() local 150 fd = fuse_lookup(minor(dev)); in fuse_device_cleanup() 151 if (fd == NULL) in fuse_device_cleanup() 156 rw_enter_write(&fd->fd_lock); in fuse_device_cleanup() 157 SIMPLEQ_FOREACH_SAFE(f, &fd->fd_fbufs_in, fb_next, ftmp) { in fuse_device_cleanup() 160 SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_in, fb_next); in fuse_device_cleanup() [all …]
|
| /openbsd-src/regress/sys/dev/wscons/ |
| H A D | sigio.c | 52 test_getown_fcntl(int fd) in test_getown_fcntl() argument 54 return test_common_getown(fd, 1); in test_getown_fcntl() 58 test_getown_ioctl(int fd) in test_getown_ioctl() argument 60 return test_common_getown(fd, 0); in test_getown_ioctl() 64 test_gpgrp(int fd) in test_gpgrp() argument 68 if (ioctl(fd, TIOCGPGRP, &pgrp) == -1) in test_gpgrp() 74 if (ioctl(fd, TIOCSPGRP, &arg) == -1) in test_gpgrp() 76 if (ioctl(fd, TIOCGPGRP, &pgrp) == -1) in test_gpgrp() 85 test_setown_fcntl(int fd) in test_setown_fcntl() argument 87 return test_common_setown(fd, 1); in test_setown_fcntl() [all …]
|
| /openbsd-src/sys/arch/sparc64/dev/ |
| H A D | fd.c | 309 void fdfinish(struct fd_softc *fd, struct buf *bp); 622 struct fd_softc *fd = (void *)self; in fdattach() local 627 timeout_set(&fd->sc_motoron_to, fd_motor_on, fd); in fdattach() 628 timeout_set(&fd->sc_motoroff_to, fd_motor_off, fd); in fdattach() 638 fd->sc_cylin = -1; in fdattach() 639 fd->sc_drive = drive; in fdattach() 640 fd->sc_deftype = type; in fdattach() 641 fdc->sc_fd[drive] = fd; in fdattach() 651 fd->sc_dk.dk_flags = DKF_NOLABELREAD; in fdattach() 652 fd->sc_dk.dk_name = fd->sc_dv.dv_xname; in fdattach() [all …]
|
| /openbsd-src/sbin/ipsecctl/ |
| H A D | ike.c | 64 ike_section_general(struct ipsec_rule *r, FILE *fd) in ike_section_general() argument 67 fprintf(fd, SET "[General]:Check-interval=%d force\n", in ike_section_general() 69 fprintf(fd, SET "[General]:DPD-check-interval=%d force\n", in ike_section_general() 75 ike_section_peer(struct ipsec_rule *r, FILE *fd) in ike_section_peer() argument 78 fprintf(fd, SET "[Phase 1]:%s=%s force\n", r->peer->name, in ike_section_peer() 81 fprintf(fd, SET "[Phase 1]:Default=%s force\n", r->p1name); in ike_section_peer() 82 fprintf(fd, SET "[%s]:Phase=1 force\n", r->p1name); in ike_section_peer() 84 fprintf(fd, SET "[%s]:Address=%s force\n", r->p1name, in ike_section_peer() 87 fprintf(fd, SET "[%s]:Local-address=%s force\n", r->p1name, in ike_section_peer() 90 fprintf(fd, SET "[%s]:Authentication=%s force\n", r->p1name, in ike_section_peer() [all …]
|
| /openbsd-src/gnu/llvm/lldb/examples/interposing/darwin/fd_interposing/ |
| H A D | FDInterposing.cpp | 150 FDEvent(int fd, int err, const StringSP &string_sp, bool is_create, in FDEvent() argument 153 m_fd(fd), m_err(err), m_is_create(is_create) {} in FDEvent() 468 void save_backtrace(int fd, int err, const StringSP &string_sp, in save_backtrace() argument 473 FDEventSP fd_event_sp(new FDEvent(fd, err, string_sp, is_create, frames)); in save_backtrace() 475 FDEventMap::iterator pos = g_fd_event_map.find(fd); in save_backtrace() 480 FDEventArray &event_array = g_fd_event_map[fd]; in save_backtrace() 492 fd); in save_backtrace() 509 fd); in save_backtrace() 522 g_fd_event_map[fd].push_back(fd_event_sp); in save_backtrace() 531 const int fd = ::socket(domain, type, protocol); in socket$__interposed__() local [all …]
|
| /openbsd-src/gnu/llvm/compiler-rt/lib/tsan/rtl/ |
| H A D | tsan_fd.cpp | 51 static bool bogusfd(int fd) { in bogusfd() argument 53 return fd < 0 || fd >= kTableSize; in bogusfd() 80 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { in fddesc() argument 81 CHECK_GE(fd, 0); in fddesc() 82 CHECK_LT(fd, kTableSize); in fddesc() 83 atomic_uintptr_t *pl1 = &fdctx.tab[fd / kTableSizeL2]; in fddesc() 97 return &fds[fd % kTableSizeL2]; in fddesc() 101 static void init(ThreadState *thr, uptr pc, int fd, FdSync *s, in init() argument 103 FdDesc *d = fddesc(thr, pc, fd); in init() 160 bool FdLocation(uptr addr, int *fd, Tid *tid, StackID *stack, bool *closed) { in FdLocation() argument [all …]
|
| /openbsd-src/gnu/usr.bin/perl/dist/IO/lib/IO/ |
| H A D | Poll.pm | 33 # [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-src/usr.sbin/mopd/otherOS/ |
| H A D | loop.c | 46 int fd; local 48 fd = (*(p->iopen))(p->if_name, 52 if (fd >= 0) { 53 pfAddMulti(fd, p->if_name, rc_mcst); 54 pfEthAddr(fd, p->eaddr); 57 return fd; 69 int fd; local 71 fd = (*(p->iopen))(p->if_name, 75 if (fd >= 0) { 76 pfAddMulti(fd, p->if_name, dl_mcst); [all …]
|
| /openbsd-src/usr.bin/rsync/ |
| H A D | io.c | 36 io_read_check(int fd) in io_read_check() argument 40 pfd.fd = fd; in io_read_check() 56 io_write_nonblocking(int fd, const void *buf, size_t bsz, in io_write_nonblocking() argument 68 pfd.fd = fd; in io_write_nonblocking() 92 if ((wsz = write(fd, buf, bsz)) == -1) { in io_write_nonblocking() 106 io_write_blocking(int fd, const void *buf, size_t sz) in io_write_blocking() argument 112 c = io_write_nonblocking(fd, buf, sz, &wsz); in io_write_blocking() 133 io_write_buf(struct sess *sess, int fd, const void *buf, size_t sz) in io_write_buf() argument 140 c = io_write_blocking(fd, buf, sz); in io_write_buf() 149 if (!io_write_blocking(fd, &tagbuf, sizeof(tagbuf))) { in io_write_buf() [all …]
|
| /openbsd-src/regress/sys/fifofs/ |
| H A D | fifotest.out | 6 1 fd(s) ready, revents == POLLOUT 8 0 fd(s) ready 10 1 fd(s) ready, revents == POLLOUT 12 0 fd(s) ready 14 1 fd(s) ready, writeable 16 0 fd(s) ready 18 1 fd(s) ready, writeable 20 0 fd(s) ready 24 1 fd(s) ready, revents == POLLIN POLLOUT 26 1 fd(s) ready, revents == POLLIN [all …]
|
| H A D | fifotest.c | 86 int fd; in runtest() local 97 if ((fd = open(fifo, O_RDWR | flags)) == -1) { in runtest() 107 dopoll(-1, fd, POLLIN|POLLOUT, "POLLIN|POLLOUT", timeout); in runtest() 108 dopoll(-1, fd, POLLIN, "POLLIN", timeout); in runtest() 109 dopoll(-1, fd, POLLOUT, "POLLOUT", timeout); in runtest() 110 dopoll(-1, fd, 0, "(none)", timeout); in runtest() 111 doselect(-1, fd, fd, timeout); in runtest() 112 doselect(-1, fd, -1, timeout); in runtest() 113 doselect(-1, -1, fd, timeout); in runtest() 116 if (write(fd, "test", 4) != 4) { in runtest() [all …]
|
| /openbsd-src/usr.sbin/tcpdump/ |
| H A D | privsep.c | 118 static void impl_localtime(int fd); 366 impl_open_bpf(int fd, int *bpfd) in impl_open_bpf() argument 375 must_read(fd, &snaplen, sizeof(int)); in impl_open_bpf() 376 must_read(fd, &promisc, sizeof(int)); in impl_open_bpf() 377 must_read(fd, &dlt, sizeof(u_int)); in impl_open_bpf() 378 must_read(fd, &dirfilt, sizeof(u_int)); in impl_open_bpf() 379 must_read(fd, &fildrop, sizeof(fildrop)); in impl_open_bpf() 380 iflen = read_string(fd, device, sizeof(device), __func__); in impl_open_bpf() 389 send_fd(fd, *bpfd); in impl_open_bpf() 390 must_write(fd, &err, sizeof(int)); in impl_open_bpf() [all …]
|
| /openbsd-src/regress/sys/kern/pwrite/ |
| H A D | pwrite.c | 22 int fd, ret; in main() local 24 if ((fd = mkstemp(temp)) < 0) in main() 28 if (write(fd, zeroes, sizeof(zeroes)) != sizeof(zeroes)) in main() 31 if (lseek(fd, 5, SEEK_SET) != 5) in main() 34 if (pwrite(fd, &magic[1], 4, 4) != 4) in main() 37 if (read(fd, &c, 1) != 1) in main() 44 if (write(fd, &c, 1) != 1) in main() 47 if (write(fd, &c, 0) != 0) in main() 50 if (pread(fd, buf, 10, 0) != 10) in main() 56 if ((ret = pwrite(fd, &magic[5], 1, -1)) != -1) in main() [all …]
|
| /openbsd-src/usr.sbin/makefs/cd9660/ |
| H A D | cd9660_write.c | 59 FILE *fd; in cd9660_write_image() local 63 if ((fd = fopen(image, "w+")) == NULL) in cd9660_write_image() 67 status = cd9660_copy_file(diskStructure, fd, 0, in cd9660_write_image() 77 status = cd9660_write_volume_descriptors(diskStructure, fd); in cd9660_write_image() 88 status = cd9660_write_path_tables(diskStructure, fd); in cd9660_write_image() 95 status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode); in cd9660_write_image() 102 cd9660_write_boot(diskStructure, fd); in cd9660_write_image() 107 cd9660_write_filedata(diskStructure, fd, in cd9660_write_image() 110 fclose(fd); in cd9660_write_image() 114 fclose(fd); in cd9660_write_image() [all …]
|
| /openbsd-src/regress/lib/libpthread/blocked_fifo/ |
| H A D | blocked_fifo.c | 49 int fd; in fifo_deadlocker() local 55 CHECKe(fd = open(FILE, O_RDONLY)); in fifo_deadlocker() 56 CHECKe(close(fd)); in fifo_deadlocker() 59 CHECKe(fd = open(FIFO, O_WRONLY)); in fifo_deadlocker() 60 CHECKe(write(fd, "test", 4)); in fifo_deadlocker() 61 CHECKe(close(fd)); in fifo_deadlocker() 69 int fd; in fifo_closer() local 75 CHECKe(fd = open(FILE, O_RDONLY)); in fifo_closer() 76 CHECKe(dup2(fd, expected_fd)); in fifo_closer() 77 CHECKe(close(fd)); in fifo_closer() [all …]
|
| /openbsd-src/regress/sys/kern/poll/ |
| H A D | poll_iocond.c | 298 proc_barrier(int fd) in proc_barrier() argument 303 ret = write(fd, &b, 1); in proc_barrier() 305 ret = read(fd, &b, 1); in proc_barrier() 310 proc_child(int fd, int bfd) in proc_child() argument 322 pfd[0].fd = fd; in proc_child() 331 ret = write(fd, &b, 1); in proc_child() 351 pfd[0].fd = fd; in proc_child() 358 ret = write(fd, buf, sizeof(buf)); in proc_child() 380 ret = write(fd, &b, 1); in proc_child() 383 if (ioctl(fd, UIOCCMD(42), NULL) == -1) in proc_child() [all …]
|
| /openbsd-src/regress/sys/kern/flock/ |
| H A D | flock.c | 76 test1(int fd) in test1() argument 85 if (fcntl(fd, F_GETLK, &fl1) < 0) in test1() 105 test2(int fd) in test2() argument 135 if (fcntl(fd, F_SETLK, &fl) < 0) in test2() 155 res = fcntl(fd, F_SETLK, &fl); in test2() 176 test3(int fd) in test3() argument 206 if (fcntl(fd, F_SETLK, &fl) < 0) in test3() 229 res = fcntl(fd, F_SETLKW, &fl); in test3() 246 test4(int fd) in test4() argument 275 if (fcntl(fd, F_SETLK, &fl) < 0) in test4() [all …]
|