aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fstat
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
commitdf3f5d9dd51fa82a604ec559a75d3791a7b80ed5 (patch)
treeb6c05d5088be1b1275d5422f8b002b9cd42ff1b7 /usr.bin/fstat
parent18dac96b7bf3831c3d8393ab93b391c2ca65e6a1 (diff)
Notes
Diffstat (limited to 'usr.bin/fstat')
-rw-r--r--usr.bin/fstat/fstat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index fbfaacbc21bf8..84fd799132243 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)fstat.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)fstat.c 8.3 (Berkeley) 5/2/95";
#endif /* not lint */
#include <sys/param.h>
@@ -65,7 +65,9 @@ static char sccsid[] = "@(#)fstat.c 8.1 (Berkeley) 6/6/93";
#include <sys/mount.h>
#include <nfs/nfsproto.h>
#include <nfs/rpcv2.h>
+#define KERNEL
#include <nfs/nfs.h>
+#undef KERNEL
#include <nfs/nfsnode.h>
#undef NFS
@@ -79,12 +81,14 @@ static char sccsid[] = "@(#)fstat.c 8.1 (Berkeley) 6/6/93";
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
+#include <limits.h>
#include <nlist.h>
#include <paths.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#define TEXT -1
#define CDIR -2
@@ -164,6 +168,7 @@ main(argc, argv)
struct kinfo_proc *p, *plast;
int arg, ch, what;
char *memf, *nlistf;
+ char buf[_POSIX2_LINE_MAX];
int cnt;
arg = 0;
@@ -238,8 +243,8 @@ main(argc, argv)
if (nlistf != NULL || memf != NULL)
setgid(getgid());
- if ((kd = kvm_open(nlistf, memf, NULL, O_RDONLY, NULL)) == NULL) {
- fprintf(stderr, "fstat: %s\n", kvm_geterr(kd));
+ if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) {
+ fprintf(stderr, "fstat: %s\n", buf);
exit(1);
}
#ifdef notdef