Add Book to My BookshelfPurchase This Book Online

Preface -

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

Example Programs
You can obtain the source code for the programs presented in this book from O'Reilly & Associates through their Internet server.
The example programs in this book are available electronically in a number of ways: by FTP, Ftpmail, BITFTP, and UUCP. The cheapest, fastest, and easiest ways are listed first. If you read from the top down, the first one that works for you is probably the best. Use FTP if you are directly on the Internet. Use Ftpmail if you are not on the Internet, but can send and receive electronic mail to Internet sites (this includes CompuServe users). Use BITFTP if you send electronic mail via BITNET. Use UUCP if none of the above works.
FTP
To use FTP, you need a machine with direct access to the Internet. A sample session is shown, with what you should type in boldface.
% ftp ftp.uu.net
Connected to ftp.uu.net.
220 FTP server (Version 6.21 Tue Mar 10 22:09:55 EST 1992) ready.
Name (ftp.uu.net:joe): anonymous
331 Guest login ok, send domain style e-mail address as password.
Password: yourname@domain.name (use your user name and host here)
230 Guest login ok, access restrictions apply.
ftp> cd /published/oreilly/nutshell/sys.prog
250 CWD command successful.
ftp> binary (Very important! You must specify binary transfer for compressed files.)
200 Type set to I.
ftp> get examples.tar.gz
200 PORT command successful.
150 Opening BINARY mode data connection for examples.tar.gz.
226 Transfer complete.
ftp> quit
221 Goodbye.
%
The file is a compressed tar archive; extract the files from the archive by typing:
% gzcat examples.tar.gz | tar xvf -
System V systems require the following tar command instead:
% gzcat examples.tar.gz | tar xof -
If gzcat is not available on your system, use separate gunzip and tar or shar commands.
% gunzip examples.tar.gz
% tar xvf examples.tar
Ftpmail
Ftpmail is a mail server available to anyone who can send electronic mail to and receive it from Internet sites. This includes any company or service provider that allows email connections to the Internet. Here's how you do it.
You send mail to ftpmail@online.oreilly.com. In the message body, give the FTP commands you want to run. The server will run anonymous FTP for you and mail the files back to you. To get a complete help file, send a message with no subject and the single word "help" in the body.
The following is a sample mail session that should get you the examples. This command sends you a listing of the files in the selected directory and the requested example files. The listing is useful if there's a later version of the exam ples you're interested in.
% mail ftpmail@online.oreilly.com
Subject:
reply-to username@domain.name    (Where you want files mailed)
open
cd /published/oreilly/nutshell/sys.prog
mode binary
uuencode
get examples.tar.gz
quit
.
A signature at the end of the message is acceptable as long as it appears after "quit."
BITFTP
BITFTP is a mail server for BITNET users. You send it electronic mail messages requesting files, and it sends you back the files by electronic mail. BITFTP currently serves only users who send it mail from nodes that are directly on BITNET, EARN, or NetNorth. BITFTP is a public service of Princeton University. Here's how it works.
To use BITFTP, send mail containing your ftp commands to BITFTP@PUCC. For a complete help file, send HELP as the message body.The following is the message body you send to BITFTP:
FTP  ftp.uu.net  NETDATA
USER  anonymous
PASS  myname@podunk.edu Put your Internet email address here (not your BITNET address)
CD /published/oreilly/nutshell/sys.prog
DIR
BINARY
GET  examples.tar.gz
QUIT
Once you've got the desired file, follow the directions under FTP to extract the files from the archive. Since you are probably not on a UNIX system, you may need to get versions of uudecode, uncompress, atob, and tar for your system. VMS, DOS, and Mac versions are available.
UUCP
UUCP is standard on virtually all UNIX systems and is available for IBM-compatible PCs and Apple Macintoshes. The examples are available by UUCP via modem from UUNET; UUNET's connect-time charges apply.
You can get the examples from UUNET whether you have an account there or not. If you or your company has an account with UUNET, you have a system some where with a direct UUCP connection to UUNET. Find that system, and type:
uucp uunet\!~/published/oreilly/nutshell/sys.prog/examples.tar.gz
yourhost\!~/yourname/
The backslashes can be omitted if you use the Bourne shell (sh) instead of csh. The file should appear some time later (up to a day or more) in the directory /usr/spool/uucppublic/yourname. If you don't have an account, but would like one so that you can get electronic mail, contact UUNET at 703-204-8000.
It's a good idea to get the file /published/oreilly/ls-lR.Z as a short test file containing the filenames and sizes of all the files available.
Once you've got the desired file, follow the directions under FTP to extract the files from the archive.
Once you've obtained, uncompressed, and extracted the examples distribution, you will have a directory called examples that contains directories for each chapter of the book. Each chapter's directory contains four directories. The common directory contains example programs that work identically across all versions of the operating system discussed in this book, while the hpux, IRIX, and solaris directories contain the example programs that differ slightly between the various operating system versions.
To compile the examples, first change to the examples directory. Then examine or edit one of the Makedefs files as appropriate for your operating system. These files define the name of the compiler to use and the flags to give to it when compiling the examples. When you are finished, simply issue the command ./build-examples.
The examples in this book have been compiled and tested on the platforms shown below:

Hardware
Operating
System

Compiler
Sun SPARCstation LX
Solaris 2.3
GNU C 2.6.3
Sun SPARCstation 5/70
Solaris 2.3
SPARCompiler C 3.0.1
Sun SPARCstation 20/HS12
Solaris 2.4
SPARCompiler C 3.0.1
Sun SPARCstation 5/85
Solaris 2.5
GNU C 2.7.2
Sun SPARCstation 5/85
Solaris 2.5
SPARCompiler C 4.0
HP 9000/819
HP-UX B.10.0
cc
Silicon Graphics IRIS
IRIX 5.3
cc

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback