do_output_char(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 ignores TABDLY, CRDLY, VTDLY, FFDLY and NLDLY. 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:


🌈 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