zstd_end_stream(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ zstd_end_stream(9) πŸŽ€

okay bestie, welcome to the Kernel API Manual page for zstd_end_stream(9). It’s giving β€œlast call at the compression party” energy, and honestly? Iconic. πŸ’…


✨ NAME ✨

zstd_end_stream β€” flush internal buffers into output and end the frame. That’s the whole vibe: get the internal buffers out into output, then wrap up the frame. 🎬


πŸ¦‹ SYNOPSIS πŸ¦‹

size_t zstd_end_stream (zstd_cstream *cstream , zstd_out_buffer *output
);

🌸 ARGUMENTS 🌸

  • cstream β€” the zstd streaming compression context. This is the context you’re working with, main character energy. πŸ‘‘
  • output β€” destination buffer. output->pos is updated to indicate how much compressed data was written. Yes, it tracks the progress for you. 🫢

πŸ’– DESCRIPTION πŸ’–

zstd_end_stream is not a one-and-done bestie. It must be called until it returns 0, meaning all the data has been flushed and the frame epilogue has been written. So keep calling it, and when you finally see that 0, that’s the β€œwe’re done, frame epilogue written” moment. ✨


πŸ”₯ RETURN πŸ”₯

Returns the number of bytes still present within internal buffers, or an error. You can check that error using zstd_is_error. So if the number isn’t 0 and it’s not an error, there’s still stuff in the internal buffers β€” keep going. πŸ‘€


🌈 SEE ALSO 🌈

Kernel file: ./include/linux/zstd.h. Here’s the whole squad β€” every single reference, no skips:


mwah πŸ’‹ β€” source/version: ./include/linux; date: October 2026. Bye bestie! 🫢

πŸ“¦ where this page comes from