"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/src/core/sys/posix/termios.d" (20 Nov 2020, 33923 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * D header file for POSIX.
    3  *
    4  * Copyright: Copyright Sean Kelly 2005 - 2009.
    5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
    6  * Authors:   Sean Kelly, Alex Rønne Petersen
    7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
    8  */
    9 
   10 /*          Copyright Sean Kelly 2005 - 2009.
   11  * Distributed under the Boost Software License, Version 1.0.
   12  *    (See accompanying file LICENSE or copy at
   13  *          http://www.boost.org/LICENSE_1_0.txt)
   14  */
   15 module core.sys.posix.termios;
   16 
   17 private import core.sys.posix.config;
   18 public import core.sys.posix.sys.types; // for pid_t
   19 
   20 version (OSX)
   21     version = Darwin;
   22 else version (iOS)
   23     version = Darwin;
   24 else version (TVOS)
   25     version = Darwin;
   26 else version (WatchOS)
   27     version = Darwin;
   28 
   29 version (Posix):
   30 extern (C):
   31 
   32 nothrow:
   33 @nogc:
   34 @system:
   35 
   36 //
   37 // Required
   38 //
   39 /*
   40 cc_t
   41 speed_t
   42 tcflag_t
   43 
   44 NCCS
   45 
   46 struct termios
   47 {
   48     tcflag_t   c_iflag;
   49     tcflag_t   c_oflag;
   50     tcflag_t   c_cflag;
   51     tcflag_t   c_lflag;
   52     cc_t[NCCS] c_cc;
   53 }
   54 
   55 VEOF
   56 VEOL
   57 VERASE
   58 VINTR
   59 VKILL
   60 VMIN
   61 VQUIT
   62 VSTART
   63 VSTOP
   64 VSUSP
   65 VTIME
   66 
   67 BRKINT
   68 ICRNL
   69 IGNBRK
   70 IGNCR
   71 IGNPAR
   72 INLCR
   73 INPCK
   74 ISTRIP
   75 IXOFF
   76 IXON
   77 PARMRK
   78 
   79 OPOST
   80 
   81 B0
   82 B50
   83 B75
   84 B110
   85 B134
   86 B150
   87 B200
   88 B300
   89 B600
   90 B1200
   91 B1800
   92 B2400
   93 B4800
   94 B9600
   95 B19200
   96 B38400
   97 
   98 CSIZE
   99     CS5
  100     CS6
  101     CS7
  102     CS8
  103 CSTOPB
  104 CREAD
  105 PARENB
  106 PARODD
  107 HUPCL
  108 CLOCAL
  109 
  110 ECHO
  111 ECHOE
  112 ECHOK
  113 ECHONL
  114 ICANON
  115 IEXTEN
  116 ISIG
  117 NOFLSH
  118 TOSTOP
  119 
  120 TCSANOW
  121 TCSADRAIN
  122 TCSAFLUSH
  123 
  124 TCIFLUSH
  125 TCIOFLUSH
  126 TCOFLUSH
  127 
  128 TCIOFF
  129 TCION
  130 TCOOFF
  131 TCOON
  132 
  133 speed_t cfgetispeed(const scope termios*);
  134 speed_t cfgetospeed(const scope termios*);
  135 int     cfsetispeed(termios*, speed_t);
  136 int     cfsetospeed(termios*, speed_t);
  137 int     tcdrain(int);
  138 int     tcflow(int, int);
  139 int     tcflush(int, int);
  140 int     tcgetattr(int, termios*);
  141 int     tcsendbreak(int, int);
  142 int     tcsetattr(int, int, const scope termios*);
  143 */
  144 
  145 version (CRuntime_Glibc)
  146 {
  147     alias ubyte cc_t;
  148     alias uint  speed_t;
  149     alias uint  tcflag_t;
  150 
  151     enum NCCS   = 32;
  152 
  153     struct termios
  154     {
  155         tcflag_t   c_iflag;
  156         tcflag_t   c_oflag;
  157         tcflag_t   c_cflag;
  158         tcflag_t   c_lflag;
  159         cc_t       c_line;
  160         cc_t[NCCS] c_cc;
  161         speed_t    c_ispeed;
  162         speed_t    c_ospeed;
  163     }
  164 
  165     enum VEOF       = 4;
  166     enum VEOL       = 11;
  167     enum VERASE     = 2;
  168     enum VINTR      = 0;
  169     enum VKILL      = 3;
  170     enum VMIN       = 6;
  171     enum VQUIT      = 1;
  172     enum VSTART     = 8;
  173     enum VSTOP      = 9;
  174     enum VSUSP      = 10;
  175     enum VTIME      = 5;
  176 
  177     enum BRKINT     = 0x0000002; // 0000002
  178     enum ICRNL      = 0x0000100; // 0000400
  179     enum IGNBRK     = 0x0000001; // 0000001
  180     enum IGNCR      = 0x0000080; // 0000200
  181     enum IGNPAR     = 0x0000004; // 0000004
  182     enum INLCR      = 0x0000040; // 0000100
  183     enum INPCK      = 0x0000010; // 0000020
  184     enum ISTRIP     = 0x0000020; // 0000040
  185     enum IXOFF      = 0x0001000; // 0010000
  186     enum IXON       = 0x0000400; // 0002000
  187     enum PARMRK     = 0x0000008; // 0000010
  188 
  189     enum OPOST      = 0x0000001; // 0000001
  190 
  191     enum B0         = 0x0000000; // 0000000
  192     enum B50        = 0x0000001; // 0000001
  193     enum B75        = 0x0000002; // 0000002
  194     enum B110       = 0x0000003; // 0000003
  195     enum B134       = 0x0000004; // 0000004
  196     enum B150       = 0x0000005; // 0000005
  197     enum B200       = 0x0000006; // 0000006
  198     enum B300       = 0x0000007; // 0000007
  199     enum B600       = 0x0000008; // 0000010
  200     enum B1200      = 0x0000009; // 0000011
  201     enum B1800      = 0x000000A; // 0000012
  202     enum B2400      = 0x000000B; // 0000013
  203     enum B4800      = 0x000000C; // 0000014
  204     enum B9600      = 0x000000D; // 0000015
  205     enum B19200     = 0x000000E; // 0000016
  206     enum B38400     = 0x000000F; // 0000017
  207 
  208     enum CSIZE      = 0x0000030; // 0000060
  209     enum   CS5      = 0x0000000; // 0000000
  210     enum   CS6      = 0x0000010; // 0000020
  211     enum   CS7      = 0x0000020; // 0000040
  212     enum   CS8      = 0x0000030; // 0000060
  213     enum CSTOPB     = 0x0000040; // 0000100
  214     enum CREAD      = 0x0000080; // 0000200
  215     enum PARENB     = 0x0000100; // 0000400
  216     enum PARODD     = 0x0000200; // 0001000
  217     enum HUPCL      = 0x0000400; // 0002000
  218     enum CLOCAL     = 0x0000800; // 0004000
  219 
  220     enum ECHO       = 0x0000008; // 0000010
  221     enum ECHOE      = 0x0000010; // 0000020
  222     enum ECHOK      = 0x0000020; // 0000040
  223     enum ECHONL     = 0x0000040; // 0000100
  224     enum ICANON     = 0x0000002; // 0000002
  225     enum IEXTEN     = 0x0008000; // 0100000
  226     enum ISIG       = 0x0000001; // 0000001
  227     enum NOFLSH     = 0x0000080; // 0000200
  228     enum TOSTOP     = 0x0000100; // 0000400
  229 
  230     enum TCSANOW    = 0;
  231     enum TCSADRAIN  = 1;
  232     enum TCSAFLUSH  = 2;
  233 
  234     enum TCIFLUSH   = 0;
  235     enum TCOFLUSH   = 1;
  236     enum TCIOFLUSH  = 2;
  237 
  238     enum TCIOFF     = 2;
  239     enum TCION      = 3;
  240     enum TCOOFF     = 0;
  241     enum TCOON      = 1;
  242 
  243     speed_t cfgetispeed(const scope termios*);
  244     speed_t cfgetospeed(const scope termios*);
  245     int     cfsetispeed(termios*, speed_t);
  246     int     cfsetospeed(termios*, speed_t);
  247     int     tcdrain(int);
  248     int     tcflow(int, int);
  249     int     tcflush(int, int);
  250     int     tcgetattr(int, termios*);
  251     int     tcsendbreak(int, int);
  252     int     tcsetattr(int, int, const scope termios*);
  253 }
  254 else version (Darwin)
  255 {
  256     alias ubyte cc_t;
  257     alias c_ulong  speed_t;
  258     alias c_ulong  tcflag_t;
  259 
  260     enum NCCS   = 20;
  261 
  262     struct termios
  263     {
  264         tcflag_t   c_iflag;
  265         tcflag_t   c_oflag;
  266         tcflag_t   c_cflag;
  267         tcflag_t   c_lflag;
  268         cc_t[NCCS] c_cc;
  269         speed_t    c_ispeed;
  270         speed_t    c_ospeed;
  271     }
  272 
  273     enum VEOF       = 0;
  274     enum VEOL       = 1;
  275     enum VERASE     = 3;
  276     enum VINTR      = 8;
  277     enum VKILL      = 5;
  278     enum VMIN       = 16;
  279     enum VQUIT      = 9;
  280     enum VSTART     = 12;
  281     enum VSTOP      = 13;
  282     enum VSUSP      = 10;
  283     enum VTIME      = 17;
  284 
  285     enum BRKINT     = 0x0000002;
  286     enum ICRNL      = 0x0000100;
  287     enum IGNBRK     = 0x0000001;
  288     enum IGNCR      = 0x0000080;
  289     enum IGNPAR     = 0x0000004;
  290     enum INLCR      = 0x0000040;
  291     enum INPCK      = 0x0000010;
  292     enum ISTRIP     = 0x0000020;
  293     enum IXOFF      = 0x0000400;
  294     enum IXON       = 0x0000200;
  295     enum PARMRK     = 0x0000008;
  296 
  297     enum OPOST      = 0x0000001;
  298 
  299     enum B0         = 0;
  300     enum B50        = 50;
  301     enum B75        = 75;
  302     enum B110       = 110;
  303     enum B134       = 134;
  304     enum B150       = 150;
  305     enum B200       = 200;
  306     enum B300       = 300;
  307     enum B600       = 600;
  308     enum B1200      = 1200;
  309     enum B1800      = 1800;
  310     enum B2400      = 2400;
  311     enum B4800      = 4800;
  312     enum B9600      = 9600;
  313     enum B19200     = 19200;
  314     enum B38400     = 38400;
  315 
  316     enum CSIZE      = 0x0000300;
  317     enum   CS5      = 0x0000000;
  318     enum   CS6      = 0x0000100;
  319     enum   CS7      = 0x0000200;
  320     enum   CS8      = 0x0000300;
  321     enum CSTOPB     = 0x0000400;
  322     enum CREAD      = 0x0000800;
  323     enum PARENB     = 0x0001000;
  324     enum PARODD     = 0x0002000;
  325     enum HUPCL      = 0x0004000;
  326     enum CLOCAL     = 0x0008000;
  327 
  328     enum ECHO       = 0x00000008;
  329     enum ECHOE      = 0x00000002;
  330     enum ECHOK      = 0x00000004;
  331     enum ECHONL     = 0x00000010;
  332     enum ICANON     = 0x00000100;
  333     enum IEXTEN     = 0x00000400;
  334     enum ISIG       = 0x00000080;
  335     enum NOFLSH     = 0x80000000;
  336     enum TOSTOP     = 0x00400000;
  337 
  338     enum TCSANOW    = 0;
  339     enum TCSADRAIN  = 1;
  340     enum TCSAFLUSH  = 2;
  341 
  342     enum TCIFLUSH   = 1;
  343     enum TCOFLUSH   = 2;
  344     enum TCIOFLUSH  = 3;
  345 
  346     enum TCIOFF     = 3;
  347     enum TCION      = 4;
  348     enum TCOOFF     = 1;
  349     enum TCOON      = 2;
  350 
  351     speed_t cfgetispeed(const scope termios*);
  352     speed_t cfgetospeed(const scope termios*);
  353     int     cfsetispeed(termios*, speed_t);
  354     int     cfsetospeed(termios*, speed_t);
  355     int     tcdrain(int);
  356     int     tcflow(int, int);
  357     int     tcflush(int, int);
  358     int     tcgetattr(int, termios*);
  359     int     tcsendbreak(int, int);
  360     int     tcsetattr(int, int, const scope termios*);
  361 
  362 }
  363 else version (FreeBSD)
  364 {
  365     alias ubyte cc_t;
  366     alias uint  speed_t;
  367     alias uint  tcflag_t;
  368 
  369     enum NCCS   = 20;
  370 
  371     struct termios
  372     {
  373         tcflag_t   c_iflag;
  374         tcflag_t   c_oflag;
  375         tcflag_t   c_cflag;
  376         tcflag_t   c_lflag;
  377         cc_t[NCCS] c_cc;
  378         speed_t    c_ispeed;
  379         speed_t    c_ospeed;
  380     }
  381 
  382     enum VEOF       = 0;
  383     enum VEOL       = 1;
  384     enum VERASE     = 3;
  385     enum VINTR      = 8;
  386     enum VKILL      = 5;
  387     enum VMIN       = 16;
  388     enum VQUIT      = 9;
  389     enum VSTART     = 12;
  390     enum VSTOP      = 13;
  391     enum VSUSP      = 10;
  392     enum VTIME      = 17;
  393 
  394     enum BRKINT     = 0x0000002;
  395     enum ICRNL      = 0x0000100;
  396     enum IGNBRK     = 0x0000001;
  397     enum IGNCR      = 0x0000080;
  398     enum IGNPAR     = 0x0000004;
  399     enum INLCR      = 0x0000040;
  400     enum INPCK      = 0x0000010;
  401     enum ISTRIP     = 0x0000020;
  402     enum IXOFF      = 0x0000400;
  403     enum IXON       = 0x0000200;
  404     enum PARMRK     = 0x0000008;
  405 
  406     enum OPOST      = 0x0000001;
  407 
  408     enum B0         = 0;
  409     enum B50        = 50;
  410     enum B75        = 75;
  411     enum B110       = 110;
  412     enum B134       = 134;
  413     enum B150       = 150;
  414     enum B200       = 200;
  415     enum B300       = 300;
  416     enum B600       = 600;
  417     enum B1200      = 1200;
  418     enum B1800      = 1800;
  419     enum B2400      = 2400;
  420     enum B4800      = 4800;
  421     enum B9600      = 9600;
  422     enum B19200     = 19200;
  423     enum B38400     = 38400;
  424 
  425     enum CSIZE      = 0x0000300;
  426     enum   CS5      = 0x0000000;
  427     enum   CS6      = 0x0000100;
  428     enum   CS7      = 0x0000200;
  429     enum   CS8      = 0x0000300;
  430     enum CSTOPB     = 0x0000400;
  431     enum CREAD      = 0x0000800;
  432     enum PARENB     = 0x0001000;
  433     enum PARODD     = 0x0002000;
  434     enum HUPCL      = 0x0004000;
  435     enum CLOCAL     = 0x0008000;
  436 
  437     enum ECHO       = 0x00000008;
  438     enum ECHOE      = 0x00000002;
  439     enum ECHOK      = 0x00000004;
  440     enum ECHONL     = 0x00000010;
  441     enum ICANON     = 0x00000100;
  442     enum IEXTEN     = 0x00000400;
  443     enum ISIG       = 0x00000080;
  444     enum NOFLSH     = 0x80000000;
  445     enum TOSTOP     = 0x00400000;
  446 
  447     enum TCSANOW    = 0;
  448     enum TCSADRAIN  = 1;
  449     enum TCSAFLUSH  = 2;
  450 
  451     enum TCIFLUSH   = 1;
  452     enum TCOFLUSH   = 2;
  453     enum TCIOFLUSH  = 3;
  454 
  455     enum TCIOFF     = 3;
  456     enum TCION      = 4;
  457     enum TCOOFF     = 1;
  458     enum TCOON      = 2;
  459 
  460     speed_t cfgetispeed(const scope termios*);
  461     speed_t cfgetospeed(const scope termios*);
  462     int     cfsetispeed(termios*, speed_t);
  463     int     cfsetospeed(termios*, speed_t);
  464     int     tcdrain(int);
  465     int     tcflow(int, int);
  466     int     tcflush(int, int);
  467     int     tcgetattr(int, termios*);
  468     int     tcsendbreak(int, int);
  469     int     tcsetattr(int, int, const scope termios*);
  470 }
  471 else version (DragonFlyBSD)
  472 {
  473     alias ubyte cc_t;
  474     alias uint  speed_t;
  475     alias uint  tcflag_t;
  476 
  477     enum NCCS   = 20;
  478 
  479     struct termios
  480     {
  481         tcflag_t   c_iflag;
  482         tcflag_t   c_oflag;
  483         tcflag_t   c_cflag;
  484         tcflag_t   c_lflag;
  485         cc_t[NCCS] c_cc;
  486         speed_t    c_ispeed;
  487         speed_t    c_ospeed;
  488     }
  489 
  490     enum VEOF       = 0;
  491     enum VEOL       = 1;
  492     enum VERASE     = 3;
  493     enum VINTR      = 8;
  494     enum VKILL      = 5;
  495     enum VMIN       = 16;
  496     enum VQUIT      = 9;
  497     enum VSTART     = 12;
  498     enum VSTOP      = 13;
  499     enum VSUSP      = 10;
  500     enum VTIME      = 17;
  501 
  502     enum BRKINT     = 0x0000002;
  503     enum ICRNL      = 0x0000100;
  504     enum IGNBRK     = 0x0000001;
  505     enum IGNCR      = 0x0000080;
  506     enum IGNPAR     = 0x0000004;
  507     enum INLCR      = 0x0000040;
  508     enum INPCK      = 0x0000010;
  509     enum ISTRIP     = 0x0000020;
  510     enum IXOFF      = 0x0000400;
  511     enum IXON       = 0x0000200;
  512     enum PARMRK     = 0x0000008;
  513 
  514     enum OPOST      = 0x0000001;
  515 
  516     enum B0         = 0;
  517     enum B50        = 50;
  518     enum B75        = 75;
  519     enum B110       = 110;
  520     enum B134       = 134;
  521     enum B150       = 150;
  522     enum B200       = 200;
  523     enum B300       = 300;
  524     enum B600       = 600;
  525     enum B1200      = 1200;
  526     enum B1800      = 1800;
  527     enum B2400      = 2400;
  528     enum B4800      = 4800;
  529     enum B9600      = 9600;
  530     enum B19200     = 19200;
  531     enum B38400     = 38400;
  532 
  533     enum CSIZE      = 0x0000300;
  534     enum   CS5      = 0x0000000;
  535     enum   CS6      = 0x0000100;
  536     enum   CS7      = 0x0000200;
  537     enum   CS8      = 0x0000300;
  538     enum CSTOPB     = 0x0000400;
  539     enum CREAD      = 0x0000800;
  540     enum PARENB     = 0x0001000;
  541     enum PARODD     = 0x0002000;
  542     enum HUPCL      = 0x0004000;
  543     enum CLOCAL     = 0x0008000;
  544 
  545     enum ECHO       = 0x00000008;
  546     enum ECHOE      = 0x00000002;
  547     enum ECHOK      = 0x00000004;
  548     enum ECHONL     = 0x00000010;
  549     enum ICANON     = 0x00000100;
  550     enum IEXTEN     = 0x00000400;
  551     enum ISIG       = 0x00000080;
  552     enum NOFLSH     = 0x80000000;
  553     enum TOSTOP     = 0x00400000;
  554 
  555     enum TCSANOW    = 0;
  556     enum TCSADRAIN  = 1;
  557     enum TCSAFLUSH  = 2;
  558 
  559     enum TCIFLUSH   = 1;
  560     enum TCOFLUSH   = 2;
  561     enum TCIOFLUSH  = 3;
  562 
  563     enum TCIOFF     = 3;
  564     enum TCION      = 4;
  565     enum TCOOFF     = 1;
  566     enum TCOON      = 2;
  567 
  568     speed_t cfgetispeed(const scope termios*);
  569     speed_t cfgetospeed(const scope termios*);
  570     int     cfsetispeed(termios*, speed_t);
  571     int     cfsetospeed(termios*, speed_t);
  572     int     tcdrain(int);
  573     int     tcflow(int, int);
  574     int     tcflush(int, int);
  575     int     tcgetattr(int, termios*);
  576     int     tcsendbreak(int, int);
  577     int     tcsetattr(int, int, const scope termios*);
  578 }
  579 else version (NetBSD)
  580 {
  581     alias ubyte cc_t;
  582     alias uint  speed_t;
  583     alias uint  tcflag_t;
  584 
  585     enum NCCS   = 20;
  586 
  587     struct termios
  588     {
  589         tcflag_t   c_iflag;
  590         tcflag_t   c_oflag;
  591         tcflag_t   c_cflag;
  592         tcflag_t   c_lflag;
  593         cc_t[NCCS] c_cc;
  594         speed_t    c_ispeed;
  595         speed_t    c_ospeed;
  596     }
  597 
  598     enum VEOF       = 0;
  599     enum VEOL       = 1;
  600     enum VERASE     = 3;
  601     enum VINTR      = 8;
  602     enum VKILL      = 5;
  603     enum VMIN       = 16;
  604     enum VQUIT      = 9;
  605     enum VSTART     = 12;
  606     enum VSTOP      = 13;
  607     enum VSUSP      = 10;
  608     enum VTIME      = 17;
  609 
  610     enum BRKINT     = 0x0000002;
  611     enum ICRNL      = 0x0000100;
  612     enum IGNBRK     = 0x0000001;
  613     enum IGNCR      = 0x0000080;
  614     enum IGNPAR     = 0x0000004;
  615     enum INLCR      = 0x0000040;
  616     enum INPCK      = 0x0000010;
  617     enum ISTRIP     = 0x0000020;
  618     enum IXOFF      = 0x0000400;
  619     enum IXON       = 0x0000200;
  620     enum PARMRK     = 0x0000008;
  621 
  622     enum OPOST      = 0x0000001;
  623 
  624     enum B0         = 0;
  625     enum B50        = 50;
  626     enum B75        = 75;
  627     enum B110       = 110;
  628     enum B134       = 134;
  629     enum B150       = 150;
  630     enum B200       = 200;
  631     enum B300       = 300;
  632     enum B600       = 600;
  633     enum B1200      = 1200;
  634     enum B1800      = 1800;
  635     enum B2400      = 2400;
  636     enum B4800      = 4800;
  637     enum B9600      = 9600;
  638     enum B19200     = 19200;
  639     enum B38400     = 38400;
  640 
  641     enum CSIZE      = 0x0000300;
  642     enum   CS5      = 0x0000000;
  643     enum   CS6      = 0x0000100;
  644     enum   CS7      = 0x0000200;
  645     enum   CS8      = 0x0000300;
  646     enum CSTOPB     = 0x0000400;
  647     enum CREAD      = 0x0000800;
  648     enum PARENB     = 0x0001000;
  649     enum PARODD     = 0x0002000;
  650     enum HUPCL      = 0x0004000;
  651     enum CLOCAL     = 0x0008000;
  652 
  653     enum ECHO       = 0x00000008;
  654     enum ECHOE      = 0x00000002;
  655     enum ECHOK      = 0x00000004;
  656     enum ECHONL     = 0x00000010;
  657     enum ICANON     = 0x00000100;
  658     enum IEXTEN     = 0x00000400;
  659     enum ISIG       = 0x00000080;
  660     enum NOFLSH     = 0x80000000;
  661     enum TOSTOP     = 0x00400000;
  662 
  663     enum TCSANOW    = 0;
  664     enum TCSADRAIN  = 1;
  665     enum TCSAFLUSH  = 2;
  666 
  667     enum TCIFLUSH   = 1;
  668     enum TCOFLUSH   = 2;
  669     enum TCIOFLUSH  = 3;
  670 
  671     enum TCIOFF     = 3;
  672     enum TCION      = 4;
  673     enum TCOOFF     = 1;
  674     enum TCOON      = 2;
  675 
  676     speed_t cfgetispeed(const scope termios*);
  677     speed_t cfgetospeed(const scope termios*);
  678     int     cfsetispeed(termios*, speed_t);
  679     int     cfsetospeed(termios*, speed_t);
  680     int     tcdrain(int);
  681     int     tcflow(int, int);
  682     int     tcflush(int, int);
  683     int     tcgetattr(int, termios*);
  684     int     tcsendbreak(int, int);
  685     int     tcsetattr(int, int, const scope termios*);
  686 }
  687 else version (OpenBSD)
  688 {
  689     alias uint  tcflag_t;
  690     alias ubyte cc_t;
  691     alias uint  speed_t;
  692 
  693     enum NCCS   = 20;
  694 
  695     struct termios
  696     {
  697         tcflag_t   c_iflag;
  698         tcflag_t   c_oflag;
  699         tcflag_t   c_cflag;
  700         tcflag_t   c_lflag;
  701         cc_t[NCCS] c_cc;
  702         int        c_ispeed;
  703         int        c_ospeed;
  704     }
  705 
  706     enum VEOF       = 0;
  707     enum VEOL       = 1;
  708     enum VERASE     = 3;
  709     enum VINTR      = 8;
  710     enum VKILL      = 5;
  711     enum VMIN       = 16;
  712     enum VQUIT      = 9;
  713     enum VSTART     = 12;
  714     enum VSTOP      = 13;
  715     enum VSUSP      = 10;
  716     enum VTIME      = 17;
  717 
  718     enum BRKINT     = 0x0000002;
  719     enum ICRNL      = 0x0000100;
  720     enum IGNBRK     = 0x0000001;
  721     enum IGNCR      = 0x0000080;
  722     enum IGNPAR     = 0x0000004;
  723     enum INLCR      = 0x0000040;
  724     enum INPCK      = 0x0000010;
  725     enum ISTRIP     = 0x0000020;
  726     enum IXOFF      = 0x0000400;
  727     enum IXON       = 0x0000200;
  728     enum PARMRK     = 0x0000008;
  729 
  730     enum OPOST      = 0x0000001;
  731 
  732     enum B0         = 0;
  733     enum B50        = 50;
  734     enum B75        = 75;
  735     enum B110       = 110;
  736     enum B134       = 134;
  737     enum B150       = 150;
  738     enum B200       = 200;
  739     enum B300       = 300;
  740     enum B600       = 600;
  741     enum B1200      = 1200;
  742     enum B1800      = 1800;
  743     enum B2400      = 2400;
  744     enum B4800      = 4800;
  745     enum B9600      = 9600;
  746     enum B19200     = 19200;
  747     enum B38400     = 38400;
  748 
  749     enum CSIZE      = 0x0000300;
  750     enum   CS5      = 0x0000000;
  751     enum   CS6      = 0x0000100;
  752     enum   CS7      = 0x0000200;
  753     enum   CS8      = 0x0000300;
  754     enum CSTOPB     = 0x0000400;
  755     enum CREAD      = 0x0000800;
  756     enum PARENB     = 0x0001000;
  757     enum PARODD     = 0x0002000;
  758     enum HUPCL      = 0x0004000;
  759     enum CLOCAL     = 0x0008000;
  760 
  761     enum ECHO       = 0x00000008;
  762     enum ECHOE      = 0x00000002;
  763     enum ECHOK      = 0x00000004;
  764     enum ECHONL     = 0x00000010;
  765     enum ICANON     = 0x00000100;
  766     enum IEXTEN     = 0x00000400;
  767     enum ISIG       = 0x00000080;
  768     enum NOFLSH     = 0x80000000;
  769     enum TOSTOP     = 0x00400000;
  770 
  771     enum TCSANOW    = 0;
  772     enum TCSADRAIN  = 1;
  773     enum TCSAFLUSH  = 2;
  774 
  775     enum TCIFLUSH   = 1;
  776     enum TCOFLUSH   = 2;
  777     enum TCIOFLUSH  = 3;
  778 
  779     enum TCIOFF     = 3;
  780     enum TCION      = 4;
  781     enum TCOOFF     = 1;
  782     enum TCOON      = 2;
  783 
  784     speed_t cfgetispeed(const scope termios*);
  785     speed_t cfgetospeed(const scope termios*);
  786     int     cfsetispeed(termios*, speed_t);
  787     int     cfsetospeed(termios*, speed_t);
  788     int     tcdrain(int);
  789     int     tcflow(int, int);
  790     int     tcflush(int, int);
  791     int     tcgetattr(int, termios*);
  792     int     tcsendbreak(int, int);
  793     int     tcsetattr(int, int, const scope termios*);
  794 }
  795 else version (Solaris)
  796 {
  797     alias tcflag_t = uint;
  798     alias cc_t = ubyte;
  799     alias speed_t = uint;
  800 
  801     enum NCCS   = 19;
  802 
  803     struct termios
  804     {
  805         tcflag_t   c_iflag;    /* input modes */
  806         tcflag_t   c_oflag;    /* output modes */
  807         tcflag_t   c_cflag;    /* control modes */
  808         tcflag_t   c_lflag;    /* line discipline modes */
  809         cc_t[NCCS] c_cc;       /* control chars */
  810     }
  811 
  812     /* control characters */
  813     enum VINTR  = 0;
  814     enum VQUIT  = 1;
  815     enum VERASE = 2;
  816     enum VKILL  = 3;
  817     enum VEOF   = 4;
  818     enum VEOL   = 5;
  819     enum VMIN   = 4;
  820     enum VTIME  = 5;
  821     enum VSTART = 8;
  822     enum VSTOP  = 9;
  823     enum VSUSP  = 10;
  824 
  825     /* input modes */
  826     enum IGNBRK = 0x000001;
  827     enum BRKINT = 0x000002;
  828     enum IGNPAR = 0x000004;
  829     enum PARMRK = 0x000008;
  830     enum INPCK  = 0x000010;
  831     enum ISTRIP = 0x000020;
  832     enum INLCR  = 0x000040;
  833     enum IGNCR  = 0x000080;
  834     enum ICRNL  = 0x000100;
  835     enum IXON   = 0x000400;
  836     enum IXOFF  = 0x001000;
  837 
  838     /* output modes */
  839     enum OPOST  = 0x000001;
  840 
  841     /* control modes */
  842     enum CSIZE  = 0x000030;
  843     enum CS5    = 0x000000;
  844     enum CS6    = 0x000010;
  845     enum CS7    = 0x000020;
  846     enum CS8    = 0x000030;
  847     enum CSTOPB = 0x000040;
  848     enum CREAD  = 0x000080;
  849     enum PARENB = 0x000100;
  850     enum PARODD = 0x000200;
  851     enum HUPCL  = 0x000400;
  852     enum CLOCAL = 0x000800;
  853 
  854     enum CRTSCTS = 0x10000000;
  855 
  856     /* line discipline 0 modes */
  857     enum ISIG   = 0x000001;
  858     enum ICANON = 0x000002;
  859     enum ECHO   = 0x000008;
  860     enum ECHOE  = 0x000010;
  861     enum ECHOK  = 0x000020;
  862     enum ECHONL = 0x000040;
  863     enum NOFLSH = 0x000080;
  864     enum TOSTOP = 0x000100;
  865 
  866     enum ECHOCTL = 0x000200;
  867     enum ECHOPRT = 0x000400;
  868     enum ECHOKE  = 0x000800;
  869 
  870     enum IEXTEN = 0x008000;  /* POSIX flag - enable POSIX extensions */
  871 
  872     enum _TIOC      = ('T'<<8);
  873     enum TCSANOW    = (_TIOC|14);
  874     enum TCSADRAIN  = (_TIOC|15);
  875     enum TCSAFLUSH  = (_TIOC|16);
  876 
  877     /* termios option flags */
  878     enum TCIFLUSH   = 0;  /* flush data received but not read */
  879     enum TCOFLUSH   = 1;  /* flush data written but not transmitted */
  880     enum TCIOFLUSH  = 2;  /* flush both data both input and output queues */
  881 
  882     enum TCOOFF     = 0;  /* suspend output */
  883     enum TCOON      = 1;  /* restart suspended output */
  884     enum TCIOFF     = 2;  /* suspend input */
  885     enum TCION      = 3;  /* restart suspended input */
  886 
  887     /* Speeds */
  888     enum B0      = 0;
  889     enum B50     = 1;
  890     enum B75     = 2;
  891     enum B110    = 3;
  892     enum B134    = 4;
  893     enum B150    = 5;
  894     enum B200    = 6;
  895     enum B300    = 7;
  896     enum B600    = 8;
  897     enum B1200   = 9;
  898     enum B1800   = 10;
  899     enum B2400   = 11;
  900     enum B4800   = 12;
  901     enum B9600   = 13;
  902     enum B19200  = 14;
  903     enum B38400  = 15;
  904     enum B57600  = 16;
  905     enum B76800  = 17;
  906     enum B115200 = 18;
  907     enum B153600 = 19;
  908     enum B230400 = 20;
  909     enum B307200 = 21;
  910     enum B460800 = 22;
  911     enum B921600 = 23;
  912 
  913     /*
  914      * POSIX termios functions
  915      * These functions get mapped into ioctls.
  916      */
  917     speed_t cfgetospeed(const scope termios*);
  918     int     cfsetospeed(termios*, speed_t);
  919     speed_t cfgetispeed(const scope termios*);
  920     int     cfsetispeed(termios*, speed_t);
  921     int     tcgetattr(int, termios*);
  922     int     tcsetattr(int, int, const scope termios*);
  923     int     tcsendbreak(int, int);
  924     int     tcdrain(int);
  925     int     tcflush(int, int);
  926     int     tcflow(int, int);
  927 }
  928 else version (CRuntime_UClibc)
  929 {
  930     alias ubyte cc_t;
  931     alias uint  speed_t;
  932     alias uint  tcflag_t;
  933 
  934     enum NCCS   = 32;
  935 
  936     struct termios
  937     {
  938         tcflag_t   c_iflag;
  939         tcflag_t   c_oflag;
  940         tcflag_t   c_cflag;
  941         tcflag_t   c_lflag;
  942         cc_t       c_line;
  943         cc_t[NCCS] c_cc;
  944         speed_t    c_ispeed;
  945         speed_t    c_ospeed;
  946     }
  947 
  948     enum VINTR      = 0;
  949     enum VQUIT      = 1;
  950     enum VERASE     = 2;
  951     enum VKILL      = 3;
  952     enum VEOF       = 4;
  953     enum VTIME      = 5;
  954     enum VMIN       = 6;
  955     enum VSWTC      = 7;
  956     enum VSTART     = 8;
  957     enum VSTOP      = 9;
  958     enum VSUSP      = 10;
  959     enum VEOL       = 11;
  960     enum VREPRINT   = 12;
  961     enum VDISCARD   = 13;
  962     enum VWERASE    = 14;
  963     enum VLNEXT     = 15;
  964     enum VEOL2      = 16;
  965 
  966     enum BRKINT     = 0x0000002; // 0000002
  967     enum ICRNL      = 0x0000100; // 0000400
  968     enum IGNBRK     = 0x0000001; // 0000001
  969     enum IGNCR      = 0x0000080; // 0000200
  970     enum IGNPAR     = 0x0000004; // 0000004
  971     enum INLCR      = 0x0000040; // 0000100
  972     enum INPCK      = 0x0000010; // 0000020
  973     enum ISTRIP     = 0x0000020; // 0000040
  974     enum IXOFF      = 0x0001000; // 0010000
  975     enum IXON       = 0x0000400; // 0002000
  976     enum PARMRK     = 0x0000008; // 0000010
  977 
  978     enum OPOST      = 0x0000001; // 0000001
  979 
  980     enum B0         = 0x0000000; // 0000000
  981     enum B50        = 0x0000001; // 0000001
  982     enum B75        = 0x0000002; // 0000002
  983     enum B110       = 0x0000003; // 0000003
  984     enum B134       = 0x0000004; // 0000004
  985     enum B150       = 0x0000005; // 0000005
  986     enum B200       = 0x0000006; // 0000006
  987     enum B300       = 0x0000007; // 0000007
  988     enum B600       = 0x0000008; // 0000010
  989     enum B1200      = 0x0000009; // 0000011
  990     enum B1800      = 0x000000A; // 0000012
  991     enum B2400      = 0x000000B; // 0000013
  992     enum B4800      = 0x000000C; // 0000014
  993     enum B9600      = 0x000000D; // 0000015
  994     enum B19200     = 0x000000E; // 0000016
  995     enum B38400     = 0x000000F; // 0000017
  996 
  997     enum CSIZE      = 0x0000030; // 0000060
  998     enum   CS5      = 0x0000000; // 0000000
  999     enum   CS6      = 0x0000010; // 0000020
 1000     enum   CS7      = 0x0000020; // 0000040
 1001     enum   CS8      = 0x0000030; // 0000060
 1002     enum CSTOPB     = 0x0000040; // 0000100
 1003     enum CREAD      = 0x0000080; // 0000200
 1004     enum PARENB     = 0x0000100; // 0000400
 1005     enum PARODD     = 0x0000200; // 0001000
 1006     enum HUPCL      = 0x0000400; // 0002000
 1007     enum CLOCAL     = 0x0000800; // 0004000
 1008 
 1009     enum ECHO       = 0x0000008; // 0000010
 1010     enum ECHOE      = 0x0000010; // 0000020
 1011     enum ECHOK      = 0x0000020; // 0000040
 1012     enum ECHONL     = 0x0000040; // 0000100
 1013     enum ICANON     = 0x0000002; // 0000002
 1014     enum IEXTEN     = 0x0008000; // 0100000
 1015     enum ISIG       = 0x0000001; // 0000001
 1016     enum NOFLSH     = 0x0000080; // 0000200
 1017     enum TOSTOP     = 0x0000100; // 0000400
 1018 
 1019     enum TCSANOW    = 0;
 1020     enum TCSADRAIN  = 1;
 1021     enum TCSAFLUSH  = 2;
 1022 
 1023     enum TCIFLUSH   = 0;
 1024     enum TCOFLUSH   = 1;
 1025     enum TCIOFLUSH  = 2;
 1026 
 1027     enum TCIOFF     = 2;
 1028     enum TCION      = 3;
 1029     enum TCOOFF     = 0;
 1030     enum TCOON      = 1;
 1031 
 1032     speed_t cfgetispeed(const scope termios*);
 1033     speed_t cfgetospeed(const scope termios*);
 1034     int     cfsetispeed(termios*, speed_t);
 1035     int     cfsetospeed(termios*, speed_t);
 1036     int     tcdrain(int);
 1037     int     tcflow(int, int);
 1038     int     tcflush(int, int);
 1039     int     tcgetattr(int, termios*);
 1040     int     tcsendbreak(int, int);
 1041     int     tcsetattr(int, int, const scope termios*);
 1042 }
 1043 
 1044 //
 1045 // XOpen (XSI)
 1046 //
 1047 /*
 1048 IXANY
 1049 
 1050 ONLCR
 1051 OCRNL
 1052 ONOCR
 1053 ONLRET
 1054 OFILL
 1055 NLDLY
 1056     NL0
 1057     NL1
 1058 CRDLY
 1059     CR0
 1060     CR1
 1061     CR2
 1062     CR3
 1063 TABDLY
 1064     TAB0
 1065     TAB1
 1066     TAB2
 1067     TAB3
 1068 BSDLY
 1069     BS0
 1070     BS1
 1071 VTDLY
 1072     VT0
 1073     VT1
 1074 FFDLY
 1075     FF0
 1076     FF1
 1077 
 1078 pid_t   tcgetsid(int);
 1079 */
 1080 
 1081 version (CRuntime_Glibc)
 1082 {
 1083     enum IXANY      = 0x0000800; // 0004000
 1084 
 1085     enum ONLCR      = 0x0000004; // 0000004
 1086     enum OCRNL      = 0x0000008; // 0000010
 1087     enum ONOCR      = 0x0000010; // 0000020
 1088     enum ONLRET     = 0x0000020; // 0000040
 1089     enum OFILL      = 0x0000040; // 0000100
 1090     enum NLDLY      = 0x0000100; // 0000400
 1091     enum   NL0      = 0x0000000; // 0000000
 1092     enum   NL1      = 0x0000100; // 0000400
 1093     enum CRDLY      = 0x0000600; // 0003000
 1094     enum   CR0      = 0x0000000; // 0000000
 1095     enum   CR1      = 0x0000200; // 0001000
 1096     enum   CR2      = 0x0000400; // 0002000
 1097     enum   CR3      = 0x0000600; // 0003000
 1098     enum TABDLY     = 0x0001800; // 0014000
 1099     enum   TAB0     = 0x0000000; // 0000000
 1100     enum   TAB1     = 0x0000800; // 0004000
 1101     enum   TAB2     = 0x0001000; // 0010000
 1102     enum   TAB3     = 0x0001800; // 0014000
 1103     enum BSDLY      = 0x0002000; // 0020000
 1104     enum   BS0      = 0x0000000; // 0000000
 1105     enum   BS1      = 0x0002000; // 0020000
 1106     enum VTDLY      = 0x0004000; // 0040000
 1107     enum   VT0      = 0x0000000; // 0000000
 1108     enum   VT1      = 0x0004000; // 0040000
 1109     enum FFDLY      = 0x0008000; // 0100000
 1110     enum   FF0      = 0x0000000; // 0000000
 1111     enum   FF1      = 0x0008000; // 0100000
 1112 
 1113     pid_t   tcgetsid(int);
 1114 }
 1115 
 1116 else version (Darwin)
 1117 {
 1118     enum IXANY      = 0x00000800;
 1119 
 1120     enum ONLCR      = 0x00000002;
 1121     enum OCRNL      = 0x00000010;
 1122     enum ONOCR      = 0x00000020;
 1123     enum ONLRET     = 0x00000040;
 1124     enum OFILL      = 0x00000080;
 1125     enum NLDLY      = 0x00000300;
 1126     enum   NL0      = 0x00000000;
 1127     enum   NL1      = 0x00000100;
 1128     enum CRDLY      = 0x00003000;
 1129     enum   CR0      = 0x00000000;
 1130     enum   CR1      = 0x00001000;
 1131     enum   CR2      = 0x00002000;
 1132     enum   CR3      = 0x00003000;
 1133     enum TABDLY     = 0x00000c04;
 1134     enum   TAB0     = 0x00000000;
 1135     enum   TAB1     = 0x00000400;
 1136     enum   TAB2     = 0x00000800;
 1137     enum   TAB3     = 0x00000004;
 1138     enum BSDLY      = 0x00008000;
 1139     enum   BS0      = 0x00000000;
 1140     enum   BS1      = 0x00008000;
 1141     enum VTDLY      = 0x00010000;
 1142     enum   VT0      = 0x00000000;
 1143     enum   VT1      = 0x00010000;
 1144     enum FFDLY      = 0x00004000;
 1145     enum   FF0      = 0x00000000;
 1146     enum   FF1      = 0x00004000;
 1147 
 1148     pid_t tcgetsid (int);
 1149 }
 1150 
 1151 else version (FreeBSD)
 1152 {
 1153     enum IXANY      = 0x00000800;
 1154 
 1155     enum ONLCR      = 0x00000002;
 1156     enum OCRNL      = 0x00000010;
 1157     enum ONOCR      = 0x00000020;
 1158     enum ONLRET     = 0x00000040;
 1159     //enum OFILL
 1160     //enum NLDLY
 1161     //enum     NL0
 1162     //enum     NL1
 1163     //enum CRDLY
 1164     //enum     CR0
 1165     //enum     CR1
 1166     //enum     CR2
 1167     //enum     CR3
 1168     enum TABDLY     = 0x00000004;
 1169     enum     TAB0   = 0x00000000;
 1170     //enum     TAB1
 1171     //enum     TAB2
 1172     enum     TAB3   = 0x00000004;
 1173     //enum BSDLY
 1174     //enum     BS0
 1175     //enum     BS1
 1176     //enum VTDLY
 1177     //enum     VT0
 1178     //enum     VT1
 1179     //enum FFDLY
 1180     //enum     FF0
 1181     //enum     FF1
 1182 
 1183     pid_t   tcgetsid(int);
 1184 }
 1185 else version (DragonFlyBSD)
 1186 {
 1187     enum IXANY      = 0x00000800;
 1188 
 1189     enum ONLCR      = 0x00000002;
 1190     enum OCRNL      = 0x00000010;
 1191     enum ONOCR      = 0x00000020;
 1192     enum ONLRET     = 0x00000040;
 1193     //enum OFILL
 1194     //enum NLDLY
 1195     //enum     NL0
 1196     //enum     NL1
 1197     //enum CRDLY
 1198     //enum     CR0
 1199     //enum     CR1
 1200     //enum     CR2
 1201     //enum     CR3
 1202     enum TABDLY     = 0x00000004;
 1203     enum     TAB0   = 0x00000000;
 1204     //enum     TAB1
 1205     //enum     TAB2
 1206     enum     TAB3   = 0x00000004;
 1207     //enum BSDLY
 1208     //enum     BS0
 1209     //enum     BS1
 1210     //enum VTDLY
 1211     //enum     VT0
 1212     //enum     VT1
 1213     //enum FFDLY
 1214     //enum     FF0
 1215     //enum     FF1
 1216 
 1217     pid_t   tcgetsid(int);
 1218 }
 1219 else version (NetBSD)
 1220 {
 1221     enum IXANY      = 0x00000800;
 1222 
 1223     enum ONLCR      = 0x00000002;
 1224     enum OCRNL      = 0x00000010;
 1225     enum ONOCR      = 0x00000020;
 1226     enum ONLRET     = 0x00000040;
 1227     //enum OFILL
 1228     //enum NLDLY
 1229     //enum     NL0
 1230     //enum     NL1
 1231     //enum CRDLY
 1232     //enum     CR0
 1233     //enum     CR1
 1234     //enum     CR2
 1235     //enum     CR3
 1236     enum TABDLY     = 0x00000004;
 1237     enum     TAB0   = 0x00000000;
 1238     //enum     TAB1
 1239     //enum     TAB2
 1240     enum     TAB3   = 0x00000004;
 1241     //enum BSDLY
 1242     //enum     BS0
 1243     //enum     BS1
 1244     //enum VTDLY
 1245     //enum     VT0
 1246     //enum     VT1
 1247     //enum FFDLY
 1248     //enum     FF0
 1249     //enum     FF1
 1250 
 1251     pid_t   tcgetsid(int);
 1252 }
 1253 else version (OpenBSD)
 1254 {
 1255     enum IXANY      = 0x00000800;
 1256 
 1257     enum ONLCR      = 0x00000002;
 1258     enum OCRNL      = 0x00000010;
 1259     enum ONOCR      = 0x00000040;
 1260     enum ONLRET     = 0x00000080;
 1261     //enum OFILL
 1262     //enum NLDLY
 1263     //enum   NL0
 1264     //enum   NL1
 1265     //enum CRDLY
 1266     //enum   CR0
 1267     //enum   CR1
 1268     //enum   CR2
 1269     //enum   CR3
 1270     //enum TABDLY
 1271     //enum   TAB0
 1272     //enum   TAB1
 1273     //enum   TAB2
 1274     //enum   TAB3
 1275     //enum BSDLY
 1276     //enum   BS0
 1277     //enum   BS1
 1278     //enum VTDLY
 1279     //enum   VT0
 1280     //enum   VT1
 1281     //enum FFDLY
 1282     //enum   FF0
 1283     //enum   FF1
 1284 
 1285     pid_t   tcgetsid(int);
 1286 }
 1287 else version (Solaris)
 1288 {
 1289     enum IXANY      = 0x0000800;
 1290 
 1291     enum ONLCR      = 0x0000004;
 1292     enum OCRNL      = 0x0000008;
 1293     enum ONOCR      = 0x0000010;
 1294     enum ONLRET     = 0x0000020;
 1295     enum OFILL      = 0x0000040;
 1296     enum OFDEL      = 0x0000080;
 1297     enum NLDLY      = 0x0000100;
 1298     enum NL0        = 0x0000000;
 1299     enum NL1        = 0x0000100;
 1300     enum CRDLY      = 0x0000600;
 1301     enum CR0        = 0x0000000;
 1302     enum CR1        = 0x0000200;
 1303     enum CR2        = 0x0000400;
 1304     enum CR3        = 0x0000600;
 1305     enum TABDLY     = 0x0001800;
 1306     enum TAB0       = 0x0000000;
 1307     enum TAB1       = 0x0000800;
 1308     enum TAB2       = 0x0001000;
 1309     enum TAB3       = 0x0001800;
 1310     enum BSDLY      = 0x0002000;
 1311     enum BS0        = 0x0000000;
 1312     enum BS1        = 0x0002000;
 1313     enum VTDLY      = 0x0004000;
 1314     enum VT0        = 0x0000000;
 1315     enum VT1        = 0x0004000;
 1316     enum FFDLY      = 0x0008000;
 1317     enum FF0        = 0x0000000;
 1318     enum FF1        = 0x0008000;
 1319     enum XCASE      = 0x0000004;
 1320 
 1321     pid_t   tcgetsid(int);
 1322 }
 1323 else version (CRuntime_UClibc)
 1324 {
 1325     enum IXANY      = 0x0000800; // 0004000
 1326 
 1327     enum ONLCR      = 0x0000004; // 0000004
 1328     enum OCRNL      = 0x0000008; // 0000010
 1329     enum ONOCR      = 0x0000010; // 0000020
 1330     enum ONLRET     = 0x0000020; // 0000040
 1331     enum OFILL      = 0x0000040; // 0000100
 1332     enum NLDLY      = 0x0000100; // 0000400
 1333     enum   NL0      = 0x0000000; // 0000000
 1334     enum   NL1      = 0x0000100; // 0000400
 1335     enum CRDLY      = 0x0000600; // 0003000
 1336     enum   CR0      = 0x0000000; // 0000000
 1337     enum   CR1      = 0x0000200; // 0001000
 1338     enum   CR2      = 0x0000400; // 0002000
 1339     enum   CR3      = 0x0000600; // 0003000
 1340     enum TABDLY     = 0x0001800; // 0014000
 1341     enum   TAB0     = 0x0000000; // 0000000
 1342     enum   TAB1     = 0x0000800; // 0004000
 1343     enum   TAB2     = 0x0001000; // 0010000
 1344     enum   TAB3     = 0x0001800; // 0014000
 1345     enum BSDLY      = 0x0002000; // 0020000
 1346     enum   BS0      = 0x0000000; // 0000000
 1347     enum   BS1      = 0x0002000; // 0020000
 1348     enum VTDLY      = 0x0004000; // 0040000
 1349     enum   VT0      = 0x0000000; // 0000000
 1350     enum   VT1      = 0x0004000; // 0040000
 1351     enum FFDLY      = 0x0008000; // 0100000
 1352     enum   FF0      = 0x0000000; // 0000000
 1353     enum   FF1      = 0x0008000; // 0100000
 1354 
 1355     pid_t   tcgetsid(int);
 1356 }