43 int fd=open("/home/kashrinivaasan/linux-3.7.8/drivers/virgo/cpupooling/virgocloudexec/virgo_cloudexec_upcall_usermode_log.txt",O_RDWR | O_APPEND);
44 char buf[500];
45 sprintf(buf,"virgo_cloud_mempool: executing userspace thread for virgo_cloud_mempool on virgo cloud\n");
46 write(fd,buf,sizeof(buf));
47
48 fsync(fd);
49 close(fd);
50 */
51int pid;
52int x=100;
53int status;
54 x=x*x;
55 pid=fork();
56void* ptr;
57if(pid==0)
58 {
59/*
60 int fd=open("./virgo_cloud_mempool_print_to_stdout.out", O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
61 dup2(fd,1);
62 dup2(fd,2);
63 */
64 printf("Child process of fork: virgo_cloud_mempool_main.c: User space has written to a VFS file opened by Kernel, Kernel To User space communication worksi. Doing userspace malloc(1000)\n");
65 ptr=malloc(1000);
66 fflush(stdout);
67 x=x*x;
68 }
69else
70 {
71/*
72 int fd=open("./virgo_cloud_mempool_print_to_stdout.out", O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
73 dup2(fd,1);
74 dup2(fd,2);
75 */
76 printf("Parent process of fork: virgo_cloud_mempool_main.c: User space has written to a VFS file opened by Kernel, Kernel To User space communication works\n");
77 fflush(stdout);
78 x=x*x;
79 waitpid(pid,&status,WCONTINUED);
80 }
81return NULL;
82 }
Generated on Tue Jul 15 2014 13:51:27 for Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud by 1.8.6