[lxc-devel] Two different (functionality) processes in same namespace

Maheswara Reddy C - ERS, HCL Tech maheswarareddyc at hcl.com
Tue Feb 22 11:47:06 UTC 2011


Hi,
Shall I program this way to create 10 namespaces, with each namespace run 2 different processes or any better way.

#include <sched.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char *argv[])
{

   for(i=0;i<10;i++)
   {
     pid_t pid1[10],pid2[10];

     int flag1= CLONE_NEWNS|CLONE_NETNET, flag2=0;

     int(*fun1[10]( ); // initialize statically
     int(*fun2[10]( );


      Pid1[i] = clone(fun1[i],0,flag1,0);   // process 1
      Pid2[i] = clone(fun2[i],0,flag2,0);   // process 2

   }

}


::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------




More information about the lxc-devel mailing list