Fix: add RHEL version macros
[lttng-modules.git] / lttng-syscalls.c
index 622da6e206a5c683a5c1b006387789c46ac0126e..7b6078ea010f715a72819e8f5bc138573501f927 100644 (file)
 #include <linux/in6.h>
 #include <linux/seq_file.h>
 #include <linux/stringify.h>
+#include <linux/file.h>
+#include <linux/anon_inodes.h>
 #include <asm/ptrace.h>
 #include <asm/syscall.h>
 
 #include "lib/bitfield.h"
 #include "wrapper/tracepoint.h"
+#include "wrapper/file.h"
 #include "lttng-events.h"
 
 #ifndef CONFIG_COMPAT
@@ -73,6 +76,7 @@ struct oldold_utsname;
 struct old_utsname;
 struct sel_arg_struct;
 struct mmap_arg_struct;
+struct file_handle;
 
 #ifdef IA32_NR_syscalls
 #define NR_compat_syscalls IA32_NR_syscalls
@@ -1261,3 +1265,39 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        kfree(tmp_mask);
        return ret;
 }
+
+int lttng_abi_syscall_list(void)
+{
+       struct file *syscall_list_file;
+       int file_fd, ret;
+
+       file_fd = lttng_get_unused_fd();
+       if (file_fd < 0) {
+               ret = file_fd;
+               goto fd_error;
+       }
+
+       syscall_list_file = anon_inode_getfile("[lttng_syscall_list]",
+                                         &lttng_syscall_list_fops,
+                                         NULL, O_RDWR);
+       if (IS_ERR(syscall_list_file)) {
+               ret = PTR_ERR(syscall_list_file);
+               goto file_error;
+       }
+       ret = lttng_syscall_list_fops.open(NULL, syscall_list_file);
+       if (ret < 0)
+               goto open_error;
+       fd_install(file_fd, syscall_list_file);
+       if (file_fd < 0) {
+               ret = file_fd;
+               goto fd_error;
+       }
+       return file_fd;
+
+open_error:
+       fput(syscall_list_file);
+file_error:
+       put_unused_fd(file_fd);
+fd_error:
+       return ret;
+}
This page took 0.023091 seconds and 4 git commands to generate.