The Linux Programming Interface

(nextflipdebug5) #1
Contents in Detail xxix

64 PSEUDOTERMINALS 1375
64.1 Overview ............................................................................................................... 137 5
64.2 UNIX 98 Pseudoterminals......................................................................................... 1380
64.2.1 Opening an Unused Master: posix_openpt()........................................... 1380
64.2.2 Changing Slave Ownership and Permissions: grantpt()........................... 1381
64.2.3 Unlocking the Slave: unlockpt()............................................................ 1382
64.2.4 Obtaining the Name of the Slave: ptsname().......................................... 1382
64.3 Opening a Master: ptyMasterOpen()......................................................................... 1383
64.4 Connecting Processes with a Pseudoterminal: ptyFork()................................................ 1385
64.5 Pseudoterminal I/O ................................................................................................. 1388
64.6 Implementing script(1)............................................................................................. 1390
64.7 Terminal Attributes and Window Size ........................................................................ 1394
64.8 BSD Pseudoterminals ............................................................................................... 1395
64.9 Summary................................................................................................................ 139 7
64.10 Exercises ................................................................................................................ 1398


A TRACING SYSTEM CALLS 1401


B PARSING COMMAND-LINE OPTIONS 1405


CCASTING THE NULL POINTER 1413


D KERNEL CONFIGURATION 1417


E FURTHER SOURCES OF INFORMATION 1419


F SOLUTIONS TO SELECTED EXERCISES 1425


BIBLIOGRAPHY 1437


INDEX 1447

Free download pdf