]> granicus.if.org Git - sysstat/blobdiff - cifsiostat.c
sar/sadc: Add stable identifier support for disks statistics
[sysstat] / cifsiostat.c
index fc95437af11d6d1c9c4fc803dfd30c5c76762492..936f95c83ead90e68a571cdbd9a1c6209dc8f059 100644 (file)
 char *sccsid(void) { return (SCCSID); }
 #endif
 
+#ifdef TEST
+void int_handler(int n) { return; }
+#endif
+
 unsigned long long uptime_cs[2] = {0, 0};
 struct cifs_stats *st_cifs[2];
 struct io_hdr_stats *st_hdr_cifs;
@@ -53,6 +57,7 @@ struct io_hdr_stats *st_hdr_cifs;
 int cifs_nr = 0;       /* Nb of CIFS mounted directories found */
 int cpu_nr = 0;                /* Nb of processors on the machine */
 int flags = 0;         /* Flag for common options and system state */
+int dplaces_nr = -1;   /* Number of decimal places */
 
 long interval = 0;
 char timestamp[TIMESTAMP_LEN];
@@ -74,10 +79,10 @@ void usage(char *progname)
 
 #ifdef DEBUG
        fprintf(stderr, _("Options are:\n"
-                         "[ --human ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ --debuginfo ]\n"));
+                         "[ --dec={ 0 | 1 | 2 } ] [ --human ] [ -h ] [ -k | -m ] [ -t ] [ -V ] [ --debuginfo ]\n"));
 #else
        fprintf(stderr, _("Options are:\n"
-                         "[ --human ] [ -h ] [ -k | -m ] [ -t ] [ -V ]\n"));
+                         "[ --dec={ 0 | 1 | 2 } ] [ --human ] [ -h ] [ -k | -m ] [ -t ] [ -V ]\n"));
 #endif
        exit(1);
 }
@@ -609,6 +614,15 @@ int main(int argc, char **argv)
                        opt++;
                }
 
+               else if (!strncmp(argv[opt], "--dec=", 6) && (strlen(argv[opt]) == 7)) {
+                       /* Get number of decimal places */
+                       dplaces_nr = atoi(argv[opt] + 6);
+                       if ((dplaces_nr < 0) || (dplaces_nr > 2)) {
+                               usage(argv[0]);
+                       }
+                       opt++;
+               }
+
                else if (!strncmp(argv[opt], "-", 1)) {
                        for (i = 1; *(argv[opt] + i); i++) {
 
@@ -683,7 +697,7 @@ int main(int argc, char **argv)
        get_localtime(&rectime, 0);
 
        /* Get system name, release number and hostname */
-       uname(&header);
+       __uname(&header);
        if (print_gal_header(&rectime, header.sysname, header.release,
                             header.nodename, header.machine, cpu_nr,
                             PLAIN_OUTPUT)) {