Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [RFC][v6][PATCH 0/9] clone_with_pids() syscall | Date | Fri, 11 Sep 2009 13:34:45 +0200 |
| |
On Friday 11 September 2009, Peter Zijlstra wrote: > Why not have something like: > > struct clone_struct { > u32 size; > u32 __reserved; > u64 flags; > u64 child_stack; > u32 child_tid; > u32 parent_tid; > }; > > struct clone_pid_struct { > u32 nr; > pid_t pids[]; > }; > > int clone2(struct clone_struct *cs, struct clone_pid_struct *cps); > > If you then get passed a longer clone_struct than you know about, all is > well IFF the tail is 0, otherwise fail with -E2BIG. > > If you get passed a short clone_struct, zero out the tail.
I would leave out the size argument. We can put a few reserved fields and flag bits in there for possible extensions, but if we ever run out of these, just define a new syscall.
Also, if you're passing a struct, why not put nr_pids in there, and replace clone_pid_struct with a simple array? That would give us
struct clone_struct { u64 flags; u64 child_stack; u32 child_tid; u32 parent_tid; u32 nr_pids; u32 reserved1; u64 reserved2; }; int clone2(struct clone_struct *cs, pid_t *pids);
Arnd <><
| |