hl_snprintf_resize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 either NULL or allocated with vmalloc.
  • 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


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