zstd_compress_cctx(9)
π zstd_compress_cctx(9)
okay so this is a page from the Kernel API Manual β yes bestie, we're in kernel-land now, it's giving "big brain main character energy" and honestly? iconic π
β¨ NAME β¨
zstd_compress_cctx β compress src into dst with the initialized parameters π«Ά
πΈ SYNOPSIS πΈ
size_t zstd_compress_cctx (zstd_cctx *cctx , void *dst , size_t
dst_capacity , const void *src , size_t src_size , const zstd_parameters
*parameters );
no cap, that's the whole signature, keep it exactly like that π
π¦ ARGUMENTS π¦
cctxβ the context, bestie. it must have been initialized withzstd_init_cctxβ like, this is not optional, do not skip this step πdstβ the buffer you're compressingsrcinto. that's her home now πdst_capacityβ the size of the destination buffer. lowkey it may be any size, butZSTD_compressBound(srcSize)is guaranteed to be large enough. so if you want the safe route, that's the vibe βsrcβ the data to compress. the raw material, the moment, the muse β¨src_sizeβ the size of the data to compress. gotta know how much you're working with πparametersβ the compression parameters to be used. the settings, the lewk, the whole aesthetic π
π₯ RETURN π₯
it returns the compressed size π β or an error π, which you can check using zstd_is_error. fr fr, always check, don't just assume it slayed.
π SEE ALSO π
kernel file ./include/linux/zstd.h plus the whole friend group:
zstd_compress_bound(9)zstd_is_error(9)zstd_get_error_code(9)zstd_get_error_name(9)zstd_min_clevel(9)zstd_max_clevel(9)zstd_default_clevel(9)zstd_get_params(9)zstd_get_cparams(9)zstd_cctx_set_param(9)zstd_cctx_workspace_bound(9)zstd_cctx_workspace_bound_with_ext_seq_prod(9)zstd_init_cctx(9)zstd_create_cctx_advanced(9)zstd_free_cctx(9)zstd_create_cdict_byreference(9)zstd_free_cdict(9)zstd_compress_using_cdict(9)zstd_dctx_workspace_bound(9)zstd_init_dctx(9)zstd_decompress_dctx(9)zstd_create_ddict_byreference(9)zstd_free_ddict(9)zstd_create_dctx_advanced(9)zstd_free_dctx(9)zstd_decompress_using_ddict(9)zstd_cstream_workspace_bound(9)zstd_cstream_workspace_bound_with_ext_seq_prod(9)zstd_init_cstream(9)zstd_reset_cstream(9)zstd_compress_stream(9)zstd_flush_stream(9)zstd_end_stream(9)zstd_dstream_workspace_bound(9)zstd_init_dstream(9)zstd_reset_dstream(9)zstd_decompress_stream(9)zstd_find_frame_compressed_size(9)zstd_get_frame_header(9)zstd_compress_sequences_and_literals(9)
that's the whole page, bestie β go compress something and slay π
source path: ./include/linux Β· dated October 2026 Β· manual: zstd_compress_cctx(9) β ok that's the cute sign-off, ily, bye π§ββοΈπ
π¦ 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