Bundle libseccomp 2.3.1
[linux-seccomp.git] / libseccomp / doc / man / man3 / seccomp_version.3
1 .TH "seccomp_version" 3 "18 February 2016" "paul@paul-moore.com" "libseccomp Documentation"
2 .\" //////////////////////////////////////////////////////////////////////////
3 .SH NAME
4 .\" //////////////////////////////////////////////////////////////////////////
5 seccomp_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
20 Link with \fI\-lseccomp\fP.
21 .fi
22 .\" //////////////////////////////////////////////////////////////////////////
23 .SH DESCRIPTION
24 .\" //////////////////////////////////////////////////////////////////////////
25 .P
26 The
27 .BR seccomp_version ()
28 and
29 .BR seccomp_reset ()
30 functions return a pointer to a
31 .B scmp_version
32 struct which contains the version information of the currently loaded
33 libseccomp library. This function can be used by applications that need to
34 verify that they are linked to a specific libseccomp version at runtime.
35 .P
36 The caller should not attempt to free the returned
37 .B scmp_version
38 struct when finished.
39 .\" //////////////////////////////////////////////////////////////////////////
40 .SH RETURN VALUE
41 .\" //////////////////////////////////////////////////////////////////////////
42 The
43 .BR seccomp_version ()
44 function returns a pointer to a
45 .B scmp_version
46 structure on success, NULL on failure. The caller should not attempt to free
47 the returned structure.
48 .\" //////////////////////////////////////////////////////////////////////////
49 .SH EXAMPLES
50 .\" //////////////////////////////////////////////////////////////////////////
51 .nf
52 #include <seccomp.h>
53
54 int 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
66 err:
67 return \-1;
68 }
69 .fi
70 .\" //////////////////////////////////////////////////////////////////////////
71 .SH NOTES
72 .\" //////////////////////////////////////////////////////////////////////////
73 .P
74 While the seccomp filter can be generated independent of the kernel, kernel
75 support is required to load and enforce the seccomp filter generated by
76 libseccomp.
77 .P
78 The libseccomp project site, with more information and the source code
79 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
80 as well as the libseccomp library, is currently under development, please
81 report any bugs at the project site or directly to the author.
82 .\" //////////////////////////////////////////////////////////////////////////
83 .SH AUTHOR
84 .\" //////////////////////////////////////////////////////////////////////////
85 Paul Moore <paul@paul-moore.com>
86 .\" //////////////////////////////////////////////////////////////////////////
87
This page took 0.023549 seconds and 4 git commands to generate.