blob: c6a308464acb600f3705c4e3a6e0c9fa9c848430 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __COW_SYS_H__
2#define __COW_SYS_H__
3
4#include "kern_util.h"
5#include "user_util.h"
6#include "os.h"
7#include "user.h"
Paolo 'Blaisorblade' Giarrussoc13e5692006-10-19 23:28:20 -07008#include "um_malloc.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10static inline void *cow_malloc(int size)
11{
12 return(um_kmalloc(size));
13}
14
15static inline void cow_free(void *ptr)
16{
17 kfree(ptr);
18}
19
20#define cow_printf printk
21
22static inline char *cow_strdup(char *str)
23{
24 return(uml_strdup(str));
25}
26
Paolo 'Blaisorblade' Giarrussofe1db502006-02-24 13:03:58 -080027static inline int cow_seek_file(int fd, __u64 offset)
Linus Torvalds1da177e2005-04-16 15:20:36 -070028{
29 return(os_seek_file(fd, offset));
30}
31
Paolo 'Blaisorblade' Giarrusso52c73782006-04-10 22:53:41 -070032static inline int cow_file_size(char *file, unsigned long long *size_out)
Linus Torvalds1da177e2005-04-16 15:20:36 -070033{
34 return(os_file_size(file, size_out));
35}
36
Paolo 'Blaisorblade' Giarrusso31bc5a32006-02-24 13:03:53 -080037static inline int cow_write_file(int fd, void *buf, int size)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038{
39 return(os_write_file(fd, buf, size));
40}
41
42#endif
43
44/*
45 * ---------------------------------------------------------------------------
46 * Local variables:
47 * c-file-style: "linux"
48 * End:
49 */