{"thread":{"id":"11723","subject":"[PATCH] some systems don't have (and need) sys/select.h","startedAt":"2008-01-24T18:34:46Z","lastAt":"2008-01-26T09:42:53Z","messageCount":9,"participants":["Robert Schiele","Johannes Schindelin","Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"66502","messageId":"20080124183446.GJ30676@schiele.dyndns.org","threadId":"11723","inReplyTo":null,"subject":"[PATCH] some systems don't have (and need) sys/select.h","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-01-24T18:34:46Z","receivedAt":"2008-01-24T18:34:46Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"The select stuff is already in sys/time.h on on some systems like HP-UX\nthus we should not include sys/select.h in that case.\n\nSigned-off-by: Robert Schiele <rschiele@gmail.com>\n---\nThis patch replaces my previously sent patch\n\"HP-UX traditionally has no sys/select.h\".\n\n Makefile          |    5 +++++\n git-compat-util.h |    2 ++\n 2 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 5aac0c0..c9e54b1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -42,6 +42,8 @@ all::\n #\n # Define NO_MKDTEMP if you don't have mkdtemp in the C library.\n #\n+# Define NO_SYS_SELECT_H if you don't have sys/select.h.\n+#\n # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.\n # Enable it on Windows.  By default, symrefs are still used.\n #\n@@ -635,6 +637,9 @@ ifdef NO_UNSETENV\n \tCOMPAT_CFLAGS += -DNO_UNSETENV\n \tCOMPAT_OBJS += compat/unsetenv.o\n endif\n+ifdef NO_SYS_SELECT_H\n+\tBASIC_CFLAGS += -DNO_SYS_SELECT_H\n+endif\n ifdef NO_MMAP\n \tCOMPAT_CFLAGS += -DNO_MMAP\n \tCOMPAT_OBJS += compat/mmap.o\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex b6ef544..4df90cb 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -68,7 +68,9 @@\n #include <sys/poll.h>\n #include <sys/socket.h>\n #include <sys/ioctl.h>\n+#ifndef NO_SYS_SELECT_H\n #include <sys/select.h>\n+#endif\n #include <assert.h>\n #include <regex.h>\n #include <netinet/in.h>\n-- \n1.5.2.4\n"},{"id":"66521","messageId":"alpine.LSU.1.00.0801242114590.5731@racer.site","threadId":"11723","inReplyTo":"20080124183446.GJ30676@schiele.dyndns.org","subject":"Re: [PATCH] some systems don't have (and need) sys/select.h","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-24T21:15:12Z","receivedAt":"2008-01-24T21:15:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 24 Jan 2008, Robert Schiele wrote:\n\n> The select stuff is already in sys/time.h on on some systems like HP-UX \n> thus we should not include sys/select.h in that case.\n\nThank you very much,\nDscho\n"},{"id":"66522","messageId":"7vk5ly9b51.fsf@gitster.siamese.dyndns.org","threadId":"11723","inReplyTo":"20080124183446.GJ30676@schiele.dyndns.org","subject":"Re: [PATCH] some systems don't have (and need) sys/select.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-24T21:17:14Z","receivedAt":"2008-01-24T21:17:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Schiele <rschiele@gmail.com> writes:\n\n> The select stuff is already in sys/time.h on on some systems like HP-UX\n> thus we should not include sys/select.h in that case.\n>\n> Signed-off-by: Robert Schiele <rschiele@gmail.com>\n\nThe patch looks good.  I'd rather try to be a bit more helpful\nto people who want to port git to their system that is not\nHP-UX, though.\n\nHow about wording it like this?\n\nSubject: pre-POSIX.1-2001 systems do not have <sys/select.h>\n\nPOSIX.1-2001 has declaration of select(2) in <sys/select.h>, but\nin previous version of SUS, it is declared in <sys/time.h>,\nwhich is already included in git-compat-util.h.\n\nThis introduces NO_SYS_SELECT_H macro in the Makefile to be set\non older systems, to skip inclusion of <sys/select.h> that does\nnot exist on them.\n\nWe could check _POSIX_VERSION with 200112L and do this\nautomatically, but earlier it was reported that the approach\ndoes not work well on some vintage of HP-UX.  Other systems may\nget _POSIX_VERSION itself wrong.  At least for now, this manual\nconfiguration is safer.\n"},{"id":"66524","messageId":"20080124215803.GN30676@schiele.dyndns.org","threadId":"11723","inReplyTo":"7vk5ly9b51.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] some systems don't have (and need) sys/select.h","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-01-24T21:58:03Z","receivedAt":"2008-01-24T21:58:03Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Thu, Jan 24, 2008 at 01:17:14PM -0800, Junio C Hamano wrote:\n> Robert Schiele <rschiele@gmail.com> writes:\n> \n> > The select stuff is already in sys/time.h on on some systems like HP-UX\n> > thus we should not include sys/select.h in that case.\n> >\n> > Signed-off-by: Robert Schiele <rschiele@gmail.com>\n> \n> The patch looks good.  I'd rather try to be a bit more helpful\n> to people who want to port git to their system that is not\n> HP-UX, though.\n> \n> How about wording it like this?\n> \n> Subject: pre-POSIX.1-2001 systems do not have <sys/select.h>\n> \n> POSIX.1-2001 has declaration of select(2) in <sys/select.h>, but\n> in previous version of SUS, it is declared in <sys/time.h>,\n> which is already included in git-compat-util.h.\n> \n> This introduces NO_SYS_SELECT_H macro in the Makefile to be set\n> on older systems, to skip inclusion of <sys/select.h> that does\n> not exist on them.\n> \n> We could check _POSIX_VERSION with 200112L and do this\n> automatically, but earlier it was reported that the approach\n> does not work well on some vintage of HP-UX.  Other systems may\n> get _POSIX_VERSION itself wrong.  At least for now, this manual\n> configuration is safer.\n\nI have no strong opinion on the wording.  Sounds reasonable to me.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"66556","messageId":"1201259981-7115-1-git-send-email-jnareb@gmail.com","threadId":"11723","inReplyTo":"20080124183446.GJ30676@schiele.dyndns.org","subject":"[PATCH] autoconf: Add test for sys/select.h header file","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-25T11:19:41Z","receivedAt":"2008-01-25T11:19:41Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Some systems like HP-UX don't have sys/select.h; the select stuff\nis already present in some other headef file (e.g. sys/time.h for\nHP-UX).\n\nCompanion to\n  \"some systems don't have (and need) sys/select.h\"\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nIt could be alternately just squashed together with\n\"some systems don't have (and need) sys/select.h\" by Robert Schiele.\n\nRobert, could you please check this patch on HP-UX? It does work\ncorrectly on Linux (which has sys/select.h).\n\n config.mak.in |    1 +\n configure.ac  |    6 ++++++\n 2 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex 40b14d9..ee6c33d 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -30,6 +30,7 @@ NO_CURL=@NO_CURL@\n NO_EXPAT=@NO_EXPAT@\n NEEDS_LIBICONV=@NEEDS_LIBICONV@\n NEEDS_SOCKET=@NEEDS_SOCKET@\n+NO_SYS_SELECT_H=@NO_SYS_SELECT_H@\n NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@\n NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@\n NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@\ndiff --git a/configure.ac b/configure.ac\nindex af177fd..85d7ef5 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -235,6 +235,12 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n ## Checks for header files.\n AC_MSG_NOTICE([CHECKS for header files])\n #\n+# Define NO_SYS_SELECT_H if you don't have sys/select.h.\n+AC_CHECK_HEADER([sys/select.h],\n+[NO_SYS_SELECT_H=],\n+[NO_SYS_SELECT_H=UnfortunatelyYes])\n+AC_SUBST(NO_SYS_SELECT_H)\n+#\n # Define OLD_ICONV if your library has an old iconv(), where the second\n # (input buffer pointer) parameter is declared with type (const char **).\n AC_DEFUN([OLDICONVTEST_SRC], [[\n-- \n1.5.3.7\n"},{"id":"66560","messageId":"alpine.LSU.1.00.0801251229250.5731@racer.site","threadId":"11723","inReplyTo":"1201259981-7115-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH] autoconf: Add test for sys/select.h header file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-25T12:30:27Z","receivedAt":"2008-01-25T12:30:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 25 Jan 2008, Jakub Narebski wrote:\n\n> diff --git a/configure.ac b/configure.ac\n> index af177fd..85d7ef5 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -235,6 +235,12 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n>  ## Checks for header files.\n>  AC_MSG_NOTICE([CHECKS for header files])\n>  #\n> +# Define NO_SYS_SELECT_H if you don't have sys/select.h.\n> +AC_CHECK_HEADER([sys/select.h],\n> +[NO_SYS_SELECT_H=],\n> +[NO_SYS_SELECT_H=UnfortunatelyYes])\n> +AC_SUBST(NO_SYS_SELECT_H)\n> +#\n\nJust because I am curious: would that not define \"NO_SYS_SELECT_H\" in both \ncases?  IOW would the \"ifdef NO_SYS_SELECT_H\" not be triggered all the \ntime?\n\nThanks,\nDscho\n"},{"id":"66563","messageId":"20080125125304.GO30676@schiele.dyndns.org","threadId":"11723","inReplyTo":"alpine.LSU.1.00.0801251229250.5731@racer.site","subject":"Re: [PATCH] autoconf: Add test for sys/select.h header file","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-01-25T12:53:04Z","receivedAt":"2008-01-25T12:53:04Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Fri, Jan 25, 2008 at 12:30:27PM +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Fri, 25 Jan 2008, Jakub Narebski wrote:\n> \n> > diff --git a/configure.ac b/configure.ac\n> > index af177fd..85d7ef5 100644\n> > --- a/configure.ac\n> > +++ b/configure.ac\n> > @@ -235,6 +235,12 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n> >  ## Checks for header files.\n> >  AC_MSG_NOTICE([CHECKS for header files])\n> >  #\n> > +# Define NO_SYS_SELECT_H if you don't have sys/select.h.\n> > +AC_CHECK_HEADER([sys/select.h],\n> > +[NO_SYS_SELECT_H=],\n> > +[NO_SYS_SELECT_H=UnfortunatelyYes])\n> > +AC_SUBST(NO_SYS_SELECT_H)\n> > +#\n> \n> Just because I am curious: would that not define \"NO_SYS_SELECT_H\" in both \n> cases?  IOW would the \"ifdef NO_SYS_SELECT_H\" not be triggered all the \n> time?\n\nNo, in make the empty string is equal to not being defined.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"66621","messageId":"7v8x2d3xya.fsf@gitster.siamese.dyndns.org","threadId":"11723","inReplyTo":"1201259981-7115-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH] autoconf: Add test for sys/select.h header file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-26T06:25:33Z","receivedAt":"2008-01-26T06:25:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Some systems like HP-UX don't have sys/select.h; the select stuff\n> is already present in some other headef file (e.g. sys/time.h for\n> HP-UX).\n>\n> Companion to\n>   \"some systems don't have (and need) sys/select.h\"\n>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> It could be alternately just squashed together with\n> \"some systems don't have (and need) sys/select.h\" by Robert Schiele.\n>\n> Robert, could you please check this patch on HP-UX? It does work\n> correctly on Linux (which has sys/select.h).\n\nThe issue is not really about \"do we have <sys/select.h>?\" but\nis about \"do we need to include <sys/select.h> in order to\nobtain declaration of select(2)?\" so this is covering only a\nhalf of the issue.  But I guess we will find out if the system\ndoes not offer select(2) whether <sys/select.h> is included or\nnot, so this is not too bad.\n\nWill apply.  I do not think it would have problems but even if\nit does it is small and easy to revert before the final.\n\nThanks.\n"},{"id":"66626","messageId":"20080126094253.GP30676@schiele.dyndns.org","threadId":"11723","inReplyTo":"7v8x2d3xya.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] autoconf: Add test for sys/select.h header file","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-01-26T09:42:53Z","receivedAt":"2008-01-26T09:42:53Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Fri, Jan 25, 2008 at 10:25:33PM -0800, Junio C Hamano wrote:\n> The issue is not really about \"do we have <sys/select.h>?\" but\n> is about \"do we need to include <sys/select.h> in order to\n> obtain declaration of select(2)?\" so this is covering only a\n\nThis is true.  Actually HP-UX 11.23 for instance has sys/select.h but this is\nnot intended to be included to get the select call but this is intended to be\nincluded by kernel drivers that implement the interface the kernel needs to\n_provide_ the select call.  In that case the test determines that sys/select.h\nexists but it does not notice that it is not the header to include.  It does\nnot hurt though since including sys/select.h outside of a kernel driver is a\nno-op and we include sys/time.h which is really needed anyway.\n\n> half of the issue.  But I guess we will find out if the system\n> does not offer select(2) whether <sys/select.h> is included or\n> not, so this is not too bad.\n> \n> Will apply.  I do not think it would have problems but even if\n> it does it is small and easy to revert before the final.\n\nAt least on the systems I know it does not hurt even when it does not always\nexactly what it is intended to do.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"}]}