2012-03-27 23:13:14 +00:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package net
|
|
|
|
|
|
|
|
import "syscall"
|
|
|
|
|
|
|
|
func maxListenerBacklog() int {
|
|
|
|
// TODO: Implement this
|
2014-09-21 17:33:12 +00:00
|
|
|
// NOTE: Never return a number bigger than 1<<16 - 1. See issue 5030.
|
2012-03-27 23:13:14 +00:00
|
|
|
return syscall.SOMAXCONN
|
|
|
|
}
|
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
func sysSocket(f, t, p int) (syscall.Handle, error) {
|
|
|
|
// See ../syscall/exec_unix.go for description of ForkLock.
|
|
|
|
syscall.ForkLock.RLock()
|
|
|
|
s, err := syscall.Socket(f, t, p)
|
|
|
|
if err == nil {
|
|
|
|
syscall.CloseOnExec(s)
|
2012-03-27 23:13:14 +00:00
|
|
|
}
|
2014-09-21 17:33:12 +00:00
|
|
|
syscall.ForkLock.RUnlock()
|
|
|
|
return s, err
|
2012-03-27 23:13:14 +00:00
|
|
|
}
|