Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud
 All Classes
virgo_cloud_fs_main.c
1 /***************************************************************************************
2 VIRGO - a linux module extension with CPU and Memory pooling with cloud capabilities
3 
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 --------------------------------------------------------------------------------------------------
19 Copyright (C):
20 Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
21 Independent Open Source Developer, Researcher and Consultant
22 Ph: 9003082186, 9791165980
23 Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan
24 Personal website(research): https://sites.google.com/site/kuja27/
25 emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
26 --------------------------------------------------------------------------------------------------
27 
28 *****************************************************************************************/
29 
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <stdio.h>
33 #include <fcntl.h>
34 #include <unistd.h>
35 #include <string.h>
36 #include <stdlib.h>
37 #include <sys/types.h>
38 #include <sys/wait.h>
39 
40 int main(int argc, char* argv[])
41 {
42  int pid;
43  int x=100;
44  int status;
45  x=x*x;
46  pid=fork();
47  void* ptr;
48  if(pid==0)
49  {
50  printf("Child process of fork: virgo_cloud_fs_main.c: User space has written to a VFS file opened by Kernel, Kernel To User space communication works. Doing userspace file open for /var/log/virgo_fs/virgofstest.txt\n");
51  ptr=malloc(1000);
52  fflush(stdout);
53  x=x*x;
54  }
55  else
56  {
57  printf("Parent process of fork: virgo_cloud_fs_main.c: User space has written to a VFS file opened by Kernel, Kernel To User space communication works\n");
58  fflush(stdout);
59  x=x*x;
60  waitpid(pid,&status,WCONTINUED);
61  }
62  return NULL;
63 }