Hi folks -
I've found myself having do some socket programming in the linux kernel. (yes, yes, I know: have I thought about user space? Yes, that's where I've prototyped my code. This is a research project that requires that this behavior be in the kernel)
I've found that the socket API in the kernel has shockingly poor documentation (was there a tax on comments when they wrote this stuff initially?), and I was hoping that some intrepid members of the symposium might have some ideas where I might be able to look for even passable documentation. Google has been little help.
Essentially, what I'm trying to do is implement a reactor in the kernel that will listen on several socket handles and forward messages to queues for later delivery to user space programs - so what I'd love to be able to do is to simulate some sort of select/poll functionality. I've been trying to use set_fs/get_fs to be able to call the regular socket syscalls directly (probably not the best approach), but select doesn't appear to like the fds returned from these functions, simply giving me -EBADF.
I guess the main thing I'm looking for here is this: Does anyone know of any documentation at all of the kernel-level socket primitives and APIs?
I've found myself having do some socket programming in the linux kernel. (yes, yes, I know: have I thought about user space? Yes, that's where I've prototyped my code. This is a research project that requires that this behavior be in the kernel)
I've found that the socket API in the kernel has shockingly poor documentation (was there a tax on comments when they wrote this stuff initially?), and I was hoping that some intrepid members of the symposium might have some ideas where I might be able to look for even passable documentation. Google has been little help.
Essentially, what I'm trying to do is implement a reactor in the kernel that will listen on several socket handles and forward messages to queues for later delivery to user space programs - so what I'd love to be able to do is to simulate some sort of select/poll functionality. I've been trying to use set_fs/get_fs to be able to call the regular socket syscalls directly (probably not the best approach), but select doesn't appear to like the fds returned from these functions, simply giving me -EBADF.
I guess the main thing I'm looking for here is this: Does anyone know of any documentation at all of the kernel-level socket primitives and APIs?