comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: POSIX.Semaphores question
Date: Sat, 03 Dec 2011 21:59:31 +0200
Date: 2011-12-03T21:59:31+02:00	[thread overview]
Message-ID: <9jvdbkFdi2U1@mid.individual.net> (raw)
In-Reply-To: <a24b6635-6820-4c1b-8e2b-67dc90900159@f35g2000yqm.googlegroups.com>

On 11-12-02 17:43 , awdorrin wrote:
> I'm using the Florist POSIX Libraries and have code that is similar to
> the following:
>
> In the spec file:
>
> Sem_READY : Semaphore;
> READY         : Semaphore_Descriptor;
> pragma Export( Ada, READY, "ready");

This pragma gives the variable a very short linkage name, "ready", which 
is moreover a common word. Perhaps the same name is used by some other 
module of the program, for some other program item, and this confuses 
the linker. Does the linker give any errors or warnings?

Try it with a longer name, one less likely to be in use already for 
something else.

>
> Then in my body:
>
> POSIX.Semaphores.Initialize( Sem_READY, 1);
> READY := POSIX.Semaphores.Descriptor_Of( Sem_READY );
>
> When executed, READY is always set to null.
>
> If I run the code through GDB and print READY, it always displays 0x0.
> However, if I call POSIX.Semaphores.Descriptor_Of( Sem_Ready )
> I get the right address returned: (access posix.c.sem_t) 0x8321540
>
> I have no idea why the assignment is failing and not generating an
> exception....


-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .



  parent reply	other threads:[~2011-12-03 19:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 15:43 POSIX.Semaphores question awdorrin
2011-12-02 16:54 ` awdorrin
2011-12-02 17:06   ` Georg Bauhaus
2011-12-02 17:09     ` Georg Bauhaus
2011-12-02 17:22       ` awdorrin
2011-12-03 16:32         ` awdorrin
2011-12-03 19:59 ` Niklas Holsti [this message]
2011-12-05 12:25   ` awdorrin
2011-12-05 14:19     ` Georg Bauhaus
2011-12-05 16:58       ` awdorrin
2011-12-05 17:59         ` Simon Wright
2011-12-06  0:53           ` awdorrin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox