116 lines
3.5 KiB
Groff
116 lines
3.5 KiB
Groff
.\" Copyright (c) 1991, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)ttyname.3 8.1 (Berkeley) 6/4/93
|
|
.\" %FreeBSD: src/lib/libc/gen/ttyname.3,v 1.5.2.3 2001/12/14 18:33:51 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd June 4, 1993
|
|
.Dt TTYNAME 3
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm ttyname ,
|
|
.Nm isatty ,
|
|
.Nm ttyslot
|
|
.Nd ¥Õ¥¡¥¤¥ëµ½Ò»Ò¤«¤é¤½¤ì¤Ë·ë¹ç¤µ¤ì¤Æ¤¤¤ëüËö ( tty ) ¤Î̾Á°¤ò¼èÆÀ
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libc
|
|
.Sh ½ñ¼°
|
|
.In unistd.h
|
|
.Ft char *
|
|
.Fn ttyname "int fd"
|
|
.Ft int
|
|
.Fn isatty "int fd"
|
|
.Ft int
|
|
.Fn ttyslot void
|
|
.Sh ²òÀâ
|
|
¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢Ã¼Ëö¥¿¥¤¥×¥Ç¥Ð¥¤¥¹¤Ë´Ø¤¹¤ë¥·¥¹¥Æ¥à¥Õ¥¡¥¤¥ëµ½Ò»Ò¤ò
|
|
Áàºî¤·¤Þ¤¹¡£¤³¤ì¤é¤Îµ½Ò»Ò¤Ïɸ½à¤Î
|
|
.Tn I/O
|
|
.Dv FILE
|
|
typedef ¤È¤Ï´Ø·¸¤ò»ý¤Ã¤Æ¤ª¤é¤º¡¢
|
|
.Pa /dev
|
|
¥Ç¥£¥ì¥¯¥È¥êÃæ¤Ë¤¢¤Ã¤Æ
|
|
.Pa /dev/tty Ns Em xx
|
|
¤È¤¤¤¦Ì¾Á°¤ò»ý¤Á¡¢
|
|
¤½¤ì¤Ë¤Ä¤¤¤Æ¤Ï½é´üÀßÄê¥Õ¥¡¥¤¥ë
|
|
.Pa /etc/ttys
|
|
¤ÎÃæ¤Ë¥¨¥ó¥È¥ê¤¬Â¸ºß¤¹¤ë¤è¤¦¤ÊÆÃÊ̥ǥХ¤¥¹¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Þ¤¹(
|
|
.Xr ttys 5
|
|
»²¾È )¡£
|
|
.Pp
|
|
.Fn isatty
|
|
´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ëµ½Ò»Ò
|
|
.Fa fd
|
|
¤¬Í¸ú¤ÊüËö¥¿¥¤¥×¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òȽÃǤ·¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn ttyname
|
|
´Ø¿ô¤Ï¡¢
|
|
.Fn isatty
|
|
¤¬¿¿¤Ç¤¢¤ë¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ë´ØÏ¢¤¹¤ë¥Ç¥Ð¥¤¥¹Ì¾¤ò¼èÆÀ¤·¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn ttyslot
|
|
´Ø¿ô¤Ï¡¢
|
|
.Xr ttys 5
|
|
¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤«¤é¸½ºß¤Î¥×¥í¥»¥¹¤ÎÀ©¸æÃ¼ËöÈÖ¹æ¤ò¼è¤Ã¤Æ¤¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
.Fn ttyname
|
|
´Ø¿ô¤Ï¡¢¥Ç¥Ð¥¤¥¹¤¬¸«¤Ä¤«¤Ã¤Æ
|
|
.Fn isatty
|
|
¤¬¿¿¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢null ¤Ç½ªÃ¼¤µ¤ì¤¿Ì¾Á°¤òÊÖ¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢
|
|
.Dv NULL
|
|
¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn ttyslot
|
|
´Ø¿ô¤Ï¡¢¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ì¤Ð¤½¤Î¥æ¥Ë¥Ã¥ÈÈÖ¹æ¤ò
|
|
ÊÖ¤·¤Þ¤¹¡£¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢ÃÍ¥¼¥í¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Sh ¥Õ¥¡¥¤¥ë
|
|
.Bl -tag -width /etc/ttys -compact
|
|
.It Pa /dev/\(**
|
|
.It Pa /etc/ttys
|
|
.El
|
|
.Sh »²¾È
|
|
.Xr ioctl 2 ,
|
|
.Xr ttys 5
|
|
.Sh Îò»Ë
|
|
.Fn isatty ,
|
|
.Fn ttyname ,
|
|
¤ª¤è¤Ó
|
|
.Fn ttyslot
|
|
´Ø¿ô¤Ï¡¢
|
|
.At v7
|
|
¤Ë¸½¤ì¤Þ¤·¤¿¡£
|
|
.Sh ¥Ð¥°
|
|
.Fn ttyname
|
|
´Ø¿ô¤Ï¡¢¤½¤Î·ë²Ì¤òÆâÉôÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÃæ¤Ë»Ä¤·¡¢¤½¤Î
|
|
¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£¤½¤ì°Ê¸å¤Ë
|
|
.Fn ttyname
|
|
¤ò¸Æ¤Ó½Ð¤¹¤È¡¢¤½¤ÎƱ¤¸¥ª¥Ö¥¸¥§¥¯¥È¤Ï½¤Àµ¤µ¤ì¤Þ¤¹¡£
|