diff options
author | markm <markm@FreeBSD.org> | 2004-06-20 17:42:35 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2004-06-20 17:42:35 +0000 |
commit | ae932b023a4b823f78d8a2ca7ab77b209496fef5 (patch) | |
tree | 43a30f95eeaa07cf2e0aa0b0314e2dbf02c7659d | |
parent | 1183f24cdee8e86902d84beeb71a40dfd639821f (diff) | |
download | FreeBSD-src-ae932b023a4b823f78d8a2ca7ab77b209496fef5.zip FreeBSD-src-ae932b023a4b823f78d8a2ca7ab77b209496fef5.tar.gz |
Give zlib the ability to be a module that can be depended on,
in the MODULE_DEPEND() sense.
-rw-r--r-- | sys/modules/zlib/Makefile | 8 | ||||
-rw-r--r-- | sys/net/zlib.c | 24 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile new file mode 100644 index 0000000..0a475b5 --- /dev/null +++ b/sys/modules/zlib/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= zlib +SRCS= zlib.c + +.include <bsd.kmod.mk> diff --git a/sys/net/zlib.c b/sys/net/zlib.c index e6e1286..b25d4a2 100644 --- a/sys/net/zlib.c +++ b/sys/net/zlib.c @@ -57,6 +57,8 @@ #include <sys/time.h> #include <sys/systm.h> #include <sys/param.h> +#include <sys/kernel.h> +#include <sys/module.h> # define HAVE_MEMCPY #else @@ -5380,3 +5382,25 @@ uLong adler32(adler, buf, len) return (s2 << 16) | s1; } /* --- adler32.c */ + +#ifdef _KERNEL +static int +zlib_modevent(module_t mod, int type, void *unused) +{ + switch (type) { + case MOD_LOAD: + return 0; + case MOD_UNLOAD: + return 0; + } + return EINVAL; +} + +static moduledata_t zlib_mod = { + "zlib", + zlib_modevent, + 0 +}; +DECLARE_MODULE(zlib, zlib_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); +MODULE_VERSION(zlib, 1); +#endif /* _KERNEL */ |