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

From: Linus Torvalds
Date: Wed Sep 09 2009 - 14:35:25 EST




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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/