apps/nshlib: Add the pidof command and API nsh_getpid

Add the API "nsh_getpid" in "nsh_fsutils. c" and the nsh command pidof. Temporarily support two parameters, - s, and process name

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
This commit is contained in:
wangmingrong
2023-08-11 19:09:16 +08:00
committed by Xiang Xiao
parent 658b847384
commit 7981278021
5 changed files with 176 additions and 3 deletions

View File

@@ -435,6 +435,10 @@ static const struct cmdmap_s g_cmdmap[] =
# endif
#endif
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PIDOF)
CMD_MAP("pidof", cmd_pidof, 2, 2, "<name>"),
#endif
#if defined(CONFIG_PM) && !defined(CONFIG_NSH_DISABLE_PMCONFIG)
CMD_MAP("pmconfig", cmd_pmconfig, 1, 4,
"[stay|relax] [normal|idle|standby|sleep] [domain]"),