user/include/linux/list.h
Run Code Online (Sandbox Code Playgroud)
本声明:
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr) – (unsigned long)(&((type *)0)->member)))
Run Code Online (Sandbox Code Playgroud)
有人可以解释这是什么以及它是如何工作的,提前谢谢
PS请尽可能地简化你的答案,我知道Linux中的线程,进程,现在我正在探索可能性,而且我有点困惑于这个.
每个人我对程序有一些疑问:如果我有一些程序:
int main()
{
int value = 0;
...
return value;
}
Run Code Online (Sandbox Code Playgroud)
我的操作系统创建了新的进程,它使用execv()来运行这个程序,当return value我将值转移回进程时,我的问题是这个进程将如何结束?它是否执行exit(value),当value是我程序中的值时?提前感谢您的帮助
操作系统如何区分
int x = 0; //variable
Run Code Online (Sandbox Code Playgroud)
和
int 0x80; //interrupt, call system_call()
Run Code Online (Sandbox Code Playgroud)