MODULE_DEPEND(9)

MODULE_DEPEND9

Set kernel module dependencies

Usage

#include <sys/param.h>

#include <sys/module.h>

MODULE_DEPEND(name, moddepend, int minversion, int prefversion, int maxversion);

Overview

The MODULE_DEPEND() macro sets a dependency on another kernel module with name moddepend, which has registered its version with MODULE_VERSION().

The MODULE_DEPEND() macro provides hints to the kernel loader(8) and to the kernel linker to ensure that the named dependency is loaded prior to the existing module. It does not change or dictate the order in which modules are initialized at runtime.

Three versions must be specified for moddepend:

minversion

The minimum version on which the current module can depend.

maxversion

The maximum version on which the current module can depend.

prefversion

The preferred version on which the current module can depend.

Examples

MODULE_DEPEND(foo, bar, 1, 3, 4);

Releases

65 releases since FreeBSD 4.4-RELEASE; the text changed 36 times.

  1. 4.4
  2. 4.5–4.11
  3. 5.0–5.3
  4. 5.4–5.5
  5. 6.0–6.3
  6. 6.4
  7. 7.0
  8. 7.1
  9. 7.2
  10. 7.3
  11. 7.4
  12. 8.0
  13. 8.1
  14. 8.2
  15. 8.3
  16. 8.4
  17. 9.0
  18. 9.1
  19. 9.2
  20. 9.3
  21. 10.0
  22. 10.1
  23. 10.2
  24. 10.3
  25. 10.4
  26. 11.0
  27. 11.1
  28. 11.2
  29. 11.3
  30. 11.4
  31. 12.0
  32. 12.1
  33. 12.2
  34. 12.3
  35. 12.4
  36. 13.0–13.2
  37. 13.3–16.0

Authors

This manual page was written by Alexander Langer ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.