kernel debug: priv can be NULL early on
[minix.git] / lib / libhgfs / info.c
blobf6d9258e28809534eeb7aa17fd54734128d12b7f
1 /* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
3 #include "inc.h"
5 /*===========================================================================*
6 * hgfs_queryvol *
7 *===========================================================================*/
8 int hgfs_queryvol(path, free, total)
9 char *path;
10 u64_t *free;
11 u64_t *total;
13 /* Retrieve information about available and total volume space associated with
14 * a given path.
16 u32_t lo, hi;
17 int r;
19 RPC_REQUEST(HGFS_REQ_QUERYVOL);
21 path_put(path);
23 /* It appears that this call always fails with EACCES ("permission denied")
24 * on read-only folders. As far as I can tell, this is a VMware bug.
26 if ((r = rpc_query()) != OK)
27 return r;
29 lo = RPC_NEXT32;
30 hi = RPC_NEXT32;
31 *free = make64(lo, hi);
33 lo = RPC_NEXT32;
34 hi = RPC_NEXT32;
35 *total = make64(lo, hi);
37 return OK;