On Mon, May 02, 2022 at 09:12:53PM -0300, Leonardo Bras Soares Passos wrote: > Hello Peter, > > On Mon, May 2, 2022 at 8:52 PM Peter Xu <pet...@redhat.com> wrote: > > > > Leo, > > > > On Fri, Apr 29, 2022 at 11:40:44PM -0300, Leonardo Bras Soares Passos wrote: > > > Does anyone else have any further suggestions, or know how this kind of > > > issue > > > is generally solved in qemu? > > > > I've no solid idea why it can't see MSG_ZEROCOPY defined in the specific > > environment, but when I was looking at bits/socket.h I saw this: > > > > #ifndef _SYS_SOCKET_H > > # error "Never include <bits/socket.h> directly; use <sys/socket.h> > > instead." > > #endif > > > > Maybe worth a shot to do a replacement in all cases? > > > > Sure, no problem with this, I will update for v11. > (Or should I send a different patch since Dave has already merged in his > tree?) > > But it should not interfere in MSG_ZEROCOPY definition: > > > > I tracked down how the test happened, downloaded the same docker image > > > from the > > > tests(opensuse-leap-15.2), and took a look at the filesystem for the > > > MSG_ZEROCOPY define, which I could not find anywhere. > > By this, I mean I did a 'grep MSG_ZEROCOPY -r /' and could not find anything, > so > it's probably not defined anywhere in the fs.
What you described gives me the feeling that the distro seems to have had mismatched versions of asm-generic/socket.h (who should define SO_ZEROCOPY), and bits/socket.h (who should define MSG_ZEROCOPY). Let's first replace it with sys/socket.h, then one trick you could consider play with (even if any env could have broken headers) that I thought of, is you can put your code into: #if defined(MSG_ZEROCOPY) && defined(SO_ZEROCOPY) ... #endif Blocks. Just to avoid assuming CONFIG_LINUX will be the same. -- Peter Xu