From: Mikio Hara Date: Wed, 24 Jul 2013 15:24:17 +0000 (+0900) Subject: runtime: drop EV_RECEIPT support from network pollster on kqueue X-Git-Tag: go1.2rc2~955 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8f746af65d563ce442720aeb35a0f80efc62b7d6;p=gostls13.git runtime: drop EV_RECEIPT support from network pollster on kqueue Currently Darwin and FreeBSD support and NetBSD and OpenBSD do not support EV_RECEIPT flag. We will drop use of EV_RECEIPT for now. Also enables to build runtime-integrated network pollster on freebsd/amd64,386 and openbsd/amd64,386. It just does build but never runs pollster stuff. This is in preparation for runtime-integrated network pollster for BSD variants. Update #5199 R=dvyukov, minux.ma CC=golang-dev https://golang.org/cl/11759044 --- diff --git a/src/pkg/runtime/netpoll.goc b/src/pkg/runtime/netpoll.goc index 2e855556c3..ec9a31d2da 100644 --- a/src/pkg/runtime/netpoll.goc +++ b/src/pkg/runtime/netpoll.goc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin linux windows +// +build darwin freebsd,amd64 freebsd,386 linux openbsd windows package net diff --git a/src/pkg/runtime/netpoll_kqueue.c b/src/pkg/runtime/netpoll_kqueue.c index 3ded4ee0b0..d3883dfb3c 100644 --- a/src/pkg/runtime/netpoll_kqueue.c +++ b/src/pkg/runtime/netpoll_kqueue.c @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin +// +build darwin freebsd,amd64 freebsd,386 openbsd #include "runtime.h" #include "defs_GOOS_GOARCH.h" @@ -37,23 +37,15 @@ runtime·netpollopen(uintptr fd, PollDesc *pd) // when fd is closed. ev[0].ident = (uint32)fd; ev[0].filter = EVFILT_READ; - ev[0].flags = EV_ADD|EV_RECEIPT|EV_CLEAR; + ev[0].flags = EV_ADD|EV_CLEAR; ev[0].fflags = 0; ev[0].data = 0; ev[0].udata = (byte*)pd; ev[1] = ev[0]; ev[1].filter = EVFILT_WRITE; - n = runtime·kevent(kq, ev, 2, ev, 2, nil); + n = runtime·kevent(kq, ev, 2, nil, 0, nil); if(n < 0) return -n; - if(n != 2 || - (ev[0].flags&EV_ERROR) == 0 || ev[0].ident != (uint32)fd || ev[0].filter != EVFILT_READ || - (ev[1].flags&EV_ERROR) == 0 || ev[1].ident != (uint32)fd || ev[1].filter != EVFILT_WRITE) - return EFAULT; // just to mark out from other errors - if(ev[0].data != 0) - return ev[0].data; - if(ev[1].data != 0) - return ev[1].data; return 0; } diff --git a/src/pkg/runtime/netpoll_stub.c b/src/pkg/runtime/netpoll_stub.c index c6ecf67d15..a785936e41 100644 --- a/src/pkg/runtime/netpoll_stub.c +++ b/src/pkg/runtime/netpoll_stub.c @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build freebsd netbsd openbsd plan9 +// +build freebsd,arm netbsd plan9 #include "runtime.h"