/freebsd-11-stable/stand/common/ |
H A D | ls.c | 61 int fd; local 70 fd = -1; 106 fd = ls_getdir(&path); 107 if (fd == -1) { 115 while ((d = readdirfd(fd)) != NULL) { 146 if (fd != -1) 147 close(fd); 153 * Given (path) containing a vaguely reasonable path specification, return an fd 160 int fd; local 164 fd [all...] |
/freebsd-11-stable/contrib/netbsd-tests/kernel/ |
H A D | t_lockf.c | 73 int i, fd; local 77 fd = open (lockfile, O_RDWR, 0); 79 if (fd < 0) 102 (void)fcntl(fd, F_SETLKW, &fl); 111 close (fd); 124 int i, j, fd; local 133 fd = open (lockfile, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0666); 134 ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", lockfile, strerror(errno)); 136 ATF_REQUIRE_MSG(ftruncate(fd, filesize) >= 0, 141 fsync(fd); 194 dolock(int fd, int op, off_t lk_off, off_t lk_size) argument 221 int fd; local [all...] |
/freebsd-11-stable/lib/libc/gen/ |
H A D | pututxline.c | 48 int fd; local 50 fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK|O_CLOEXEC, 0644); 51 if (fd < 0) 55 if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) { 56 _close(fd); 61 fp = fdopen(fd, "r+"); 63 _close(fd); 181 int fd; local 184 fd = _open(_PATH_UTX_ACTIVE, O_CREAT|O_RDWR|O_TRUNC, 0644); 185 if (fd < 239 int fd; local 259 int error, fd; local [all...] |
/freebsd-11-stable/usr.sbin/iovctl/ |
H A D | iovctl.c | 56 get_schema(int fd) argument 66 error = ioctl(fd, IOV_GET_SCHEMA, &arg); 76 error = ioctl(fd, IOV_GET_SCHEMA, &arg); 95 config_iov(int fd, const char *dev_name, const nvlist_t *config, int dryrun) argument 113 error = ioctl(fd, IOV_CONFIG, &arg); 125 int fd; local 147 fd = open(dev, O_RDWR); 148 if (fd < 0) 152 return (fd); 275 int fd; local 298 int fd, error; local 380 int fd; local [all...] |
/freebsd-11-stable/usr.sbin/ofwdump/ |
H A D | ofwdump.c | 53 static void ofw_dump_property(int fd, phandle_t n, int level, 70 int opt, i, fd; local 117 fd = ofw_open(O_RDONLY); 121 ofw_dump(fd, NULL, rflag, pflag, Parg, Rflag, Sflag); 128 ofw_dump(fd, argv[i], rflag, pflag, Parg, Rflag, Sflag); 130 ofw_close(fd); 144 ofw_dump_properties(int fd, phandle_t n, int level, int raw, int str) argument 149 for (nlen = ofw_firstprop(fd, n, prop, sizeof(prop)); nlen != 0; 150 nlen = ofw_nextprop(fd, n, prop, prop, sizeof(prop))) 151 ofw_dump_property(fd, 155 ofw_dump_property(int fd, phandle_t n, int level, const char *prop, int raw, int str) argument 211 ofw_dump_node(int fd, phandle_t n, int level, int rec, int prop, const char *pmatch, int raw, int str) argument 243 ofw_dump(int fd, const char *start, int rec, int prop, const char *pmatch, int raw, int str) argument [all...] |
/freebsd-11-stable/bin/sh/ |
H A D | input.c | 83 int fd; /* file descriptor (or -1 if string) */ member in struct:parsefile 138 if (parsefile->fd == 0 && el) { 161 nr = read(parsefile->fd, parsefile->buf, BUFSIZ); 167 if (parsefile->fd == 0 && errno == EWOULDBLOCK) { 253 if (parsefile->fd == 0 && hist && 360 int fd; local 364 if ((fd = open(fname, O_RDONLY | O_CLOEXEC)) < 0) 366 if (fd < 10) { 367 fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 10); 368 close(fd); 384 setinputfd(int fd, int push) argument [all...] |
/freebsd-11-stable/crypto/heimdal/lib/krb5/ |
H A D | fcache.c | 44 int fd; member in struct:fcc_cursor 72 _krb5_xlock(krb5_context context, int fd, krb5_boolean exclusive, argument 83 ret = fcntl(fd, F_SETLKW, &l); 85 ret = flock(fd, exclusive ? LOCK_EX : LOCK_SH); 116 _krb5_xunlock(krb5_context context, int fd) argument 125 ret = fcntl(fd, F_SETLKW, &l); 127 ret = flock(fd, LOCK_UN); 149 write_storage(krb5_context context, krb5_storage *sp, int fd) argument 160 sret = write(fd, data.data, data.length); 175 int fd, krb5_boolea 174 fcc_lock(krb5_context context, krb5_ccache id, int fd, krb5_boolean exclusive) argument 181 fcc_unlock(krb5_context context, int fd) argument 214 scrub_file(int fd) argument 250 int fd; local 316 int fd; local 390 int fd; local 423 int fd; local 503 int fd; local 544 int fd; local 693 int fd; local 802 int fd; local 1026 int fd; local 1053 int fd; local 1080 int fd; local [all...] |
/freebsd-11-stable/sbin/clri/ |
H A D | clri.c | 82 int i, fd, inonum; local 93 if ((fd = open(fs, O_RDWR, 0)) < 0) 96 if (lseek(fd, (off_t)(sblock_try[i]), SEEK_SET) < 0) 98 if (read(fd, sblock, sizeof(sblock)) != sizeof(sblock)) 125 if (lseek(fd, offset, SEEK_SET) < 0) 127 if (read(fd, ibuf, bsize) != bsize) 151 if (lseek(fd, (off_t)-bsize, SEEK_CUR) < 0) 153 if (write(fd, ibuf, bsize) != bsize) 155 (void)fsync(fd); 157 (void)close(fd); [all...] |
/freebsd-11-stable/tools/tools/bootparttest/ |
H A D | bootparttest.c | 66 int fd; member in struct:disk 83 ret = pread(disk.fd, buf, size, 106 disk.fd = open(argv[1], O_RDONLY); 107 if (disk.fd < 0) 113 disk.fd = g_open(argv[1], 0); 114 if (disk.fd < 0) 116 disk.mediasize = g_mediasize(disk.fd); 117 disk.sectorsize = g_sectorsize(disk.fd); 134 close(disk.fd); 136 g_close(disk.fd); [all...] |
/freebsd-11-stable/contrib/netbsd-tests/fs/fifofs/ |
H A D | t_fifo.c | 38 int fd; local 45 fd = open(FIFO_FILE_PATH, O_WRONLY, 0); 46 if (fd == -1) { 55 rv = write(fd, message, MSG_SIZE); 65 close(fd); 96 int fd, status; local 122 if ((fd = open(FIFO_FILE_PATH, O_WRONLY, 0)) == -1) 140 if ((fd = open(FIFO_FILE_PATH, O_RDONLY, 0)) == -1) { 158 rv = read(fd, buf, buf_size); 189 close(fd); [all...] |
/freebsd-11-stable/contrib/netbsd-tests/fs/nullfs/ |
H A D | t_basic.c | 34 int fd; local 36 fd = rump_sys_open(path, O_CREAT | O_RDWR, 0777); 37 if (fd == -1) 39 if (rump_sys_write(fd, MSTR, sizeof(MSTR)) != sizeof(MSTR)) 41 rump_sys_close(fd); 48 int fd; local 50 fd = rump_sys_open(path, O_RDONLY); 51 if (fd == -1) 53 if (rump_sys_read(fd, buf, sizeof(buf)) == -1) 55 rump_sys_close(fd); [all...] |
/freebsd-11-stable/usr.bin/dc/ |
H A D | dc.c | 63 procfd(int fd, char *fname) { argument 67 file = fdopen(fd, "r"); 85 int ch, fd; local 102 fd = open(optarg, O_RDONLY); 103 if (fd < 0) 105 procfd(fd, optarg); 134 fd = open(argv[0], O_RDONLY); 135 if (fd < 0) 138 if (caph_limit_stream(fd, CAPH_READ) < 0 || 143 procfd(fd, arg [all...] |
/freebsd-11-stable/usr.sbin/mpsutil/ |
H A D | mps_show.c | 72 int error, fd, v, i; local 79 fd = mps_open(mps_unit); 80 if (fd < 0) { 86 man0 = mps_read_man_page(fd, 0, NULL); 103 bios3 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_BIOS, 3, 0, NULL); 115 if ((facts = mps_get_iocfacts(fd)) == NULL) { 117 close(fd); 129 fd = mps_open(mps_unit); 130 if (fd < 0) { 136 sas0 = mps_read_extended_config_page(fd, 205 int error, fd; local 254 int unit, fd, error; local 451 int fd, error, nphys; local 569 int fd, error, issep; local 620 int fd, error, nphys, i; local 714 int fd, error, len, attrs; local [all...] |
H A D | mpsutil.h | 109 int mps_user_command(int fd, void *req, uint32_t req_len, void *reply, 111 int mps_pass_command(int fd, void *req, uint32_t req_len, void *reply, 114 int mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, 116 int mps_read_ext_config_page_header(int fd, U8 ExtPageType, U8 PageNumber, 119 void *mps_read_config_page(int fd, U8 PageType, U8 PageNumber, 121 void *mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, 123 int mps_map_btdh(int fd, uint16_t *devhandle, uint16_t *bus, 126 int mps_firmware_send(int fd, unsigned char *buf, uint32_t len, bool bios); 127 int mps_firmware_get(int fd, unsigned char **buf, bool bios); 130 mps_read_man_page(int fd, U argument 138 mps_read_ioc_page(int fd, U8 PageNumber, U16 *IOCStatus) argument [all...] |
/freebsd-11-stable/usr.sbin/cpucontrol/ |
H A D | cpucontrol.c | 144 int fd, error; local 161 fd = open(dev, O_RDONLY); 162 if (fd < 0) { 166 error = ioctl(fd, CPUCTL_CPUID, &args); 169 close(fd); 174 close(fd); 184 int fd, error; local 211 fd = open(dev, O_RDONLY); 212 if (fd < 0) { 216 error = ioctl(fd, CPUCTL_CPUID_COUN 238 int fd, error; local 347 int fd, error; local 366 int fd; local [all...] |
/freebsd-11-stable/contrib/apr-util/test/ |
H A D | testxml.c | 24 apr_file_t **fd) 31 rv = apr_file_mktemp(fd, template, APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_DELONCLOSE | 39 "<had a=\"little\"/><lamb/>\n", *fd); 44 "for=\"dinner\">yummy</hmm>\n", *fd); 48 rv = apr_file_puts("</mary>\n", *fd); 51 rv = apr_file_seek(*fd, APR_SET, &off); 58 apr_file_t **fd) 65 rv = apr_file_mktemp(fd, template, APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_DELONCLOSE | 72 rv = apr_file_puts("<?xml version=\"1.0\" ?>\n<mary>\n", *fd); 77 "for=\"dinner <>=\">yummy</hmm>\n", *fd); 23 create_dummy_file_error(abts_case *tc, apr_pool_t *p, apr_file_t **fd) argument 57 create_dummy_file(abts_case *tc, apr_pool_t *p, apr_file_t **fd) argument 122 apr_file_t *fd; local 153 apr_file_t *fd; local [all...] |
/freebsd-11-stable/bin/cat/ |
H A D | cat.c | 167 int fd, i; local 172 fd = -1; 176 fd = STDIN_FILENO; 179 fd = open(path, O_RDONLY); 181 if (fd < 0 && errno == EOPNOTSUPP) 182 fd = udom_open(path, O_RDONLY); 185 if (fd < 0) { 189 if (fd == STDIN_FILENO) 192 fp = fdopen(fd, "r"); 197 raw_cat(fd); 333 int fd = -1; local [all...] |
/freebsd-11-stable/usr.sbin/nandsim/ |
H A D | nandsim.c | 239 opendev(int *fd) argument 242 *fd = open(SIMDEVICE, O_RDWR); 243 if (*fd == -1) { 283 int chip = 0, ctl = 0, err = 0, fd, idx, idx2, start, stop; local 301 if (opendev(&fd) != EX_OK) 311 err = ioctl(fd, NANDSIM_STATUS_CTRL, &ctrlconf); 324 err = ioctl(fd, NANDSIM_STATUS_CHIP, &chipconf); 334 close(fd); 353 int chip = 0, ctl = 0, err = 0, fd, running, state; local 374 if (opendev(&fd) ! 390 int chip = 0, ctl = 0, err = 0, fd, running; local 420 int chip, ctl, err = 0, fd = -1, i; local 522 int chip = 0, ctl = 0, err = 0, fd; local 569 int c, cdevd, chip = 0, ctl = 0, err = 0, fd, idx; local 664 int chip = 0, ctl = 0, err = 0, fd, i, start = 0, state, stop = 0; local 721 int chip = 0, ctl = 0, err = 0, fd, idx, start = 0, stop = 0; local 809 int chip = 0, ctl = 0, err = EX_OK, fd, dumpfd; local 937 int chip = 0, ctl = 0, err = 0, fd, dumpfd = -1; local 1075 int chip = 0, ctl = 0, err = 0, fd, idx, idx2, state; local 1260 int err, fd; local 1281 int err, fd; local 1303 int err, fd; local [all...] |
/freebsd-11-stable/contrib/libarchive/libarchive/ |
H A D | archive_read_open_fd.c | 54 int fd; member in struct:read_fd_data 66 archive_read_open_fd(struct archive *a, int fd, size_t block_size) argument 73 if (fstat(fd, &st) != 0) { 74 archive_set_error(a, errno, "Can't stat fd %d", fd); 88 mine->fd = fd; 101 setmode(mine->fd, O_BINARY); 120 bytes_read = read(mine->fd, mine->buffer, mine->block_size); 124 archive_set_error(a, errno, "Error reading fd [all...] |
/freebsd-11-stable/crypto/openssh/ |
H A D | monitor_fdpass.c | 52 mm_send_fd(int sock, int fd) argument 70 msg.msg_accrights = (caddr_t)&fd; 71 msg.msg_accrightslen = sizeof(fd); 80 *(int *)CMSG_DATA(cmsg) = fd; 88 pfd.fd = sock; 92 debug3("%s: sendmsg(%d): %s", __func__, fd, strerror(errno)); 96 error("%s: sendmsg(%d): %s", __func__, fd, 127 int fd; local 136 msg.msg_accrights = (caddr_t)&fd; 137 msg.msg_accrightslen = sizeof(fd); [all...] |
/freebsd-11-stable/contrib/netbsd-tests/fs/vfs/ |
H A D | t_ro.c | 62 int fd; local 65 RL(fd = rump_sys_open(AFILE, O_CREAT | O_RDWR, 0777)); 66 ATF_REQUIRE_EQ(rump_sys_write(fd, FUNTEXT, FUNSIZE), FUNSIZE); 67 RL(rump_sys_close(fd)); 98 int fd; local 108 RL(fd = rump_sys_open(AFILE, O_RDONLY)); 109 ATF_REQUIRE_EQ(rump_sys_read(fd, buf, FUNSIZE), FUNSIZE); 112 RL(rump_sys_close(fd)); 124 int fd; local 135 RL(fd [all...] |
/freebsd-11-stable/usr.sbin/mfiutil/ |
H A D | mfi_flash.c | 48 display_pending_firmware(int fd) argument 55 if (mfi_ctrl_get_info(fd, &info, NULL) < 0) { 96 int error, fd, flash; local 112 fd = -1; 125 fd = mfi_open(mfi_unit, O_RDWR); 126 if (fd < 0) { 134 mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4, &status); 153 mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0, 160 mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_DOWNLOAD, buf, nread, 164 mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOS [all...] |
H A D | mfi_bbu.c | 108 mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp) argument 111 return (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_PROP, props, 116 mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp) argument 119 return (mfi_dcmd_command(fd, MFI_DCMD_BBU_SET_PROP, props, 127 int error, fd; local 137 fd = mfi_open(mfi_unit, O_RDWR); 138 if (fd < 0) { 144 if (mfi_dcmd_command(fd, MFI_DCMD_BBU_START_LEARN, NULL, 0, NULL, 0, 163 int error, fd; local 174 fd [all...] |
/freebsd-11-stable/contrib/ipfilter/tools/ |
H A D | ipfs.c | 93 int fd, olen, nlen, rw; local 108 fd = open(fname, O_RDWR); 109 if (fd == -1) { 114 for (pos = 0; read(fd, &ips, sizeof(ips)) == sizeof(ips); ) { 133 if (lseek(fd, pos, SEEK_SET) != pos) { 137 if (write(fd, &ips, sizeof(ips)) != sizeof(ips)) { 142 pos = lseek(fd, 0, SEEK_CUR); 144 close(fd); 156 int fd, olen, nlen, rw; local 173 fd 341 int fd = -1; local 783 int fd, devfd; local 834 int fd, devfd; local [all...] |
/freebsd-11-stable/contrib/gdb/gdb/ |
H A D | event-loop.c | 56 int fd; /* File descriptor that is ready. */ member in struct:gdb_event 65 int fd; /* File descriptor. */ member in struct:file_handler 69 handler_func *proc; /* Procedure to call when fd is ready. */ 71 int error; /* Was an error detected on this fd? */ 121 in, for each fd. */ 156 /* Number of valid bits (highest fd value + 1). (for select) */ 209 static void create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data); 215 static gdb_event *create_file_event (int fd); 262 create_file_event (int fd) 268 file_event_ptr->fd 261 create_file_event(int fd) argument 285 int fd; local 434 add_file_handler(int fd, handler_func * proc, gdb_client_data client_data) argument 481 create_file_handler(int fd, int mask, handler_func * proc, gdb_client_data client_data) argument 554 delete_file_handler(int fd) argument [all...] |