我是linux内核的新手.我的问题是关于task_struct.我知道每个task_struct都通过指向父进程的指针来引用它的父进程task_struct.
在查看task_struct定义中的sched.h后,我注意到以下内容:
struct task_struct __rcu *real_parent; /* real parent process */
Run Code Online (Sandbox Code Playgroud)
我发现它引用了compiler.h.我猜"__rcu"代表"读取副本更新"
有人可以澄清语法吗?
基本上我想获得用户的输入并将其标记化.例如我输入
4 <tab> 5 <tab> 6
我想得到的
4
5
6
Run Code Online (Sandbox Code Playgroud)
但我的代码不起作用;(
#include <stdio.h>
#include <string.h>
int main ()
{
char str;
scanf("%c",&str);
char *p = strtok(str, "\t");
while(p != NULL) {
printf("%s\n", p);
p = strtok(NULL, "\t");
}
}
Run Code Online (Sandbox Code Playgroud)