diff options
author | dzwdz | 2021-08-18 20:23:59 +0200 |
---|---|---|
committer | dzwdz | 2021-08-18 20:23:59 +0200 |
commit | c0a5b44bc8261dec6d4ffaadb244ecbff962719b (patch) | |
tree | 64043f4c174b1695541f4de2ee845681b14e300e /src/kernel/syscalls.h | |
parent | 349420c51fe05bfb23b6eb4d30aa1aad034d3c33 (diff) |
await() 1: wait for child to die, without message passing
The length is a int, because the syscall will have a signed output. A
negative return value will mean an error (such as when it gets called
by a childless process).
Diffstat (limited to 'src/kernel/syscalls.h')
-rw-r--r-- | src/kernel/syscalls.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kernel/syscalls.h b/src/kernel/syscalls.h index d3ad2a8..a986a33 100644 --- a/src/kernel/syscalls.h +++ b/src/kernel/syscalls.h @@ -5,6 +5,7 @@ enum { // idc about stable syscall numbers just yet _SYSCALL_EXIT, + _SYSCALL_AWAIT, _SYSCALL_FORK, _SYSCALL_DEBUGLOG @@ -15,6 +16,11 @@ enum { */ _Noreturn void _syscall_exit(const char *msg, size_t len); +/** Waits for a child to exit, putting its exit message into *buf. + * @return the length of the message + */ +int _syscall_await(char *buf, int *len); + /** Creates a copy of the current process, and executes it. * All user memory pages get copied too. * @return 0 in the child, a meaningless positive value in the parent. |