Messages in this thread | | | Subject | Re: [PATCH] Re: bug in socket.h (and maybe many other kernel headerfiles) | Date | Mon, 20 Sep 1999 18:40:28 -0400 | From | Jeff Dike <> |
| |
> Here's a little background: I have a program like strace, which > monitors the system calls that *other programs* make. I need to > #include the entire userspace-to-kernel ABI so that I can monitor > properly.
I ran into a similar problem with the user-mode kernel, and my fix for it might be applicable. I need to #include both user and kernel headers, the kernel headers because I'm building a kernel, the user headers because the lowest levels are implemented in terms of system calls.
I found out that you are asking for a world of hurt if you include both user and kernel headers into the same file. What I did was split my sources into "user" and "kernel" files, which include only user and kernel headers, respectively. Communication between these two groups happens in terms of basic C types.
So, what might work for C++ is to have little C files which include the kernel headers, which pass their information back out to the C++ files using types that everyone agrees on.
Jeff
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |