Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!wuarchive!texbell!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: itimers Message-ID: <-1773786417@convex.convex.com> Date: 15 Feb 90 16:28:14 GMT References: <5334@convex.convex.com> <7077@jpl-devvax.JPL.NASA.GOV> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 35 YARG, I was using 2 timeval's instead of 2 itimerval's. Chastisement accepted. The routines work now with one minor change to compensate for what *seems* to be a perl bug regarding return values from syscall. The last statement in setitimer() had to be changed from : !syscall(&SYS_setitimer, $which, $_[0], $_[1]); to: syscall(&SYS_setitimer, $which, $_[0], $_[1]) != -1; I found that in the test case posted, syscall was returning 1, 3, and 1, although errno was OK and everything worked. This is true on both a Sun and a Convex. I coded up the same thing in C using the indirect syscall() interface, and it was just fine, returning 0's not 1, 3, and 1. Looking at do_syscall() in perl/doarg.c, I put this debugging line in perl itself right after the call: printf("perl: syscall returned %d\n", retval); and confirmed that the syscall()s really are working fine. BUT by the time the interpreted code gets a hold of it, it's been changed into 1, 3, and 1. I can't help wondering whether my array-sensitive &itimer function is messing with perl's stack (the one it keeps of my code, not its own stack.) --tom -- Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in : Editor too big!"