Home
last modified time | relevance | path

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

12345678910>>...12

/freebsd/lib/libc/gen/
H A Dgetttyent.c53 getttynam(const char *tty) in getttynam() argument
57 if (strncmp(tty, "/dev/", 5) == 0) in getttynam()
58 tty += 5; in getttynam()
61 if (!strcmp(tty, t->ty_name)) in getttynam()
121 static struct ttyent tty; in getttyent() local
153 tty.ty_name = p; in getttyent()
154 tty.ty_status = 0; in getttyent()
155 tty.ty_window = NULL; in getttyent()
156 tty.ty_group = _TTYS_NOGROUP; in getttyent()
159 if (!*(tty.ty_getty = p)) in getttyent()
[all …]
/freebsd/sys/sys/
H A Dttydisc.h41 struct tty;
45 void ttydisc_open(struct tty *tp);
46 void ttydisc_close(struct tty *tp);
47 size_t ttydisc_bytesavail(struct tty *tp);
48 int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag);
49 int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag);
50 void ttydisc_canonicalize(struct tty *tp);
51 void ttydisc_optimize(struct tty *tp);
54 void ttydisc_modem(struct tty *tp, int open);
56 int ttydisc_rint(struct tty *tp, char c, int flags);
[all …]
H A Dtty.h61 struct tty { struct
64 TAILQ_ENTRY(tty) t_list; /* (l) TTY list entry. */ argument
165 struct tty *tty_alloc(struct ttydevsw *tsw, void *softc);
166 struct tty *tty_alloc_mutex(struct ttydevsw *tsw, void *softc, struct mtx *mtx);
167 void tty_rel_pgrp(struct tty *tp, struct pgrp *pgrp);
168 void tty_rel_sess(struct tty *tp, struct session *sess);
169 void tty_rel_gone(struct tty *tp);
181 int tty_makedevf(struct tty *tp, struct ucred *cred, int flags,
190 void tty_signal_sessleader(struct tty *tp, int signal);
191 void tty_signal_pgrp(struct tty *tp, int signal);
[all …]
H A Dttydevsw.h43 typedef int tsw_open_t(struct tty *tp);
44 typedef void tsw_close_t(struct tty *tp);
45 typedef void tsw_outwakeup_t(struct tty *tp);
46 typedef void tsw_inwakeup_t(struct tty *tp);
47 typedef int tsw_ioctl_t(struct tty *tp, u_long cmd, caddr_t data,
49 typedef int tsw_cioctl_t(struct tty *tp, int unit, u_long cmd, caddr_t data,
51 typedef int tsw_param_t(struct tty *tp, struct termios *t);
52 typedef int tsw_modem_t(struct tty *tp, int sigon, int sigoff);
53 typedef int tsw_mmap_t(struct tty *tp, vm_ooffset_t offset,
55 typedef void tsw_pktnotify_t(struct tty *tp, char event);
[all …]
H A Dttyhook.h36 struct tty;
43 typedef int th_rint_t(struct tty *tp, char c, int flags);
44 typedef size_t th_rint_bypass_t(struct tty *tp, const void *buf, size_t len);
45 typedef void th_rint_done_t(struct tty *tp);
46 typedef size_t th_rint_poll_t(struct tty *tp);
48 typedef size_t th_getc_inject_t(struct tty *tp, void *buf, size_t len);
49 typedef void th_getc_capture_t(struct tty *tp, const void *buf, size_t len);
50 typedef size_t th_getc_poll_t(struct tty *tp);
52 typedef void th_close_t(struct tty *tp);
69 int ttyhook_register(struct tty **, struct proc *, int,
[all …]
/freebsd/usr.sbin/bhyve/
H A Duart_backend.c73 struct ttyfd tty; member
153 if (sc->tty.opened) { in uart_rxfifo_getchar()
182 if (sc->tty.opened) { in rxfifo_putchar()
202 if (ttyread(&sc->tty, &ch) == 0 && sc->tty.is_socket) in uart_rxfifo_drain()
206 len = ttyread(&sc->tty, &ch); in uart_rxfifo_drain()
209 if (len == 0 && sc->tty.is_socket) in uart_rxfifo_drain()
224 } else if (sc->tty.opened) { in uart_rxfifo_putchar()
226 if (ttywrite(&sc->tty, ch) == -1 && sc->tty.is_socket) in uart_rxfifo_putchar()
247 if (sc->tty.opened) { in uart_rxfifo_reset()
252 nread = read(sc->tty.rfd, flushbuf, sizeof(flushbuf)); in uart_rxfifo_reset()
[all …]
/freebsd/crypto/openssh/
H A Dsshpty.c87 pty_release(const char *tty) in pty_release() argument
90 if (chown(tty, (uid_t) 0, (gid_t) 0) == -1) in pty_release()
91 error("chown %.100s 0 0 failed: %.100s", tty, strerror(errno)); in pty_release()
92 if (chmod(tty, (mode_t) 0666) == -1) in pty_release()
93 error("chmod %.100s 0666 failed: %.100s", tty, strerror(errno)); in pty_release()
100 pty_make_controlling_tty(int *ttyfd, const char *tty) in pty_make_controlling_tty() argument
134 fd = open(tty, O_RDWR); in pty_make_controlling_tty()
136 error("%.100s: %.100s", tty, strerror(errno)); in pty_make_controlling_tty()
166 pty_setowner(struct passwd *pw, const char *tty) in pty_setowner() argument
185 if (stat(tty, &st) == -1) in pty_setowner()
[all …]
/freebsd/libexec/rc/rc.d/
H A Dserial52 comcontrol /dev/tty${dc}${i} dtrwait 300 drainwait $drainwait
53 stty < /dev/tty${dc}${i}.init -clocal crtscts hupcl 115200 reprint ^R
54 stty < /dev/tty${dc}${i}.lock -clocal -crtscts -hupcl 0
68 stty < /dev/tty${dc}${i}.init reprint undef
71 stty < /dev/tty${dc}${i}.lock clocal
74 stty < /dev/tty${dc}${i}.lock 300
87 comcontrol /dev/tty${dc}${i} dtrwait 100 drainwait 180
90 stty < /dev/tty${dc}${i}.init crtscts 115200
91 stty < /dev/tty${dc}${i}.lock crtscts
106 stty < /dev/tty${dc}${i}.init clocal -hupcl 1200
[all …]
/freebsd/usr.bin/mesg/
H A Dmesg.c52 char *tty; in main() local
64 if ((tty = ttyname(STDIN_FILENO)) == NULL && in main()
65 (tty = ttyname(STDOUT_FILENO)) == NULL && in main()
66 (tty = ttyname(STDERR_FILENO)) == NULL) in main()
68 if (stat(tty, &sb) < 0) in main()
69 err(2, "%s", tty); in main()
82 if (chmod(tty, sb.st_mode | S_IWGRP) < 0) in main()
83 err(2, "%s", tty); in main()
86 if (chmod(tty, sb.st_mode & ~S_IWGRP) < 0) in main()
87 err(2, "%s", tty); in main()
/freebsd/bin/pkill/tests/
H A Dpkill-t_test.sh8 tty=`ps -x -o tty -p $$ | tail -1`
9 if [ "$tty" = "??" -o "$tty" = "-" ]; then
10 tty="-"
13 case $tty in
14 pts/*) ttyshort=`echo $tty | cut -c 5-` ;;
15 *) ttyshort=`echo $tty | cut -c 4-` ;;
22 pkill -f -t $tty $sleep
H A Dpgrep-t_test.sh8 tty=`ps -x -o tty -p $$ | tail -1`
9 if [ "$tty" = "??" -o "$tty" = "-" ]; then
10 tty="-"
13 case $tty in
14 pts/*) ttyshort=`echo $tty | cut -c 5-` ;;
15 *) ttyshort=`echo $tty | cut -c 4-` ;;
23 pid=`pgrep -f -t $tty $sleep`
/freebsd/lib/libpam/modules/pam_securetty/
H A Dpam_securetty.c60 const void *tty; in pam_sm_acct_mgmt() local
75 pam_err = pam_get_item(pamh, PAM_TTY, &tty); in pam_sm_acct_mgmt()
79 PAM_LOG("Got TTY: %s", (const char *)tty); in pam_sm_acct_mgmt()
82 if (tty != NULL && strncmp(TTY_PREFIX, tty, sizeof(TTY_PREFIX)) == 0) { in pam_sm_acct_mgmt()
84 tty = (const char *)tty + sizeof(TTY_PREFIX) - 1; in pam_sm_acct_mgmt()
87 if (tty != NULL && (ty = getttynam(tty)) != NULL && in pam_sm_acct_mgmt()
/freebsd/contrib/tcsh/
H A Dsh.file.c164 struct termios tty, tty_normal; in back_to_col_1() local
166 struct termio tty, tty_normal; in back_to_col_1()
169 struct sgttyb tty, tty_normal; in back_to_col_1()
177 (void) tcgetattr(SHOUT, &tty); in back_to_col_1()
181 tty_normal = tty; in back_to_col_1()
182 tty.c_iflag &= ~INLCR; in back_to_col_1()
183 tty.c_oflag &= ~ONLCR; in back_to_col_1()
185 (void) xtcsetattr(SHOUT, TCSANOW, &tty); in back_to_col_1()
187 (void) ioctl(SHOUT, TCSETAW, (ioctl_t) &tty); in back_to_col_1()
196 (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & tty); in back_to_col_1()
[all …]
/freebsd/crypto/heimdal/appl/login/
H A Dread_string.c56 FILE *tty; in read_string() local
76 if((tty = fopen("/dev/tty", "r")) == NULL) in read_string()
77 tty = stdin; in read_string()
83 tcgetattr(fileno(tty), &t_old); in read_string()
86 tcsetattr(fileno(tty), TCSANOW, &t_new); in read_string()
91 c = getc(tty); in read_string()
93 if(!ferror(tty)) in read_string()
109 tcsetattr(fileno(tty), TCSANOW, &t_old); in read_string()
112 if(tty != stdin) in read_string()
113 fclose(tty); in read_string()
/freebsd/usr.bin/write/
H A Dwrite.c74 char tty[MAXPATHLEN], *mytty; in main() local
154 search_utmp(devfd, argv[0], tty, mytty, myuid); in main()
155 do_write(devfd, tty, mytty, login); in main()
187 utmp_chk(char *user, char *tty) in utmp_chk() argument
191 strncpy(lu.ut_line, tty, sizeof lu.ut_line); in utmp_chk()
214 search_utmp(int devfd, char *user, char *tty, char *mytty, uid_t myuid) in search_utmp() argument
239 (void)strlcpy(tty, u->ut_line, MAXPATHLEN); in search_utmp()
248 (void)strlcpy(tty, mytty, MAXPATHLEN); in search_utmp()
253 warnx("%s is logged in more than once; writing to %s", user, tty); in search_utmp()
262 term_chk(int devfd, char *tty, int *msgsokP, time_t *atimeP, int showerror) in term_chk() argument
[all …]
/freebsd/contrib/less/
H A Dttyin.c33 public HANDLE tty;
39 public int tty; in open_tty_device()
54 /* The __open() system call translates "/dev/tty" to "con". */
62 * Open the tty device. in open_tty()
63 * Try ttyname(), then try /dev/tty, then use file descriptor 2. in open_tty()
83 fd = open_tty_device("/dev/tty"); in open_getchr()
105 tty = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, in open_getchr()
108 GetConsoleMode(tty, &init_console_input_mode); in open_getchr()
115 SetConsoleMode(tty, curr_console_input_mode); in open_getchr()
125 tty in close_getchr()
27 public HANDLE tty; global() variable
29 public int tty; global() variable
[all...]
/freebsd/contrib/ncurses/ncurses/trace/
H A Dlib_tracebits.c107 _nc_trace_ttymode(const TTY * tty) in _nc_trace_ttymode() argument
177 if (tty->c_iflag & ALLIN) in _nc_trace_ttymode()
178 lookup_bits(buf, iflags, "iflags", tty->c_iflag); in _nc_trace_ttymode()
180 if (tty->c_oflag & ALLOUT) in _nc_trace_ttymode()
181 lookup_bits(buf, oflags, "oflags", tty->c_oflag); in _nc_trace_ttymode()
183 if (tty->c_cflag & ALLCTRL) in _nc_trace_ttymode()
184 lookup_bits(buf, cflags, "cflags", tty->c_cflag); in _nc_trace_ttymode()
203 int value = (int) (tty->c_cflag & CSIZE); in _nc_trace_ttymode()
218 if (tty->c_lflag & ALLLOCAL) in _nc_trace_ttymode()
219 lookup_bits(buf, lflags, "lflags", tty->c_lflag); in _nc_trace_ttymode()
[all …]
/freebsd/sys/kern/
H A Dtty.c75 static void tty_rel_free(struct tty *tp);
77 static TAILQ_HEAD(, tty) tty_list = TAILQ_HEAD_INITIALIZER(tty_list);
124 tty_watermarks(struct tty *tp) in tty_watermarks()
152 tty_drain(struct tty *tp, int leaving) in tty_drain()
214 ttydev_enter(struct tty *tp) in ttydev_enter()
229 ttydev_leave(struct tty *tp) in ttydev_leave()
272 struct tty *tp; in ttydev_open()
372 struct tty *tp = dev->si_drv1; in ttydev_close()
413 tty_is_ctty(struct tty *tp, struct proc *p) in tty_is_ctty()
422 tty_wait_background(struct tty *tp, struct thread *td, int sig) in tty_wait_background()
[all …]
H A Dtty_ttydisc.c92 ttydisc_open(struct tty *tp) in ttydisc_open()
98 ttydisc_close(struct tty *tp) in ttydisc_close()
120 ttydisc_read_break(struct tty *tp, char *breakc, size_t breaksz) in ttydisc_read_break()
141 ttydisc_bytesavail(struct tty *tp) in ttydisc_bytesavail()
170 ttydisc_canonicalize(struct tty *tp) in ttydisc_canonicalize()
192 ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) in ttydisc_read_canonical()
267 ttydisc_read_raw_no_timer(struct tty *tp, struct uio *uio, int ioflag) in ttydisc_read_raw_no_timer()
306 ttydisc_read_raw_read_timer(struct tty *tp, struct uio *uio, int ioflag, in ttydisc_read_raw_read_timer()
360 ttydisc_read_raw_interbyte_timer(struct tty *tp, struct uio *uio, int ioflag) in ttydisc_read_raw_interbyte_timer()
409 ttydisc_read(struct tty *tp, struct uio *uio, int ioflag) in ttydisc_read()
[all …]
/freebsd/usr.sbin/pstat/
H A Dpstat.c45 #include <sys/tty.h>
224 TAILQ_HEAD(, tty) tl; in ttymode_kvm()
225 struct tty *tp, tty; in ttymode_kvm() local
235 if (kvm_read(kd, (u_long)tp, &tty, sizeof tty) != sizeof tty) in ttymode_kvm()
237 xt.xt_insize = tty.t_inq.ti_nblocks * TTYINQ_DATASIZE; in ttymode_kvm()
238 xt.xt_incc = tty.t_inq.ti_linestart - tty in ttymode_kvm()
[all...]
/freebsd/lib/libpam/modules/pam_login_access/
H A Dpam_login_access.c72 const void *rhost, *tty, *user; in pam_sm_acct_mgmt() local
89 pam_err = pam_get_item(pamh, PAM_TTY, &tty); in pam_sm_acct_mgmt()
110 } else if (tty != NULL && *(const char *)tty != '\0') { in pam_sm_acct_mgmt()
112 (const char *)user, (const char *)tty); in pam_sm_acct_mgmt()
113 if (login_access(user, tty, &login_access_opts) != 0) in pam_sm_acct_mgmt()
116 (const char *)user, (const char *)tty); in pam_sm_acct_mgmt()
/freebsd/usr.bin/who/
H A Dwho.c164 char buf[80], tty[PATH_MAX]; in row() local
177 snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, ut->ut_line); in row()
178 if (stat(tty, &sb) == 0) { in row()
270 const char *name, *tty; in whoami() local
272 if ((tty = ttyname(STDIN_FILENO)) == NULL) in whoami()
273 tty = "tty??"; in whoami()
274 else if (strncmp(tty, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) in whoami()
275 tty += sizeof _PATH_DEV - 1; in whoami()
276 strlcpy(ut.ut_line, tty, sizeof ut.ut_line); in whoami()
/freebsd/lib/libutil/
H A Dlogin_ok.c125 login_ttyok(login_cap_t *lc, const char *tty, const char *allowcap, in login_ttyok() argument
130 if (lc != NULL && tty != NULL && *tty != '\0') { in login_ttyok()
135 te = getttynam(tty); /* Need group name */ in login_ttyok()
139 if (ttl != NULL && !login_str2inlist(ttl, tty, grp, 0)) in login_ttyok()
144 if (ttl != NULL && login_str2inlist(ttl, tty, grp, 0)) in login_ttyok()
160 auth_ttyok(login_cap_t *lc, const char * tty) in auth_ttyok() argument
162 return login_ttyok(lc, tty, "ttys.allow", "ttys.deny"); in auth_ttyok()
/freebsd/usr.bin/killall/
H A Dkillall.c103 char *tty = NULL; in main() local
181 tty = *av; in main()
249 if (user == NULL && tty == NULL && cmd == NULL && !jflag && ac == 0) in main()
252 if (tty) { in main()
253 if (strncmp(tty, "/dev/", 5) == 0) in main()
254 snprintf(buf, sizeof(buf), "%s", tty); in main()
255 else if (strncmp(tty, "tty", 3) == 0 || in main()
256 strncmp(tty, "pts/", 4) == 0) in main()
257 snprintf(buf, sizeof(buf), "/dev/%s", tty); in main()
259 snprintf(buf, sizeof(buf), "/dev/tty%s", tty); in main()
[all …]
/freebsd/lib/libpam/modules/pam_lastlog/
H A Dpam_lastlog.c73 const void *rhost, *tty; in pam_sm_open_session() local
89 pam_err = pam_get_item(pamh, PAM_TTY, &tty); in pam_sm_open_session()
94 if (tty == NULL) { in pam_sm_open_session()
100 if (strncmp(tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) in pam_sm_open_session()
101 tty = (const char *)tty + sizeof(_PATH_DEV) - 1; in pam_sm_open_session()
138 strncpy(utl.ut_line, tty, sizeof utl.ut_line); in pam_sm_open_session()

12345678910>>...12