From owner-freebsd-gnome@freebsd.org Mon Jul 30 17:20:37 2018 Return-Path: Delivered-To: freebsd-gnome@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E1B105BEF7 for ; Mon, 30 Jul 2018 17:20:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 60DAE7B45F for ; Mon, 30 Jul 2018 17:20:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 26902105BEEE; Mon, 30 Jul 2018 17:20:37 +0000 (UTC) Delivered-To: gnome@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C29105BEED for ; Mon, 30 Jul 2018 17:20:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0117B35E for ; Mon, 30 Jul 2018 17:20:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id CDC33248D4 for ; Mon, 30 Jul 2018 17:20:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w6UHKZJ9098326 for ; Mon, 30 Jul 2018 17:20:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w6UHKZha098325 for gnome@FreeBSD.org; Mon, 30 Jul 2018 17:20:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: [Bug 214338] [PATCH] devel/glib20: new kqueue() backend for file monitoring Date: Mon, 30 Jul 2018 17:20:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: lightside@gmx.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: eugen@freebsd.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: flagtypes.name attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 17:20:38 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214338 lightside changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195598|maintainer-approval?(gnome@ | Flags|FreeBSD.org) | Attachment #195598|0 |1 is obsolete| | Attachment #195649| |maintainer-approval?(gnome@ Flags| |FreeBSD.org) --- Comment #56 from lightside --- Created attachment 195649 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D195649&action= =3Dedit Proposed patch (since 475857 revision) Fixed MSTOSBT macro for files/kqueue_fnm.c. Test case: -8<-- /* `cc -O2 -o test test.c` or `cc -O2 -DFIXED=3D1 -o test test.c` * ./test && echo ok || echo not ok * ./test > test.txt * cat test.txt | grep true * cat test.txt | grep false */ #include #include #include #include #ifndef FIXED #define MSTOSBT(__ms) ((sbintime_t)((((int64_t)(__ms)) * (int64_t)(((uint64_t)1 << 63) / 500) >> 32))) #else #define MSTOSBT(__ms) (sbintime_t)(((int64_t)__ms * (((uint64_t)1= << 63) / 500)) >> 32) #endif #if defined(__FreeBSD_version) && (__FreeBSD_version < 1200040) /* https://svnweb.freebsd.org/base?view=3Drevision&revision=3D321686 * https://svnweb.freebsd.org/base/head/sys/sys/time.h?view=3Dmarkup&pathrev= =3D321686#l198 */ static __inline sbintime_t mstosbt(int64_t _ms) { return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); } #endif int main() { sbintime_t funct, macro; int match, result =3D 0; for (int64_t i =3D 0; i < 1000; ++i) { funct =3D mstosbt(i); macro =3D MSTOSBT(i); match =3D (funct =3D=3D macro) ? 1 : 0; printf("%ld: funct =3D %ld, macro =3D %ld, %s\n", i, funct,= macro, match ? "true" : "false"); if ((result =3D=3D 0) && (match =3D=3D 0)) result =3D 1; } return result; } -->8- % cc -O2 -o test test.c % ./test && echo ok || echo not ok <..> 997: funct =3D 4282082394, macro =3D -12884902, false 998: funct =3D 4286377361, macro =3D -8589935, false 999: funct =3D 4290672328, macro =3D -4294968, false not ok % ./test | grep true | head -5 0: funct =3D 0, macro =3D 0, true 1: funct =3D 4294967, macro =3D 4294967, true 2: funct =3D 8589934, macro =3D 8589934, true 3: funct =3D 12884901, macro =3D 12884901, true 4: funct =3D 17179869, macro =3D 17179869, true % ./test | grep false | head -5 501: funct =3D 2151778615, macro =3D -2143188681, false 502: funct =3D 2156073582, macro =3D -2138893714, false 503: funct =3D 2160368549, macro =3D -2134598747, false 504: funct =3D 2164663517, macro =3D -2130303779, false 505: funct =3D 2168958484, macro =3D -2126008812, false % cc -O2 -DFIXED=3D1 -o test_fixed test.c % ./test_fixed && echo ok || echo not ok <..> 997: funct =3D 4282082394, macro =3D 4282082394, true 998: funct =3D 4286377361, macro =3D 4286377361, true 999: funct =3D 4290672328, macro =3D 4290672328, true ok --=20 You are receiving this mail because: You are on the CC list for the bug.=