The Makefile build already forwards both values via PRIORITY /
STACKSIZE. Align the CMake build with the Makefile so that
CONFIG_NETUTILS_REXECD_PRIORITY and CONFIG_NETUTILS_REXECD_STACKSIZE
take effect under CMake as well.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
By default rexecd spawns a detached worker thread per accepted connection
to allow concurrent sessions. Add a "-t" runtime option to instead handle
each connection inline in the main task, avoiding the per-connection
worker stack (CONFIG_NETUTILS_REXECD_STACKSIZE) allocation from the heap.
This matters on low-memory targets with limited free heap.
With "-t", connections are served strictly one at a time: a long-running
or interactive command blocks the accept loop until it finishes. Without
it, the existing thread-per-connection behaviour is unchanged.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
popen() now returns a fopencookie-backed FILE* whose fileno() yields the
cookie pointer rather than a real descriptor, so poll() silently ignores
the negative fd and the relay loop blocks forever waiting for command
completion. See https://github.com/apache/nuttx-apps/pull/3511
Use dpopen()/dpclose() to obtain the raw bidirectional socket descriptor
directly, restoring the EOF/POLLHUP command-completion signal.
Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
When using AF_RPMSG (-r option), rexecd was setting the rp_name
to the raw port number, while rexec was using htons(port). This
caused a mismatch where rexec couldn't connect to rexecd.
This commit fixes the issue by applying htons() to REXECD_PORT
when setting rp_name in the AF_RPMSG case, making it consistent
with the rexec client implementation.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Fix cast from pointer to integer of different size to ensure
proper type conversion and avoid compilation warnings.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
using popen with r+,w+ mode to interact with the remote service on
the command line, supporting input and output until the local
voluntarily exits or the remote service ends.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>