console_ioctl

CONSOLE_IOCTLS(4)          Linux Programmer's Manual         CONSOLE_IOCTLS(4)



åå
       console ioctl's - 端æ«ã³ã³ã½ã¼ã«ã¨ä»®æ³ã³ã³ã½ã¼ã«ã® ioctl

説æ
       è¦å: ããªãã以ä¸ã®æå ±ã使ããªãããããªãã®è¦æã§ã©ããã

       è¦åï¼ioctl ã¯ææ¸åãããªã Linux ã®åé¨æ©è½ã§ãããè¦åãªãã«å¤æ´ ãããæããããããªãã¹ã
       POSIX æ©è½ã使ããã¨ãå§ããã

       次ã®ãã㪠Linux åºæã® ioctl() ããµãã¼ãããã¦ããã
       ãããã3çªç®ã®å¼æ°ãå¿è¦ã§ãããããã§ã¯ argp ã¨ããã


       KDGETLED
              LED ã®ç¶æãåå¾ãããargp 㯠long int ã®ãã¤ã³ã¿ã¼ã§ããã *argp ã®ä¸ä½ 3
              ãããã«ä»¥ä¸ã®ããã« LED ã®ç¶æãã»ãããããã
                  LED_CAP       0x04   ãã£ãã¿ã«ããã¯ãç¹ç¯
                  LEC_NUM       0x02   ãã³ãã¼ããã¯ãç¹ç¯
                  LED_SCR       0x01   ã¹ã¯ãã¼ã«ããã¯ãç¹ç¯


       KDSETLED
              LEDãç¹ç¯ããããLED㯠argp ã®ä¸ä½ 3 ãããã«å¾ãç¹ç¯ãããã
              ããããããé«ä½ã®ããããã»ããããã¦ããæã«ã¯ããã£ãã¿ã«ããã¯ãã ã³ãã¼ããã¯ãã¹ã¯ã‐
              ã¼ã«ããã¯ã®ãã¼ãã¼ãæ©è½ã®ç¶æã表示ãã LED 㯠é常ç¶æã«æ»ãã

       ã«ã¼ãã« 1.1.54 以åã¯ãLED ã¯ããããã®ãã¼ãã¼ããã©ã°ã®ç¶æãåæ ãã
       ã ãã§ãKDGETLED/KDSETLED ããã¼ãã¼ããã©ã°ãå¤æ´ããã ãã§ãã£ãã ã«ã¼ãã«l 1.1.54
       ãã㯠LED ã«ä»»æã®è¡¨ç¤ºãããäºãã§ããããã«ãªã£ããã ããã©ã«ãã§ã¯ã‐
       ã¼ãã¼ããã©ã°ã表示ããã 次ã«ç¤ºã 2 ã¤ã® ioctl ã¯ã‐
       ã¼ãã¼ããã©ã°ã«ã¢ã¯ã»ã¹ããã®ã«ç¨ããããã


       KDGKBLED
              ãã£ãã¿ã«ããã¯ããã³ãã¼ããã¯ãã¹ã¯ãã¼ã«ããã¯ã®(LED ã®è¡¨ç¤ºã§ã¯ãª ã)ã‐
              ã¼ãã¼ããã©ã°ãå¾ãã argp ã¯ãã©ã°ã®ç¶æãã»ãããããæåå¤æ°ãæãã
              (0x7)ã§ãã¹ã¯ãã¦å¾ãããä¸ä½ 3 ããããç¾å¨ã®ãã©ã°ã®ç¶æã示ãã
              (0x70)ã§ãã¹ã¯ãã¦å¾ããã次㮠3 ããããããã©ã«ãã®ãã©ã°ã®ç¶æã示
              ãã(ã«ã¼ãã« 1.1.54以é)


       KDSKBLED
              ãã£ãã¿ã«ããã¯ããã³ãã¼ããã¯ãã¹ã¯ãã¼ã«ããã¯ã®(LED ã®è¡¨ç¤ºã§ã¯ãª ã)ã‐
              ã¼ãã¼ããã©ã°ãã»ããããã argp ãã»ããããããã©ã°ã§ããã
              (0x7)ã§ãã¹ã¯ãã¦å¾ãããä¸ä½ 3 ãããããã©ã°ã®ç¶æã§ã(0x70)ã§ãã¹ã¯
              ã¦å¾ããã次㮠3 ããããããã©ã«ãã®ãã©ã°ã®ç¶æã§ããã(ã«ã¼ãã« 1.1.54以é)


       KDGKBTYPE
              ãã¼ãã¼ãã®ç¨®é¡ãå¾ããããã¯å¤ 0x02 ã¨å®ç¾©ããã¦ãã KB_101ãè¿ãã


       KDADDIO
              I/Oãã¼ããæå¹ãªç©ã¨ãã¦å ããããã㯠ioperm(arg,1,1)ã¨ç価ã§ããã


       KDDELIO
              I/Oãã¼ããæå¹ãªç©ããå¤ãããã㯠ioperm(arg,1,0)ã¨ç価ã§ããã


       KDENABIO
              ãããªãã¼ãã¸ã® I/O ãå¯è½ã«ããããã㯠ioperm(0x3b4, 0x3df-0x3b4+1, 1)
              ã¨ç価ã§ããã


       KDDISABIO
              ãããªãã¼ãã¸ã® I/O ãä¸å¯è½ã«ããããã㯠ioperm(0x3b4, 0x3df-0x3b4+1,
              0)ã¨ç価ã§ããã


       KDSETMODE
              ããã¹ã/ã°ã©ãã£ã¯ã¹ã¢ã¼ããè¨å®ãããargp ã¯æ¬¡ã®ãã¡ã®ã©ããï¼
                  KD_TEXT       0x00
                  KD_GRAPHICS   0x01


       KDGETMODE
              ããã¹ã/ã°ã©ãã£ã¯ã¹ã¢ã¼ããåå¾ããã argp ãæã long åå¤æ°
              ã«ä¸è¿°ã®å¤ã®ã©ã¡ãããã»ãããããã


       KDMKTONE
              æå®ãããé·ãã®ãã¼ã³ãçºçããã argp ã®ä¸ä½ 16 ãããã¯ã¯ã‐
              ãã¯ãµã¤ã¯ã«ãåä½ã«ãã¦å¨æãæå®ãã ä¸ä½ 16 ãããã msec
              ã®åä½ã§è¡¨ããã(ãã¼ã³ãçºçããã)æéãæå®ã ãã ãã¼ã³ãçºçãããæéãã¼ã‐
              ã®ã¨ãã¯ããµã¦ã³ãã¯ãªãã«ãªãã å¶å¾¡ã¯ç´ã¡ã«æ»ãã ä¾ãã°ãargp =
              (125<<16) + 0x637 ã¨ããã°ãé常 ctrl-G ãæ¼ããæ ã«çºçããé³ã«ãªãã
              (ã«ã¼ãã« 0.99pl1 以é;ãã®æ©è½ã¯ ã«ã¼ãã« 2.1.49 ãã 2.1.50
              ã§ã¯ãã°ã®ããåä½ããªã)


       KIOCSOUND
              é³ã®çºçã®éå§ãåæ¢ãè¡ãã argp ã®ä¸ä½ 16 ãããã¯ã¯ã‐
              ãã¯ãµã¤ã¯ã«ãåä½ã¨ãã¦å¨æã示ãã (ã¤ã¾ã argp = 1193180/å¨æ³¢æ°)ã
              argp = 0 ã®å ´åããµã¦ã³ãã¯ãªãã«ãªãã
              ã©ã¡ãã®å ´åã§ãããã ã¡ã«å¶å¾¡ã¯æ»ãã


       GIO_CMAP
              ç¾å¨ã®ããã©ã«ãã®ã«ã©ã¼ããããã«ã¼ãã«ããåå¾ãããargp 㯠48
              ãã¤ãã®éåã¸ã®ãã¤ã³ã¿ã¼ã(ã«ã¼ãã« 1.3.3 以é)


       PIO_CMAP
              ããã©ã«ãã®ããã¹ãã¢ã¼ãã®ã«ã©ã¼ããããå¤æ´ããã argp ãæã 48 ãã¤ãã®éåä¸‐
              ã«ã¯ã16 ã®å¯è½ãªã¹ã¯ãªã¼ã³ã®è²ãã 赤ãç·ãéã®é ã« 0
              ããªãã255ãæ大強度ã¨ããå¤ã¨ãã¦ç´ããã
              ããã©ã«ãã®è²ã¯é ã«ãé»ãæ¿ã赤ãæ¿ãç·ãè¶ãæ¿ãéãæ¿ãç´«ãæ¿ãã·ã¢
              ã³ãæããç°è²ãæ¿ãç°è²ãæãã赤ãæããç·ãé»ãæããéãæããç´«ã
              æããã·ã¢ã³ãç½ã§ããã(ã«ã¼ãã« 1.3.3以é)


       GIO_FONT
              æ¡å¼µãããå½¢å¼ã§ 256 æåã®ã¹ã¯ãªã¼ã³ãã©ã³ããå¾ãã argp 㯠8192
              ãã¤ãã®éåãæãã ç¾å¨ãã¼ãããã¦ãããã©ã³ãã 512 æå‐
              ã®ãã©ã³ãã§ããããã³ã³ã½ã¼ã« ãããã¹ãã¢ã¼ãã§ãªãæã«ã¯å¤±æã EINVAL
              ã®ã¨ã©ã¼ã³ã¼ããè¿ãã


       GIO_FONTX
              ã¹ã¯ãªã¼ã³ãã©ã³ãã¨ããã«é¢é£ããæå ±ãåå¾ãããargp ã¯æ§é ä½
              consolefontdesc (PIO_FONTX ãåç§ã®ãã¨)ãæãã
              é¢æ°å¼ã³åºãã®ã¨ãã«ã¯ãcharcount ã«ã¯ãchardata ãæããã
              ãã¡ã«ããã¾ãæ大ã®æåæ°ãã»ããããªããã°ãªããªãã é¢æ°å¼ã³åºãããæ»ã£ãæã«ã¯
              charcount 㨠charheight ã«ã¯ã ç¾å¨ã‐
              ã¼ãããã¦ãããã©ã³ãã®è©²å½ãããã¼ã¿ãåãããã¦ããã éå chardata ã«ã¯ãæåã«
              charcount ã«ãããå¤ã«ãã£ã¦ãã©ã³
              ããåããã®ã«ååãªã¹ãã¼ã¹ãããã¨ãããã°ãã©ã³ããã¼ã¿ãåããããã
              ããã§ãªãæã«ã¯ããããã¡ã¯å¤æ´ãããã errno ã« ENOMEM ã ã»ããããã(ã«ã¼ãã«
              1.3.1 以é)ã


       PIO_FONT
              256 æåã®ãã©ã³ããã»ãããããEGA/VGA ãã£ã©ã¯ã¿ã¼ã¸ã§ãã¬ã¼ã¿ã¼
              (character generator) ã«ãã©ã³ãããã¼ãããã argp ã¯ã8192 ãã¤ã(ä¸æå 32
              ãã¤ã)ã®ããããæãã ãããã®ãã¡ãæåã® N ã®ã¿ã 8xN ã®ãã©ã³ãã®ããã«ç¨ãã ãã(0
              < N <= 32)ã ãã®å¼ã³åºãããã㨠Unicode ã®ãããã³ã°ãç¡å¹ã«ãªãã


       PIO_FONTX
              ã¹ã¯ãªã¼ã³ãã©ã³ãã¨ãããã«é¢é£ããã¬ã³ããªã³ã°æå ±ãã»ããããã argp ã¯ã
              struct consolefontdesc {
                    u_short charcount;  /* ãã©ã³ãã®æåæ°(256ã¾ãã¯512) */
                    u_short charheight; /* ä¸æåã®èµ°æ»ç·ã®æ°(1-32) */
                    char *chardata;     /* å±éããããã©ã³ããã¼ã¿ */
              };
              ã¨ããæ§é ä½ãæãã

              å¿è¦ãªãã¹ã¯ãªã¼ã³ã¯é©å½ã«ãµã¤ãºå¤æ´ãããSIGWINCH ãé©åãªãã
              ã»ã¹ã«éãããã ãã®ã³ã¼ã«ã«ãã Unicode ã®ãããã³ã°ãç¡å¹ã«ãªãã


       PIO_FONTRESET
              ã¹ã¯ãªã¼ã³ãã©ã³ãããµã¤ãºã Unicode ãããã³ã°ããã¼ãæã®ããã©ã«ã
              å¤ã«ãªã»ãããããargp ã¯ç¨ããããªãããå°æ¥ã®ãã¼ã¸ã§ã³ã® Linux
              ã¨ã®äºææ§ãä¿ã¤ããã« NULL ã«ã»ãããã¹ãã§ããã

       GIO_SCRNMAP
              ã¹ã¯ãªã¼ã³ãããã³ã°ãã«ã¼ãã«ããåå¾ãããargp ã¯ãµã¤ãº E_TABSZ
              ã®é åãæãããã®é åã«ã¯åãã£ã©ã¯ã¿ã¼ã表示ããã®ã«ç¨ãããããã©ã³
              ãã®ä½ç½®ããã¼ãããã¦ããã ãã®å¼ã³åºãã¯ç¾å¨ãã¼ãããã¦ãããã©ã³ãã 256 æå‐
              ãããå¤ãæã«ã¯ ç¡æå³ãªæå ±ãè¿ãäºãå¤ãã


       GIO_UNISCRNMAP
              ãã« Unicode ã¹ã¯ãªã¼ã³ãããã³ã°ãã«ã¼ãã«ããåå¾ããã argp ã¯ãµã¤ãº
              E_TABSZ*sizeof(unsigned short) ã®é åãæãããã® é åã«ã¯åã‐
              ã£ã©ã¯ã¿ã¼ã示ã Unicode ããã¼ãããã¦ããã U+F000 ã«å§ã¾ã Unicode
              ã®ç¹å¥ãªéåã¯ãããã©ã³ãç´æ¥ãª(direct to
              font)ããããã³ã°ã示ãã®ã«ç¨ãããã(ã«ã¼ãã« 1.3.1 以é)ã


       PIO_SCRNMAP
              ãã¦ã¼ã¶ã¼å®ç¾©å¯è½ãª(user definable)ã(4çªç®ã®)ãã¼ãã«ãã«ã¼ãã«ã«ã‐
              ã¼ ãããããã®ãã¼ãã«ã¯åãã¤ããã¹ã¯ãªã¼ã³ã·ã³ãã«ã«ãããã³ã°ããã argp
              ã¯ãµã¤ãºE_TABSZã®é åãæãã


       PIO_UNISCRNMAP
              ãã¦ã¼ã¶ã¼å®ç¾©å¯è½ãªã(4çªç®ã®)ãã¼ãã«ãã«ã¼ãã«ã«ãã¼ãããããã®ãã¼
              ãã«ã¯åãã¤ããã¦ãã³ã¼ãã«ãããã³ã°ãããã®å¾ãç¾å¨ãã¼ãããã¦ãã
              ã¦ãã³ã¼ããããã©ã³ãã¸ã®ãããã«å¾ãã¹ã¯ãªã¼ã³ã·ã³ãã«ã«å¤æãããã U+F000
              ã«å§ã¾ãã¦ãã³ã¼ãã¯ç´æ¥ãã©ã³ãã·ã³ãã«ã«ãããã³ã°ããã®ã«ä½¿ ãã(ã«ã¼ãã«
              1.3.1 以é)


       GIO_UNIMAP
              Unicode ãããã©ã³ãã¸ã®ãããã³ã°ãã«ã¼ãã«ããåå¾ãããargp ã¯ã
              struct unimapdesc {
                    u_short entry_ct;
                    struct unipair *entries;
              };
              ã¨ããæ§é ä½ãæãã

              ãã㧠entries ã¯ã
              struct unipair {
                    u_short unicode;
                    u_short fontpos;
              };
              ã¨ããæ§é ä½ã®ã®éåã¸ã®ãã¤ã³ã¿ã¼ã§ããã (ã«ã¼ãã« 1.1.92 以é)


       PIO_UNIMAP
              Unicode ãããã©ã³ãã¸ã®ãããã³ã°ãã«ã¼ãã«ã«ã»ãããããargp ã¯æ§é ä½
              unimapdesc ã¸ã®ãã¤ã³ã¿ã¼ã§ããã(ã«ã¼ãã« 1.1.92 以é)


       PIO_UNIMAPCLR
              ãã¼ãã«ãã¯ãªã¢ãããã®äºããã·ã¥ã¢ã«ã´ãªãºã ã«ä¼ããã argpã¯
              struct unimapinit {
                    u_short advised_hashsize;  /* 0 if no opinion */
                    u_short advised_hashstep;  /* 0 if no opinion */
                    u_short advised_hashlevel; /* 0 if no opinion */
              };
              ã¨ããæ§é ä½ãæããã¤ã³ã¿ã¼ã§ããã (ã«ã¼ãã« 1.1.92 以é)


       KDGKBMODE
              ç¾å¨ã®ãã¼ãã¼ãã¢ã¼ããåå¾ãããargp ã®æã long åå¤æ°ãã
              次ã®ãã¡ã®ã©ããã«è¨å®ãããã
                  K_RAW         0x00
                  K_XLATE       0x01
                  K_MEDIUMRAW   0x02
                  K_UNICODE     0x03


       KDSKBMODE
              ç¾å¨ã®ãã¼ãã¼ãã¢ã¼ããè¨å®ããã argp ã¯ä¸è¨ã®å¤ã®ãã¡ã®ã©ããã«ç‐
              ããå¤ã«ããã


       KDGKBMETA
              ã¡ã¿ãã¼ãã³ããªã³ã°ã¢ã¼ã(meta key handling mode)ãåå¾ããã argp ãæã
              long åå¤æ°ã¯ã次ã®ãã¡ã®ã©ããã«è¨å®ãããã
                  K_METABIT     0x03   set high order bit
                  K_ESCPREFIX   0x04   escape prefix


       KDSKBMETA
              ã¡ã¿ãã¼ãã³ããªã³ã°ã¢ã¼ããè¨å®ããã argp ã¯ä¸è¨ã®å¤ã®ã©ããã«çããå¤ã«ããã


       KDGKBENT
              ãã¼ã³ã¼ããã¢ã¯ã·ã§ã³ã³ã¼ãã«å¤æãããã¼å¤æ表ã®ã¨ã³ããªã¼ã®ä¸ã¤ãå
              å¾ããã argp ã¯ã
              struct kbentry {
                  u_char kb_table;
                  u_char kb_index;
                  u_short kb_value;
              };
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã æåã®2ã¤ã®è¦ç´ ãkb_table ã«ã¯é¸æãããã¼ãã¼ãã« (0
              <= kb_table < MAX_NR_KEYMAPS)ãkb_index ã«ã¯ãã¼ã³ã¼ã(0 <=
              kb_index < NR_KEYS)ãè¨å®ããã kb_value
              ã¯å¯¾å¿ããã¢ã¯ã·ã§ã³ã³ã¼ããã¾ãã¯ããã®ãããªãã¼ã㪠ãã¨ãã«ã¯
              K_HOLEãkb_table ãç¡å¹ãªæã«ã¯ K_NOSUCHMAP ã«è¨å®ãããã


       KDSKBENT
              å¤æãã¼ãã«ã®ã¨ã³ããªã¼ã®ä¸ã¤ãè¨å®ãããargp ã¯æ§é ä½ kbentry
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã


       KDGKBSENT
              ãã¡ã³ã¯ã·ã§ã³ãã¼ã®æååãåå¾ãããargp ã¯ã
              struct kbsentry {
                  u_char kb_func;
                  u_char kb_string[512];
              };
              ã¨ããæ§é ä½ã¸ã®ãã¤ã³ã¿ã¼ã§ããã

              kb_func çªç®ã®ãã¡ã³ã¯ã·ã§ã³ãã¼ã®ã¢ã¯ã·ã§ã³ã³ã¼ãã«å¯¾å¿ãã (NULL
              ã§çµç«¯ããã)æååã kb_string ã«è¨å®ãããã


       KDSKBSENT
              ãã¡ã³ã¯ã·ã§ã³ãã¼ã®æååã®ã¨ã³ããªã¼ãè¨å®ãããargp ã¯ã æ§é ä½ kbsentry
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã


       KDGKBDIACR
              ã«ã¼ãã«ã®ã¢ã¯ã»ã³ããã¼ãã«(accent table)ãèªã¿è¾¼ããargpã¯ã
              struct kbdiacrs {
                  unsigned int kb_cnt;
                 struct kbdiacr kbdiacr[256];
              };
              ã¨ããæ§é ä½ã¸ã®ãã¤ã³ã¿ã¼ã§ããã ããã§ãkb_cnt ã¯éåä¸‐
              ã®ã¨ã³ããªã¼ã®åæ°ã§ãåãã®ã¨ã³ããªã¼ã¯ã
              struct kbdiacr {
              u_char diacr,
              base, result;
              };
              ã¨ããæ§é ä½ã§ããã


       KDGETKEYCODE
              ã«ã¼ãã«ã®(ã¹ãã£ã³ã³ã¼ããããã¼ã³ã¼ã㸠å¤æãã)ã‐
              ã¼ã³ã¼ããã¼ãã«ã¨ã³ããªã¼ãèªã¿è¾¼ãã argp ã¯ã
              struct kbkeycode { unsigned int scancode, keycode; };
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã keycode ã¯ãscancode ã«å¯¾å¿ããå¤ã«è¨‐
              å®ãããã(ãã ãã89 <= scancode <= 255ã®ã¿ã«ã¤ãã¦ã1 <= scancode <=
              88ã§ã¯ keycode == scancode ã§ããã) (ã«ã¼ãã« 1.1.63 以é)


       KDSETKEYCODE
              ã«ã¼ãã«ã®ãã¼ã³ã¼ããã¼ãã«ã¨ã³ããªã¼ãæ¸ãè¾¼ããargp ã¯æ§é ä½ kbkeycode
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã (ã«ã¼ãã« 1.1.63 以é)


       KDSIGACCEPT
              ãã®é¢æ°å¼ã³åºãã¯ãç¹å¥ãªçµåãã§ãã¼ãæ¼ããæã«çºçããã·ã°ãã« argp (1 <=
              argp <= NSIG) ãé²ãã§åãä»ãããã©ããã示ãã (
              linux/drivers/char/keyboard.c ã® Spawn_console() ãè¦ãã)


       VT_OPENQRY
              æåã®ç©ºãã¦ãã(ã¾ã ãªã¼ãã³ããã¦ããªã)ã³ã³ã½ã¼ã«ãè¿ãã argp
              ã®æãæ´æ°ã«ã¯ãvt ã®çªå·ãã»ããããã (1 <= *argp <= MAX_NR_CONSOLES)ã


       VT_GETMODE
              ã¢ã¯ãã£ã㪠vt ã®ã¢ã¼ããåå¾ãããargpã¯ã
              struct vt_mode {
                 char mode;     /* vt mode */
                 char waitv;    /* if set, hang on writes if not active */
                 short relsig;  /* signal to raise on release req */
                 short acqsig;  /* signal to raise on acquisition */
                 short frsig;   /* unused (set to 0) */
              };
              ã¨ããæ§é ä½ãæããã¤ã³ã¿ã§ãããã¢ã¯ãã£ã㪠vt ã®ã¢ã¼ããã»ãããã ãã mode
              ã¯æ¬¡ã®ã©ããã«è¨å®ãããï¼
                 VT_AUTO       èªåvtåæ¿ã
                 VT_PROCESS    ããã»ã¹ã³ã³ããã¼ã«åæ¿ã
                 VT_ACKACQ     ã¢ã¯ããªãã¸åæ¿ã


       VT_SETMODE
              ã¢ã¯ãã£ã㪠vt ã®ã¢ã¼ããè¨å®ãããargp ã¯æ§é ä½ vt_mode ã¸ã®ã
              ã¤ã³ã¿ã¼ã§ããã


       VT_GETSTATE
              ã°ãã¼ãã«ãª vt ã®ç¶æã®æå ±ãåå¾ãããargpã¯ã
              struct vt_stat {
                 ushort v_active;  /* active vt */
                 ushort v_signal;  /* signal to send */
                 ushort v_state;   /* vt bitmask */
              };
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã 使ç¨ããã¦ããããããã® vt ã«ã¤ã v_state
              ã®å¯¾å¿ããããããã»ã ããããã (ã«ã¼ãã«l 1.0 ãã 1.1.92 ã¾ã§)


       VT_RELDISP
              ãã£ã¹ãã¬ã¼ã解æ¾ããã


       VT_ACTIVATE
              argp (1 <= argp <= MAX_NR_CONSOLES)ã® vt ã«åæ¿ããã


       VT_WAITACTIVE
              argpã® vt ãã¢ã¯ãã£ãã«ãªãã¾ã§å¾ã¤ã


       VT_DISALLOCATE
              argp ã® vt ã«çµã³ã¤ããããã¡ã¢ãªã¼ã解æ¾ããã (ã«ã¼ãã« 1.1.54 以é)


       VT_RESIZE
              ã«ã¼ãã«ãèªèããã¹ã¯ãªã¼ã³ãµã¤ãºãè¨å®ãããargp ã¯ã
              struct vt_sizes {
                 ushort v_rows;       /* # rows */
                 ushort v_cols;       /* # columns */
                 ushort v_scrollsize; /* no longer used */
              };
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã ããã¯ãããªã¢ã¼ããå¤æ´ããªãäºã«æ³¨æã resizecons(8)
              ãè¦ã(ã«ã¼ãã« 1.1.54 以é)ã


       VT_RESIZEX
              ã«ã¼ãã«ãèªèããå種ã®ã¹ã¯ãªã¼ã³ãã©ã¡ã¼ã¿ãè¨å®ãããargp ã¯ã
              struct vt_consize {
                     ushort v_rows;          /* number of rows */
                     ushort v_cols;          /* number of columns */
                     ushort v_vlin;          /* number of pixel rows on screen */
                     ushort v_clin;          /* number of pixel rows per character */
                     ushort v_vcol;          /* number of pixel columns on screen */
                     ushort v_ccol;          /* number of pixel columns per character */
              };
              ã¸ã®ãã¤ã³ã¿ã¼ã§ããã

              ãã©ã¡ã¼ã¿ã¯ã¼ãã§ãã£ã¦ãããããã®ã¨ã㯠``å¤æ´ããªããã¨'' ãæå³
              ããããè¤æ°ã®ãã©ã¡ã¼ã¿ãè¨å®ãããæã«ã¯ãããã®éã§çç¾ããªããã
              ã«ããªããã°ãªããªãã
              ãã®é¢æ°å¼ã³åºãã«ãã£ã¦ããããªã¢ã¼ãã¯å¤æ´ãããªãäºã«æ³¨æã
              resizecons(8) ãåç§ã®äº(ã«ã¼ãã« 1.3.3 以é)ã

       以ä¸ã® ioctl ãã©ã®ããã«åä½ããããã¯ãargp ãæãæ§é ä½ã®æå ã®ãã¤ã(ããã§ã¯
       subcode ã¨å¼ã¶)ã«ä¾åããã ãããã®å¼åºãã¯ãã¹ã¼ãã¼ã¦ã¼ã¶ã¼ãç¾å¨ã® tty
       ã®ãªã¼ãã«ã®ã¿è¨±ãããã


       TIOCLINUX, subcode=0
              ã¹ã¯ãªã¼ã³ããã³ã(dump)ãã ã«ã¼ãã« 1.1.92 以éã§ãªããªã£ã(1.1.92
              以éã§ã¯ã代ããã« /dev/vcsN ã¾ ã㯠/dev/vcsaN ããèªã¿è¾¼ã)ã


       TIOCLINUX, subcode=1
              ã¿ã¹ã¯æå ±ãåå¾ãããã«ã¼ãã« 1.1.92 ã§ãªããªã£ãã


       TIOCLINUX, subcode=2
              é¸æãè¨å®ããã argp ãæãã®ã¯ã
                struct {char subcode;
                    short xs, ys, xe, ye;
                    short sel_mode;
                }
              ã§ããããã㧠xs 㨠ys ã¯å§ãã®æ¡ã¨è¡ã§ãxe 㨠ye ã¯çµãã®æ¡ ã¨è¡ã§ããã
              (å·¦ä¸ã®éã æ¡=è¡=1 ) sel_mode 㯠0 ãæå‐
              æ¯ã®é¸æã§ã1ã¯èªæ¯ã®é¸æã2ã¯è¡æ¯ã®é¸æãæ å³ããã
              示ãããã¹ã¯ãªã¼ã³ä¸ã®æåã¯ãã¤ã©ã¤ã表示ãã devices/char/console.c
              ã®éçéå sel_buffer ã«ä¿åãããã

       TIOCLINUX, subcode=3

              é¸æãããã®ããã¼ã¹ãããã é¸æãããã¡ä¸ã®æå ã fd ã«æ¸ãåºãããã


       TIOCLINUX, subcode=4

              ã¹ã¯ãªã¼ã³ãã¢ã³ãã©ã³ã¯(unblank)ããã


       TIOCLINUX, subcode=5

              èªæ¯ã®é¸æã®ããã®ãèªãä¸ã®æåãè¦å®ãã¦ãã 256 ãããã®ã«ãã¯ã¢ãã
              ãã¼ãã«ã®å容ãè¨å®ãã(ã«ã¼ãã« 1.1.32 以é)ã


       TIOCLINUX, subcode=6

              argp ã¯æåå¤æ°ãæããã¤ã³ã¿ã§ããã®å容ãã«ã¼ãã«å¤æ°
              shift_stateã®å¤ã«è¨å®ããã(ã«ã¼ãã« 1.1.32 以é)ã


       TIOCLINUX, subcode=7

              argp ã¯æåå¤æ°ãæããã¤ã³ã¿ã§ããã®å容ãã«ã¼ãã«å¤æ°
               report_mouse ã®å¤ã«è¨å®ããã(ã«ã¼ãã« 1.1.33 以é)ã


       TIOCLINUX, subcode=8

              ã¹ã¯ãªã¼ã³å¹ãã¹ã¯ãªã¼ã³é«ããã«ã¼ã½ã«ä½ç½®ãå¨ã¦ã®æåå±æ§ã®çµããã³ã
              ãã(ã«ã¼ãã« 1.1.67 ãã 1.1.91ã¾ã§ã®ã¿ã ã«ã¼ãã« 1.1.92
              以éã§ã¯ã/dev/vcsa*ããèªã¿è¾¼ã)ã


       TIOCLINUX, subcode=9

              ã¹ã¯ãªã¼ã³å¹ãã¹ã¯ãªã¼ã³é«ããã«ã¼ã½ã«ä½ç½®ãå¨ã¦ã®æåå±æ§ã®çµã復åã
              ã(ã«ã¼ãã« 1.1.67 ãã 1.1.91 ã¾ã§ã®ã¿ã ã«ã¼ãã« 1.1.92
              以éã§ã¯ã/dev/vcsa* ã«æ¸ãè¾¼ã)ã


       TIOCLINUX, subcode=10

              æ°ä¸ä»£ã¢ãã¿ã¼ã®ãã¯ã¼ã»ã¼ãæ©è½ãå¶å¾¡ããã VESA ã¹ã¯ãªã¼ã³ãã©ã³ã‐
              ã³ã°ã¢ã¼ãã argp[1]ã«è¨å®ãããã ãã®å¤ã¯ã¹ã¯ãªã¼ã³ãã©ã³ã‐
              ã³ã°ãã©ã®ããã«è¡ããããã示ãã以ä¸ããã® å¤ã§ããã

                   0: ã¹ã¯ãªã¼ã³ãã©ã³ãã³ã°ãªãã

                   1:ç¾å¨ã®ãããªã¢ããã¿ã¼ã¬ã¸ã¹ã¿ãä¿åããããã¨ãã³ã³ ãã‐
              ã¼ã©ã¯åç´åæãã«ã¹ããªãã«ããããããã°ã©ã ããããããã«ãã
              ã¢ãã¿ã¼ã¯ãã¹ã¿ã³ãã¤ãã¢ã¼ãã«ã¯ããã ã¢ãã¿ã¼ã« Off_Mode
              ã¿ã¤ããåãã£ã¦ããã°ãæçµçã«ã¯ã¢ãã¿ã¼ãèªå㧠é»æºãè½ãã

                   2:ç¾å¨ã®è¨å®ãä¿åããå¾ãåç´ãæ°´å¹³åæãã«ã¹ããªãã«ãªãã
              ããã«ããã¢ãã¿ã¼ã¯ããªããã¢ã¼ãã«ãªãã ã¢ãã¿ã¼ã« Off_Mode
              ã¿ã¤ãã¼ããªãæãã¾ãã¯ãblank_timer ãã¿ã¤ã ã¢ã¦ã
              ãããããã«ã¢ãã¿ã¼ã®é»æºãè½ãããã¨ãã«ãã®é¸æè¢ãé¸ã¶ã
              (注æï¼é »ç¹ã«ã¢ãã¿ã¼ã®é»æºãåãã¨ã¢ãã¿ã¼ãçããã) (ã«ã¼ãã« 1.1.76
              以é)


