add names to ps command

This commit is contained in:
Aurel Feer 2022-06-02 15:44:18 +02:00
parent 9ecfa0a79a
commit de5c0d664d

View File

@ -115,7 +115,11 @@ static errval_t shelly_cmd_ps(char * line) {
shelly_write_str("PIDs:\n\r");
char buf[256];
for(size_t i = 0; i < pid_count; ++i) {
snprintf(buf, 256, " %lu\n\r", pids[i]);
// get process name
char *name;
err = aos_rpc_process_get_name(rpc, pids[i], &name);
if (err_is_fail(err)) name = "unknown name";
snprintf(buf, 256, " %lu : %s\n\r", pids[i], name);
shelly_write_str(buf);
}
return SYS_ERR_OK;