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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebad38e7bffe4881,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Kim Rostgaard Christensen Newsgroups: comp.lang.ada Subject: C chars_ptr STORAGE_ERROR in Imported function Date: Fri, 22 Aug 2008 10:36:38 +0200 Organization: Jacob's private Usenet server Message-ID: NNTP-Posting-Host: pintsize.dmusyd.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: jacob-sparre.dk 1219394200 7771 83.94.115.162 (22 Aug 2008 08:36:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 22 Aug 2008 08:36:40 +0000 (UTC) User-Agent: Icedove 1.5.0.14eol (X11/20080724) Xref: g2news2.google.com comp.lang.ada:7480 Date: 2008-08-22T10:36:38+02:00 List-Id: Hello there I am in progress of binding the pcap c library to ada, it is a part of a school project. And for that i need a funtion that modifies a parameter to a function like so: char *pcap_lookupdev(char *); I have figured out this much: function pcap_lookupdev(errbuff : Interfaces.C.Strings.Chars_Ptr) return Interfaces.C.Strings.Chars_Ptr; pragma Import (C, pcap_lookupdev, "pcap_lookupdev"); This works in the sense that running it as root returns the device found, but when I run it as normal user I get raised STORAGE_ERROR : stack overflow (or erroneous memory access) Do I need to declare the buffer and then then pass its c pointer to the function? It is declared like this in a c example: char errbuf[PCAP_ERRBUF_SIZE]; Best Kim Rostgaard Christensen