From: Robert Hancock <hancockr@shaw.ca>
To: liangbowen <liangbowen@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: problem with <asm/semaphore.h>
Date: Thu, 19 Apr 2007 08:26:14 -0600 [thread overview]
Message-ID: <46277C06.4020602@shaw.ca> (raw)
In-Reply-To: <1176961482.904618.250700@e65g2000hsc.googlegroups.com>
liangbowen wrote:
>> You're trying to use a kernel data structure in a user-space program.
>> Don't. The definitions in that header are inside #ifdef __KERNEL__ and
>> so the provided userspace headers remove that part.
>
> someone've said the exact same thing, and he said that I can add the -
> D__KERNEL__ to the compilation options,
> but I can't see any #ifdef __KERNEL__ macro in that header(<asm/
> semaphore.h>).
> Is my header differ from yours?
>
It's because the userspace headers have been processed with unifdef to
remove any sections which are inside #ifdef __KERNEL__, since userspace
apps are not supposed to see those sections.
I'm not sure why you want to use a semaphore in a userspace program.
Even if you can get it to compile, they definitely won't function
properly. Aside from the legal issues (using internal kernel code like
that would make your program a derived work of the kernel and thus
covered under the GPL).
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next prev parent reply other threads:[~2007-04-19 14:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1176885218.597268.304370@l77g2000hsb.googlegroups.com>
2007-04-19 0:50 ` problem with <asm/semaphore.h> Robert Hancock
[not found] ` <fa.fBTtgscoj66JCf4bIm8v290vCRo@ifi.uio.no>
[not found] ` <fa.w5cKcLCYzl2eiKiQW21MMlLALWM@ifi.uio.no>
[not found] ` <1176961482.904618.250700@e65g2000hsc.googlegroups.com>
2007-04-19 14:26 ` Robert Hancock [this message]
[not found] ` <fa.AvTW9UjANJ733AbQtnQmG3hvo7U@ifi.uio.no>
[not found] ` <fa.BgzkXXMJTw3V0hCHG6tJNpgDbkw@ifi.uio.no>
[not found] ` <fa.aUMayTTuQ16UFy6Q+LWR4hiTB1Q@ifi.uio.no>
[not found] ` <fa.633EuMGTHsDpCL9UutDSzsItJUQ@ifi.uio.no>
[not found] ` <1177003071.879067.80590@n76g2000hsh.googlegroups.com>
2007-04-21 22:57 ` Robert Hancock
2002-06-04 11:41 bonganilinux
2002-06-04 11:44 ` Thomas 'Dent' Mirlacher
2002-06-04 11:44 ` Thomas 'Dent' Mirlacher
-- strict thread matches above, loose matches on Subject: below --
2002-06-04 11:19 Hossein Mobahi
2002-06-04 11:44 ` Shanks
2002-06-04 11:44 ` Shanks
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=46277C06.4020602@shaw.ca \
--to=hancockr@shaw.ca \
--cc=liangbowen@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.