hl_snprintf_resize(9)
okay bestie, welcome to the hl_snprintf_resize(9) page from the Kernel API Manual π
this one is all about printing formatted data into a buffer and resizing that buffer when it needs more room, no cap.
π NAME π
hl_snprintf_resize β print formatted data to buffer, resize as needed β¨
π§ SYNOPSIS π§
int hl_snprintf_resize (char **buf , size_t *size , size_t *offset ,
const char *format , ... );
π ARGUMENTS π
bufβ buffer double pointer, to be written to and resized, must be eitherNULLor allocated withvmalloc.sizeβ current size of the buffer.offsetβ current offset to write to.formatβ format of the data....β variable arguments.
β¨ DESCRIPTION β¨
so here's the tea: this function writes formatted data into the buffer. if the buffer is not large enough, it will be resized using vmalloc β iconic behavior, honestly. size may be modified if the buffer was resized, and offset will be advanced by the number of bytes written not including the terminating character. iykyk π«
Returns 0 on success or an error code on failure π«Ά
Note, bestie: the buffer has to be manually released using vfree π
π SEE ALSO π
Kernel file ./drivers/accel/habanalabs/common/state_dump.c
hl_format_as_binary(9)resize_to_fit(9)hl_sync_engine_to_string(9)hl_print_resize_sync_engine(9)hl_state_dump_get_sync_name(9)hl_state_dump_get_monitor_name(9)hl_state_dump_free_sync_to_engine_map(9)hl_state_dump_get_sync_to_engine(9)hl_state_dump_read_sync_objects(9)hl_state_dump_free_sync_objects(9)hl_state_dump_print_syncs_single_block(9)hl_state_dump_print_syncs(9)hl_state_dump_alloc_read_sm_block_monitors(9)hl_state_dump_free_monitors(9)hl_state_dump_print_monitors_single_block(9)hl_state_dump_print_monitors(9)hl_state_dump_print_engine_fences(9)hl_state_dump_print_fences(9)hl_state_dump(9)
made with π by the Kernel API Manual crew, source/version chillin' at ./drivers/accel/habanalabs/common, dated October 2026 β bye bestie, go resize responsibly! π
β¨
π¦ 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