CAPNG_PRINT_CAPS_TEXT(3)

✨ CAPNG_PRINT_CAPS_TEXT ✨

okay bestie, gather round, because this is a little function from the Libcap-ng API and she is so handy πŸ’–

🌸 NAME 🌸

capng_print_caps_text β€” she prints out the names of the values in your capabilities set πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <cap-ng.h>

char *capng_print_caps_text(capng_print_t where, capng_type_t which);

πŸ’… DESCRIPTION πŸ’…

so like, capng_print_caps_text will literally build you a text string representation of the internal capability set you specified. no cap, that's the whole job πŸ’β™€οΈ

and where does that pretty little string go? your choice, bestie β€” you pass either CAPNG_PRINT_STDOUT or CAPNG_PRINT_BUFFER for the where parameter:

  • CAPNG_PRINT_STDOUT β€” it goes straight to stdout, main character energy πŸ‘‘
  • CAPNG_PRINT_BUFFER β€” it goes into a buffer
🚨 and if you picked the buffer option, listen up: this function will malloc a buffer for you, and you, the caller, must free it. not optional. do not ghost that free(), i'm begging 😭

now, the which parameter β€” the only legal values are these, and yes you gotta pick from this exact list:

  • CAPNG_EFFECTIVE
  • CAPNG_PERMITTED
  • CAPNG_INHERITABLE
  • CAPNG_BOUNDING_SET
  • CAPNG_AMBIENT

that's the whole vibe check on which, periodt ✨


🫢 RETURN VALUE 🫢

depends on what you asked for, so pay attention:

  • if you selected CAPNG_PRINT_BUFFER for where β€” you get the text buffer back, and NULL on failure. and again, don't forget to free it πŸ“
  • if you selected CAPNG_PRINT_STDOUT β€” this value will be NULL no matter what. like, always. don't come for her, that's just how it is πŸ’€

🌈 SEE ALSO 🌈


πŸ’œ AUTHOR πŸ’œ

Steve Grubb πŸ’–


and that's the tea, bestie 🧚 this page came to you courtesy of Red Hat, dated March 2026 β€” go free your buffers, ily, bye πŸ’…βœ¨πŸŒΈ