xref: /illumos-gate/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision 458f44a49dc56cd17a39815122214e7a1b4793e3)
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
__setitimer(int which,const struct itimerval * value,struct itimerval * ovalue)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