A fork-like C-wrapper for clone()?

From: Francesc Oller (francesc@mat.upc.es)
Date: Fri Apr 06 2001 - 05:42:25 EST


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



This archive was generated by hypermail 2b29 : Sat Apr 07 2001 - 21:00:18 EST