Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Linux Programmers Guide

Linux Programmers Guide

Ratings: (0)|Views: 12 |Likes:
Published by api-3797737

More info:

Published by: api-3797737 on Oct 17, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

The Linux Programmer\u2019s Guide

Sven Goldt
Sven van der Meer
Scott Burkett
Matt Welsh

Version 0.4
March 1995
0...Our continuing mission: to seek out knowledge of C, to explore strange unix
commands, and to boldly code where no one has man page 4.
2
Contents
1 The Linux operating system
7
2 The Linux kernel
9
3 The Linux libc package
11
4 Systemcalls
13
5 The \u201cswiss army knife\u201d ioctl
15
6 Linux Interprocess Communications
17
6.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

6.2 Half-duplex UNIX Pipes. . . . . . . . . . . . . . . . . . . . . . . . . . .17 6.2.1 BasicConcepts. . . . . . . . . . . . . . . . . . . . . . . . . . . .17 6.2.2 Creating Pipes in C. . . . . . . . . . . . . . . . . . . . . . . . . .19 6.2.3 Pipes the Easy Way!. . . . . . . . . . . . . . . . . . . . . . . . .23 6.2.4 Atomic Operations with Pipes. . . . . . . . . . . . . . . . . . . .27 6.2.5 Notes on half-duplex pipes:. . . . . . . . . . . . . . . . . . . . .27

6.3 Named Pipes (FIFOs - First In First Out). . . . . . . . . . . . . . . . . . .27 6.3.1 BasicConcepts. . . . . . . . . . . . . . . . . . . . . . . . . . . .27 6.3.2 Creating a FIFO. . . . . . . . . . . . . . . . . . . . . . . . . . .27 6.3.3 FIFOOperations. . . . . . . . . . . . . . . . . . . . . . . . . . .28 6.3.4 Blocking Actions on a FIFO. . . . . . . . . . . . . . . . . . . . .30 6.3.5 The Infamous SIGPIPE Signal. . . . . . . . . . . . . . . . . . . .30

6.4 System V IPC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 6.4.1 FundamentalConcepts. . . . . . . . . . . . . . . . . . . . . . . .30 6.4.2 MessageQueues. . . . . . . . . . . . . . . . . . . . . . . . . . .32 6.4.3 Semaphores. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 6.4.4 SharedMemory. . . . . . . . . . . . . . . . . . . . . . . . . . . .62

7 SoundProgramming
69
7.1 Programming the internal speaker. . . . . . . . . . . . . . . . . . . . . .69
7.2 Programming a sound card. . . . . . . . . . . . . . . . . . . . . . . . . .69
8 Character Cell Graphics
71

8.1 I/O Function in libc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.1.1 FormattedOutput. . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.1.2 FormattedInput. . . . . . . . . . . . . . . . . . . . . . . . . . . .73

8.2 The Termcap Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 8.2.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 8.2.2 Find a Terminal Description. . . . . . . . . . . . . . . . . . . . .75 8.2.3 Look at a Terminal Description. . . . . . . . . . . . . . . . . . .75 8.2.4 TermcapCapabilities. . . . . . . . . . . . . . . . . . . . . . . . .76

3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->