Re: [PATCH] HP-UX traditionally has no sys/select.h

Subsystems: the rest

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

Re: [PATCH] HP-UX traditionally has no sys/select.h

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:08

Robert Schiele [off-list ref] writes:
quoted hunk
The select stuff is already in sys/time.h on traditional HP-UX
systems thus we should not include sys/select.h there because older
releases don't have it.
---
 git-compat-util.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef544..77de915 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 __hpux
 #include <sys/select.h>
+#endif
 #include <assert.h>
 #include <regex.h>
 #include <netinet/in.h>
-- 
1.5.2.4
We had a thread on this issue mid December.
Does this help?
From 72a41cae180ad57c6f2daa0af9b96e284386dc1b Mon Sep 17 00:00:00 2001
From: Junio C Hamano <redacted>
Date: Tue, 18 Dec 2007 01:52:07 -0800
Subject: [PATCH] Do not include <sys/select.h> on pre- POSIX.1-2001 systems

For previous version of SUS, select(2) would have been declared in
<sys/time.h>, which is already included.  POSIX.1-2001 moved the
declaration to <sys/select.h>, so check _POSIX_VERSION with 200112L
and skip inclusion of <sys/select.h> if it is not the case.

Signed-off-by: Junio C Hamano <redacted>
---
 git-compat-util.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef544..fb3b969 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>
+#if _POSIX_VERSION >= 200112L
 #include <sys/select.h>
+#endif
 #include <assert.h>
 #include <regex.h>
 #include <netinet/in.h>
-- 
1.5.4.rc4.23.gcab31

Re: [PATCH] HP-UX traditionally has no sys/select.h

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

On Thu, Jan 24, 2008 at 11:11:44AM -0800, Junio C Hamano wrote:
We had a thread on this issue mid December.
Does this help?
Yes, checking for the _POSIX_VERSION is also a working approach.

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