SYS_dup_fds_to (XCC)
[akaros.git] / kern / include / ros / syscall.h
1 #ifndef ROS_INC_SYSCALL_H
2 #define ROS_INC_SYSCALL_H
3
4 #include <arch/arch.h>
5 #include <ros/bits/syscall.h>
6 #include <ros/arch/syscall.h>
7 #include <ros/event.h>
8 #include <ros/atomic.h>
9
10 /* Flags for an individual syscall. */
11 #define SC_DONE                                 0x0001          /* SC is done */
12 #define SC_PROGRESS                             0x0002          /* SC made progress */
13 #define SC_UEVENT                               0x0004          /* user has an ev_q */
14 #define SC_K_LOCK                               0x0008          /* kernel locked sysc */
15 #define SC_ABORT                                0x0010          /* syscall abort attempted */
16
17 #define MAX_ERRSTR_LEN                  128
18
19 struct syscall {
20         unsigned int                            num;
21         int                                                     err;                    /* errno */
22         long                                            retval;
23         atomic_t                                        flags;
24         struct event_queue                      *ev_q;
25         void                                            *u_data;
26         long                                            arg0;
27         long                                            arg1;
28         long                                            arg2;
29         long                                            arg3;
30         long                                            arg4;
31         long                                            arg5;
32         char                                            errstr[MAX_ERRSTR_LEN];
33 };
34
35 struct childfdmap {
36         unsigned int                            parentfd;
37         unsigned int                            childfd;
38         int                                                     ok;
39 };
40
41 #ifndef ROS_KERNEL
42
43 /* Temp hack, til the rest of glibc/userspace uses sys/syscall.h */
44 #include <sys/syscall.h>
45 #endif /* ifndef ROS_KERNEL */
46
47 #endif /* ROS_INC_SYSCALL_H */