Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
Interoperating Between Programming Environments
Open System Services Porting Guide—520573-006
5-13
Terminal I/O
Terminal I/O
The only terminals supported in the OSS environment are a Telserv window and the
three OSSTTY windows: #stdin, #stdout, and #stderr. Terminal I/O through a
Telserv window is the same as that for a UNIX network terminal. OSS also supports
local terminals through OSSTTY, although OSSTTY has the look and feel of a remote
terminal. OSS terminal I/O functions operate only on the terminal device /dev/tty.
The functions cfsetispeed() cfsetospeed() have no effect on the network
terminals (they affect only local terminals). The function tcsetattr affects both the
Telserv and OSSTTY terminals.
The only way to access the OSS environment interactively is through an OSSTTY
window or through a Telserv virtual terminal, or window, with VT100 emulation. The
Open System Services Programmer’s Guide discusses accessing terminals from the
OSS environment, including details on static and dynamic windows, terminal
parameters, and control characters, where managing I/O is discussed. There is also a
discussion of the OSSTTY facility.
The OSS terminal interface is described in detail in the termios(4) and tty(7)
reference pages, either online or in the Open System Services System Calls
Reference Manual.
Printer I/O
The OSS API has no function that accesses printers or spoolers directly. To print from
an OSS program or get information about a print job, you can use the popen()
function to call the lp or lpstat utility. For information about these utilities, refer to
the lp(1) and lpstat(1) reference pages either online or in the Open System
Services Shell and Utilities Reference Manual, or refer to the Open System Services
User’s Guide.
An alternative is to write OSS files and send output directly to a printer or to the
Guardian spooler using the Guardian API, and take advantage of the spooler features.
For example, your program can examine the queues of available printers and move a
job to a printer whose queue becomes unexpectedly shorter because of a job
cancellation, or away from a printer that is experiencing delays. You can also access
spoolers that are on other systems than the file you want to print.
You can send an OSS file to the spooler and control the spooler from an OSS program
using Guardian spooler procedures. The printer is opened using FILE_OPEN_; then,
SPOOLSTART is called to establish a level-3 spooling session. The Open System
Services Programmer’s Guide contains an example of using Guardian spooler
procedures, in the discussion about managing I/O.
Mixed-Module Programming
In general, a program that runs as an OSS process is composed of modules compiled
for the OSS environment (OSS modules). Likewise, a program that runs as a Guardian
process is composed of modules compiled for the Guardian environment (Guardian