mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 12:55:43 +08:00
nsh:support $! get last pid use nsh run
test: nsh> hello & hello [4:100] nsh> Hello, World!! nsh> echo $! 4 nsh> echo $! 3 nsh> ps PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND 0 0 0 FIFO Kthread - Ready 0000000000000000 0069616 Idle_Task 1 1 224 FIFO Kthread - Waiting Signal 0000000000000000 0067536 loop_task 2 2 224 FIFO Kthread - Waiting Semaphore 0000000000000000 0067504 hpwork 0x45ae80 0x45aea8 3 3 100 FIFO Task - Running 0000000000000000 0067536 nsh_main nsh> Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -202,6 +202,7 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
||||
* foreground
|
||||
*/
|
||||
|
||||
vtbl->np.np_lastpid = pid;
|
||||
#ifdef CONFIG_SCHED_WAITPID
|
||||
/* CONFIG_SCHED_WAITPID is selected, so we may run the command in
|
||||
* foreground unless we were specifically requested to run the command
|
||||
|
Reference in New Issue
Block a user