tty_buffer_space_avail(9)
πΈ tty_buffer_space_avail(9) πΈ
okay so bestie π this is the Kernel API Manual page for tty_buffer_space_avail(9) β tiny function, very specific job, honestly iconic. Let's get into it β¨
β¨ NAME β¨
tty_buffer_space_avail β return unused buffer space π
β¨ SYNOPSIS β¨
unsigned int tty_buffer_space_avail (struct tty_port *port );
π«Ά ARGUMENTS π«Ά
portβ the tty port owning the flip buffer. she's literally holding the buffer, no cap π«Ά
π RETURN π
the # of bytes which can be written by the driver without reaching the buffer limit. it's giving "here's your room report" β¨
β οΈ NOTE β οΈ
this does not guarantee that memory is available to write the returned#of bytes (usetty_prepare_flip_stringto pre-allocate if memory guarantee is required). so yeah, don't @ me π β if you need that memory guarantee, do the pre-allocate thing, fr fr.
π SEE ALSO π
Kernel file ./drivers/tty/tty_buffer.c β and the whole friend group:
tty_buffer_lock_exclusive(9)tty_buffer_unlock_exclusive(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)tty_ldisc_receive_buf(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)
bye bestie π stay spacey β¨ β source/version: ./drivers/tty, date: October 2026, page: tty_buffer_space_avail(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