Initial AROS support.
[deb_libnfs.git] / lib / libnfs.c
index 2f47ba8f4245a95d3161cac6b0578518ef10d2f2..cd5a629805dfd3b3cd18b3952033562b7bbeedc6 100644 (file)
 #include "win32_compat.h"
 #define DllExport
 #else
+
 #include <strings.h>
-#include <sys/statvfs.h>
 #include <utime.h>
 #include <unistd.h>
-#endif/*WIN32*/
+
+#ifdef AROS
+#include "aros_compat.h"
+#else
+#ifdef ANDROID
+#include <sys/vfs.h>
+#define statvfs statfs
+#else
+#include <sys/statvfs.h>
+#endif /*ANDROID*/
+#endif /*AROS*/
+#endif /*WIN32*/
 
 #define _GNU_SOURCE
 
@@ -38,6 +49,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <netinet/in.h>
+#include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
 #include "libnfs-raw-mount.h"
@@ -112,7 +125,7 @@ struct nfs_mcb_data {
 static int nfs_lookup_path_async_internal(struct nfs_context *nfs, struct nfs_cb_data *data, struct nfs_fh3 *fh);
 
 
-void nfs_set_auth(struct nfs_context *nfs, AUTH *auth)
+void nfs_set_auth(struct nfs_context *nfs, struct AUTH *auth)
 {
        rpc_set_auth(nfs->rpc, auth);
 }
@@ -2412,10 +2425,12 @@ static void nfs_statvfs_1_cb(struct rpc_context *rpc, int status, void *command_
        svfs.f_bavail  = res->FSSTAT3res_u.resok.abytes/4096;
        svfs.f_files   = res->FSSTAT3res_u.resok.tfiles;
        svfs.f_ffree   = res->FSSTAT3res_u.resok.ffiles;
+#if !defined(ANDROID)
        svfs.f_favail  = res->FSSTAT3res_u.resok.afiles;
        svfs.f_fsid    = 0;
        svfs.f_flag    = 0;
        svfs.f_namemax = 256;
+#endif
 
        data->cb(0, nfs, &svfs, data->private_data);
        free_nfs_cb_data(data);
@@ -3417,7 +3432,7 @@ uint64_t nfs_get_readmax(struct nfs_context *nfs)
  */
 uint64_t nfs_get_writemax(struct nfs_context *nfs)
 {
-       /* Some XDR libraries can not marshall PDUs bigger than this */
+       /* Some ZDR libraries can not marshall PDUs bigger than this */
         if (nfs->writemax < 32768) {
                return nfs->writemax;
        }