Re: [RFC][v5][PATCH 8/8]: Define clone_with_pids() syscall

Linus Torvalds
2009-09-09T18:35:15Z

On Wed, 9 Sep 2009, Sukadev Bhattiprolu wrote:
>
> BTW, would it work if we defined
>
> struct pid_set {
> u64 pids;
> int num_pids;
> }
>
> where ->pids can be still be a pointer ? The data structure would
> have the same size on all architectures.

I don't think that's all that great. Just go with the C90 version, we
already have that thing in the kernel, and

struct pid_set {
int num_pids;
pid_t pids[];
};

looks simple and straightforward. And it even makes your example simpler,
doesn't it? Ie now it's just

struct pid_set pids = { 3, { 0, 97, 99 } };

and gcc should do the right thing.

(Of course, in any real case it would be dynamically allocated, but
whatever).

Linus