在 2024-05-04 20:18, Pali Rohár 写道:
msvcrt's execve splits every member of arglist to more arguments by space. If you want to prevent this splitting then you need to quote argument as:
Each Windows process receives its command-line arguments as a whole string and has to parse it with `__getmainargs()`, unlike on Linux etc. where arguments are passed directly as a `char**`.
So in my opinion, for compatibility with POSIX (when one of those macro is defined, like _POSIX_C_SOURCE) then mingw-w64 should provide also POSIX compatible execve() function wrapper.
I think that nobody would ever prefer `_execve()` because it's a Unix relic. It would not be very useful without `fork()`.
And we probably should not be reproducing Unix too much. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public