This talk describes the extended error messages that can now be returned by the FreeBSD kernel. This facility was added in May 2025 shortly before the release of 15.0. The goal was to reduce the terseness of commonly overloaded error codes like EINVAL which occurs at many places in a given system call. For example, the mmap(2) system call can return EINVAL for thirteen different reasons. The single terse error "Invalid argument" is now expanded with thirteen detailed error messages.
This talk will explain how the extended error facility has been added to the kernel, with a brief tutorial on how to incorporate its use into additional kernel subsystems. The talk will conclude by describing how the return and display of extended kernel error messages has been integrated into the err(3) error message system which is already used by many programs and utilities.