Index: head/usr.bin/primes/primes.c =================================================================== --- head/usr.bin/primes/primes.c +++ head/usr.bin/primes/primes.c @@ -61,6 +61,7 @@ * validation check: there are 664579 primes between 0 and 10^7 */ +#include #include #include #include @@ -70,6 +71,7 @@ #include #include #include +#include #include #include "primes.h" @@ -99,6 +101,12 @@ int ch; char *p; + /* Cache NLS data, for strerror, for err(3), before cap_enter. */ + (void)catopen("libc", NL_CAT_LOCALE); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "cap_enter"); + while ((ch = getopt(argc, argv, "h")) != -1) switch (ch) { case 'h':