xref: /illumos-gate/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1 /*
2  * Copyright (c) 1997-2000 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 #ifndef LINT
7 static const char rcsid[] = "$Id: setitimer.c,v 8.4 1999/10/13 16:39:21 vixie Exp $";
8 #endif
9 
10 
11 #pragma ident	"%Z%%M%	%I%	%E% SMI"
12 
13 #include "port_before.h"
14 
15 #include <sys/time.h>
16 
17 #include "port_after.h"
18 
19 /*
20  * Setitimer emulation routine.
21  */
22 #ifndef NEED_SETITIMER
23 int __bindcompat_setitimer;
24 #else
25 
26 int
27 __setitimer(int which, const struct itimerval *value,
28 	    struct itimerval *ovalue)
29 {
30 	if (alarm(value->it_value.tv_sec) >= 0)
31 		return (0);
32 	else
33 		return (-1);
34 }
35 #endif
36