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 User Environments
Open System Services Porting Guide—520573-006
4-8
Guardian Environment Variables and the OSS Shell
The following commands set options and variables for using the vi editing mode:
FCEDIT
Use fc (the FIX command) to activate the second editing mode. In this mode, a
temporary file is created by the shell, and the editor specified by the FCEDIT variable
is activated with this file. When you exit the editor, the commands in the temporary file
are executed by the shell. FCEDIT is normally the ed utility. Most shells, including the
OSS shell, provide the alias r (for repeat) to reexecute a specific command in the
history. The following sample command sets the editor for fc to ed:
export FCEDIT=$(whence ed)
HISTSIZE and HISTFILE
Two other shell variables control the operation of the history mechanism: HISTSIZE
and HISTFILE.
HISTSIZE specifies the number of commands stored in the history file. If HISTSIZE is
not specified in $HOME/.profile or is invalid, the default of 128 commands is used.
HISTFILE specifies the pathname of the file that the shell uses to store the command
history. If HISTFILE is not specified in $HOME/.profile or is invalid, the filename
$HOME/.sh_history is used. If you are using more than one OSS shell at a time,
HISTFILE should be set to a different filename for each shell to prevent shell
interference.
The following example sets the number of commands saved in the history file to 50:
export HISTSIZE=50
The following example sets the pathname of the history file to be unique for this shell:
export HISTFILE=$HOME/.ksh_hist$$
The OSS process ID (PID) number is placed at the end of the filename, replacing
the $$, thus ensuring a unique pathname. The filename becomes
$HOME/.ksh_histPID.
Guardian Environment Variables and the OSS Shell
When a new Guardian process starts, a sequence of messages usually provides that
process with some information about the process’s environment, such as the user-
Editing Command Setting Description
set +o emacs Ensures emacs mode is off.
set +o gmacs Ensures gmacs mode is off.
set -o vi Turns on vi editing mode.
export EDITOR=$(whence vi) Sets editing mode to vi. The whence command
returns the full pathname for the program vi. The
value is exported to subshells.