From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: * X-Spam-Status: No, score=1.1 required=3.0 tests=BAYES_00,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!tmr9BI+uueYJMT3TC5a5oA.user.46.165.242.75.POSTED!not-for-mail From: Fernando Oleo Blanco Newsgroups: comp.lang.ada Subject: Re: Help: Ada in NetBSD Date: Sun, 29 Aug 2021 22:36:41 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <16242b6e-cfb6-4fb1-8f7f-566469de446an@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="17322"; posting-host="tmr9BI+uueYJMT3TC5a5oA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62578 List-Id: On 29.08.21 20:25, Simon Wright wrote: > The problem can't be fixed by including C headers, because ... > >>> For gettimeofday the symbol is replaced by __gettimeofday50. >>> These symbols are marked with __RENAME(XXX) macros in the C headers. > > The C header is (I got this from the net, so beware) > > int gettimeofday(struct timeval * __restrict, void *__restrict) > __RENAME(__gettimeofday50); That is correct. I do not know exactly how the __RENAME() statement works, however, I can take a guess. The symbol gettimeofday should still be defined and just call the __RENAME directly. The NetBSD people cannot expect everybody to rename their functions just for them. There are very many more functions that are also __RENAME d > The Ada needs to change to > > function gettimeofday > (tv : not null access struct_timeval; > tz : struct_timezone_ptr) return Integer; > pragma Import (C, gettimeofday, "gettimeofday50"); > > (or maybe "_gettimeofday50", or even "__gettimeofday50" - nm will be > your friend). This is exactly what I want to avoid. I took a look at FreeBSD's libc and glibc. None __RENAME their functions (at the very least the ones I am interested)... I need to interrogate some developers in IRC. I will update the thread if I find anything relevant. Regards, -- Fernando Oleo Blanco https://irvise.xyz