linux kernel function do_fork
2016-04-06 14:28
393 查看
kernel function do_fork kernel thread: /* * Create a kernel thread. */ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn, (unsigned long)arg, NULL, NULL); } user space process: 1. fork SYSCALL_DEFINE0(fork) { #ifdef CONFIG_MMU return do_fork(SIGCHLD, 0, 0, NULL, NULL); 2. vfork SYSCALL_DEFINE0(vfork) { return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, 0, NULL, NULL); } 3. clone SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, int __user *, parent_tidptr, int, tls_val, int __user *, child_tidptr) #elif defined(CONFIG_CLONE_BACKWARDS2) SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags, int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val) #elif defined(CONFIG_CLONE_BACKWARDS3) SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp, int, stack_size, int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val) #else SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val) #endif { return do_fork(clone_flags, newsp, 0, parent_tidptr, child_tidptr); }
无论kernel thread还是user space process,在kernel中的表示都是一样的。
相关文章推荐
- 阿里云Centos配置iptables防火墙
- Linux无法连接外网
- linux scp指令
- 使用Linux命令行测试网速
- Linux中断处理驱动程序编写
- Linux下打印调试信息
- linux安装composer
- Linux - 常用命令
- Linux 环境下查看resin版本
- 【读书笔记】Linux内核设计与实现(第三章)
- Linux内核分析(第七周)
- linux服务器磁盘坏道的发现及解决全过程
- Linux系统中对SSD硬盘优化的方法
- linux下指定mysql数据库服务器主从同步的配置实例
- CentOS7下安装配置LAMP详细教程
- Linux下动态链接库的创建和使用
- CentOS 自定义安装GitLab
- linux shell 快捷键
- 关于/etc/init.d/rcS not found的解决方法
- linux下加载R包: