aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-08-20 12:39:31 +0200
committerQuim Muntal <quimmuntal@gmail.com>2025-08-22 23:39:20 -0700
commitd86ec924993bfb824dfb6f618a46ea205fdbf261 (patch)
tree99e619b69112b481bf77ccee0f93af6eae5aad50 /src/os
parent9d3f7fda70900c9d311df1eb4656fe9f6d62c781 (diff)
downloadgo-d86ec924993bfb824dfb6f618a46ea205fdbf261.tar.xz
internal/syscall/windows: increase internal Windows O_ flags values
The lowercase o_ flags are invented values. These conflict with constants that will soon be allowed by os.OpenFile, which values will be mandated by the Windows API. To avoid this overlap, the internal values have been increased to the 33-63 bit range, as the Windows ones are in the 0-32 bit range. Updates #73676 Change-Id: I0f657f3ed3403de150f1730a5a65ae887a18a4e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/697363 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/root_windows.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os/root_windows.go b/src/os/root_windows.go
index 523ee48d13..afc645d8f8 100644
--- a/src/os/root_windows.go
+++ b/src/os/root_windows.go
@@ -129,7 +129,7 @@ func openRootInRoot(r *Root, name string) (*Root, error) {
// rootOpenFileNolog is Root.OpenFile.
func rootOpenFileNolog(root *Root, name string, flag int, perm FileMode) (*File, error) {
fd, err := doInRoot(root, name, nil, func(parent syscall.Handle, name string) (syscall.Handle, error) {
- return openat(parent, name, flag, perm)
+ return openat(parent, name, uint64(flag), perm)
})
if err != nil {
return nil, &PathError{Op: "openat", Path: name, Err: err}
@@ -138,8 +138,8 @@ func rootOpenFileNolog(root *Root, name string, flag int, perm FileMode) (*File,
return newFile(fd, joinPath(root.Name(), name), "file", false), nil
}
-func openat(dirfd syscall.Handle, name string, flag int, perm FileMode) (syscall.Handle, error) {
- h, err := windows.Openat(dirfd, name, uint64(flag)|syscall.O_CLOEXEC|windows.O_NOFOLLOW_ANY, syscallMode(perm))
+func openat(dirfd syscall.Handle, name string, flag uint64, perm FileMode) (syscall.Handle, error) {
+ h, err := windows.Openat(dirfd, name, flag|syscall.O_CLOEXEC|windows.O_NOFOLLOW_ANY, syscallMode(perm))
if err == syscall.ELOOP || err == syscall.ENOTDIR {
if link, err := readReparseLinkAt(dirfd, name); err == nil {
return syscall.InvalidHandle, errSymlink(link)