move eventfd stuff out to own file
[trinity.git] / include / syscall.h
blobfcfcf78476e2e43de30bd23c7831bd485d0ea2bc
1 #pragma once
3 #include "types.h"
5 enum argtype {
6 ARG_UNDEFINED = 0,
7 ARG_RANDOM_LONG = 1,
8 ARG_FD = 2,
9 ARG_LEN = 3,
10 ARG_ADDRESS = 4,
11 ARG_MODE_T = 5,
12 ARG_NON_NULL_ADDRESS = 6,
13 ARG_PID = 7,
14 ARG_RANGE = 8,
15 ARG_OP = 9,
16 ARG_LIST = 10,
17 ARG_RANDPAGE = 11,
18 ARG_CPU = 12,
19 ARG_PATHNAME = 13,
20 ARG_IOVEC = 14,
21 ARG_IOVECLEN = 15,
22 ARG_SOCKADDR = 16,
23 ARG_SOCKADDRLEN = 17,
24 ARG_MMAP = 18,
27 struct arglist {
28 unsigned int num;
29 unsigned long values[32];
32 struct syscallentry {
33 void (*sanitise)(int childno);
34 void (*post)(int childno);
35 int (*init)(void);
36 char * (*decode)(int argnum, int childno);
38 unsigned int number;
39 unsigned int active_number;
40 const char name[80];
41 const unsigned int num_args;
42 unsigned int flags;
44 const enum argtype arg1type;
45 const enum argtype arg2type;
46 const enum argtype arg3type;
47 const enum argtype arg4type;
48 const enum argtype arg5type;
49 const enum argtype arg6type;
51 const char *arg1name;
52 const char *arg2name;
53 const char *arg3name;
54 const char *arg4name;
55 const char *arg5name;
56 const char *arg6name;
58 /* FIXME: At some point, if we grow more type specific parts here,
59 * it may be worth union-ising this
62 /* ARG_RANGE */
63 const unsigned int low1range, hi1range;
64 const unsigned int low2range, hi2range;
65 const unsigned int low3range, hi3range;
66 const unsigned int low4range, hi4range;
67 const unsigned int low5range, hi5range;
68 const unsigned int low6range, hi6range;
70 /* ARG_OP / ARG_LIST */
71 const struct arglist arg1list;
72 const struct arglist arg2list;
73 const struct arglist arg3list;
74 const struct arglist arg4list;
75 const struct arglist arg5list;
76 const struct arglist arg6list;
78 const unsigned int group;
79 const int rettype;
82 #define RET_BORING -1
83 #define RET_NONE 0
84 #define RET_ZERO_SUCCESS 1
85 #define RET_FD 2
86 #define RET_KEY_SERIAL_T 3
87 #define RET_PID_T 4
88 #define RET_PATH 5
89 #define RET_NUM_BYTES 6
90 #define RET_GID_T 7
91 #define RET_UID_T 8
93 #define GROUP_NONE 0
94 #define GROUP_VM 1
95 #define GROUP_VFS 2
97 struct syscalltable {
98 struct syscallentry *entry;
101 #define AVOID_SYSCALL (1<<0)
102 #define NI_SYSCALL (1<<1)
103 #define BORING (1<<2)
104 #define ACTIVE (1<<3)
105 #define TO_BE_DEACTIVATED (1<<4)
106 #define NEED_ALARM (1<<5)
107 #define EXTRA_FORK (1<<6)