won’t be able to tell the difference if the exec’ed program returned 255.

Maybe a pipe could be used instead of the 255 exit code?  Unless that’s too slow/has side-effects