At the moment, both syscalls store the error number in td_retval[0] and
return 0, indicating success. This has two problems:
- td_errno is not set, so errors are not made visible to ktrace and dtrace in the usual way
- negative error numbers such as ERESTART, which are supposed to be interpreted by the kernel, are returned to userland
Thus, set td_errno and use TDP_NERRNO to ensure that it is not set by
the kernel syscall layer, and return negative errors directly.