/freebsd-11-stable/lib/libc/gen/ |
H A D | daemon.c | 50 int fd; local 87 if (!noclose && (fd = _open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 88 (void)_dup2(fd, STDIN_FILENO); 89 (void)_dup2(fd, STDOUT_FILENO); 90 (void)_dup2(fd, STDERR_FILENO); 91 if (fd > 2) 92 (void)_close(fd);
|
H A D | termios.c | 52 tcgetattr(int fd, struct termios *t) argument 55 return (_ioctl(fd, TIOCGETA, t)); 59 tcsetattr(int fd, int opt, const struct termios *t) argument 70 return (_ioctl(fd, TIOCSETA, t)); 72 return (_ioctl(fd, TIOCSETAW, t)); 74 return (_ioctl(fd, TIOCSETAF, t)); 82 tcsetpgrp(int fd, pid_t pgrp) argument 87 return (_ioctl(fd, TIOCSPGRP, &s)); 91 tcgetpgrp(int fd) argument 95 if (_ioctl(fd, TIOCGPGR 102 tcgetsid(int fd) argument 113 tcsetsid(int fd, pid_t pid) argument 198 tcsendbreak(int fd, int len __unused) argument 213 __libc_tcdrain(int fd) argument 221 tcdrain(int fd) argument 232 tcflush(int fd, int which) argument 254 tcflow(int fd, int action) argument [all...] |
/freebsd-11-stable/usr.sbin/mpsutil/ |
H A D | mps_flash.c | 51 int error, fd, size; local 77 fd = mps_open(mps_unit); 78 if (fd < 0) { 84 if ((size = mps_firmware_get(fd, &firmware_buffer, bios)) < 0) { 86 close(fd); 90 close(fd); 92 fd = open(firmware_file, O_CREAT | O_TRUNC | O_RDWR, 0644); 93 if (fd <0) { 100 if ((ret = write(fd, firmware_buffer + written, size - written)) <0) { 104 close(fd); 122 int error, fd; local [all...] |
/freebsd-11-stable/contrib/ipfilter/lib/ |
H A D | ipf_perror.c | 17 ipf_perror_fd(fd, iocfunc, string) 18 int fd; 26 if ((*iocfunc)(fd, SIOCIPFINTERROR, &realerr) == -1) 37 ipferror(fd, msg) 38 int fd; 41 if (fd >= 0) { 42 ipf_perror_fd(fd, ioctl, msg);
|
/freebsd-11-stable/contrib/wpa/src/ap/ |
H A D | vlan_ifconfig.c | 21 int fd; local 24 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { 33 if (ioctl(fd, SIOCGIFFLAGS, &ifr) != 0) { 37 close(fd); 46 if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) { 50 close(fd); 54 close(fd);
|
H A D | vlan_ioctl.c | 21 int fd; local 31 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { 42 if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) { 45 close(fd); 49 close(fd); 64 int fd; local 77 if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { 92 if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0 && 96 if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0 && 99 close(fd); 129 int fd; local [all...] |
/freebsd-11-stable/usr.sbin/fifolog/lib/ |
H A D | fifolog_create.c | 48 int i, fd; local 55 fd = open(fn, O_WRONLY | O_TRUNC | O_EXCL | O_CREAT, 0644); 56 if (fd < 0) { 58 fd = open(fn, O_WRONLY); 59 if (fd < 0) 69 i = fstat(fd, &st); 74 assert(!close (fd)); 79 assert(!close (fd)); 84 i = ioctl(fd, DIOCGSECTORSIZE, &u); 89 i = ioctl(fd, DIOCGMEDIASIZ [all...] |
/freebsd-11-stable/contrib/netbsd-tests/rump/rumpkern/h_client/ |
H A D | h_forkcli.c | 22 int fd, status; local 27 fd = rump_sys_open("/dev/null", O_CREAT | O_RDWR); 28 if (rump_sys_write(fd, &fd, sizeof(fd)) != sizeof(fd)) 47 /* check that we can access the fd, the close it and exit */ 48 if (rump_sys_write(fd, &fd, sizeof(fd)) ! [all...] |
/freebsd-11-stable/sys/dev/fdc/ |
H A D | fdc.c | 49 * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 99 /* configuration flags for fd */ 369 fdsettype(struct fd_data *fd, struct fd_type *ft) argument 371 fd->ft = ft; 373 fd->sectorsize = 128 << fd->ft->secsize; 574 static void fd_motor(struct fd_data *fd, int turnon); 590 pc98_fd_check_ready(struct fd_data *fd) argument 592 struct fdc_data *fdc = fd->fdc; 594 int fdu = device_get_unit(fd 612 pc98_fd_check_type(struct fd_data *fd, int unit) argument 768 fd_select(struct fd_data *fd) argument 782 struct fd_data *fd; local 804 fd_motor(struct fd_data *fd, int turnon) argument 833 struct fd_data *fd = xfd; local 886 struct fd_data *fd; local 915 struct fd_data *fd; local 1369 fd_enqueue(struct fd_data *fd, struct bio *bp) argument 1397 fd_probe_disk(struct fd_data *fd, int *recal) argument 1463 fdmisccmd(struct fd_data *fd, u_int cmd, void *data) argument 1514 fdautoselect(struct fd_data *fd) argument 1609 struct fd_data *fd; local 1676 struct fd_data * fd; local 1702 struct fd_data *fd; local 2124 struct fd_data *fd; local 2271 struct fd_data *fd; local 2285 struct fd_data *fd; local 2298 struct fd_data *fd = arg; local 2307 struct fd_data *fd; local [all...] |
/freebsd-11-stable/usr.sbin/eeprom/ |
H A D | ofw_options.c | 86 ofwo_oemlogo(const struct ofwo_extabent *exent, int fd, const void *buf, argument 94 ofw_setprop(fd, ofw_optnode(fd), exent->ex_prop, "", 1); 108 if (ofw_setprop(fd, ofw_optnode(fd), exent->ex_prop, 122 ofwo_secmode(const struct ofwo_extabent *exent, int fd, const void *buf, argument 129 if ((res = ofwo_setpass(fd)) != EX_OK) 131 if ((res = ofwo_setstr(fd, buf, buflen, exent->ex_prop, 133 ofw_setprop(fd, ofw_optnode(fd), 150 ofwo_secpwd(const struct ofwo_extabent *exent, int fd, const void *buf, int buflen, const char *val) argument 180 ofwo_setpass(int fd) argument 203 ofwo_setstr(int fd, const void *buf, int buflen, const char *prop, const char *val) argument 248 int fd, len, nlen, pblen; local 281 int fd, len, pblen, rv; local [all...] |
/freebsd-11-stable/tools/tools/cfi/ |
H A D | cfi.c | 67 int fd = open(dvname, mode, 0); local 68 if (fd < 0) 70 return fd; 77 int fd = getfd(O_RDONLY); local 78 if (ioctl(fd, CFIOCGFACTORYPR, &v) < 0) 80 close(fd); 88 int fd = getfd(O_RDONLY); local 89 if (ioctl(fd, CFIOCGOEMPR, &v) < 0) 91 close(fd); 98 int fd local 108 int fd = getfd(O_RDONLY); local 118 int fd = getfd(O_WRONLY); local [all...] |
/freebsd-11-stable/crypto/openssh/openbsd-compat/ |
H A D | bsd-poll.c | 37 * Supports pfd.fd = -1 meaning "unused" although it's not standard. 44 int saved_errno, ret, fd, maxfd = 0; local 50 fd = fds[i].fd; 51 if (fd >= FD_SETSIZE) { 55 maxfd = MAX(maxfd, fd); 69 fd = fds[i].fd; 70 if (fd == -1) 73 FD_SET(fd, readfd [all...] |
/freebsd-11-stable/share/examples/ses/srcs/ |
H A D | getobjmap.c | 51 int nobj, fd, i; local 54 fd = open(*v, O_RDONLY); 55 if (fd < 0) { 59 if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) { 61 (void) close(fd); 66 (void) close(fd); 72 (void) close(fd); 75 if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) { 77 (void) close(fd); 85 (void) close(fd); [all...] |
/freebsd-11-stable/usr.sbin/bluetooth/ath3kfw/ |
H A D | ath3k_fw.c | 48 int fd; local 54 fd = open(fwname, O_RDONLY); 55 if (fd < 0) { 60 if (fstat(fd, &sb) != 0) { 62 close(fd); 69 close(fd); 75 r = read(fd, buf, sb.st_size); 79 close(fd); 89 close(fd); 102 close(fd); [all...] |
/freebsd-11-stable/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_file.h | 37 fd_t fd; member in struct:__sanitizer::ReportFile 42 // PID of the process that opened fd. If a fork() occurs, 63 bool ReadFromFile(fd_t fd, void *buff, uptr buff_size, 65 bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, 70 explicit FileCloser(fd_t fd) : fd(fd) {} argument 71 ~FileCloser() { CloseFile(fd); } 72 fd_t fd; member in struct:__sanitizer::FileCloser 75 bool SupportsColoredOutput(fd_t fd); [all...] |
/freebsd-11-stable/contrib/ncurses/include/ |
H A D | nc_termios.h | 55 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg) 58 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg) 67 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) 150 #define tcsetattr(fd, cmd, arg) _nc_mingw_ioctl(fd, cmd, arg) 154 #define tcgetattr(fd, arg) _nc_mingw_ioctl(fd, TCGET [all...] |
/freebsd-11-stable/usr.bin/tip/tip/ |
H A D | uucplock.c | 64 int fd, len; local 70 fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660); 71 if (fd < 0) { 76 fd = open(tbuf, O_RDWR, 0); 77 if (fd < 0) { 82 len = read(fd, text_pid, sizeof(text_pid)-1); 85 (void)close(fd); 93 (void)close(fd); /* process is still running */ 102 if (lseek(fd, (off_t)0, SEEK_SET) < 0) { 104 (void)close(fd); [all...] |
/freebsd-11-stable/contrib/expat/xmlwf/ |
H A D | readfilemap.c | 84 int fd; local 89 fd = topen(name, O_RDONLY | O_BINARY); 90 if (fd < 0) { 94 if (fstat(fd, &sb) < 0) { 96 close(fd); 101 close(fd); 105 close(fd); 114 close(fd); 120 close(fd); 123 n = _EXPAT_read(fd, [all...] |
/freebsd-11-stable/sbin/sconfig/ |
H A D | sconfig.c | 240 print_modems (int fd, int need_header) argument 244 if (ioctl (fd, TIOCMGET, &status) < 0) { 261 print_ifconfig (int fd) argument 263 print_ifconfig (int fd __unused) 270 if (ioctl (fd, SERIAL_GETPROTO, &protocol) >= 0 && 305 print_stats (int fd, int need_header) argument 311 if (ioctl (fd, SERIAL_GETSTAT, &st) < 0) { 351 clear_stats (int fd) argument 353 if (ioctl (fd, SERIAL_CLRSTAT, 0) < 0) { 417 print_e1_stats (int fd, in argument 536 print_e3_stats(int fd, int need_header) argument 580 print_chan(int fd) argument 731 setup_chan(int fd, int argc, char **argv) argument 928 int fd; local 1008 int fd; local 1054 int fd, need_header, chan_num; local [all...] |
/freebsd-11-stable/usr.sbin/mfiutil/ |
H A D | mfi_patrol.c | 55 mfi_get_time(int fd, uint32_t *at) argument 58 if (mfi_dcmd_command(fd, MFI_DCMD_TIME_SECS_GET, at, sizeof(*at), NULL, 66 patrol_get_props(int fd, struct mfi_pr_properties *prop) argument 70 if (mfi_dcmd_command(fd, MFI_DCMD_PR_GET_PROPERTIES, prop, 89 int error, fd; local 92 fd = mfi_open(mfi_unit, O_RDWR); 93 if (fd < 0) { 100 mfi_get_time(fd, &at); 101 error = patrol_get_props(fd, &prop); 103 close(fd); 200 int error, fd; local 226 int error, fd; local 255 int error, fd; local [all...] |
H A D | mfi_foreign.c | 49 int ch, error, fd; local 51 fd = mfi_open(mfi_unit, O_RDWR); 52 if (fd < 0) { 65 close(fd); 69 if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_CLEAR, NULL, 0, NULL, 73 close(fd); 78 close(fd); 87 int error, fd; local 89 fd = mfi_open(mfi_unit, O_RDONLY); 90 if (fd < 112 foreign_show_cfg(int fd, uint32_t opcode, uint8_t cfgidx, int diagnostic) argument 218 int error, fd; local 288 int ch, error, fd; local [all...] |
/freebsd-11-stable/tests/sys/file/ |
H A D | ftruncate_test.c | 62 int error, fd, fds[2], i, read_only_fd; local 78 fd = open(path, O_RDWR|O_CREAT, 0600); 79 if (fd < 0) 90 if (ftruncate(fd, -1) == 0) 91 errx(1, "ftruncate(fd, -1) succeeded unexpectedly"); 93 err(1, "ftruncate(fd, -1) returned wrong error"); 97 if (ftruncate(fd, len) < 0) 99 if (fstat(fd, &sb) < 0) 105 size = pread(fd, &ch, sizeof(ch), len - 1); 120 if (ftruncate(fd, le [all...] |
/freebsd-11-stable/tools/regression/sockets/unix_cmsg/ |
H A D | t_sockcred.c | 43 t_sockcred_client(int type, int fd) argument 56 if (uc_socket_connect(fd) < 0) 63 if (uc_message_sendn(fd, &msghdr) < 0) 158 int fd, rv, rv_client; local 164 fd = uc_socket_create(); 165 if (fd < 0) 168 rv = t_sockcred_client(1, fd); 169 if (uc_socket_close(fd) < 0) 178 fd = uc_socket_create(); 179 if (fd < 200 t_sockcred_2_client(int fd) argument 206 t_sockcred_2_server(int fd) argument [all...] |
/freebsd-11-stable/contrib/ntp/ntpd/ |
H A D | ntp_signd.c | 35 int fd; local 45 fd = socket(AF_UNIX, SOCK_STREAM, 0); 46 if (fd == -1) { 50 if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { 51 close(fd); 55 return fd; 63 write_all(int fd, const void *buf, size_t len) argument 67 int n = write(fd, buf, len); 80 read_all(int fd, void *buf, size_t len) argument 84 int n = read(fd, bu 97 send_packet(int fd, const char *buf, uint32_t len) argument 109 recv_packet(int fd, char **buf, uint32_t *len) argument 146 int fd, sendlen; local [all...] |
/freebsd-11-stable/contrib/gcc/config/i386/ |
H A D | host-cygwin.c | 30 static void * cygwin_gt_pch_get_address (size_t, int fd); 52 cygwin_gt_pch_get_address (size_t sz, int fd) argument 55 off_t p = lseek(fd, 0, SEEK_CUR); 64 if ( ftruncate (fd, sz) == -1 ) 68 base = mmap (NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); 75 if (lseek (fd, p, SEEK_SET) == (off_t) -1 )
|