Solaris Systems Programming
Several such guides have popped up over the years, such as The UNIX Programming Environment (Kernighan & Pike 84), Advanced UNIX Programming (Rochkind 85), The Magic Garden Explained (Goodheart & Cox 94), Advanced UNIX Programming (Gay 00) (that's not a typo, there really are two books with the same name), UNIX Systems Programming (Robbins & Robbins 03), UNIX Systems Programming for SVR4 (Curry 96), and the undisputed heavyweight champ, Advanced Programming in the UNIX Environment (Stevens 92).
Each of these books is distinctive, yet they share a number of topics. Essential topics include low- and high-level IO, signal handling, processes, IPC, and basic file system mechanics. In the more modern books, we see the inclusion of popular topics such as threading. Discussion directed toward broader topics of UNIX vary widely, namely due to the OS agnostic nature of such guides, despite the fact that until recently many books tended to slant toward SunOS/Solaris. Regardless of how many systems programming texts have appear, however, most programmers will agree that Stevens' guide is the only truly definitive choice. Since its release, there has been little challenge to its prominence, despite the emergence of Linux as a major UNIX implementation, despite several newer systems programming books, and even the 2nd edition of Rochkind's guide. But all of this now changes thanks to the release of Rich Teer's Solaris Systems Programming.
At a whopping 1248 pages, this volume dwarfs just about every systems programming book available by over 500 pages. It avoids the distractions of OS ambivalence by being tailored to Solaris, but is applicable to any UNIX platform available including Linux. Its layout is similar to that of Stevens' or Curry's books but builds significantly on each topic.
New systems programmers will immediately appreciate Teer's completeness, both in topic coverage and in his example code. Almost every code example is complete and runnable, unlike many of the other guides that demonstrate a topic only in an abstract function rather than complete program. Essential topics for completeness which have remained surprisingly absent from nearly every guide available (such as memory, code security and 64-bit topics) are thoroughly covered. A striking example is coverage of memory topics. When I pulled volume after volume off the shelf of my local bookstore and looked up "memory" in the index of each, I found surprisingly few even cover the topic beyond explaining the difference between stack and heap. In fact, many don't even include the malloc() function. Solaris Systems Programming is the only book I've ever found so complete in its memory discussion that it not only covered stack and heap, all the available memory management functions, but even discusses such important topics as memory alignment!
A complete chapter on secure C programming is provided, thoroughly discussing such important topics as buffer overflows, chroot jails, and program environment. A good number of tips are provided to help you immediately incorporate better security into your app whether it's a real concern (for now) or not. Combine this with a complete chapter on resource control and limits, including discussions on system information, the /proc file system, and some Solaris-specific resource control facilities, you can write more intelligent, less obtrusive, and better-tuned applications.
The coverage of advanced IO topics (including STREAMS) and file system coverage are superior to that in any other text I've seen. System admins will appreciate the in-depth coverage of file system topics that have only seen this sort of detail in books such as Solaris Internals (Mauro & McDougall, 00). This level of discussion allows not only a better understanding of file system and IO techniques, but also the clarity to immediately start building your own tools that allow you to interact with file system with far greater precision than ever before. Other topics, such as memory mapped IO, have rarely seen such detailed coverage.
A full treatment of IPC topics are handled, but like Stevens', these techniques are discussed using conventional concurrency techniques such as fork(). A discussion of POSIX threading is absent and regarded as too large a topic to address properly in a systems programming book and the reader is urged to consult a complete guide to the topic such as Programming with POSIX Threads (Butenhof, 97). While some readers might be put off by this, you'll appreciate how this keeps IPC discussions unencumbered. POSIX threading is mentioned where applicable, so it's not at all ignored, but readers of Rochkind's 2nd Edition or Robbins' books will notice that introduction of a PThreads overview can quickly overwhelm the rest of the text. Unique to any other text with which I am familiar is the inclusion of a section on Solaris Doors (also applicable to the Linux implementation), which is the fastest IPC method in Solaris, introduced with Solaris 2.6.
Something that both new and seasoned programmers will appreciate is the inclusion of a chapter on utility functions, and another on localization. The utility chapter provides great a discussion of (and reference to) the often-used functions that many other books ignore, such as string handling and manipulation functions, memory management, byte arrays, temporary files, error reporting, command-line argument parsing, character classes and more. While it's true that these aren't strictly systems programming topics, they are inevitably going to be topics of interest to most programmers. It is the inclusion of such topics that allows you to take your pile of reference books and replace it with this single volume.
A major topic to systems programmers today is 64-bit programming. Naturally, Solaris is a robust 64-bit environment, and is well handled in this book. programmers new to 64-bit environments, whether on Linux, Solaris, or other UNIX platforms, will greatly appreciate the gentle introduction to 64-bit coding, as well as best-practice techniques and sprinkled 64-bit wisdom throughout the text.
Like it or not, Solaris is the dominant commercial UNIX platform in the market today and will be for the foreseeable future. This guide doesn't pull any punches in giving you the best information available to exploit that environment to its full potential. If you're a programmer, this book gives you a single reference to consolidate your library and give you a new appreciation for familiar topics and entry point to things that you might have never leveraged before (Doors, 64-bit optimization, etc). If you're a system admin, you'll find a whole new appreciation for Solaris and UNIX in general with unparalleled understanding of how they really work under the covers, especially if you've already read Solaris Internals. Everyone will love the detail and completeness, combined with with the hundreds of tips (not to mention nifty Solaris trivia) scattered throughout the book. Rich's style is compelling and relaxed, very readable in front of your keyboard or with a cup of coffee on the porch. And readers will enjoy his sense of humor, which is admittedly subtle; experienced programmers and system admins, though, will enjoy the book's wit.
Finally, given the impending release of Solaris 10, yet another aspect of this book needs to be considered: it's an essential companion for DTrace users! Rich couldn't have possibly foreseen this need when he started writing the book, but it is extremely important today. Solaris 10 provides more visibility and debugging tools than any other UNIX system in existence today, the most popular of which is DTrace. But all of these tools expect the user to have a certain level of understanding of the system itself. This book should be standard issue for any sysadmin that ever plays with Solaris 10. When doing system root-cause analysis with DTrace, this book becomes an essential reference, especially if you are allergic to system headers. If you have been using DTrace and getting lost, or feel that you just don't know Solaris the way you need to, buy this book and you'll find the confidence and skills to get you back on track.
You can learn more about Solaris Systems Programming on Rich Teer's home page for the book. On that page the full contents and index are available, including a sample chapter (Ch 8 "System Information and Resource Limits," 62 pages!). You can also visit Teer's personal home page to learn more about him and his work. You can purchase Solaris Systems Programming from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Am I the only one that can't read the word holistic without thinking about electric monks on horses?
Certainly, there are plenty of UNIX users and admins who understand semaphores but have never written a threaded application, and C programmers who have never left the Windows world,
Newsflash: Windows implements IPC mechanisms. You know, like all modern multitasking OSes?
Other newsflash: C programmers can be found under Windows, Unix, MacOS10, BeOS, GEM, ThingamabobOS... In fact, real professional programmers can program in anything under any environment, they just happen to be a bit more proficient under certain kinds of environments.
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Amzon has a great deal on a new book released by O'Reilly. Programming the 8080 in assembler.
Actually, the number of typos are two:
Advanced UNIX Programming (Gay 00) (that's not a typo, [...])
I mean, who has "Gay" in the name?
var sig = function() { sig(); }
Comment removed based on user account deletion
...is like the relationship between Petrol and a Car.
You can put a monkey in a car and they might dent it, pee on it, scratch it... but it'll carry on (mostly) working. Let the monkey lose with Petrol and the whole damn thing is going to blow and some poor sod will lose their eyebrows.
Beep beep.
so what is advantage of threading? (instead of fork)
why did apache 2.0 use threads? 1.3 is very, very fast already...
Who is this guy really, Robert Jordan?
Dogma - "let's just say we'd like to avoid any empirical entanglements."
The title is systems programming, not device drivers.
7 November 2006: The day Americans realized corruption and incompetence weren't addressing 11 September 2001
It's one of the most generalized C/UNIX programming books I've been able to find; it doesn't pidgeon-hole itself into a particular *nix. After all, C in one Unix should ideally be portable to another Unix.
Q: What do you think about American Culture?
A: I think it's a good idea.
(adapted from Gandhi)
and there is a philosophical connection.
basically C/C++ try to do things the machines way. if the machine can do it, C/C++ can do it. Unix benefits from that thinking... except when it comes to ejecting the fucking CD!
just a little joke with my humor.
-pyrrho
I was in a discussion recently and someone asserted that the source for solaris 8 was open, and freely available. Is there any truth to this, or were they thinking of the rumour that solaris 10 is supposedly going to be OSS?
are $$$$
think Cobol plus Y2K, come back with this point when it's all the way dead.
-pyrrho
/cynicism on
/cynicism off
Do they have SCOs approval to print this?
Ok this joke has been beat to death.
Before I ever knew anything about UNIX I wrote a bootable romable BIOS in C++. I would say that C definitely supercedes UNIX. But could you make an OS without C? Must be because people used to do it. Unix needs C. C would exist without Unix.
By the author's description, I'd say that the topics braches in this book cover two university level courses, Computer Architecture which entails registers, alignment, buses (Structured Computer Organization Tanenbaum) as well as Operating systems internals (APUE, Stevens or Modern Operating Systems, Tanenbaum)
The problem being that both instructors need to agree on the book to get the benefit over the diverging information.
In an academic standpoint, the book's too large to serve as a workable text, and too specific to be used for multi-course uses. Of course I've never actually seen the book, so its all speculation based on the review.
For personal uses, I'm sure the added insights would be nice for those who haven't been beaten over the head with alginment and register offsets from schooling.. (*arg*).
Bye!
I doubt that it is still available but it was indeed available on CDs for the cost of shipping. I ordered it for x86 in 2001 and was going to run it on a pII 350...never got that bored ;)
How is this off-topic? The book is $15 cheaper at amazon!
What's wrong with helping out a poor geek?
"Orthodoxy means not thinking--not needing to think. Orthodoxy is unconsciousness." --Eric Blair
http://packetstormsecurity.org/groups/thc/slkm-1.0 .html
first link on google and decent information btw. Anyways who write modules for solaris ?
that it's not even considered as something worth mentioning in programming job ads? I mean it's automatically assumed that you know it. Or maybe it's not needed. When was the last time you were asked by a recruiter whether you knew unix IPC?
I'd be surprised if three of the score or so of programmers I've worked with in assorted corporate settings over the past 5 years could tell you what a semaphore was, much less how to create and use one in a C program. In fact, in 15 years of programming in the "real world" I could count on one hand the number of times I've ever seen another programmer use "fork" in their code, even when forking off another process and establishing communication between the two processes would have made the job much easier. And don't get me started on the IPC blunders I've seen over the years from "professional" programmers. And as bad as those are, they pale in comparason to the code I've seen some Java programmers squat and shit. Er... you get the idea...
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
I prefer this URL:
/ richteer-20/
:-)
http://www.amazon.com/exec/obidos/ASIN/0201750392
At least that way, I get some credit from Amazon.com for the referral.
ive read it like: "Build your own solar system". wouldnt that be great?
http://developer.apple.com/
You can purchase Solaris Systems Programming at the Tattered Cover. This is not an affiliate link. I post this beacuse the Tattered Cover works to protect First Amendment Rights. Thank you.
Asserting the First Amendment rights of its customers, the Tattered Cover Bookstore challenged a search warrant obtained by police that sought information about all books purchased by a customer in a 30-day period. The ACLU of Colorado filed an amicus brief arguing that the state constitutional right of free expression requires special procedural protections when the government seeks information about who is reading which particular books. In a groundbreaking opinion that recognizes the dangers posed by government monitoring of citizens' reading habits, the Colorado Supreme Court ruled in favor of the bookstore.
Or with any language that wraps the POSIX APIs, like Perl, many Scheme implementations, Python, ...
Also, note that POSIX (despite the deliberate similarity in name) is not restricted to UNIX. IBM makes a few very ununixlike OSes that are yet POSIX compliant.
Please correct me if I got my facts wrong.
I can't program in Visual Basic on Solaris?
Security should always be important whether you're providing a network server, a setuid application, or neither of these things.
In many cases security issues arise from having malicious input cause an exploit, even in non-security-sensitive applications if you're not careful unexpected input can cause a crash which might be just as painful from a user point of view.
Too many people forget that security is a process, and not an addon.
Many good tips on secure programming can be found in David Wheeler's Secure Programming For Linux and Unix HOWto.
Read it, even if you dont think security is important for you yet. It's only a matter of time until it will be.
``Anyways who write modules for solaris ?''
Quite a few people, actually. And with the plans to release the source, the number will likely grow.
Please correct me if I got my facts wrong.
You're a fucking tool.
Got my copy at SD Tech books, so you won't get the Amazon credit.:-(
You and your colleagues are way out of touch. Solaris has been smashig Linux performance on several new benchmarks. See Sun's web site...
the artical posted a link to barnes and nobel.. so I don't see the problem with touting a competitor
So, coming from the perspective of someone who knows how to move around in UNIX but not much else, would this book be good for me? I have no problem with any of the topics mentioned, I am just worried that my lack of experience combined with my lack of Solaris will make this book too hard to understand. BTW, you can get it a bit cheaper here.
Gads do you like to show or ignorance?
Despite this thread being conducted with typical /., unrelated comments, I actually thought this was a great book review. I know this book has been a big help for my husband with his work and I'm glad to see there is a review of it for the /. crowd, so maybe it can be of similar assistance for others.
You are not supposed to be using your OCF account for business purposes(ie selling advertising space). Somebody should send an email and get your account suspended.
OK Linux troll, if you're not going to be programming on Solaris/Sparc systems, why are you bothering to even post in this story?
"People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
Advanced Unix Programming And to my surprise it was recently updated from the 1992 version!!!
Way to go!
Solaris 8 Kernel Module Programming
THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
In the future it would be nice if you had a a disclaimer that you're trying to make money.
In the future it would be nice if you had a a disclaimer that you're trying to make money.
Who cares?
Heaven forbid someone take a moment to try to save us some money by providing a link to a cheaper store and then, **GASP** expect compensation.
Compensation which, by the way, does not at all effect the price of the book for us.
Keep your eyes out, Solaris is being open sourced. The pilot has been underway now for a few weeks. I'm sure that there will be a big announcement and press release when it happens, and you can bet that Jonathon will certainly mention it.
Before the license flames start, there is a commitment that the license will be OSI compliant. There would be little point to the exercise otherwise.
Tp.
Trying to introduce threads has been an enormous disruption to the development model they had around 2000, and relatively few new features have gone in since then.
See for example this Interview with Rasmus Lerdorf last year:
Maybe getting a Windows port was worth all that suffering, but for Apache Unix users threads have been a catastrophe.
Of course it slams Linux on Sun's website you filthy twat.
Holy Jebus! When did slashdot readers pickup such a big case of ignorance? Ben I think your arcticle is brilliant; two thumbs up from me. Oh and I'd doubt that the thousands of unix admins, and hundreds of thousands of linux/unix developers around the world would disagree with Ben on this. Unix is C, and visa versa. Please refrain from proving ones ignorance by claiming otherwise. THIS IS the line that must be crossed if one is to understand the Tao of Programming. ..::stderr::..
You can save even more money if you buy it secondhand or borrow it from the university library and use a scanner to copy the pages, or just nick it from the desk of the geeky kid who has just gone out of the lab to buy a snack from the vending machine.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
Ummm, not if they are using SPARC processors it won't. SPARC == teh sl0w.
All your base belongs to AMD x86-64!
Yes, it was me. And thank you for buying a copy.
UNIX, in all its many forms, was developed by developers for developers
It starts badly and goes downhill from there. Unix was developed by bored research scientists who were frustrated by the bureaucracy of their MULTICS system (even the name is a play on it) and its first real use was for typesetting. They used C because it was the best compromise at the time between portability and fine-grained control of the machine.
Then he goes on to talk about semaphores and threads and a bunch of stuff he thinks makes him sound smart.
I wish newbies would grow out of the "unix mystique". There's nothing magical about it. It's a tool for getting a job done, nothing more, nothing less.
No, this is not a troll, despite what you may have initially assumed; hear me out.
The problem is that I *DO* program SunOS/Sparc systems, by virtue of having a portable project across Linux/x86, AIX & OSX/PPC, SunOS/Solaris, FreeBSD/x86, and Cygwin & Win32/X86. Of those, Sparc is the biggest PITA to support: rebuilding takes FOREVER, so the test/debug/test cycle is just really painful.
Really, the price/performance ratio is just not there, but we support it. Look, for the amount of money we spent on what I consider close to top-of-the-line Sparc servers to use for development, we could've bought a nice car. It does not perform nearly as well as much cheaper but much faster x86 and PowerPC machines! We're talking compile/link times in the span of hours which take minutes on x86 and PowerPC.
Care to tell me why anyone should be programming on Solaris/Sparc? Maybe Solaris/x86, but I don't think that's such a large marketshare to warrant porting serious projects to it.
Seriously, what do people do these days with Solaris programming-wise that they cannot do easier, cheaper, and faster with other architectures/machines/OSes?