+int
+rb_ports_supports_event(void)
+{
+ return 1;
+};
+
+void
+rb_ports_init_event(void)
+{
+ return;
+}
+
+int
+rb_ports_sched_event(struct ev_entry *event, int when)
+{
+ timer_t *id;
+ struct sigevent ev;
+ port_notify_t not;
+ struct itimerspec ts;
+
+ event->comm_ptr = rb_malloc(sizeof(timer_t));
+ id = event->comm_ptr;
+
+ memset(&ev, 0, sizeof(ev));
+ ev.sigev_notify = SIGEV_PORT;
+ ev.sigev_value.sival_ptr = ¬
+
+ memset(¬, 0, sizeof(not));
+ not.portnfy_port = pe;
+ not.portnfy_user = event;
+
+ if(timer_create(CLOCK_REALTIME, &ev, id) < 0)
+ {
+ rb_lib_log("timer_create: %s\n", strerror(errno));
+ return 0;
+ }
+
+ memset(&ts, 0, sizeof(ts));
+ ts.it_value.tv_sec = when;
+ ts.it_value.tv_nsec = 0;
+ if(event->frequency != 0)
+ ts.it_interval = ts.it_value;
+
+ if(timer_settime(*id, 0, &ts, NULL) < 0)
+ {
+ rb_lib_log("timer_settime: %s\n", strerror(errno));
+ return 0;
+ }
+ return 1;
+}
+
+void
+rb_ports_unsched_event(struct ev_entry *event)
+{
+ timer_delete(*((timer_t *) event->comm_ptr));
+ rb_free(event->comm_ptr);
+ event->comm_ptr = NULL;
+}