1 //go:build !dragonfly && !freebsd && !illumos && !linux 2 // +build !dragonfly,!freebsd,!illumos,!linux 3 4 package socket 5 6 import ( 7 "fmt" 8 "runtime" 9 10 "golang.org/x/sys/unix" 11 ) 12 13 const sysAccept = "accept" 14 15 // accept wraps accept(2). 16 func accept(fd, flags int) (int, unix.Sockaddr, error) { 17 if flags != 0 { 18 // These operating systems have no support for flags to accept(2). 19 return 0, nil, fmt.Errorf("socket: Conn.Accept flags are ineffective on %s", runtime.GOOS) 20 } 21 22 return unix.Accept(fd) 23 } 24