aboutsummaryrefslogtreecommitdiff
path: root/libc/inc/sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inc/sys.h')
-rw-r--r--libc/inc/sys.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/inc/sys.h b/libc/inc/sys.h
index 3145432..c846b4b 100644
--- a/libc/inc/sys.h
+++ b/libc/inc/sys.h
@@ -98,14 +98,13 @@ int sysv(enum sys num, ...);
#define event_unregister(id) sys1(SYS_UNREGISTER, (int)(id))
#define msg_send(pid, type, msg) sys3(SYS_SEND, (int)(pid), (int)(type), (int)(msg))
-#define msg_receive() (struct message *)sys0(SYS_RECEIVE)
+#define msg_receive(buf) (struct message *)sys1(SYS_RECEIVE, (int)(buf))
#define getpid() (int)sys0(SYS_GETPID)
-static inline struct message *msg_receive_loop()
+static inline struct message *msg_receive_loop(struct message *buf)
{
- struct message *msg;
- while (!(msg = msg_receive()))
+ while (!msg_receive(&buf))
yield();
- return msg;
+ return buf;
}
// Simple read wrapper