summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/python/seccomp.pyx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
index 1a9eb24..2eeabc1 100644
--- a/src/python/seccomp.pyx
+++ b/src/python/seccomp.pyx
@@ -1001,6 +1001,19 @@ cdef class SyscallFilter:
if rc < 0:
raise RuntimeError(str.format("Library error (errno = {0})", rc))
+ def get_notify_fd(self):
+ """ Get the seccomp notification file descriptor
+
+ Description:
+ Returns the seccomp listener file descriptor that was generated when
+ the seccomp policy was loaded. This is only valid after load() with a
+ filter that makes use of the NOTIFY action.
+ """
+ fd = libseccomp.seccomp_notify_fd(self._ctx)
+ if fd < 0:
+ raise RuntimeError("Notifications not enabled/active")
+ return fd
+
def export_pfc(self, file):
""" Export the filter in PFC format.