From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9277635655f37412 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.35.68 with SMTP id f4mr15729850pbj.5.1322942325969; Sat, 03 Dec 2011 11:58:45 -0800 (PST) Path: lh20ni65751pbb.0!nntp.google.com!news2.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: POSIX.Semaphores question Date: Sat, 03 Dec 2011 21:59:31 +0200 Organization: Tidorum Ltd Message-ID: <9jvdbkFdi2U1@mid.individual.net> References: Mime-Version: 1.0 X-Trace: individual.net eV4JGAUZq8siM3Shv/a7kQ4MFrazrByKbSEJJbleEKLgisoBr3 Cancel-Lock: sha1:S0R+1a2zQ7wys4mmhU4PkM3mk1o= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Xref: news2.google.com comp.lang.ada:14815 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-12-03T21:59:31+02:00 List-Id: 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 . @ .