ENUM XZ_RET(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… enum xz_ret(9) โ€” Return Codes, Bestie โœจ

okay so this is a page from the Kernel API Manual and it's literally all about enum xz_ret, aka the return codes the XZ decompressor hands back to you, and ngl you're gonna want to know every single one of them ๐Ÿซถ


โœจ NAME โœจ

enum xz_ret โ€” Return codes ๐Ÿ’–


๐ŸŒธ SYNOPSIS ๐ŸŒธ

enum xz_ret {
    XZ_OK ,
    XZ_STREAM_END ,
    XZ_UNSUPPORTED_CHECK ,
    XZ_MEM_ERROR ,
    XZ_MEMLIMIT_ERROR ,
    XZ_FORMAT_ERROR ,
    XZ_OPTIONS_ERROR ,
    XZ_DATA_ERROR ,
    XZ_BUF_ERROR

};

๐ŸŽ€ CONSTANTS ๐ŸŽ€

okay bestie, here's the whole cast of characters, main character energy each and every one ๐Ÿ‘‘

  • XZ_OK โ€” Everything's slaying so far ๐Ÿ’… but like, you still need more input or more output space to actually keep going. Heads up: this return code is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC).
  • XZ_STREAM_END โ€” Operation finished successfully โœจ iconic, no notes, we love a happy ending.
  • XZ_UNSUPPORTED_CHECK โ€” The integrity check type is not supported ๐Ÿ˜ญ but decoding is still possible in multi-call mode โ€” you literally just call xz_dec_run again and keep it moving. Note that this return value is used only if XZ_DEC_ANY_CHECK was defined at build time, which is not used in the kernel. Unsupported check types return XZ_OPTIONS_ERROR if XZ_DEC_ANY_CHECK was not defined at build time.
  • XZ_MEM_ERROR โ€” Allocating memory failed ๐Ÿ’€ This return code is possible only if the decoder was initialized with XZ_DYNALLOC. The amount of memory that was tried to be allocated was no more than the dict_max argument given to xz_dec_init.
  • XZ_MEMLIMIT_ERROR โ€” A bigger LZMA2 dictionary would be needed than allowed by the dict_max argument given to xz_dec_init ๐Ÿ™ˆ This return value is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC); the single-call mode (XZ_SINGLE) ignores the dict_max argument.
  • XZ_FORMAT_ERROR โ€” File format was not recognized (wrong magic bytes) ๐Ÿ”ฎ like who even are you.
  • XZ_OPTIONS_ERROR โ€” This implementation doesn't support the requested compression options ๐Ÿ’€ In the decoder this means that the header CRC32 matches, but the header itself specifies something that we don't support.
  • XZ_DATA_ERROR โ€” Compressed data is corrupt ๐Ÿ˜ญ rip.
  • XZ_BUF_ERROR โ€” Cannot make any progress ๐Ÿงš Details are slightly different between multi-call and single-call mode; more information below.

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls to XZ code cannot consume any input and cannot produce any new output. This happens when there is no new input available, or the output buffer is full while at least one output byte is still pending. Assuming your code is not buggy, you can get this error only when decoding a compressed stream that is truncated or otherwise corrupt ๐Ÿ‘€

In single-call mode, XZ_BUF_ERROR is returned only when the output buffer is too small or the compressed input is corrupt in a way that makes the decoder produce more output than the caller expected. When it is (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR is used instead of XZ_BUF_ERROR ๐Ÿ’œ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Kernel file ./include/linux/xz.h โ€” plus the whole friend group fr fr: enum xz_mode(9), struct xz_buf(9), xz_dec_init(9), xz_dec_run(9), xz_dec_reset(9), xz_dec_end(9), MicroLZMA decompressor(9), xz_dec_microlzma_alloc(9), xz_dec_microlzma_reset(9), xz_dec_microlzma_run(9), xz_dec_microlzma_end(9)


okay that's the whole page ๐Ÿซถ and for the credits moment: this one lives in ./include/linux, it's the October 2026 edition, and it's filed under enum xz_ret(9) โ€” periodt ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from