1 Introduction

 1.1 Who should read this document?
 1.2 Overview
 1.3 What exactly is POSIX?

1.1 Who should read this document?

It is frequently the case that a FORTRAN programmer will need to use facilities that the operating system of the host computer provides and which pure FORTRAN 77 does not. This document is intended for programmers who need to use such facilities, and to do so in a portable way.

1.2 Overview

When writing programs that interact with the real world, as opposed to those that do some purely mathematical calculation, it is often necessary to make use of features of the operating system. A simple example of this is getting the current date and time. Most FORTRAN systems provide subroutines to let the programmer get this information, but the syntax of these routines differ from one computer to another, making the resulting code non portable. What is required is a portable operating system interface, and that is exactly what POSIX is. It is a set of routines that let an application program interact with the host operating system of the computer in a standard manner.

POSIX will eventually define a whole set of standards, but the one of interest here is that known as IEEE 1003.1-1988. This standard is published by the Institute of Electrical and Electronic Engineers (IEEE) and is recognized by the American National Standards Institute (ANSI). To quote from the standard [1], ‘It defines a standard operating system interface and environment to support application portability at the source code level.’ What this means is that if you include a POSIX call in your program, then your program will work on any system that is POSIX compliant. Since POSIX has its origins in Unix, it is not surprising that several of the many different Unix systems are already fully or nearly, POSIX compliant.

On account of the Unix origin of POSIX, some of the terminology used in describing the routines has a Unix accent. Any confusion caused by this should be resolved by the notes for each routine.

1.3 What exactly is POSIX?

If you really mean that, you had better go and read the standard[1]. However, to a reasonable approximation, POSIX (1003.1) is just the C run time library and indeed the POSIX standard makes reference to the ANSI C standard [2]. Unfortunately, different computers have somewhat different C run time libraries. The point of POSIX is to define a common run time library that will be available on all computers.