[libdispatch-dev] [PATCH] use libkqueue if sys/event.h is missing

Mark Heily mark at heily.com
Mon Nov 16 21:41:32 PST 2009


Joakim Johansson wrote:
> 
> Of course, I'd like to disable this check on Solaris completely, as the
> current plan is to use native event ports rather than libkqueue, but that
> is for a later patch.
> 

I do plan to add Solaris event port support to libkqueue once the Linux 
backend is complete and the internal API is stabilized. I checked the 
port_create(3C) manpage in Solaris 10 and OpenSolaris, and did not see any 
way to wait for signals like in EVFILT_SIGNAL. There is no equivalent to 
EVFILT_PROC that allows you to receive events when a child process calls 
exit(2). There is also no equivalent to EVFILT_VNODE in Solaris 10, although 
OpenSolaris has added the PORT_SOURCE_FILE functionality.

On the other hand, the event port interface is very similar to kqueue(2) and 
kevent(2) so it should be very easy to emulate these system calls under 
Solaris. I have already started work on a generic POSIX backend for 
libkqueue to fill in the gaps when the host kernel does not support a 
particular event source. The Linux backend already falls back to using this 
generic POSIX backend to emulate the EVFILT_PROC filter, since there is no 
event-based alternative to the wait(2) family of system calls on Linux.

Regards,

  - Mark


References:

[1] Solaris 10 port_create(3C)

http://docs.sun.com/app/docs/doc/816-5168/port-create-3c?l=en&a=view&q=port_create

[2] OpenSolaris port_create(3C)

   http://docs.sun.com/app/docs/doc/819-2243/port-create-3c?a=view




More information about the libdispatch-dev mailing list