CAPNG_CAPABILITY_TO_NAME(3)
β¨ CAPNG_CAPABILITY_TO_NAME β¨
okay bestie, so this one lives in section 3 of the manual (that's the library functions section, iykyk π
), and it's part of the Libcap-ng API. it's literally called capng_capability_to_name and it does exactly one (1) thing, but it does it flawlessly. no cap.
πΈ NAME πΈ
capng_capability_to_name β convert capability integer to text π¦
π SYNOPSIS π
#include <cap-ng.h>
const char *capng_capability_to_name(unsigned int capability);
like, you include the header, you call the function, you get a string. it's giving effortless. periodt.
π DESCRIPTION π
okay so here's the vibe. capng_capability_to_name takes the integer you pass in and looks it up to see what its text string representation would be. that's it. that's the whole plot. π
the integer you hand over must be in the valid range defined in linux/capability.h β don't be out here passing random numbers, bestie, the range is real and it matters. π«Ά
the string that comes out is the same as the define text from linux/capability.h with the CAP_ prefix removed and lower case. so like, the define gets a little makeover and shows up in its lowercase era. β¨
and why do we care? because this is useful for taking an integer representation and converting it to something more user friendly for display. nobody wants to stare at a raw number, we want the cute text version. main character energy fr fr. π
π¦ RETURN VALUE π¦
this returns a NULL pointer on failure π and the correct string otherwise π
like, that's it. success = string, failure = NULL. know the difference, it's important. π
π SEE ALSO π
π AUTHOR π
Steve Grubb β the icon, the legend, the moment. π
ok so quick recap for the girlies: pass in a valid capability integer fromlinux/capability.h, get back the lowercase,CAP_-stripped string version, orNULLif it went sideways. that's the whole thing. slay. π
Red Hat Β· June 2009 Β· Libcap-ng API β yeah that's the source, the date and the version bestie, mwah, take care of her ππ«Άβ¨
π¦ where this page comes from
- alpine 3.22: libcap-ng-doc 0.8.5-r0 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.23: libcap-ng-doc 0.8.5-r0 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: libcap-ng-doc 0.8.5-r2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: libcap-ng-devel 0.9.3-2.el10 Β· LGPL-2.0-or-later
- debian trixie: libcap-ng-dev 0.8.5-4+b1 Β· LGPL-2.1-or-later
- fedora 43: libcap-ng-devel 0.8.5-8.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.8.5-8.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- nixos 26.05: libcap-ng 0.9.3
- nixpkgs unstable: libcap-ng 0.9.6
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libcap-ng-devel 0.8.5-160000.3.2 Β· LGPL-2.1-or-later
- ubuntu noble: libcap-ng-dev 0.8.4-2build2 Β· LGPL-2.1-or-later
- ubuntu questing: libcap-ng-dev 0.8.5-4build2
- ubuntu resolute: libcap-ng-dev 0.8.5-4build5 Β· LGPL-2.1-or-later
- ubuntu stonking: libcap-ng-dev 0.9.6-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms