7 Syscall Interface

Some of the MPLAB XC compilers use architecture-specific macros and functions to explicitly perform system calls that are needed by many other standard library functions. To reduce the resources used, these syscall functions are designed to have limited functionality.

The syscall functions described in the sections that follow are provided as weak stub definitions. These stubs provide reasonable behavior where the functionality is unimplemented, generally returning an error or trivial result. These functions can be modified by user code as required and included into a project to customize the behavior of certain library functions.

Those stubs that always fail (e.g. open) can optionally use the .gnu.warning mechanism to cause linker warnings when linked. This is controlled by the __DISABLE_WARNINGS__ macro used by arch/mchp/mchp.h.

The source code for those stub functions implemented by MPLAB XC16 and XC-DSC can be obtained by unzipping the archive src/libpic30.zip provided with the compiler.