Open System Services Programmer's Guide

Selecting Source and Target Execution Environments
Application program development takes place in the source environment and includes writing,
compiling, and debugging code. Once developed, the application program runs in the target
execution environment. The source and target execution environments are usually the same (OSS
or Guardian environment), but there are some special cases in which they are different.
The Typical Case
In most cases, you will use a combination of OSS and UNIX workstation tools to develop source
code and produce applications that run in the OSS target execution environment from the OSS
shell.
Special Cases of Cross Compilation
There are two special cases of cross compilation in which you might want to use different source
and target environments.
OSS source environment, Guardian target execution environment. You might want to produce
applications to run in the Guardian environment from a Tandem Advanced Command Language
(TACL) prompt but take advantage of the OSS development tools to do some initial development
(editing, some compiling and debugging). In the OSS environment, you can use filenames
containing more than eight characters and a deep, tree-structured directory system, as
compared with an eight-character limit for Guardian file identifiers and a shallow file system.
Guardian source environment, OSS target execution environment. This is the situation of
porting existing Guardian applications to run in the OSS environment from the OSS shell.
For more information about cross compilation, see the Open System Services Porting Guide.
Calling Functions and Procedures in OSS Programs
In general, you should use OSS function calls because doing so makes applications more portable.
However, there are cases in which you will want or need to call Guardian system procedures and
Guardian C functions.
The following subsections describe when to use which category of functions or procedures and
provide examples of calling Guardian procedures directly from an OSS program.
OSS Functions
Use OSS functions wherever possible, even to manipulate Guardian objects. For example, if you
want to open a Guardian file that is odd-unstructured, use the OSS open() function. Call OSS
functions as you would any standard C function.
OSS functions are defined in library header files in the /usr/include directory. For detailed
information about OSS functions, see the following manuals:
Library functions (those in logical section 3 of the reference pages) are described in the Open
System Services Library Calls Reference Manual.
System functions (those in logical section 2 of the reference pages) are described in the Open
System Services System Calls Reference Manual.
The HP C language for NonStop systems, run-time library, and compiler information are
described in the C/C++ Programmer’s Guide.
Selecting Source and Target Execution Environments 37