1 // Copyright 2015 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.
13 func maxOpenFiles() int {
14 return 4 * defaultMaxOpenFiles /* actually it's 16581375 */
17 func supportsRawIPSocket() (string, bool) {
18 // From http://msdn.microsoft.com/en-us/library/windows/desktop/ms740548.aspx:
19 // Note: To use a socket of type SOCK_RAW requires administrative privileges.
20 // Users running Winsock applications that use raw sockets must be a member of
21 // the Administrators group on the local computer, otherwise raw socket calls
22 // will fail with an error code of WSAEACCES. On Windows Vista and later, access
23 // for raw sockets is enforced at socket creation. In earlier versions of Windows,
24 // access for raw sockets is enforced during other socket operations.
25 s, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_RAW, 0)
26 if err == syscall.WSAEACCES {
27 return fmt.Sprintf("no access to raw socket allowed on %s", runtime.GOOS), false
30 return err.Error(), false
32 syscall.Closesocket(s)
36 func supportsIPv6MulticastDeliveryOnLoopback() bool {
40 func causesIPv6Crash() bool {