[LTP] [RFC PATCH 2/4] lapi/socket.h: Move definitions from netstress.c

Alexey Kodanev alexey.kodanev@oracle.com
Fri Nov 10 14:14:24 CET 2017


On 11/09/2017 02:39 PM, Petr Vorel wrote:
> + remove sys/socket.h from netstress.c

What about including it in lapi/socket.h?

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  include/lapi/socket.h                   | 18 +++++++++++++++++-
>  testcases/network/netstress/netstress.c | 18 ++----------------
>  2 files changed, 19 insertions(+), 17 deletions(-)
>
> diff --git a/include/lapi/socket.h b/include/lapi/socket.h
> index 98263105e..af9448804 100644
> --- a/include/lapi/socket.h
> +++ b/include/lapi/socket.h
> @@ -19,8 +19,24 @@
>  #ifndef __LAPI_SOCKET_H__
>  #define __LAPI_SOCKET_H__
>  
> +#ifndef MSG_FASTOPEN
> +#define MSG_FASTOPEN	0x20000000 /* Send data in TCP SYN */
> +#endif
> +
> +#ifndef SO_BUSY_POLL
> +#define SO_BUSY_POLL	46
> +#endif
> +
>  #ifndef SOCK_CLOEXEC
> -# define SOCK_CLOEXEC 02000000
> +#define SOCK_CLOEXEC 02000000
> +#endif
> +
> +#ifndef SOCK_DCCP
> +#define SOCK_DCCP		6
> +#endif

The two above should probably be in ascending order...

SOCK_CLOEXEC along with SOCK_NONBLOCK already defined in
lapi/fcntl.h. I guess we should move them to lapi/socket.h instead.

Thanks,
Alexey



More information about the ltp mailing list