You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "liqinhuixm (via GitHub)" <gi...@apache.org> on 2023/08/21 07:18:08 UTC

[GitHub] [nuttx] liqinhuixm opened a new pull request, #10325: sim/posix: Add the host_system interface used to execute the host command

liqinhuixm opened a new pull request, #10325:
URL: https://github.com/apache/nuttx/pull/10325

   ## Summary
   Encapsulate the host system/popen interface to host_system.
   ## Impact
   We can use the host_system interface to execute the host command.
   ## Testing
     - Execute the `ls`,  do not receive the return result of the `ls` command.
       ret = host_system(NULL, 0, "%s", "ls");
     - Execute the `ls`,  receive the return result of the `ls` command with a buffer of length `buf_size`.
       ret = host_system(buf, buf_size, "%s", "ls");


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#discussion_r1299807344


##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -108,6 +109,61 @@ int host_backtrace(void** array, int size)
 #endif
 }
 
+/****************************************************************************
+ * Name: host_system

Review Comment:
   do you want the caller call host_read/host_close by self? It's a common case to call system and gather the output. Exposing host_popen will make the caller duplicate the similar code in many places.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#issuecomment-1685909312

   > > > what's the expected user of this?
   > > 
   > > 
   > > sim wifi simulation need call wpa supplicant through host_system.
   > 
   > is it for device drivers?
   
   yes, net wifi driver will call host_system("wpaxxx") to interact with host's WiFi.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] yamt commented on a diff in pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "yamt (via GitHub)" <gi...@apache.org>.
yamt commented on code in PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#discussion_r1299814893


##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -108,6 +109,61 @@ int host_backtrace(void** array, int size)
 #endif
 }
 
+/****************************************************************************
+ * Name: host_system

Review Comment:
   ok. i prefer to name it something not `system` if it isn't system(). but i have no strong opinions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#discussion_r1299871958


##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -108,6 +109,61 @@ int host_backtrace(void** array, int size)
 #endif
 }
 
+/****************************************************************************
+ * Name: host_system

Review Comment:
   it's unlucky that the POSIX spec doesn't support system return the output from application, which is a very common requirement.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] yamt commented on a diff in pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "yamt (via GitHub)" <gi...@apache.org>.
yamt commented on code in PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#discussion_r1299795363


##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -108,6 +109,61 @@ int host_backtrace(void** array, int size)
 #endif
 }
 
+/****************************************************************************
+ * Name: host_system

Review Comment:
   isn't it simpler to have host_system and host_popen?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 merged pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #10325:
URL: https://github.com/apache/nuttx/pull/10325


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] yamt commented on pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "yamt (via GitHub)" <gi...@apache.org>.
yamt commented on PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#issuecomment-1685917763

   > > > > what's the expected user of this?
   > > > 
   > > > 
   > > > sim wifi simulation need call wpa supplicant through host_system.
   > > 
   > > 
   > > is it for device drivers?
   > 
   > yes, net wifi driver will call host_system("wpaxxx") to interact with host's WiFi.
   
   ok. it makes sense.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#discussion_r1299871958


##########
arch/sim/src/sim/posix/sim_hostmisc.c:
##########
@@ -108,6 +109,61 @@ int host_backtrace(void** array, int size)
 #endif
 }
 
+/****************************************************************************
+ * Name: host_system

Review Comment:
   it's unlucky that the POSIX spec doesn't support system return the output from application, which is a very common requirment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] yamt commented on pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "yamt (via GitHub)" <gi...@apache.org>.
yamt commented on PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#issuecomment-1685885085

   > > what's the expected user of this?
   > 
   > sim wifi simulation need call wpa supplicant through host_system.
   
   is it for device drivers?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #10325: sim/posix: Add the host_system interface used to execute the host command

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #10325:
URL: https://github.com/apache/nuttx/pull/10325#issuecomment-1685846134

   > what's the expected user of this?
   
   sim wifi simulator need call wpa supplicant through host_system.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org