/freebsd/sys/kern/ |
H A D | sys_timerfd.c | 134 struct timerfd *tfd; in timerfd_jumped() local 142 LIST_FOREACH(tfd, &timerfd_list, entry) { in timerfd_jumped() 143 mtx_lock(&tfd->tfd_lock); in timerfd_jumped() 144 if (tfd->tfd_clockid != CLOCK_REALTIME || in timerfd_jumped() 145 (tfd->tfd_timflags & TFD_TIMER_ABSTIME) == 0 || in timerfd_jumped() 146 timespeccmp(&boottime, &tfd->tfd_boottim, ==)) { in timerfd_jumped() 147 mtx_unlock(&tfd->tfd_lock); in timerfd_jumped() 151 if (callout_active(&tfd->tfd_callout)) { in timerfd_jumped() 152 if ((tfd->tfd_timflags & TFD_TIMER_CANCEL_ON_SET) != 0) in timerfd_jumped() 153 tfd->tfd_jumped = TFD_CANCELED; in timerfd_jumped() [all …]
|
/freebsd/contrib/netbsd-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 …]
|
/freebsd/sbin/ipf/libipf/ |
H A D | ipft_hx.c | 23 static int tfd = -1; variable 28 if (tfp && tfd != -1) { in hex_open() 30 return (tfd); in hex_open() 34 tfd = 0; in hex_open() 37 tfd = open(fname, O_RDONLY); in hex_open() 38 if (tfd != -1) in hex_open() 39 tfp = fdopen(tfd, "r"); in hex_open() 41 return (tfd); in hex_open() 48 int cfd = tfd; in hex_close() 50 tfd = -1; in hex_close()
|
H A D | ipft_tx.c | 29 static int tfd = -1; variable 84 if (tfp && tfd != -1) { in text_open() 86 return (tfd); in text_open() 90 tfd = 0; in text_open() 93 tfd = open(fname, O_RDONLY); in text_open() 94 if (tfd != -1) in text_open() 95 tfp = fdopen(tfd, "r"); in text_open() 97 return (tfd); in text_open() 104 int cfd = tfd; in text_close() 106 tfd = -1; in text_close()
|
/freebsd/sys/contrib/dev/iwlwifi/queue/ |
H A D | tx.c |
|
H A D | tx.h |
|
/freebsd/contrib/libbegemot/ |
H A D | rpoll.c | 189 static int * tfd; /* sorted entries */ variable 432 if(tfd[i] == handle) { in poll_stop_timer() 433 tfd[i] = -1; in poll_stop_timer() 467 tfd = _xrealloc(tfd, sizeof(int *) * tfd_alloc); in sort_timers() 470 pp = tfd; in sort_timers() 475 assert(pp - tfd == (ptrdiff_t)tims_used); in sort_timers() 479 qsort(tfd, tfd_used, sizeof(int), tim_cmp); in sort_timers() 524 i, tfd[i]->when - now); in poll_dispatch() 527 if((tout = tims[tfd[0]].when - now) < 0) in poll_dispatch() 615 if(tfd[i] < 0) in poll_dispatch() [all …]
|
/freebsd/tools/test/stress2/testcases/openat/ |
H A D | openat.c | 117 int tfd; in test_openat() local 124 if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1) in test_openat() 126 close(tfd); in test_openat() 139 int tfd; in test_renameat() local 146 if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1) in test_renameat() 148 close(tfd); in test_renameat() 165 int tfd; in test_unlinkat() local 171 if ((tfd = openat(fd, file, O_RDONLY|O_CREAT, 0660)) == -1) in test_unlinkat() 173 close(tfd); in test_unlinkat()
|
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | cp_files.c | 14 int tfd; in main() local 30 tfd = open(argv[2], O_DIRECTORY); in main() 31 if (tfd < 0) { in main() 43 int fd = openat(tfd, dirent->d_name, O_CREAT|O_WRONLY, 0666); in main() 48 close(tfd); in main() 55 close(tfd); in main()
|
/freebsd/usr.sbin/pw/ |
H A D | grupd.c | 51 int pfd, tfd; in gr_update() local 68 if ((tfd = gr_tmp(-1)) == -1) { in gr_update() 72 if (gr_copy(pfd, tfd, gr, old_gr) == -1) { in gr_update() 74 close(tfd); in gr_update() 77 fsync(tfd); in gr_update() 78 close(tfd); in gr_update()
|
H A D | pw_nis.c | 41 int pfd, tfd; in pw_nisupdate() local 58 if ((tfd = pw_tmp(-1)) == -1) { in pw_nisupdate() 62 if (pw_copy(pfd, tfd, pw, old_pw) == -1) { in pw_nisupdate() 64 close(tfd); in pw_nisupdate() 67 fsync(tfd); in pw_nisupdate() 68 close(tfd); in pw_nisupdate()
|
H A D | pwupd.c | 88 int rc, pfd, tfd; in pw_update() local 105 if ((tfd = pw_tmp(-1)) == -1) { in pw_update() 109 if (pw_copy(pfd, tfd, pw, old_pw) == -1) { in pw_update() 111 close(tfd); in pw_update() 114 fsync(tfd); in pw_update() 115 close(tfd); in pw_update()
|
/freebsd/contrib/mandoc/ |
H A D | term_tag.c | 55 int tfd; in term_tag_init() local 57 ofd = tfd = -1; in term_tag_init() 110 if ((tfd = mkstemp(tag_files.tfn)) == -1) { in term_tag_init() 119 tfd = open(tagfilename, O_WRONLY | O_CREAT | O_EXCL, 0644); in term_tag_init() 120 if (tfd == -1) { in term_tag_init() 126 if ((tag_files.tfs = fdopen(tfd, "w")) == NULL) { in term_tag_init() 130 tfd = -1; in term_tag_init() 142 if (tfd != -1) in term_tag_init() 143 close(tfd); in term_tag_init()
|
/freebsd/usr.sbin/bhyve/ |
H A D | pci_ahci.c | 163 uint32_t tfd; member 374 ahci_write_fis_sdb(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t tfd) in ahci_write_fis_sdb() argument 379 error = (tfd >> 8) & 0xff; in ahci_write_fis_sdb() 380 tfd &= 0x77; in ahci_write_fis_sdb() 384 fis[2] = tfd; in ahci_write_fis_sdb() 388 p->err_cfis[2] = tfd; in ahci_write_fis_sdb() 395 p->tfd &= ~0x77; in ahci_write_fis_sdb() 396 p->tfd |= tfd; in ahci_write_fis_sdb() 401 ahci_write_fis_d2h(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t tfd) in ahci_write_fis_d2h() argument 406 error = (tfd >> 8) & 0xff; in ahci_write_fis_d2h() [all …]
|
/freebsd/sys/contrib/dev/iwlwifi/pcie/ |
H A D | tx-gen2.c | 64 struct iwl_tfh_tfd *tfd, in iwl_pcie_gen2_enqueue_hcmd() 77 ret = iwl_txq_gen2_set_tb(trans, tfd, phys, len); in iwl_pcie_gen2_enqueue_hcmd() 132 ret = iwl_txq_gen2_set_tb(trans, tfd, phys, len); in iwl_pcie_gen2_enqueue_hcmd() 162 struct iwl_tfh_tfd *tfd, in iwl_pcie_gen2_enqueue_hcmd() 180 trace_iwlwifi_dev_tx(trans->dev, skb, tfd, sizeof(*tfd), in iwl_pcie_gen2_enqueue_hcmd() 252 iwl_txq_gen2_set_tb(trans, tfd, tb_phys, tb_len); in iwl_pcie_gen2_enqueue_hcmd() 272 ret = iwl_txq_gen2_set_tb_with_wa(trans, skb, tfd, 307 struct iwl_tfh_tfd *tfd = iwl_txq_get_tfd(trans, txq, idx); 319 iwl_txq_gen2_set_tb(trans, tfd, tb_phy 44 struct iwl_tfh_tfd *tfd; iwl_pcie_gen2_enqueue_hcmd() local [all...] |
H A D | tx.c | 148 static inline void iwl_pcie_gen1_tfd_set_tb(struct iwl_tfd *tfd, in iwl_pcie_tfd_set_tb() 151 struct iwl_tfd_tb *tb = &tfd->tbs[idx]; in iwl_pcie_tfd_set_tb() 159 tfd->num_tbs = idx + 1; in iwl_pcie_txq_build_tfd() local 162 static inline u8 iwl_txq_gen1_tfd_get_num_tbs(struct iwl_tfd *tfd) in iwl_pcie_txq_build_tfd() 164 return tfd->num_tbs & 0x1f; in iwl_pcie_txq_build_tfd() 171 void *tfd; in iwl_pcie_txq_build_tfd() 174 tfd = (u8 *)txq->tfds + trans_pcie->txqs.tfd.size * txq->write_ptr; in iwl_pcie_txq_build_tfd() 177 memset(tfd, 0, trans_pcie->txqs.tfd in iwl_pcie_txq_build_tfd() 140 iwl_pcie_tfd_set_tb(struct iwl_trans * trans,void * tfd,u8 idx,dma_addr_t addr,u16 len) iwl_pcie_tfd_set_tb() argument 1453 void *tfd; iwl_trans_pcie_tx() local [all...] |
/freebsd/sys/contrib/dev/iwlwifi/ |
H A D | iwl-trans.c |
|
/freebsd/lib/libutil/ |
H A D | gr_util.c | 130 int tfd; in gr_tmp() local 143 if ((tfd = mkostemp(tempname, 0)) == -1) in gr_tmp() 147 if (write(tfd, buf, (size_t)nr) != nr) in gr_tmp() 152 close(tfd); in gr_tmp() 156 return (tfd); in gr_tmp() 164 gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr) in gr_copy() argument 245 if (write(tfd, p, q -p + 1) != q - p + 1) in gr_copy() 267 if (write(tfd, p, q - p + 1) != q - p + 1) in gr_copy() 283 if (write(tfd, line, len) != (int) len) in gr_copy() 291 if (write(tfd, q, end - q) != end - q) in gr_copy() [all …]
|
H A D | pw_util.c | 210 int tfd; in pw_tmp() local 223 if ((tfd = mkostemp(tempname, 0)) == -1) in pw_tmp() 227 if (write(tfd, buf, (size_t)nr) != nr) in pw_tmp() 232 close(tfd); in pw_tmp() 236 return (tfd); in pw_tmp() 426 pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) in pw_copy() argument 507 if (write(tfd, p, q - p + 1) != q - p + 1) in pw_copy() 530 if (write(tfd, p, q - p + 1) != q - p + 1) in pw_copy() 546 if (write(tfd, line, len) != (int)len) in pw_copy() 554 if (write(tfd, q, end - q) != end - q) in pw_copy() [all …]
|
/freebsd/usr.sbin/vipw/ |
H A D | vipw.c | 57 int ch, pfd, tfd; in main() local 83 if ((tfd = pw_tmp(pfd)) == -1) { in main() 87 (void)close(tfd); in main()
|
/freebsd/usr.sbin/lpr/lpr/ |
H A D | lpr.c | 90 static int tfd; /* control file descriptor */ variable 315 tfd = nfile(tfname); in main() 317 (void) fchown(tfd, pp->daemon_user, -1); in main() 483 (void) close(tfd); in main() 489 if ((tfd = open(tfname, O_RDWR)) >= 0) { in main() 492 if (read(tfd, &touch_c, 1) == 1 && in main() 493 lseek(tfd, (off_t)0, 0) == 0 && in main() 494 write(tfd, &touch_c, 1) != 1) { in main() 500 (void) close(tfd); in main() 616 write(tfd, buf, len); in card()
|
/freebsd/tools/test/stress2/testcases/rename/ |
H A D | rename.c | 95 int tfd; in test_rename() local 100 if ((tfd = open(file1, O_RDONLY|O_CREAT, 0660)) == -1) in test_rename() 102 close(tfd); in test_rename()
|
/freebsd/usr.bin/chpass/ |
H A D | chpass.c | 71 int ch, pfd, tfd; in main() local 199 if ((tfd = pw_tmp(-1)) == -1) { in main() 253 if ((tfd = pw_tmp(-1)) == -1) { in main() 257 if (pw_copy(pfd, tfd, pw, old_pw) == -1) { in main()
|
/freebsd/sys/fs/tmpfs/ |
H A D | tmpfs_vfsops.c | 588 struct tmpfs_fid_data tfd; in tmpfs_fhtovp() local 593 if (fhp->fid_len != sizeof(tfd)) in tmpfs_fhtovp() 600 memcpy(&tfd, fhp->fid_data, fhp->fid_len); in tmpfs_fhtovp() 604 if (tfd.tfd_id >= tmp->tm_nodes_max) in tmpfs_fhtovp() 609 if (node->tn_id == tfd.tfd_id && in tmpfs_fhtovp() 610 node->tn_gen == tfd.tfd_gen) { in tmpfs_fhtovp()
|
/freebsd/sbin/ipf/ipsend/ |
H A D | sock.c | 150 find_tcp(int tfd, struct tcpiphdr *ti) in find_tcp() argument 197 if (KMCPY(f, o[tfd], sizeof(*f)) == -1) in find_tcp() 200 (u_long)o[tfd], (u_long)f, (u_long)sizeof(*f)); in find_tcp()
|