aboutsummaryrefslogtreecommitdiff
path: root/core/os/temp_file_linux.odin
blob: 30f2169ad1b37ca7e60830490729a920c1e66357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#+private
package os

import "base:runtime"

_temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Error) {
	temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
	tmpdir := get_env("TMPDIR", temp_allocator)
	if tmpdir == "" {
		tmpdir = "/tmp"
	}
	return clone_string(tmpdir, allocator)
}