From: Joerg Pommnitz (jpo@beta.informatik.tu-chemnitz.de)
Date: 05/14/93


From: jpo@beta.informatik.tu-chemnitz.de (Joerg Pommnitz)
Subject: using clone
Date: 14 May 1993 08:58:47 GMT

Yesterday I tried to use the new clone syscall. After looking
at the kernel sources I was able to get a small programm to run.
The real problem is libc.

Almost every library call seems to be a critical section and has
to be protected. Even the small (?) write wrapper failed.

Any thoughts ?

                                                Joerg

P.S: Here is my final cloning program:
============================8<=================================================

#include <linux/unistd.h>

static inline _syscall1 (int, clone, int, stack)
static inline _syscall3 (int, write, int, fd, char *, buf, int, count)

char string = 'A';

void
main ()
{
  if (clone (512 * 1024 * 1024))
    for (;;)
      write (1, &string, 1);
  else
    for (;;)
      string = (string == 'A') ? '.' : 'A';
}