[os2] Add missing temp_file implementation for Linux

This commit is contained in:
Roland Kovacs
2024-07-30 18:09:51 +02:00
parent 7f17d4eb7f
commit 1913c08b7b

View File

@@ -3,8 +3,11 @@ package os2
import "base:runtime"
_temp_dir :: proc(allocator: runtime.Allocator) -> (string, Error) {
//TODO
return "", nil
_temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Error) {
TEMP_ALLOCATOR_GUARD()
tmpdir := get_env("TMPDIR", temp_allocator())
if tmpdir == "" {
tmpdir = "/tmp"
}
return clone_string(tmpdir, allocator)
}