Skip to content

Commit 1ee729c

Browse files
ianlancetaylorgopherbot
authored andcommitted
internal/poll: update SOCK_CLOEXEC comment
For #45964 For #59359 Change-Id: I9f8f4c17ccd9711f81d152953a5e6aea50c6a28f Reviewed-on: https://go-review.googlesource.com/c/go/+/501636 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent 7f26e9e commit 1ee729c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/internal/poll/sock_cloexec.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import "syscall"
1515
// descriptor as nonblocking and close-on-exec.
1616
func accept(s int) (int, syscall.Sockaddr, string, error) {
1717
ns, sa, err := Accept4Func(s, syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC)
18-
// On Linux the accept4 system call was introduced in 2.6.28
19-
// kernel and on FreeBSD it was introduced in 10 kernel. If we
20-
// get an ENOSYS error on both Linux and FreeBSD, or EINVAL
21-
// error on Linux, fall back to using accept.
18+
// TODO: We can remove the fallback on Linux and *BSD,
19+
// as currently supported versions all support accept4
20+
// with SOCK_CLOEXEC, but Solaris does not. See issue #59359.
2221
switch err {
2322
case nil:
2423
return ns, sa, "", nil

0 commit comments

Comments
 (0)