mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
posix: add package
This commit is contained in:
@@ -330,7 +330,7 @@ dev_t :: u64
|
||||
ino_t :: u64
|
||||
nlink_t :: u32
|
||||
off_t :: i64
|
||||
mode_t :: u16
|
||||
mode_t :: u32
|
||||
pid_t :: u32
|
||||
uid_t :: u32
|
||||
gid_t :: u32
|
||||
@@ -454,7 +454,7 @@ foreign libc {
|
||||
@(link_name="realloc") _unix_realloc :: proc(ptr: rawptr, size: c.size_t) -> rawptr ---
|
||||
|
||||
@(link_name="getenv") _unix_getenv :: proc(cstring) -> cstring ---
|
||||
@(link_name="realpath") _unix_realpath :: proc(path: cstring, resolved_path: rawptr) -> rawptr ---
|
||||
@(link_name="realpath") _unix_realpath :: proc(path: cstring, resolved_path: [^]byte = nil) -> cstring ---
|
||||
@(link_name="sysctlbyname") _sysctlbyname :: proc(path: cstring, oldp: rawptr, oldlenp: rawptr, newp: rawptr, newlen: int) -> c.int ---
|
||||
|
||||
@(link_name="exit") _unix_exit :: proc(status: c.int) -> ! ---
|
||||
@@ -832,9 +832,9 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
|
||||
if path_ptr == nil {
|
||||
return "", get_last_error()
|
||||
}
|
||||
defer _unix_free(path_ptr)
|
||||
defer _unix_free(rawptr(path_ptr))
|
||||
|
||||
path = strings.clone(string(cstring(path_ptr)))
|
||||
path = strings.clone(string(path_ptr))
|
||||
|
||||
return path, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user