/freebsd-current/sbin/ipf/ipsend/ |
H A D | sockraw.c | 38 int fd; local 43 if ((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) 49 if (ioctl(fd, SIOCGIFADDR, &ifr) == -1) 58 if (bind(fd, &s, sizeof(s)) == -1) 60 return (fd); 67 int sendip(int fd, char *pkt, int len) argument 79 if (sendto(fd, pkt, len, 0, &sin, sizeof(sin)) == -1)
|
/freebsd-current/usr.sbin/mptutil/ |
H A D | mpt_config.c | 88 * leak the fd on purpose since this application is not long-running. 179 mpt_create_physdisk(int fd, struct mpt_standalone_disk *disk, U8 *PhysDiskNum) argument 186 error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, 205 error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0, 215 mpt_delete_physdisk(int fd, U8 PhysDiskNum) argument 218 return (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_PHYSDISK, 0, 0, 235 int ch, error, fd, i; local 237 fd = mpt_open(mpt_unit); 238 if (fd < 0) { 244 ioc2 = mpt_read_ioc_page(fd, 361 parse_volume(int fd, int raid_type, struct config_id_state *state, char *volume_str, struct volume_info *info) argument 442 add_drives(int fd, struct volume_info *info, int verbose) argument 504 build_volume(int fd, struct volume_info *info, int raid_type, long stripe_size, struct config_id_state *state, int verbose) argument 627 int ch, error, fd, i, quick, raid_type, verbose; local 792 int error, fd; local 836 find_volume_spare_pool(int fd, const char *name, int *pool) argument 924 int error, fd, i, nsdisks, pool; local 1022 int error, fd; local 1089 int error, fd, i, ndisks; local 1139 int error, fd; local 1221 int error, fd; local [all...] |
H A D | mpt_volume.c | 71 int error, fd; local 83 fd = mpt_open(mpt_unit); 84 if (fd < 0) { 90 error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID); 96 vnames = mpt_vol_names(fd, VolumeBus, VolumeID, NULL); 100 close(fd); 107 close(fd); 116 if (mpt_write_config_page(fd, vnames, NULL) < 0) { 120 close(fd); 125 close(fd); 139 int error, fd; local 207 int error, fd; local [all...] |
/freebsd-current/sbin/ipf/libipf/ |
H A D | ipf_dotuning.c | 14 void ipf_dotuning(int fd, char *tuneargs, ioctlfunc_t iocfn) argument 29 if ((*iocfn)(fd, SIOCIPFGETNEXT, &obj) == -1) { 30 ipf_perror_fd(fd, iocfn, 45 if ((*iocfn)(fd, SIOCIPFSET, &obj) == -1) { 46 ipf_perror_fd(fd, iocfn, 57 if ((*iocfn)(fd, SIOCIPFGET, &obj) == -1) { 58 ipf_perror_fd(fd, iocfn, "ioctl(SIOCIPFGET)");
|
/freebsd-current/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | clone_mmap_write.c | 55 int fd; local 56 if ((fd = open(source, O_RDWR | O_APPEND)) < 0) { 61 return (fd); 83 map_file(int fd, long long size) argument 85 void *p = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); 95 map_write(void *p, int fd) argument 97 if (pwrite(fd, p, 1024*128, 0) < 0) {
|
/freebsd-current/usr.sbin/mfiutil/ |
H A D | mfi_drive.c | 61 int error, fd, len; local 75 fd = mfi_open(mfi_device, O_RDWR); 76 if (fd < 0) { 82 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { 84 close(fd); 88 close(fd); 161 mfi_lookup_drive(int fd, char *drive, uint16_t *device_id) argument 203 if (mfi_pd_get_list(fd, &list, NULL) < 0) { 251 mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp) argument 266 if (mfi_dcmd_command(fd, MFI_DCMD_PD_GET_LIS 282 mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info, uint8_t *statusp) argument 387 int error, fd; local 496 int error, fd; local 553 int error, fd; local 609 int error, fd; local 664 int error, fd; local 724 int error, fd; local [all...] |
/freebsd-current/tools/test/stress2/testcases/lockf2/ |
H A D | lockf2.c | 49 static int fd; variable 84 if ((fd = open(file,O_CREAT | O_TRUNC | O_RDWR, 0600)) == -1) 88 if (write(fd, &buf, sizeof(buf)) != sizeof(buf)) 90 close(fd); 107 if ((fd = open(file, O_RDWR, 0600)) == -1) 112 if (lseek(fd, pos, SEEK_SET) == -1) 118 r = lockf(fd, F_LOCK, size); 123 if (lockf(fd, F_ULOCK, size) == -1) 127 close(fd);
|
/freebsd-current/tests/sys/cddl/zfs/bin/ |
H A D | rm_lnkcnt_zero_file.c | 93 int *fd = (int *)a; local 96 (void) close (*fd); 97 *fd = open(filebase, O_APPEND | O_RDWR | O_CREAT, 0644); 98 if (*fd < 0) 100 (void) write(*fd, "test\n", 5); 109 int fd; local 118 fd = open(filebase, O_APPEND | O_RDWR | O_CREAT, 0644); 119 if (fd < 0) { 130 (void) pthread_create(&tid, NULL, writer, (void *) &fd);
|
/freebsd-current/contrib/libarchive/libarchive/ |
H A D | archive_write_open_fd.c | 53 int fd; member in struct:write_fd_data 61 archive_write_open_fd(struct archive *a, int fd) argument 70 mine->fd = fd; 72 setmode(mine->fd, O_BINARY); 86 if (fstat(mine->fd, &st) != 0) { 87 archive_set_error(a, errno, "Couldn't stat fd %d", mine->fd); 106 S_ISFIFO(st.st_mode) || (mine->fd == 1)) 124 bytesWritten = write(mine->fd, buf [all...] |
/freebsd-current/contrib/ofed/librdmacm/ |
H A D | preload.c | 90 int (*fxstat)(int ver, int fd, struct stat *buf); 120 int fd; member in struct:fd_info 285 static void fd_store(int index, int fd, enum fd_type type, enum fd_fork_state state) argument 290 fdi->fd = fd; 295 static inline enum fd_type fd_get(int index, int *fd) argument 301 *fd = fdi->fd; 305 *fd = index; 315 return fdi ? fdi->fd 334 fd_close(int index, int *fd) argument 568 int fd; local 575 int fd, ret; local 588 int fd, index, ret; local 746 fd_fork_get(int index, int *fd) argument 767 int fd, ret; local 789 int fd; local 797 int fd; local 805 int fd; local 812 int fd; local 820 int fd; local 828 int fd; local 836 int fd; local 844 int fd; local 851 int fd; local 859 int fd; local 916 int fd, events, i = 0; local 935 int fd, rfd, i, cnt = 0; local 995 int fd; local 1028 int fd; local 1036 int fd; local 1046 int fd; local 1055 int fd; local 1066 int fd, ret; local 1156 int fd; local 1175 int fd, ret; local [all...] |
/freebsd-current/contrib/libevent/ |
H A D | changelist-internal.h | 30 A "changelist" is a list of all the fd status changes that should be made 40 2) Sometimes we can coalesce multiple changes on the same fd into a single 54 /** The fd or signal whose events are to be changed */ 55 evutil_socket_t fd; member in struct:event_change 56 /* The events that were enabled on the fd before any of these changes 60 /* The changes that we want to make in reading and writing on this fd. 74 /* If set, this event refers a signal, not an fd. */ 96 int event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events, 99 int event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
|
/freebsd-current/contrib/ncurses/include/ |
H A D | ncurses_mingw.h | 70 int fd, 74 int fd, 77 int fd,
|
/freebsd-current/contrib/netbsd-tests/kernel/kqueue/read/ |
H A D | t_file.c | 61 int i, n, fd; local 66 fd = open(FILENAME, O_WRONLY|O_APPEND, 0644); 67 if (fd < 0) 70 n = write(fd, "foo\n", 4); 74 (void)close(fd); 90 int fd, kq, n, num, status; local 98 RL(fd = open(FILENAME, O_RDONLY|O_CREAT, 0644)); 101 RL(lseek(fd, 0, SEEK_END)); 106 EV_SET(&event[0], fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0); 123 RL(lseek(fd, [all...] |
/freebsd-current/contrib/netbsd-tests/lib/libc/c063/ |
H A D | t_symlinkat.c | 57 atf_tc_set_md_var(tc, "descr", "See that symlinkat works with fd"); 61 int dfd, fd; local 66 ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); 67 ATF_REQUIRE(close(fd) != -1); 82 "See that symlinkat works with fd as AT_FDCWD"); 86 int fd; local 91 ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1); 92 ATF_REQUIRE(close(fd) != -1); 105 "See that symlinkat works with fd as AT_FDCWD and bad path"); 109 int fd; local 131 int fd; local [all...] |
H A D | t_mknodat.c | 67 atf_tc_set_md_var(tc, "descr", "See that mknodat works with fd"); 73 int fd; local 80 ATF_REQUIRE((fd = mknodat(dfd, BASEFILE, mode, dev)) != -1); 81 ATF_REQUIRE(close(fd) == 0); 90 "See that mknodat works with fd as AT_FDCWD"); 95 int fd; local 101 ATF_REQUIRE((fd = mknodat(AT_FDCWD, FILE, mode, dev)) != -1); 102 ATF_REQUIRE(close(fd) == 0); 110 "See that mknodat fails with fd as AT_FDCWD and bad path"); 115 int fd; local 131 int fd; local [all...] |
/freebsd-current/contrib/ntp/libntp/ |
H A D | icom.c | 23 #define write(fd, data, octets) async_write(fd, data, octets) 64 * icom_freq(fd, ident, freq) - load radio frequency 73 int fd, /* file descriptor */ 89 rc = write(fd, cmd, temp + 7); 145 int fd; local 149 fd = tty_open(device, O_RDWR, 0777); 150 if (fd < 0) 153 rc = tcgetattr(fd, &ttyb); 156 close(fd); 72 icom_freq( int fd, int ident, double freq ) argument [all...] |
/freebsd-current/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_chroot.c | 56 int fd, sta; local 82 fd = open("file", O_RDONLY | O_CREAT, 0600); 84 if (fd < 0) 87 if (close(fd) != 0) 101 fd = open(buf, O_RDONLY); 103 if (fd < 0) 106 ATF_REQUIRE(close(fd) == 0); 182 int fd, sta; local 192 fd = open(buf, O_RDONLY); 193 ATF_REQUIRE(fd > 243 int fd; local 268 int fd, sta; local [all...] |
H A D | t_mmap.c | 176 int fd = -1; local 188 if ((fd = open(dev, O_RDONLY)) >= 0) { 195 if (fd < 0) 198 map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0); 202 ATF_REQUIRE(close(fd) == 0); 249 int fd; local 251 fd = open(path, O_RDWR | O_CREAT, 0600); 252 ATF_REQUIRE(fd >= 0); 255 (void)write(fd, buf, sizeof(buf)); 258 MAP_FILE | MAP_PRIVATE, fd, 298 int fd; local 369 int fd, sta; local 433 int fd; local 480 int fd, sta; local [all...] |
/freebsd-current/contrib/netbsd-tests/lib/libc/ssp/ |
H A D | h_read.c | 45 int fd, n; local 48 if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1) 50 if ((n = read(fd, b, len)) == -1)
|
/freebsd-current/crypto/heimdal/appl/ftp/common/ |
H A D | sockbuf.c | 45 set_buffer_size(int fd, int read) argument 56 if(getsockopt(fd, SOL_SOCKET, optname, (void *)&curr, &optlen) == 0) { 65 setsockopt(fd, SOL_SOCKET, optname, (void *)&size, sizeof(size)) < 0)
|
/freebsd-current/contrib/ntp/sntp/libevent/ |
H A D | changelist-internal.h | 30 A "changelist" is a list of all the fd status changes that should be made 40 2) Sometimes we can coalesce multiple changes on the same fd into a single 54 /** The fd or signal whose events are to be changed */ 55 evutil_socket_t fd; member in struct:event_change 56 /* The events that were enabled on the fd before any of these changes 60 /* The changes that we want to make in reading and writing on this fd. 74 /* If set, this event refers a signal, not an fd. */ 96 int event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events, 99 int event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
|
/freebsd-current/tools/test/stress2/misc/ |
H A D | unlink.sh | 31 int fd; 34 fd = open("nosync.data", O_RDWR | O_CREAT, 0600); 35 if (fd == -1) 39 if (ftruncate(fd, sz) == -1) 42 MAP_SHARED | MAP_NOSYNC, fd, 0); 49 close(fd);
|
/freebsd-current/contrib/llvm-project/lldb/include/lldb/Host/ |
H A D | FileAction.h | 30 bool Close(int fd); 32 bool Duplicate(int fd, int dup_fd); 34 bool Open(int fd, const FileSpec &file_spec, bool read, bool write);
|
/freebsd-current/sys/contrib/openzfs/tests/zfs-tests/tests/functional/libzfs/ |
H A D | many_fds.c | 46 int fd = open("/dev/null", O_RDONLY); local 47 if (fd == -1) 50 if (dup(fd) == -1)
|
/freebsd-current/lib/libopenbsd/ |
H A D | imsg.c | 36 imsg_init(struct imsgbuf *ibuf, int fd) argument 40 ibuf->fd = fd; 41 ibuf->w.fd = fd; 57 int fd; local 82 if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) { 100 * more than one fd, and we must close them. 105 fd = ((int *)CMSG_DATA(cmsg))[i]; 107 ifd->fd 166 imsg_compose(struct imsgbuf *ibuf, u_int32_t type, u_int32_t peerid, pid_t pid, int fd, const void *data, u_int16_t datalen) argument 185 imsg_composev(struct imsgbuf *ibuf, u_int32_t type, u_int32_t peerid, pid_t pid, int fd, const struct iovec *iov, int iovcnt) argument 272 int fd; local 297 int fd; local [all...] |