* problem with <asm/semaphore.h>
@ 2002-06-04 11:19 Hossein Mobahi
2002-06-04 11:44 ` Shanks
0 siblings, 1 reply; 4+ messages in thread
From: Hossein Mobahi @ 2002-06-04 11:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-c-programming
Hi
I compiled the following code with gcc under Redhat
7.2 :
#include <asm/semaphore.h>
main()
{
struct semaphore sum;
}
It doesn't compile, saying "storage size of `sem'
isn't known".
Please guide me how to fix it.
Sincerely
--Hossein Mobahi
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: problem with <asm/semaphore.h>
2002-06-04 11:19 problem with <asm/semaphore.h> Hossein Mobahi
@ 2002-06-04 11:44 ` Shanks
0 siblings, 0 replies; 4+ messages in thread
From: Shanks @ 2002-06-04 11:44 UTC (permalink / raw)
To: Hossein Mobahi, linux-kernel; +Cc: linux-c-programming
Hi Hossein,
If you look inside <asm/semaphore.h> you will see that
the definition of struct semaphore is within a
conditional #ifdef __KERNEL__
Hence __KERNEL__ needs to be defined for this code to
compile.
Try compiling like this
$> gcc -D__KERNEL__ file.c
Regards,
Shanks
--- Hossein Mobahi <hmobahi@yahoo.com> wrote:
> Hi
> I compiled the following code with gcc under Redhat
> 7.2 :
> #include <asm/semaphore.h>
> main()
> {
> struct semaphore sum;
> }
>
> It doesn't compile, saying "storage size of `sem'
> isn't known".
>
> Sincerely
> --Hossein Mobahi
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: problem with <asm/semaphore.h>
@ 2002-06-04 11:41 bonganilinux
2002-06-04 11:44 ` Thomas 'Dent' Mirlacher
0 siblings, 1 reply; 4+ messages in thread
From: bonganilinux @ 2002-06-04 11:41 UTC (permalink / raw)
To: Hossein Mobahi, linux-kernel, linux-c-programming
I think you a trying to include a file from the linux source
which will not work for use-space apps. Try using
#include <semaphore.h> instead
> Hi
>
> I compiled the following code with gcc under Redhat
> 7.2 :
>
> #include <asm/semaphore.h>
> main()
> {
> struct semaphore sum;
> }
>
> It doesn't compile, saying "storage size of `sem'
> isn't known".
> Please guide me how to fix it.
>
> Sincerely
>
> --Hossein Mobahi
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
---------------------------------------------
This message was sent using M-Web Airmail.
JUST LIKE THAT
Are you ready for 10-digit dialling on the 8th of May?
To find out how this will affect your Internet connection go to www.mweb.co.za/ten
http://airmail.mweb.co.za/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-06-04 11:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-04 11:19 problem with <asm/semaphore.h> Hossein Mobahi
2002-06-04 11:44 ` Shanks
-- strict thread matches above, loose matches on Subject: below --
2002-06-04 11:41 bonganilinux
2002-06-04 11:44 ` Thomas 'Dent' Mirlacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).