This will enable further migration away from lib/ast/compat_unistd.h. Note that
the `S_ISDIR` wrapper there appears incorrect, in using a platform-specific
constant for the mask. Its definition of `X_OK` also seems incorrect, as this
value has no documented meaning when calling `_access` on Windows.
Gitlab: #2204
#include <process.h> /* for getpid() and the exec..() family */
#include <direct.h> /* for _getcwd() and _chdir() */
#include <BaseTsd.h>
+#include <sys/stat.h>
#define srandom srand
#define random rand
//#define X_OK 1 /* execute permission - unsupported in windows*/
#define F_OK 0 /* Test for existence. */
+#define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR)
+
#define access _access
#define dup2 _dup2
#define execve _execve