diff options
| author | qmuntal <quimmuntal@gmail.com> | 2025-08-20 12:39:31 +0200 |
|---|---|---|
| committer | Quim Muntal <quimmuntal@gmail.com> | 2025-08-22 23:39:20 -0700 |
| commit | d86ec924993bfb824dfb6f618a46ea205fdbf261 (patch) | |
| tree | 99e619b69112b481bf77ccee0f93af6eae5aad50 /src/internal/syscall/windows | |
| parent | 9d3f7fda70900c9d311df1eb4656fe9f6d62c781 (diff) | |
| download | go-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/internal/syscall/windows')
| -rw-r--r-- | src/internal/syscall/windows/at_windows.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/internal/syscall/windows/at_windows.go b/src/internal/syscall/windows/at_windows.go index d48fce1c99..8b19a03e7e 100644 --- a/src/internal/syscall/windows/at_windows.go +++ b/src/internal/syscall/windows/at_windows.go @@ -13,16 +13,17 @@ import ( // Openat flags not supported by syscall.Open. // -// These are invented values. +// These are invented values, use values in the 33-63 bit range +// to avoid overlap with flags and attributes supported by [syscall.Open]. // // When adding a new flag here, add an unexported version to // the set of invented O_ values in syscall/types_windows.go // to avoid overlap. const ( - O_DIRECTORY = 0x100000 // target must be a directory - O_NOFOLLOW_ANY = 0x20000000 // disallow symlinks anywhere in the path - O_OPEN_REPARSE = 0x40000000 // FILE_OPEN_REPARSE_POINT, used by Lstat - O_WRITE_ATTRS = 0x80000000 // FILE_WRITE_ATTRIBUTES, used by Chmod + O_DIRECTORY = 0x100000000 // target must be a directory + O_NOFOLLOW_ANY = 0x200000000 // disallow symlinks anywhere in the path + O_OPEN_REPARSE = 0x400000000 // FILE_OPEN_REPARSE_POINT, used by Lstat + O_WRITE_ATTRS = 0x800000000 // FILE_WRITE_ATTRIBUTES, used by Chmod ) func Openat(dirfd syscall.Handle, name string, flag uint64, perm uint32) (_ syscall.Handle, e1 error) { |
