summaryrefslogtreecommitdiffstats
path: root/usr.bin/fstat/fstat.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
committerpeter <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
commitdeba7db48c7897a6302d3d706887bbddc3604c00 (patch)
treede15b52a10645135d816eb7c2d0fdc19e613c445 /usr.bin/fstat/fstat.c
parentdc74a95b3c87ac7e618302b89dfff6205c05cfc0 (diff)
downloadFreeBSD-src-deba7db48c7897a6302d3d706887bbddc3604c00.zip
FreeBSD-src-deba7db48c7897a6302d3d706887bbddc3604c00.tar.gz
Merge from Lite2
Diffstat (limited to 'usr.bin/fstat/fstat.c')
-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 fbfaacb..84fd799 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
OpenPOWER on IntegriCloud