n_hdlc_tty_read(9)
π 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 roomkbufactually 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 π«Ά:
struct n_hdlc(9)n_hdlc_tty_close(9)n_hdlc_tty_open(9)n_hdlc_send_frames(9)n_hdlc_tty_write_work(9)n_hdlc_tty_wakeup(9)n_hdlc_tty_receive(9)n_hdlc_tty_write(9)n_hdlc_tty_ioctl(9)n_hdlc_tty_poll(9)n_hdlc_alloc(9)n_hdlc_buf_return(9)n_hdlc_buf_put(9)n_hdlc_buf_get(9)
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
- 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