You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/03/28 15:26:42 UTC
[incubator-nuttx] branch master updated (d7391bf -> ad9ba8f)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from d7391bf xtensa: add xtensa arch oneshot ops
new 5b027f5 net: netdev_ioctl handle FIONBIO
new ad9ba8f local_socket: default set block mode if accept() a new socket
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
net/local/local_accept.c | 6 ++----
net/local/local_sockif.c | 11 +++++++++++
net/netdev/netdev_ioctl.c | 1 +
3 files changed, 14 insertions(+), 4 deletions(-)
[incubator-nuttx] 01/02: net: netdev_ioctl handle FIONBIO
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 5b027f5260ccf093a3349829c91949ff5548088e
Author: ligd <li...@xiaomi.com>
AuthorDate: Sat Mar 26 00:33:40 2022 +0800
net: netdev_ioctl handle FIONBIO
Signed-off-by: ligd <li...@xiaomi.com>
---
net/netdev/netdev_ioctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c
index 8cc035b..21d156a 100644
--- a/net/netdev/netdev_ioctl.c
+++ b/net/netdev/netdev_ioctl.c
@@ -1601,6 +1601,7 @@ ssize_t net_ioctl_arglen(int cmd)
{
switch (cmd)
{
+ case FIONBIO:
case FIONSPACE:
case FIONREAD:
return sizeof(int);
[incubator-nuttx] 02/02: local_socket: default set block mode if accept() a new socket
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit ad9ba8f454419d04d365bc0784968cebfe7e5dd8
Author: ligd <li...@xiaomi.com>
AuthorDate: Wed Dec 8 23:27:39 2021 +0800
local_socket: default set block mode if accept() a new socket
reference:
https: //man7.org/linux/man-pages/man2/accept.2.html
1. default set block mode if accept() a new socket
2. local_socket support FIONBIO
Signed-off-by: ligd <li...@xiaomi.com>
---
net/local/local_accept.c | 6 ++----
net/local/local_sockif.c | 11 +++++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/net/local/local_accept.c b/net/local/local_accept.c
index 47551ed..5a2bed2 100644
--- a/net/local/local_accept.c
+++ b/net/local/local_accept.c
@@ -181,8 +181,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
* block.
*/
- ret = local_open_server_tx(
- conn, _SS_ISNONBLOCK(server->lc_conn.s_flags));
+ ret = local_open_server_tx(conn, false);
if (ret < 0)
{
nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n",
@@ -201,8 +200,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
* for writing.
*/
- ret = local_open_server_rx(
- conn, _SS_ISNONBLOCK(server->lc_conn.s_flags));
+ ret = local_open_server_rx(conn, false);
if (ret < 0)
{
nerr("ERROR: Failed to open read-only FIFOs for %s: %d\n",
diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c
index 776b6f9..547f029 100644
--- a/net/local/local_sockif.c
+++ b/net/local/local_sockif.c
@@ -718,6 +718,17 @@ static int local_ioctl(FAR struct socket *psock, int cmd,
switch (cmd)
{
+ case FIONBIO:
+ if (conn->lc_infile.f_inode != NULL)
+ {
+ ret = file_ioctl(&conn->lc_infile, cmd, arg);
+ }
+
+ if (ret >= 0 && conn->lc_outfile.f_inode != NULL)
+ {
+ ret = file_ioctl(&conn->lc_outfile, cmd, arg);
+ }
+ break;
case FIONREAD:
if (conn->lc_infile.f_inode != NULL)
{