logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Linux::Termios2" - wrap the Linux-specific "struct termios2" structure and related

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-10-20                               Linux::Termios2(3pm)

Description

       This class provides an API equivalent to the POSIX::Termios class, except backed by the Linux-specific
       "struct termios2" structure instead.

       It uses the "TCGETS2" and "TCSETS2" family of ioctl() calls, meaning it has access to the arbitrary baud
       rate ability of the "c_ispeed" and "c_ospeed" fields with the "BOTHER" baud setting. These are accessed
       transparently, by simply calling "setispeed" and "setospeed" with baud rates in bits per second.

Name

       "Linux::Termios2" - wrap the Linux-specific "struct termios2" structure and related

Synopsis

       This module is primarily intended as a helper for IO::Termios, but it could also be used directly.

        use Linux::Termios2;
        use POSIX qw( TCSANOW );

        my $termios = Linux::Termios2->new;
        $termios->getattr( 0 );

        $termios->setospeed( 123456 );

        $termios->setattr( 0, TCSANOW ) or
           die "Cannot TCSETS2 - $!";