diff options
| author | Mustafa Quraish <[email protected]> | 2022-02-03 21:14:17 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-02-03 21:14:17 -0500 |
| commit | 0a5c4e6954a6969120b0854650357ca95f9c9fdc (patch) | |
| tree | e791a039829c3ac4dbb4250a54f1a0cc8e7ff6ff /src | |
| parent | Modify implementation of structs to support unions (diff) | |
| download | cup-0a5c4e6954a6969120b0854650357ca95f9c9fdc.tar.xz cup-0a5c4e6954a6969120b0854650357ca95f9c9fdc.zip | |
Add `exit()` syscall builtin
Diffstat (limited to 'src')
| -rw-r--r-- | src/builtins.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/builtins.c b/src/builtins.c index 2883c1d..45f203d 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -69,6 +69,9 @@ void initialize_builtins() make_syscall(3, SYS_read, "read", type_new(TYPE_INT), type_new(TYPE_INT), type_new_ptr(TYPE_CHAR), type_new(TYPE_INT) // Args ); + make_syscall(1, SYS_exit, "exit", type_new(TYPE_NONE), + type_new(TYPE_INT) // Args + ); } Node *find_builtin_function(Token *token) |