Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac os undefined: unix.EpollCreate1 #30539

Closed
jorahbi opened this issue Mar 3, 2019 · 1 comment
Closed

mac os undefined: unix.EpollCreate1 #30539

jorahbi opened this issue Mar 3, 2019 · 1 comment

Comments

@jorahbi
Copy link

jorahbi commented Mar 3, 2019

macos version 10.14.3

go version go1.12 darwin/amd64

glide code
 - package: golang.org/x/sys
 - package: golang.org/x/sys/unix


package main

import
(
	"golang.org/x/sys/unix"
	"log"
	"net"
	"reflect"
	"sync"
	"syscall"
)

func NewEventPoll () (*EventPoll, error) {
	fd, err := unix.EpollCreate1(0)

	if err != nil {
		return nil, err
	}

	return &EventPoll{
		fd: fd,
		mu: &sync.RWMutex{},
		connects: make(map[int]net.Conn),
	}, nil
}

go env Output
$ go env

processor/epoller.go:21:13: undefined: unix.EpollCreate1
processor/epoller.go:36:9: undefined: unix.EpollCtl
processor/epoller.go:36:30: undefined: syscall.EPOLL_CTL_ADD
processor/epoller.go:36:58: undefined: unix.EpollEvent
processor/epoller.go:54:9: undefined: unix.EpollCtl
processor/epoller.go:54:30: undefined: syscall.EPOLL_CTL_DEL
processor/epoller.go:67:19: undefined: unix.EpollEvent
processor/epoller.go:68:12: undefined: unix.EpollWait

@tklauser
Copy link
Member

tklauser commented Mar 3, 2019

macOS does not provide the EpollCreate1 syscall, it is only available on Linux.

@tklauser tklauser closed this as completed Mar 3, 2019
@golang golang locked and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants