1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:44:52 -07:00

syscall: clean up windows a bit

The files being deleted contain no code.
They exist because back when we used Makefiles
that listed all the Go sources to be compiled, we wrote
patterns like syscall_$GOOS_$GOARCH.go,
and it was easier to create dummy empty files
than introduce conditionals to not look for that
file on Windows.

Now that we have the go command instead,
we don't need those dummy files.

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: Ie0066d1dd2bf09802c74c6a496276e8c593e4bc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/288815
Trust: Russ Cox <rsc@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Russ Cox 2021-01-27 11:39:48 -05:00
parent 09e059afb1
commit b6379f190b
7 changed files with 15 additions and 38 deletions

View File

@ -414,19 +414,22 @@ const ptrSize = unsafe.Sizeof(uintptr(0))
// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542(v=vs.85).aspx
func setFilePointerEx(handle Handle, distToMove int64, newFilePointer *int64, whence uint32) error {
var e1 Errno
switch runtime.GOARCH {
default:
panic("unsupported architecture")
case "amd64":
if unsafe.Sizeof(uintptr(0)) == 8 {
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 4, uintptr(handle), uintptr(distToMove), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0, 0)
case "386":
// distToMove is a LARGE_INTEGER:
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
case "arm":
// distToMove must be 8-byte aligned per ARM calling convention
// https://msdn.microsoft.com/en-us/library/dn736986.aspx#Anchor_7
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 6, uintptr(handle), 0, uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence))
} else {
// Different 32-bit systems disgaree about whether distToMove starts 8-byte aligned.
switch runtime.GOARCH {
default:
panic("unsupported 32-bit architecture")
case "386":
// distToMove is a LARGE_INTEGER:
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
case "arm":
// distToMove must be 8-byte aligned per ARM calling convention
// https://msdn.microsoft.com/en-us/library/dn736986.aspx#Anchor_7
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 6, uintptr(handle), 0, uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence))
}
}
if e1 != 0 {
return errnoErr(e1)

View File

@ -1,5 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -1,5 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -1,5 +0,0 @@
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -1,5 +0,0 @@
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -1,3 +0,0 @@
// nothing to see here
package syscall

View File

@ -1,3 +0,0 @@
// nothing to see here
package syscall