Update: Implement "rerun" and properly get failed execute status codes.
Provide "rerun" support feature.
I discovered some problems with the execute functions after testing the "rerun" feature.
Specifically, when a child exits, the exit code is not properly propogating to the caller.
This makes it impossible to detect a failed execution.
It turns out that I need to call exit() with the appropriate failed code (which is only 8-bits).
The pthread_exit() is documented as always exit() with a value of 0.
This makes it impossible to communicate the failed state to the parent via an exit return code.
I am forced to call exit() here.
To do this, several significant changes are required.
Implement F_execute_codes enum and related functions to handle the 8-bit large status codes.
The limited set of codes are focused on possible failure states from the execute functions.
Functions to convert to and from regular status codes and these special limited execute status codes are now provided.
A union called f_execute_result_t is now provided as a way for the execute functions to return a pid_t for the parent process and an int for the child process.
The int in this case is intended to hold the special execute status codes.
An int is used rather than a more appropriate uint8_t because the standard POSIX functions use int.
Additional normal status codes F_too_large and F_too_small are now provided as generic too large and too small statuses.
Exit calls now directly use the execute status codes when calling exit().
The controller program child process now returns the exit status code either at the end of the appropraite threads or at the end of the main().
A new micro time conversion function is provided so that the deprecated usleep() can be avoided.
I may end up rewriting this to perform the sleep as well rather than just return a timespec.
Yet another htop rule is provided for testing "rerun".
See the previous commit for additional details (
5b09409e3c7b5eafc164405c5d487bdfd083be11).