]> git.corax.cc Git - corax/commitdiff
include/corax: Add IPC message definitions for IO process
authorMatthias Kruk <m@m10k.eu>
Tue, 28 Jul 2020 13:13:50 +0000 (22:13 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 28 Jul 2020 13:13:50 +0000 (22:13 +0900)
include/corax/ipc/io.h [new file with mode: 0644]

diff --git a/include/corax/ipc/io.h b/include/corax/ipc/io.h
new file mode 100644 (file)
index 0000000..01ad326
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __CORAX_IPC_IO_H
+#define __CORAX_IPC_IO_H
+
+#include <corax/types.h>
+#include <sys/types.h>
+
+#define CXIO_RESPONSE 0
+#define CXIO_READ     1
+#define CXIO_WRITE    2
+#define CXIO_OPEN     3
+#define CXIO_CLOSE    4
+#define CXIO_FORK     5
+#define CXIO_PIPE     6
+
+struct cxio_fork {
+       pid_t parent;
+       pid_t child;
+};
+
+struct cxio_pipe {
+       int flags;
+};
+
+struct cxio_read {
+       int fd;
+       size_t n;
+};
+
+struct cxio_write {
+       int fd;
+       size_t datalen;
+       u8_t data[];
+};
+
+struct cxio_open {
+       int flags;
+       int mode;
+       size_t pathlen;
+       char path[];
+};
+
+struct cxio_close {
+       int fd;
+       int how; /* for shutdown() */
+};
+
+struct cxio_response {
+       int fd;
+       int retval;
+       int error;
+       size_t extralen;
+       u8_t extradata[];
+};
+
+#define CXIO_EXTRADATA_MAX (CONFIG_IPC_MSGSIZE - sizeof(struct cxio_response))
+
+#endif /* __CORAX_IPC_IO_H */