2017-03-02 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libgo / go / net / sock_windows.go
blob89a3ca425857c2150893edaad598d94b7d554061
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.
5 package net
7 import (
8 "os"
9 "syscall"
12 func maxListenerBacklog() int {
13 // TODO: Implement this
14 // NOTE: Never return a number bigger than 1<<16 - 1. See issue 5030.
15 return syscall.SOMAXCONN
18 func sysSocket(family, sotype, proto int) (syscall.Handle, error) {
19 // See ../syscall/exec_unix.go for description of ForkLock.
20 syscall.ForkLock.RLock()
21 s, err := socketFunc(family, sotype, proto)
22 if err == nil {
23 syscall.CloseOnExec(s)
25 syscall.ForkLock.RUnlock()
26 if err != nil {
27 return syscall.InvalidHandle, os.NewSyscallError("socket", err)
29 return s, nil