seccomp_version(3)
β¨ seccomp_version(3) β the libseccomp girlies' version check β¨
okay so bestie, this is a page from the libseccomp Documentation and it's literally the cutest lil function ever. it's giving "am I linked to the right library or not" energy and honestly? iconic. let's get into it π
πΈ NAME πΈ
seccomp_version β query the libseccomp version information π
π¦ SYNOPSIS π¦
#include <seccomp.h>
struct scmp_version {
unsigned int major;
unsigned int minor;
unsigned int micro;
}
const struct scmp_version *seccomp_version(void);
Link with -lseccomp.
π DESCRIPTION π
so the seccomp_version() and seccomp_reset() functions return a pointer to a scmp_version struct, and that struct is holding the version info of the currently loaded libseccomp library. like, the one that's actually loaded right now, not some hypothetical one. periodt. π₯
this is the function you call when your app needs to verify that it's linked to a specific libseccomp version at runtime. runtime checks, bestie. we love a runtime check. β¨
π«Ά important: the caller should not attempt tofreethe returnedscmp_versionstruct when finished. hands off, it's not yours to free.
π RETURN VALUE π
the seccomp_version() function returns a pointer to a scmp_version structure on success, and NULL on failure. π
and again, because it bears repeating: the caller should not attempt to free the returned structure. no. don't. put it down. π«
π EXAMPLES π
okay here's the vibe, copy-paste ready:
#include <seccomp.h>
int main(int argc, char *argv[])
{
const struct scmp_version *ver;
ver = seccomp_version();
if (ver == NULL)
goto err;
/* ... */
return 0;
err:
return 1;
}
π§ NOTES π§
so while the seccomp filter can be generated independent of the kernel (yes, you can build the whole thing with no kernel input at all), kernel support is required to actually load and enforce the seccomp filter that libseccomp generated. so like, the filter exists, but the kernel has to be the one to run it. no kernel, no enforcement. that's just how it is. π
the libseccomp project site β with more info and the source code repository β lives at https://github.com/seccomp/libseccomp. this tool, as well as the libseccomp library, is currently under development (yes, still, bestie, it's a whole thing), so please report any bugs at the project site or directly to the author. π
π AUTHOR π
Paul Moore <paul@paul-moore.com>
and that's the whole page, bestie!! every flag, every struct field, every "don't free it" warning β all present and accounted for. slay. π β¨
this little treasure was brought to you by paul@paul-moore.com and dated 18 February 2016, and it's page seccomp_version(3) in case you need to cite it in your group chat. mwah π«Ά
π¦ where this page comes from
- alpine 3.22: libseccomp-doc 2.6.1-r0 Β· LGPL-2.1-or-later
- alpine 3.23: libseccomp-doc 2.6.1-r0 Β· LGPL-2.1-or-later
- alpine 3.24: libseccomp-doc 2.6.1-r0 Β· LGPL-2.1-or-later
- arch rolling: libseccomp 2.6.0-1 Β· LGPL-2.1-only
- centos-stream 10: libseccomp-devel 2.5.6-1.el10 Β· LGPL-2.1-only
- centos-stream 9: libseccomp-devel 2.5.6-1.el9 Β· LGPLv2
- centos-stream 9: libseccomp-devel 2.5.6-1.el9 Β· LGPLv2
- debian bookworm: libseccomp-dev 2.5.4-1+deb12u1 Β· LGPL-2.1-only
- debian trixie: libseccomp-dev 2.6.0-2 Β· LGPL-2.1-only
- fedora 43: libseccomp-devel 2.6.0-2.fc43 Β· LGPL-2.1-only
- fedora 43: libseccomp-devel 2.6.0-2.fc43 Β· LGPL-2.1-only
- fedora 43: libseccomp-devel 2.6.1-2.fc43 Β· LGPL-2.1-only
- fedora 43: libseccomp-devel 2.6.1-2.fc43 Β· LGPL-2.1-only
- fedora 44: libseccomp-devel 2.6.0-3.fc44 Β· LGPL-2.1-only
- fedora 44: libseccomp-devel 2.6.0-3.fc44 Β· LGPL-2.1-only
- fedora 44: libseccomp-devel 2.6.1-2.fc44 Β· LGPL-2.1-only
- fedora 44: libseccomp-devel 2.6.1-2.fc44 Β· LGPL-2.1-only
- nixpkgs unstable: libseccomp 2.6.1
- opensuse-leap 16.0: libseccomp-devel 2.6.0-160000.2.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: libseccomp-devel 2.6.0-160000.2.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: libseccomp-devel 2.6.0-160000.2.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: libseccomp-devel 2.6.0-160000.2.2 Β· LGPL-2.1-only
- ubuntu jammy: libseccomp-dev 2.5.3-2ubuntu2 Β· LGPL-2.1-only
- ubuntu jammy: libseccomp-dev 2.5.3-2ubuntu3~22.04.1 Β· LGPL-2.1-only
- ubuntu noble: libseccomp-dev 2.5.5-1ubuntu3 Β· LGPL-2.1-only
- ubuntu noble: libseccomp-dev 2.5.5-1ubuntu3.1 Β· LGPL-2.1-only
- ubuntu questing: libseccomp-dev 2.6.0-2ubuntu2
- ubuntu resolute: libseccomp-dev 2.6.0-2ubuntu5 Β· LGPL-2.1-only
- ubuntu stonking: libseccomp-dev 2.6.1-1ubuntu1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms