5 #include "filesys-stub.h"
10 file_close (struct file *file)
13 filesys_stub_put_string ("close");
14 filesys_stub_put_file (file);
15 filesys_stub_match_string ("close");
16 filesys_stub_unlock ();
20 file_read (struct file *file, void *buffer, off_t size)
25 filesys_stub_put_string ("read");
26 filesys_stub_put_file (file);
27 filesys_stub_put_uint32 (size);
28 filesys_stub_match_string ("read");
29 retval = filesys_stub_get_int32 ();
32 ASSERT (retval <= size);
33 filesys_stub_get_bytes (buffer, retval);
35 filesys_stub_unlock ();
41 file_write (struct file *file, const void *buffer, off_t size)
46 filesys_stub_put_string ("write");
47 filesys_stub_put_file (file);
48 filesys_stub_put_uint32 (size);
49 filesys_stub_put_bytes (buffer, size);
50 filesys_stub_match_string ("write");
51 retval = filesys_stub_get_int32 ();
52 ASSERT (retval <= size);
53 filesys_stub_unlock ();
59 file_length (struct file *file)
64 filesys_stub_put_string ("length");
65 filesys_stub_put_file (file);
66 filesys_stub_match_string ("length");
67 length = filesys_stub_get_int32 ();
68 filesys_stub_unlock ();
74 file_seek (struct file *file, off_t pos)
77 filesys_stub_put_string ("seek");
78 filesys_stub_put_file (file);
79 filesys_stub_put_uint32 (pos);
80 filesys_stub_match_string ("seek");
81 filesys_stub_unlock ();
85 file_tell (struct file *file)
90 filesys_stub_put_string ("tell");
91 filesys_stub_put_file (file);
92 filesys_stub_match_string ("tell");
93 pos = filesys_stub_get_int32 ();
94 filesys_stub_unlock ();
98 #endif /* FILESYS_STUB */