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