strings, is NULL (not initialized) until environment variables are associated with
the job.
On a UNIX system, the exec() function creates a new process and extends the
environment variables of the original process to the new process. Although the
AS/400 has no exec() function, environment variables
are
extended to a new
job created using the Submit Job (SBMJOB) command, provided the first job
has environment variables.
To help alleviate these differences, OS/400 provides several nonstandard interfaces
that can be used to establish a default set of environment variables.
The Add Environment Variable (ADDENVVAR) CL command can be used to
set an environment variable for a job. Further, a CL program can be written
using the ADDENVVAR command that sets several environment variables for a
job. Alternatively, the putenv() or Qp0zPutEnv() function can be used in a
similar manner in a C program.
Other environment variable CL commands, Change Environment Variable
(CHGENVVAR) and Work with Environment Variables (WRKENVVAR), or C
functions can be used to change or retrieve environment variables for a job.
Integrated File System APIs
The integrated file system is a part of OS/400 that supports stream input/output and
storage management similar to personal computer and UNIX operating systems.
The stream file support is designed for efficient use in client/server applications.
Stream files are particularly well suited for storing strings of data such as the text of
documents, images, audio, and video.
The integrated file system provides a hierarchical directory structure that supports
UNIX-based open system standards, such as POSIX** and XPG. This file and
directory structure provides the users of PC operating systems with a familiar envi-
ronment. The integrated file system takes better advantage of the graphical user
interface.
In addition to providing a common interface for users and application to access
stream files, the integrated file system also provides access to database files, docu-
ments and other objects stored on the AS/400.
The integrated file system APIs can perform operations on directories, files, and
related objects in the file systems accessed through the integrated file system inter-
face. For more information about the integrated file system, see the
Integrated File
System Introduction
book, SC41-5711.
Interprocess Communication APIs
Interprocess communication (IPC) on the AS/400 is made up of three services:
message queues, semaphores, and shared memory. The basic purpose of these
services is to provide OS/400 processes with a way to communicate with each
other through a set of standardized APIs. These C-language functions are based
on the definitions in the X/Open single UNIX specification (formerly Spec 1170).
Message queues provide a form of message passing in which any process (given
that it has the necessary permissions) can read a message from or write a
message to any message queue on the system. There are no requirements that a
process be waiting to receive a message from a queue before another process
8-22 System API Programming V4R1