aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
commit65a311fcb2f44fce7eb05160d3198cefed5c27f9 (patch)
treed2eb15e6477b3d5e7e1f7c49c1e2eed3b85ec318 /sbin
parent1a946b9fef9f4b4cd10611232e8844d4c2d33e69 (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/kldunload/kldunload.87
-rw-r--r--sbin/kldunload/kldunload.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/sbin/kldunload/kldunload.8 b/sbin/kldunload/kldunload.8
index f74965613500..935e5afb71ed 100644
--- a/sbin/kldunload/kldunload.8
+++ b/sbin/kldunload/kldunload.8
@@ -33,9 +33,11 @@
.Nd unload a file from the kernel
.Sh SYNOPSIS
.Nm
+.Op Fl f
.Op Fl v
.Fl i Ar id
.Nm
+.Op Fl f
.Op Fl v
.Op Fl n
.Ar name
@@ -47,6 +49,11 @@ utility unloads a file which was previously loaded with
.Pp
The following options are available:
.Bl -tag -width indentXX
+.It Fl f
+Force the unload.
+This ignores error returns to MOD_QUISCE from the module and implies
+that the module should be unloaded even if it is currently in use.
+The users are left to cope as best they can.
.It Fl v
Be more verbose.
.It Fl i Ar id
diff --git a/sbin/kldunload/kldunload.c b/sbin/kldunload/kldunload.c
index be86960b3e17..29da28d07774 100644
--- a/sbin/kldunload/kldunload.c
+++ b/sbin/kldunload/kldunload.c
@@ -48,10 +48,14 @@ main(int argc, char** argv)
int c;
int verbose = 0;
int fileid = 0;
+ int force = LINKER_UNLOAD_NORMAL;
char* filename = NULL;
- while ((c = getopt(argc, argv, "i:n:v")) != -1)
+ while ((c = getopt(argc, argv, "fi:n:v")) != -1)
switch (c) {
+ case 'f':
+ force = LINKER_UNLOAD_FORCE;
+ break;
case 'i':
fileid = atoi(optarg);
if (!fileid)
@@ -93,7 +97,7 @@ main(int argc, char** argv)
printf("Unloading %s, id=%d\n", stat.name, fileid);
}
- if (kldunload(fileid) < 0)
+ if (kldunloadf(fileid, force) < 0)
err(1, "can't unload file");
return 0;