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