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
OSS Porting Considerations
Open System Services Porting Guide—520573-006
6-25
Guardian LISTNER Versus UNIX and OSS inetd
without interfering with each other. A super server handles all requests and passes
requests to the other servers. When necessary, the NonStop operating system can
activate a static server process in an additional processor, thus spreading the load
throughout the system.
Guardian LISTNER Versus UNIX and OSS inetd
A listener server acts as a handler process when network activity is detected on ports
under its domain of management. This way, one handler process, also called a super
server, can handle multiple ports, dramatically reducing the system resources for
creating new processes and for file operations. With one handler process, the specific
needs of individual services can be met in logical, consistent ways. The Guardian
LISTNER process and the OSS inetd process are both listener and static servers.
In the Guardian environment, LISTNER is the super server and listener process for the
application servers provided by HP, such as the TELNET server. LISTNER invokes the
appropriate Guardian server as connection requests for services are received on well-
known TCP ports (in the default configuration).
To use the LISTNER process, you must configure the PORTCONF file and start the
LISTNER process. The PORTCONF file defines the servers to be invoked when a
request comes in from another system on the Internet. Once started, LISTNER reads
the SERVICES file to resolve the services configured in the PORTCONF file. LISTNER
checks that the service name and corresponding port are valid.
In the OSS environment, inetd is a server process that listens for network activity.
inetd is considered an Internet super server, because it is able to handle requests for
multiple Internet services. When started, inetd listens for connections on certain
Internet ports. When a connection request is received, inetd decides to which service
the request corresponds and invokes a server program to service the request. Like the
LISTNER process in the Guardian environments, inetd provides server functions for
application servers, such as TELNET.
The inetd process reads the /etc/inetd.config file, which defines the servers to
be invoked when a request comes in from the network. This file contains a table with
port-to-service assignments, used to service requests that start servers. Using
/etc/inetd.config, inetd invokes the appropriate server (with a fork() call and
a call to one of the exec set of functions) for the connection request. Refer to the
inetd(8) reference page either online or in the Open System Services Shell and
Utilities Reference Manual for information on the command that starts inetd and for
the format of entries in the /etc/inetd.config file.
inetd simplifies the interface of a server program that it starts, because it duplicates
its socket descriptors for an incoming request as file descriptors 0, 1, and 2 before the
server application is processed by an exec function call. This action allows the server
application to use stdin, stdout, and stderr in function calls to perform the
requested service.
Applications using an inetd type of service to start servers can generally be ported to
the OSS environment with minimal changes. However, you can use the Guardian