aboutsummaryrefslogtreecommitdiff
path: root/sbin/kldstat
diff options
context:
space:
mode:
authorJohn-Mark Gurney <jmg@FreeBSD.org>1997-10-21 09:59:26 +0000
committerJohn-Mark Gurney <jmg@FreeBSD.org>1997-10-21 09:59:26 +0000
commit2830148a29f76ad83de6693dad770c5c8240c55e (patch)
tree365b023bfc9ea7336245d53acc0211cc9ae73392 /sbin/kldstat
parent9cf7c6b0e5ffd15b604f59da7438b8ea8d38ff26 (diff)
downloadsrc-2830148a29f76ad83de6693dad770c5c8240c55e.tar.gz
src-2830148a29f76ad83de6693dad770c5c8240c55e.zip
Notes
Diffstat (limited to 'sbin/kldstat')
-rw-r--r--sbin/kldstat/kldstat.812
-rw-r--r--sbin/kldstat/kldstat.c29
2 files changed, 21 insertions, 20 deletions
diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8
index bafdb2207345..2dbf2a48bbab 100644
--- a/sbin/kldstat/kldstat.8
+++ b/sbin/kldstat/kldstat.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id$
+.\" $Id: kldstat.8,v 1.1 1997/05/07 18:19:54 dfr Exp $
.\"
.Dd April 25, 1997
.Dt KLDSTAT 8
@@ -43,7 +43,7 @@ utility displays the status of any files dynamically linked into the
kernel.
.Pp
The options are:
-.Bl -tag -width indent
+.Bl -tag -width XXXXXXX -offset indent
.It Fl v
Be more verbose.
.It Fl i Ar id
@@ -54,7 +54,13 @@ Display the status of only the file with this name.
.Sh SEE ALSO
.Xr kldload 8 ,
.Xr kldunload 8
+.Sh HISTORY
+The
+.Nm
+command first appeared in
+.Fx 3.0 .
.Sh AUTHOR
.Bl -tag
-Doug Rabson, dfr@freebsd.org
+Doug Rabson
+.Aq dfr@freebsd.org
.El.
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c
index 9b6b2dded4c1..b07fc62dc7f2 100644
--- a/sbin/kldstat/kldstat.c
+++ b/sbin/kldstat/kldstat.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kldstat.c,v 1.1 1997/05/07 18:19:54 dfr Exp $
+ * $Id: kldstat.c,v 1.2 1997/10/19 11:15:44 jmg Exp $
*/
#include <err.h>
@@ -35,12 +35,8 @@
#include <sys/module.h>
#include <sys/linker.h>
-extern char *optarg;
-extern int optind;
-
-static char* progname;
-
-static void printmod(int modid)
+static void
+printmod(int modid)
{
struct module_stat stat;
@@ -73,31 +69,31 @@ static void printfile(int fileid, int verbose)
}
static void
-usage()
+usage(void)
{
- fprintf(stderr, "usage: %s [-v]\n", progname);
+ fprintf(stderr, "usage: kldstat [-v]\n");
exit(1);
}
-int main(int argc, char** argv)
+int
+main(int argc, char** argv)
{
int c;
int verbose = 0;
int fileid = 0;
char* filename = 0;
- progname = argv[0];
- while ((c = getopt(argc, argv, "vi:n:")) != -1)
+ while ((c = getopt(argc, argv, "i:n:v")) != -1)
switch (c) {
- case 'v':
- verbose = 1;
- break;
case 'i':
fileid = atoi(optarg);
break;
case 'n':
filename = optarg;
break;
+ case 'v':
+ verbose = 1;
+ break;
default:
usage();
}
@@ -108,8 +104,7 @@ int main(int argc, char** argv)
usage();
if (filename) {
- fileid = kldfind(filename);
- if (fileid < 0)
+ if ((fileid = kldfind(filename)) < 0)
err(1, "Can't find file %s", filename);
}