BNX2X: Semaphore compatibility
[akaros.git] / tests / alarm.c
index 84c71f1..122d418 100644 (file)
 
 /* Am I the only one annoyed at how open has different includes than
  * close/read/write? */
+/* NO. Ron. */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
-static void handle_alarm(struct event_msg *ev_msg, unsigned int ev_type)
+static void handle_alarm(struct event_msg *ev_msg, unsigned int ev_type,
+                         void *data)
 {
        assert(ev_type == EV_ALARM);
        printf("\tAlarm fired!, id %d\n", ev_msg ? ev_msg->ev_arg2 : 55555);
@@ -59,7 +61,7 @@ int main(int argc, char **argv)
        }
        /* Since we're doing SPAM_PUBLIC later, we actually don't need a big ev_q.
         * But someone might copy/paste this and change a flag. */
-       ev_handlers[EV_ALARM] = handle_alarm;
+       register_ev_handler(EV_ALARM, handle_alarm, 0);
        if (!(ev_q = get_big_event_q())) {
                perror("Failed ev_q");  /* it'll actually PF if malloc fails */
                exit(-1);