tty_ldisc_receive_buf(9)
π tty_ldisc_receive_buf π
okay bestie, so we're in the Kernel API Manual today and the star of the show is tty_ldisc_receive_buf β literally the function that forwards data to the line discipline. no cap, that's the whole vibe. π
β¨ NAME β¨
tty_ldisc_receive_buf β forward data to line discipline π¦
πΈ SYNOPSIS πΈ
size_t tty_ldisc_receive_buf (struct tty_ldisc *ld , const u8 *p , const
const u8 *f , size_t count );
wait β copy that exactly, ok? the line break and all. she's precise. π
π ARGUMENTS π
ldβ the line discipline that's gonna process the input. she's the one doing the work, periodt. πpβ char buffer. the actual bytes, living their life. πfβ the flags buffer:TTY_NORMAL,TTY_BREAK, etc. think of it as the little mood ring for each byte. πcountβ number of bytes to process. how many we're serving today, no more no less. β¨
π§ DESCRIPTION π§
here's the tea: if you're a caller other than flush_to_ldisc, you need to exclude the kworker from concurrent use of the line discipline. yes, really. don't let them both touch it at once, that's giving chaos energy π. and if you want to see how it's done properly, go look at paste_selection β she ate. π
bestie pls don't skip this part. the kworker exclusion is not optional vibes, it's the whole point. π
β RETURN β
returns the number of bytes processed. iconic. π₯
π SEE ALSO π
- Kernel file
./drivers/tty/tty_buffer.c tty_buffer_lock_exclusive(9)tty_buffer_unlock_exclusive(9)tty_buffer_space_avail(9)tty_buffer_free_all(9)tty_buffer_alloc(9)tty_buffer_free(9)tty_buffer_flush(9)__tty_buffer_request_room(9)tty_prepare_flip_string(9)flush_to_ldisc(9)tty_flip_buffer_push(9)tty_insert_flip_string_and_push_buffer(9)tty_buffer_init(9)tty_buffer_set_limit(9)
the whole friend group, fr fr. go say hi. π«Ά
k bye ily, this page came straight out of ./drivers/tty and it's dated October 2026 β so yes, she's from the future and she's still slaying πβ¨
π¦ 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