accept.go 496 B

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