Add specs for argenv interface with the kernel
[akaros.git] / kern / include / ros / syscall.h
index 8d47c45..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>
@@ -32,15 +31,24 @@ struct syscall {
        char                                            errstr[MAX_ERRSTR_LEN];
 };
 
-// include hell with go and friends.
-#ifndef STRUCT_CHILDFDMAP_DEFINED
-#define STRUCT_CHILDFDMAP_DEFINED
 struct childfdmap {
-  int parentfd;
-  int childfd;
-  int ok;
+       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))];
+        * }
+        */
 };
-#endif
 
 #ifndef ROS_KERNEL