Index: libiberty/pex-common.c
--- a/libiberty/pex-common.c
+++ b/libiberty/pex-common.c
@@ -1,3 +1,12 @@
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#endif
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200112L
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 /* Common code for executing a program in a sub-process.
    Copyright (C) 2005-2022 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@airs.com>.
