github.com/peggyl/go@v0.0.0-20151008231540-ae315999c2d5/src/net/hook_unix.go (about) 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 // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 7 package net 8 9 import "syscall" 10 11 var ( 12 testHookDialChannel = func() {} // see golang.org/issue/5349 13 14 // Placeholders for socket system calls. 15 socketFunc func(int, int, int) (int, error) = syscall.Socket 16 closeFunc func(int) error = syscall.Close 17 connectFunc func(int, syscall.Sockaddr) error = syscall.Connect 18 listenFunc func(int, int) error = syscall.Listen 19 acceptFunc func(int) (int, syscall.Sockaddr, error) = syscall.Accept 20 getsockoptIntFunc func(int, int, int) (int, error) = syscall.GetsockoptInt 21 )