On Sun, Jul 13, 2003 at 11:45:53AM +0200, Patrick Kilian wrote: > Hi, > > does someone know how to create a socket in kernelspace and how to > handle connections to it? I want to create a socket in the PF_LOCAL > namespace called /tmp/guestsocket. And what about "\0guestsocket" ? > I know that I have to do this in a seperate kernel thread and I managed > to to create a kernel thread using kernel_thread. > All examples I could find were using the PF_INET namespace, but I want > to use the PF_LOCAL namespace. The problem I have is: > > struct socket *guestsock; > error = sock_create(PF_UNIX, SOCK_DGRAM, 0, &guestsock); It looks OK to my eyes. > if (error<0) { > perror("socket thread: can't create guest socket"); That exists in kernel?!?! I really, really, really doubt that. > } > > always gives: > socket thread: can't create guest socket: Operation not permitted Are you sure you know where the "Operation not permitted" comes from? (Hint: the "perror" function was not passed the error argument, so it can't know what it was!) > Kernel panic: Segfault with no mm This looks like an umlinux error, right? If so, get a debugger, attach and inspect ;-). Especially try to get value of "error". ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/