Hi all, I'm attempting to use kobject_uevent() to send event notifications to userspace. Unfortunately, my userspace program never sees the uevent. >From my kernel module, I call kobject_uevent(&miscdev.class->kobj, KOBJ_CHANGE). I assume I don't need to call kobject_uevent_init(), since it looks like it's called during the kernel init phase. Are there any other setup routines I must call before using kobject_uevent()? My userspace program models this Linux Journal article on Netlink: http://www.linuxjournal.com/article/7356. #include <sys/socket.h> #include <linux/netlink.h> #define MAX_PAYLOAD 1024 /* maximum payload size*/ struct sockaddr_nl src_addr, dest_addr; struct nlmsghdr *nlh = NULL; struct msghdr msg; struct iovec iov; int sock_fd; int main() { /* Changed LJ article example to use NETLINK_KOBJECT_UEVENT */ sock_fd=socket(PF_NETLINK, SOCK_RAW, NETLINK_KOBJECT_UEVENT); memset(&src_addr, 0, sizeof(src_addr)); src_addr.nl_family = AF_NETLINK; /* self pid */ src_addr.nl_pid = getpid(); /* interested in group 1<<0 */ src_addr.nl_groups = 1; bind(sock_fd, (struct sockaddr*)&src_addr, sizeof(src_addr)); memset(&dest_addr, 0, sizeof(dest_addr)); nlh = (struct nlmsghdr *)malloc( NLMSG_SPACE(MAX_PAYLOAD)); memset(nlh, 0, NLMSG_SPACE(MAX_PAYLOAD)); iov.iov_base = (void *)nlh; iov.iov_len = NLMSG_SPACE(MAX_PAYLOAD); msg.msg_name = (void *)&dest_addr; msg.msg_namelen = sizeof(dest_addr); msg.msg_iov = &iov; msg.msg_iovlen = 1; printf("Waiting for message from kernel\n"); /* Read message from kernel */ recvmsg(sock_fd, &msg, 0); printf(" Received message payload: %s\n", NLMSG_DATA(nlh)); close(sock_fd); return 0; } I'm using a stock 2.6.17 kernel. Also, what is the purpose of the uevent file in the sysfs hierarchy (e.g. /sys/class/mem/urandom/uevent)? It looks like it's write only. Does it enable/disable uevents perhaps? Thanks in advance for your help. Arun -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/