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: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/57390: misleading error message in mq_send(3) for empty
 message
Date: Thu, 4 May 2023 04:54:39 +0000

 On Thu, May 04, 2023 at 03:35:00AM +0000, jschauma%netmeister.org@localhost wrote:
  > /* Check the message size limit */
  > if (msg_len <= 0 || msg_len > mqattr->mq_msgsize) {
  >         error = EMSGSIZE;
  >         goto error;
  > }
  > 
  > strerror(EMSGSIZE) yields "Message too long", but in this case the error is
  > actually that the message is _too short_.
 
 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)
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index