1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
8 "internal/syscall/windows"
13 func maxListenerBacklog() int {
14 // TODO: Implement this
15 // NOTE: Never return a number bigger than 1<<16 - 1. See issue 5030.
16 return syscall
.SOMAXCONN
19 func sysSocket(family
, sotype
, proto
int) (syscall
.Handle
, error
) {
20 s
, err
:= wsaSocketFunc(int32(family
), int32(sotype
), int32(proto
),
21 nil, 0, windows
.WSA_FLAG_OVERLAPPED|windows
.WSA_FLAG_NO_HANDLE_INHERIT
)
25 // WSA_FLAG_NO_HANDLE_INHERIT flag is not supported on some
26 // old versions of Windows, see
27 // https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx
28 // for details. Just use syscall.Socket, if windows.WSASocket failed.
30 // See ../syscall/exec_unix.go for description of ForkLock.
31 syscall
.ForkLock
.RLock()
32 s
, err
= socketFunc(family
, sotype
, proto
)
34 syscall
.CloseOnExec(s
)
36 syscall
.ForkLock
.RUnlock()
38 return syscall
.InvalidHandle
, os
.NewSyscallError("socket", err
)