Annotation of 42BSD/lib/libc/gen/alarm.c, revision 1.1

1.1     ! root        1: /*     alarm.c 4.1     83/06/10        */
        !             2: 
        !             3: /*
        !             4:  * Backwards compatible alarm.
        !             5:  */
        !             6: #include <sys/time.h>
        !             7: 
        !             8: alarm(secs)
        !             9:        int secs;
        !            10: {
        !            11:        struct itimerval it, oitv;
        !            12:        register struct itimerval *itp = &it;
        !            13: 
        !            14:        timerclear(&itp->it_interval);
        !            15:        itp->it_value.tv_sec = secs;
        !            16:        itp->it_value.tv_usec = 0;
        !            17:        if (setitimer(ITIMER_REAL, itp, &oitv) < 0)
        !            18:                return (-1);
        !            19:        return (oitv.it_value.tv_sec);
        !            20: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.