pty

å称
     pty — ç似端æ«ãã©ã¤ã

æ¸å¼
     pseudo-device pty [count]

解説
     pty ãã©ã¤ã㯠çä¼¼ç«¯æ« ã¨å¼ã°ããããã¤ã¹å¯¾ã®ãµãã¼ããæä¾ãã¾ãã ç似端æ«ã¨ã¯ã
     ãã¹ã¿ ããã¤ã¹ã¨ ã¹ã¬ã¼ã ããã¤ã¹ã¨ãã ä¸å¯¾ã®ãã£ã©ã¯ã¿åããã¤ã¹ã§ãã
     ã¹ã¬ã¼ãããã¤ã¹ã¯ã tty(4) ã«è¨è¿°ããã¦ãããã®ã¨åä¸ã®ã¤ã³ã¿ãã§ã¼ã¹ããã‐
     ã»ã¹ã«æä¾ãã¾ãã ãã ãã tty(4)
     ã«è¨è¿°ãããã¤ã³ã¿ãã§ã¼ã¹ãæä¾ãããããªä»ã®ããã¤ã¹ã¯ãã¹ã¦ã
     æ ¹åºã«ä½ããã®ãã¼ãã¦ã§ã¢ããã¤ã¹ãæã¤ã®ã«å¯¾ãã
     ã¹ã¬ã¼ãããã¤ã¹ã¯ç似端æ«ã®ãã¹ã¿å´ãéãã¦å¥ã®ããã»ã¹ã«æä½ããã¾ãã
     ã¤ã¾ãããã¹ã¿ããã¤ã¹ã«æ¸ãè¾¼ã¾ããå容㯠ãã¹ã¦ã¹ã¬ã¼ãããã¤ã¹ã¸å¥åã¨ãã¦éããã
     ã¹ã¬ã¼ãããã¤ã¹ã«æ¸ãè¾¼ã¾ããå容㯠ãã¹ã¦ãã¹ã¿ããã¤ã¹ã¸å¥åã¨ãã¦æ¸¡ããã¾ãã

     ã«ã¼ãã«è¨å®ãã¡ã¤ã«ä¸ã®æå®ã«ãªãã·ã§ã³ã® count
     ãä¸ããã¨ããã®æ°ã ãç似端æ«ã®çµãæ§æããã¾ãã count ã®ããã©ã«ã㯠32 ã§ãã

     次ã«æãã ioctl(2) å¼ã³åºãã¯ç似端æ«ã«ã®ã¿é©ç¨ã§ãã¾ã:

     TIOCSTOP    端æ«ã¸ã®åºåãæ¢ãã¾ã (ä¾ãã° ‘^S’ ãæ¼ãããã«)ã ãã©ã¡ã¼ã¿ã¯åãã¾ããã

     TIOCSTART   ( TIOCSTOP ã ‘^S’ ãæ¼ããã¨ã§æ¢ãããã¦ãã ) åºåãåéãã¾ãã
                 ãã©ã¡ã¼ã¿ã¯åãã¾ããã

     TIOCPKT     ãã±ãã ã¢ã¼ããæå¹/ç¡å¹ã«ãã¾ãã ãã±ããã¢ã¼ãã¯é 0 ã®ãã©ã¡ã¼ã¿ãæå®
                 (åç§æ¸¡ã) ããã¨æå¹ã«ãªãã 0 ãæå® (åç§æ¸¡ã) ããã¨ç¡å¹ã«ãªãã¾ãã
                 ç似端æ«ã®ãã¹ã¿å´ã«é©ç¨ãããå ´åã以å¾ç«¯æ«ãã read(2)
                 ãå¼ã³åºãã¨ã1 åã® 0 ãã¤ã (ã·ã³ãã«å®ç¾©ã§ã¯ TIOCPKT_DATA )
                 ã«ç¶ãã¦ç似端æ«ã®ã¹ã¬ã¼ãå´ã«æ¸ãè¾¼ã¾ãããã¼ã¿ãè¿ããããã
                 ãããã¯å¶å¾¡ç¶ææå ±ã表ãåä¸ãã¤ããè¿ãããããã«ãªãã¾ãã
                 å¾èã®å ´åãè¿ããããã¤ãã¯æ¬¡ã®ãããã® 0 å以ä¸ã®å (OR) ã«ãªãã¾ã:

                 TIOCPKT_FLUSHREAD   端æ«ã®èªã¿è¾¼ã¿ãã¥ã¼ããã©ãã·ã¥ãããã¨ã

                 TIOCPKT_FLUSHWRITE  端æ«ã®æ¸ãè¾¼ã¿ãã¥ã¼ããã©ãã·ã¥ãããã¨ã

                 TIOCPKT_STOP        端æ«ã¸ã®åºåã ‘^S’ ã®ããã«ãã¦æ¢ããããã¨ã

                 TIOCPKT_START       端æ«ã¸ã®åºåãåéãããã¨ã

                 TIOCPKT_DOSTOP      t_stopc ã ‘^S’ 㧠t_startc ã ‘^Q’
                                     ã¨ãªã£ãã¨ã

                 TIOCPKT_NOSTOP      START æåãSTOP æåã ‘^S/^Q’ ã§ãªããªã£ãã¨ã

                                     ãã®ã¢ã¼ããæå¹ãªéã ãã¹ã¿å´ããèª‐
                                     ã¿è¾¼ã¾ããå¶å¾¡ç¶ææå ±ã®åå¨ã¯ select(2)
                                     ã§ä¾å¤æ¡ä»¶ã¨ãã¦æ¤åºã§ãã¾ãã

                                     rlogin(1) ã rlogind(8) ã¯ãã®ã¢ã¼ããç¨ãã¦ã
                                     ãªã¢ã¼ãå´ã§ã¨ã³ã¼ããã¼ã«ã«å´ã§ ‘^S/^Q’ ãã‐
                                     ã¼å¶å¾¡ãããåºåã®ããã¯ãã©ãã·ã¥ãé©åã«è¡ãªããã
                                     ãªã¢ã¼ããã°ã¤ã³æ©æ§ãå®è£ãã¦ãã¾ãã
                                     ãã®ä»ã®ä¼¼ããã‐
                                     ã°ã©ã ã§ããã®ã¢ã¼ããå©ç¨ã§ãã¾ãã

     TIOCUCNTL   å°æ°ã®åç´ãªã¦ã¼ã¶ ioctl(2) ã³ãã³ããã TIOCPKT ã¨ä¼¼ããã‐
                 ãã³ã«ãç¨ãã¦ç似端æ«ãéãã¦æ¸¡ããã¨ã®ã§ããã¢ã¼ããã æå¹/ç¡å¹ã«ãã¾ãã
                 TIOCUCNTL ã¢ã¼ã㨠TIOCPKT ã¢ã¼ãã¯äºãã«æä»çã§ãã
                 ãã®ã¢ã¼ãã¯ç似端æ«ã®ãã¹ã¿å´ããè¨å®ãã¾ãã é 0 ã®ãã©ã¡ã¼ã¿ãæå®
                 (åç§æ¸¡ã) ããã¨æå¹ã«ãªãã 0 ãæå® (åç§æ¸¡ã) ããã¨ç¡å¹ã«ãªãã¾ãã
                 以å¾ãã¹ã¿å´ãã read(2) ãå¼ã³åºãã¨ã 1 åã® 0
                 ãã¤ãã«ç¶ãã¦ç似端æ«ã®ã¹ã¬ã¼ãå´ã«æ¸ãè¾¼ã¾ãããã¼ã¿ãè¿ããããã
                 ãããã¯ã¹ã¬ã¼ãå´ã®ã¦ã¼ã¶å¶å¾¡æä½ã表ãåä¸ã®ãã¤ããè¿ãããããã«ãªãã¾ãã
                 ã¦ã¼ã¶å¶å¾¡ã³ãã³ãã¯ããã¼ã¿ãæããªãç¹å¥ãª ioctl(2)
                 æä½ã§æ§æããã¾ããã³ãã³ã㯠UIOCCMD(n) ã®å½¢ã§æ¸¡ãã¾ããããã§ã n 㯠1
                 ãã 255 ã®ç¯å²ã®æ°åã§ãã æä½å¤ n ã¯ããã¹ã¿å´ããã®æ¬¡åã® read(2)
                 ã«ããåä¸ãã¤ãã¨ãã¦åãåããã¾ãã ioctl(2) UIOCCMD(0)
                 ã¯ä½ãæä½ã¯è¡ãã¾ããã (no-op)ã ãã®æ©è½ã®æç¡ã調ã¹ãããã«ä½¿ãã¾ãã
                 TIOCPKT ã¢ã¼ãã®å ´åã¨åæ§ãã³ãã³ãæä½ã¯ select(2)
                 ã§ä¾å¤æ¡ä»¶ã¨ãã¦æ¤åºã§ãã¾ãã

     TIOCREMOTE  ç似端æ«ã®ãã¹ã¿å´ç¨ã®ã¢ã¼ãã§ã TIOCPKT ã¨ã¯ç¬ç«ã§ãã
                 ãã®ã¢ã¼ãã§ã¯ (端æ«ã®ã¢ã¼ãã«é¢ããã)ã ç似端æ«ã¸ã®å¥åããã‐
                 ã¼å¶å¾¡ããå¥åç·¨éãè¡ããªãããã«ãã¾ãã å¶å¾¡ç«¯æ«ã¸æ¸ãè¾¼ã¿ãè¡ãã¨ã
                 ãã®ç«¯æ«ããèªã¿è¾¼ãããã»ã¹ã®ããã«ã¬ã³ã¼ãå¢çãä½ããã¾ãã
                 é常ã®ä½¿ç¨ã§ã¯ã
                 ãã¼ã¿ã®æ¸ãè¾¼ã¿ã¯ãã®ãã¼ã¿ã端æ«ããè¡å¥åãããããã«ãªãã 0
                 ãã¤ãã®æ¸ãè¾¼ã¿ã¯ãã¡ã¤ã«çµäºæåãå¥åãããããã«ãªãã¾ãã TIOCREMOTE
                 ã¯ãã¦ã£ã³ãã¦ããã¼ã¸ã£ã§ãªã¢ã¼ãè¡ç·¨éãè¡ãã¨ããã å¥åããã‐
                 ã¼å¶å¾¡ããå¿è¦ã®ããã¨ãã«å©ç¨ã§ãã¾ãã

é¢é£ãã¡ã¤ã«
     /dev/pty[p-sP-S][0-9a-v]   ãã¹ã¿ç似端æ«
     /dev/tty[p-sP-S][0-9a-v]   ã¹ã¬ã¼ãç似端æ«

診æ
     ããã¾ããã

é¢é£é ç®
     tty(4)

æ´å²
     pty ãã©ã¤ã㯠4.2BSD ããç»å ´ãã¾ããã