sehr empfehlenswert
Sehr gut gemachte Einführung in die PSOX API von Unix und die Linux spezifischen Erweiterungen.
Arnold Robbins beschreibt in seinem neuesten Buch Unix bzw. Linux Programmierung in C von Anfang an. Er macht dies an Beispielen, wie einigen V7 Quellen oder GAWK Ausschnitten. Dieses Vorgehen erinnert sehr an CodeReading, ist aber besser gemacht. Auch wenn Linux im Titel steht, ist das Buch auch für andere Unixe interessant, legt er doch viel wert auf POSIX.
Preface. Audience. What You Will Learn. Small Is Beautiful: Unix Programs. Standards. Features and Power: GNU Programs. Chapter Summary. Typographical Conventions. Where To Get Unix and GNU Source Code. Unix Code. GNU Code. Acknowledgments. 1. Introduction. The Linux/Unix File Model. The Linux/Unix Process Model. Standard C vs. Original C. Why GNU Programs Are Better. Portability Revisited. Suggested Reading. Summary. Exercises. 2. Arguments, Options, and the Environment Option and Argument Conventions. Basic Command Line Processing. Option Parsing: getopt() and getopt_long(). The Environment. Summary. Exercises. 3. User-Level Memory Management Linux/Unix Address Space. Allocating Memory. Summary. Exercises. 4. Files and File I/O. Introduction. Basic Program Structure. Determining What Went Wrong. Input and Output. Random Access: Moving Around Within A File. Creating Files. Forcing Data to Disk. Setting File Length. Summary. Exercises. 5. Directories and File Metadata. Directory Contents. Creating and Removing Directories. Reading Directories. File Types and Information. Changing Ownership, Permission, and Modification Times. Summary. Exercises. 6. General Library Interfaces - Part 1 Times and Dates. Sorting and Searching. User and Group Names. Terminals: isatty(). Suggested Reading. Summary. Exercises. 7. Putting It All Together: ls. V7 ls Options. The V7 ls Code. Summary. Exercises. 8. Filesystems and Directory Walks. Mounting and Unmounting Filesystems. Filesystem Administration Files. Retrieving Per-filesystem Information. Moving Around In The File Hierarchy. Doing A File Tree Walk: GNU du. Changing The Root Directory: chroot(). Summary. Exercises. 9. Process Management and Pipes. Process Creation and Management. Process Groups. Basic Interprocess Communication: Pipes and FIFOs. File Descriptor Management. Example: Two Way Pipes In gawk. Suggested Reading. Summary. Exercises. 10. Signals. Introduction. Signal Actions. Standard C Signals: signal() and raise(). Signal Handlers In Action. The System V Release 3 Signal APIs: sigset() et al. POSIX Signals. Signals For Interprocess Communication. Important Special Purpose Signals. Signals Across fork() and exec(). Summary. Exercises. 11. User and Group ID Numbers and Permissions. Introduction. Retrieving User and Group Ids. Checking As The Real User: access(). GLIBC Only: Checking As The E_ective User: euidaccess(). Extra Permission Bits For Directories. Setting Real and E_ective Ids. Linux Only: getresuid() and setresuid(). Setuid root: A Security Minefield. Suggested Reading. Summary. Exercises. 12. General Library Interfaces - Part 2. Stating Assertions: assert(). Low-level Memory: The memXXX() Functions. Temporary Files. Committing Suicide: abort(). Non-local Gotos. Pseudorandom Numbers. Metacharacter Expansions. Regular Expressions. Suggested Reading. Summary. Exercises. 13. Internationalization and Localization. Locales and the C Library. Dynamic Translation of Program Messages. Can You Spell That For Me Please? Suggested Reading. Summary. Exercises. 14. Extended Interfaces. Allocating Aligned Memory: posix_memalign() and memalign(). Locking Files. More Precise Times. Advanced Searching With Binary Trees. Summary. Exercises 15. Debugging. What To Do First? Compiling For Debugging. GDB Basics. Programming For Debugging. Debugging Tools. Software Testing. Debugging Rules. Suggested Reading. Summary. Exercises. 16. Tying It Together - A Project. Project Description. Suggested Reading. Appendix A. Teach Yourself Programming in Ten Years. Why is everyone in such a rush? Teach Yourself Programming in Ten Years. References. Answers. Footnotes. Appendix B. Caldera Ancient UNIX License. Appendix C. GNU General Public License.
Schnoerkellos aber mit einem sehr feinen Geschmack für Humor.
Als langjähriger GNU AWK Maintainer kennt der Autor die Probleme und Besonderheiten vieler Unix Derivate (inkl. Linux) in- und auswendig. Durch praktische Beispiele zeigt er sich deutlich die Kniffe und kleinen Stolperfallen bei der Programmierung gegenn die POSIX API. Dabei konzentriert er sich auf die Basics (memory management, file i/o, processes, users&groups, sorting&searching, argument parsig, signals, internationalization and debugging) und lässt Raum für weitere Bände (z.B. IPC).
Robbins ist ein Praktiker, von dem viele noch etwas lernen können. Die Art wie und vor allem wie tief er beschreibt, erinnert ich sehr an RichStevens. Hoffentlich folgen in der Reihe noch mehr Bände -- die Themen IPC (and networking) and development (and portability) sind auf der Liste.
Arnold Robbins
2004, Prentice Hall PTR, ISBN 0-13-142964-7, 687 Seiten
Amazon: http://www.amazon.de/exec/obidos/ASIN/0131429647
Verlag: http://www.phptr.com/title/0131429647
Autor: http://authors.phptr.com/robbins/
Linux, Unix, C, awk, POSIX
15-Oct-2004