Problem with RISC Fortran signal
Ralph Becker-Szendy
ralph at uhheph.phys.hawaii.edu
Fri Mar 29 07:15:45 AEST 1991
Beginners question (I have been writing code on a Unix machine for a few
hours now, never programmed on one before), and yes, I have read the FM
(actually, the DEC FORTRAN for RISC manual hasn't been farther than a few feet
from me for the last few hours):
I am using the FORTRAN library routine "signal" as a replacement for VMS common
event flag clusters. I am writing a long-running program, and there has to be
a way to indicate to it to please flush the output (the machine may go down
soon or I want to look at the accumulated data), or to please stop (I am
satisfied with the statistics).
I wrote a two little subroutines SIGHAND_FLUSH and SIGHAND_ABORT, which set
flush and abort flags in a common block. I was planning to use signals 30 and
31 (known as USR1 and USR2), but maybe 18=TSTP for the abort signal would be
better. I declare those routines with something like
STATUS = SIGNAL(30, SIGHAND_FLUSH, -1).
Well, doesn't work. STATUS is always -130, which stands for illegal argument.
A little experimentation shows that the SIGNAL routine only accepts signal
numbers between 0 and 16 (inclusive !!).
Question 1: Is this a bug ? It doesn't seem to be documented anywhere. Or am I
just using the signal routine wrong ?
Question 2: I am now using signal 15=TERM for ABORT and signal 14=ALRM for
FLUSH. Is there something seriously wrong with grabbing these signals and using
them for my own purposes ?
Flame: After a few hours on Unix I can start to understand why people always
say they prefer it over VMS. Using the common event flags was such a pain
compared to signals. But at least it worked right.
--
Ralph Becker-Szendy UHHEPG=24742::RALPH (HEPNet,SPAN)
University of Hawaii RALPH at UHHEPG.PHYS.HAWAII.EDU
High Energy Physics Group RALPH at UHHEPG.BITNET
Watanabe Hall #203, 2505 Correa Road, Honolulu, HI 96822 (808)956-2931
More information about the Comp.unix.ultrix
mailing list