> Date: Tue, 14 Apr 2015 21:26:25 -0400 > From: William Orr <w...@worrbase.com> > > Hey, > > I was debugging a few CPython test failures yesterday, and I noticed > that attaching multiple cmsg structures causes unp_internalize to return > EINVAL. > > I've looked in unix(4) and sendmsg(2), and this caveat isn't documented > anywhere. > > I looked at other OSes, and Linux supports this, FreeBSD fails in > interesting ways and OS X returns E2BIG. > > Is this behavior intentional, and the documentation is missing this > failure mode? Or is the behavior unintentional? I'm happy to submit a > patch for either, I just want to know which behavior is intended.
The behaviour is intentional. The additional complexity of supporting multiple cmsghdrs has caused many bugs (and associated security issues) in the past. The alignment fuckups in various OSes make it hard to use this functionality in a portable way anyway. And we only support SCM_RIGHTS, so there is no real reason to use multiple cmsghdrs in your code.