import ports/devel/epoll-shim, ok/comment ian@

This is a small library that implements epoll on top of kqueue. It has
been successfully used on FreeBSD to port libinput, libevdev, Wayland
and more. It may be useful for porting other software that uses epoll
or some other features (e.g. timerfd).
This commit is contained in:
sthen 2021-02-28 14:40:04 +00:00
parent e5327c4a96
commit a3e85be3be
5 changed files with 61 additions and 0 deletions

20
devel/epoll-shim/Makefile Normal file
View File

@ -0,0 +1,20 @@
# $OpenBSD: Makefile,v 1.1.1.1 2021/02/28 14:40:04 sthen Exp $
COMMENT= small epoll implementation using kqueue
GH_ACCOUNT= jiixyj
GH_PROJECT= epoll-shim
GH_TAGNAME= v0.0.20210213
SHARED_LIBS= epoll-shim 0.0
CATEGORIES= devel
# MIT
PERMIT_PACKAGE= Yes
WANTLIB= pthread
MODULES= devel/cmake
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (epoll-shim-0.0.20210213.tar.gz) = TrdWKtkNZwe6Z6GjW3CrBo+Ce/lym8GZR8MnP4NjmlA=
SIZE (epoll-shim-0.0.20210213.tar.gz) = 83657

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-src_signalfd_ctx_c,v 1.1.1.1 2021/02/28 14:40:04 sthen Exp $
This is filling in the struct; we don't have this struct member (it's
commented-out with #if 0 in sys/siginfo.h - struct _file / _band).
If our siginfo changes then this should be removed.
Index: src/signalfd_ctx.c
--- src/signalfd_ctx.c.orig
+++ src/signalfd_ctx.c
@@ -277,7 +277,9 @@ signalfd_ctx_read_impl(SignalFDCtx *signalfd,
signalfd_siginfo->ssi_status = siginfo.si_status;
+#ifndef __OpenBSD__
signalfd_siginfo->ssi_band = siginfo.si_band;
+#endif
signalfd_siginfo->ssi_int = siginfo.si_value.sival_int;
signalfd_siginfo->ssi_ptr = (uint64_t)(uintptr_t)

View File

@ -0,0 +1,4 @@
This is a small library that implements epoll on top of kqueue. It has
been successfully used on FreeBSD to port libinput, libevdev, Wayland
and more. It may be useful for porting other software that uses epoll
or some other features (e.g. timerfd).

View File

@ -0,0 +1,15 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2021/02/28 14:40:04 sthen Exp $
include/libepoll-shim/
include/libepoll-shim/sys/
include/libepoll-shim/sys/epoll.h
include/libepoll-shim/sys/eventfd.h
include/libepoll-shim/sys/signalfd.h
include/libepoll-shim/sys/timerfd.h
lib/cmake/
lib/cmake/epoll-shim/
lib/cmake/epoll-shim/epoll-shim-config.cmake
lib/cmake/epoll-shim/epoll-shim-targets${MODCMAKE_BUILD_SUFFIX}
lib/cmake/epoll-shim/epoll-shim-targets.cmake
@lib lib/libepoll-shim.so.${LIBepoll-shim_VERSION}
libdata/pkgconfig/
libdata/pkgconfig/epoll-shim.pc