æ»ãå¤
       ã¨ã©ã¼ã«å¯¾ãã¦ã¯ -1 ãè¿ãã errno ãè¨å®ãããã

ã¨ã©ã¼
       errno ã¯æ¬¡ã®ãããªå¤ãã¨ã:

       EBADF  ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãç¡å¹ã

       ENOTTY ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ããã£ã©ã¯ã¿ã»ã¹ãã·ã£ã«ããã¤ã¹ã¨é¢é£ä»ããã
              ã¦ããªããã¾ãã¯ãè¦æ±ããããã®ãããã«å½ã¦ã¯ã¾ããªãã

       EINVAL ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã¾ã㯠argp ãç¡å¹ã

       EPERM  権é(permisson)éåã


è¦å
       ãã®ããã¥ã¢ã«ãã¼ã¸ã Linux ã®ã³ã³ã½ã¼ã« ioctl ãææ¸åãããã®ã¨æã ãªãäºã
       ããã¯ãèå³ããã人ãã½ã¼ã¹ãèªããã¨ã®ä»£ããã«ãªãããã«ç¨æããç©ã§ ããã ioctl
       ã¯ææ¸åãããªã Linux ã®åé¨æ©è½ã§ãã£ã¦ãè¦åãªãã«å¤æ´ããã ãã¨ãããã
       (ããã¦ããã®ãã¼ã¸ã¯ã«ã¼ãã« 1.1.94 ã®ã¨ãã®ç¶æ³ãè¨è¿°ããç©ã§ããã
       ã¯ä»¥åã®ãã¼ã¸ã§ã³ã¨æ¯ã¹ãã°ãå¤ãã®éãããã)

       ioctl ã¯ã«ã¼ãã«ã¨ãããç¹å®ã®ããç¥ãããããã°ã©ã ã¨ã®æå ±äº¤æã®ããã«
       å°å¥ãããäºãé常ã«å¤ã(fdisk, hdparm, setserial,tunelp, loadkeys,
       selection, setfont ãªã©)ããã®ãã ioctl ã®åä½ã¯ããã®ç¹å®ã®ããã°ã©ã
       ãå¿è¦ã¨ããæã«ã¯å¤æ´ã«ãªãã

       ãããã® ioctl ã使ã£ãããã°ã©ã ã¯ä»ã®ãã¼ã¸ã§ã³ã® Unix ã¨ã®äºææ§ã
       ãªãããå¤ããã¼ã¸ã§ã³ã® Linux ã§ã¯ãèµ°ããªããããã«å°æ¥ã®ãã¼ã¸ã§ã³ ã® Linux
       ã§ã¯èµ°ããªããªãããç¥ããªãã

       POSIX æ©è½ã使ããªããã


é¢é£é ç®
       kbd_mode(1), loadkeys(1), dumpkeys(1), mknod(1), setleds(1),
       setmetamode(1), ioperm(2), termios(2), execve(2), fcntl(2),
       charsets(4), console(4), console_codes(4), mt(4), sd(4), tty(4),
       ttys(4), vcs(4), vcsa(4), mapscrn(8), setfont(8), resizecons(8),
       /usr/include/linux/kd.h, /usr/include/linux/vt.h


翻訳è
       é«æ© ç¦å¸ <muz@ilp.iijnet.or.jp>

       ç³å· ç¦ <ishikawa@linux.or.jp>



Linux                         September 18, 1995             CONSOLE_IOCTLS(4)