summaryrefslogtreecommitdiff
path: root/src/configure.ac
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-10 21:26:37 +0100
committerBram Moolenaar <Bram@vim.org>2021-03-10 21:26:37 +0100
commitf52f0606ed9ea19bcfc3a8343af9958f2d99eaf7 (patch)
tree1fd2ccebf68aca966d10acdacf36a99badea66c5 /src/configure.ac
parentc23555de346c53f8f6c478635c2d9e5f2992dd7f (diff)
downloadvim-git-f52f0606ed9ea19bcfc3a8343af9958f2d99eaf7.tar.gz
patch 8.2.2586: process id may be invalidv8.2.2586
Problem: Process id may be invalid. Solution: Use sysinfo.uptime to check for recent reboot. (suggested by Hugo van der Sanden, closes #7947)
Diffstat (limited to 'src/configure.ac')
-rw-r--r--src/configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/configure.ac b/src/configure.ac
index 798e9b894..0bb5cc557 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -4095,6 +4095,20 @@ AC_TRY_COMPILE(
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT),
AC_MSG_RESULT(no))
+dnl struct sysinfo may have the uptime field or not
+AC_MSG_CHECKING(for sysinfo.uptime)
+AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/sysinfo.h>],
+[ struct sysinfo sinfo;
+ long ut;
+
+ (void)sysinfo(&sinfo);
+ ut = sinfo.uptime;
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_UPTIME),
+ AC_MSG_RESULT(no))
+
dnl sysconf() may exist but not support what we want to use
AC_MSG_CHECKING(for sysconf)
AC_TRY_COMPILE(