summaryrefslogtreecommitdiffstats
path: root/sbin/kldstat
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>1997-10-19 11:15:45 +0000
committerjmg <jmg@FreeBSD.org>1997-10-19 11:15:45 +0000
commit075da1dbb990ca02802b89d73266b82c6c776b11 (patch)
treeedfa02a1745e2182653df33aba56af68d6520ed6 /sbin/kldstat
parent804107bc406012014ee4aa55efc2e153232e6eac (diff)
downloadFreeBSD-src-075da1dbb990ca02802b89d73266b82c6c776b11.zip
FreeBSD-src-075da1dbb990ca02802b89d73266b82c6c776b11.tar.gz
activate the programs that will be used to manipulate kld modules
fix a few problems with missing headers, warn called with an exit value, and undeclared getopt vars these programs now compile -Wall clean (and yes, I know I should use more than just -Wall) :)
Diffstat (limited to 'sbin/kldstat')
-rw-r--r--sbin/kldstat/Makefile4
-rw-r--r--sbin/kldstat/kldstat.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/sbin/kldstat/Makefile b/sbin/kldstat/Makefile
index 27cdf27..ff5d75c 100644
--- a/sbin/kldstat/Makefile
+++ b/sbin/kldstat/Makefile
@@ -23,11 +23,13 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id$
+# $Id: Makefile,v 1.1 1997/05/07 18:19:54 dfr Exp $
#
PROG= kldstat
SRCS= kldstat.c
MAN8= kldstat.8
+CFLAGS= -I${.CURDIR}/../../sys
+
.include <bsd.prog.mk>
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c
index edb045f..9b6b2dd 100644
--- a/sbin/kldstat/kldstat.c
+++ b/sbin/kldstat/kldstat.c
@@ -23,16 +23,21 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: kldstat.c,v 1.1 1997/05/07 18:19:54 dfr Exp $
*/
+#include <err.h>
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/module.h>
#include <sys/linker.h>
+extern char *optarg;
+extern int optind;
+
static char* progname;
static void printmod(int modid)
@@ -41,7 +46,7 @@ static void printmod(int modid)
stat.version = sizeof(struct module_stat);
if (modstat(modid, &stat) < 0)
- warn(1, "Can't state module");
+ warn("Can't stat module id %d", modid);
else
printf("\t\t%2d %s\n", stat.id, stat.name);
}
@@ -53,9 +58,9 @@ static void printfile(int fileid, int verbose)
stat.version = sizeof(struct kld_file_stat);
if (kldstat(fileid, &stat) < 0)
- warn(1, "Can't stat file");
+ warn("Can't stat file id %d", fileid);
else
- printf("%2d %4d %-8x %-8x %s\n",
+ printf("%2d %4d %p %-8x %s\n",
stat.id, stat.refs, stat.address, stat.size, stat.name);
if (verbose) {
OpenPOWER on IntegriCloud