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