Home
last modified time | relevance | path

Searched refs:tfd (Results 1 – 25 of 25) sorted by relevance

/illumos-gate/usr/src/cmd/ipf/lib/
H A Dipft_hx.c26 static int tfd = -1; variable
31 if (tfp && tfd != -1) {
33 return tfd;
37 tfd = 0;
40 tfd = open(fname, O_RDONLY);
41 if (tfd != -1)
42 tfp = fdopen(tfd, "r");
44 return tfd;
50 int cfd = tfd; in hex_close()
52 tfd = -1; in hex_close()
H A Dipft_td.c54 static int tfd = -1; variable
60 if (tfd != -1)
61 return tfd;
64 tfd = 0;
67 tfd = open(fname, O_RDONLY);
68 tfp = fdopen(tfd, "r");
70 return tfd;
77 return close(tfd); in tcpd_close()
H A Dipft_tx.c40 static int tfd = -1; variable
121 if (tfp && tfd != -1) {
123 return tfd;
127 tfd = 0;
130 tfd = open(fname, O_RDONLY);
131 if (tfd != -1)
132 tfp = fdopen(tfd, "r");
134 return tfd;
140 int cfd = tfd; in text_close()
142 tfd = -1; in text_close()
/illumos-gate/usr/src/cmd/mandoc/
H A Dterm_tag.c55 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()
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/
H A Dprocess.c182 int tfd; in find_user() local
197 if ((tfd = open(dev, O_WRONLY|O_NOCTTY)) == -1) { in find_user()
200 if (!isatty(tfd)) { in find_user()
201 (void) close(tfd); in find_user()
212 if (fstat(tfd, &stbuf) < 0 || in find_user()
214 (void) close(tfd); in find_user()
218 (void) close(tfd); in find_user()
223 (void) close(tfd); in find_user()
/illumos-gate/usr/src/cmd/lp/lib/lp/
H A Dtidbit.c241 tfd; local
258 tfd = -1;
260 tfd = open_terminfo_file(terminfo, term);
262 if (tfd < 0)
263 tfd = open_terminfo_file(TERMINFO, term);
265 if (tfd >= 0)
266 (void) Fstat(tfd, &statbuf);
268 if (tfd < 0 || !statbuf.st_size) {
280 n = Read(tfd, pt->tiebuf, statbuf.st_size);
281 (void) Close(tfd);
/illumos-gate/usr/src/cmd/bhyve/
H A Dpci_ahci.c161 uint32_t tfd; member
376 tfd &= 0x77; in ahci_write_fis_sdb()
380 fis[2] = tfd; in ahci_write_fis_sdb()
392 p->tfd |= tfd; in ahci_write_fis_sdb()
425 p->tfd = tfd; in ahci_write_fis_d2h()
1143 uint32_t tfd; in atapi_inquiry() local
1369 uint32_t tfd; in atapi_read_toc() local
1471 uint32_t tfd; in atapi_start_stop_unit() local
1571 uint32_t tfd; in atapi_get_event_status_notification() local
1897 uint32_t tfd; in ata_ioreq_cb() local
[all …]
H A Dmevent.c606 mevent_add_state(int tfd, enum ev_type type, in mevent_add_state() argument
618 if (tfd < 0 || func == NULL) { in mevent_add_state()
632 if (type != EVF_TIMER && lp->me_fd == tfd && in mevent_add_state()
639 if (type != EVF_TIMER && lp->me_fd == tfd && in mevent_add_state()
654 mevp->me_msecs = tfd; in mevent_add_state()
661 mevp->me_fd = tfd; in mevent_add_state()
696 mevent_add(int tfd, enum ev_type type, in mevent_add() argument
700 return (mevent_add_state(tfd, type, func, param, EV_ADD, 0)); in mevent_add()
704 mevent_add_flags(int tfd, enum ev_type type, int fflags, in mevent_add_flags() argument
708 return (mevent_add_state(tfd, type, func, param, EV_ADD, fflags)); in mevent_add_flags()
[all …]
/illumos-gate/usr/src/cmd/backup/restore/
H A Drestore.c943 int fromfd, fromdir, tofd, todir, tfd; in movexattrs() local
949 resolve(orig, &tfd, &from); in movexattrs()
957 if (tfd != AT_FDCWD) (void) close(tfd); in movexattrs()
963 if (tfd != AT_FDCWD) (void) close(tfd); in movexattrs()
971 if (tfd != AT_FDCWD) in movexattrs()
972 (void) close(tfd); in movexattrs()
975 if (tfd != AT_FDCWD) (void) close(tfd); in movexattrs()
977 resolve(targ, &tfd, &to); in movexattrs()
984 if (tfd != AT_FDCWD) (void) close(tfd); in movexattrs()
987 if ((tfd = dup(fromdir)) == -1 || in movexattrs()
[all …]
H A Dutilities.c1073 int tfd; in resolve() local
1075 *fd = tfd = AT_FDCWD; in resolve()
1079 (*fd = openat64(tfd, *rpath, O_RDONLY)) > 0) { in resolve()
1080 if (tfd != AT_FDCWD) in resolve()
1081 (void) close(tfd); in resolve()
1082 tfd = *fd; in resolve()
1088 if (*fd < 0 || (*fd = openat64(tfd, ".", O_RDONLY|O_XATTR)) < 0) { in resolve()
1095 if (tfd != AT_FDCWD) (void) close(tfd); in resolve()
/illumos-gate/usr/src/cmd/sgs/libelf/demo/
H A Ddcom.c93 int tfd, *shndx, ndx = 1, off = 0; in delete_comment() local
167 if ((tfd = open(tfile, O_RDWR | O_CREAT, 0600)) == -1) { in delete_comment()
175 if ((telf = elf_begin(tfd, ELF_C_WRITE, 0)) == NULL) { in delete_comment()
328 (void) close(tfd); in delete_comment()
338 (void) fchmod(tfd, sbuf.st_mode); in delete_comment()
340 (void) close(tfd); in delete_comment()
/illumos-gate/usr/src/lib/libcurses/screen/
H A Dsetupterm.c234 int n, tfd; in setupterm() local
250 tfd = -1; in setupterm()
264 tfd = open(fname, 0); in setupterm()
268 if ((tfd < 0) && (errno == EACCES)) in setupterm()
272 if (tfd < 0) { in setupterm()
280 tfd = open(fname, 0); in setupterm()
287 if (tfd < 0) { in setupterm()
311 n = (int)read(tfd, tiebuf, sizeof (tiebuf)); in setupterm()
312 (void) close(tfd); in setupterm()
/illumos-gate/usr/src/uts/common/syscall/
H A Drename.c51 renameat(int ffd, char *from, int tfd, char *to) in renameat() argument
61 if ((error = fgetstartvp(tfd, to, &tstartvp)) != 0) in renameat()
H A Dlink.c51 linkat(int ffd, char *from, int tfd, char *to, int flag) in linkat() argument
66 if ((error = fgetstartvp(tfd, to, &tstartvp)) != 0) in linkat()
/illumos-gate/usr/src/cmd/cmd-inet/usr.lib/inetd/
H A Drepval.c458 int tfd; in repvals_to_file() local
469 if ((tfd = mkstemp(genfmri_temp_filename)) == -1) { in repvals_to_file()
473 if (fchmod(tfd, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) { in repvals_to_file()
474 (void) close(tfd); in repvals_to_file()
479 if ((tfp = fdopen(tfd, "w")) == NULL) { in repvals_to_file()
480 (void) close(tfd); in repvals_to_file()
/illumos-gate/usr/src/cmd/logadm/
H A Dconf.c460 int cfd, tfd; in conf_close() local
507 if ((tfd = mkstemp(tuname)) == -1) in conf_close()
512 if (fchmod(tfd, 0644) == -1) in conf_close()
514 if ((tfp = fdopen(tfd, "w")) == NULL) in conf_close()
/illumos-gate/usr/src/lib/libc/port/gen/
H A Dttyname.c740 int tfd = open("/dev/console", O_WRONLY); in get_pri_dirs() local
741 if (tfd >= 0) { in get_pri_dirs()
746 (void) write(tfd, buf, strlen(buf)); in get_pri_dirs()
747 (void) close(tfd); in get_pri_dirs()
/illumos-gate/usr/src/lib/libcmdutils/common/
H A Dprocess_xattrs.c37 get_attrdirs(int indfd, int outdfd, char *attrfile, int *sfd, int *tfd) in get_attrdirs() argument
62 *tfd = fd2; in get_attrdirs()
/illumos-gate/usr/src/cmd/lofiadm/
H A Dmain.c1500 int tfd = -1; in lofi_compress() local
1585 if ((tfd = mkstemp64(tmpfilename)) == -1) in lofi_compress()
1665 wbytes = write(tfd, compressed_seg, len_compressed + SEGHDR); in lofi_compress()
1733 if (lseek(tfd, 0, SEEK_SET) != 0) in lofi_compress()
1739 rbytes = read(tfd, compressed_seg, compressed_segsize + SEGHDR); in lofi_compress()
1765 (void) close(tfd); in lofi_compress()
1769 if (tfd != -1) in lofi_compress()
1791 if (tfd != -1) in lofi_compress()
1792 (void) close(tfd); in lofi_compress()
/illumos-gate/usr/src/lib/libcontract/common/
H A Dlibcontract.c198 ct_ctl_newct(int cfd, ctevid_t evid, int tfd) in ct_ctl_newct() argument
200 if (ioctl(cfd, CT_CNEWCT, tfd) == -1) in ct_ctl_newct()
/illumos-gate/usr/src/lib/libbsm/common/
H A Dadt_xlate.h147 fd_t tfd; member
H A Dadt_token.c916 sock = ((union convert *)p_data)->tfd; in adt_to_in_peer()
/illumos-gate/usr/src/cmd/sendmail/src/
H A Dqueue.c355 int tfd = -1; local
395 if (tfd < 0 ||
400 (void *) &tfd, SM_IO_WRONLY,
408 tf, (int) geteuid(), tfd, tfp);
421 if (tfd < 0)
424 if (tfd < 0)
439 if (tfd >= 0)
455 (void) close(tfd);
456 tfd = -1;
469 (void *) &tfd, SM_IO_WRONLY_B,
[all …]
/illumos-gate/usr/src/lib/fm/topo/modules/common/ses/
H A Dses.c739 int tfd, len, rval; in ses_create_contract() local
752 tfd = open64(CTFS_ROOT "/device/template", O_RDWR); in ses_create_contract()
753 (void) ct_tmpl_set_critical(tfd, CT_DEV_EV_OFFLINE); in ses_create_contract()
754 (void) ct_tmpl_set_cookie(tfd, (uint64_t)(uintptr_t)stp); in ses_create_contract()
757 if ((rval = ct_dev_tmpl_set_minor(tfd, &link_path[13])) != 0) in ses_create_contract()
760 else if ((rval = ct_tmpl_create(tfd, &stp->set_ctid)) != 0) in ses_create_contract()
764 (void) close(tfd); in ses_create_contract()
/illumos-gate/usr/src/cmd/ypcmd/
H A Dypserv.c178 int ufd, tfd; in ypinit() local