Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud
 All Classes
test_virgo_filesystem.c
1 /***************************************************************************************
2 VIRGO - VIRtual Generic Os - linux kernel extensions for cloud
3 
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 --------------------------------------------------------------------------------------------------
18 Copyright(C):
19 Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
20 Independent Open Source Developer, Researcher and Consultant
21 Ph: 9789346927, 9003082186, 9791165980
22 Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan, http://www.ohloh.net/accounts/ka_shrinivaasan
23 Personal website(research): https://sites.google.com/site/kuja27/
24 emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
25 --------------------------------------------------------------------------------------------------
26 
27 *****************************************************************************************/
28 
29 #include <stdio.h>
30 #include <sys/syscall.h>
31 #include <unistd.h>
32 #include <string.h>
33 #include <stdio.h>
34 
35 
36 struct hostport
37 {
38  char* hostip;
39  int port;
40 };
41 
42 
43 int main(int argc, char* argv[])
44 {
45  /*
46  Testcases for:
47 
48  sys_virgo_open(char* filepath);
49  sys_virgo_read(long vfsdesc, char __user *data_out, int size, int pos);
50  sys_virgo_write(long vfsdesc, const char __user *data_in, int size, int pos);
51  sys_virgo_close(long vfsdesc);
52 
53  invoked by syscall numbers in arch/x86/syscalls/syscalls_32.tbl
54  */
55 
56  long vfsdesc = syscall(355,"/var/log/virgo_fs/virgofstest.txt"); /* open */
57  char data_read[256];
58  /*syscall(357,vfsdesc,data_read,250,0); */ /* read */
59  /*printf("test_virgo_filesystem.c: data_read = %s\n",data_read);*/
60  syscall(358,vfsdesc,"test_virgo_filesystem",50,30);/* write */
61  syscall(356,vfsdesc); /* close */
62  return 0;
63 }