alloc_tty_buffer(9)
π alloc_tty_buffer(9) β a Kernel API Manual moment π
okay so bestie, welcome to the Kernel API Manual entry for alloc_tty_buffer(9) β yes that's the section 9, kernel-internals girlies, we're not in man 1 land anymore π
β¨ NAME β¨
alloc_tty_buffer β returns a brand new struct iucv_tty_buffer element. that's it, that's the job, and she does it slayfully π
πΈ SYNOPSIS πΈ
struct iucv_tty_buffer * alloc_tty_buffer (size_t size , gfp_t flags );
like look at her, one function, two args, zero drama π¦
π«Ά ARGUMENTS π«Ά
sizeβ the size of the internal buffer that's gonna hold your data. literally just how much room the data gets πflagsβ memory allocation flags, and they get passed straight to mempool. no middleman, no vibes check, they go where they go β¨
π DESCRIPTION π
so what she does is: she allocates a new struct iucv_tty_buffer element, and optionally she also allocates an internal data buffer with the size you gave her in size. two-for-one, main character energy fr fr π₯
the important part, the part you cannot skip β the internal data buffer is always allocated with GFP_DMA. not sometimes. always. because that's what's required for receiving and sending data with IUCV. it's giving non-negotiable π
π NOTE π
the total message size arises from the internal buffer size plus the members of the iucv_tty_msg structure. so like, don't forget the struct overhead, bestie, that's the math π
and if memory allocation has failed, the function returns NULL. check for it. please. for me π
no cap: NULL means it failed. handle it or perish π
π SEE ALSO π
the kernel file lives at ./drivers/tty/hvc/hvc_iucv.c and honestly the whole friend group is here:
hvc_iucv_get_private(9)destroy_tty_buffer(9)destroy_tty_buffer_list(9)hvc_iucv_write(9)hvc_iucv_get_chars(9)hvc_iucv_queue(9)hvc_iucv_send(9)hvc_iucv_sndbuf_work(9)hvc_iucv_put_chars(9)hvc_iucv_notifier_add(9)hvc_iucv_cleanup(9)tty_outqueue_empty(9)flush_sndbuf_sync(9)hvc_iucv_hangup(9)hvc_iucv_notifier_hangup(9)hvc_iucv_dtr_rts(9)hvc_iucv_notifier_del(9)hvc_iucv_filter_connreq(9)hvc_iucv_path_pending(9)hvc_iucv_path_severed(9)hvc_iucv_msg_pending(9)hvc_iucv_msg_complete(9)hvc_iucv_alloc(9)hvc_iucv_destroy(9)hvc_iucv_parse_filter(9)hvc_iucv_setup_filter(9)param_set_vmidfilter(9)param_get_vmidfilter(9)hvc_iucv_init(9)hvc_iucv_config(9)
every single one of them, accounted for, no one left on read π§π
and that's the page!! sourced from ./drivers/tty/hvc, dated October 2026, and yeah β that's the whole vibe check on alloc_tty_buffer(9). go forth and allocate responsibly, ily, bye πβ
π¦ 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