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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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 f4mr24922547pbj.5.1323132804735; Mon, 05 Dec 2011 16:53:24 -0800 (PST) Path: lh20ni73884pbb.0!nntp.google.com!news2.google.com!postnews.google.com!w3g2000vbw.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: Re: POSIX.Semaphores question Date: Mon, 5 Dec 2011 16:53:24 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <9jvdbkFdi2U1@mid.individual.net> <2166814f-4a26-4425-965f-2c6215eeedde@d17g2000yql.googlegroups.com> <4edcd2fa$0$6548$9b4e6d93@newsspool4.arcor-online.net> <8fbf5f51-f133-41bf-9457-b3f85e3950c9@x7g2000yqb.googlegroups.com> NNTP-Posting-Host: 74.69.172.183 Mime-Version: 1.0 X-Trace: posting.google.com 1323132804 23367 127.0.0.1 (6 Dec 2011 00:53:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 6 Dec 2011 00:53:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w3g2000vbw.googlegroups.com; posting-host=74.69.172.183; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Xref: news2.google.com comp.lang.ada:14846 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-12-05T16:53:24-08:00 List-Id: > That's because "type Semaphore_Descriptor is private;", so your code > can't see the fact that it's privately implemented as "access constant > POSIX.C.sem_t;". That makes sense, and sounds like what that bug report I linked to was addressing. I'm guessing that the private tag is what is making the Semaphore and Mutex have a larger size than I expect. I would have thought that the 'Dummy' null record would have evaluated to zero size, making the Semaphore and Mutex records defined in the POSIX library map to the same size as the types within C. However, it looks like GNAT is adding another 4 bytes to the size (for the 'null' record), then GNAT is aligning multiple Semaphores/Mutexes in a record to 16 byte boundaries... Guess I could add padding to the C structs to get this to work with GNAT - but seems like there should be a better way to get the sizes correct.