#7242 closed bug (fixed)

struct kevent is different on NetBSD

Reported by: iquiw Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 7.6.1
Keywords: Cc: anton.nik@…
Operating System: NetBSD Architecture: Unknown/Multiple
Type of failure: Runtime crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The following is NetBSD's struct kevent.

struct kevent {
        uintptr_t       ident;          /* identifier for this event */
        uint32_t        filter;         /* filter for event */
        uint32_t        flags;          /* action flags for kqueue */
        uint32_t        fflags;         /* filter flag value */
        int64_t         data;           /* filter data value */
        intptr_t        udata;          /* opaque user data identifier */
};

while FreeBSD's one is as follows.

struct kevent {
	uintptr_t	ident;		/* identifier for this event */
	short		filter;		/* filter for event */
	u_short		flags;
	u_int		fflags;
	intptr_t	data;
	void		*udata;		/* opaque user data identifier */
};

GHC/Event/KQueue.hsc assumes the latter structure.

Attachments (3)

0001-Adapt-to-NetBSD-s-struct-kevent.patch (2.6 KB) - added by iquiw 19 months ago.
Patch to adapt to NetBSD's struct kevent (rebased)
0001-Adapt-to-NetBSD-s-struct-kevent.2.patch (2.5 KB) - added by iquiw 19 months ago.
Patch to adapt to NetBSD's struct kevent (remove period from commit log)
0002-FFI-wrapper-for-kevent.patch (1.8 KB) - added by iquiw 19 months ago.
Patch to use kevent FFI wrapper (remove period from commit log)

Download all attachments as: .zip

Change History (11)

comment:1 Changed 19 months ago by iquiw

The attached patch (0001-Adapt-to-NetBSD-s-struct-kevent.patch) uses autoconf for kevent.filter and kevent.flags, which checks their size only.

If to use netbsd_HOST_OS is more suitable, please make the change (or I will prepare new patch).

The another patch (0002-FFI-wrapper-for-kevent.patch) is not directly related to this ticket, but NetBSD needs this also. Please include it also if there is no problem.

comment:2 Changed 19 months ago by lelf

  • Status changed from new to patch

comment:3 Changed 19 months ago by lelf

  • Cc anton.nik@… added

comment:4 follow-up: Changed 19 months ago by simonmar

  • Difficulty set to Unknown

In the FFI-wrapper patch, should the #ifdef be HAVE_KEVENT, not HAVE_KQUEUE?

comment:5 in reply to: ↑ 4 Changed 19 months ago by iquiw

Replying to simonmar:

In the FFI-wrapper patch, should the #ifdef be HAVE_KEVENT, not HAVE_KQUEUE?

Yes, it should be.

comment:6 Changed 19 months ago by iquiw

amend version of FFI-wrapper patch was attached.

Changed 19 months ago by iquiw

Patch to adapt to NetBSD's struct kevent (rebased)

Changed 19 months ago by iquiw

Patch to adapt to NetBSD's struct kevent (remove period from commit log)

Changed 19 months ago by iquiw

Patch to use kevent FFI wrapper (remove period from commit log)

comment:7 Changed 19 months ago by simonmar

  • Status changed from patch to merge

Fixed, please merge.

commit 8ff58d31f56bf5f35be0f97c0b46beb48e07b5e4
Author: Iku Iwasa <iku.iwasa@gmail.com>
Date:   Sun Sep 16 16:36:52 2012 +0900

    FFI wrapper for kevent()

commit 1bc8270f086ee634e6f399272accc934495ad350
Author: Iku Iwasa <iku.iwasa@gmail.com>
Date:   Sun Sep 16 16:36:25 2012 +0900

    Adapt to NetBSD's struct kevent

comment:8 Changed 18 months ago by igloo

  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.