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.

With the exception of sbrk(), which is fully implemented, 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.