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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8e3291db4c97390f X-Google-Attributes: gid103376,public From: dale@cs.rmit.edu.au (Dale Stanbrough) Subject: Re: System call Date: 1998/09/30 Message-ID: #1/1 X-Deja-AN: 396235333 References: <6ulqvt$728$2@pinah.connect.com.au> X-Complaints-To: abuse@cs.rmit.edu.au X-Trace: emu.cs.rmit.edu.au 907132442 23587 131.170.27.23 (30 Sep 1998 05:14:02 GMT) Organization: RMIT NNTP-Posting-Date: 30 Sep 1998 05:14:02 GMT Newsgroups: comp.lang.ada Date: 1998-09-30T05:14:02+00:00 List-Id: In article <6ulqvt$728$2@pinah.connect.com.au>, "Adnan" wrote: > How do I use a Unix system call from an Ada program. > > Thanx by calling the appropriate Unix routine, just as C does. the code below does this, but is not really the best it could be. dale function invoke_system(name :string) return integer is C_name :constant interfaces.c.char_array(1..name'length+1) := interfaces.c.to_C(name); function C_system( name :system.address) return interfaces.c.int; pragma import(C, C_system, "system"); begin return integer(C_system(C_name(1)'address)); end;