When reporting errors in the Hurd part of glibc, please use these
functions. They can be found in $glibc-SRC/hurd/hurd/fd.h.
`__hurd_fail (error_t err)`
The __hurd_fail () inline function is the recommended way of
reporting errors in the Hurd part of glibc. It is more concise than {
errno = err; return -1; }, and it translates some MIG and Mach errors
into POSIX errors.
You can see some example uses of it from this email to bug-hurd.
extern int __hurd_dfail (int fd, error_t err);
Handle error code ERR from an RPC on file descriptor FD's port.
This function converts some errors into signals as expressed by
POSIX. It sets errno to the appropriate error code and always return
-1. Most developers will rarely use this function, since __hurd_fail
() handles most usecases.
`_hurd_fd_error (error_t err)`
Handle an error from an RPC on a file descriptor's port. This
function is almost the same as __hurd_dfail (). _hurd_fd_error ()
returns the error, while __hurd_dfail () sets errno and returns
-1. You should always use this function to handle errors from RPCs
made on file descriptor ports. Some errors are translated into
signals.
`__hurd_sockfail (int fd, int flags, error_t err)`
Handle error code ERR from an RPC on file descriptor FD's port. Set
errno to the appropriate error code, and always return -1. It
differs from __hurd_dfail () in that it does not raise SIGPIPE on
EPIPE if flags contain MSG_NOSIGNAL.
extern int _hurd_fd_error_signal (error_t err);
Check if ERR should generate a signal. Returns the signal to take, or zero if none.
