custom message type for VM_INFO
[minix3.git] / lib / libhgfs / info.c
blob006e6d72b5f581cdf11965effb410e7e2a60d7fa
1 /* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
3 #include "inc.h"
5 /*===========================================================================*
6 * hgfs_queryvol *
7 *===========================================================================*/
8 int hgfs_queryvol(char *path, u64_t *free, u64_t *total)
10 /* Retrieve information about available and total volume space associated with
11 * a given path.
13 u32_t lo, hi;
14 int r;
16 RPC_REQUEST(HGFS_REQ_QUERYVOL);
18 path_put(path);
20 /* It appears that this call always fails with EACCES ("permission denied")
21 * on read-only folders. As far as I can tell, this is a VMware bug.
23 if ((r = rpc_query()) != OK)
24 return r;
26 lo = RPC_NEXT32;
27 hi = RPC_NEXT32;
28 *free = make64(lo, hi);
30 lo = RPC_NEXT32;
31 hi = RPC_NEXT32;
32 *total = make64(lo, hi);
34 return OK;