Path: utzoo!attcan!uunet!mailrus!uwm.edu!rpi!brutus.cs.uiuc.edu!usc!ucsd!ucbvax!hplabs!hpda!hpwala!hp-and!gallag From: gallag@hp-and.HP.COM (Mike Gallagher) Newsgroups: comp.sys.hp Subject: Re: Unix (HP-UX) system calls from ADA Message-ID: <13060001@hp-and.HP.COM> Date: 21 Mar 90 13:46:36 GMT References: <1587@krafla.rhi.hi.is> Organization: HP Andover Division (Massachusetts) Lines: 62 > Problem : Making unix system calls within Ada code > Background : HP-UX 6.5, HP 9000/300 series, Alsys 4.35 Ada compiler > Error message : > ld: Undefined external - > _ll > _clear > ld: output file still contains undefined symbols > ld: (Warning) did not generate an output file > ada: Errors detected > > > procedure MAIN is > > begin > > UNIX_SYSTEM_CALL.clear; > UNIX_SYSTEM_CALL.ll; > > end MAIN; > > > system.ads : The following source is the unix_system_call package > > -- ************************************************ > -- * ABSTRACT: Package specification * > -- ************************************************ > > package UNIX_SYSTEM_CALL is > > procedure clear; > procedure ll; > > private > > pragma INTERFACE (C, clear); -- clear display > pragma INTERFACE (C, ll); -- long list > > end UNIX_SYSTEM_CALL; -- package specification > Using the HP Ada compiler on a HP-UX A.B3.10 U 9000/855 machine, I use the following: with SYSTEM_ENVIRONMENT; procedure MAIN is LOCAL_STATUS : SYSTEM_ENVIRONMENT.EXIT_STATUS; begin LOCAL_STATUS := SYSTEM_ENVIRONMENT.EXEC_SHELL_COMMAND("clear"); LOCAL_STATUS := SYSTEM_ENVIRONMENT.EXEC_SHELL_COMMAND("ll"); end MAIN; Perhaps your compiler has a similar SYSTEM_ENVIRONMENT package. Mike Gallagher gallag@hp-and