lkml.org 
[lkml]   [2009]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][v8][PATCH 0/10] Implement clone3() system call
From
Sukadev Bhattiprolu writes:

> struct clone_struct {
> u64 flags;
> u64 child_stack;
> u32 nr_pids;
> u32 reserved1;
> u64 parent_tid;
> u64 child_tid;
> u64 reserved2;
> };
>
> sys_clone3(struct clone_struct __user *cs, pid_t __user *pids)

We'll be needing a clone4() for ia64 if you don't include the
stack_size parameter.

You have a prime opportunity to fix a portability problem that
has been quite a pain for some time. There are currently 3 cases
that userspace has to suffer with:

1. specify one end of the stack with clone
2. specify the other end of the stack with clone (HP PA-RISC)
3. specify the base and size with clone2 (IA-64)

Portable code ends up with an icky #ifdef mess.

BTW, the extra stack info is also useful for other purposes.
It's information that could appear in /proc/*/maps data.
With an extra flag, thread stacks could be freed on thread exit
so that other threads don't have to babysit an exiting thread.


\
 
 \ /
  Last update: 2009-10-26 10:41    [W:0.049 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site