cat --show-ends will now show \r\n as ^M$. Previously the \r was taken
literally, thus overwriting the first character in the line with '$'.
- cksum is now up to 4 times faster by using a slice by 8 algorithm.
+ cksum is now up to 4 times faster by using a slice by 8 algorithm,
+ and at least 8 times faster where pclmul instructions are supported.
+ A new --debug option will indicate if pclmul is being used.
df now recognizes these file systems as remote:
acfs, coda, fhgfs, gpfs, ibrix, ocfs2, and vxfs.
#define AUTHORS proper_name ("Q. Frank Xia")
+#include <getopt.h>
#include <stdio.h>
#include <sys/types.h>
#include <stdint.h>
#else /* !CRCTAB */
-# include "long-options.h"
# include "die.h"
# include "error.h"
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
+static bool debug;
+
+enum
+{
+ DEBUG_PROGRAM_OPTION = CHAR_MAX + 1,
+};
+
+static struct option const longopts[] =
+{
+ {"debug", no_argument, NULL, DEBUG_PROGRAM_OPTION},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
+ {NULL, 0, NULL, 0},
+};
+
/* Nonzero if any of the files read were the standard input. */
static bool have_read_stdin;
unsigned int edx = 0;
if (! __get_cpuid (1, &eax, &ebx, &ecx, &edx))
- return false;
+ {
+ if (debug)
+ error (0, 0, "%s", _("failed to get cpuid"));
+ return false;
+ }
- if (! (ecx & bit_PCLMUL))
- return false;
+ if (! (ecx & bit_PCLMUL) || ! (ecx & bit_AVX))
+ {
+ if (debug)
+ error (0, 0, "%s", _("pclmul support not detected"));
+ return false;
+ }
- if (! (ecx & bit_AVX))
- return false;
+ if (debug)
+ error (0, 0, "%s", _("using pclmul hardware support"));
return true;
}
int
main (int argc, char **argv)
{
- int i;
+ int i, c;
bool ok;
initialize_main (&argc, &argv);
so that processes running in parallel do not intersperse their output. */
setvbuf (stdout, NULL, _IOLBF, 0);
- parse_gnu_standard_options_only (argc, argv, PROGRAM_NAME, PACKAGE, Version,
- true, usage, AUTHORS, (char const *) NULL);
+ while ((c = getopt_long (argc, argv, "", longopts, NULL)) != -1)
+ {
+ switch (c)
+ {
+ case DEBUG_PROGRAM_OPTION:
+ debug = true;
+ break;
+
+ case_GETOPT_HELP_CHAR;
+
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+
+ default:
+ usage (EXIT_FAILURE);
+ }
+ }
have_read_stdin = false;