lkml.org 
[lkml]   [2009]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][v6][PATCH 8/9]: Define clone_with_pids() syscall
Date
On Thursday 10 September 2009, Sukadev Bhattiprolu wrote:
>
> +int sys_clone_with_pids(struct pt_regs *regs)
> +{
> + unsigned long clone_flags;
> + unsigned long newsp;
> + int __user *parent_tidptr;
> + int __user *child_tidptr;
> + struct pid_set __user *upid_setp;
> +
> + clone_flags = regs->bx;
> + newsp = regs->cx;
> + parent_tidptr = (int __user *)regs->dx;
> + child_tidptr = (int __user *)regs->di;
> + upid_setp = (struct pid_set __user *)regs->bp;
> +
> + if (!newsp)
> + newsp = regs->sp;
> +
> + return do_fork_with_pids(clone_flags, newsp, regs, 0, parent_tidptr,
> + child_tidptr, upid_setp);
> +}

I wonder if we can avoid spreading copies of this function across
all architectures.

Would it be possible to define it like this?

asmlinkage long
clone_with_pids(int flags, unsigned long child_stack_base, int __user *parent_tid_ptr,
int __user *child_tid_ptr, struct pid_set __user *pid_setp)
{
if (!child_stack_base) {
struct pt_regs *regs;

regs = task_pt_regs(current);
child_stack_base = user_stack_pointer(regs);
}

return do_fork_with_pids(clone_flags, child_stack_base, 0,
parent_tid_ptr, child_tid_ptr, pid_setp);
}

Arnd <><



\
 
 \ /
  Last update: 2009-09-10 17:11    [W:0.129 / U:7.452 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site