aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt2
-rw-r--r--ports/linux/statvfs/guts/statvfs.c13
-rw-r--r--ports/linux/statvfs/wrapfuncs.in1
-rwxr-xr-xports/linux/subports13
-rw-r--r--pseudo_wrappers.c8
5 files changed, 36 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 1d98415..07aa80a 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -6,6 +6,8 @@
* (seebs) drop the diagnostic for a missing "real" function
as it turns out to be counterproductive at best.
* (seebs) merge epoll support from <alexander.kanavin@linux.intel.com>
+ * (seebs) add wrapper for statvfs (based on patch from
+ <dan.dedrick@gmail.com>)
2017-12-22:
* (seebs) handle the pathological case of LINKAT with
diff --git a/ports/linux/statvfs/guts/statvfs.c b/ports/linux/statvfs/guts/statvfs.c
new file mode 100644
index 0000000..c516649
--- /dev/null
+++ b/ports/linux/statvfs/guts/statvfs.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int statvfs(const char *path, struct statvfs *buf)
+ * int rc = -1;
+ */
+
+ rc = real_statvfs(path, buf);
+
+/* return rc;
+ * }
+ */
diff --git a/ports/linux/statvfs/wrapfuncs.in b/ports/linux/statvfs/wrapfuncs.in
new file mode 100644
index 0000000..1afb64d
--- /dev/null
+++ b/ports/linux/statvfs/wrapfuncs.in
@@ -0,0 +1 @@
+int statvfs(const char *path, struct statvfs *buf);
diff --git a/ports/linux/subports b/ports/linux/subports
index 507794e..a29044a 100755
--- a/ports/linux/subports
+++ b/ports/linux/subports
@@ -41,3 +41,16 @@ else
echo "linux/noxattr"
fi
rm -f dummy.c dummy.o
+
+cat > dummy.c <<EOF
+#include <sys/statvfs.h>
+int i;
+EOF
+if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
+ echo >&2 "Warning: Can't compile trivial program using <sys/statvfs.h>".
+ echo >&2 " xattr support will require that header."
+else
+ echo "linux/statvfs"
+fi
+rm -f dummy.c dummy.o
+
diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
index ad3a8c0..e05f73a 100644
--- a/pseudo_wrappers.c
+++ b/pseudo_wrappers.c
@@ -37,6 +37,9 @@
#include <sys/wait.h>
#include <dlfcn.h>
+/* include this to get PSEUDO_PORT_* definitions */
+#include "pseudo.h"
+
/* used for various specific function arguments */
#include <dirent.h>
#include <fts.h>
@@ -45,12 +48,15 @@
#include <grp.h>
#include <pwd.h>
#include <utime.h>
+#ifdef PSEUDO_PORT_LINUX_STATVFS
+#include <sys/statvfs.h>
+#endif
-#include "pseudo.h"
#include "pseudo_wrapfuncs.h"
#include "pseudo_ipc.h"
#include "pseudo_client.h"
+
/* Types and declarations we need in advance. */
#include "pseudo_wrapper_table.c"