---
name: "MODULE_DEPEND"
section: "9freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/MODULE_DEPEND/9freebsd"
---

# MODULE\_DEPEND(9freebsd)

set kernel module dependencies

## NAME

**MODULE\_DEPEND** – set kernel module dependencies

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/module.h\>**

**MODULE\_DEPEND**(*name*, *moddepend*, *int minversion*, *int prefversion*, *int maxversion*);

## DESCRIPTION

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)](/loader/8.md) 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);
```

## SEE ALSO

[DECLARE\_MODULE(9)](/DECLARE_MODULE/9.md), [module(9)](/module/9.md), [MODULE\_VERSION(9)](/MODULE_VERSION/9.md)

## AUTHORS

This manual page was written by Alexander Langer ⟨*alex@FreeBSD.org*⟩.
