diff options
author | Marvin Borner | 2021-03-21 00:13:13 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-21 00:13:13 +0100 |
commit | 68a0ad7f21ba07b93cd63613996e27afd8780f9c (patch) | |
tree | 1fb7ff055743737ab5903d81507ea4732e45e095 /libgui/msg.c | |
parent | 535018ae7247ede06606e4d8aced2d12c761f28f (diff) |
Added basic shared memory support
This will be improved soon. It's very insecure right now.
Diffstat (limited to 'libgui/msg.c')
-rw-r--r-- | libgui/msg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libgui/msg.c b/libgui/msg.c index 3f58267..677ad52 100644 --- a/libgui/msg.c +++ b/libgui/msg.c @@ -1,12 +1,15 @@ // MIT License, Copyright (c) 2021 Marvin Borner #include <assert.h> +#include <errno.h> #include <msg.h> #include <print.h> #include <sys.h> int msg_send(u32 pid, enum message_type type, void *data, u32 size) { + if (!data) + return -EFAULT; assert((signed)pid != -1 && size >= sizeof(struct message_header)); char path[32] = { 0 }; sprintf(path, "/proc/%d/msg", pid); |