Chapter Contents |
Previous |
Next |
Introduction to POSIX |
Process |
Permissions |
Signals |
Some signals cannot be caught. The signal
SIGKILL
can be used to terminate another process
without allowing the target process to intercept termination. Unless the
user has appropriate privileges, a process can send a signal only to other
closely related processes, for instance, ones that it created. OS/390 does
not have a concept that corresponds to the POSIX signal. Under OS/390, various
types of interrupts are handled by a number of unrelated facilities such as
ESTAE
,
STIMER
, and
STAX
.
Files |
Processes can share files. A locking mechanism allows
processes to cooperate in sharing a file. Filenames may be as long as 1024
bytes in USS. Case distinctions are honored in filenames;
calc.c
and
Calc.c
reference separate files. This is in contrast to OS/390 data
sets, which are record-oriented, cannot generally be shared, and whose names
are limited to a small number of uppercase characters. POSIX files are organized
into file systems that are stored in OS/390 data sets by USS. These data
sets can be mounted independently.
Directories |
POSIX
files are organized into directories.
A directory is a file that contains a list of other files and
their attributes. Directories can reference subdirectories to any number
of levels. A complete pathname includes a directory specification and a filename.
The pathname
/u/fred/calc.c
refers to the file named
calc.c
, in the directory
fred
, in the directory
u
in the system root directory. Both special and regular files are referenced
by hierarchical filenames. For example, the pathname for the user's terminal
is
/dev/tty
. Each process
has a current working directory that defines a reference point for pathnames.
If a working directory for a process is
/u/fred
, the pathname
calc.c
is interpreted as
/u/fred/calc.c
. You can read a directory and write applications that
process some or all of the files in a directory. Neither OS/390 catalogs
nor PDS directories offer the flexibility and convenience of POSIX directories.
Links |
Terminals and Sessions |
A
POSIX terminal is a special file. POSIX provides interfaces
that are valid only for terminal files. For example,
tcflush
is an interface that is used to discard
unread terminal input. A terminal may be either a physical ASCII
asynchronous terminal, such as a VT-100, or a pseudo-terminal, which is a
software emulation of an asynchronous terminal. USS supports only pseudo-terminals
created by the TSO OMVS command. When a process writes to an USS pseudo-terminal,
the output is received by the OMVS command, which then writes the data to
the user's TSO terminal. Input is handled in the same way. Some POSIX terminal
control functions, such as defining the terminal's baud rate, have no effect
on USS because they are not meaningful for a pseudo-terminal.
A session may be divided into several process groups:
a foreground process group and one or more background process groups. Processes
are generally allowed to send signals only to other processes in their process
group. The controlling terminal can use special input sequences to interrupt
or halt the processes of the foreground process group. For example, the control-C
character causes a SIGINT to be sent to each foreground process. Note that
the OMVS command uses the sequence
¢c
to replace control-C, which cannot be entered from a 3270 keyboard.
Shells |
The
shell is a specialized application that is used
to invoke other programs; it implements a scripting language that can be used
in a similar fashion to CLIST or REXX under TSO. The shell is a UNIX construct
associated with USS. It is defined by a related POSIX standard, 1003.2. Although
the shell is not defined by the POSIX 1003.1 standard, it uses many interfaces
that are defined by that standard. Under OS/390, invoking an application
from the shell is the best way to run an application in a fully POSIX-compliant
environment. The shell resembles the TSO TMP (terminal monitor program).
Because the shell is not part of POSIX 1003.1 functionality, the SAS/C Library
does not interact directly with it, with the exception of the
system
and
popen
functions, which can invoke an USS command through the shell.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.