Re: How to manage a system call inside Ada ?
- From: Georg Bauhaus <bauhaus@xxxxxxxxxxxxx>
- Date: Thu, 23 Nov 2006 17:43:49 +0100
On Thu, 2006-11-23 at 17:12 +0100, wlz wrote:
Hi,
I want to call an editor inside Ada-Code. Is there a Ada function
like system(..) in C.
This may depend on compiler and system.
with Interfaces.C;
with Ada.Text_IO; use Ada;
procedure edit is
package C renames Interfaces.C;
function system(command: C.char_array) return C.int;
pragma import(C, system); -- have the compiler choose the linke name
--pragma import(C, system, "system");
rc: C.int;
begin
rc := system(C.To_C("editor"));
Text_IO.put_line(Text_IO.current_error,
"system returns" & C.int'image(rc));
end edit;
I tried to import a C function with this system call. But this failed, the
Ada Linker is missing the label _system.
I hope somebody can help.
thx - rainer
.
- References:
- How to manage a system call inside Ada ?
- From: wlz
- How to manage a system call inside Ada ?
- Prev by Date: How to manage a system call inside Ada ?
- Next by Date: Re: How to manage a system call inside Ada ?
- Previous by thread: How to manage a system call inside Ada ?
- Next by thread: Re: How to manage a system call inside Ada ?
- Index(es):
Relevant Pages
|