1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #if defined(LIBC_SCCS) && !defined(lint)
   8: static char sccsid[] = "@(#)alarm.c	5.2 (Berkeley) 3/9/86";
   9: #endif LIBC_SCCS and not lint
  10: 
  11: /*
  12:  * Backwards compatible alarm.
  13:  */
  14: #include <sys/time.h>
  15: 
  16: alarm(secs)
  17:     int secs;
  18: {
  19:     struct itimerval it, oitv;
  20:     register struct itimerval *itp = &it;
  21: 
  22:     timerclear(&itp->it_interval);
  23:     itp->it_value.tv_sec = secs;
  24:     itp->it_value.tv_usec = 0;
  25:     if (setitimer(ITIMER_REAL, itp, &oitv) < 0)
  26:         return (-1);
  27:     if (oitv.it_value.tv_usec)
  28:         oitv.it_value.tv_sec++;
  29:     return (oitv.it_value.tv_sec);
  30: }

Defined functions

alarm defined in line 16; used 378 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1157
Valid CSS Valid XHTML 1.0 Strict