| /netbsd-src/sys/kern/ |
| H A D | sys_timerfd.c | 91 timerfd_fire_count(const struct timerfd * const tfd) in timerfd_fire_count() argument 93 return (unsigned int)tfd->tfd_itimer.it_overruns; in timerfd_fire_count() 97 timerfd_is_readable(const struct timerfd * const tfd) in timerfd_is_readable() argument 99 return tfd->tfd_itimer.it_overruns != 0 || tfd->tfd_cancelled; in timerfd_is_readable() 112 struct timerfd * const tfd = in timerfd_fire() local 116 timerfd_wake(tfd); in timerfd_fire() 130 struct timerfd * const tfd = in timerfd_realtime_changed() local 136 if (tfd->tfd_cancel_on_set) { in timerfd_realtime_changed() 137 tfd in timerfd_realtime_changed() 159 struct timerfd * const tfd = kmem_zalloc(sizeof(*tfd), KM_SLEEP); timerfd_create() local 185 timerfd_destroy(struct timerfd * const tfd) timerfd_destroy() argument 208 timerfd_wait(struct timerfd * const tfd,int const fflag) timerfd_wait() argument 249 timerfd_wake(struct timerfd * const tfd) timerfd_wake() argument 266 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_read() local 305 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_ioctl() local 339 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_poll() local 358 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_stat() local 382 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_close() local 393 struct timerfd * const tfd = ((file_t *)kn->kn_obj)->f_timerfd; timerfd_filt_read_detach() local 404 struct timerfd * const tfd = ((file_t *)kn->kn_obj)->f_timerfd; timerfd_filt_read() local 432 struct timerfd * const tfd = ((file_t *)kn->kn_obj)->f_timerfd; timerfd_fop_kqfilter() local 457 struct timerfd * const tfd = fp->f_timerfd; timerfd_fop_restart() local 560 struct timerfd * const tfd = fp->f_timerfd; do_timerfd_gettime() local 612 struct timerfd * const tfd = fp->f_timerfd; do_timerfd_settime() local [all...] |
| /netbsd-src/tests/rump/rumpvfs/ |
| H A D | t_etfs.c | 66 int tfd; in ATF_TC_BODY() local 81 tfd = rump_sys_open(TESTPATH1, O_RDONLY); in ATF_TC_BODY() 82 ATF_REQUIRE(tfd != -1); in ATF_TC_BODY() 83 ATF_REQUIRE(rump_sys_read(tfd, buf, sizeof(buf)) > 0); in ATF_TC_BODY() 84 rump_sys_close(tfd); in ATF_TC_BODY() 89 tfd = rump_sys_open(TESTPATH2, O_RDWR); in ATF_TC_BODY() 90 ATF_REQUIRE(tfd != -1); in ATF_TC_BODY() 92 ATF_REQUIRE((n = rump_sys_read(tfd, buf, sizeof(buf))) > 0); in ATF_TC_BODY() 98 ATF_REQUIRE_EQ(rump_sys_lseek(tfd, 0, SEEK_SET), 0); in ATF_TC_BODY() 100 ATF_REQUIRE_EQ(rump_sys_write(tfd, TESTSTR2, TESTSTR2SZ), TESTSTR2SZ); in ATF_TC_BODY() [all …]
|
| /netbsd-src/sys/dev/ata/ |
| H A D | ata_wdc.c | 183 int wait_flags, tfd; in wdc_ata_bio_start() local 224 &tfd)) in wdc_ata_bio_start() 231 &tfd)) in wdc_ata_bio_start() 233 if (ATACH_ST(tfd) & (WDCS_ERR | WDCS_DWF)) in wdc_ata_bio_start() 245 &tfd)) in wdc_ata_bio_start() 247 if (ATACH_ST(tfd) & (WDCS_ERR | WDCS_DWF)) in wdc_ata_bio_start() 264 &tfd)) in wdc_ata_bio_start() 266 if (ATACH_ST(tfd) & (WDCS_ERR | WDCS_DWF)) in wdc_ata_bio_start() 279 &tfd)) in wdc_ata_bio_start() 281 if (ATACH_ST(tfd) & (WDCS_ERR | WDCS_DWF)) in wdc_ata_bio_start() [all …]
|
| /netbsd-src/usr.bin/passwd/ |
| H A D | local_passwd.c | 137 int pfd, tfd; in pwlocal_process() local 204 tfd = pw_lock(0); in pwlocal_process() 205 if (tfd < 0) { in pwlocal_process() 207 tfd = pw_lock(10); in pwlocal_process() 208 if (tfd < 0) in pwlocal_process() 217 pw_copy(pfd, tfd, pw, &old_pw); in pwlocal_process() 272 int pfd, tfd; in local_chpw() local 313 tfd = pw_lock(0); in local_chpw() 314 if (tfd < 0) { in local_chpw() 316 tfd = pw_lock(10); in local_chpw() [all …]
|
| /netbsd-src/external/bsd/ipf/dist/lib/ |
| H A D | ipft_hx.c | 28 static int tfd = -1; variable 33 if (tfp && tfd != -1) { 35 return tfd; 39 tfd = 0; 42 tfd = open(fname, O_RDONLY); 43 if (tfd != -1) 44 tfp = fdopen(tfd, "r"); 46 return tfd; 52 int cfd = tfd; in hex_close() 54 tfd = -1; in hex_close()
|
| H A D | ipft_tx.c | 34 static int tfd = -1; variable 90 if (tfp && tfd != -1) { 92 return tfd; 96 tfd = 0; 99 tfd = open(fname, O_RDONLY); 100 if (tfd != -1) 101 tfp = fdopen(tfd, "r"); 103 return tfd; 109 int cfd = tfd; in text_close() 111 tfd = -1; in text_close()
|
| /netbsd-src/bin/ksh/ |
| H A D | tty.c | 103 int tfd; local 112 if ((tfd = open(devtty, O_RDWR, 0)) < 0) { 113 if (tfd < 0) { 121 if (tfd < 0) { 124 tfd = 0; 126 tfd = 2; 132 if ((tty_fd = ksh_dupbase(tfd, FDBASE)) < 0) { 143 close(tfd);
|
| /netbsd-src/external/bsd/mdocml/dist/ |
| H A D | tag.c | 65 tag_files.tfd = -1; in tag_init() 100 if ((tag_files.tfd = mkstemp(tag_files.tfn)) == -1) in tag_init() 122 if (tag_files.tfd != -1) in tag_init() 123 close(tag_files.tfd); in tag_init() 127 tag_files.tfd = -1; in tag_init() 143 if (tag_files.tfd <= 0) in tag_put() 225 if (tag_files.tfd <= 0) in tag_write() 232 stream = fdopen(tag_files.tfd, "w"); in tag_write() 247 close(tag_files.tfd); in tag_write() 248 tag_files.tfd = -1; in tag_write()
|
| /netbsd-src/usr.bin/chpass/ |
| H A D | chpass.c | 85 int ch, dfd, pfd, tfd; in main() local 260 tfd = pw_lock(0); in main() 261 if (tfd < 0) { in main() 265 tfd = pw_lock(10); in main() 266 if (tfd < 0) { in main() 273 if (fcntl(tfd, F_SETFD, 1) < 0) in main() 281 pw_copy(pfd, tfd, pw, (op == LOADENTRY) ? NULL : &old_pw); in main() 284 close(tfd); in main()
|
| /netbsd-src/tests/lib/libc/sys/ |
| H A D | t_timerfd.c | 762 int tfd; 765 ATF_REQUIRE((tfd = timerfd_create(CLOCK_MONOTONIC, 0)) >= 0); 766 ATF_REQUIRE((fcntl(tfd, F_GETFL) & O_NONBLOCK) == 0); 767 ATF_REQUIRE(fcntl(tfd, F_SETFL, O_NONBLOCK) == 0); 768 ATF_REQUIRE((fcntl(tfd, F_GETFL) & O_NONBLOCK) != 0); 769 ATF_REQUIRE((fcntl(tfd, F_GETFD) & FD_CLOEXEC) == 0); 772 ATF_REQUIRE(ioctl(tfd, FIONREAD, &val) == 0); 775 ATF_REQUIRE_ERRNO(ENOTTY, ioctl(tfd, FIONWRITE, &val) == -1); 776 ATF_REQUIRE_ERRNO(ENOTTY, ioctl(tfd, FIONSPACE, &val) == -1); 777 (void)close(tfd); 633 int tfd; ATF_TC_BODY() local [all...] |
| /netbsd-src/sys/dev/ic/ |
| H A D | wdcvar.h | 184 #define wdc_wait_for_drq(chp, timeout, flags, tfd) \ argument 185 wdcwait((chp), WDCS_DRQ, WDCS_DRQ, (timeout), (flags), (tfd)) 186 #define wdc_wait_for_unbusy(chp, timeout, flags, tfd) \ argument 187 wdcwait((chp), 0, 0, (timeout), (flags), (tfd)) 188 #define wdc_wait_for_ready(chp, timeout, flags, tfd) \ argument 189 wdcwait((chp), WDCS_DRDY, WDCS_DRDY, (timeout), (flags), (tfd))
|
| H A D | mvsata.c | 560 mvsata_channel_recover(struct ata_channel *chp, int flags, uint32_t tfd) in mvsata_channel_recover() argument 582 ata_recovery_resume(chp, drive, tfd, AT_POLL); in mvsata_channel_recover() 1026 int nblks, error, tfd; in mvsata_bio_start() local 1175 switch(wdc_wait_for_ready(chp, ATA_DELAY, wait_flags, &tfd)) { in mvsata_bio_start() 1205 if (wdc_wait_for_drq(chp, ATA_DELAY, AT_POLL, &tfd) != 0) { in mvsata_bio_start() 1209 chp->ch_channel, xfer->c_drive, ATACH_ST(tfd), in mvsata_bio_start() 1210 ATACH_ERR(tfd)); in mvsata_bio_start() 1214 if (ATACH_ST(tfd) & WDCS_ERR) { in mvsata_bio_start() 1216 ata_bio->r_error = ATACH_ERR(tfd); in mvsata_bio_start() 1243 chp->ch_channel, xfer->c_drive, ATACH_ST(tfd), ATACH_ERR(tfd)); in mvsata_bio_start() [all …]
|
| H A D | ahcisata_core.c | 648 uint32_t is, tfd, sact; in ahci_intr_port_common() local 679 tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); in ahci_intr_port_common() 691 AHCINAME(sc), chp->ch_channel, sact, is, tfd), in ahci_intr_port_common() 695 tfd = (WDCE_ABRT << AHCI_P_TFD_ERR_SHIFT) | in ahci_intr_port_common() 709 tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); in ahci_intr_port_common() 712 if ((tfd & WDCS_ERR) != 0) { in ahci_intr_port_common() 717 AHCINAME(sc), chp->ch_channel, tfd), DEBUG_INTR); in ahci_intr_port_common() 720 tfd = 0; in ahci_intr_port_common() 732 xfer->ops->c_intr(chp, xfer, tfd); in ahci_intr_port_common() 749 xfer->ops->c_intr(chp, xfer, tfd); in ahci_intr_port_common() [all …]
|
| H A D | siisata.c | 514 uint32_t pss, pis, tfd = 0; in siisata_intr_port() local 540 tfd = ATACH_ERR_ST(WDCE_CRC, WDCS_ERR); in siisata_intr_port() 557 tfd = ntfd; in siisata_intr_port() 594 xfer->ops->c_intr(chp, xfer, tfd); in siisata_intr_port() 619 ata_thread_run(chp, 0, ATACH_TH_RECOVERY, tfd); in siisata_intr_port() 626 siisata_channel_recover(struct ata_channel *chp, int flags, uint32_t tfd) in siisata_channel_recover() argument 649 if ((ATACH_ST(tfd) & (WDCS_BSY|WDCS_DRQ)) != 0) { in siisata_channel_recover() 657 ata_recovery_resume(chp, drive, tfd, flags); in siisata_channel_recover() 1079 siisata_cmd_complete(struct ata_channel *chp, struct ata_xfer *xfer, int tfd) in siisata_cmd_complete() argument 1099 if (ATACH_ST(tfd) & WDCS_BSY) { in siisata_cmd_complete() [all …]
|
| H A D | ahcisatareg.h | 250 #define AHCI_TFD_ERR(tfd) \ argument 251 (((tfd) & AHCI_P_TFD_ERR_MASK) >> AHCI_P_TFD_ERR_SHIFT) 252 #define AHCI_TFD_ST(tfd) \ argument 253 (((tfd) & AHCI_P_TFD_ST) >> AHCI_P_TFD_ST_SHIFT)
|
| H A D | wdc.c | 300 int i, j, error, tfd; in wdc_drvprobe() local 451 if (wdc_wait_for_ready(chp, 10000, 0, &tfd) == in wdc_drvprobe() 463 if (wdc_wait_for_ready(chp, 10000, 0, &tfd) == in wdc_drvprobe() 1205 __wdcwait(struct ata_channel *chp, int mask, int bits, int timeout, int *tfd) in __wdcwait() argument 1216 *tfd = 0; in __wdcwait() 1264 *tfd = ATACH_ERR_ST(error, status); in __wdcwait() 1274 int *tfd) in wdcwait() argument 1282 error = __wdcwait(chp, mask, bits, timeout, tfd); in wdcwait() 1284 error = __wdcwait(chp, mask, bits, WDCDELAY_POLL, tfd); in wdcwait() 1293 WDCDELAY_POLL, tfd) == 0) { in wdcwait() [all …]
|
| /netbsd-src/sys/dev/scsipi/ |
| H A D | atapi_wdc.c | 486 int tfd; in wdc_atapi_start() local 522 if (wdc_wait_for_unbusy(chp, ATAPI_DELAY, wait_flags, &tfd)) in wdc_atapi_start() 528 &tfd)) in wdc_atapi_start() 530 if (ATACH_ST(tfd) & WDCS_ERR) { in wdc_atapi_start() 531 if (ATACH_ST(tfd) == WDCE_ABRT) { in wdc_atapi_start() 562 &tfd)) in wdc_atapi_start() 564 if (ATACH_ST(tfd) & WDCS_ERR) { in wdc_atapi_start() 565 if (ATACH_ERR(tfd) == WDCE_ABRT) { in wdc_atapi_start() 603 switch (wdc_wait_for_unbusy(chp, ATAPI_DELAY, wait_flags, &tfd)) { in wdc_atapi_start() 608 ATACH_ST(tfd)); in wdc_atapi_start() [all …]
|
| /netbsd-src/usr.sbin/vipw/ |
| H A D | vipw.c | 69 int pfd, tfd; in main() local 97 tfd = pw_lock(0); in main() 98 if (tfd < 0) { in main() 108 copyfile(pfd, tfd); in main() 109 (void)close(tfd); in main()
|
| /netbsd-src/lib/libutil/compat/ |
| H A D | compat_passwd.c | 76 pw_copy(int ffd, int tfd, struct passwd50 *pw50, struct passwd50 *opw50) in pw_copy() argument 82 __pw_copy50(ffd, tfd, &pw, opw50 ? &opw : NULL); in pw_copy() 86 pw_copyx(int ffd, int tfd, struct passwd50 *pw50, struct passwd50 *opw50, in pw_copyx() argument 93 return __pw_copyx50(ffd, tfd, &pw, opw50 ? &opw : NULL, errbuf, in pw_copyx()
|
| /netbsd-src/usr.sbin/rpc.yppasswdd/ |
| H A D | yppasswdd_mkpw.c | 68 int pfd, tfd; in make_passwd() local 129 tfd = pw_lock(0); in make_passwd() 130 if (tfd < 0) { in make_passwd() 155 pw_copy(pfd, tfd, &pw, NULL); in make_passwd()
|
| /netbsd-src/usr.sbin/lpr/lpr/ |
| H A D | lpr.c | 97 static int tfd; /* control file descriptor */ variable 304 tfd = nfile(tfname); in main() 306 (void)fchown(tfd, DU, -1); /* owned by daemon for protection */ in main() 385 (void)close(tfd); in main() 391 if ((tfd = open(tfname, O_RDWR)) >= 0) { in main() 394 if (read(tfd, &ch, 1) == 1 && in main() 395 lseek(tfd, (off_t)0, 0) == 0 && in main() 396 write(tfd, &ch, 1) != 1) { in main() 401 (void)close(tfd); in main() 527 if (write(tfd, buf, len) != (ssize_t)len) in card()
|
| /netbsd-src/lib/libpam/modules/pam_unix/ |
| H A D | pam_unix.c | 360 int tfd, pfd; in local_set_password() local 363 tfd = pw_lock(0); in local_set_password() 364 if (tfd < 0) { in local_set_password() 366 tfd = pw_lock(10); in local_set_password() 367 if (tfd < 0) { in local_set_password() 381 if (pw_copyx(pfd, tfd, pwd, opwd, errbuf, sizeof(errbuf)) == 0) { in local_set_password()
|
| /netbsd-src/external/bsd/ipf/dist/ipsend/ |
| H A D | sock.c | 289 struct tcpcb *find_tcp(tfd, ti) in find_tcp() argument 290 int tfd; in find_tcp() 347 if (KMCPY(f, o[tfd], sizeof(*f)) == -1) 350 (u_long)o[tfd], (u_long)f, (u_long)sizeof(*f));
|
| /netbsd-src/external/bsd/file/dist/src/ |
| H A D | compress.c | 483 int tfd; in file_pipe2file() local 503 tfd = open(ptr, O_RDWR|O_TRUNC|O_EXCL|O_CREAT, 0600); in file_pipe2file() 512 tfd = mkstemp(buf); in file_pipe2file() 519 if (tfd == -1) { in file_pipe2file() 525 if (swrite(tfd, startbuf, nbytes) != CAST(ssize_t, nbytes)) in file_pipe2file() 529 if (swrite(tfd, buf, CAST(size_t, r)) != r) in file_pipe2file() 549 if ((fd = dup2(tfd, fd)) == -1) { in file_pipe2file() 553 (void)close(tfd); in file_pipe2file()
|
| /netbsd-src/lib/libutil/ |
| H A D | passwd.c | 340 pw_copy(int ffd, int tfd, struct passwd *pw, struct passwd *old_pw) in pw_copy() argument 345 rv = pw_copyx(ffd, tfd, pw, old_pw, errbuf, sizeof(errbuf)); in pw_copy() 363 pw_copyx(int ffd, int tfd, struct passwd *pw, struct passwd *old_pw, in pw_copyx() argument 392 if (!(to = fdopen(tfd, "w"))) { in pw_copyx()
|