main_unix_test.go 482 B

123456789101112131415161718192021222324
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build !js && !plan9 && !windows
  5. package socktest_test
  6. import "syscall"
  7. var (
  8. socketFunc func(int, int, int) (int, error)
  9. closeFunc func(int) error
  10. )
  11. func installTestHooks() {
  12. socketFunc = sw.Socket
  13. closeFunc = sw.Close
  14. }
  15. func uninstallTestHooks() {
  16. socketFunc = syscall.Socket
  17. closeFunc = syscall.Close
  18. }