xref: /titanic_41/usr/src/lib/libresolv2/common/bsd/setitimer.c (revision 9525b14bcdeb5b5f6f95ab27c2f48f18bd2ec829)
17c478bd9Sstevel@tonic-gate #ifndef LINT
2*9525b14bSRao Shoaib static const char rcsid[] = "$Id: setitimer.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
37c478bd9Sstevel@tonic-gate #endif
47c478bd9Sstevel@tonic-gate 
57c478bd9Sstevel@tonic-gate #include "port_before.h"
67c478bd9Sstevel@tonic-gate 
77c478bd9Sstevel@tonic-gate #include <sys/time.h>
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate #include "port_after.h"
107c478bd9Sstevel@tonic-gate 
11*9525b14bSRao Shoaib /*%
127c478bd9Sstevel@tonic-gate  * Setitimer emulation routine.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate #ifndef NEED_SETITIMER
157c478bd9Sstevel@tonic-gate int __bindcompat_setitimer;
167c478bd9Sstevel@tonic-gate #else
177c478bd9Sstevel@tonic-gate 
187c478bd9Sstevel@tonic-gate int
__setitimer(int which,const struct itimerval * value,struct itimerval * ovalue)197c478bd9Sstevel@tonic-gate __setitimer(int which, const struct itimerval *value,
207c478bd9Sstevel@tonic-gate 	    struct itimerval *ovalue)
217c478bd9Sstevel@tonic-gate {
227c478bd9Sstevel@tonic-gate 	if (alarm(value->it_value.tv_sec) >= 0)
237c478bd9Sstevel@tonic-gate 		return (0);
247c478bd9Sstevel@tonic-gate 	else
257c478bd9Sstevel@tonic-gate 		return (-1);
267c478bd9Sstevel@tonic-gate }
277c478bd9Sstevel@tonic-gate #endif
28*9525b14bSRao Shoaib 
29*9525b14bSRao Shoaib /*! \file */
30