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.
9 func maxListenerBacklog() int {
10 fd
, err
:= open("/proc/sys/net/core/somaxconn")
12 return syscall
.SOMAXCONN
15 l
, ok
:= fd
.readLine()
17 return syscall
.SOMAXCONN
20 n
, _
, ok
:= dtoi(f
[0], 0)
22 return syscall
.SOMAXCONN
24 // Linux stores the backlog in a uint16.
25 // Truncate number to avoid wrapping.