fork vfork clone

    xiaoxiao2025-05-31  29

    sys_vfork sys_clone sys_fork    arch/arm/kernel/sys_arm.c 

    asmlinkage int sys_vfork(struct pt_regs *regs) { return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); }

    /* Fork a new task - this creates a new program thread.  * This is called indirectly via a small wrapper  */ asmlinkage int sys_fork(struct pt_regs *regs) { #ifdef CONFIG_MMU return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); #else /* can not support in nommu mode */ return(-EINVAL); #endif }

    /* Clone a task - this clones the calling program thread.  * This is called indirectly via a small wrapper  */ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, int __user *parent_tidptr, int tls_val, int __user *child_tidptr, struct pt_regs *regs) { if (!newsp) newsp = regs->ARM_sp; return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr); }

    linux下 fork(),vfork(),clone()的用法及区别:

    http://www.cnblogs.com/lonelycatcher/archive/2011/12/17/2291311.html   

    转载请注明原文地址: https://ju.6miu.com/read-1299448.html
    最新回复(0)