[PATCH] some systems don't have (and need) sys/select.h

Subsystems: kernel build + files below scripts/ (unless maintained elsewhere), the rest

DORMANTno replies

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

[PATCH] some systems don't have (and need) sys/select.h

From: Robert Schiele <hidden>
Date: 2016-06-15 22:44:08

The select stuff is already in sys/time.h on on some systems like HP-UX
thus we should not include sys/select.h in that case.

Signed-off-by: Robert Schiele <redacted>
---
This patch replaces my previously sent patch
"HP-UX traditionally has no sys/select.h".

 Makefile          |    5 +++++
 git-compat-util.h |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 5aac0c0..c9e54b1 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,8 @@ all::
 #
 # Define NO_MKDTEMP if you don't have mkdtemp in the C library.
 #
+# Define NO_SYS_SELECT_H if you don't have sys/select.h.
+#
 # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
 # Enable it on Windows.  By default, symrefs are still used.
 #
@@ -635,6 +637,9 @@ ifdef NO_UNSETENV
 	COMPAT_CFLAGS += -DNO_UNSETENV
 	COMPAT_OBJS += compat/unsetenv.o
 endif
+ifdef NO_SYS_SELECT_H
+	BASIC_CFLAGS += -DNO_SYS_SELECT_H
+endif
 ifdef NO_MMAP
 	COMPAT_CFLAGS += -DNO_MMAP
 	COMPAT_OBJS += compat/mmap.o
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef544..4df90cb 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -68,7 +68,9 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#ifndef NO_SYS_SELECT_H
 #include <sys/select.h>
+#endif
 #include <assert.h>
 #include <regex.h>
 #include <netinet/in.h>
-- 
1.5.2.4

Re: [PATCH] some systems don't have (and need) sys/select.h

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:08

Hi,

On Thu, 24 Jan 2008, Robert Schiele wrote:
The select stuff is already in sys/time.h on on some systems like HP-UX 
thus we should not include sys/select.h in that case.
Thank you very much,
Dscho

[PATCH] autoconf: Add test for sys/select.h header file

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:44:08

Some systems like HP-UX don't have sys/select.h; the select stuff
is already present in some other headef file (e.g. sys/time.h for
HP-UX).

Companion to
  "some systems don't have (and need) sys/select.h"

Signed-off-by: Jakub Narebski <redacted>
---
It could be alternately just squashed together with
"some systems don't have (and need) sys/select.h" by Robert Schiele.

Robert, could you please check this patch on HP-UX? It does work
correctly on Linux (which has sys/select.h).

 config.mak.in |    1 +
 configure.ac  |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index 40b14d9..ee6c33d 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -30,6 +30,7 @@ NO_CURL=@NO_CURL@
 NO_EXPAT=@NO_EXPAT@
 NEEDS_LIBICONV=@NEEDS_LIBICONV@
 NEEDS_SOCKET=@NEEDS_SOCKET@
+NO_SYS_SELECT_H=@NO_SYS_SELECT_H@
 NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@
 NO_D_TYPE_IN_DIRENT=@NO_D_TYPE_IN_DIRENT@
 NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@
diff --git a/configure.ac b/configure.ac
index af177fd..85d7ef5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,12 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
 #
+# Define NO_SYS_SELECT_H if you don't have sys/select.h.
+AC_CHECK_HEADER([sys/select.h],
+[NO_SYS_SELECT_H=],
+[NO_SYS_SELECT_H=UnfortunatelyYes])
+AC_SUBST(NO_SYS_SELECT_H)
+#
 # Define OLD_ICONV if your library has an old iconv(), where the second
 # (input buffer pointer) parameter is declared with type (const char **).
 AC_DEFUN([OLDICONVTEST_SRC], [[
-- 
1.5.3.7

Re: [PATCH] autoconf: Add test for sys/select.h header file

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:08

Hi,

On Fri, 25 Jan 2008, Jakub Narebski wrote:
quoted hunk
diff --git a/configure.ac b/configure.ac
index af177fd..85d7ef5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,12 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
 #
+# Define NO_SYS_SELECT_H if you don't have sys/select.h.
+AC_CHECK_HEADER([sys/select.h],
+[NO_SYS_SELECT_H=],
+[NO_SYS_SELECT_H=UnfortunatelyYes])
+AC_SUBST(NO_SYS_SELECT_H)
+#
Just because I am curious: would that not define "NO_SYS_SELECT_H" in both 
cases?  IOW would the "ifdef NO_SYS_SELECT_H" not be triggered all the 
time?

Thanks,
Dscho

Re: [PATCH] autoconf: Add test for sys/select.h header file

From: Robert Schiele <hidden>
Date: 2016-06-15 22:44:08

On Fri, Jan 25, 2008 at 12:30:27PM +0000, Johannes Schindelin wrote:
Hi,

On Fri, 25 Jan 2008, Jakub Narebski wrote:
quoted
diff --git a/configure.ac b/configure.ac
index af177fd..85d7ef5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,12 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
 #
+# Define NO_SYS_SELECT_H if you don't have sys/select.h.
+AC_CHECK_HEADER([sys/select.h],
+[NO_SYS_SELECT_H=],
+[NO_SYS_SELECT_H=UnfortunatelyYes])
+AC_SUBST(NO_SYS_SELECT_H)
+#
Just because I am curious: would that not define "NO_SYS_SELECT_H" in both 
cases?  IOW would the "ifdef NO_SYS_SELECT_H" not be triggered all the 
time?
No, in make the empty string is equal to not being defined.

Robert

-- 
Robert Schiele
Dipl.-Wirtsch.informatiker	mailto:rschiele@gmail.com

"Quidquid latine dictum sit, altum sonatur."
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help