semanage_count(3)

πŸ“¦
version 3.11 Β· 2 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

semanage_count β€” this is part of the Libsemanage API documentation (aka the semanage_count(3) page, bestie, that's the manual we're living in rn) and it's literally the SELinux Management API πŸ’–


🌸 SYNOPSIS 🌸

okay so here's the tea: the following count function is supported for any semanage record. You just replace the function and object name as necessary β€” mix and match, it's giving build-your-own-adventure πŸ¦‹

extern int COUNT_FUNCTION (
     semanage_handle_t *handle,
     unsigned int* response);

πŸ’… DESCRIPTION πŸ’…

πŸŽ€ Behavior

The count function will return the number of all objects in the selected location. That's it. That's the whole vibe. It counts. πŸ‘‘

πŸ“ Parameters

  • handle β€” used to track persistent state across semanage calls, and for error reporting. It's the main character keeping receipts. πŸ’–
  • response β€” the number of objects will be stored at the location pointed to by response. So like, pass it a pointer and it'll fill it in, no cap. ✨

⭐ Requirements

This function requires an semanage connection to be established (see semanage_connect(3)). No connection, no counting. Periodt. πŸ™ˆ


πŸ”₯ RETURN VALUE πŸ”₯

In case of failure, -1 is returned, and the semanage error callback is invoked, describing the error 😭 Otherwise a non-negative integer is returned (a commit number). The same number will be returned by all other semanage object read calls until the next commit. Consistency? We love to see it. πŸ’―


🌈 SEE ALSO 🌈

  • semanage_handle_create(3)
  • semanage_connect(3)

and that's the whole page, bestie!! 🫢 this iconic lil doc was brought to you by ivg2@cornell.edu, dated 16 March 2006 β€” yes she's vintage, she's an elder, and she still eats πŸ’…βœ¨