LZ4_decompress_safe_partial(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay bestie, this is the LZ4_decompress_safe_partial(9) page from the Kernel API Manual πŸ’– and the whole mood is: decompress a block of size compressedSize at position source into buffer dest, but like, carefully and with boundaries. ✨

✨ SYNOPSIS ✨

int LZ4_decompress_safe_partial (const char *source , char *dest , int
       compressedSize , int targetOutputSize , int maxDecompressedSize );

πŸ’… ARGUMENTS πŸ’…

  • source β€” the source address of the compressed data. literally where the compressed stuff lives. πŸ“
  • dest β€” the output buffer address for the decompressed data, and it must already be allocated, bestie. 🫢
  • compressedSize β€” the precise full size of the compressed block. not approximate, not vibe-based: precise. πŸ’―
  • targetOutputSize β€” the decompression operation will try to stop as soon as targetOutputSize has been reached. like β€œokay we’re done here” energy. βœ‹
  • maxDecompressedSize β€” the size of the destination buffer. this is the boundary, respect it. 🚧

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function decompresses a compressed block of size compressedSize at position source into destination buffer dest of size maxDecompressedSize. it tries to stop the decompression operation as soon as targetOutputSize has been reached. πŸ‘‘

and the safety part? iconic. this function never writes outside of the output buffer, and never reads outside of the input buffer. that means it is therefore protected against malicious data packets. no cap, that’s the whole protective vibe. πŸ›‘οΈβœ¨

πŸŽ€ RETURN πŸŽ€

it returns the number of bytes decoded in the destination buffer (necessarily <= maxDecompressedSize) or a negative result in case of error. so it’s a byte count when it slays, and a negative result when something went wrong. 😭

πŸ”₯ SEE ALSO πŸ”₯

kernel file: ./include/linux/lz4.h β€” and the whole friend group is here:


okay that’s the page, bestie β€” this one is from ./include/linux, October 2026, and it’s the LZ4_decompress_safe_partial(9) manual. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from