[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

STINNER Victor report at bugs.python.org
Thu Feb 20 23:37:25 CET 2014


STINNER Victor added the comment:

Extract of the POSIX standard for recvmsg():
http://pubs.opengroup.org/onlinepubs/009695399/functions/recvmsg.html

"""
DESCRIPTION

(...) The recvmsg() function shall return the total length of the message. (...) If a message is too long to fit in the supplied buffers, and MSG_PEEK is not set in the flags argument, the excess bytes shall be discarded, and MSG_TRUNC shall be set in the msg_flags member of the msghdr structure. (...)

ERRORS

[EMSGSIZE] The msg_iovlen member of the msghdr structure pointed to by message is less than or equal to 0, or is greater than {IOV_MAX}.
"""

I don't see EMSGSIZE in the Linux manual page of recvmsg(). So it looks like Linux truncates, whereas OpenBSD raises an error. It's probably safe to accept in the unit test that the OS can raise OSError(EMSGSIZE).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20669>
_______________________________________


More information about the Python-bugs-list mailing list