Skip to content
Browse files

Merge pull request #30 from theuni/android

[droid] Support building for android
  • Loading branch information...
2 parents db0c9f4 + 252aa90 commit 717cc58e61cd43db43353027c383883cadde8251 @sahlberg committed
Showing with 25 additions and 0 deletions.
  1. +3 −0 include/libnfs.h
  2. +6 −0 lib/libnfs-sync.c
  3. +7 −0 lib/libnfs.c
  4. +5 −0 nfs/libnfs-raw-nfs.h
  5. +4 −0 nlm/libnfs-raw-nlm.h
View
3 include/libnfs.h
@@ -18,6 +18,9 @@
* This is the highlevel interface to access NFS resources using a posix-like interface
*/
#include <stdint.h>
+#if defined(ANDROID)
+#include <sys/time.h>
+#endif
struct nfs_context;
struct rpc_context;
View
6 lib/libnfs-sync.c
@@ -23,7 +23,13 @@
#else
#include <strings.h>
#include <unistd.h>
+#ifndef ANDROID
#include <sys/statvfs.h>
+#else
+#include <netinet/in.h>
+#include <sys/vfs.h>
+#define statvfs statfs
+#endif
#include <poll.h>
#include <sys/ioctl.h>
#include <netdb.h>
View
7 lib/libnfs.c
@@ -22,7 +22,12 @@
#define DllExport
#else
#include <strings.h>
+#ifndef ANDROID
#include <sys/statvfs.h>
+#else
+#include <sys/vfs.h>
+#define statvfs statfs
+#endif
#include <utime.h>
#include <unistd.h>
#endif/*WIN32*/
@@ -2414,10 +2419,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);
View
5 nfs/libnfs-raw-nfs.h
@@ -18,6 +18,11 @@ extern "C" {
#define NFS3_CREATEVERFSIZE 8
#define NFS3_COOKIEVERFSIZE 8
+#if defined(ANDROID)
+typedef long long int quad_t;
+typedef long long unsigned u_quad_t;
+#endif
+
typedef char cookieverf3[NFS3_COOKIEVERFSIZE];
typedef u_quad_t uint64;
View
4 nlm/libnfs-raw-nlm.h
@@ -13,6 +13,10 @@
extern "C" {
#endif
+#if defined(ANDROID)
+typedef long long int quad_t;
+typedef long long unsigned u_quad_t;
+#endif
struct nlm_fh4 {
struct {

0 comments on commit 717cc58

Please sign in to comment.
Something went wrong with that request. Please try again.