JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Programming Interfaces Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Memory and CPU Management

2.  Session Description Protocol API

3.  Process Scheduler

4.  Locality Group APIs

5.  Input/Output Interfaces

Files and I/O Interfaces

Basic File I/O

Advanced File I/O

File System Control

Using File and Record Locking

Choosing a Lock Type

Selecting Advisory or Mandatory Locking

Cautions About Mandatory Locking

Supported File Systems

Opening a File for Locking

Setting a File Lock

Setting and Removing Record Locks

Getting Lock Information

Process Forking and Locks

Deadlock Handling

Terminal I/O Functions

6.  Interprocess Communication

7.  Socket Interfaces

8.  Programming With XTI and TLI

9.  Packet Filtering Hooks

10.  Transport Selection and Name-to-Address Mapping

11.  Real-time Programming and Administration

12.  The Oracle Solaris ABI and ABI Tools

A.  UNIX Domain Sockets

Index

Terminal I/O Functions

Terminal I/O interfaces deal with a general terminal interface for controlling asynchronous communications ports, as shown in the following table. For more information, see the termios(3C) and termio(7I) man pages.

Table 5-5 Terminal I/O Interfaces

Interface Name
Purpose
Get and set terminal attributes
Perform line control interfaces
Get and set baud rate
Get and set terminal foreground process group ID
Get terminal session ID

The following example shows how the server dissociates from the controlling terminal of its invoker in the non-DEBUG mode of operation.

Example 5-4 Dissociating From the Controlling Terminal

   (void) close(0);
   (void) close(1);
   (void) close(2);
   (void) open("/", O_RDONLY);
   (void) dup2(0, 1);
   (void) dup2(0, 2);
   setsid();

This operation mode prevents the server from receiving signals from the process group of the controlling terminal. A server cannot send reports of errors to a terminal after the server has dissociated. The dissociated server must log errors with syslog(3C).