public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* A fork-like C-wrapper for clone()?
@ 2001-04-06 10:42 Francesc Oller
  0 siblings, 0 replies; only message in thread
From: Francesc Oller @ 2001-04-06 10:42 UTC (permalink / raw)
  To: linux-kernel

Hi all!

is there a fork-like C-wrapper for clone which would let write
something like:

  if ((pid=clone(0,SIGCHLD|CLONE_VM))==0) /* child */
    {
      child_code;
      _exit(0);
    }
  else
    {
      assert(pid>0); /* mother */
      mother_code;
      exit(0);
    }

I'm not thinking in glibc'__clone or Linus' clone.c example since
they encapsulate the main thread code in a function. (i.e. not
fork-like)

Can somebody point me to some sample code?

I'll thank a CC to my e-mail

cheers

Francesc Oller

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-06 11:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-06 10:42 A fork-like C-wrapper for clone()? Francesc Oller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox