Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Advanced Unix Programming, 2nd Ed.

timothy posted more than 10 years ago | from the heavy-eyelids-heavy-lifting dept.

Unix 143

prostoalex writes "Advanced Unix Programming by Marc Rochkind is published by Addison-Wesley this year in its second edition. A book that has been considered a timeless classic, a title that saw its first edition back in 1985 and its second edition almost two decades later, in 2004. Where do you even start to review?" Read on below to see read prostoalex's evaluation.

Advanced Unix Programming (AUP) has been updated to include information relevant to Solaris, Linux, FreeBSD, Darwin and Mac OS X. Rochkind has added more than 200 system calls, according to the preface. But who is the book for?

First off, if you look at the table of contents, you will find that AUP is largely a book on input-output in Unix operating systems. The input-output varies from Basic (Chapter 2) and Advanced (Chapter 3) File I/O to Interprocess Communications (Chapters 6, 7), Network I/O (Chapter 8) and Terminal I/O (Chapter 4). The rest of the book consists of purely informational chapters on fundamental concepts of Unix operating systems (Chapter 1), working with threads and processes (Chapter 5) and signals and timers (Chapter 9).

If you get the impression that this is an academic title, you're not mistaken - if your university has some kind of Advanced Unix/Linux or Unix Networking course, they probably use some AUP material. Note that the book is not a how-to or manual on setting up Apache, Samba, FTP, various filesystems or Jabber servers - it does have a chapter on networking but teaches Unix I/O concepts from developer's perspective only, meaning you have to know C and C++. If you prefer to look at the source code, it's on the author's Web site.

There are two types of readers for AUP: those who start off programming in Unix/Linux, and those who are quite good at it, have read the first edition and are now wondering whether the second one is worth it.

If you are just starting with programming in Unix/Linux environment, don't let the word "Advanced" scare you off. The first chapter is pretty good in getting the reader up to speed with the concepts discussed in the book. It talks about such common tasks as getting the system to tell you what it has in terms of POSIX, getting a Unix box to tell you the date and time inside a C++ application, and counting your app's execution time. In many aspects, the second half of each chapter falls under O'Reilly cookbook format, where you are given a certain task and then provided the source code and explanations of what needs to be done to accomplish the task.

