This change implements the SO_ERROR socket option that is used to obtain the last error reported by the network.

Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    net/: Trivial changes to PR from review.  Biggest difference:  type of s_error changed to int16_t to save a byte or two.

Author: liuhuahang <liuhuahang@xiaomi.com>

    Implement SO_ERROR for getsockopt()
This commit is contained in:
liuhuahang
2019-12-24 08:09:55 -06:00
committed by Gregory Nutt
parent 10c4aff6ca
commit ce634578dd
13 changed files with 60 additions and 21 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/net/net.h
*
* Copyright (C) 2007, 2009-2014, 2016-2018 Gregory Nutt. All rights
* Copyright (C) 2007, 2009-2014, 2016-2019 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
@@ -234,6 +234,7 @@ struct socket
/* Socket options */
#ifdef CONFIG_NET_SOCKOPTS
int16_t s_error; /* Last error that occurred on this socket */
sockopt_t s_options; /* Selected socket options */
socktimeo_t s_rcvtimeo; /* Receive timeout value (in deciseconds) */
socktimeo_t s_sndtimeo; /* Send timeout value (in deciseconds) */