完善ipc对象&完善nsfs&完善文件接口

This commit is contained in:
zhangzheng
2025-03-02 23:31:22 +08:00
parent d8a8b2e3f7
commit 6049dad2b1
66 changed files with 713 additions and 345 deletions

View File

@@ -12,15 +12,18 @@
#include <pthread.h>
#include <errno.h>
#ifdef CONFIG_USING_SIG
static int sig_cn;
static int shell_sig_call_back(pid_t pid, umword_t sig_val)
{
/*TODO:这个消息是init发送的这里不能给init发送消息否导致卡死*/
// cons_write_str("test");
/*TODO:这个消息是init发送的这里不能给init发送消息否导致卡死除非init增加多进程支持*/
cons_write_str("test sig.\n");
sig_cn++;
return 0;
}
int shell_test_sig(int argc, char *argv[])
{
int ret;
if (argc < 2)
{
return -1;
@@ -28,7 +31,10 @@ int shell_test_sig(int argc, char *argv[])
pm_sig_func_set(shell_sig_call_back);
pid_t pid = atoi(argv[1]);
return pm_sig_watch(pid, 0 /*TODO:现在只有kill */);
ret = pm_sig_watch(pid, 0 /*TODO:现在只有kill */);
printf("sig_cn:%d\n", sig_cn);
return ret;
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), test_sig, shell_test_sig, shell_test_sig command);
#endif