regarding psignal()

Robert Watson rwatson at freebsd.org
Thu Jun 24 20:44:53 PDT 2004


On Tue, 22 Jun 2004, pradeep reddy punnam wrote:

> i am modifing my ../netinet/ip_input.c code so that kernel can inform a
> user process about the arrival of a packet, i want to use signaling
> mechanism for this , i know the pid of the process to which the signal
> should be send, i am looing for exact function that can help me in
> sending SIGIO to procss...  i tryed to use the kill and psignal
> functions but the system going panic when the packet arrives...may be my
> use of the fuctions is wrong...  somebody tell me what functions are
> suitable to call for such a situation....  thanking you... 

Hmmm.  I'm not sure how what you're trying to do differs from the existing
aio/sigio capabilities, but assuming those don't provide what you need,
I'd suggest looking at uipc_socket2.c:sowakeup().  This is the function
that generates a variety of wakeups on socket events, including select,
waking up processes in sbwait() blocked in sockets, SIGIO, upcalls to NFS
(and friends), AIO wakeups, and so on.  Lots of models to look at :-).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research



More information about the freebsd-hackers mailing list