KNET_GET_...RESS_LIST(3)

πŸ’– KNET_GET_COMPRESS_LIST πŸ’–

okay bestie, welcome to the Kronosnet Programmer's Manual ✨ this is knet_get_compress_list(3) and she's here to spill the tea on every compression system your libknet is holding πŸ’…


🌸 NAME 🌸

knet_get_compress_list β€” bestie, this gets you a whole list of the supported compression types πŸ‘‘


✨ SYNOPSIS ✨

#include <libknet.h>

int knet_get_compress_list(
    struct knet_compress_info   *compress_list,
    size_t                      *compress_list_entries
);

πŸ¦‹ DESCRIPTION πŸ¦‹

knet_get_compress_list β€” the way she just hands you the receipts on what compression is installed, no cap πŸ”₯

  • compress_list β€” an array of struct knet_compress_info *. If you pass NULL here, she just gives you the number of structs back in compress_list_entries so you can go allocate enough space first, periodt. fr fr, libknet does not allow more than 256 compress methods at the moment. it is safe to allocate 256 structs to avoid calling knet_get_compress_list twice πŸ’… (iykyk β€” no double-calling, we're efficient here)
  • compress_list_entries β€” returns the number of structs in compress_list ✨

πŸŽ€ STRUCTURES πŸŽ€

the struct she hands back from get_compress_list(), packed with info about the installed compression systems 🫢

struct knet_compress_info {
    const char   *name;        /* Name of the compression type bzip2, lz4, etc.. */
    uint8_t       properties;  /* Properties - currently unused */
    char          pad[256];    /* Currently unused padding */
};
not the properties field and the pad[256] just sitting there unused 😭 iconic behaviour honestly, they're reserved and that's that πŸ’€

🌈 RETURN VALUE 🌈

knet_get_compress_list returns 0 on success, -1 on error and errno is set. so like, check your errno bestie, she's trying to tell you something πŸ™ˆ


⭐ SEE ALSO ⭐

the whole friend group, all of them, we love a full roster πŸ’œ


Copyright (C) 2010-2026 Red Hat, Inc. All rights reserved. 🫢


and that's the whole page bestie, you ate πŸ’…βœ¨ this came straight from kronosnet, dated 2026-07-20, page KNET_GET_...RESS_LIST(3) β€” mwah, go forth and compress πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from