MCPcopy Create free account
hub / github.com/cloudwego/netpoll / openDefaultPoll

Function openDefaultPoll

poll_default_bsd.go:31–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31func openDefaultPoll() (*defaultPoll, error) {
32 l := new(defaultPoll)
33 p, err := syscall.Kqueue()
34 if err != nil {
35 return nil, err
36 }
37 l.fd = p
38 _, err = syscall.Kevent(l.fd, []syscall.Kevent_t{{
39 Ident: 0,
40 Filter: syscall.EVFILT_USER,
41 Flags: syscall.EV_ADD | syscall.EV_CLEAR,
42 }}, nil, nil)
43 if err != nil {
44 syscall.Close(l.fd)
45 return nil, err
46 }
47 l.opcache = newOperatorCache()
48 return l, nil
49}
50
51type defaultPoll struct {
52 fd int

Callers 5

TestPollTriggerFunction · 0.70
TestPollModFunction · 0.70
TestPollCloseFunction · 0.70
BenchmarkPollModFunction · 0.70
openPollFunction · 0.70

Calls 2

newOperatorCacheFunction · 0.85
CloseMethod · 0.65

Tested by 4

TestPollTriggerFunction · 0.56
TestPollModFunction · 0.56
TestPollCloseFunction · 0.56
BenchmarkPollModFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…