Linux::Termios2(3pm)
π NAME π
Linux::Termios2 β the module that wraps the Linux-specific struct termios2 structure and everything that comes with it π
β¨ SYNOPSIS β¨
okay so bestie, real talk: this module mostly exists as a lil helper buddy for IO::Termios, but likeβ¦ it's not gatekeeping. you can absolutely use it directly, no cap π«Ά
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 - $!";
πΈ DESCRIPTION πΈ
So this class hands you an API that's equivalent to the POSIX::Termios class β same energy, same vibe β except it's backed by the Linux-specific struct termios2 structure instead. it's giving glow-up but for structs π
Under the hood it's using the TCGETS2 and TCSETS2 family of ioctl() calls, which is the whole reason it slaps: that means you get access to the arbitrary baud rate ability of the c_ispeed and c_ospeed fields, paired with the BOTHER baud setting. iconic honestly π
and here's the best part β you never have to think about any of that, because it's all accessed transparently. you just call setispeed and setospeed with baud rates in bits per second and the module handles the rest. no cap, fr fr β¨
π¦ AUTHOR π¦
Paul Evans <leonerd@leonerd.org.uk> β ty for your service king π
and that's the whole page bestie!! π this was perl v5.42.3, dated 2026-08-20, and it's the Linux::Termios2(3pm) manual β go forth and set those arbitrary baud rates, you absolute main character πβ¨
π¦ where this page comes from
- ubuntu stonking: liblinux-termios2-perl 0.01-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms