Porting to OS/2: Case #17 spawn...()
Many Unix programs seem not to care about command line length. So sometimes they pass a very long command line to a child program. However, OS/2 has a limitation for a command line length. It's 32KB. If a length is longer than 32KB, then OS/2 cannot execute a child program. If so, there is no way to workaround this ? Fortunately, there is a way in case of kLIBC. kLIBC supports a response file as an argument. Instead of passing arguments to a child program directly, passing arguments via a response file is the way. Here is spwanvpe() to pass a very long command line as a response file. https://github.com/komh/os2compat/blob/master/process/spawnvpe.c And a test program. https://github.com/komh/os2compat/blob/master/testcase/spawnvpe-1.c https://github.com/komh/os2compat/blob/master/testcase/spawnvpe-1-child.c How to build spawnvpe-1.exe gcc spwanvpe-1.c spawnvpe.c How to build spawnvpe-1-child.c gcc spawnvpe-1-child.c Other spawnl...() and spawnv...() can ...