Covering all the essential components of Unix/Linux, including process management, concurrent programming, timer and time service, file systems and network programming, this textbook emphasizes programming practice in the Unix/Linux environment. Systems Programming in Unix/Linux is intended as a textbook for systems programming courses in technically-oriented Computer Science/Engineering curricula that emphasize both theory and programming practice. The book contains many detailed working example programs with complete source code. It is also suitable for self-study by advanced programmers and computer enthusiasts. Systems programming is an indispensable part of Computer Science/Engineering education. After taking an introductory programming course, this book is meant to further knowledge by detailing how dynamic data structures are used in practice, using programming exercises and programming projects on such topics as C structures, pointers, link lists and trees. This book provides a wide range of knowledge about computer system software and advanced programming skills, allowing readers to interface with operating system kernel, make efficient use of system resources and develop application software. It also prepares readers with the needed background to pursue advanced studies in Computer Science/Engineering, such as operating systems, embedded systems, database systems, data mining, artificial intelligence, computer networks, network security, distributed and parallel computing.
Master the system calls at the heart of today´s UNIX and Linux systems: the programming interfaces that drive the UNIX and Linux kernels and run everything from filesystems and multitasking to interprocess communication. A thorough knowledge of system calls is essential for every UNIX and Linux programmer -- and for 20 years, W. Richard Stevens´ Advanced Programming in the Unix Environment has delivered that. Now, Stephen Rago has completely updated this classic to reflect modern distributions including Red Hat 2.6.x, Solaris 10 3, OS X 10.5.4, FreeBSD 7.0.5 -- and for the first time, Ubuntu. As in previous editions, Rago begins with essentials such as file and process control, carefully laying the groundwork for more advanced techniques. He supports his crystal-clear explanations with nearly 10,000 lines of code, all carefully tested on each of these leading versions and distributions. Rago begins with an up-to-date overview of the UNIX System, its standardization processes, and its diverse implementations. Next, he introduces file I/O, files, directories, and the Standard I/O Library. You´ll walk through working with UNIX/Linux system data files and information? controlling the process environment and its relationships? using signals, threads, and daemon processes? mastering advanced I/O techniques, interprocess communication, sockets, and advanced IPC? using Terminal I/O and Pseudo Terminals? working with database libraries, communicating with network printers, and much more. Appendices provide essential information on function prototypes, miscellaneous source code, and solutions to many of this guide´s exercises. For all intermediate-to-advanced level UNIX programmers and software engineers. Product Description For more than twenty years, serious C programmers have relied on one book for practical, in-depth knowledge of the programming interfaces that drive the UNIX and Linux kernels: W. Richard Stevens? Advanced Programming in the UNIX® Environment . Now, once again, Rich?s colleague Steve Rago has thoroughly updated this classic work. The new third edition supports today?s leading platforms, reflects new technical advances and best practices, and aligns with Version 4 of the Single UNIX Specification. Steve carefully retains the spirit and approach that have made this book so valuable. Building on Rich?s pioneering work, he begins with files, directories, and processes, carefully laying the groundwork for more advanced techniques, such as signal handling and terminal I/O. He also thoroughly covers threads and multithreaded programming, and socket-based IPC. This edition covers more than seventy new interfaces, including POSIX asynchronous I/O, spin locks, barriers, and POSIX semaphores. Most obsolete interfaces have been removed, except for a few that are ubiquitous. Nearly all examples have been tested on four modern platforms: Solaris 10, Mac OS X version 10.6.8 (Darwin 10.8.0), FreeBSD 8.0, and Ubuntu version 12.04 (based on Linux 3.2). As in previous editions, you?ll learn through examples, including more than ten thousand lines of downloadable, ISO C source code. More than four hundred system calls and functions are demonstrated with concise, complete programs that clearly illustrate their usage, arguments, and return values. To tie together what you?ve learned, the book presents several chapter-length case studies, each reflecting contemporary environments. Advanced Programming in the UNIX® Environment has helped generations of programmers write code with exceptional power, performance, and reliability. Now updated for today?s systems, this third edition will be even more valuable. Features + Benefits W. Richard Stevens´ definitive, classic guide to UNIX® programming, now 100% updated for today´s leading systems and distributions! The new third edition of Advanced Programming in the UNIX® Environment supports today´s leading platforms, reflects new technical advances and best practices, and aligns with Version 4 of the Single UNIX Specification. This valuable tool begins with files, directories, and processes, carefully laying the groundwork for more advanced techniques, such as signal handling and terminal I/O then thoroughly covers threads and multithreaded programming, and socket-based IPC. This edition covers more than seventy new interfaces, including POSIX asynchronous I/O, spin locks, barriers, and POSIX semaphores. Students are given examples, including more than ten thousand lines of
In order to thoroughly understand what makes Linux tick and why it works so well on a wide variety of systems, you need to delve deep into the heart of the kernel. The kernel handles all interactions between the CPU and the external world, and determines which programs will share processor time, in what order. It manages limited memory so well that hundreds of processes can share the system efficiently, and expertly organizes data transfers so that the CPU isn´t kept waiting any longer than necessary for the relatively slow disks. The third edition of Understanding the Linux Kernel takes you on a guided tour of the most significant data structures, algorithms, and programming tricks used in the kernel. Probing beyond superficial features, the authors offer valuable insights to people who want to know how things really work inside their machine. Important Intel-specific features are discussed. Relevant segments of code are dissected line by line. But the book covers more than just the functioning of the code; it explains the theoretical underpinnings of why Linux does things the way it does. This edition of the book covers Version 2.6, which has seen significant changes to nearly every kernel subsystem, particularly in the areas of memory management and block devices. The book focuses on the following topics: - Memory management, including file buffering, process swapping, and Direct memory Access (DMA) - The Virtual Filesystem layer and the Second and Third Extended Filesystems - Process creation and scheduling - Signals, interrupts, and the essential interfaces to device drivers - Timing - Synchronization within the kernel - Interprocess Communication (IPC) - Program execution Understanding the Linux Kernel will acquaint you with all the inner workings of Linux, but it´s more than just an academic exercise. You´ll learn what conditions bring out Linux´s best performance, and you´ll see how it meets the challenge of providing good system response during process scheduling, file access, and memory management in a wide variety of environments. This book will help you make the most of your Linux system. In order to thoroughly understand what makes Linux tick and why it works so well on a wide variety of systems, you need to delve deep into the heart of the kernel. The kernel handles all interactions between the CPU and the external world, and determines which programs will share processor time, in what order. It manages limited memory so well that hundreds of processes can share the system efficiently, and expertly organizes data transfers so that the CPU isn´t kept waiting any longer than necessary for the relatively slow disks. This edition of Understanding the Linux Kernel takes you on a guided tour of the most significant data structures, algorithms, and programming tricks used in the kernel. Probing beyond superficial features, the authors offer valuable insights to people who want to know how things really work inside their machine. Important Intel-specific features are discussed. Relevant segments of code are dissected line by line. But the book covers more than just the functioning of the code; it explains the theoretical underpinnings of why Linux does things the way it does.This edition of the book covers Version 2.6, which has seen significant changes to nearly every kernel subsystem, particularly in the areas of memory management and block devices. You´ll learn what conditions bring out Linux´s best performance, and you´ll see how it meets the challenge of providing good system response during process scheduling, file access, and memory management in a wide variety of environments. This book will help you make the most of your Linux system.
The Insider´s Best-Practice Guide to Rapid PyQt 4 GUI Development Whether you´re building GUI prototypes or full-fledged cross-platform GUI applications with native look-and-feel, PyQt 4 is your fastest, easiest, most powerful solution. Qt expert Mark Summerfield has written the definitive best-practice guide to PyQt 4 development. With Rapid GUI Programming with Python and Qt you´ll learn how to build efficient GUI applications that run on all major operating systems, including Windows, Mac OS X, Linux, and many versions of Unix, using the same source code for all of them. Summerfield systematically introduces every core GUI development technique: from dialogs and windows to data handling; from events to printing; and more. Through the book´s realistic examples you´ll discover a completely new PyQt 4-based programming approach, as well as coverage of many new topics, from PyQt 4´s rich text engine to advanced model/view and graphics/view programming. Every key concept is illuminated with realistic, downloadable examples-all tested on Windows, Mac OS X, and Linux with Python 2.5, Qt 4.2, and PyQt 4.2, and on Windows and Linux with Qt 4.3 and PyQt 4.3. Coverge includes Python basics for every PyQt developer: data types, data structures, control structures, classes, modules, and more Core PyQt GUI programming techniques: dialogs, main windows, and custom file formats Using Qt Designer to design user interfaces, and to implement and test dialogs, events, the Clipboard, and drag-and-drop Building custom widgets: Widget Style Sheets, composite widgets, subclassing, and more Making the most of Qt 4.2´s new graphics/view architecture Connecting to databases, executing SQL queries, and using form and table views Advanced model/view programming: custom views, generic delegates, and more Implementing online help, internationalizing applications, and using PyQt´s networking and multithreading facilities
Ruby is the fastest growing and most exciting dynamic language out there. If you need to get working programs delivered fast, you should add Ruby to your toolbox. This book is the only complete reference for both Ruby 1.9 and Ruby 2.0, the very latest version of Ruby. 2013 marks the 20th anniversary of the Ruby language. We´re proud that throughout its history, we´ve continued to cover the latest version of Ruby. Would you like to go from first idea to working code much, much faster? Do you currently spend more time satisfying the compiler instead of your clients or end users? Are you frustrated with demanding languages that seem to get in your way, instead of getting the work done? Are you using Rails, and want to dig deeper into the underlying Ruby language? If so, then we´ve got a language and book for you! Ruby is a fully object-oriented language, much like the classic object-oriented language, Smalltalk. Like Smalltalk, it is dynamically typed (as opposed to Java or C++), but unlike Smalltalk, Ruby features the same conveniences found in modern scripting languages such as Perl and Python. The combination of the power of a pure object-oriented language with the convenience of a scripting language makes Ruby a favorite tool of intelligent, forward-thinking programmers. The Pickaxe contains four major sections: An acclaimed tutorial on using Ruby. The definitive reference to the language. Complete documentation of all built-in classes, modules, and methods. Complete descriptions of all 97 standard libraries. This is the reference manual for Ruby, including a description of all the standard library modules, a complete reference to all built-in classes and modules (including all the new and changed methods introduced by Ruby 1.9, 1.9.2, 1.9.3, and 2.0). It also includes all the new and changed syntax and semantics introduced since Ruby 1.8. Learn about the new parameter passing rules, local variable scoping in blocks, fibers, and the new block declaration syntax, among other exciting new features. About Ruby 2.0 Ruby 2.0 is a minor update to Ruby 1.9, unlike the more major updates from Ruby 1.8 to Ruby 1.9. The major language changes in Ruby 2.0 are the addition of keyword arguments and the change to use UTF-8 as the default source file encoding. There are a number of additions to the standard library, including: @Enumerator::Lazy@, which adds support for lazy access to potentially infinite lists. Refinements allow you to encapsulate changes to third-party classes, and scope their application to individual source files, preventing your changes from polluting the global application. You´ll also find that Ruby 2 is faster, and has memory management improvements that make it more server-friendly. All told, there are over 110 sections of the book that have been flagged and cross-linked to indicate 2.0 content. What You Need This book assumes you have a basic understanding of object-oriented programming. In general, Ruby programmers tend to favor the the command line for running their code, and they tend to use text editors rather than IDEs. * Ruby runs on Windows, Linux, and Macs. Ruby is the fastest growing and most exciting dynamic language out there. If you need to get working programs delivered fast, you should add Ruby to your toolbox. This book is the only complete reference for both Ruby 1.9 and Ruby 2.0, the very latest version of Ruby.
Hacking is the art of creative problem solving, whether that means finding an unconventional solution to a difficult problem or exploiting holes in sloppy programming. Many people call themselves hackers, but few have the strong technical foundation needed to really push the envelope. Rather than merely showing how to run existing exploits, author Jon Erickson explains how arcane hacking techniques actually work. To share the art and science of hacking in a way that is accessible to everyone, Hacking: The Art of Exploitation, 2nd Edition introduces the fundamentals of C programming from a hacker´s perspective. The included LiveCD provides a complete Linux programming and debugging environment all without modifying your current operating system. Use it to follow along with the book´s examples as you fill gaps in your knowledge and explore hacking techniques on your own. Get your hands dirty debugging code, overflowing buffers, hijacking network communications, bypassing protections, ex
O´Reilly´s bestselling book on Linux´s bash shell is at it again. Now that Linux is an established player both as a server and on the desktop Learning the bash Shell has been updated and refreshed to account for all the latest changes. Indeed, this third edition serves as the most valuable guide yet to the bash shell. As any good programmer knows, the first thing users of the Linux operating system come face to face with is the shell the UNIX term for a user interface to the system. In other words, it´s what lets you communicate with the computer via the keyboard and display. Mastering the bash shell might sound fairly simple but it isn´t. In truth, there are many complexities that need careful explanation, which is just what Learning the bash Shell provides. If you are new to shell programming, the book provides an excellent introduction, covering everything from the most basic to the most advanced features. And if you´ve been writing shell scripts for years, it offers a great way to find out what the new shell offers. Learning the bash Shell is also full of practical examples of shell commands and programs that will make everyday use of Linux that much easier. With this book, programmers will learn: - How to install bash as your login shell - The basics of interactive shell use, including UNIX file and directory structures, standard I/O, and background jobs - Command line editing, history substitution, and key bindings - How to customize your shell environment without programming - The nuts and bolts of basic shell programming, flow control structures, command-line options and typed variables - Process handling, from job control to processes, coroutines and subshells - Debugging techniques, such as trace and verbose modes - Techniques for implementing system-wide shell customization and features related to system security
Learn how to use a Raspberry Pi in conjunction with an Arduino to build a basic robot with advanced capabilities. Getting started in robotics does not have to be difficult. This book is an insightful and rewarding introduction to robotics and a catalyst for further directed study. You´ll be led step by step through the process of building a robot that uses the power of a Linux based computer paired with the simplicity of Arduino. You´ll learn why the Raspberry Pi is a great choice for a robotics platform; its strengths as well as its shortcomings; how to overcome these limitations by implementing an Arduino; and the basics of the Python programming language as well as some of the more powerful features. With the Raspberry Pi you can give your project the power of a Linux computer, while Arduino makes interacting with sensors and motors very easy. These two boards are complimentary in their functions; where one falters the other performs admirably. The book also includes references to other great works to help further your growth in the exciting, and now accessible, field of smart robotics. As a bonus, the final chapter of the book demonstrates the real power of the Raspberry Pi by implementing a basic vision system. Using OpenCV and a standard USB web cam, you will build a robot that can chase a ball. What You´ll Learn Install Raspbian, the operating system that drives the Raspberry Pi Drive motors through an I2C motor controller Read data through sensors attached to an Arduino Who This Book Is For Hobbyists and students looking for a rapid start in robotics. It assumes no technical background. Readers are guided to pursue the areas that interest them in more detail as they learn.