Index: par.c
--- par.c.orig
+++ par.c
@@ -14,6 +14,7 @@
 #include "buffer.h"    /* Also includes <stddef.h>. */
 #include "reformat.h"
 
+#include <unistd.h>
 #include <ctype.h>
 #include <locale.h>
 #include <stdio.h>
@@ -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: */
 
