/*
Copyright (C) 2003-2009, Parrot Foundation.
$Id: test_itimer_c.in 37201 2009-03-08 12:07:48Z fperrad $

setitimer test
*/

#include <sys/time.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>

volatile sig_atomic_t got_alarm = 0;

void
alarm_handler(int i)
{
    got_alarm = 1;
}

int
main(int argc, char **argv)
{
    struct itimerval its, ots;
    int ret;

    signal(SIGALRM, alarm_handler);
    memset(&its, 0, sizeof (its));
    its.it_interval.tv_sec = 0;
    its.it_value.tv_sec = 10;
    ret = setitimer(ITIMER_REAL, &its, &ots);
    if (ret)
        puts("err");
    else
        puts("ok");
    return 0;
}

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
