{"thread":{"id":"63127","subject":"[PATCH 10/12] config.mak.uname: add sysinfo() configuration for cygwin","startedAt":"2025-03-15T02:48:56Z","lastAt":"2025-03-15T02:48:56Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":12},"messages":[{"id":"514340","messageId":"13072bf7-c710-47e1-9996-f886e9029f02@ramsayjones.plus.com","threadId":"63127","inReplyTo":null,"subject":"[PATCH 10/12] config.mak.uname: add sysinfo() configuration for cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-03-15T02:48:54Z","receivedAt":"2025-03-15T02:48:56Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nAlthough sysinfo() is a 'Linux only' function, cygwin provides an\nimplementation which appears to be functional. The assumption that\nthis function is Linux only is reflected in the way the HAVE_SYSINFO\nbuild variable is handled by the Makefile and config.mak.uname.\n\nRework the setting of HAVE_SYSINFO in the Linux section of the system\nspecific config file, along with the corresponding setting of the\nBASIC_CFLAGS in the Makefile. Add the setting of HAVE_SYSINFO to the\ncygwin section of 'config.mak.uname'. While here, add a test for the\nsysinfo() function to the autoconf build system.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n Makefile         | 4 ++++\n config.mak.uname | 3 ++-\n configure.ac     | 8 ++++++++\n 3 files changed, 14 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 8fa4d2664e..ff89f2b81f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2168,6 +2168,10 @@ ifdef HAVE_SYNC_FILE_RANGE\n \tBASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE\n endif\n \n+ifdef HAVE_SYSINFO\n+\tBASIC_CFLAGS += -DHAVE_SYSINFO\n+endif\n+\n ifdef HAVE_BSD_SYSCTL\n \tBASIC_CFLAGS += -DHAVE_BSD_SYSCTL\n endif\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 942550fb9e..0e29341056 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -58,7 +58,7 @@ ifeq ($(uname_S),Linux)\n \tHAVE_SYNC_FILE_RANGE = YesPlease\n \tHAVE_GETDELIM = YesPlease\n \tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n-\tBASIC_CFLAGS += -DHAVE_SYSINFO\n+\tHAVE_SYSINFO = YesPlease\n \tPROCFS_EXECUTABLE_PATH = /proc/self/exe\n \tHAVE_PLATFORM_PROCINFO = YesPlease\n \tCOMPAT_OBJS += compat/linux/procinfo.o\n@@ -253,6 +253,7 @@ ifeq ($(uname_O),Cygwin)\n \tHAVE_GETDELIM = YesPlease\n \tHAVE_CLOCK_GETTIME=YesPlease\n \tHAVE_CLOCK_MONOTONIC=YesPlease\n+\tHAVE_SYSINFO = YesPlease\n \tHAVE_ALLOCA_H = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tNO_FAST_WORKING_DIRECTORY = UnfortunatelyYes\ndiff --git a/configure.ac b/configure.ac\nindex 5923edc44a..d7e0503f1e 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1066,6 +1066,14 @@ AC_CHECK_LIB([iconv], [locale_charset],\n        [AC_CHECK_LIB([charset], [locale_charset],\n                      [CHARSET_LIB=-lcharset])])\n GIT_CONF_SUBST([CHARSET_LIB])\n+\n+#\n+# Define HAVE_SYSINFO=YesPlease if sysinfo is available.\n+GIT_CHECK_FUNC(sysinfo,\n+\t[HAVE_SYSINFO=YesPlease],\n+\t[HAVE_SYSINFO=])\n+GIT_CONF_SUBST([HAVE_SYSINFO])\n+\n #\n # Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available.\n GIT_CHECK_FUNC(clock_gettime,\n-- \n2.49.0\n"}]}