These pages represent an ongoing project to define a Common Lisp API for POSIX system calls.
The goal of the API is to provide a convenient interface to POSIX system calls, while still providing some optimizations such as allowing the caller to supply pre-allocated objects for the call to fill in.
We are aware of projects such as Ossicat. The goal of this project is quite different. We are mainly interested in creating a specification of an API that looks "natural" to Common Lisp. This requirement excludes the use of any foreign-function interface (FFI) if using such an interface makes the underlying lower-level programming language visible in the interface. It is of course not excluded to use some FFI to implement the various functions of this interface, but the mapping may not direct for all functions.
Since there is no direct correspondence between the functions in this interface and similar functions in (say) libc, the specification of this interface must be complete and without reference to such similar functions.
The API comes in two levels:
A low-level interface with emphasis on performance.
This interface may not be extremely convenient to use, but it has minimal overhead for applications that require maximum performance.
Functions at this level take a constant number of arguments so as to avoid the overhead of processing &optional or &key arguments.
Errors at this level are indicated by additional return values in the form of small numbers. Constant variables are supplied to allow easy comparison for error values.
A high-level interface with emphasis on convenience.
This interface may require some overhead in order to make use more convenient to the programmer.
Functions at this level may take optional or keyword arguments for convenience.
Errors at this level are indicated by some condition being signaled. When appropriate, restarts are provided.
Functionality at this level is implemented in terms of the low-level interface.