mandoc.db man page

mandoc.db ā€” manual page database

Description

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:

Files

/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/.

See Also

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

History

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

Authors

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.

Info

August 1, 2016