System Interfaces Guide
  Buscar sólo este libro
Descargar este libro en PDF

............................Contents


1. Introduction to the API
1
..The Programming Interface 1
....Interface Functions 2
..Libraries 2
....Static libraries 2
....Dynamic libraries 3
..Interface Taxonomy 3
....Standard Classification 4
....Public Classification 4
.... Classification 4
....Obsolete Classification 5

2. Processes
7
..Overview 7
..Functions 8
....Spawning new processes 9
....Runtime Linking 11
....Process Scheduling 13
..Error Handling 14
..Signals 14
....Overview 14

3. Process Scheduler
23
..Overview of the Process Scheduler 25
....Time-Sharing Class 26
....System Class 27
....Real-time Class 27
..Commands and Functions 27
....The priocntl Command 30
....The priocntl Function 34
....The priocntlset Function 44
..Interaction with Other Functions 46
....Kernel Processes 46
....fork and exec 47
....nice 47
....init 47
..Performance 47
....Process State Transition 48
....Software Latencies 50

4. Input/Output Interfaces
51
..Files and I/O 51
....Basic File I/O 52
....Advanced File I/O 53
....File System Control 54
..File and Record Locking 55
....Supported File Systems 55
....Choosing A Lock Type 55
....Terminology 56
....Setting a File Lock 56
....Opening a File for Record Locking 58
....Setting and Removing Record Locks 58
....Getting Lock Information 59
....Forking Locks 60
....Deadlock Handling 61
....Selecting Advisory or Mandatory Locking 61
....Cautions about Mandatory Locking 62
..Terminal I/O 63

5. System V IPC
65
....Permissions 66
....IPC Functions, Key Arguments, and Creation Flags 67
..Messages 68
....Structure of a Message Queue 69
....Initializing a Message Queue with msgget() 71
....Controlling Message Queues with msgctl() 72
....Sending and Receiving Messages 73
..Semaphores 75
....Structure of a Semaphore Set 77
....Initializing a Semaphore Set with semget() 78
....Controlling Semaphores with semctl() 80
....Performing Semaphore Operations with semop() 82
..System V Shared Memory 83
....Structure of a System V Shared Memory Segment 84
....Using shmget() to Access a Shared Memory Segment 85
....Controlling a Shared Memory Segment with shmctl() 87
....Attaching and Detaching a Shared Memory Segment with
.......shmat() and shmdt() 88

6. Memory Management
91
..Overview of the Virtual Memory System 91
....Virtual Memory, Address Spaces, and Mapping 91
....Networking, Heterogeneity, and Coherence 93
..Memory Management Interfaces 94
....Creating and Using Mappings 94
....Removing Mappings 100
....Cache Control 100
....Other Mapping Functions 103
..Address Space Layout 103

7. Realtime Programming and Administration
107
..Basic Rules of Realtime Applications 107
....Degrading Response Time 108
....Runaway Realtime Processes 111
....I/O Behavior 111
..Scheduling 112
....Dispatch Latency 112
....System Calls That Control Scheduling 121
....Utilities that Control Scheduling 122
....Configuring Scheduling 124
..Memory Locking 127
....Overview 127
..High Performance I/O 129
.... Asynchronous I/O 129
....Synchronized I/O 131
..Interprocess Communication 133
....Overview 133
....Signals 134
....Pipes 134
....IPC Message Queues 135
....IPC Semaphores 136
....Shared Memory 136
....Choice of IPC Mechanism 138
..Asynchronous Networking 138
....Modes of Networking 138
....Networking Programming Models 139
....Asynchronous Connectionless-Mode Service 140
......Asynchronous Connection-Mode Service 141
......Asynchronous Open 143
...Timers 145
......Timestamp Functions 145
......Interval Timer Functions 146

A. Full Code Examples
149

Index
181