Received: by mail.netbsd.org (Postfix, from userid 605) id 530A884D79; Mon, 3 May 2021 17:17:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 8EF1A84D74 for ; Mon, 3 May 2021 17:17:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id A6Au4TwgcgS7 for ; Mon, 3 May 2021 17:17:17 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id C46BC84CDA for ; Mon, 3 May 2021 17:17:17 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id BDFA2FA95; Mon, 3 May 2021 17:17:17 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_162006223798160" MIME-Version: 1.0 Date: Mon, 3 May 2021 17:17:17 +0000 From: "Jaromir Dolecek" Subject: CVS commit: pkgsrc/devel To: pkgsrc-changes@NetBSD.org Reply-To: jdolecek@netbsd.org X-Mailer: log_accum Message-Id: <20210503171717.BDFA2FA95@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_162006223798160 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: jdolecek Date: Mon May 3 17:17:17 UTC 2021 Modified Files: pkgsrc/devel: Makefile Added Files: pkgsrc/devel/libepoll-shim: DESCR Makefile PLIST buildlink3.mk distinfo Log Message: add libepoll-shim 0.0.20210418 small library that implements epoll with kqueue will be used for net/xfreerdp2 To generate a diff of this commit: cvs rdiff -u -r1.3370 -r1.3371 pkgsrc/devel/Makefile cvs rdiff -u -r0 -r1.1 pkgsrc/devel/libepoll-shim/DESCR \ pkgsrc/devel/libepoll-shim/Makefile pkgsrc/devel/libepoll-shim/PLIST \ pkgsrc/devel/libepoll-shim/buildlink3.mk \ pkgsrc/devel/libepoll-shim/distinfo Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_162006223798160 Content-Disposition: inline Content-Length: 6170 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/devel/Makefile diff -u pkgsrc/devel/Makefile:1.3370 pkgsrc/devel/Makefile:1.3371 --- pkgsrc/devel/Makefile:1.3370 Sun May 2 13:43:15 2021 +++ pkgsrc/devel/Makefile Mon May 3 17:17:17 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3370 2021/05/02 13:43:15 pho Exp $ +# $NetBSD: Makefile,v 1.3371 2021/05/03 17:17:17 jdolecek Exp $ # COMMENT= Development utilities @@ -765,6 +765,7 @@ SUBDIR+= libdstr SUBDIR+= libdwarf SUBDIR+= libebml SUBDIR+= libelf +SUBDIR+= libepoll-shim SUBDIR+= libestr SUBDIR+= libetm SUBDIR+= libev Added files: Index: pkgsrc/devel/libepoll-shim/DESCR diff -u /dev/null pkgsrc/devel/libepoll-shim/DESCR:1.1 --- /dev/null Mon May 3 17:17:17 2021 +++ pkgsrc/devel/libepoll-shim/DESCR Mon May 3 17:17:17 2021 @@ -0,0 +1,48 @@ +This is a small library that implements epoll on top of kqueue. It +has been successfully used to port libinput, libevdev, Wayland and +more software to FreeBSD: https://www.freshports.org/devel/libepoll-shim/ + +It may be useful for porting other software that uses epoll as well. + +The library provides implementation of Linux timerfd_create(2) related +APIs, eventfd(2), signalfd(2). + +However, this library contains some very ugly hacks and workarounds. +For example: + +- When using timerfd, signalfd or eventfd, the system calls read, + write and close are redefined as macros to internal helper + functions. This is needed as there is some internal context that + has to be free'd properly. This means that you shouldn't create + a timerfd/signalfd in one part of a program and close it in a + different part where sys/timerfd.h isn't included. The context + would leak. Luckily, software such as libinput behaves very nicely + and puts all timerfd related code in a single source file. + +- There is limited support for file descriptors that lack support + for kqueue but are supported by poll(2). This includes graphics + or sound devices under /dev. Those descriptors are handled in an + outer poll(2) loop. Edge triggering using EPOLLET will not work. + +- Shimmed file descriptors cannot be shared between processes. On + fork() those fds are closed. When trying to pass a shimmed fd to + another process the sendmsg call will return EOPNOTSUPP. In most + cases sharing epoll/timerfd/signalfd is a bad idea anyway, but + there are some legitimate use cases (for example sharing semaphore + eventfds, issue #23). When the OS natively supports eventfds (as + is the case for FreeBSD >= 13) this library won't provide eventfd + shims or the sys/eventfd.h header. + +- There is no proper notification mechanism for changes to the + system CLOCK_REALTIME clock on BSD systems. Also, kevent + EVFILT_TIMERs use the system monotonic clock as reference. + Therefore, in order to implement absolute (TFD_TIMER_ABSTIME) + CLOCK_REALTIME timerfds or cancellation support + (TFD_TIMER_CANCEL_ON_SET), a thread is spawned that periodically + polls the system boot time for changes to the realtime clock. + +The following operating systems are supported: + +FreeBSD >= 11.4, >= 12.2, >= 13.0 +NetBSD >= 9.1 +OpenBSD >= 6.7 Index: pkgsrc/devel/libepoll-shim/Makefile diff -u /dev/null pkgsrc/devel/libepoll-shim/Makefile:1.1 --- /dev/null Mon May 3 17:17:17 2021 +++ pkgsrc/devel/libepoll-shim/Makefile Mon May 3 17:17:17 2021 @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1 2021/05/03 17:17:17 jdolecek Exp $ + +GITHUB_PROJECT= epoll-shim +GITHUB_TAG= refs/tags/v${PKGVERSION_NOREV} +DISTNAME= ${GITHUB_PROJECT}-0.0.20210418 +PKGNAME= lib${DISTNAME} +PKGREVISION= # empty +CATEGORIES= devel +MASTER_SITES= ${MASTER_SITE_GITHUB:=jiixyj/} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://github.com/jiixyj/epoll-shim +COMMENT= Small epoll implemented using kevent +LICENSE= mit + +USE_CMAKE= yes +USE_TOOLS+= pkg-config +USE_LANGUAGES= c c++ + +CMAKE_ARGS+= -DBUILD_TESTING=OFF + +WRKSRC= ${WRKDIR}/${DISTNAME} + +.include "../../mk/bsd.pkg.mk" Index: pkgsrc/devel/libepoll-shim/PLIST diff -u /dev/null pkgsrc/devel/libepoll-shim/PLIST:1.1 --- /dev/null Mon May 3 17:17:17 2021 +++ pkgsrc/devel/libepoll-shim/PLIST Mon May 3 17:17:17 2021 @@ -0,0 +1,15 @@ +@comment $NetBSD: PLIST,v 1.1 2021/05/03 17:17:17 jdolecek Exp $ +include/libepoll-shim/epoll-shim/detail/common.h +include/libepoll-shim/epoll-shim/detail/poll.h +include/libepoll-shim/epoll-shim/detail/read.h +include/libepoll-shim/epoll-shim/detail/write.h +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/epoll-shim/epoll-shim-config.cmake +lib/cmake/epoll-shim/epoll-shim-targets-noconfig.cmake +lib/cmake/epoll-shim/epoll-shim-targets.cmake +lib/libepoll-shim.so +lib/libepoll-shim.so.0 +libdata/pkgconfig/epoll-shim.pc Index: pkgsrc/devel/libepoll-shim/buildlink3.mk diff -u /dev/null pkgsrc/devel/libepoll-shim/buildlink3.mk:1.1 --- /dev/null Mon May 3 17:17:17 2021 +++ pkgsrc/devel/libepoll-shim/buildlink3.mk Mon May 3 17:17:17 2021 @@ -0,0 +1,14 @@ +# $NetBSD: buildlink3.mk,v 1.1 2021/05/03 17:17:17 jdolecek Exp $ + +BUILDLINK_TREE+= libepoll-shim + +.if !defined(LIBEPOLL_SHIM_BUILDLINK3_MK) +LIBEPOLL_SHIM_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.libepoll-shim+= libepoll-shim>=0.0.20210418 +BUILDLINK_PKGSRCDIR.libepoll-shim?= ../../devel/libepoll-shim +BUILDLINK_INCDIRS.libepoll-shim= include/libepoll-shim + +.endif # LIBEPOLL_SHIM_BUILDLINK3_MK + +BUILDLINK_TREE+= -libepoll-shim Index: pkgsrc/devel/libepoll-shim/distinfo diff -u /dev/null pkgsrc/devel/libepoll-shim/distinfo:1.1 --- /dev/null Mon May 3 17:17:17 2021 +++ pkgsrc/devel/libepoll-shim/distinfo Mon May 3 17:17:17 2021 @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1 2021/05/03 17:17:17 jdolecek Exp $ + +SHA1 (epoll-shim-0.0.20210418.tar.gz) = 91d34e8a3e07afc1bfbca4575894f31bc7d3aa70 +RMD160 (epoll-shim-0.0.20210418.tar.gz) = 0e8a136b1b3716eaa4f7b1c7b52219d36522b09d +SHA512 (epoll-shim-0.0.20210418.tar.gz) = 34272a694165bfb47f8a103d18aec304f7a72b36491b83268ff63dd696f5103ab53dc9e32173ed20ddd7baa36b9d7ca2b3ec6236eef8dc2f02a101819b75eb7b +Size (epoll-shim-0.0.20210418.tar.gz) = 91936 bytes --_----------=_162006223798160--