File: zselect_windows.go

package info (click to toggle)
golang-github-creack-goselect 0.1.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: sh: 102; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download | duplicates (2)
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
}