LINEDISC(9)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… linedisc(9) β€” extensible line discipline framework πŸ’…

okay so bestie, this page is from the Kernel Developer's Manual, section 9, and it’s giving β€œkernel modules deserve main character energy too.” We’re talking about the NetBSD TTY line discipline framework, and it is extensible. Periodt. 🫢


🌸 NAME 🌸

linedisc, ttyldisc_add, ttyldisc_lookup, ttyldisc_remove β€” extensible line discipline framework


✨ SYNOPSIS ✨

#include <sys/conf.h>

int
ttyldisc_add(struct linesw *disc, int no);

struct linesw *
ttyldisc_remove(const char *name);

struct linesw *
ttyldisc_lookup(const char *name);

πŸ’– DESCRIPTION πŸ’–

The NetBSD TTY line discipline framework allows extensibility. Modules that need special line disciplines can add them as convenient and do not need to modify tty_conf.c. Line disciplines are now managed by a string, rather than number. Slay. ✨

Once the framework has been initialized, a new line discipline can be added by creating and initializing a struct linesw and calling ttyldisc_add().

Here’s the brief tea on each function in the framework, bestie:

  • ttyldisc_add() β€” Register a line discipline. The l_name field of the struct linesw should point to a string which is to be the symbolic name of that line discipline. For compatibility purposes, a line discipline number can be passed in no, but for new disciplines this should be set to -1. Iconic registration moment. πŸŽ€
  • ttyldisc_lookup() β€” Look up a line discipline by name. NULL is returned if it can not be found. Vibe check failed? You get NULL. 😭
  • ttyldisc_remove() β€” Remove a line discipline called name and return a pointer to it. If the discipline cannot be found or removed ttyldisc_remove() will return NULL. Bye bestie, but make it safe. πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

  • tty(4) β€” go read this too, bestie 🫢

πŸŽ€ HISTORY πŸŽ€

The linedisc functions were added in NetBSD 1.6. That’s the lore. 🌈


πŸ‘‘ AUTHORS πŸ‘‘

The NetBSD extensible line discipline framework was created by Eduardo Horvath ⟨eeh@NetBSD.org⟩. We stan a framework creator. πŸ‘‘


mwah πŸ’‹ this page’s footer energy is Debian, dated November 1, 2000 β€” that’s the source/version and date, bestie. Periodt. 🌸

πŸ“¦ where this page comes from