Support for PREBUILT_ILLUMOS, and optional /tmp/debug.$$ output.
Forgot logerr for get_resource