[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PSID



try a code like this one in c
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
main(int argc,char **argv)
{
  int pID=(int)getpid();
  printf ("%i",pID);
  return execv (argv[1], ++argv);
}
the new proces take's the old proces pid , after it is printed , notice that
the return line would be executed only on failure of the exec line.

ortal

-- 
Ortal Alpert <ortal@batata.fh.huji.ac.il>