2017-05-10 12:19:32 +02:00
|
|
|
// +build !linux,!darwin,!freebsd
|
|
|
|
|
2020-04-16 14:33:46 +02:00
|
|
|
package vfstest
|
2017-05-10 12:19:32 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"testing"
|
2019-10-06 22:05:21 +02:00
|
|
|
|
|
|
|
"golang.org/x/sys/windows"
|
2017-05-10 12:19:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// TestWriteFileDoubleClose tests double close on write
|
|
|
|
func TestWriteFileDoubleClose(t *testing.T) {
|
|
|
|
t.Skip("not supported on " + runtime.GOOS)
|
|
|
|
}
|
2019-10-06 22:05:21 +02:00
|
|
|
|
|
|
|
// writeTestDup performs the platform-specific implementation of the dup() syscall
|
|
|
|
func writeTestDup(oldfd uintptr) (uintptr, error) {
|
|
|
|
p, err := windows.GetCurrentProcess()
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
var h windows.Handle
|
|
|
|
return uintptr(h), windows.DuplicateHandle(p, windows.Handle(oldfd), p, &h, 0, true, windows.DUPLICATE_SAME_ACCESS)
|
|
|
|
}
|