ENUM XZ_RET(9)
๐ 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_PREALLOCorXZ_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 callxz_dec_runagain and keep it moving. Note that this return value is used only ifXZ_DEC_ANY_CHECKwas defined at build time, which is not used in the kernel. Unsupported check types returnXZ_OPTIONS_ERRORifXZ_DEC_ANY_CHECKwas not defined at build time.XZ_MEM_ERRORโ Allocating memory failed ๐ This return code is possible only if the decoder was initialized withXZ_DYNALLOC. The amount of memory that was tried to be allocated was no more than thedict_maxargument given toxz_dec_init.XZ_MEMLIMIT_ERRORโ A bigger LZMA2 dictionary would be needed than allowed by thedict_maxargument given toxz_dec_init๐ This return value is possible only in multi-call mode (XZ_PREALLOCorXZ_DYNALLOC); the single-call mode (XZ_SINGLE) ignores thedict_maxargument.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
- 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