forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhgfs.c
More file actions
59 lines (44 loc) · 1.25 KB
/
Copy pathhgfs.c
File metadata and controls
59 lines (44 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
#include "inc.h"
struct sffs_table hgfs_table = {
.t_open = hgfs_open,
.t_read = hgfs_read,
.t_write = hgfs_write,
.t_close = hgfs_close,
.t_readbuf = hgfs_readbuf,
.t_writebuf = hgfs_writebuf,
.t_opendir = hgfs_opendir,
.t_readdir = hgfs_readdir,
.t_closedir = hgfs_closedir,
.t_getattr = hgfs_getattr,
.t_setattr = hgfs_setattr,
.t_mkdir = hgfs_mkdir,
.t_unlink = hgfs_unlink,
.t_rmdir = hgfs_rmdir,
.t_rename = hgfs_rename,
.t_queryvol = hgfs_queryvol,
};
/*===========================================================================*
* hgfs_init *
*===========================================================================*/
int hgfs_init(const struct sffs_table **tablep)
{
/* Initialize the library. Return OK on success, or a negative error code
* otherwise. If EAGAIN is returned, shared folders are disabled.
*/
int r;
time_init();
r = rpc_open();
if (r == OK)
*tablep = &hgfs_table;
return r;
}
/*===========================================================================*
* hgfs_cleanup *
*===========================================================================*/
void hgfs_cleanup()
{
/* Clean up state.
*/
rpc_close();
}