xref: /csrg-svn/usr.bin/f77/libU77/kill_.c (revision 2543)
1*2543Sdlw /*
2*2543Sdlw char id_kill[] = "@(#)kill_.c	1.1";
3*2543Sdlw  *
4*2543Sdlw  * send a signal to a process
5*2543Sdlw  *
6*2543Sdlw  * calling sequence:
7*2543Sdlw  *	ierror = kill(pid, signum)
8*2543Sdlw  * where:
9*2543Sdlw  *	pid must be the process id of one of the user's processes
10*2543Sdlw  *	signum must be a valid signal number (see signal(2))
11*2543Sdlw  *	ierror will be 0 if successful; an error code otherwise.
12*2543Sdlw  */
13*2543Sdlw 
14*2543Sdlw #include "../libI77/f_errno.h"
15*2543Sdlw 
16*2543Sdlw long kill_(pid, signum)
17*2543Sdlw long *pid, *signum;
18*2543Sdlw {
19*2543Sdlw 	if (*pid < 0 || *pid > 32767L || *signum < 1 || *signum > 16)
20*2543Sdlw 		return((long)(errno=F_ERARG));
21*2543Sdlw 	if (kill((int)*pid, (int)*signum) != 0)
22*2543Sdlw 		return((long)errno);
23*2543Sdlw 	return(0L);
24*2543Sdlw }
25