From cc8a9eb93c97bec3e139f384353d82f205d55fd7 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 24 Dec 2024 12:20:48 -0800 Subject: [PATCH] Document execve() limitation on Windows Closes #1253 --- libc/proc/execve.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/proc/execve.c b/libc/proc/execve.c index b610f8b29fd..a88ed55b463 100644 --- a/libc/proc/execve.c +++ b/libc/proc/execve.c @@ -57,6 +57,11 @@ * compiled by MSVC or Cygwin is launched instead, then only the stdio * file descriptors can be passed along. * + * On Windows, the parent process must be a cosmo program. If you're + * calling execve() from a program that wasn't launched by cosmopolitan + * bash, or some similar program, then ask yourself if what you really + * want is to either (a) call fork() first, or (b) use posix_spawn(). + * * On Windows, `argv` and `envp` can't contain binary strings. They need * to be valid UTF-8 in order to round-trip the WIN32 API, without being * corrupted.