The author also "falls" into the trap of using some quick solutions only to "discover" that they do not work on all the systems. For example, subchapter 3.6.1 Reading Directories first tries to access the contents of the directory via ec_neg (fd = open (".", O_RDONLY) and ec_neg (nread = read (fd, buffer, sizeof(buffer))) only to find out that under Linux the call retrieves unhelpful "*** EISDIR (21: "Is a directory") ***" message. After that we are introduced into proper, not quick and dirty ways, to access Unix directories via opendir(), closedir() and readdir().

From experience, it looks like most of the people I know who own a copy of the first edition of AUP bought it because of its section on Interprocess Communications. The author does indeed provide a great learning and reference resource when in Chapter 5 he takes the reader through Unix processes and threads, explains how fork() works. The simple pop quizzes are there as well. A way to win friends and amuse the opposite sex during watercooler talks is to offer the following example:

void forktest (void)
{
int pid;
printf ("Start of test.\n");
pid = fork();
printf ("Returned %d.\n", pid);
}

Run this example as forktest and you will get a message:

Start of test.

Returned 11111.
Returned 0.

Run this test as forktest > tmp and suddenly the message in tmp file changes:

Start of test.

Returned 22222.
Start of test.
Returned 0.

Why is "Start of test" printed twice in the second example? Warning: the book contains an early spoiler in 5.5 fork System Call

By this point, you probably wonder whether the code examples will work on your system. The author tested the code on Solaris 8, SuSE Linux 8, FreeBSD 4.6 and Darwin (Mac OS X kernel) 6.8. In the preface, he talks about using a Windows box with SSH client to upload the code to the destination systems and run them there.

The book is very convenient to read; the chapter numbering system always gives you a good feel of where you are at. As reading of the entire book is not required, and a lot of people use AUP as a reference, an index containing just functions and system calls is included in Appendix D. Don't know what tcgetpgrp() does? The index will point you to 4.3.4. All the code is printed in monospace font, so it's quite easy to differentiate from the regular text. All the function definitions are boxed with function name, description and signature provided. The signature itself contains comments on what the parameter represents. They also are not saving whitespace on function samples, using the style where each line of source code and each { gets a separate line in text. Overall, more than 1100 functions are covered.

The book is quite practical, too, so don't think of it as pure API rehash. For example, in 8.4.3 (the chapter 8 deals with Networking), you are given the source code for a text-based browser that's written in less than 50 lines of code (although it doesn't quite understand HTML and just dumps everything to standard output).

Overall, if any part of your job description or hobby list includes Unix/Linux development, especially if it's high on that list, this book is a must have. Moreover, looking at the job market defined by keyword "unix", it looks like half the positions include some kind of "Sr." or "Architect" or "Networking" attribute, for which the knowledge provided in AUP would be indispensable.


You can purchase Advanced Unix Programming, 2nd Ed. from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, carefully read the book review guidelines, then visit the submission page.

cancel ×

143 comments

GNAA Early Post (-1, Troll)

GNAA Goat-See (775677) | more than 10 years ago | (#9012373)

GNAA DOMINATES TROLLYMPICS GNAA DOMINATES TROLLYMPICS
Horatio Brunswick - Gnaa, Nigeria.
Speaking to a hushed crowd from the heights of a ceremonial golden minaret hastily erected on the main lawn of the lush GNAA (GAY NIGGER ASSOCIATION OF AMERICA) estate this morning, chief GNAA spokesman l0de triumphantly announced near-total victory for the Gay Nigger Association of America in the 103rd Trollympics [redhat.com] .

"Citizens, never before have you been trolled so hard. You have lost, as none have lost, and as none may ever lose again. Today was truly the nicest day. Doom awaits you all."

A deafening roar of cheering and celebratory gunfire met the announcement, followed by a rare smile from enigmatically taciturn l0de, which has been interpreted by Top Gay Nigger Analists as owing as much to his own two medal haul as his customarily heroic intake of fortified wine. Following the smile, increased cumsumer confidence drove the GNIA (Gay Nigger Incestual Average) over the 15,000 mark, once thought to be unattainable. L0de then read the names of the medal winning trolls, (Which have been reproduced here, sans incomprehensible slurs and racial epithets) and delivered his already-infamous "skeet heard round the world" keynote address, finishing with a scream of "LAST MEASURE" and plummeting nearly 70 feet from the minaret into the crowd below. His current whereabouts are unknown.

GOLD MEDALISTS OF THE 103rd WORLD TROLLYMPIAD

RKZ, GNAA, Silver, Popup blocker breaking
Bare, GNAA, Gold, Ban Evade
Bare GNAA, Gold, DiKKy 4 hour flood
Rolloffle, GNAA, Gold, 100 Minute Proxy Whore
JesuitX, GNAA, Golden Goatse, AOL tech support mental breakdown (Punjabi Circuit). New world record
JesuitX, GNAA, Golden Goatse, Trolling Song or Anthem
Goat-see, GNAA, Golden Goatse, Popup blocker breaking
Penisbird + Rollofflle, GNAA, Golden Goatse, 3000 comment tandem crapflood
DiKKy, GNAA|ITL, Gold, 500 meter OMGWTF
DiKKy, GNAA|ITL, Golden Goatse, 5 minute channel jupe
Toil, GNAA|ITL, Gold, 500 Momfuck server delink
L0de, GNAA|T4C|LRH, Golden Goatse, Troll Radio Show
L0de, GNAA|T4C|LRH, Gold, Metatroll
Sarojin, T4C, Bronze Boner, CUMFUSING FRIST POST
Peccavi, T4C, Bronze Boner, 100m FYAD FYAD LOL
Feerit, T4C, Silver, Badabababa Junktouch
Klerck, T4C, Golden Goatse, 400 foot wide page
QPT, Non-affliated, Gold, 5 day forum ghost-town
QPT, Non-affliated, Gold, G-line
Impi, Non-affliated, (medal confiscated with highest honors), OMG WALLHAX NOOB

About GNAA:
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the first organization which
gathers GAY NIGGERS from all over America and abroad for one common goal - being GAY NIGGERS.

Are you GAY [klerck.org] ?
Are you a NIGGER [mugshots.org] ?
Are you a GAY NIGGER [gay-sex-access.com] ?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!
Join GNAA (GAY NIGGER ASSOCIATION OF AMERICA) today, and enjoy all the benefits of being a full-time GNAA member.
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the fastest-growing GAY NIGGER community with THOUSANDS of members all over United States of America. You, too, can be a part of GNAA if you join today!

Why not? It's quick and easy - only 3 simple steps!

First, you have to obtain a copy of GAY NIGGERS FROM OUTER SPACE THE MOVIE [imdb.com] and watch it. (You can download the movie (~280mb) using BitTorrent, by clicking here [idge.net] .

Second, you need to succeed in posting a GNAA "first post" on slashdot.org [slashdot.org] , a popular "news for trolls" website

Third, you need to join the official GNAA irc channel #GNAA on irc.gnaa.us, and apply for membership.
Talk to one of the ops or any of the other members in the channel to sign up today!

If you are having trouble locating #GNAA, the official GAY NIGGER ASSOCIATION OF AMERICA irc channel, you might be on a wrong irc network. The correct network is Niggernet, and you can connect to irc.gnaa.us as our official server. If you do not have an IRC client handy, you are free to use the GNAA Java IRC client by clicking here [nero-online.org] .


If you have mod points and would like to support GNAA, please moderate this post up.

.________________________________________________. fucking
| ______________________________________._a,____ | CmdrTaco
| _______a_._______a_______aj#0s_____aWY!400.___ | will
| __ad#7!!*P____a.d#0a____#!-_#0i___.#!__W#0#___ | he ever learn that
| _j#'_.00#,___4#dP_"#,__j#,__0#Wi___*00P!_"#L,_ | GNAA is totally
| _"#ga#9!01___"#01__40,_"4Lj#!_4#g_________"01_ | unstoppable? Teamed
| ________"#,___*@`__-N#____`___-!^_____________ | up with the other troll groups,
| _________#1__________?________________________ | GNAA will absolutely own
| _________j1___________________________________ | the shitty place that is slashdot.
| ____a,___jk_GAY_NIGGER_ASSOCIATION_OF_AMERICA_ | Just remember, the longer the lines are,
| ____!4yaa#l___________________________________ | the smaller CmdrTaco's penis.
| ______-"!^____________________________________ | This logo is (C) 2003, 2004 GNAA [idge.net]
` _______________________________________________'

(C) GNAA 2004


Re:GNAA Early Post (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012442)

??????

wha

Re:GNAA Early Post (-1, Troll)

Anonymous Coward | more than 10 years ago | (#9012549)

Gnaa, Nigeria


Priceless.

MOD PARENT INFORMATIVE (-1, Troll)

Anonymous Coward | more than 10 years ago | (#9012792)

Gnaa, Nigeria exists.

Check this [calle.com]

Re:MOD PARENT INFORMATIVE (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#9012816)

I vote that the GNAA adopts that Niggerian town as a refuge.

No mention of VB huh? (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012381)

No use to me.

TTFN

ZING! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012382)

Suck a Boot!

BOOK REVIEWS on /. (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012413)

HOW TO GET SOME SKANK ON YOUR CRANK
by CmdrTaco

Chapter 1 - Find a girl so fugly nobody else wants to marry her.
Chapter 2 - Marry her & put your pee sprout in her slime hole.
Chapter 3 - Discover you're really a gay homsexual
Chapter 4 - Give head to young boys at highway rest stops.
Chapter 5 - Post dupe stories on slashdot.
Epilogue - Can I suck your dick?

slashdotted already? (2, Informative)

spangineer (764167) | more than 10 years ago | (#9012421)

Well, I'm having trouble getting to the link, so here's the amazon.com page (not a referral link):

Advanced Unix Programming [amazon.com] They have 27 used copies, and the book's gotten high reviews.

Re:slashdotted already? (5, Informative)

spangineer (764167) | more than 10 years ago | (#9012452)

Sorry, that's 27 copies of the 1st edition, the second ed. obviously doesn't because it just came out 6 days ago. The link for the second ed. is:

Advanced Unix Programming [amazon.com] .

Does does it print twice? (5, Informative)

kyz (225372) | more than 10 years ago | (#9012422)

Because the first printf was automatically flushed after the newline, because it's going to a terminal. Some stdio implementations are like that.

It wasn't flushed in the second example, it would only write out data once there was a full buffer's worth (e.g. 32kb or such), or when the stream was closed. Because it wasn't flushed, both fork()ed copies had this unflushed data in their buffer and both printed it.

I'm sure it scares a few newbies, but it's fairly obvious.

Re:Does does it print twice? (5, Informative)

pclminion (145572) | more than 10 years ago | (#9012560)

If you want the line buffered behavior even when outputting to non-terminal devices, without having to explicitly call fflush() after every line, you can force the stdout stream into line buffered mode like this:

setvbuf(stdout, NULL, _IOLBF, 0);

You must do this before you use stdout in any way.

Terminal I/O? (5, Funny)

Not The Real Me (538784) | more than 10 years ago | (#9012429)

That chapter alone tells me to avoid this book like the plague.

Re:Terminal I/O? (1, Informative)

NickDngr (561211) | more than 10 years ago | (#9012501)

Believe it or not, some of us still use terminals. Sometimes it is an efficient way to work with a system.

Re:Terminal I/O? (0, Redundant)

Anonymous Coward | more than 10 years ago | (#9012617)

All of us still use terminals. Your Linux/*BSD/Solaris/OSX consoles are terminals. Your xterm windows are terminals.

Re:Terminal I/O? (0)

Anonymous Coward | more than 10 years ago | (#9013912)

You both fail it. It was a joke. Think about it, carefully.

Re:Terminal I/O? (2, Funny)

TheAmazingRando (324343) | more than 10 years ago | (#9014503)

Where's "-1, Didn't get the joke" ?

Re:Terminal I/O? (3, Funny)

Carnildo (712617) | more than 10 years ago | (#9012759)

Actually, I think terminal I/O would be a very useful thing. I'd love to be able to release a program that, when run by my enemies, would terminate them, preferably with extreme prejudice.

Re:Terminal I/O? (3, Funny)

Pike65 (454932) | more than 10 years ago | (#9013049)

Yeah, that stuff'll be the death of you.

Re:Terminal I/O? (1)

neurojab (15737) | more than 10 years ago | (#9014220)

Perhaps "terminal I/O" refers to virtual terminals as well (Xterm, eTerm, RXVT, the Linux console), etc.. .?

Perhaps I'm in the minority, but the vast majority of applications I use in Linux are console apps. They're simply more efficient and easier to work with than "point and click" GUI apps. You definately need to know how to program console apps to call yourself a master UNIX programmer.

Re:Terminal I/O? (1)

neurojab (15737) | more than 10 years ago | (#9014238)

Yes, I know the parent post was supposed to be a joke.

Good UNIX Reference (3, Informative)

mcx101 (724235) | more than 10 years ago | (#9012434)

I spotted the first edition of this book in my university library when I was doing some coding on FreeBSD. Whilst it didn't have anything specific to FreeBSD it was still a handy reference. I look forward to reading the additions in this version. Perhaps I'll get the university library to order it for me ;-)

Re:Good UNIX Reference (2, Funny)

Anonymous Coward | more than 10 years ago | (#9012498)

Nice sig you fu~1

Re:Good UNIX Reference (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#9012556)

We don't like *BSD wankers here so why don't you just fu~1 off.

Re:Good UNIX Reference (-1, Redundant)

Anonymous Coward | more than 10 years ago | (#9012571)

Pound sand, limey.

Re:Good UNIX Reference (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012584)

SUCK MY PUCKERED ANUS.

*NIX (1)

trick-knee (645386) | more than 10 years ago | (#9012444)

okay, I'm not *trying* to troll, but, what with SCO, I'd've thought that they'd do more to separate themselves from UNIX(r).

Re:*NIX (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012459)

A hand in the pants is worth 2 in the bush.

Re:*NIX (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9012783)

You've got that backwards. A hand in the bush is worth two in the pants. Unless you are a fag.

Re:*NIX (5, Informative)

mcx101 (724235) | more than 10 years ago | (#9012485)

Don't forget though that UNIX is a registered trademark of The Open Group, so even though SCO has (claims to have?) the rights to the UNIX source code they don't own the name.

Re:*NIX (1)

DaHat (247651) | more than 10 years ago | (#9012490)

For the most part, far from it. Granted some Linux users may have gone to alternative systems, the non Linux *NIX is still going quite strong.

Re:*NIX (2, Interesting)

ydrol (626558) | more than 10 years ago | (#9013221)

Especially as most GNU / GPL / Open /BSD stuff runs on *NIX anyway (often even before it ran on Linux)

In the corporate server market savings on Linux are minimal compared to Sun etc because of two things:

1. Server quality x86 boxes for hosting business critical applications can cost as much as Sun / HP Boxes. So no real hardware savings that justify the "risk".

2. Most companies do not have /dedicated/ Linux admin support skills and need to outsource some degree of support in order to provide that support level themselves. So no real support savings.

3. In some environments a lot of applications (that you may in turn be depending on) are supported on recent flavours of Unix but only on a particular Linux Distro ( and usually an old one given Linux release cycles) say Redhat 7.2. I suspect this is changing (especially as Linux distros are EOLing their releases a lot faster) but companies may not see potential ROI in testing against recent (not latest) releases of every major distro.

So whilst it may be good to have at home, or even in the Web Farm (where all required apps required are often better supported on Linux) there is still a lot of demand of *NIX - and in turn a lot of integration work with APIs of applications best supported (by their vendors) on *NIX.

Also the cowards argument - If the target platforn is *NIX, no one gets sacked for choosing Solaris. If it goes pear shaped it wasnt your fault :)

opendir() (0, Redundant)

hey (83763) | more than 10 years ago | (#9012457)

So you use opendir() to read a directory!
Who knew?!

Re:opendir() (1)

happyfrogcow (708359) | more than 10 years ago | (#9012528)

my programs don't open directories, you insensitive clod!

% ls -1 *foo | ./my_program

opendir() is a new feature (2, Informative)

Albert Cahalan (761500) | more than 10 years ago | (#9013251)

The old way was to call open() on the directory,
then simply use read() to get an array of structs.
Each struct had a 16-bit inode number and a
14-character filename.

Linux broke support for this, because 32-bit inode
numbers and 255-character filenames would not fit.
Linux would get stuck with DOS-style name mangling
and some sort of inode remapping. Like this:

Linux_i~1.html

(but hey, 14 characters beats 8.3 style names)

Re:opendir() is a new feature (0)

Anonymous Coward | more than 10 years ago | (#9013751)


Linux broke support for this, because 32-bit inode
numbers and 255-character filenames would not fit.
Linux would get stuck with DOS-style name mangling
and some sort of inode remapping. Like this:


Not true, asswipe.
Linux was not the first *nix to break support for ths.
Using open/read on dirs has never never been portable.

Shitface. Get your facts straight.

Re:opendir() is a new feature (1)

Albert Cahalan (761500) | more than 10 years ago | (#9013881)

ROTFLMAO

Did I ever say Linux was the first? Linux did
support read() on directories long ago though,
as did many other systems around 1990.

It was portable until Berkeley invented FFS.

Interesting change of pace... (5, Funny)

eidechse (472174) | more than 10 years ago | (#9012464)

...in twenty years every other programming book I have will be in it's 123rd edition.

Marc vs. Stevens (4, Interesting)

jonfelder (669529) | more than 10 years ago | (#9012473)

I wonder how well Marc holds up against Stevens.

It's very unfortunate Stevens died so young, his books including "Advanced Unix Programming" are extraordinary.

Re:Marc vs. Stevens (3, Interesting)

eschasi (252157) | more than 10 years ago | (#9012590)

Hear, hear. Rochkind is good, but has neither the breadth nor depth of Stevens. It's a damned shame that there's apparently no-one with Stevens' dual skills in programming and writing who can take up his mantle. The review above, while generally complimentary, doesn't sound like Rochkind can replace Stevens.

And I fondly remember MTS, too.

Re:Marc vs. Stevens (0)

Anonymous Coward | more than 10 years ago | (#9013256)

Rochkind is an excellent writer. IMHO more
entertaining and engaging than Stevens ever
was.

But a comparison is a little unfair. Rochkind
deals with Unix whereas Stevens has a strong
networking bent.

Re:Marc vs. Stevens (4, Interesting)

Ankh (19084) | more than 10 years ago | (#9013265)

On the whole I'd say Marc Rochkind is actually a better writer - it's a lot harder to write a thin book on a topic and still have it be this useful.

If you're working in C (or C++ I suppose, Oh you youngsters!) on and form of Unix, you probably already have the first edition, or at least have read it. If not, go and get it (or this second edition). Along with The Unix Programming Environment, it's one of the classic texts that's not too large to read, but too useful to skip.

Liam

Re:Marc vs. Stevens (4, Informative)

hitchhacker (122525) | more than 10 years ago | (#9012724)

"Advanced Unix Programming"

I believe you mean:
"Advanced Programming in the UNIX Environment" [barnesandnoble.com]

His "TCP/IP Illustrated" volumes 1-3 are also great.
I havn't read AUP, so I can't compare him to Stevens.

-metric

Re:Marc vs. Stevens (1)

bobsled (70901) | more than 10 years ago | (#9012729)

It is unfortunate - I keep a copy on my desk (actually had two copies before I realized one order was just really late!).

But he (Stevens) wrote Advanced Programming in the Unix Environment (APUE), not Advanced Unix Programming...I can see buying AUP and getting myself thouroughly confused..."Hand me that copy of APUE, er, AUP, um, the one with the RED stripe on the cover!!!"

I find it strange Addison-Wesley doesn't include Unix Network Programming Vol 2 (IPC) in its "Professional Computing Series" [awprofessional.com] ...APUE, UNP Vol 1 AND 2 are rarely far away.

Copyright infringement (5, Funny)

sdjunky (586961) | more than 10 years ago | (#9012479)

You stole the following code from SCO did you not?

void forktest (void)
{
int pid;
printf ("Start of test.\n");
pid = fork();
printf ("Returned %d.\n", pid);
}

I'm certain you did. It's code and it can be used in Unix so it belongs to SCO.

Re:Copyright infringement (0)

Anonymous Coward | more than 10 years ago | (#9012576)

You stole the following code from SCO did you not?

void forktest (void)
{
int pid;
printf ("Start of test.\n");
pid = fork();
printf ("Returned %d.\n", pid);
}

I'm certain you did. It's code and it can be used in Unix so it belongs to SCO.


Arrrggh! You copied and pasted it too, so your guilty too! Will it never end?

Uh-oh...I think I'm in the same boat....

Re:Copyright infringement (1)

sdjunky (586961) | more than 10 years ago | (#9012782)


Copyright infringement is a vicious cycle. Anonymous, let us create a support group. We'll start by licensing the code from SCO.

Obvious question (4, Insightful)

Florian Weimer (88405) | more than 10 years ago | (#9012510)

How does it compare to APUE?

Re:Obvious question (1, Funny)

Anonymous Coward | more than 10 years ago | (#9012603)

Go to the Quik-E-Mart and see for yourself.

Re:Obvious question (1)

IWannaBeAnAC (653701) | more than 10 years ago | (#9012689)

Leading question. I hope some gurus answer. I was planning to buy APUE, and I want to know!

Re:Obvious question (3, Interesting)

khuber (5664) | more than 10 years ago | (#9012817)

AUP is Unix for newbies.

Buy APUE and Unix Network Programming volumes 1 and 2 all by Stevens if you're serious.

Re:Obvious question (0)

Anonymous Coward | more than 10 years ago | (#9013252)

I bought APUE a few years back, and everything listed here is covered there as well. I wouldn't get both books. I can't speak to the quality of this book but APUE is a priceless tome. My programming knowledge and understanding of the nuts and bolts went from amateur to marketable solely due to Mr. Stevens.

APUE: great quality, but showing age (3, Insightful)

Albert Cahalan (761500) | more than 10 years ago | (#9013313)

I don't think this new book can compare.
There's just something wrong with trying
to write a UNIX book while running Windows.
Stevens wrote APUE with *roff macros! FYI,
that beats TeX for nerd value.

Problem is, APUE is getting obsolete. :-(

Excellent Reference (4, Informative)

muppetsrule (734214) | more than 10 years ago | (#9012564)

I have used this book for the past few years mostly as a reference for some of the really hairy stuff/problems that I have sometimes run into.

It belongs on my bookshelf right along with my Unix Network Programming books (Richard Stevens auth).

Um... (4, Funny)

GoNINzo (32266) | more than 10 years ago | (#9012616)

If they were true programers, wouldn't this be the 1st edition? Cause if you start counting at 0...

Or would that be the 10th edition?

Re:Um... (1)

aled (228417) | more than 10 years ago | (#9012687)

A Real Programmer wouldn't waste two chars for one number, and not even one if already knows the number.

Re:Um... (5, Funny)

pclminion (145572) | more than 10 years ago | (#9012930)

Or would that be the 10th edition?

You should call it the 10nd edition. It confuses people better that way.

Re:Um... (1)

eviltypeguy (521224) | more than 10 years ago | (#9014319)

You know, there are 10 kinds of people in this world. Those who understand binary and those who do not.

Re:Um... (1)

rice_burners_suck (243660) | more than 10 years ago | (#9013172)

Or would that be the 10th edition?

Uh, no, that would be the 10nd Edition.

Re:Um... (1)

Frizzle Fry (149026) | more than 10 years ago | (#9014089)

Unless this has a large focus on Linux programming, in which case it would probably be something like the 0.011th edition.

Oh Joy! (5, Funny)

Sloh_One (756526) | more than 10 years ago | (#9012630)

Can't wait to buy this book, go home, and snuggle up to the cozy fire with my Advanced Unix Progamming book 2nd edition.

Re:Oh Joy! (1)

Dingeaux (768490) | more than 10 years ago | (#9014376)

Can I assume you'll be using the 1st edition as kindling for the fire?

SAMBA 2.2 to SAMBA 3.0 - what they didnt tell you (-1, Offtopic)

stratjakt (596332) | more than 10 years ago | (#9012635)

3.0 installs smbd/nmbd in /usr/local/samba/sbin

2.2 installed them in /usr/local/samba/bin

Now make install renames old binaries with .old, so you can do make revert.

But, since the binaries are in a wholly different spot, it doesnt matter.

Your samba init script, or inetd.conf no doubt are configured to run from bin. So you'll be endlessly scouring google, running testparm - and getting no errors, running smbd in debug mode - getting no errors, but when the system launches, you'll get errors out the asshole in your log and wont know why!

so do this:
rm -rf /usr/local/samba/sbin /usr/local/samba/bin ./configure
make
make install

test test test test test scream

buy Windows Server 2003

Thank you, that is all.

Re:SAMBA 2.2 to SAMBA 3.0 - what they didnt tell y (0, Offtopic)

stratjakt (596332) | more than 10 years ago | (#9012726)

psst..

Thats offtopic, but not flamebait.

10 bucks says others are struggling with the same fuckin thing.

Oh, and as for IDEALX's LDAP user webmin module, when you configure it and it asks for the "LDAP Admin Username", it wants the fully qualified dn, like "uid=cmdrtaco,ou=homos,dc=slashdot,dc=org".

Of course, like all useful linux utilities, there's absolutely no documentation about it. Now some other dork can benefit from my hours of trial-and-error.

But yay me, after a week of cussing, I know have a half-assed functional equivalent of a 10 year old server technology that MSFT abandoned!

Who needs krb5 and ldap when you got flatfiles and MSRPC, right?

And THAT's advanced unix programming, folks.

Re:SAMBA 2.2 to SAMBA 3.0 - what they didnt tell y (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#9012770)

Who the fuck are you talking to? None of your posts have any relevant content. It seems your posts are the equivalent of public masturbation. You sir, can rightfully claim the title of "Slashdot village idiot."

POSIX Reference (5, Informative)

the frizz (242326) | more than 10 years ago | (#9012653)

AUP really is a classic. I may buy it just for sentimental reasons, even though I don't need the tutorial introducton to Unix anymore.

Nowdays though, my definitive reference for writing portable unix programs is the merged IEEE POSIX and Open groups's Single Unix Specification [opengroup.org] . Registration is free.

worth getting? (1)

rylics (775688) | more than 10 years ago | (#9012657)

So would this book be worth getting if I already own Stevens' APUE

Opening the source is bad for *nix (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#9012711)

Every day, the GPL zealots resemble the Mafia more and more. "Releasing the source" is akin to paying the protection money, so you don't get your legs broken. When will you people learn that strong-arm tactics are no way to garner acceptance in the business world? Demanding the source code for everything under the sun is going to give Linux a bad name among those of us that embrace capitalism.

First Edition? (5, Funny)

WwWonka (545303) | more than 10 years ago | (#9012733)

A book that has been considered a timeless classic,

I am an avid book collector who has appeared on "Antique Roadshow" and "Cover to Cover Classics". I consider myself an authority in this matter. I have touched original Guttenberg bibles, been in the presence of the "War and Peace" transcripts, thumbed through the notes of DaVinci...but never, and I mean never, have I stumbled across this true classic! Ebay, Sothebys, 7 Mile Fair in Racine, Wisconsin...NO WHERE have I been able to zero in on this rareity.

I will gladly sacrifice a small fortune to be in same vicinity as this timeless classic known by a few rare collectors as "Advanced Unix Programming, 1st Edition." Extra if it is bound by that cool shiny metal spirally stuff.

Unix programming reference... (1, Insightful)

192939495969798999 (58312) | more than 10 years ago | (#9012745)

With UNIX having been around so long, I wonder how close we are to having a book of just varieties of implementations of "ls", since there are so many hundreds of UNIX scripts, scripters, etc.

Re:Unix programming reference... (1)

mcx101 (724235) | more than 10 years ago | (#9012840)

There has been a huge amount of variation between UNIX implementations, but in more recent times standards like POSIX [pasc.org] have emerged.

What!? (2, Insightful)

stratjakt (596332) | more than 10 years ago | (#9012820)

The author tested the code on Solaris 8, SuSE Linux 8, FreeBSD 4.6 and Darwin (Mac OS X kernel) 6.8. In the preface, he talks about using a Windows box with SSH client to upload the code to the destination systems and run them there.

No testing - or even discussion - under cygwin, MS's native POSIX subsystem, linux-on-windows or MS's unix services for windows?

People need to develop for unix - for windows. All those killer win32 apps end up unix compatible, and future migrations are a snap once you tell your pointy haired boss that his favorite solitaire program is really a unix application running through a compatiblity layer.

So there ya go.

Seriously though, why do people ignore such things? The future is in hybrid systems. Your OS prejudices be damned.

Re:What!? (0)

Anonymous Coward | more than 10 years ago | (#9012885)

Your OS prejudices be damned.

LOL. This from a known MS troll.

Fork() (2, Funny)

nate nice (672391) | more than 10 years ago | (#9012870)

I had an operating systems class and in it we had a discussion section where we learned various types of system calls, such as forking, mutexes, pipes etc. Our TA for the discussion was an asian grad student and when we learned about fork() he pronounced it "fuck()". It was great learning what happens when you instruct your program to "fuck()". Needless to say, all you would hear was held back laughter from the entire class. For some reason, it never got old, he always found new ways to make "fuck()" really, really funny

Re:Fork() (0)

Anonymous Coward | more than 10 years ago | (#9013426)

If you fork() a process you get a child and a parent process, but where is the other parent?

So you fuck() yourself and get a child :-)

Re:Fork() (1)

mslinux (570958) | more than 10 years ago | (#9013820)

Reminds me of a Chinese place a friend and mine use to eat at. The waitresses would always ask, "You wanna fork?" Naturally, it sounded like fuck instead of fork.

italo (0)

Anonymous Coward | more than 10 years ago | (#9013894)

italo160.mp3 [loki.ws]

Where to start a review (0)

Anonymous Coward | more than 10 years ago | (#9012944)

Where do you even start to review?

Um, page 1?

Water cooler? (1)

Bill, Shooter of Bul (629286) | more than 10 years ago | (#9013077)

A way to win friends and amuse the opposite sex during watercooler talks is to offer the following example:

I don't think any of the opposite sex will be amused. In fact, I seriously doubt it.

Re:Water cooler? (1)

cachorro (576097) | more than 10 years ago | (#9013797)

I don't think any of the opposite sex will be amused.

Au contraire!

They may not be particularly interested, but I am certain that they will be amused, although they will probably wait for you to leave before ROTFLTAO at what a geek you are.

Or maybe it's just me...

File handle passing (2, Informative)

Nate Eldredge (133418) | more than 10 years ago | (#9013132)

They leave out my favorite example of an advanced Unix programming technique, which is file handle passing. You can actually pass an open file handle from one unrelated process to another.

Sure, it's easy to have two processes open the same file. If it's something like a pipe that exists anonymously, you can still give it to a child process by having it open when you fork. But to pass it to a process that isn't a child? Tougher, but not, surprisingly, impossible. (It involves Unix domain sockets, of all things.)

I generally don't find too many people that know about this, but it can be very useful on occasion. I think it definitely qualifies as an important technique, and the fact that this book doesn't appear to mention it is a strike against it. (Stevens discusses the topic, of course.)

Looking for other good UNIX programming books (1)

gsfx (398367) | more than 10 years ago | (#9013142)

I'm looking for good UNIX programming books that don't hide the ugly reality of porting between different Unix systems. Including shared libraries, threads and siganls, etc.

damn, I just purchased this a year or so ago (0)

JDizzy (85499) | more than 10 years ago | (#9013244)

Now I'm stuck with an older version of the book. Guess maybe I can sell it on Amazon to some tard, but what tard would actually buy the first edition? Guess I'm the tard with an old programming book. Damn it!

I'm Buying It (1)

Greyfox (87712) | more than 10 years ago | (#9013308)

I have the first edition and it turned out to be an invaluable (if occassionally outdated) resource in many of the C programming positions I've held. If you program in C on UNIX, you should own this book!

a true classic (3, Interesting)

emmelaich (467112) | more than 10 years ago | (#9013391)

The first edition of this book ranked up there
with K&R's C book and K&P's unix book as a must
have.

The style is light and engaging, and humorous.
e.g. on the 'new' lseek call there's a footnote:
"The extra letter (l) was available, since
creat was one letter short"

I still have my dog-eared copy which I refer to
from time to time.

HP distributed it with their first Unix systems
in lieu of a an official HP manual.

This 2nd edition adds a Java POSIX library
which is excellent. I am already using it
in production systems.

(Comparison's with Stevens book are a little
unfair as they have different emphases.
Rochkinds is on Unix, Steven's are less on
Unix and more on networking)

Re:a true classic (2, Interesting)

Albert Cahalan (761500) | more than 10 years ago | (#9013623)

(Comparison's with Stevens book are a little unfair as they have different emphases. Rochkinds is on Unix, Steven's are less on Unix and more on networking)

No way. Stevens wrote a UNIX book, not just the networking books. The UNIX book is about file IO, directory operations, system data files (passwd), process control and job control, signals, terminals, mmap, daemon writing, pipes, shared memory, message queues, FIFOs, semaphores, passing file descriptors, serial port IO, PTYs, etc.

tcgetpgrp, huh? (1)

jcuervo (715139) | more than 10 years ago | (#9013672)

They also are not saving whitespace on function samples, using the style where each line of source code and each { gets a separate line in text.
Allman style [dict.org] . (Yay! Was starting to think I was alone in the world.)
Don't know what tcgetpgrp() does? The index will point you to 4.3.4.
Big deal. /usr/bin/man will just tell me.

termios(3):
tcgetpgrp() returns process group ID of foreground processing group, or -1 on error.
Sounds interesting enough, though, and everyone else seems to be happy with it. I may check it out.

Free Software (0, Troll)

R. M. Stallman (775710) | more than 10 years ago | (#9013700)

Firstly I feel I must correct the author on his error in referring to an operating system using the Linux kernel as Linux, instead of GNU/Linux. For the reasoning behing this see here [gnu.org] .

Secondly I note that accompanying any book on programming there should be a book on Free Software [gnu.org] to educate the programmers of the future as to the importance of Free Software and the evils of supporting proprietary software.

Re:Free Software (-1)

Anonymous Coward | more than 10 years ago | (#9014014)

Free software is bullshit. I'm tired of the whole concept. Luckily many of us are part of the backlash. We're switching back to Windows from Linux. Look, we don't need a bunch of brainwashed freaks killing all our jobs. I think the world of software has existed just fine with proprietary software. Free software just kills small companies and our jobs. It is helping to destroy the world of the professional programmer. You all can choose to keep it, but then you get to pay more in taxes since I won't have a fucking job. Support of that software is great as long as the project is new. After it's gotten a bit old, it gets abandoned. Look for all the abandonware in the Free Software world. It equals closed source. So it has been yet another bit of FUD the open source freaks push. Now don't get me wrong. I love Unix, prefer to use a good Linux distro like Gentoo, love openbsd, and love the preferred licensing of BSD to GPL. Unix rocks my world. But I hate all this bullshit, it's gotta be free crap. What a fucking crock of shit.

I prefer the old cover (1)

aurelian (551052) | more than 10 years ago | (#9013726)

It had typographic style. This new one is too fussy. What's with the maze and the yellow paint splash? Looks like a book about home decorating.

Best Linux programming books (2, Interesting)

dioscaido (541037) | more than 10 years ago | (#9013766)

Understanding Linux Kernel + Linux Kernel Device Drivers

Those two books gain you an understanding of the linux kernel (and OS concepts in the meanwhile) only rivaled by reading the kernel source (and http://lxr.linux.no/ is the best for that!)

Something wrong in the code? (2, Funny)

Espectr0 (577637) | more than 10 years ago | (#9013818)

I tried the forktest, and renamed the forktest function to main and ran it. It displays numbers like 731 and the > tmp does about the same.

Am i doing something wrong?

Re:Something wrong in the code? (1)

trouser (149900) | more than 10 years ago | (#9013987)

Every process has a unique process id (PID). The value is guaranteed to be unique for your process. The value in the example is not really relevant.

Re:Something wrong in the code? (1)

Little Hamster (586231) | more than 10 years ago | (#9014065)

Straight from the man page

NAME
fork - create a child process

SYNOPSIS
#include
#include

pid_t fork(void);

The 731 you get is the pid of the child process.

Re:Something wrong in the code? (2, Funny)

AJWM (19027) | more than 10 years ago | (#9014208)

Am i doing something wrong?

Yes. Before running the it the first way (stdout is the terminal), you need to wait until your system's process id counter is in the low 11100s -- check by using ps, top, or similar. That will ensure you get the "Returned 11111" output. (You might need to try it a few times.)

Similarly before running it with the output directed to tmp, wait for the highest PID numbers returned by ps to get up to around 22218 before running it.

Of course, if you don't care if your forked process IDs are exactly 11111 or 22222 as per the example, you can just ignore the actual values.

(Which I assume (hope!) you knew.)

1st edition was great (1, Insightful)

Anonymous Coward | more than 10 years ago | (#9013974)

In institute where I used to work, we had one copy of 1st edition. It was the book where from I learned UNIX programming.

From my friend who still works there, I heard that they had managed somehow to lose the copy. I was so sad, that I decided to buy one. Shipping costs were much larger that cost of the second hand book...

Just when book arived, I heard about new edition!

Compared with Stevens? (1, Insightful)

Anonymous Coward | more than 10 years ago | (#9014184)

I have a copy of Advanced Programming in the Unix Environment [amazon.com] , Unix Network Programming volume 1 [amazon.com] and volume 2 [amazon.com] , and TCP/IP Illustrated, volume 1 [amazon.com] .

All I want to know is, would adding this book to my collection be redundant, or would it actually be useful? Given the quality of the late, great Stevens' writing, I suspect the former...

not just advanced programming (1)

phoebe (196531) | more than 10 years ago | (#9014393)

looks like advanced compiling if the author can get that code to run ...

forktest@moo $ gcc moo.c
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x82): undefined reference to `main'

The "feel" of the 1st edition (1)

luugi (150586) | more than 10 years ago | (#9014623)

To tell you the truth. I always liked the "feel" of the book.The book looks a lot heavier than what it really is.

I just love the Addison Wesley books.
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...