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,238d86975fe557fa X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to manage a system call inside Ada ? From: Georg Bauhaus In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-Id: <1164300228.5369.27.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Thu, 23 Nov 2006 17:43:49 +0100 NNTP-Posting-Date: 23 Nov 2006 17:43:51 CET NNTP-Posting-Host: 66b836c4.newsspool3.arcor-online.net X-Trace: DXC=;^\7RA=IfEkPXlQ;h]GTMdMcF=Q^Z^V3h4Fo<]lROoRagUcjd<3m<;bFd6:LSaNQcePCY\c7>ejVhP 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 > >