/freebsd-current/sys/dev/fdc/ |
H A D | fdc.c | 93 /* configuration flags for fd */ 308 fdsettype(struct fd_data *fd, struct fd_type *ft) argument 310 fd->ft = ft; 312 fd->sectorsize = 128 << fd->ft->secsize; 559 if (fdc_cmd(fdc, 2, NE7CMD_SENSED, fdc->fd->fdsu, 1, &st3)) 620 fd_select(struct fd_data *fd) argument 625 fdc = fd->fdc; 627 fdc->fdout |= FDO_FDMAEN | FDO_FRST | fd->fdsu; 634 struct fd_data *fd; local 655 fd_motor(struct fd_data *fd, int turnon) argument 678 struct fd_data *fd = xfd; local 731 struct fd_data *fd; local 760 struct fd_data *fd; local 1178 fd_enqueue(struct fd_data *fd, struct bio *bp) argument 1204 fd_probe_disk(struct fd_data *fd, int *recal) argument 1266 fdmisccmd(struct fd_data *fd, u_int cmd, void *data) argument 1317 fdautoselect(struct fd_data *fd) argument 1410 struct fd_data *fd; local 1465 struct fd_data * fd; local 1490 struct fd_data *fd; local 1887 struct fd_data *fd; local 2018 struct fd_data *fd; local 2032 struct fd_data *fd; local 2045 struct fd_data *fd; local 2055 struct fd_data *fd = arg; local 2064 struct fd_data *fd; local [all...] |
/freebsd-current/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-current/crypto/heimdal/lib/krb5/ |
H A D | crypto-rand.c | 48 int fd; local 49 fd = open(seedfile, O_RDONLY | O_BINARY | O_CLOEXEC); 50 if (fd >= 0) { 52 rk_cloexec(fd); 53 ret = read(fd, buf, sizeof(buf)); 56 close(fd);
|
/freebsd-current/tools/test/stress2/misc/ |
H A D | fpclone2.sh | 85 int fd; 90 if ((fd = open("/dev/fpclone", O_RDONLY)) == -1) 92 if (read(fd, buf, sizeof(buf)) <= 0) 94 if (dup2(fd, 10) == -1) 96 if (dup2(fd, 11) == -1) 98 if (dup2(fd, 12) == -1) 100 if (close(fd) == -1) 101 err(1, "close(%d)", fd); 109 if ((fd = open("/dev/fpclone", O_WRONLY)) == -1) 111 if (write(fd, "xx [all...] |
H A D | mkfifo5.sh | 81 int fd, n, r; 85 if((fd = open(path, O_RDONLY)) == -1) 89 if (fd == -1) 91 } while (fd == -1); 95 FD_SET(fd, &rset); 96 if ((n = select(fd + 1, &rset, NULL, NULL, NULL)) < 0) 99 if (n == 1 && FD_ISSET(fd, &rset)) { 100 r = read(fd, &ch, 1); 110 FD_SET(fd, &rset); 113 if ((n = select(fd [all...] |
/freebsd-current/contrib/libfido2/openbsd-compat/ |
H A D | posix_win.c | 36 posix_close(int fd) argument 38 return (close(fd)); 42 posix_read(int fd, void *buf, size_t count) argument 49 return (read(fd, buf, (unsigned int)count)); 53 posix_write(int fd, const void *buf, size_t count) argument 60 return (write(fd, buf, (unsigned int)count));
|
/freebsd-current/contrib/llvm-project/lldb/include/lldb/Utility/ |
H A D | SelectHelper.h | 33 // cause FD_SET() to be called prior to calling select using the "fd" 35 void FDSetRead(lldb::socket_t fd); 36 void FDSetWrite(lldb::socket_t fd); 37 void FDSetError(lldb::socket_t fd); 43 bool FDIsSetRead(lldb::socket_t fd) const; 44 bool FDIsSetWrite(lldb::socket_t fd) const; 45 bool FDIsSetError(lldb::socket_t fd) const;
|
/freebsd-current/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | dosmode_readonly_write.c | 28 * We should be able to open a file RW, set READONLY, and still write to the fd. 47 const char *buf = "We should be allowed to write this to the fd.\n"; 49 int fd; local 56 fd = open(path, O_CREAT|O_RDWR, 0777); 57 if (fd == -1) 61 if (ioctl(fd, ZFS_IOC_SETDOSFLAGS, &dosflags) == -1) 67 if (write(fd, buf, strlen(buf)) == -1) 69 if (close(fd) == -1)
|
H A D | getversion.c | 35 int fd = open(argv[1], O_RDONLY); local 36 if (fd == -1) 40 if (ioctl(fd, FS_IOC_GETVERSION, &gen) == -1) 43 (void) close(fd);
|
H A D | mmap_exec.c | 41 int error, fd; local 53 if ((fd = open(argv[1], O_RDONLY)) < 0) { 58 if (fstat(fd, &statbuf) < 0) { 65 PROT_EXEC, MAP_SHARED, fd, 0) == MAP_FAILED) {
|
/freebsd-current/lib/libulog/ |
H A D | ulog_login_pseudo.c | 46 ulog_exec_helper(int fd, char const * const argv[]) argument 62 if (dup2(fd, STDIN_FILENO) == -1) 79 ulog_login_pseudo(int fd, const char *host) argument 83 ulog_exec_helper(fd, args); 87 ulog_logout_pseudo(int fd) argument 91 ulog_exec_helper(fd, args);
|
/freebsd-current/tests/sys/ses/ |
H A D | common.h | 26 typedef bool(*ses_cb)(const char *devname, int fd); 46 int fd; local 48 fd = open(g.gl_pathv[i], oflags); 49 ATF_REQUIRE(fd >= 0); 50 cb(g.gl_pathv[i], fd); 51 close(fd);
|
/freebsd-current/sbin/nvmecontrol/ |
H A D | reset.c | 56 int fd; local 62 open_dev(opt.dev, &fd, 1, 1); 63 get_nsid(fd, &path, &nsid); 65 close(fd); 66 open_dev(path, &fd, 1, 1); 70 if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
|
/freebsd-current/lib/libc/stdio/ |
H A D | tmpfile.c | 52 int fd, sverrno; local 69 fd = mkstemp(buf); 70 if (fd != -1) 77 if (fd == -1) 80 if ((fp = fdopen(fd, "w+")) == NULL) { 82 (void)_close(fd);
|
/freebsd-current/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ |
H A D | stat.h | 44 fstat64(int fd, struct stat *sb) argument 48 ret = fstat(fd, sb); 51 (void) ioctl(fd, DIOCGMEDIASIZE, &sb->st_size); 61 fstat64_blk(int fd, struct stat64 *st) argument 63 if (fstat64(fd, st) == -1) 68 if (ioctl(fd, BLKGETSIZE64, &st->st_size) != 0)
|
/freebsd-current/tools/test/stress2/tools/ |
H A D | serial.c | 15 int fd; local 25 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0) 28 if (lseek(fd, size - 1, SEEK_SET) == -1) 32 if (write(fd, "\0", 1) != 1) 35 if ((cp = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) 43 close(fd);
|
/freebsd-current/lib/libc/sys/ |
H A D | shm_open.c | 56 int error, fd, saved_errno; local 58 fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL); 59 if (fd == -1) 65 error = ioctl(fd, FIOSSHMLPGCNF, &slc); 68 close(fd); 72 return (fd);
|
/freebsd-current/contrib/llvm-project/compiler-rt/lib/tsan/rtl/ |
H A D | tsan_fd.cpp | 51 static bool bogusfd(int fd) { argument 52 // Apparently a bogus fd value. 53 return fd < 0 || fd >= kTableSize; 80 static FdDesc *fddesc(ThreadState *thr, uptr pc, int fd) { argument 81 CHECK_GE(fd, 0); 82 CHECK_LT(fd, kTableSize); 83 atomic_uintptr_t *pl1 = &fdctx.tab[fd / kTableSizeL2]; 97 return &fds[fd % kTableSizeL2]; 101 static void init(ThreadState *thr, uptr pc, int fd, FdSyn argument 160 FdLocation(uptr addr, int *fd, Tid *tid, StackID *stack, bool *closed) argument 178 FdAcquire(ThreadState *thr, uptr pc, int fd) argument 189 FdRelease(ThreadState *thr, uptr pc, int fd) argument 202 FdAccess(ThreadState *thr, uptr pc, int fd) argument 210 FdClose(ThreadState *thr, uptr pc, int fd, bool write) argument 253 FdFileCreate(ThreadState *thr, uptr pc, int fd) argument 279 FdEventCreate(ThreadState *thr, uptr pc, int fd) argument 286 FdSignalCreate(ThreadState *thr, uptr pc, int fd) argument 293 FdInotifyCreate(ThreadState *thr, uptr pc, int fd) argument 300 FdPollCreate(ThreadState *thr, uptr pc, int fd) argument 307 FdPollAdd(ThreadState *thr, uptr pc, int epfd, int fd) argument 331 FdSocketCreate(ThreadState *thr, uptr pc, int fd) argument 339 FdSocketAccept(ThreadState *thr, uptr pc, int fd, int newfd) argument 348 FdSocketConnecting(ThreadState *thr, uptr pc, int fd) argument 356 FdSocketConnect(ThreadState *thr, uptr pc, int fd) argument [all...] |
/freebsd-current/crypto/heimdal/lib/roken/ |
H A D | cloexec.c | 39 rk_cloexec(int fd) argument 44 ret = fcntl(fd, F_GETFD); 47 if (fcntl(fd, F_SETFD, ret | FD_CLOEXEC) == -1)
|
/freebsd-current/crypto/openssh/ |
H A D | sshbuf-io.c | 32 /* Load a file from a fd into a buffer */ 34 sshbuf_load_fd(int fd, struct sshbuf **blobp) argument 44 if (fstat(fd, &st) == -1) 52 if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) { 83 int r, fd, oerrno; local 86 if ((fd = open(path, O_RDONLY)) == -1) 88 if ((r = sshbuf_load_fd(fd, bufp)) != 0) 94 close(fd); 103 int fd, oerrno; local 105 if ((fd [all...] |
/freebsd-current/contrib/sendmail/libsm/ |
H A D | notify.h | 39 #define RDNETSTR(rc, fd, SM_NOTIFY_EOF) \ 47 if (!FD_ISSET(fd, &readfds)) \ 49 SM_DBG((stderr, "pid=%ld, fd=%d, isset=false\n", (long)getpid(), fd)); \ 52 r = read(fd, buf, NETSTRPRE); \ 55 SM_DBG((stderr, "pid=%ld, fd=%d, read1=EOF, e=%d\n", (long)getpid(), fd, errno)); \ 61 SM_DBG((stderr, "pid=%ld, fd=%d, read1=%d, e=%d\n", (long)getpid(), fd, r, errno)); \ 85 r = read(fd, bu [all...] |
/freebsd-current/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_dup.c | 60 int fd, fd1, fd2; local 78 fd = dup(fd1); 80 fd = dup2(fd1, fd2); 82 fd = dup3(fd1, fd2, O_CLOEXEC); 84 fd = -1; 87 ATF_REQUIRE(fd >= 0); 92 ATF_REQUIRE(fstat(fd, &st) == 0); 98 (void)close(fd); 114 int fd, fd1, fd2; local 122 fd 142 int fd; local 207 int fd; local 300 int *buf, fd, sta; local [all...] |
H A D | t_truncate.c | 57 int fd; local 59 fd = open(path, O_RDWR | O_CREAT, 0600); 60 ATF_REQUIRE(fd >= 0); 66 ATF_REQUIRE(ftruncate(fd, sizes[i]) == 0); 67 ATF_REQUIRE(fstat(fd, &st) == 0); 75 (void)close(fd); 93 int fd; local 95 fd = open("/etc/passwd", O_RDONLY, 0400); 96 ATF_REQUIRE(fd >= 0); 102 ATF_REQUIRE_ERRNO(EINVAL, ftruncate(fd, 99 117 int fd; local [all...] |
/freebsd-current/contrib/sendmail/libsmutil/ |
H A D | lockfile.c | 23 ** fd -- the file descriptor of the file. 37 lockfile(fd, filename, ext, type) 38 int fd; 59 if (fcntl(fd, action, &lfd) >= 0) 76 if (flock(fd, type) >= 0)
|
/freebsd-current/sys/contrib/openzfs/tests/zfs-tests/tests/functional/tmpfile/ |
H A D | tmpfile_test.c | 21 int fd; local 37 fd = open(argv[1], O_TMPFILE | O_WRONLY, 0666); 38 if (fd < 0) { 50 close(fd);
|