xref: /illumos-gate/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision eb9a1df2aeb866bf1de4494433b6d7e5fa07b3ae)
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