Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2005 12:34:06 -0500
From:      Aziz KEZZOU <opensource.enthousiat@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   How to send a signal from inside the kernel?
Message-ID:  <37e13166050317093477de8f7a@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi all,
I would like to send a signal (e.g SIGUSR1) to a user process from
inside the kernel (kld module).
Can any one tell me how to do it ?
I tried the following code inspired from sys/kern/kern_sig.c :
==============================================================
#include <sys/types.h> 
#include <sys/signal.h>

int process_pid;
struct kill_args {
	int	pid;
	int	signum;
};

void send_SIGUSR1() {
  struct kill_args uap;
  uap.pid = process_pid;
  uap.signum = SIGUSR1;  
  kill((struct thread *)0, &uap);
}
===============================================================

but that causes a page fault in kernel mode (ie. Kernel panic :-)

Any help is appreciated, thanks.
Aziz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37e13166050317093477de8f7a>