EuroBSDCon 2026

Getting Extended Error Messages from the FreeBSD Kernel
2026-09-13 , D.0.02

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.

Dr. Marshall Kirk McKusick writes books and articles, teaches classes on UNIX- and BSD-related subjects, and provides expert-witness testimony on software patent, trade secret, and copyright issues particularly those related to operating systems and filesystems. He has been a developer and committer to the FreeBSD Project since shortly after its founding in 1993. While at the University of California at Berkeley, he implemented the 4.2BSD fast filesystem and was the Research Computer Scientist at the Berkeley Computer Systems Research Group (CSRG) overseeing the development and release of 4.3BSD and 4.4BSD. He earned his undergraduate degree in electrical engineering from Cornell University and did his graduate work at the University of California at Berkeley, where he received master's degrees in computer science and business administration and a doctoral degree in computer science. He has twice been president of the board of the Usenix Association, served nine years as a board member and treasurer of the FreeBSD Foundation, is a senior member of the IEEE, and a member of ACM, and AAAS.

In his spare time, he enjoys swimming, scuba diving, and wine collecting. The wine is stored in a specially constructed wine cellar (accessible from the Web at http://www.mckusick.com/~mckusick/) in the basement of the house that he shares with Eric Allman, his partner of 47-and-some-odd years and husband since 2013.

This speaker also appears in: