xref: /titanic_50/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision de33058aebd1018422519c8262583a3e5871d75c)
1 #ifndef LINT
2 static const char rcsid[] = "$Id: setitimer.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
3 #endif
4 
5 #include "port_before.h"
6 
7 #include <sys/time.h>
8 
9 #include "port_after.h"
10 
11 /*%
12  * Setitimer emulation routine.
13  */
14 #ifndef NEED_SETITIMER
15 int __bindcompat_setitimer;
16 #else
17 
18 int
19 __setitimer(int which, const struct itimerval *value,
20 	    struct itimerval *ovalue)
21 {
22 	if (alarm(value->it_value.tv_sec) >= 0)
23 		return (0);
24 	else
25 		return (-1);
26 }
27 #endif
28 
29 /*! \file */
30