Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2022-01-16 01:41:55 +0300
committerVladislavs Sokurenko <vladislavs.sokurenko@zabbix.com>2022-01-16 01:41:55 +0300
commit35e168e5de2e159934504bc2e16175061a223b59 (patch)
tree5a30460a52431d49b51774b871e257dc20c2cb39 /tests
parent51e09a6fb309b0f7a7ebcf05de642da51aa2c16c (diff)
.......... [ZBXNEXT-7411] fixed tests on older platforms
Diffstat (limited to 'tests')
-rw-r--r--tests/conf_tests.m411
-rw-r--r--tests/zbxmockfile.c18
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/conf_tests.m4 b/tests/conf_tests.m4
index 7ddc6c5d40e..9a25dc1c2b7 100644
--- a/tests/conf_tests.m4
+++ b/tests/conf_tests.m4
@@ -82,4 +82,15 @@ AC_DEFUN([CONF_TESTS],
AC_CONFIG_FILES([tests/libs/zbxsysinfo/unknown/Makefile])
;;
esac
+
+
+AC_TRY_LINK(
+[
+#include <stdlib.h>
+],
+[
+ __fxstat(0, 0, NULL);
+],
+AC_DEFINE([HAVE_FXSTAT], [1], [Define to 1 if fxstat function is available]))
+
])
diff --git a/tests/zbxmockfile.c b/tests/zbxmockfile.c
index 3d68b50a76a..2b15d2cfe2a 100644
--- a/tests/zbxmockfile.c
+++ b/tests/zbxmockfile.c
@@ -50,9 +50,15 @@ ssize_t __wrap_read(int fildes, void *buf, size_t nbyte);
int __wrap_open(const char *path, int oflag, ...);
int __wrap_stat(const char *path, struct stat *buf);
int __wrap___xstat(int ver, const char *pathname, struct stat *buf);
+#ifdef HAVE_FXSTAT
+int __wrap___fxstat(int __ver, int __fildes, struct stat *__stat_buf);
+#endif
int __real_open(const char *path, int oflag, ...);
int __real_stat(const char *path, struct stat *buf);
+#ifdef HAVE_FXSTAT
+int __real___fxstat(int __ver, int __fildes, struct stat *__stat_buf);
+#endif
static int is_profiler_path(const char *path)
{
@@ -280,3 +286,15 @@ int __wrap___xstat(int ver, const char *pathname, struct stat *buf)
return __wrap_stat(pathname, buf);
}
+
+#ifdef HAVE_FXSTAT
+int __wrap___fxstat(int __ver, int __fildes, struct stat *__stat_buf)
+{
+ if (__fildes != INT_MAX)
+ return __real___fxstat(__ver, __fildes, __stat_buf);
+
+ __stat_buf->st_size = zbx_mock_get_parameter_uint64("in.file_len");
+
+ return 0;
+}
+#endif