This is an appendix to Understanding Unix/Linux Programming
written for people interested in Ada programming on POSIX systems.
A Guide to Theory and Practice
You may want to download the Ada version of the examples from the book.
For each chapter there is source code for the examples, and a make file with the preferred compiler flags for each example.
These appendices to Understanding Unix/Linux Programming
assume that you are using the GNU Ada compiler (GNAT). If you run Debian or Ubuntu you are advised to install these packages:
- ada-mode
- ada-reference-manual
- build-essential
- emacs
- gnat
- gnat-doc
- libflorist-dev
- manpages-dev
- libncurses5-dev
The packages can be installed using this command:
% sudo aptitude install ada-mode ada-reference-manual build-essential emacs gnat gnat-doc libflorist-dev manpages-dev libncurses5-dev
Please make sure that you have this alias set up before you start:
% alias gnatmake='gnatmake -gnat05 -gnatE -gnato -gnatv -gnati1 -gnatf -fstack-check -m -O3'
You can check if it is set correctly like this:
% alias gnatmake gnatmake='gnatmake -gnat05 -gnatE -gnato -gnatv -gnati1 -gnatf -fstack-check -m -O3' %
When you have added this to your shell profile, gnatmake
will automatically have the appropriate settings for compiling the examples included with this text.
Ada Distilled
is a useful (and free) introduction to Ada for people already familiar with programming in other languages. You can also download the examples from Ada Distilled
.
Another option for studying Ada is John Barnes’ Programming in Ada 2005
.
—
Go to the first chapter.
Collected examples: posix-in-ada.zip
Based on: Understanding Unix/Linux Programming
, Bruce Molay, ISBN 0-13-008396-8.
Index:
- Chapter 1: Unix Systems Programming: The Big Picture
- Chapter 2: Users, Files, and the Manual:
who
Is First - Chapter 3: Directories and File Properties: Looking through
ls
- Chapter 4: Focus on File Systems: Writing
pwd
- Chapter 5: Connection Control: Studying
stty
- Chapter 6: Programming for Humans: Terminal Control and Signals
- Chapter 7: Event-Driven Programming: Writing a Video Game
- Chapter 8: Processes and Programs: Studying
sh
- Chapter 9: A Programmable Shell: Shell Variables and the Environment
- Chapter 10: I/O Redirection and Pipes
- Chapter 11: Connecting to Processes Near and Far: Servers and Sockets
- Chapter 12: Connections and Protocols: Writing a Web Server
- Chapter 13: Programming with Datagrams: A License Server