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
5//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris
6
7package net
8
9import "internal/poll"
10
11func init() {
12	extraTestHookInstallers = append(extraTestHookInstallers, installAccept4TestHook)
13	extraTestHookUninstallers = append(extraTestHookUninstallers, uninstallAccept4TestHook)
14}
15
16var (
17	// Placeholders for saving original socket system calls.
18	origAccept4 = poll.Accept4Func
19)
20
21func installAccept4TestHook() {
22	poll.Accept4Func = sw.Accept4
23}
24
25func uninstallAccept4TestHook() {
26	poll.Accept4Func = origAccept4
27}
28