Re: Using getpid() often, another way? [was Re: clone() <-> getpid()bug in 2.6?]

From: David Mosberger
Date: Mon Jun 07 2004 - 18:28:52 EST


>>>>> On Mon, 07 Jun 2004 19:02:34 -0400, Russell Leighton <russ@xxxxxxxxxxxxxxxxxxxx> said:

Russell> So Ia64 does have it..that's good. Does glibc wrap it?

Here is how it works at the user-level:

- There _is_ a clone(), with the original interface. However,
this version only works when you create a new address-space.

- There is clone2(), which adds the extra "size" argument. This
one works for all cases.

Russell> I agree with the above...could glibc's clone() should have
Russell> a size added? Then the arch specific stack issues could be
Russell> hidden.

In my opinion, it would make sense for all platforms to support
clone2(), since it's more in line with the normal UNIX-convention of
specifying stacks as a memory-range (e.g., see stack_t). So far, the
interest in doing this has been lack-luster (and, IIRC, Linus was
against it in the past, so I haven't spent a lot of effort on it).

--david
-
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/