do_output_char(9)
π do_output_char(9) β the kernel API manual, bestie edition
okay so picture this: you're deep in the Kernel API Manual, page do_output_char(9). That's our whole vibe today. Sit down, grab a boba, we're gonna talk about outputting one character. Yes, one. Iconic.
β¨ NAME β¨
do_output_char β output one character. that's it. that's the whole job. she's focused, she's efficient, she ate π
π SYNOPSIS π
int do_output_char (u8 c , struct tty_struct *tty , int space );
π¦ ARGUMENTS π¦
cβ the character, or likeβ¦ a partial unicode symbol. no pressure, just a fragment of a vibe. πttyβ the terminal device. the main character of this whole situation.spaceβ how much room is actually left in the tty driver's write buffer. know your limits, queen.
πΈ DESCRIPTION πΈ
So this is a helper function β a little bestie whose entire purpose is handling one output character. And not just the easy ones: we're talking special characters too, like TAB, CR, LF, etc. She does the OPOST processing and then drops the results straight into the tty driver's write buffer. Lowkey a lot of responsibility for one function ngl π«Ά
β οΈ Important note, and I need you to hear me: Linux currently ignoresTABDLY,CRDLY,VTDLY,FFDLYandNLDLY. They simply aren't relevant in the world today. That's canon. If you ever need them β and I mean ever β add them here. Don't come for me, come for the code. π
Locking: she should be called under the output_lock to protect the column state and the space left in the buffer. no cap, this is not optional, protect the state bestie π
β RETURN β
The number of bytes of buffer space used β or -1 if there's no space left. that -1 is giving "no room at the inn" energy π
π SEE ALSO π
Literally all her friends, the whole group chat, Kernel file ./drivers/tty/n_tty.c:
n_tty_kick_worker(9)n_tty_write_wakeup(9)put_tty_queue(9)reset_buffer_flags(9)n_tty_flush_buffer(9)is_utf8_continuation(9)is_continuation(9)process_output(9)process_output_block(9)__process_echoes(9)add_echo_byte(9)echo_move_back_col(9)echo_set_canon_col(9)echo_erase_tab(9)echo_char_raw(9)echo_char(9)finish_erasing(9)eraser(9)isig(9)n_tty_receive_break(9)n_tty_receive_overrun(9)n_tty_receive_parity_error(9)n_tty_receive_char_flow_ctrl(9)n_tty_receive_char(9)n_tty_receive_buf_common(9)n_tty_set_termios(9)n_tty_close(9)n_tty_open(9)copy_from_read_buf(9)canon_copy_from_read_buf(9)job_control(9)n_tty_read(9)n_tty_write(9)n_tty_poll(9)n_tty_inherit_ops(9)
π and that's the page!! mwah π sign-off time: this lil slice of the Kernel API Manual lives at ./drivers/tty, dated October 2026. she's do_output_char(9) and she's that girl. periodt. πβ¨
π¦ 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