Add specs for argenv interface with the kernel
[akaros.git] / kern / include / ros / syscall.h
index 1263d42..1e6d8f7 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef ROS_INC_SYSCALL_H
 #define ROS_INC_SYSCALL_H
 
-#include <arch/arch.h>
 #include <ros/bits/syscall.h>
 #include <ros/arch/syscall.h>
 #include <ros/event.h>
@@ -12,6 +11,9 @@
 #define SC_PROGRESS                            0x0002          /* SC made progress */
 #define SC_UEVENT                              0x0004          /* user has an ev_q */
 #define SC_K_LOCK                              0x0008          /* kernel locked sysc */
+#define SC_ABORT                               0x0010          /* syscall abort attempted */
+
+#define MAX_ERRSTR_LEN                 128
 
 struct syscall {
        unsigned int                            num;
@@ -26,7 +28,26 @@ struct syscall {
        long                                            arg3;
        long                                            arg4;
        long                                            arg5;
-       char                                            errstr[32];
+       char                                            errstr[MAX_ERRSTR_LEN];
+};
+
+struct childfdmap {
+       unsigned int                            parentfd;
+       unsigned int                            childfd;
+       int                                                     ok;
+};
+
+struct argenv {
+       size_t argc;
+       size_t envc;
+       char buf[];
+       /* The buf array is laid out as follows:
+        * buf {
+        *   char *argv[argc]; // Offset of arg relative to &argbuf[0]
+        *   char *envp[envc]; // Offset of envvar relative to &argbuf[0]
+        *   char argbuf[sum(map(strlen + 1, argv + envp))];
+        * }
+        */
 };
 
 #ifndef ROS_KERNEL