aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 0e68b6686acb..540730783433 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1527,8 +1527,6 @@ static inline void init_idle_pids(struct pid_link *links)
1527struct task_struct * __cpuinit fork_idle(int cpu) 1527struct task_struct * __cpuinit fork_idle(int cpu)
1528{ 1528{
1529 struct task_struct *task; 1529 struct task_struct *task;
1530 struct pt_regs regs;
1531
1532 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0); 1530 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0);
1533 if (!IS_ERR(task)) { 1531 if (!IS_ERR(task)) {
1534 init_idle_pids(task->pids); 1532 init_idle_pids(task->pids);
@@ -1546,7 +1544,6 @@ struct task_struct * __cpuinit fork_idle(int cpu)
1546 */ 1544 */
1547long do_fork(unsigned long clone_flags, 1545long do_fork(unsigned long clone_flags,
1548 unsigned long stack_start, 1546 unsigned long stack_start,
1549 struct pt_regs *regs,
1550 unsigned long stack_size, 1547 unsigned long stack_size,
1551 int __user *parent_tidptr, 1548 int __user *parent_tidptr,
1552 int __user *child_tidptr) 1549 int __user *child_tidptr)
@@ -1576,7 +1573,7 @@ long do_fork(unsigned long clone_flags,
1576 * requested, no event is reported; otherwise, report if the event 1573 * requested, no event is reported; otherwise, report if the event
1577 * for the type of forking is enabled. 1574 * for the type of forking is enabled.
1578 */ 1575 */
1579 if (!(clone_flags & CLONE_UNTRACED) && likely(user_mode(regs))) { 1576 if (!(clone_flags & CLONE_UNTRACED)) {
1580 if (clone_flags & CLONE_VFORK) 1577 if (clone_flags & CLONE_VFORK)
1581 trace = PTRACE_EVENT_VFORK; 1578 trace = PTRACE_EVENT_VFORK;
1582 else if ((clone_flags & CSIGNAL) != SIGCHLD) 1579 else if ((clone_flags & CSIGNAL) != SIGCHLD)
@@ -1632,7 +1629,7 @@ long do_fork(unsigned long clone_flags,
1632 */ 1629 */
1633pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) 1630pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1634{ 1631{
1635 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn, NULL, 1632 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn,
1636 (unsigned long)arg, NULL, NULL); 1633 (unsigned long)arg, NULL, NULL);
1637} 1634}
1638#endif 1635#endif
@@ -1641,7 +1638,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1641SYSCALL_DEFINE0(fork) 1638SYSCALL_DEFINE0(fork)
1642{ 1639{
1643#ifdef CONFIG_MMU 1640#ifdef CONFIG_MMU
1644 return do_fork(SIGCHLD, 0, current_pt_regs(), 0, NULL, NULL); 1641 return do_fork(SIGCHLD, 0, 0, NULL, NULL);
1645#else 1642#else
1646 /* can not support in nommu mode */ 1643 /* can not support in nommu mode */
1647 return(-EINVAL); 1644 return(-EINVAL);
@@ -1652,7 +1649,7 @@ SYSCALL_DEFINE0(fork)
1652#ifdef __ARCH_WANT_SYS_VFORK 1649#ifdef __ARCH_WANT_SYS_VFORK
1653SYSCALL_DEFINE0(vfork) 1650SYSCALL_DEFINE0(vfork)
1654{ 1651{
1655 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, current_pt_regs(), 1652 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
1656 0, NULL, NULL); 1653 0, NULL, NULL);
1657} 1654}
1658#endif 1655#endif
@@ -1675,7 +1672,7 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
1675 int, tls_val) 1672 int, tls_val)
1676#endif 1673#endif
1677{ 1674{
1678 return do_fork(clone_flags, newsp, current_pt_regs(), 0, 1675 return do_fork(clone_flags, newsp, 0,
1679 parent_tidptr, child_tidptr); 1676 parent_tidptr, child_tidptr);
1680} 1677}
1681#endif 1678#endif