fix os.read_dir closing the given file descriptor

This commit is contained in:
Laytan Laats
2024-08-12 18:51:27 +02:00
parent b71e0c2e36
commit a4ac3cc6e8
7 changed files with 55 additions and 5 deletions
+6
View File
@@ -886,6 +886,12 @@ _readlink :: proc(path: string) -> (string, Error) {
}
}
@(private, require_results)
_dup :: proc(fd: Handle) -> (Handle, Error) {
dup, err := linux.dup(linux.Fd(fd))
return Handle(dup), err
}
@(require_results)
absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
buf : [256]byte