HP3000-L Archives

March 1996, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mike Paivinen <[log in to unmask]>
Reply To:
Mike Paivinen <[log in to unmask]>
Date:
Fri, 22 Mar 1996 10:35:48 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
Bruce Toback ([log in to unmask]) wrote:
: The system() call actually uses the Posix CI, since it expects Posix-syntax
: system commands. It's not a call to HPCICOMMAND, which would use the MPE
: command interpreter.
 
Let me expound on Bruce's answer just a little bit.  [We were talking about
this today at the MPE Technical Roundtable at IPROF's.]  When you compile
and link a C program in the MPE CI environment, your program is bound to
the 3000's "ANSI" C library.  [I call it the ANSI C library, but it really
is the non-POSIX C library that has always been part of XL.PUB.SYS.]
This library was around long before we began the design of POSIX on MPE.
So, the system() function was implemented as an interface to the
HPCICOMMAND intrinsic.  When we added POSIX to MPE, we didn't want existing
programs to have to be re-written.  So, the ANSI C library still calls the
HPCICOMMAND intrinsic.  The POSIX C library, /lib/libc.a, implements the
system() function by invoking the POSIX shell.  When you use c89 in the
POSIX shell, your program is bound to the POSIX C library.  The correct
call in this case is:
 
   nRval = system ("callci \"TELL #s383; Edward, send help!\r\"");
 
callci is the POSIX shell command for invoking the MPE CI.  Any object file
that wants to call the POSIX C functions must be linked with the POSIX C
library, /lib/libc.a.  Note that this library is an RL.
 
A couple of additional notes.  A program built in the POSIX shell can be
run from the MPE CI prompt.  [Jeff Kell has a few cautions in this regard
which he posted to this newsgroup.]  You can also use the MPE CI to compile
and link a program with the POSIX C library.  You do the compile as you did
in your example, but you use a different link command.
 
   ccxl tstsysmc,tstsysmo
   link from=tstsysmo;to=./TSYS2;rl=/lib/libc.a;cap=ph;posix;share
 
One final note, in your POSIX shell example you had the comment,
   <use linkedit to alter program capabilities to add ph>
This is unnecessary.  c89 from the POSIX shell always links programs with
PH capability.
 
Hope this helps,
 
Mike P.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Mike Paivinen
[log in to unmask]
 
Hewlett-Packard
CSY - Mailstop 47UP
19447 Pruneridge Avenue
Cupertino, CA   95014

ATOM RSS1 RSS2