/freebsd-11-stable/lib/libc/rpc/ |
H A D | clnt_generic.c | 327 * If fd is RPC_ANYFD, it will be opened using nconf. 332 clnt_tli_create(int fd, const struct netconfig *nconf, argument 337 bool_t madefd = FALSE; /* whether fd opened here */ 343 if (fd == RPC_ANYFD) { 349 fd = __rpc_nconf2fd(nconf); 351 if (fd == -1) 353 if (fd < __rpc_minfd) 354 fd = __rpc_raise_fd(fd); 357 if (!__rpc_fd2sockinfo(fd, 426 __rpc_raise_fd(int fd) argument [all...] |
/freebsd-11-stable/usr.sbin/fwcontrol/ |
H A D | fwcontrol.c | 113 get_dev(int fd, struct fw_devlstreq *data) argument 117 if( ioctl(fd, FW_GDEVLST, data) < 0) { 123 str2node(int fd, const char *nodestr) argument 149 get_dev(fd,data); 173 list_dev(int fd) argument 184 get_dev(fd, data); 204 read_write_quad(int fd, struct fw_eui64 eui, u_int32_t addr_lo, int readmode, u_int32_t data) argument 233 if (ioctl(fd, FW_ASYREQ, asyreq) < 0) { 260 send_phy_config(int fd, int root_node, int gap_count) argument 281 if (ioctl(fd, FW_ASYRE 287 link_on(int fd, int node) argument 306 reset_start(int fd, int node) argument 330 set_pri_req(int fd, u_int32_t pri_req) argument 390 get_crom(int fd, int node, void *crom_buf, int len) argument 514 show_topology_map(int fd) argument 559 read_phy_registers(int fd, u_int8_t *buf, int offset, int len) argument 575 read_phy_page(int fd, u_int8_t *buf, int page, int port) argument 587 dump_phy_registers(int fd) argument 646 open_dev(int *fd, char *devname) argument 665 detect_recv_fn(int fd, char ich) argument 735 int fd = -1, ch, len=1024; local [all...] |
/freebsd-11-stable/contrib/ntp/ntpd/ |
H A D | refclock_heath.c | 218 int fd; local 225 fd = refclock_open(device, speed[peer->ttl & 0x3], 227 if (fd <= 0) 233 pp->io.fd = fd; 235 close(fd); 236 pp->io.fd = -1; 262 if (-1 != pp->io.fd) 427 if (ioctl(pp->io.fd, TIOCMBIC, (char *)&bits) < 0) 430 if (write(pp->io.fd, " [all...] |
/freebsd-11-stable/contrib/dma/ |
H A D | crypto.c | 80 smtp_init_crypto(int fd, int feature) argument 121 send_remote_command(fd, "EHLO %s", hostname()); 122 if (read_remote(fd, 0, NULL) == 2) { 123 send_remote_command(fd, "STARTTLS"); 124 if (read_remote(fd, 0, NULL) != 2) { 148 /* Set fd for SSL in/output */ 149 error = SSL_set_fd(config.ssl, fd); 151 syslog(LOG_NOTICE, "remote delivery deferred: SSL set fd failed: %s", 257 smtp_auth_md5(int fd, char *login, char *password) argument 271 send_remote_command(fd, "AUT [all...] |
/freebsd-11-stable/contrib/ipfilter/ipsend/ |
H A D | snit.c | 67 int fd; local 69 if ((fd = open("/dev/nit", O_RDWR)) < 0) 78 ioctl(fd, I_SRDOPT, (char*)RMSGD); 79 ioctl(fd, I_PUSH, "nbuf"); 91 if (ioctl(fd, I_STR, (char*)&si) == -1) 105 if (ioctl(fd, I_STR, (char*)&si) == -1) 110 return fd; 115 * output an IP packet onto a fd opened for /dev/nit 117 int sendip(fd, pkt, len) 118 int fd, le [all...] |
/freebsd-11-stable/sbin/nvmecontrol/ |
H A D | wdc.c | 60 wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix) argument 68 read_controller_data(fd, &cdata); 78 wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, argument 94 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) 101 wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode, argument 110 wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); 125 wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid); 166 int ch, fd; local 181 open_dev(argv[optind], &fd, 1, 1); 183 wdc_do_dump(fd, path_tmp [all...] |
H A D | firmware.c | 54 slot_has_valid_firmware(int fd, int slot) argument 59 read_logpage(fd, NVME_LOG_FIRMWARE_SLOT, 73 int fd; local 78 if ((fd = open(path, O_RDONLY)) < 0) 80 if (fstat(fd, &sb) < 0) 100 if ((*size = read(fd, *buf, filesize)) < 0) 110 update_firmware(int fd, uint8_t *payload, int32_t payload_size) argument 135 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) 147 activate_firmware(int fd, int slot, int activate_action) argument 156 if (ioctl(fd, NVME_PASSTHROUGH_CM 180 int fd = -1, slot = 0; local [all...] |
/freebsd-11-stable/usr.sbin/fifolog/lib/ |
H A D | fifolog_int.c | 64 f->fd = open(fname, mode ? O_RDWR : O_RDONLY); 65 if (f->fd < 0) 69 i = ioctl(f->fd, DIOCGSECTORSIZE, &f->recsize); 74 i = fstat(f->fd, &st); 83 i = ioctl(f->fd, DIOCGMEDIASIZE, &f->logsize); 94 i = pread(f->fd, f->recbuf, f->recsize, 0); 146 f->fd = -1; 172 if (f->fd >= 0) 173 (void)close(f->fd); 185 assert(ff->fd > [all...] |
/freebsd-11-stable/sys/sys/ |
H A D | syscallsubr.h | 72 int kern_accessat(struct thread *td, int fd, char *path, 78 int kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); 79 int kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds, 81 int kern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights); 93 int kern_close(struct thread *td, int fd); 94 int kern_connectat(struct thread *td, int dirfd, int fd, 108 int kern_fchmodat(struct thread *td, int fd, char *path, 110 int kern_fchownat(struct thread *td, int fd, char *path, 112 int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); 113 int kern_fcntl_freebsd(struct thread *td, int fd, in [all...] |
H A D | filedesc.h | 69 #define fd_seq(fdt, fd) (&(fdt)->fdt_ofiles[(fd)].fde_seq) 167 void _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags, 189 int getvnode(struct thread *td, int fd, cap_rights_t *rightsp, 193 int fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, 195 int fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, 199 int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, 204 fget_locked(struct filedesc *fdp, int fd) argument 209 if (fd < 0 || fd > fd 216 fdeget_locked(struct filedesc *fdp, int fd) argument 233 fd_modified(struct filedesc *fdp, int fd, seq_t seq) argument [all...] |
/freebsd-11-stable/contrib/ntp/sntp/libevent/ |
H A D | evport.c | 42 * pointers to the read and write events that correspond to that fd. (That is, 50 * necessary when large fd's come in. reassociate() takes care of maintaining 92 /* Index of this fd within ed_pending, plus 1. Zero if this fd is 118 static int evport_add(struct event_base *, int fd, short old, short events, void *); 119 static int evport_del(struct event_base *, int fd, short old, short events, void *); 233 reassociate(struct evport_data *epdp, struct fd_info *fdip, int fd) argument 239 fd, sysevents, fdip) == -1) { 290 const int fd = epdp->ed_pending[i]; local 291 if (fd ! 327 int fd = (int) pevt->portev_object; local 379 evport_add(struct event_base *base, int fd, short old, short events, void *p) argument 396 evport_del(struct event_base *base, int fd, short old, short events, void *p) argument [all...] |
/freebsd-11-stable/contrib/tcp_wrappers/ |
H A D | tli.c | 86 if ((request->config = tli_transport(request->fd)) != 0 90 if ((request->config = tli_transport(request->fd)) != 0 140 int fd = request->fd; local 156 if ((client = (struct t_unitdata *) t_alloc(fd, T_UNITDATA, T_ADDR)) == 0) { 160 if (ioctl(fd, TI_GETPEERNAME, &client->addr) < 0 || client->addr.len == 0) { 162 if (t_rcvudata(fd, client, &flags) < 0 || client->addr.len == 0) { 175 if ((server = (struct t_unitdata *) t_alloc(fd, T_UNITDATA, T_ADDR)) == 0) { 179 if (ioctl(fd, TI_GETMYNAME, &server->addr) < 0) { 189 static struct netconfig *tli_transport(fd) [all...] |
/freebsd-11-stable/contrib/openbsm/compat/ |
H A D | pidfile.h | 74 int error, fd, i; local 76 fd = open(path, O_RDONLY); 77 if (fd == -1) 80 i = read(fd, buf, sizeof(buf) - 1); 82 close(fd); 101 int error, fd, len, count; local 128 fd = flopen(pfh->pf_path, 134 if (fd == -1) { 155 if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { 158 close(fd); 189 int error, fd; local [all...] |
/freebsd-11-stable/usr.sbin/bluetooth/btpand/ |
H A D | client.c | 53 int fd, n; local 62 fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BLUETOOTH_PROTO_L2CAP); 63 if (fd == -1) { 75 if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { 81 if (setsockopt(fd, SOL_L2CAP, SO_L2CAP_IMTU, &mru, sizeof(mru)) == -1) { 91 if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { 97 if (getsockopt(fd, SOL_L2CAP, SO_L2CAP_IMTU, &mru, &len) == -1) { 107 if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, &len) == -1) { 113 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1) 118 if (getsockopt(fd, SOL_L2CA [all...] |
H A D | event.c | 109 event_log_debug("%s: building fd set...", __func__); 127 if (ev->fd >= 0) { 129 FD_SET(ev->fd, &r); 130 nfd = (nfd > ev->fd) ? nfd : ev->fd; 134 FD_SET(ev->fd, &w); 135 nfd = (nfd > ev->fd) ? nfd : ev->fd; 160 /* check if fd is ready for reading/writing */ 161 if (nfd > 0 && ev->fd > 213 __event_set(struct event *ev, int fd, short flags, void (*cb)(int, short, void *), void *cbarg) argument [all...] |
/freebsd-11-stable/usr.sbin/bluetooth/bcmfw/ |
H A D | bcmfw.c | 123 int fd = -1, error = -1; local 127 if ((fd = open(path, O_WRONLY)) < 0) { 133 if (ioctl(fd, USB_GET_DEVICE_DESC, &desc) < 0) { 135 fd, USB_GET_DEVICE_DESC, &desc, 149 if (fd != -1) 150 close(fd); 163 int intr = -1, bulk = -1, fd = -1, error = -1, len; local 185 if ((fd = open(md, O_RDONLY)) < 0) { 192 len = read(fd, buf, sizeof(buf)); 210 close(fd); [all...] |
/freebsd-11-stable/usr.sbin/mfiutil/ |
H A D | mfi_show.c | 62 int error, fd, comma; local 69 fd = mfi_open(mfi_unit, O_RDONLY); 70 if (fd < 0) { 76 if (mfi_ctrl_get_info(fd, &info, NULL) < 0) { 79 close(fd); 136 close(fd); 150 int comma, error, fd, show_capacity, show_props; local 158 fd = mfi_open(mfi_unit, O_RDONLY); 159 if (fd < 0) { 165 if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_CAPACITY_INF 353 int error, fd, i, j; local 453 int error, fd; local 537 int error, fd; local 616 int error, fd; local 674 int busy, error, fd; local [all...] |
/freebsd-11-stable/usr.sbin/mptutil/ |
H A D | mpt_drive.c | 109 mpt_pd_insert(int fd, struct mpt_drive_list *list, U8 PhysDiskNum) argument 130 list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL); 138 mpt_pd_list(int fd) argument 152 ioc2 = mpt_read_ioc_page(fd, 2, NULL); 160 ioc3 = mpt_read_ioc_page(fd, 3, NULL); 169 ioc5 = mpt_read_ioc_page(fd, 5, NULL); 187 volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, 211 if (mpt_pd_insert(fd, list, rdisk->PhysDiskNum) < 0) { 226 if (mpt_pd_insert(fd, list, spare->PhysDiskNum) < 0) { 236 if (mpt_pd_insert(fd, lis 332 int error, fd; local [all...] |
/freebsd-11-stable/usr.sbin/makefs/cd9660/ |
H A D | cd9660_eltorito.c | 533 cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start, argument 539 if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1) 543 fwrite(&val, sizeof(val), 1, fd); 546 fwrite(&val, sizeof(val), 1, fd); 547 fwrite(&val, sizeof(val), 1, fd); 548 fwrite(&val, sizeof(val), 1, fd); 551 fwrite(&val, sizeof(val), 1, fd); 554 fwrite(&val, sizeof(val), 1, fd); 555 fwrite(&val, sizeof(val), 1, fd); 556 fwrite(&val, sizeof(val), 1, fd); 568 cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions, off_t sector_start, off_t nsectors, off_t sector_size, const char *part_name, const char *part_type) argument 622 cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd) argument [all...] |
/freebsd-11-stable/stand/ficl/ |
H A D | loader.c | 390 ** reads in text from file fd and passes it to ficlExec() 395 int ficlExecFD(FICL_VM *pVM, int fd) argument 403 pVM->sourceID.i = fd; 410 while ((status = read(fd, &ch, 1)) > 0 && ch != '\n') 448 /* isdir? - Return whether an fd corresponds to a directory. 450 * isdir? ( fd -- bool ) 456 int fd; local 462 fd = stackPopINT(pVM->pStack); 465 if (fd < 0) 467 if (fstat(fd, 482 int mode, fd, count; local 516 int fd; local 533 int fd, len; local 564 int fd; local 628 int fd; local 645 int fd, len; local 667 int fd, pos, whence; local 753 int i, fd; local [all...] |
/freebsd-11-stable/crypto/openssh/ |
H A D | authfile.c | 59 int fd, oerrno; local 61 if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0) 63 if (atomicio(vwrite, fd, (u_char *)sshbuf_ptr(keybuf), 66 close(fd); 71 close(fd); 96 /* Load a key from a fd into a buffer */ 98 sshkey_load_file(int fd, struct sshbuf *blob) argument 105 if (fstat(fd, &st) < 0) 123 if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) { 157 sshkey_load_public_rsa1(int fd, struc argument 182 sshkey_perm_ok(int fd, const char *filename) argument 214 int fd, r; local 242 sshkey_load_private_type_fd(int fd, int type, const char *passphrase, struct sshkey **keyp, char **commentp) argument 272 int r, fd; local 354 int r, fd; local [all...] |
H A D | loginrec.c | 845 register int fd; local 872 if (tty > 0 && (fd = open(UTMP_FILE, O_RDWR|O_CREAT, 0644)) >= 0) { 876 if ((ret = lseek(fd, pos, SEEK_SET)) == -1) { 878 close(fd); 884 close(fd); 892 if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) && 898 if ((ret = lseek(fd, pos, SEEK_SET)) == -1) { 900 close(fd); 906 close(fd); 909 if (atomicio(vwrite, fd, u 1095 int fd, ret = 1; local 1186 int fd, found = 0; local 1267 int fd, ret = 1; local 1351 int fd, found=0; local 1477 lastlog_openseek(struct logininfo *li, int *fd, int filemode) argument 1539 int fd; local 1592 int fd, ret; local 1664 int fd; local [all...] |
/freebsd-11-stable/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_posix.cpp | 168 void CloseFile(fd_t fd) { argument 169 internal_close(fd); 172 bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, uptr *bytes_read, argument 174 uptr res = internal_read(fd, buff, buff_size); 182 bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, uptr *bytes_written, argument 184 uptr res = internal_write(fd, buff, buff_size); 193 fd_t fd = OpenFile(file_name, RdOnly); local 194 CHECK(fd != kInvalidFd); 195 uptr fsize = internal_filesize(fd); 199 uptr map = internal_mmap(nullptr, *buff_size, PROT_READ, MAP_PRIVATE, fd, 203 MapWritableFileToMemory(void *addr, uptr size, fd_t fd, OFF_T offset) argument 321 ReserveStandardFds(fd_t fd) argument 350 int fd = ReserveStandardFds( local 380 int fd = GetNamedMappingFd(name, length, &flags); local [all...] |
/freebsd-11-stable/contrib/apr/poll/unix/ |
H A D | epoll.c | 93 int fd; local 96 fd = epoll_create1(EPOLL_CLOEXEC); 98 fd = epoll_create(size); 100 if (fd < 0) { 109 if ((fd_flags = fcntl(fd, F_GETFD)) == -1) { 111 close(fd); 117 if (fcntl(fd, F_SETFD, fd_flags) == -1) { 119 close(fd); 133 close(fd); 139 close(fd); 345 int fd; local [all...] |
/freebsd-11-stable/contrib/libarchive/libarchive/ |
H A D | archive_util.c | 241 int fd; local 244 fd = -1; 366 fd = _open_osfhandle((intptr_t)h, _O_BINARY | _O_RDWR); 367 if (fd == -1) { 380 return (fd); 425 int fd = -1; local 437 fd = open(temp_name.s, O_RDWR|O_CLOEXEC|O_TMPFILE|O_EXCL, 0600); 438 if(fd >= 0) 442 fd = mkstemp(temp_name.s); 443 if (fd < 455 int fd = -1; local 483 int fd; local 568 __archive_ensure_cloexec_flag(int fd) argument [all...] |