From: ralph@uhheph.phys.hawaii.edu (Ralph Becker-Szendy)
Subject: Problem with RISC Fortran signal
Date: 28 Mar 91 21:15:45 GMT [thread overview]
Message-ID: <12200@uhccux.uhcc.Hawaii.Edu> (raw)
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@UHHEPG.PHYS.HAWAII.EDU
High Energy Physics Group RALPH@UHHEPG.BITNET
Watanabe Hall #203, 2505 Correa Road, Honolulu, HI 96822 (808)956-2931
reply other threads:[~1991-03-28 21:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox