I'm currently trying to create a kernel module that will produce data based on kernel events and push them to a file. After reading that this is bad (and I agree), I decided it would make more sense to have the data in a /proc file that a user program could pull from when necessary. However, this idea led to all sorts of problems, particularly when and how to clear out this file. So I thought... "why don't I make a named pipe in /proc and read from that?"
I've got the general gist of setting a read function and a write function for a proc file, but I'm still having conceptual trouble with how I'd go about this. Namely, how would I write such a function to take arbitrary data and write it to such a pipe from the kernel? Does anyone have any idea how you'd push data to a named pipe from kernel-space? In the end, it doesn't have to be a /proc file (particularly if it's wrong of me to do so), but that was the conclusion I came to. Then I'll have to figure out how to attach to it from a userspace program, but I feel that's a separate issue.