[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 2/7] QIOChannelSocket: Implement io_writev zero copy flag
From: |
Peter Xu |
Subject: |
Re: [PATCH v11 2/7] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX |
Date: |
Wed, 4 May 2022 15:53:06 -0400 |
On Wed, May 04, 2022 at 04:18:31PM -0300, Leonardo Bras wrote:
> +/*
> + * Zero-copy defines bellow are included to avoid breaking builds on systems
> + * that don't support MSG_ZEROCOPY, while keeping the functions more readable
> + * (without a lot of ifdefs).
> + */
> +#ifndef MSG_ZEROCOPY
> +#define MSG_ZEROCOPY 0x4000000
> +#endif
> +#ifndef SO_ZEROCOPY
> +#define SO_ZEROCOPY 60
> +#endif
So this will define these two values on e.g. FreeBSD, while they do not
make sense at all there because these numbers are pure magics and
meaningless outside Linux..
I don't think it's anything dangerous, but IMHO it's another way of being
not clean comparing of using some "#ifdef"s. Comparing to this approach
the "use #ifdef" approach is actually slightly more cleaner to me. :)
Let's wait for some other inputs.
--
Peter Xu
[PATCH v11 3/7] migration: Add zero-copy-send parameter for QMP/HMP for Linux, Leonardo Bras, 2022/05/04
[PATCH v11 4/7] migration: Add migrate_use_tls() helper, Leonardo Bras, 2022/05/04
[PATCH v11 5/7] multifd: multifd_send_sync_main now returns negative on error, Leonardo Bras, 2022/05/04