STRUCT TTY_PORT_OPERATIONS(9)
π struct tty_port_operations(9) π
okay so bestie, welcome to the Kernel API Manual β this one's all about struct tty_port_operations, which is literally the operations table for a tty_port. think of it as the vibe check that tells your port how to behave. π
β¨ NAME β¨
struct tty_port_operations β operations on tty_port. that's it, that's the whole name, no cap. π¦
πΈ SYNOPSIS πΈ
struct tty_port_operations {
bool (*carrier_raised)(struct tty_port *port);
void (*dtr_rts)(struct tty_port *port, bool active);
void (*shutdown)(struct tty_port *port);
int (*activate)(struct tty_port *port, struct tty_struct *tty);
void (*destruct)(struct tty_port *port);
};
look at that struct. iconic. five function pointers, every one of them doing its little job. π
π«Ά Members π«Ά
carrier_raisedβ returntrueif the carrier is raised on port. like, is the line actually up? yes or no, bestie, don't leave us guessing. πdtr_rtsβ raise the DTR line if active istrue, otherwise lower DTR. up or down, that's the whole assignment. βshutdownβ called when the last close completes or a hangup finishes, IFF the port was initialized. > β οΈ do NOT use this to free resources, fr fr β turn off the device only. it's called under the port mutex to serialize againstactivateandshutdown. yes, it serializes against itself too, that's what the manpage says, don't come for me. πactivateβ called under the port mutex fromtty_port_open, serialized using the port mutex. supposed to turn on the device. like flipping the light switch but with more locking. π₯destructβ called on the final put of a port. free resources, possibly incl. the port itself. yes, it can take the port down with it. main character energy honestly. π
π§ Description π§
FIXME: long term getting the tty argument *out* of this would be good for consoles.
that's the whole description. it's literally a FIXME and honestly? respect for the honesty. future-someone's problem, iykyk. π
π SEE ALSO π
- Kernel file
./include/linux/tty_port.h struct tty_port(9)
and that's the page!! go forth and implement your port operations, bestie, you're gonna slay π
β with love from ./include/linux, October 2026, on behalf of struct tty_port_operations(9) πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms