Although the PSX routines appear to the user as FORTRAN subroutines, they are actually written in C. The FORTRAN - C interface is handled by the macros and functions of Starlink's CNF package. The use of these macros makes the source code sufficiently portable that it runs on all Starlink supported hardware platforms.
Despite the fact that the routines are written in C, all character strings are returned as normal FORTRAN strings with trailing blanks.
The PSX routines call the C run time library.
The PSX routines report errors via EMS. While this is a standard feature of Starlink subroutine libraries, occasionally it will be necessary not to report errors via EMS. For example, if a PSX routine is used within EMS, and that PSX routine were to report an error then there is the potential for recursive error reports being generated. Also, if the PSX routines were needed on a non-Starlink system, then EMS would not necessarily be present. To try to take account of these situations, the PSX routines actually call the internal routine psx1_rep_c to report an error. This normally calls emsRep (the C interface to EMS_REP), but could be re-coded where required.
PSX POSIX interface routines