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.
This commit is contained in:
Laytan Laats
2024-08-16 22:54:53 +02:00
parent 970dc7a1f2
commit f7d7d65bc0
8 changed files with 45 additions and 21 deletions
+1 -1
View File
@@ -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.