summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/seccomp/syscall_table.h
blob: fffcdb76abbb9c011167be02c1e181534eb06a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef SYSCALL_TABLE_H__
#define SYSCALL_TABLE_H__

#include <sys/types.h>

#ifdef __cplusplus
#include "securemem.h"
extern "C" {
namespace playground {
#define SecureMemArgs SecureMem::Args
#else
#define SecureMemArgs void
#define bool          int
#endif
  #define UNRESTRICTED_SYSCALL ((void *)1)

  struct SyscallTable {
    void   *handler;
    bool  (*trustedProcess)(int parentMapsFd, int sandboxFd, int threadFdPub,
                            int threadFd, SecureMemArgs* mem);
  };
  extern const struct SyscallTable syscallTable[]
    asm("playground$syscallTable")
#if defined(__x86_64__)
    __attribute__((visibility("internal")))
#endif
    ;
  extern const unsigned maxSyscall
    asm("playground$maxSyscall")
#if defined(__x86_64__)
    __attribute__((visibility("internal")))
#endif
    ;
#ifdef __cplusplus
} // namespace
}
#endif

#endif // SYSCALL_TABLE_H__