libnfs.c: add nfs_create
[deb_libnfs.git] / lib / libnfs-sync.c
index 6e329f96af76f37b761a5f6e0a9ce529feca7646..39c68c6bf6fb12b0a345c839e79e2f09989ffe7f 100644 (file)
 #include "win32_compat.h"
 #endif
 
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
 #endif
 #include <sys/ioctl.h>
 #endif
 
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
 #ifdef HAVE_POLL_H
 #include <poll.h>
 #endif
@@ -696,15 +696,15 @@ static void creat_cb(int status, struct nfs_context *nfs, void *data, void *priv
        *nfsfh = fh;
 }
 
-int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
+int nfs_create(struct nfs_context *nfs, const char *path, int flags, int mode, struct nfsfh **nfsfh)
 {
        struct sync_cb_data cb_data;
 
        cb_data.is_finished = 0;
        cb_data.return_data = nfsfh;
 
-       if (nfs_creat_async(nfs, path, mode, creat_cb, &cb_data) != 0) {
-               nfs_set_error(nfs, "nfs_creat_async failed");
+       if (nfs_create_async(nfs, path, flags, mode, creat_cb, &cb_data) != 0) {
+               nfs_set_error(nfs, "nfs_create_async failed");
                return -1;
        }
 
@@ -713,6 +713,11 @@ int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh
        return cb_data.status;
 }
 
+int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh)
+{
+       return nfs_create(nfs, path, 0, mode, nfsfh);
+}
+
 /*
  * mknod()
  */