Use `shell_api.h` and the buffer structure in `shell` and `libshell` to avoid magic numbers and sync Reviewed-on: #657 Reviewed-by: Burer <burer@kolibrios.org> Co-authored-by: Egor00f <y.yarin@inbox.ru>
18 lines
310 B
C
18 lines
310 B
C
#include <shell_api.h>
|
|
#include <string.h>
|
|
|
|
unsigned shell_get_pid()
|
|
{
|
|
unsigned pid = 0;
|
|
|
|
__shell_init();
|
|
if (__shell_is_init == __SHELL_INIT_OK)
|
|
{
|
|
__shell_shm->cmd = SHELL_PID;
|
|
__SHELL_WAIT();
|
|
memcpy(&pid, __shell_shm->data, sizeof(unsigned));
|
|
}
|
|
|
|
return pid;
|
|
}
|