C/C++ Programmer's Guide (G06.25+)

Running and Debugging C and C++ Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
19-2
Running Programs in the OSS Environment
OUT file-name
specifies the standard output file (stdout) for the new process. If you do not
include the OUT option, the new process uses the command interpreter’s
default output file, which is usually your home terminal.
args-list
is a space-separated list of additional arguments to the C or C++ program you are
running. Note that you separate these arguments with spaces, not commas.
Usage Guidelines
In order to run in the Guardian environment a native object file that was compiled
in the OSS environment, you must set the file code to 700 for a TNS/R object file
or 800 for a TNS/E object file after copying the file to the Guardian file system.
For example, to set the file code of an object file to 700, enter the following at a
TACL prompt:
> FUP ALTER filename, CODE 700
To determine the file code of an object file, enter:
> FUP INFO filename
You can group several words into a single args-list argument by enclosing
them in quotation marks; for example:
5> RUN invite /OUT $s.#hold/ "Bruce and Rob"
To include a quotation mark as part of a quoted argument, use two quotation
marks; for example:
6> RUN findstr /IN myfile/ "Refer to ""Running a *"""
Running Programs in the OSS Environment
To run a C or C++ program from the OSS environment, enter the program file name at
the OSS shell prompt. You can also use the run command to run a process with HP
specific attributes. For details, see the run(1) reference page, available either online
or in the Open System Services Shell and Utilities Reference Manual.
Program Initialization
Your program begins execution when the operating system transfers control to your
program’s object code. Before executing the code, however, the C run-time library
initializes its run-time environment. The C run-time library also calls a CRE initialization
function.
The CRE initialization function establishes the CRE’s internal data structures, I/O
model, and so forth, as well as shared facilities such as the user data heap. After the