/freebsd-11-stable/contrib/tcp_wrappers/ |
H A D | fix_options.c | 46 int fd = request->fd; local 59 if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) { 72 if (getsockopt(fd, ipproto, IP_OPTIONS, (char *) optbuf, &optsize) == 0 106 shutdown(fd, 2); 125 if (setsockopt(fd, ipproto, IP_OPTIONS, (char *) 0, optsize) != 0) { 127 shutdown(fd, 2);
|
H A D | tli-sequent.c | 74 t_sync(request->fd); 75 if (getpeerinaddr(request->fd, &client, len) < 0) { 82 if ((tli_state_ptr = _t_checkfd(request->fd)) == NULL) 102 switch (ioctl(request->fd, I_PEEK, &peek)) { 140 if (getmyinaddr(request->fd, &server, len) < 0) 171 static void tli_sink(fd) 172 int fd; 184 if ((unit = (struct t_unitdata *) t_alloc(fd, T_UNITDATA, T_ALL)) == 0) { 188 (void) t_rcvudata(fd, unit, &flags);
|
/freebsd-11-stable/contrib/sendmail/libsm/ |
H A D | fflush.c | 49 int fd; local 65 SM_CONVERT_TIME(fp, fd, timeout, &to); 95 int fd; local 114 if ((fd = sm_io_getinfo(fp, SM_IO_WHAT_FD, NULL)) == -1) 116 /* can't get an fd, likely internal 'fake' fp */ 118 fd = -1; 140 if (IS_IO_ERROR(fd, t, *timeout)) 147 SM_IO_WR_TIMEOUT(fp, fd, *timeout);
|
/freebsd-11-stable/lib/libc/rpc/ |
H A D | getpublickey.c | 94 FILE *fd; local 98 fd = fopen(PKFILE, "r"); 99 if (fd == NULL) 102 res = fgets(buf, sizeof(buf), fd); 104 fclose(fd); 131 fclose(fd); 158 fclose(fd);
|
/freebsd-11-stable/sys/i386/ibcs2/ |
H A D | ibcs2_other.c | 76 largs.fd = uap->fd; 92 int fd, error; local 102 fd = td->td_retval[0]; 111 error = kern_connectat(td, AT_FDCWD, fd, (struct sockaddr *)&sun); 113 kern_close(td, fd); 116 td->td_retval[0] = fd;
|
/freebsd-11-stable/sbin/growfs/tests/ |
H A D | legacy_test.pl | 34 open my $fd, "|-", "disklabel -R md$unit /dev/stdin" or die; 35 print $fd "a: ", ($partszMB * BLKS_PER_MB), " 0 4.2BSD 1024 8192\n"; 36 print $fd "c: ", ($unitszMB * BLKS_PER_MB), " 0 unused 0 0\n"; 37 close $fd; 45 sysopen my $fd, "/dev/md$unit", O_RDWR or die "/dev/md$unit: $!"; 46 seek($fd, $start * BLK, SEEK_SET); 48 syswrite($fd, $content512) == 512 or die "write: $!";
|
/freebsd-11-stable/usr.sbin/bhyve/ |
H A D | bootrom.c | 58 int fd, i, rv, prot; local 61 fd = open(romfile, O_RDONLY); 62 if (fd < 0) { 68 if (fstat(fd, &sbuf) < 0) { 101 rlen = read(fd, ptr + i * PAGE_SIZE, PAGE_SIZE); 110 if (fd >= 0) 111 close(fd);
|
/freebsd-11-stable/contrib/netbsd-tests/rump/rumpkern/ |
H A D | t_lwproc.c | 250 atf_tc_set_md_var(tc, "descr", "check that fork shares fd's"); 257 int fd; local 266 RL(fd = rump_sys_open("/file", O_RDWR | O_CREAT, 0777)); 268 /* ok, first check rfork(RUMP_RFCFDG) does *not* preserve fd's */ 270 ATF_REQUIRE_ERRNO(EBADF, rump_sys_write(fd, &fd, sizeof(fd)) == -1); 275 ATF_REQUIRE_EQ(rump_sys_write(fd, &fd, sizeof(fd)), sizeo [all...] |
/freebsd-11-stable/contrib/netbsd-tests/kernel/ |
H A D | t_pty.c | 109 condition(int fd) argument 115 if (ioctl(fd, TIOCSQSIZE, &opt) == -1) 117 if (ioctl(fd, TIOCGQSIZE, &opt) == -1) 123 if (tcgetattr(fd, &tios) == -1) 127 if (tcsetattr(fd, TCSANOW, &tios) == -1) 134 int fd; local 136 if ((fd = posix_openpt(O_RDWR)) == -1) 138 condition(fd); 139 if (grantpt(fd) == -1) 144 condition(fd); 155 int fd; local 175 fd_nonblock(int fd) argument [all...] |
/freebsd-11-stable/usr.sbin/pciconf/ |
H A D | pciconf.c | 73 static void list_bridge(int fd, struct pci_conf *p); 74 static void list_bars(int fd, struct pci_conf *p); 78 static void list_vpd(int fd, struct pci_conf *p); 190 int fd; local 199 fd = open(_PATH_DEVPCI, (bridge || caps || errors) ? O_RDWR : O_RDONLY, 201 if (fd < 0) 219 if (ioctl(fd, PCIOCGETCONF, &pc) == -1) 233 close(fd); 238 close(fd); 257 list_bars(fd, 273 print_bus_range(int fd, struct pci_conf *p, int secreg, int subreg) argument 315 print_bridge_windows(int fd, struct pci_conf *p) argument 394 print_cardbus_mem_window(int fd, struct pci_conf *p, int basereg, int limitreg, bool prefetch) argument 404 print_cardbus_io_window(int fd, struct pci_conf *p, int basereg, int limitreg) argument 424 print_cardbus_windows(int fd, struct pci_conf *p) argument 440 list_bridge(int fd, struct pci_conf *p) argument 456 list_bars(int fd, struct pci_conf *p) argument 479 print_bar(int fd, struct pci_conf *p, const char *label, uint16_t bar_offset) argument 550 list_vpd(int fd, struct pci_conf *p) argument 859 read_config(int fd, struct pcisel *sel, long reg, int width) argument 880 int fd; local 977 readone(int fd, struct pcisel *sel, long reg, int width) argument 991 int fd; local 1018 int fd; local 1038 int fd; local [all...] |
/freebsd-11-stable/tools/tools/ath/athdecode/ |
H A D | main.c | 57 static void oprw(FILE *fd, int recnum, struct athregrec *r); 62 int fd, i, nrecs, same; local 70 fd = open(filename, O_RDONLY); 71 if (fd < 0) 73 if (fstat(fd, &sb) < 0) 75 addr = mmap(0, sb.st_size, PROT_READ, MAP_PRIVATE|MAP_NOCORE, fd, 0); 111 opmark(FILE *fd, int i, const struct athregrec *r) argument 113 fprintf(fd, "\n%05d: ", i); 116 fprintf(fd, "ar%uReset %s", state.chipnum, 120 fprintf(fd, "a 375 oprw(FILE *fd, int recnum, struct athregrec *r) argument [all...] |
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/ |
H A D | server.c | 56 static int32_t server_accept (bthid_server_p srv, int32_t fd); 57 static int32_t server_process(bthid_server_p srv, int32_t fd); 180 int32_t n, fd; local 187 /* Copy cached version of the fd sets and call select */ 203 for (fd = 0; fd < srv->maxfd + 1 && n > 0; fd ++) { 204 if (FD_ISSET(fd, &rfdset)) { 207 if (fd == srv->ctrl || fd 226 server_accept(bthid_server_p srv, int32_t fd) argument 302 server_process(bthid_server_p srv, int32_t fd) argument [all...] |
/freebsd-11-stable/tests/sys/file/ |
H A D | flock_helper.c | 78 int fd; local 82 fd = open(pathname, O_RDWR); 83 if (fd < 0) 85 if (ftruncate(fd, sz) < 0) 87 return (fd); 95 fd = mkstemp(filename); 96 if (fd < 0) 98 if (ftruncate(fd, sz) < 0) 104 return (fd); 149 test1(int fd, __unuse argument 181 test2(int fd, __unused int argc, const __unused char **argv) argument 252 test3(int fd, __unused int argc, const __unused char **argv) argument 322 test4(int fd, __unused int argc, const __unused char **argv) argument 399 test5(int fd, __unused int argc, const __unused char **argv) argument 493 test6(int fd, __unused int argc, const __unused char **argv) argument 596 test7(int fd, __unused int argc, const __unused char **argv) argument 668 test8(int fd, __unused int argc, const __unused char **argv) argument 745 test9(int fd, __unused int argc, const __unused char **argv) argument 817 test10(int fd, __unused int argc, const __unused char **argv) argument 890 test11(int fd, __unused int argc, const __unused char **argv) argument 970 test12(int fd, __unused int argc, const __unused char **argv) argument 1047 test13(int fd, __unused int argc, const __unused char **argv) argument 1132 test14(int fd, int argc, const char **argv) argument 1330 test15(int fd, __unused int argc, const __unused char **argv) argument 1440 test16(int fd, __unused int argc, const __unused char **argv) argument 1550 int fd; local [all...] |
/freebsd-11-stable/usr.sbin/mfiutil/ |
H A D | mfi_config.c | 82 mfi_config_read(int fd, struct mfi_config_data **configp) argument 84 return mfi_config_read_opcode(fd, MFI_DCMD_CFG_READ, configp, NULL, 0); 88 mfi_config_read_opcode(int fd, uint32_t opcode, struct mfi_config_data **configp, argument 105 if (mfi_dcmd_command(fd, opcode, config, 162 int ch, error, fd; local 165 fd = mfi_open(mfi_unit, O_RDWR); 166 if (fd < 0) { 175 close(fd); 179 if (mfi_ld_get_list(fd, &list, NULL) < 0) { 182 close(fd); 290 parse_array(int fd, int raid_type, char *array_str, struct array_info *info) argument 555 int error, fd, i, raid_type; local 849 int error, fd; local 933 int error, fd, i; local 1056 int error, fd; local 1109 dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix) argument 1207 int error, fd; local 1244 int error, fd; local [all...] |
/freebsd-11-stable/contrib/gdb/gdb/ |
H A D | ser-tcp.c | 98 scb->fd = socket (PF_INET, SOCK_DGRAM, 0); 100 scb->fd = socket (PF_INET, SOCK_STREAM, 0); 102 if (scb->fd < 0) 112 ioctl (scb->fd, FIONBIO, &tmp); 115 n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)); 146 FD_SET (scb->fd, &rset); 151 n = select (scb->fd + 1, &rset, &wset, NULL, &t); 168 res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, &err, &len); 180 ioctl (scb->fd, FIONBIO, &tmp); 186 setsockopt (scb->fd, IPPROTO_TC [all...] |
/freebsd-11-stable/tools/regression/aio/aiop/ |
H A D | aiop.c | 84 disk_getsize(int fd) argument 88 if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) < 0) 105 set_aio(struct aiocb *a, iot_t iot, int fd, off_t offset, int size, char *buf) argument 109 a->aio_fildes = fd; 124 int fd; local 170 fd = open(fn, O_RDONLY | O_DIRECT); 172 fd = open(fn, O_WRONLY | O_DIRECT); 174 fd = open(fn, O_RDWR | O_DIRECT); 176 if (fd < 0) 178 if (fstat(fd, [all...] |
/freebsd-11-stable/share/examples/perfmon/ |
H A D | perfmon.c | 53 int c, fd, num; local 114 fd = open(_PATH_PERFMON, O_RDWR, 0); 115 if (fd < 0) 118 if (ioctl(fd, PMIOSETUP, &pmc) < 0) 121 if (ioctl(fd, PMIOTSTAMP, &then) < 0) 125 if (ioctl(fd, PMIOSTART, &num) < 0) 130 if (ioctl(fd, PMIOSTOP, &num) < 0) 132 if (ioctl(fd, PMIOREAD, &value) < 0) 135 if (ioctl(fd, PMIORESET, &value.pmcd_num) < 0) 137 if (ioctl(fd, PMIOSTAR [all...] |
/freebsd-11-stable/usr.sbin/ctm/ctm/ |
H A D | ctm.h | 145 u_char * Ffield(FILE *fd, MD5_CTX *ctx,u_char term); 146 u_char * Fname(FILE *fd, MD5_CTX *ctx,u_char term,int qual, int verbose); 148 int Fbytecnt(FILE *fd, MD5_CTX *ctx, u_char term); 150 u_char * Fdata(FILE *fd, int u_chars, MD5_CTX *ctx); 152 #define GETFIELD(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD 153 #define GETFIELDCOPY(p,q) if(!((p)=Ffield(fd,&ctx,(q)))) return BADREAD; else p=String(p) 154 #define GETBYTECNT(p,q) if(0 >((p)= Fbytecnt(fd,&ctx,(q)))) return BADREAD 155 #define GETDATA(p,q) if(!((p) = Fdata(fd,(q),&ctx))) return BADREAD 156 #define GETNAMECOPY(p,q,r,v) if(!((p)=Fname(fd,&ctx,(q),(r),(v)))) return BADREAD; else p=String(p) 158 int Pass1(FILE *fd, unsigne [all...] |
/freebsd-11-stable/contrib/netbsd-tests/fs/vfs/ |
H A D | t_union.c | 29 int fd; local 35 RL(fd = rump_sys_open(pathb, O_CREAT | O_RDWR, 0777)); 36 if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR)) 38 RL(rump_sys_close(fd)); 46 int fd; local 52 fd = rump_sys_open(pathb, O_RDONLY); 53 if (fd == -1) 55 if (rump_sys_read(fd, buf, sizeof(buf)) == -1) 57 RL(rump_sys_close(fd)); 115 int error, fd, dsiz local [all...] |
/freebsd-11-stable/contrib/ntp/util/ |
H A D | audio-pcm.c | 91 int fd; local 103 fd = open(dname, O_RDWR | O_NONBLOCK, 0777); 104 if (fd < 0) 105 return (fd); 113 close(fd); 117 printf("input: <%s> %d\n", dname, fd); 136 rval = fd; 138 if (ioctl(fd, AIOGSIZE, &s_size) == -1) 144 if (ioctl(fd, AIOGFMT, &s_c_p) == -1)
|
/freebsd-11-stable/crypto/openssl/crypto/rand/ |
H A D | rand_egd.c | 143 int fd = -1; local 153 fd = socket(AF_UNIX, SOCK_STREAM, 0); 154 if (fd == -1) 158 if (connect(fd, (struct sockaddr *)&addr, len) == 0) 192 num = write(fd, egdbuf + numbytes, 2 - numbytes); 213 num = read(fd, egdbuf, 1); 242 num = read(fd, retrievebuf + numbytes, egdbuf[0] - numbytes); 269 if (fd != -1) 270 close(fd);
|
/freebsd-11-stable/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_posix_fadvise.c | 91 int fd; local 96 RL(fd = open("/dev/null", O_RDWR)); 117 CE(posix_fadvise(fd, 0, 0, -1), EINVAL); 120 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NORMAL), 0); 121 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL), 0); 122 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM), 0); 123 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0); 124 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0); 125 CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0);
|
/freebsd-11-stable/usr.bin/truncate/ |
H A D | truncate.c | 61 int ch, error, fd, oflags; local 64 fd = -1; 118 if (fd != -1) 119 close(fd); 120 if ((fd = open(fname, oflags, omode)) == -1) { 128 if (fstat(fd, &sb) == -1) { 145 if (ftruncate(fd, tsize) == -1) { 151 if (fd != -1) 152 close(fd);
|
/freebsd-11-stable/usr.sbin/mptutil/ |
H A D | mpt_evt.c | 44 mpt_get_events(int fd, U16 *IOCStatus) argument 47 return (mpt_read_extended_config_page(fd, MPI_CONFIG_EXTPAGETYPE_LOG, 97 int ch, error, fd, i, num_events, verbose; local 99 fd = mpt_open(mpt_unit); 100 if (fd < 0) { 106 log = mpt_get_events(fd, NULL); 126 close(fd); 137 close(fd); 161 close(fd);
|
/freebsd-11-stable/usr.sbin/digictl/ |
H A D | digictl.c | 57 int altpin, ch, debug, fd, i, res; local 108 if ((fd = open(argv[i], O_RDONLY)) == -1) { 121 if (ioctl(fd, DIGIIO_SETALTPIN, &altpin) != 0) { 129 if (ioctl(fd, DIGIIO_GETALTPIN, &altpin) != 0) { 141 if (dflag && ioctl(fd, DIGIIO_DEBUG, &debug) != 0) { 148 if (ioctl(fd, DIGIIO_MODEL, &model) != 0) { 152 } else if (ioctl(fd, DIGIIO_IDENT, &name) != 0) { 163 if (rflag && ioctl(fd, DIGIIO_REINIT) != 0) { 169 close(fd);
|