Chapter Contents

Previous

Next
Developing Applications for Use with UNIX System Services OS/390

exec-Linkage Programs

An executable load module may be stored in either a partitioned data set (PDS) or an USS hierarchical file system (HFS) file. When a load module is stored in a PDS, it can be loaded and invoked by standard OS/390 supervisor calls (SVCs), but there is no POSIX defined way to invoke it. When a load module is stored in the HFS, it is inaccessible to OS/390 SVCs but can be executed by means of the USS exec system call. exec is used by the USS shell to call its commands, as well as by other POSIX applications that need to pass control to other programs. A program that is given control by exec rather than by an OS/390 SVC is called an exec -linkage program.

Note:    A program will have exec -linkage if it is stored in the USS HFS. You can either direct the output from the linkage editor directly to the HFS or move the load module from a PDS to the HFS using the USS OPUT, OGET, or OCOPY commands. Also, the SAS/C pdscall utility can be used to invoke a program stored in a PDS with exec -linkage.  [cautionend]

exec -linkage is not required for a program to use POSIX functionality. For instance, a program that reads the HFS can be run in TSO. However, because TSO is not a POSIX conforming environment, certain POSIX behavior details are not implemented in TSO. For instance, the POSIX standards require that when a program is given control, stdin , stdout , and stderr are defined to be POSIX file descriptors 0, 1, and 2. TSO does not set up these standard file descriptors, and stdin , stdout , and stderr reference the TSO terminal instead, in this environment. If this particular behavior is important to your application, the application load module should be stored in the HFS and invoked with exec , in order to guarantee the proper behavior.

Whether or not a program has exec -linkage affects a number of details of run-time library behavior. Specific instances are discussed later in this chapter.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.