MANDOC.DB(5) File Formats Manual MANDOC.DB(5)

mandoc.dbmanual page database

The mandoc.db file format is used to store information about installed manual pages to facilitate semantic searching for manuals. Each manual page tree contains its own mandoc.db file; see FILES for examples.

Such database files are generated by makewhatis(8) and used by man(1), apropos(1) and whatis(1).

The file format uses three datatypes:

Numbers are aligned to four-byte boundaries; where they follow strings or lists of strings, padding with additional NUL characters occurs. Some, but not all, numbers point to positions in the file. These pointers are measured in bytes, and the first byte of the file is considered to be byte 0.

Each file consists of:

The pages table contains one entry for each physical manual page file, no matter how many hard and soft links it may have in the file system. The pages table consists of:

The macros table consists of:

Each macro table consists of:

/usr/share/man/mandoc.db
The manual page database for the base system.
/usr/X11R6/man/mandoc.db
The same for the X(7) Window System.
/usr/local/man/mandoc.db
The same for packages(7).

A program to dump mandoc.db files in a human-readable format suitable for diff(1) is provided in the directory /usr/src/regress/usr.bin/mandoc/db/dbm_dump/.

apropos(1), man(1), whatis(1), makewhatis(8)

A manual page database /usr/lib/whatis first appeared in 2BSD. The present format first appeared in OpenBSD 6.1.

The original version of makewhatis(8) was written by Bill Joy in 1979. The present database format was designed by Ingo Schwarze <schwarze@openbsd.org> in 2016.

August 1, 2016 OpenBSD 6.7