{"thread":{"id":"32340","subject":"[PATCH 1/4] Support builds when sys/param.h is missing","startedAt":"2012-12-14T19:56:58Z","lastAt":"2012-12-15T17:53:42Z","messageCount":4,"participants":["David Michael","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"204877","messageId":"CAEvUa7mHHy1=aOMfg4hNnDzod4zSnNHZN87isgf6Yxh5cRAf0Q@mail.gmail.com","threadId":"32340","inReplyTo":null,"subject":"[PATCH 1/4] Support builds when sys/param.h is missing","fromName":"David Michael","fromEmail":"fedora.dm0@gmail.com","sentAt":"2012-12-14T19:56:58Z","receivedAt":"2012-12-14T19:56:58Z","isPatch":true,"sender":{"key":"fedora.dm0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1379865?v=4"},"body":"An option is added to the Makefile to skip the inclusion of sys/param.h.\nThe only known platform with this condition thus far is the z/OS UNIX System\nServices environment.\n\nSigned-off-by: David Michael <fedora.dm0@gmail.com>\n---\n Makefile          | 5 +++++\n configure.ac      | 6 ++++++\n git-compat-util.h | 2 ++\n 3 files changed, 13 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 736ecd4..8c3a0dd 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -165,6 +165,8 @@ all::\n # Define NO_POLL if you do not have or don't want to use poll().\n # This also implies NO_SYS_POLL_H.\n #\n+# Define NO_SYS_PARAM_H if you don't have sys/param.h.\n+#\n # Define NO_PTHREADS if you do not have or do not want to use Pthreads.\n #\n # Define NO_PREAD if you have a problem with pread() system call (e.g.\n@@ -1748,6 +1750,9 @@ endif\n ifdef NO_SYS_POLL_H\n     BASIC_CFLAGS += -DNO_SYS_POLL_H\n endif\n+ifdef NO_SYS_PARAM_H\n+    BASIC_CFLAGS += -DNO_SYS_PARAM_H\n+endif\n ifdef NO_INTTYPES_H\n     BASIC_CFLAGS += -DNO_INTTYPES_H\n endif\ndiff --git a/configure.ac b/configure.ac\nindex ad215cc..317bfc6 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -699,6 +699,12 @@ AC_CHECK_HEADER([sys/poll.h],\n [NO_SYS_POLL_H=UnfortunatelyYes])\n GIT_CONF_SUBST([NO_SYS_POLL_H])\n #\n+# Define NO_SYS_PARAM_H if you don't have sys/param.h\n+AC_CHECK_HEADER([sys/param.h],\n+[NO_SYS_PARAM_H=],\n+[NO_SYS_PARAM_H=UnfortunatelyYes])\n+GIT_CONF_SUBST([NO_SYS_PARAM_H])\n+#\n # Define NO_INTTYPES_H if you don't have inttypes.h\n AC_CHECK_HEADER([inttypes.h],\n [NO_INTTYPES_H=],\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 2e79b8a..ace1549 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -104,7 +104,9 @@\n #endif\n #include <errno.h>\n #include <limits.h>\n+#ifndef NO_SYS_PARAM_H\n #include <sys/param.h>\n+#endif\n #include <sys/types.h>\n #include <dirent.h>\n #include <sys/time.h>\n--\n1.7.11.7\n"},{"id":"204889","messageId":"7vpq2curpa.fsf@alter.siamese.dyndns.org","threadId":"32340","inReplyTo":"CAEvUa7mHHy1=aOMfg4hNnDzod4zSnNHZN87isgf6Yxh5cRAf0Q@mail.gmail.com","subject":"Re: [PATCH 1/4] Support builds when sys/param.h is missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-14T23:41:53Z","receivedAt":"2012-12-14T23:41:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Michael <fedora.dm0@gmail.com> writes:\n\n> An option is added to the Makefile to skip the inclusion of sys/param.h.\n> The only known platform with this condition thus far is the z/OS UNIX System\n> Services environment.\n>\n> Signed-off-by: David Michael <fedora.dm0@gmail.com>\n> ---\n\nHmm, makes me wonder if we can remove that inclusion everywhere\ninstead.  What definitions are we getting from it?\n\n8695c8b (Add \"show-files\" command to show the list of managed (or\nnon-managed) files., 2005-04-11) added it to show-files, and without\nthe include the compilation failed due to lack of MAXPATHLEN, but\nyou shouldn't be using that in the first place (we tend to either\nuse PATH_MAX or lift the upper limit using strbuf these days.).\n\n65bb491 (Add the ability to prefix something to the pathname to\n\"checkout-cache.c\", 2005-04-21) does the same to checkout-cache.c\nto grab MAXPATHLEN.\n\nbb233d6 (Add support for a \"GIT_INDEX_FILE\" environment variable.,\n2005-04-21) moves these two inclusions to cache.h; removing it\nbteaks compilation due to lack of MAXPATHLEN, ULONG_MAX, etc.,\n\nI didn't check what else sys/parms.h was accicdentally slurping into\nthe compilation, but ULONG_MAX is what we explicitly ask for by\nincluding either inttypes or stdint these days.\n\nLater 4050c0d (Clean up compatibility definitions., 2005-12-05)\nfurther consolidated the headers by moving inclusion around.  This\ncommit did not audit unused headers.\n\nI have this suspicion that nobody would notice if we simply stopped\nincluding the header.\n"},{"id":"204890","messageId":"CAEvUa7kZE-p0oVV+JpXY4y-=ieB-=THTrO4hxzZsFYhLvgvbFw@mail.gmail.com","threadId":"32340","inReplyTo":"7vpq2curpa.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/4] Support builds when sys/param.h is missing","fromName":"David Michael","fromEmail":"fedora.dm0@gmail.com","sentAt":"2012-12-15T02:46:10Z","receivedAt":"2012-12-15T02:46:10Z","isPatch":true,"sender":{"key":"fedora.dm0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1379865?v=4"},"body":"Hi,\n\nOn Fri, Dec 14, 2012 at 6:41 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> I have this suspicion that nobody would notice if we simply stopped\n> including the header.\n\nWhile I'm not aware of any subtleties it could be causing on other\nplatforms, it does seem fine to drop sys/param.h on my test GNU/Linux\nsystems.\n\nI can resend the series and just remove the include, if preferred.\n\nThanks.\n\nDavid\n"},{"id":"204916","messageId":"7va9tfurq1.fsf@alter.siamese.dyndns.org","threadId":"32340","inReplyTo":"CAEvUa7kZE-p0oVV+JpXY4y-=ieB-=THTrO4hxzZsFYhLvgvbFw@mail.gmail.com","subject":"Re: [PATCH 1/4] Support builds when sys/param.h is missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-15T17:53:42Z","receivedAt":"2012-12-15T17:53:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Michael <fedora.dm0@gmail.com> writes:\n\n> On Fri, Dec 14, 2012 at 6:41 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I have this suspicion that nobody would notice if we simply stopped\n>> including the header.\n>\n> While I'm not aware of any subtleties it could be causing on other\n> platforms, it does seem fine to drop sys/param.h on my test GNU/Linux\n> systems.\n>\n> I can resend the series and just remove the include, if preferred.\n\nI am sure the patch as posted is much safer, but I was hoping that\nfolks on non-Linux platforms may say \"I tried to compile with the\ninclude removed, and I get identical binaries from before\".  Until\nthat happens, I would prefer queuing your patch as-is.\n\nThanks.\n"}]}