diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 13:43:33 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 13:43:33 +0000 |
commit | deba7db48c7897a6302d3d706887bbddc3604c00 (patch) | |
tree | de15b52a10645135d816eb7c2d0fdc19e613c445 /usr.bin/fstat/fstat.c | |
parent | dc74a95b3c87ac7e618302b89dfff6205c05cfc0 (diff) | |
download | FreeBSD-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.c | 11 |
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 |