Deleted Added
full compact
nfsstat.c (238701) nfsstat.c (243783)
1/*
2 * Copyright (c) 1983, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 27 unchanged lines hidden (view full) ---

36 The Regents of the University of California. All rights reserved.\n";
37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95";
42#endif
43static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 27 unchanged lines hidden (view full) ---

36 The Regents of the University of California. All rights reserved.\n";
37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95";
42#endif
43static const char rcsid[] =
44 "$FreeBSD: head/usr.bin/nfsstat/nfsstat.c 238701 2012-07-22 18:59:31Z hrs $";
44 "$FreeBSD: head/usr.bin/nfsstat/nfsstat.c 243783 2012-12-02 01:20:43Z rmacklem $";
45#endif /* not lint */
46
47#include <sys/param.h>
48#include <sys/module.h>
49#include <sys/mount.h>
50#include <sys/time.h>
51#include <sys/sysctl.h>
52#include <nfs/nfsproto.h>

--- 49 unchanged lines hidden (view full) ---

102main(int argc, char **argv)
103{
104 u_int interval;
105 int clientOnly = -1;
106 int serverOnly = -1;
107 int ch;
108 char *memf, *nlistf;
109 char errbuf[_POSIX2_LINE_MAX];
45#endif /* not lint */
46
47#include <sys/param.h>
48#include <sys/module.h>
49#include <sys/mount.h>
50#include <sys/time.h>
51#include <sys/sysctl.h>
52#include <nfs/nfsproto.h>

--- 49 unchanged lines hidden (view full) ---

102main(int argc, char **argv)
103{
104 u_int interval;
105 int clientOnly = -1;
106 int serverOnly = -1;
107 int ch;
108 char *memf, *nlistf;
109 char errbuf[_POSIX2_LINE_MAX];
110 int mntlen, i;
111 char buf[1024];
112 struct statfs *mntbuf;
113 struct nfscl_dumpmntopts dumpmntopts;
110
111 interval = 0;
112 memf = nlistf = NULL;
114
115 interval = 0;
116 memf = nlistf = NULL;
113 while ((ch = getopt(argc, argv, "cesWM:N:ow:z")) != -1)
117 while ((ch = getopt(argc, argv, "cesWM:mN:ow:z")) != -1)
114 switch(ch) {
115 case 'M':
116 memf = optarg;
117 break;
118 switch(ch) {
119 case 'M':
120 memf = optarg;
121 break;
122 case 'm':
123 /* Display mount options for NFS mount points. */
124 mntlen = getmntinfo(&mntbuf, MNT_NOWAIT);
125 for (i = 0; i < mntlen; i++) {
126 if (strcmp(mntbuf->f_fstypename, "nfs") == 0) {
127 dumpmntopts.ndmnt_fname =
128 mntbuf->f_mntonname;
129 dumpmntopts.ndmnt_buf = buf;
130 dumpmntopts.ndmnt_blen = sizeof(buf);
131 if (nfssvc(NFSSVC_DUMPMNTOPTS,
132 &dumpmntopts) >= 0)
133 printf("%s on %s\n%s\n",
134 mntbuf->f_mntfromname,
135 mntbuf->f_mntonname, buf);
136 }
137 mntbuf++;
138 }
139 exit(0);
118 case 'N':
119 nlistf = optarg;
120 break;
121 case 'W':
122 widemode = 1;
123 break;
124 case 'w':
125 interval = atoi(optarg);

--- 515 unchanged lines hidden (view full) ---

641 printf("\n");
642 fflush(stdout);
643}
644
645void
646usage(void)
647{
648 (void)fprintf(stderr,
140 case 'N':
141 nlistf = optarg;
142 break;
143 case 'W':
144 widemode = 1;
145 break;
146 case 'w':
147 interval = atoi(optarg);

--- 515 unchanged lines hidden (view full) ---

663 printf("\n");
664 fflush(stdout);
665}
666
667void
668usage(void)
669{
670 (void)fprintf(stderr,
649 "usage: nfsstat [-ceoszW] [-M core] [-N system] [-w wait]\n");
671 "usage: nfsstat [-cemoszW] [-M core] [-N system] [-w wait]\n");
650 exit(1);
651}
652
653static char SPBuf[64][8];
654static int SPIndex;
655
656char *
657sperc1(int hits, int misses)

--- 371 unchanged lines hidden ---
672 exit(1);
673}
674
675static char SPBuf[64][8];
676static int SPIndex;
677
678char *
679sperc1(int hits, int misses)

--- 371 unchanged lines hidden ---