Commit 35050455 authored by Wei Guangjing's avatar Wei Guangjing Committed by Russ Cox

net: windows/amd64 port

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/3790044
parent 932db13e
......@@ -493,7 +493,7 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err os.
}
// Inherit properties of the listening socket.
e = syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_UPDATE_ACCEPT_CONTEXT, int(fd.sysfd))
e = syscall.Setsockopt(s, syscall.SOL_SOCKET, syscall.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&fd.sysfd)), int32(unsafe.Sizeof(fd.sysfd)))
if e != 0 {
closesocket(s)
return nil, err
......
......@@ -594,7 +594,7 @@ func Socket(domain, typ, proto int) (fd Handle, errno int) {
func SetsockoptInt(fd Handle, level, opt int, value int) (errno int) {
v := int32(value)
return int(setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))))
return int(Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), int32(unsafe.Sizeof(v))))
}
func Bind(fd Handle, sa Sockaddr) (errno int) {
......
......@@ -1076,7 +1076,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, errno int) {
return
}
func setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
r1, _, e1 := Syscall6(procsetsockopt, 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
if int(r1) == -1 {
if e1 != 0 {
......
......@@ -1076,7 +1076,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, errno int) {
return
}
func setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (errno int) {
r1, _, e1 := Syscall6(procsetsockopt, 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
if int(r1) == -1 {
if e1 != 0 {
......
......@@ -212,8 +212,8 @@ type SecurityAttributes struct {
}
type Overlapped struct {
Internal uint32
InternalHigh uint32
Internal uintptr
InternalHigh uintptr
Offset uint32
OffsetHigh uint32
HEvent Handle
......@@ -388,16 +388,6 @@ const (
WSASYS_STATUS_LEN = 128
)
type WSAData struct {
Version uint16
HighVersion uint16
Description [WSADESCRIPTION_LEN + 1]byte
SystemStatus [WSASYS_STATUS_LEN + 1]byte
MaxSockets uint16
MaxUdpDg uint16
VendorInfo *byte
}
type WSABuf struct {
Len uint32
Buf *byte
......@@ -453,13 +443,6 @@ type Hostent struct {
AddrList **byte
}
type Servent struct {
Name *byte
Aliases **byte
Port uint16
Proto *byte
}
const (
DNS_TYPE_A = 0x0001
DNS_TYPE_NS = 0x0002
......
......@@ -3,3 +3,20 @@
// license that can be found in the LICENSE file.
package syscall
type WSAData struct {
Version uint16
HighVersion uint16
Description [WSADESCRIPTION_LEN + 1]byte
SystemStatus [WSASYS_STATUS_LEN + 1]byte
MaxSockets uint16
MaxUdpDg uint16
VendorInfo *byte
}
type Servent struct {
Name *byte
Aliases **byte
Port uint16
Proto *byte
}
......@@ -3,3 +3,20 @@
// license that can be found in the LICENSE file.
package syscall
type WSAData struct {
Version uint16
HighVersion uint16
MaxSockets uint16
MaxUdpDg uint16
VendorInfo *byte
Description [WSADESCRIPTION_LEN + 1]byte
SystemStatus [WSASYS_STATUS_LEN + 1]byte
}
type Servent struct {
Name *byte
Aliases **byte
Proto *byte
Port uint16
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment