summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-01-06 16:34:21 -0500
committerPaul Moore <pmoore@redhat.com>2013-01-15 16:49:32 -0500
commit6220c8c0fc479d97b6d3e3166a4e46fbfe25a3c0 (patch)
tree049f2fb2a261e3b28893e911a2eaef903b0dbc48 /include
parentaeac2736f600f887b42e4aca83ae6b466725aec2 (diff)
downloadlibseccomp-6220c8c0fc479d97b6d3e3166a4e46fbfe25a3c0.tar.gz
api: add syscall resolution functions that take an architecture argument
Similar to the existing seccomp_syscall_resolve_name() function, but they work for arbitrary architectures (assuming libseccomp support of course) and not just the native architecture. Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/seccomp.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/seccomp.h b/include/seccomp.h
index b09f3d3..136643e 100644
--- a/include/seccomp.h
+++ b/include/seccomp.h
@@ -1,7 +1,7 @@
/**
* Seccomp Library
*
- * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
+ * Copyright (c) 2012,2013 Red Hat <pmoore@redhat.com>
* Author: Paul Moore <pmoore@redhat.com>
*/
@@ -313,6 +313,30 @@ int seccomp_attr_set(scmp_filter_ctx ctx,
enum scmp_filter_attr attr, uint32_t value);
/**
+ * Resolve a syscall number to a name
+ * @param arch_token the architecture token, e.g. SCMP_ARCH_*
+ * @param num the syscall number
+ *
+ * Resolve the given syscall number to the syscall name for the given
+ * architecture; it is up to the caller to free the returned string. Returns
+ * the syscall name on success, NULL on failure.
+ *
+ */
+char *seccomp_syscall_resolve_num_arch(uint32_t arch_token, int num);
+
+/**
+ * Resolve a syscall name to a number
+ * @param arch_token the architecture token, e.g. SCMP_ARCH_*
+ * @param name the syscall name
+ *
+ * Resolve the given syscall name to the syscall number for the given
+ * architecture. Returns the syscall number on success, including negative
+ * pseudo syscall numbers (e.g. __PNR_*); returns __NR_SCMP_ERROR on failure.
+ *
+ */
+int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name);
+
+/**
* Resolve a syscall name to a number
* @param name the syscall name
*