]> Cypherpunks repositories - gostls13.git/commitdiff
internal/poll: update SOCK_CLOEXEC comment
authorIan Lance Taylor <iant@golang.org>
Wed, 7 Jun 2023 18:26:40 +0000 (11:26 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 7 Jun 2023 18:41:39 +0000 (18:41 +0000)
For #45964
For #59359

Change-Id: I9f8f4c17ccd9711f81d152953a5e6aea50c6a28f
Reviewed-on: https://go-review.googlesource.com/c/go/+/501636
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/internal/poll/sock_cloexec.go

index cb40f4713645302877a1d9b69aa34ec17a21a573..361c11bc57c3a99fa2ec5f02fdb1762004ad5852 100644 (file)
@@ -15,10 +15,9 @@ import "syscall"
 // descriptor as nonblocking and close-on-exec.
 func accept(s int) (int, syscall.Sockaddr, string, error) {
        ns, sa, err := Accept4Func(s, syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC)
-       // On Linux the accept4 system call was introduced in 2.6.28
-       // kernel and on FreeBSD it was introduced in 10 kernel. If we
-       // get an ENOSYS error on both Linux and FreeBSD, or EINVAL
-       // error on Linux, fall back to using accept.
+       // TODO: We can remove the fallback on Linux and *BSD,
+       // as currently supported versions all support accept4
+       // with SOCK_CLOEXEC, but Solaris does not. See issue #59359.
        switch err {
        case nil:
                return ns, sa, "", nil