get rid of half-assed posix errno handling in favor of system_error