[GENETLINK] get pid from userspace

From: Ariane Keller <hidden>
Date: 2007-06-06 10:21:17

Hi,

I have a user space program which "connects" to different kernel 
modules with generic netlink. Each module provides its own generic 
netlink family.

For each module to "connect" to I create a socket and bind it:
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
struct sockaddr_nl addr;
memset(&addr, 0, sizeof(addr));
bind(fd, (struct sockaddr *)&addr, sizeof(addr));

As far as I understand, this lets the generic netlink controller choose 
a unique pid, which shows up in the kernel module in the callback 
function as genl_info.snd_pid.

Is it possible to get this pid in userspace (without sending a message 
to the kernel module)?

Thanks!

Ariane



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help