ia64/xen-unstable

view extras/mini-os/include/fs.h @ 16838:945820bfedb6

minios: POSIX fixes
Fixes some functions which are POSIX. Also make them ifndef HAVE_LIBC.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 22 14:20:22 2008 +0000 (2008-01-22)
parents d5e22e766d1f
children a905c582a406
line source
1 #ifndef __FS_H__
2 #define __FS_H__
4 #include <xen/io/fsif.h>
5 #include <semaphore.h>
6 #include <types.h>
8 struct fs_import
9 {
10 domid_t dom_id; /* dom id of the exporting domain */
11 u16 export_id; /* export id (exporting dom specific) */
12 u16 import_id; /* import id (specific to this domain) */
13 struct list_head list; /* list of all imports */
14 unsigned int nr_entries; /* Number of entries in rings & request
15 array */
16 struct fsif_front_ring ring; /* frontend ring (contains shared ring) */
17 int gnt_ref; /* grant reference to the shared ring */
18 evtchn_port_t local_port; /* local event channel port */
19 char *backend; /* XenBus location of the backend */
20 struct fs_request *requests; /* Table of requests */
21 unsigned short *freelist; /* List of free request ids */
22 struct semaphore reqs_sem; /* Accounts requests resource */
23 };
26 void init_fs_frontend(void);
28 int fs_open(struct fs_import *import, char *file);
29 int fs_close(struct fs_import *import, int fd);
30 ssize_t fs_read(struct fs_import *import, int fd, void *buf,
31 ssize_t len, ssize_t offset);
32 ssize_t fs_write(struct fs_import *import, int fd, void *buf,
33 ssize_t len, ssize_t offset);
34 int fs_stat(struct fs_import *import,
35 int fd,
36 struct fsif_stat_response *stat);
37 int fs_truncate(struct fs_import *import,
38 int fd,
39 int64_t length);
40 int fs_remove(struct fs_import *import, char *file);
41 int fs_rename(struct fs_import *import,
42 char *old_file_name,
43 char *new_file_name);
44 int fs_create(struct fs_import *import, char *name,
45 int8_t directory, int32_t mode);
46 char** fs_list(struct fs_import *import, char *name,
47 int32_t offset, int32_t *nr_files, int *has_more);
48 int fs_chmod(struct fs_import *import, int fd, int32_t mode);
49 int64_t fs_space(struct fs_import *import, char *location);
50 int fs_sync(struct fs_import *import, int fd);
52 #endif