next up previous contents index Karma Home Page
Next: Channels: the basic Input/Output Up: Karma Programming Manual Previous: Introduction

Operating System Interface

The promise of POSIX-compliant operating systems has not yet materialised. A few packages are available in Karma to assist portability, and provide a few enhancements.

``a'' package

The a package provides a few convenience routines for displaying warning messages and aborting the execution of the application. It is important to abort and not just exit the application when a fatal error occurs, in order for a debugger to produce a meaningful traceback.

``m'' package

The m package provides an enhanced interface to the standard C library malloc() and associated functions. In particular, periodic checks are made by the memory allocator to see whether something has written past the bounds of an array.

``s'' package

The s package provides portable interfaces to some of the common Unix signal-handling facilities, such as blocking and unblocking of signals. In addition, a few ``standard'' signal handlers are provided.

``dir'' package

The dir package provides a portable and more powerful means of scanning directories. As well as being a portable interface, each entry in a directory is analysed (using the stat() system call under Unix-like systems) as it is scanned. This provides the application with more information about a file than just it's name.

Richard Gooch
Tue Dec 26 15:26:57 PST 2006