n_hdlc_tty_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– n_hdlc_tty_read(9) πŸ’–

okay so this is a page straight out of the Kernel API Manual, bestie β€” it's called n_hdlc_tty_read, and it's literally the function that gets called to retrieve one frame of data (if available). yes, "if available" is doing a lot of work in that sentence, we love a conditional πŸ’…


✨ SYNOPSIS ✨

ssize_t n_hdlc_tty_read (struct tty_struct *tty , struct file *file , u8
*kbuf , size_t nr , void **cookie , unsigned long offset );

that's it, that's the whole vibe. ssize_t return, six arguments, no notes πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tty β€” pointer to tty instance data. it's giving "the actual device we're talking to" energy ✨
  • file β€” pointer to open file object. the file that's, y'know, open πŸ‘‘
  • kbuf β€” pointer to returned data buffer. this is where the data goes to live πŸ’–
  • nr β€” size of returned data buffer. how much room kbuf actually has, no cap 🌸
  • cookie β€” stored rbuf from previous run. yes it's literally called a cookie, and yes that's iconic πŸ“
  • offset β€” offset into the data buffer. where in the buffer we're starting from 🧚

πŸ”₯ DESCRIPTION πŸ”₯

Returns the number of bytes returned or error code. that's it. that's the whole description. short queen behavior, honestly πŸ’€

like β€” read it, get a byte count, or get an error. no in-between, no extra lore, periodt ⭐


🌈 SEE ALSO 🌈

Kernel file ./drivers/tty/n_hdlc.c, plus the whole friend group 🫢:


lowkey a whole family reunion in that SEE ALSO list, and you're invited πŸ’œ

okay bye bestie, this page came from ./drivers/tty and it's dated October 2026 β€” go forth and read those frames, mwah πŸ˜­πŸ’…πŸ¦‹

πŸ“¦ where this page comes from