mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-14 09:52:23 -07:00
14 lines
286 B
Odin
14 lines
286 B
Odin
#+private
|
|
package os2
|
|
|
|
import "base:runtime"
|
|
|
|
_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)
|
|
}
|