C chars_ptr STORAGE_ERROR in Imported function
- From: Kim Rostgaard Christensen <krc@xxxxxxxxxx>
- Date: Fri, 22 Aug 2008 10:36:38 +0200
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
.
- Follow-Ups:
- Re: C chars_ptr STORAGE_ERROR in Imported function
- From: anon
- Re: C chars_ptr STORAGE_ERROR in Imported function
- From: Niklas Holsti
- Re: C chars_ptr STORAGE_ERROR in Imported function
- Prev by Date: Re: Access to function returning class-wide type
- Next by Date: Re: C chars_ptr STORAGE_ERROR in Imported function
- Previous by thread: Access to function returning class-wide type
- Next by thread: Re: C chars_ptr STORAGE_ERROR in Imported function
- Index(es):
Relevant Pages
|