]> Cypherpunks repositories - gostls13.git/commit
syscall: implement Fchdir on Windows
authorqmuntal <quimmuntal@gmail.com>
Wed, 29 Mar 2023 08:28:33 +0000 (10:28 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 12 Apr 2023 09:13:54 +0000 (09:13 +0000)
commitde475e8a66b0f530e074c68031a364ad2ebe2a95
treed4238bb403a204d510434a0773153ecc1978ea75
parentbc5b194813d1a59daec29bd81f6bc092948a2f0a
syscall: implement Fchdir on Windows

This CL adds support for os.File.Chdir() on Windows by implementing
syscall.Fchdir, which is internally used by Chdir.

Windows does not provide a function that sets the working directory
using a file handle, so we have to fallback to retrieving the file
handle path and then use it in SetCurrentDirectory.

Change-Id: I2ae93575e50411e5a9426ea531541958d7c9e812
Reviewed-on: https://go-review.googlesource.com/c/go/+/480135
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/os/os_test.go
src/syscall/syscall_windows.go
src/syscall/zsyscall_windows.go