mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-25 00:47:55 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user