summaryrefslogtreecommitdiff
path: root/software/vendor/github.com/creack/goselect/zselect_windows.go
blob: e01502c0781377df9504fa0833c76123e99411d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT

package goselect

import "unsafe"
import "syscall"

var _ unsafe.Pointer

var (
	modws2_32 = syscall.NewLazyDLL("ws2_32.dll")

	procselect       = modws2_32.NewProc("select")
	proc__WSAFDIsSet = modws2_32.NewProc("__WSAFDIsSet")
)

func _select(nfds int, readfds *FDSet, writefds *FDSet, exceptfds *FDSet, timeout *syscall.Timeval) (total int, err error) {
	r0, _, e1 := syscall.Syscall6(procselect.Addr(), 5, uintptr(nfds), uintptr(unsafe.Pointer(readfds)), uintptr(unsafe.Pointer(writefds)), uintptr(unsafe.Pointer(exceptfds)), uintptr(unsafe.Pointer(timeout)), 0)
	total = int(r0)
	if total == 0 {
		if e1 != 0 {
			err = error(e1)
		}
	}
	return
}

func __WSAFDIsSet(handle syscall.Handle, fdset *FDSet) (isset int, err error) {
	r0, _, e1 := syscall.Syscall(proc__WSAFDIsSet.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(fdset)), 0)
	isset = int(r0)
	if isset == 0 {
		if e1 != 0 {
			err = error(e1)
		} else {
			err = syscall.EINVAL
		}
	}
	return
}