This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Hurd] MSG_NOSIGNAL implementation
- From: Roland McGrath <roland at redhat dot com>
- To: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 1 Jul 2008 12:18:42 -0700 (PDT)
- Subject: Re: [Hurd] MSG_NOSIGNAL implementation
- References: <20080630224933.GD4966@implementation>
First, about the constant's value. Don't add a new file, just use the
existing bsd4.4 file. Remember, being in that sysdeps directory doesn't
really mean "what 4.4BSD had"--it just means what all the actual glibc
configurations that inherit that file need. That file does have the
things that the BSDs had in common before they diverged, because the
file was there since before they did. For things added later, I think
in the past I have used NetBSD values. Do that. If there is a working
configuration for freebsd in the future (or in an add-on port), it can
add a new divergent file.
Second, about the implementation. A style nit, put & expressions inside
(). Even when we really do know the precedence rules, they aren't
obvious. A more substantive style point: don't repeat that magic in all
those places, have it shared in a new inline. The actually substantive
point: that code is wrong. MSG_NOSIGNAL affects the EPIPE/SIGPIPE case
only. It should not affect the SIGLOST case. So, something like:
_HURD_FD_H_EXTERN_INLINE int
__hurd_sockfail (int fd, int flags, error_t err)
{
if (!(flags & MSG_NOSIGNAL) || err != EPIPE)
err = _hurd_fd_error (fd, err);
errno = err;
return -1;
}
Thanks,
Roland