Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!ut-sally!seismo!mcvax!ukc!map1 From: map1@ukc.UUCP Newsgroups: net.lang.f77 Subject: Attempts at accessing signal(2) from within f77 Message-ID: <611@eagle.ukc.UUCP> Date: Wed, 22-Jan-86 14:50:53 EST Article-I.D.: eagle.611 Posted: Wed Jan 22 14:50:53 1986 Date-Received: Sun, 26-Jan-86 04:19:25 EST Reply-To: map1@ukc.UUCP (M.A.Pralat) Organization: U of Kent at Canterbury, Canterbury, UK Lines: 64 I would be very grateful and happy if the 'net' would clarify a few points for me. This is my first posting, please forgive any blunders :-) I am using Fortran under a 4.1BSD Unix. My intention is to to able to catch interrupts from within an F77 program, and to supply my own handler. In intro(3) it says "these functions together with those from section 2 are automatically loaded by cc and f77". I took this to be reason enough that I could access signal(2) from a Fortran 77 program. Someone pointed out that "Ah yes! Loaded but not accessible" Huh? Can a clear explanation be given. A small test program (after several lager ones failed) was quickly written: external junk,signal call signal(SIGFPE,junk) a=1.0 do 10 i=1,150 a=a/2.0 if (i.gt.120)print*,a 10 continue end subroutine junk(s,subs) integer s,subs print*,"s= ",s,"subs= ",subs end On execution it failed with the messages: floating underflow Illegal instruction(core dumped) I then changed SIGFPE to 8 as defined in I now get: Segmentation fault (core dumped) Is this getting me any closer? I'm quite lost. For mild flames and/or discussion I offer the following. (1) Am I correct in assumming I can access signal in this way? If not,....why? (2) If one can access signal(2) what am I doing wrong? I'm lost as to whether I'm entering _signal (found in libc.a) or _signal_ (found in libF77.a) when setting everything up and on subsequent calls. (3) What are the inner workings involved here, or what should happen if things work? (4) If the program is a farce could someone supply a small program that is known to work. Hopefully I'll understand things more clearly if I see it working. (5) Yes, I have been told many times "Ha! Fortran, write it in C" O.K but no one has told be that it is definitely impossible from F77. I have the bit between my teeth and I'm trying hard, I want a definitive yes it's possible or no it is not. Many thanks for your help Mark Pralat