Have a Cookie

Cookie

My website uses cookies to personalize content and ads, to show you social media features, and to analyze website traffic. I might share information about your use of the website with my social media partners, advertising partners, and analysis partners, who may combine the data with other information about you, provided to them from your prior use of their services. Please note that you can change your cookie settings at any time.

POSIX in Ada: Understanding Unix/Linux Programming

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…

By.

min read

posix-in-ada

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: