-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dan wrote:
> This is a bit off topic, but this newsgroup seems to be read by the
> most knowledgable people. Suggestions for a better group would be
> appreciated.
>
> When you look in the kernel source code, or any source code for that
> matter, you see include files surrounded by angle brackets. I've
> always thought of them as meaning 'look for the file in the spot where
> such files are usually kept'.
That's a good summary of what the C standard says about #include <>
> Where and how is this defined?
It is system dependant. It is defined by how the C compiler environment in your
system is specified to be set up. The lookup is /implemented/ in the C
compiler, in accordance with the specifics of the environment. In Unixish
systems like Linux, the <> files are 'looked for' in the /usr/include directory
tree.
> And
> with regards to a kernel build, where are these files exactly?
/usr/include/linux and /usr/include/asm and a few other directories under the
/usr/include tree
Hint: the value within the <> is a path relative to /usr/include
For instance
#include <asm/uaccess.h>
includes the file /usr/include/asm/uaccess.h, while
#include <linux/config.h>
includes the file /usr/include/linux/config.h
> Is
> this always defined by the compiler? In a kernel build, do they also
> point to files in the kernel source?
They could, with #include "local/path", but apparently they dont
The kernel headers in /usr/src/linux seem to be copied or linked to the headers
in /usr/include/linux, etc.
> Dan
- --
Lew Pitcher
Master Codewright and JOAT-in-training
Registered Linux User #112576 (
http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://enigmail.mozdev.org
iD8DBQFC4GjnagVFX4UWr64RAuIUAJ4w+sNoqKNluzhdg3UpPb bsEOTuPgCgqbT4
uuVGiqN04TsI/NAnDNPtEMc=
=SKaa
-----END PGP SIGNATURE-----