summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/setns.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/setns.c')
-rw-r--r--tools/perf/util/setns.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/setns.c b/tools/perf/util/setns.c
new file mode 100644
index 000000000..48f9c0af6
--- /dev/null
+++ b/tools/perf/util/setns.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: LGPL-2.1
+
+#include "namespaces.h"
+#include <unistd.h>
+#include <sys/syscall.h>
+
+int setns(int fd, int nstype)
+{
+ return syscall(__NR_setns, fd, nstype);
+}