Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: convert to markdown and publish to Read the Docs #230

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ tags
/stamp-h1
/cov-int
/libseccomp-coverity_*.tar.gz
/site
1 change: 1 addition & 0 deletions doc/index.md
62 changes: 0 additions & 62 deletions doc/man/man1/scmp_sys_resolver.1

This file was deleted.

62 changes: 62 additions & 0 deletions doc/man/man1/scmp_sys_resolver.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
NAME
====

scmp_sys_resolver - Resolve system calls

SYNOPSIS
========

**scmp_sys_resolver** [-h] [-a *ARCH* ] [-t] *SYSCALL_NAME* |
*SYSCALL_NUMBER*

DESCRIPTION
===========

This command resolves both system call names and numbers with respect to
the given architecture supplied in the optional *ARCH* argument. If the
architecture is not supplied on the command line then the native
architecture is used. If the "-t" argument is specified along with a
system call name, then the system call will be translated as necessary
for the given architecture. The "-t" argument has no effect if a
system call number is specified.

In some combinations of architecture and system call, a negative system
call number will be displayed. A negative system call number indicates
that the system call is not defined for the given architecture and is
treated in a special manner by libseccomp depending on the operation.

**-a *ARCH***

: The architecture to use for resolving the system call. Valid *ARCH*
values are "x86", "x86_64", "x32", "arm", "aarch64",
"mips", "mipsel", "mips64", "mipsel64", "mips64n32",
"mipsel64n32", "parisc", "parisc64", "ppc", "ppc64",
"ppc64le", "s390", "s390x", "sheb" and "sh".

**-t**

: If necessary, translate the system call name to the proper system
call number, even if the system call name is different, e.g.
socket(2) on x86.

**-h**

: A simple one-line usage display.

EXIT STATUS
===========

Returns zero on success, errno values on failure.

NOTES
=====

The libseccomp project site, with more information and the source code
repository, can be found at https://github.com/seccomp/libseccomp. This
tool, as well as the libseccomp library, is currently under development,
please report any bugs at the project site or directly to the author.

AUTHOR
======

Paul Moore <[email protected]>
111 changes: 0 additions & 111 deletions doc/man/man3/seccomp_api_get.3

This file was deleted.

109 changes: 109 additions & 0 deletions doc/man/man3/seccomp_api_get.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
NAME
====

seccomp_api_get, seccomp_api_set - Manage the libseccomp API level

SYNOPSIS
========

#include <seccomp.h>

const unsigned int seccomp_api_get(void);
int seccomp_api_set(unsigned int level);

Link with -lseccomp.

DESCRIPTION
===========

The **seccomp_api_get**() function returns an integer representing the
functionality ("API level") provided by the current running kernel. It
is important to note that while **seccomp_api_get**() can be called
multiple times, the kernel is only probed the first time to see what
functionality is supported, all following calls to
**seccomp_api_get**() return a cached value.

The **seccomp_api_set**() function allows callers to force the API
level to the provided value; however, this is almost always a bad idea
and use of this function is strongly discouraged.

The different API level values are described below:

**0**

: Reserved value, not currently used.

**1**

: Base level support.

**2**

: The SCMP_FLTATR_CTL_TSYNC filter attribute is supported and
libseccomp uses the **seccomp(2)** syscall to load the seccomp
filter into the kernel.

**3**

: The SCMP_FLTATR_CTL_LOG filter attribute and the SCMP_ACT_LOG
action are supported.

**4**

: The SCMP_FLTATR_CTL_SSB filter attribute is supported.

**5**

: The SCMP_ACT_NOTIFY action and the notify APIs are supported.

**6**

: The simultaneous use of SCMP_FLTATR_CTL_TSYNC and the notify APIs
are supported.

RETURN VALUE
============

The **seccomp_api_get**() function returns an integer representing the
supported API level. The **seccomp_api_set**() function returns zero
on success, negative values on failure.

EXAMPLES
========

#include <seccomp.h>

int main(int argc, char *argv[])
{
unsigned int api;

api = seccomp_api_get();
switch (api) {
case 2:
/* ... */
default:
/* ... */
}

return 0;

err:
return 1;
}

NOTES
=====

While the seccomp filter can be generated independent of the kernel,
kernel support is required to load and enforce the seccomp filter
generated by libseccomp.

The libseccomp project site, with more information and the source code
repository, can be found at https://github.com/seccomp/libseccomp. This
tool, as well as the libseccomp library, is currently under development,
please report any bugs at the project site or directly to the author.

AUTHOR
======

Paul Moore <[email protected]>
1 change: 0 additions & 1 deletion doc/man/man3/seccomp_api_set.3

This file was deleted.

1 change: 1 addition & 0 deletions doc/man/man3/seccomp_api_set.3.md
Loading