[comp.bugs.4bsd] Fortran programs can't send all kill signals +Fix

gww@beatnix.UUCP (Gary Winiger) (03/13/88)

Subject: Fortran programs can't send all kill signals +Fix
Index:	libU77/kill_.c 4.3BSD +Fix

Description:
	A fortran program calling kill(pid,signal) cannot send 
	signals greater than 15 even though there are 31 defined 
	signals.
Repeat-By:
	By examination.
Fix:
	The attached code solves this problem at Elxsi.

Gary..
{ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86,bridge2}!elxsi!gww
--------- cut --------- snip --------- :.,$w diff -------------
*** /tmp/,RCSt1020143	Fri Oct 30 09:46:48 1987
--- kill_.c	Fri Oct 30 09:46:35 1987
***************
*** 1,6 ****
! /*	$Header: kill_.c,v 1.1 87/01/05 17:23:37 gww Exp $ ENIX BSD
   *
   * $Log:	kill_.c,v $
   * Revision 1.1  87/01/05  17:23:37  gww
   * Initial revision
   * 
--- 1,9 ----
! /*	$Header: kill_.c,v 1.2 87/10/30 09:46:09 gww Exp $ ENIX BSD
   *
   * $Log:	kill_.c,v $
+  * Revision 1.2  87/10/30  09:46:09  gww
+  * Permit fortran programs to send all kill signals.
+  * 
   * Revision 1.1  87/01/05  17:23:37  gww
   * Initial revision
   * 
***************
*** 24,35 ****
   *	ierror will be 0 if successful; an error code otherwise.
   */
  
  #include "../libI77/f_errno.h"
  
  long kill_(pid, signum)
  long *pid, *signum;
  {
! 	if (*pid < 0 || *pid > 32767L || *signum < 1 || *signum > 16)
  		return((long)(errno=F_ERARG));
  	if (kill((int)*pid, (int)*signum) != 0)
  		return((long)errno);
--- 27,39 ----
   *	ierror will be 0 if successful; an error code otherwise.
   */
  
+ #include <signal.h>
  #include "../libI77/f_errno.h"
  
  long kill_(pid, signum)
  long *pid, *signum;
  {
! 	if (*pid < 0 || *pid > 32767L || *signum < 1 || *signum >= NSIG)
  		return((long)(errno=F_ERARG));
  	if (kill((int)*pid, (int)*signum) != 0)
  		return((long)errno);