Re: Crash when reading from a PIPE:
Posted: Sat Mar 08, 2025 8:04 am
Thanks for this great information Colin, and I must say that the new AutoDoc for SystemTags() is very good.
There is just one problem! I got it working with SystemTags() and then I found this comment in my code:
/* Load the command executable into memory and use the returned segment list to create a new process */
/* with CreateNewProcTags(). We do it like this because this is the only way to capture the child's */
/* exit code. Using SystemTags() results in the shell's exit code being returned, not the child's */
Now I remember the history. I checked my git history, and for years until 2023 I used SystemTags(), but then a user asked for me to add the ability to return the return code of the program that was being launched. I couldn't figure out how to do this using SystemTags(), so that's why I switched to CreateNewProcTags(). Now I changed it back to SystemTags() and pass in NP_ExitCode and NP_ExitData (which the OS4 AutoDocs say you can do) but on OS3 when the NP_ExitCode function is called, it gets a crazy exit code value in d0. On OS4 it gets the correct value. This is with an m68k executable.
Is passing NP_ExitCode and NP_ExitData into SystemTags() only supported on OS4?
There is just one problem! I got it working with SystemTags() and then I found this comment in my code:
/* Load the command executable into memory and use the returned segment list to create a new process */
/* with CreateNewProcTags(). We do it like this because this is the only way to capture the child's */
/* exit code. Using SystemTags() results in the shell's exit code being returned, not the child's */
Now I remember the history. I checked my git history, and for years until 2023 I used SystemTags(), but then a user asked for me to add the ability to return the return code of the program that was being launched. I couldn't figure out how to do this using SystemTags(), so that's why I switched to CreateNewProcTags(). Now I changed it back to SystemTags() and pass in NP_ExitCode and NP_ExitData (which the OS4 AutoDocs say you can do) but on OS3 when the NP_ExitCode function is called, it gets a crazy exit code value in d0. On OS4 it gets the correct value. This is with an m68k executable.
Is passing NP_ExitCode and NP_ExitData into SystemTags() only supported on OS4?