Bundle libseccomp 2.3.1
[linux-seccomp.git] / libseccomp / doc / man / man3 / seccomp_version.3
CommitLineData
8befd5cc
MG
1.TH "seccomp_version" 3 "18 February 2016" "paul@paul-moore.com" "libseccomp Documentation"
2.\" //////////////////////////////////////////////////////////////////////////
3.SH NAME
4.\" //////////////////////////////////////////////////////////////////////////
5seccomp_version \- Query the libseccomp version information
6.\" //////////////////////////////////////////////////////////////////////////
7.SH SYNOPSIS
8.\" //////////////////////////////////////////////////////////////////////////
9.nf
10.B #include <seccomp.h>
11.sp
12.B struct scmp_version {
13.B unsigned int major;
14.B unsigned int minor;
15.B unsigned int micro;
16.B }
17.sp
18.BI "const struct scmp_version *seccomp_version(" void ");"
19.sp
20Link with \fI\-lseccomp\fP.
21.fi
22.\" //////////////////////////////////////////////////////////////////////////
23.SH DESCRIPTION
24.\" //////////////////////////////////////////////////////////////////////////
25.P
26The
27.BR seccomp_version ()
28and
29.BR seccomp_reset ()
30functions return a pointer to a
31.B scmp_version
32struct which contains the version information of the currently loaded
33libseccomp library. This function can be used by applications that need to
34verify that they are linked to a specific libseccomp version at runtime.
35.P
36The caller should not attempt to free the returned
37.B scmp_version
38struct when finished.
39.\" //////////////////////////////////////////////////////////////////////////
40.SH RETURN VALUE
41.\" //////////////////////////////////////////////////////////////////////////
42The
43.BR seccomp_version ()
44function returns a pointer to a
45.B scmp_version
46structure on success, NULL on failure. The caller should not attempt to free
47the returned structure.
48.\" //////////////////////////////////////////////////////////////////////////
49.SH EXAMPLES
50.\" //////////////////////////////////////////////////////////////////////////
51.nf
52#include <seccomp.h>
53
54int main(int argc, char *argv[])
55{
56 const struct scmp_version *ver;
57
58 ver = seccomp_version();
59 if (ver == NULL)
60 goto err;
61
62 /* ... */
63
64 return 0;
65
66err:
67 return \-1;
68}
69.fi
70.\" //////////////////////////////////////////////////////////////////////////
71.SH NOTES
72.\" //////////////////////////////////////////////////////////////////////////
73.P
74While the seccomp filter can be generated independent of the kernel, kernel
75support is required to load and enforce the seccomp filter generated by
76libseccomp.
77.P
78The libseccomp project site, with more information and the source code
79repository, can be found at https://github.com/seccomp/libseccomp. This tool,
80as well as the libseccomp library, is currently under development, please
81report any bugs at the project site or directly to the author.
82.\" //////////////////////////////////////////////////////////////////////////
83.SH AUTHOR
84.\" //////////////////////////////////////////////////////////////////////////
85Paul Moore <paul@paul-moore.com>
86.\" //////////////////////////////////////////////////////////////////////////
87
This page took 0.013289 seconds and 4 git commands to generate.