summaryrefslogtreecommitdiff
path: root/LibC/unistd.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-17 00:13:47 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-17 00:13:47 +0100
commit640360e958d6dea05ba0e294af52160bc10725cb (patch)
tree509ac7609062108169b8332064ebfae40edef1c6 /LibC/unistd.cpp
parent0b1b21d62286b73b8c59a2ce12e75a6de0f84f13 (diff)
downloadserenity-640360e958d6dea05ba0e294af52160bc10725cb.zip
Move WindowServer to userspace.
This is a monster patch that required changing a whole bunch of things. There are performance and stability issues all over the place, but it works. Pretty cool, I have to admit :^)
Diffstat (limited to 'LibC/unistd.cpp')
-rw-r--r--LibC/unistd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/LibC/unistd.cpp b/LibC/unistd.cpp
index 39d18b32e5..d6ec950f7d 100644
--- a/LibC/unistd.cpp
+++ b/LibC/unistd.cpp
@@ -357,7 +357,11 @@ int create_shared_buffer(pid_t peer_pid, size_t size, void** buffer)
void* get_shared_buffer(int shared_buffer_id)
{
int rc = syscall(SC_get_shared_buffer, shared_buffer_id);
- __RETURN_WITH_ERRNO(rc, (void*)rc, (void*)-1);
+ if (rc < 0 && -rc < EMAXERRNO) {
+ errno = -rc;
+ return (void*)-1;
+ }
+ return (void*)rc;
}
int release_shared_buffer(int shared_buffer_id)