NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/57390: misleading error message in mq_send(3) for empty message
The following reply was made to PR kern/57390; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/57390: misleading error message in mq_send(3) for empty message
Date: Fri, 05 May 2023 03:29:24 +0700
Date: Thu, 4 May 2023 04:55:01 +0000 (UTC)
From: David Holland <dholland-bugs%netbsd.org@localhost>
Message-ID: <20230504045501.7D2CE1A923B%mollari.NetBSD.org@localhost>
| https://pubs.opengroup.org/onlinepubs/007904975/functions/mq_send.html
| doesn't seem to leave room for zero failing. (Note that it can't
| actually be < 0 because it's unsigned.) So maybe it should not do that
| check.
|
| (That's from 2004 but as usual I can't find the newer ones by searching)
The latest drafts are no different, for both mq_send() and send() there
seems to be no POSIX requirement that the length be > 0, and EMSGSIZE is
(still) for a message too long for the socket (or message queue).
So, if the rest of the system code can handle it, without causing other
(kernel or application) failures (need to consider the effects of receiving
a zero length message) then removing the test for >0 might not hurt.
However, as long as it remains, EMSGSIZE is the obvious (and correct) error
to return - despite the strerror(EMSGSIZE) result. Those strings are based
upon historical uses of the error codes, and there are several examples where,
while the original use remains valid, and the associated string applicable for
that case, more uses of the errno value have been added, where the string does
not apply, or does not apply nearly as well.
kre
Home |
Main Index |
Thread Index |
Old Index