From: Paul Mackerras <paulus@samba.org>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Inconsistent "#ifdef __KERNEL__" on different architectures
Date: Tue, 5 Jun 2001 14:09:07 +1000 (EST) [thread overview]
Message-ID: <15132.23395.553496.50934@argo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.NEB.4.33.0106022224480.6994-100000@mimas.fachschaften.tu-muenchen.de>
In-Reply-To: <20010530003001.A2864@bacchus.dhis.org> <Pine.NEB.4.33.0106022224480.6994-100000@mimas.fachschaften.tu-muenchen.de>
Adrian Bunk writes:
> (my main concern wasn't whether the "#ifdef __KERNEL__" is correct or not
> but I was wondering whether there's a reason why it's different on
> different architectures)
The only valid reason for userspace programs to be including kernel
headers is to get definitions that are part of the kernel API. (And
in fact others here will go further and assert that there are *no*
valid reasons for userspace programs to include kernel headers.)
If you want some atomic functions or whatever for your userspace
program and the ones in the kernel look like they would be useful,
then take a copy of the relevant kernel code if you like, but don't
include the kernel headers directly. If you do, you will get bitten
at some point in the future when we decide to change some internal
implementation detail in the kernel, and your program suddenly won't
compile any more.
This is why I added #ifdef __KERNEL__ around most of the contents
of include/asm-ppc/*.h. It was done deliberately to flush out those
programs which are depending on kernel headers when they shouldn't.
Paul.
next prev parent reply other threads:[~2001-06-05 4:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-27 17:25 Adrian Bunk
2001-05-27 17:29 ` Alan Cox
2001-05-27 19:16 ` Abramo Bagnara
2001-05-27 21:07 ` Adrian Bunk
2001-05-27 21:42 ` Russell King - ARM Linux
2001-05-27 22:10 ` Philip Blundell
2001-05-29 22:30 ` Ralf Baechle
2001-06-02 20:29 ` Adrian Bunk
2001-06-05 4:09 ` Paul Mackerras [this message]
2001-06-05 9:33 ` Adrian Bunk
2001-06-05 12:15 ` Paul Mackerras
2001-06-06 6:51 ` Albert D. Cahalan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15132.23395.553496.50934@argo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=bunk@fs.tum.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®