... GNU /Linux system.
D.1 General Information
n
http://www.advancedlinuxprogramming.com is this book’s home on the
Internet. Here, you can download the full text of this book and program source
code, ... information about pro-
gramming GNU /Linux. The same information can also be found at
http://www.newriders.com.
n
http://www.linuxdoc.org is the home of the Linux Documentation Project.
This...
... connection to a WWW server at www.codesourcery.com, use
telnet www.codesourcery.com 80.The magic constant 80 specifies a connection to
the Web server programming running www.codesourcery.com instead ... other processes.
If you don’t specify this flag, Linux may buffer writes before transferring them to
the file.
Alternatively, you can force Linux to incorporate buffered writes into the...
... file
/usr/src /linux/ arch/i386/kernel/process.s provides another example, using hlt in
idle loop code. See other Linux source code files in /usr/src /linux/ arch/ and
/usr/src /linux/ drivers/.
Assembly ... function call with a single
fsin assembly instruction.
11 0430 CH09 5/22/01 10:36 AM Page 189
190
Chapter 9 Inline Assembly Code
Observe that unlike ordinary assembly code...
... file named
gmon.out, only for those portions of the code that are exer-
cised.You must vary the program’s input or commands to exercise the code sections
that you want to profile.The program must ... 277
Other Development Tools
A
DEVELOPING CORRECT, FAST C OR C++ GNU /LINUX PROGRAMS requires more
than just understanding the GNU /Linux operating system and its system calls. In this
appe...
... I/O
B
CPROGRAMMERS ON GNU /LINUX HAVE TWO SETS OF INPUT/OUTPUT functions at
their disposal.The standard C library provides I/O functions: printf, fopen, and so
on.
1
The Linux kernel itself provides ... descriptor may cause Linux to take a particular action, depending on
the nature of the file descriptor. For example, when you close a file descriptor for a
network socket, Linux closes...
... following:
% man 7 signal
Table C.1 Linux Signals
Name Description
SIGHUP Linux sends a process this signal when it becomes disconnected
from a terminal. Many Linux programs use
SIGHUP for an ... in
/usr/include/sys/signum.h, which is included as part of <signal.h>.
For a full list of Linux signals, including a short description of each and the default
behavior when the signal...
... b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules ... object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source code
from the same place counts as distribution of the source cod...
... using.
1.5.4 Source Code
This is Open Source, right? The final arbiter of how the system works is the system
source code itself, and luckily for Linux programmers, that source code is freely avail-
able. ... C library source code.
02 0430 CH01 5/22/01 10:19 AM Page 15
02 0430 CH01 5/22/01 10:19 AM Page 16
Advanced UNIX Programming
with Linux
I
1 Getting Started
2 Writing Good GN...
... */
fprintf (stderr, “%s\n”, strerror (error _code) );
exit (1);
default:
/* Some other, unexpected, error code. We’ve tried to handle all
possible error codes; if we’ve missed one, that’s a bug! ... GNU /Linux system in certain ways. GNU/
Linux provides other ways for interacting with the operating environment, too.
03 0430 CH02 5/22/01 10:20 AM Page 17
36
Chapter 2 Writing Good GNU /Linu...