xref: /illumos-gate/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision 0250c53ad267726f2438e3c6556199a0bbf588a2)
1 #include "port_before.h"
2 
3 #include <sys/time.h>
4 
5 #include "port_after.h"
6 
7 /*%
8  * Setitimer emulation routine.
9  */
10 #ifndef NEED_SETITIMER
11 int __bindcompat_setitimer;
12 #else
13 
14 int
15 __setitimer(int which, const struct itimerval *value,
16 	    struct itimerval *ovalue)
17 {
18 	if (alarm(value->it_value.tv_sec) >= 0)
19 		return (0);
20 	else
21 		return (-1);
22 }
23 #endif
24 
25 /*! \file */
26