Index: par.c --- par.c.orig +++ par.c @@ -20,6 +20,7 @@ #include #include #include +#include #undef NULL #define NULL ((void *) 0) @@ -730,6 +731,13 @@ int main(int argc, const char * const *argv) /* Set the current locale from the environment: */ setlocale(LC_ALL,""); + +/* setlocale() needs "rpath", so do the syscall after it */ + + if (pledge("stdio", NULL) == -1) { + wcscpy(errmsg, L"pledge\n"); + goto parcleanup; + } /* Process environment variables: */