etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libhgfs / link.c
blob937fee59cbccc8412053ff0f0226c7cc63d53183
1 /* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
3 #include "inc.h"
5 #include <sys/stat.h>
7 /*===========================================================================*
8 * hgfs_mkdir *
9 *===========================================================================*/
10 int hgfs_mkdir(const char *path, int mode)
12 /* Create a new directory.
15 RPC_REQUEST(HGFS_REQ_MKDIR);
16 RPC_NEXT8 = HGFS_MODE_TO_PERM(mode);
18 path_put(path);
20 return rpc_query();
23 /*===========================================================================*
24 * hgfs_unlink *
25 *===========================================================================*/
26 int hgfs_unlink(const char *path)
28 /* Delete a file.
31 RPC_REQUEST(HGFS_REQ_UNLINK);
33 path_put(path);
35 return rpc_query();
38 /*===========================================================================*
39 * hgfs_rmdir *
40 *===========================================================================*/
41 int hgfs_rmdir(const char *path)
43 /* Remove an empty directory.
46 RPC_REQUEST(HGFS_REQ_RMDIR);
48 path_put(path);
50 return rpc_query();
53 /*===========================================================================*
54 * hgfs_rename *
55 *===========================================================================*/
56 int hgfs_rename(const char *opath, const char *npath)
58 /* Rename a file or directory.
61 RPC_REQUEST(HGFS_REQ_RENAME);
63 path_put(opath);
64 path_put(npath);
66 return rpc_query();