Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!leah!rpi!rpi.edu!shadow From: shadow@pawl.rpi.edu (Deven T. Corzine) Newsgroups: comp.sys.amiga.tech Subject: Amigix (Re: alarm() function) Message-ID: Date: 19 Mar 89 13:55:43 GMT References: <70@snll-arpagw.UUCP> Sender: usenet@rpi.edu Reply-To: shadow@pawl.rpi.edu (Deven Thomas Corzine) Organization: RPI Public Access Workstation Lab, Troy NY Lines: 57 In-reply-to: paolucci@snll-arpagw.UUCP's message of 17 Mar 89 16:09:05 GMT In article <70@snll-arpagw.UUCP> paolucci@snll-arpagw.UUCP (Sam Paolucci) writes: >Has anybody written a Unix compatible alarm() function on the amiga. For >those not familiar, and to be more specific, its definition is Not that I know of, but it IS one of the functions I intend to write for Amigix. Amigix is a tentative name for the Unix V7-compatible "operating system" environment which will be implemented on top of Exec and alongside AmigaDOS. Initially, Amigix file system calls will be translated to AmigaDOS calls, but I will probably eventually write a filesystem to integrate into the system as well. All BCPL crap will be hidden from the (Amigix) process, handled by a system task which will run as an AmigaDOS process. See the huge thread here on "Unix V7 functionality ..." for more details... This same system task would also coordinate the alarm() function by sending requests to the timer device, and only acting on the one most recently defined by an alarm() call. (and AbortIO on any others, if the timer.device supports it; otherwise simply deallocate and ignore the IO request when it finally returns.) >int alarm(seconds) unsigned seconds; { } Oh, I rather think the definition will be somewhat longer than THAT... :-) >The function sends a signal ( SIGALRM, defined in signal.h and trapped by >(*signal())() ) to the invoking process after the number of seconds indicated >in the argument has elapsed. Unless the signal is caught or ignored, the >signal terminates the process. Signals will also be specially handled under Amigix. >Successive alarm() calls reinitialize the alarm clock. In other words, >alarms are not stacked, and calling alarm() with a zero argument cancels >any pending alarms. Ayup. >Also, the function should return the number of seconds remaining from a >previous alarm request. CheckIO() should work for that, I think. >I actually don't care whether it has been written with Lattice or Manx. >I need it for something I'm working on, but I though it might be a >function which may me of much more general usefulness. Well, I'm writing for Lattice, but I hope to make the code compile and run under either. (for which I'll surely need some help from someone with Aztec...) Deven -- ------- shadow@pawl.rpi.edu ------- Deven Thomas Corzine --------------------- Cogito shadow@acm.rpi.edu 2346 15th Street Pi-Rho America ergo userfxb6@rpitsmts.bitnet Troy, NY 12180-2306 (518) 272-5847 sum... In the immortal words of Socrates: "I drank what?" ...I think.