diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-16 22:19:28 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-16 22:54:53 +0200 |
| commit | f7d7d65bc0f7da6993e117e67e771c7e1741ea06 (patch) | |
| tree | 4a7a3c8a911913488f8225abb4339c8b3b05a061 /core/sys | |
| parent | 970dc7a1f26cbb2badb13ce22bcc51c6055788ef (diff) | |
fix `open` bindings
`open` specifies the `mode` argument as vararg (presumably to make it
optional). varargs actually have rules about casting, in this case the
rule that any integer arg of size <= 4 has to be casted to `i32` before
passing it.
Not doing that implicit cast makes the permissions wrong or not apply at
all.
Diffstat (limited to 'core/sys')
| -rw-r--r-- | core/sys/posix/fcntl.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/sys/posix/fcntl.odin b/core/sys/posix/fcntl.odin index 8f1b1a511..ca030a9a5 100644 --- a/core/sys/posix/fcntl.odin +++ b/core/sys/posix/fcntl.odin @@ -58,7 +58,7 @@ foreign lib { [[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html ]] */ - open :: proc(path: cstring, flags: O_Flags, mode: mode_t = {}) -> FD --- + open :: proc(path: cstring, flags: O_Flags, #c_vararg mode: ..mode_t) -> FD --- /* Equivalent to the open() function except in the case where path specifies a relative path. |