gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] [GM2] "exec" Procedure in iso-libraries?


From: Gaius Mulley
Subject: Re: [Gm2] [GM2] "exec" Procedure in iso-libraries?
Date: Wed, 21 Oct 2015 18:03:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

john o goyo <address@hidden> writes:

> On 21/10/2015 11:06, Gaius Mulley wrote:
>> "address@hidden"<address@hidden>  writes:
>>
>>> Hello List,
>>>
>>> in the "ulm" libraries, in Module "CallShell" there is procedure
>>> "Call", allowing a program to call a shell and execute some other
>>> program or system command. Is there something similar in the "iso"
>>> libraries?
>>>
>>> Thanks and regards, Georg
>>
>> Hi Georg,
>>
>> res := libc.system (ADR ("command")) ;
>
> No such animal in ISO, Gaius.
>
> In fact, there seemed to be definite bias against anything that
> smacked of POSIX.  (Hence, one of their blunders is not specifying the
> exact nature of the command arguments.  Some compilers chose the
> called command as the first argument, as in POSIX, whilst others chose
> the first passed argument as the first argument.)
>
> By the way, how is the Solaris port going (he asked hopefully)?

Hi John,

ah not strict ISO - I grant.  But using gm2 you can access the libc
module and the ISO modules.  Here is the example and compiler command
line:

MODULE testsystem ;

FROM SYSTEM IMPORT ADR ;
IMPORT libc ;

VAR
   res: INTEGER ;
BEGIN
   res := libc.system (ADR ("date"))
END testsystem.

$ gm2 -fiso -g testsystem.mod 
$ ./a.out 
Wed 21 Oct 17:51:28 BST 2015
$

The solaris port has stalled alas - however - the good news is that the
port to gcc-5.2.0 has begun.  I'm in the middle of migrating the binding
level code over to the new GCC method.  Interestingly gcc now uses g++
to compile itself - so there are a few changes required.  Hopefully
nothing too onerous - the changes generally make for cleaner internal
code and gm2 works well with g++ in any event.  Compiler build times
might increase though - but I've no empirical data as of yet just a
feeling :-)

Some other good news - I've been given a sparc at work which will
hopefully (if it installs etc) will run debian from July 2015 (debian
stopped supporting the sparc platform at that time).  But this should
allow for better testing - assuming the hardware still works and debian
installs etc

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]