Skip to content

Commit 19b814b

Browse files
ianlancetaylorgopherbot
authored andcommitted
net: update SOCK_CLOEXEC comment
For #45964 For #59359 Change-Id: I7fd295a096e5776102e057789d157da681df9073 Reviewed-on: https://go-review.googlesource.com/c/go/+/501939 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent bd00528 commit 19b814b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/net/sock_cloexec.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ import (
1919
// descriptor as nonblocking and close-on-exec.
2020
func sysSocket(family, sotype, proto int) (int, error) {
2121
s, err := socketFunc(family, sotype|syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC, proto)
22-
// On Linux the SOCK_NONBLOCK and SOCK_CLOEXEC flags were
23-
// introduced in 2.6.27 kernel and on FreeBSD both flags were
24-
// introduced in 10 kernel. If we get an EINVAL error on Linux
25-
// or EPROTONOSUPPORT error on FreeBSD, fall back to using
26-
// socket without them.
22+
// TODO: We can remove the fallback on Linux and *BSD,
23+
// as currently supported versions all support accept4
24+
// with SOCK_CLOEXEC, but Solaris does not. See issue #59359.
2725
switch err {
2826
case nil:
2927
return s, nil

0 commit comments

Comments
 (0)