Re: [PATCH] HP-UX does not have select.h
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:00
"H.Merijn Brand" [off-list ref] writes:
quoted
quoted
Also because these are the *only* _POSIX_VERSION defines in the entire include tree, and 11.23 does have a select.h, which makes the patch below to be not OK on 11.23. I'm not stating that HP follows the rules in any correct way, but if this is to be sure that select.h gets included if the OS supports it, it will fail.... But your grep did not catch their definition of _POSIX1_VERSION_$YEAR which are used to define the actual value of _POSIX_VERSION.If it is used to *define* _POSIX_VERSION, it should have come up too, wouldn't it?
Sorry, I should re-read your grep output. It is possible that I am quite confused. Your grep session begins like this:
quoted
quoted
quoted
quoted
/usr/include 103 > grep -r POSIX_VERSION * sys/unistd.h:# define _POSIX_VERSION _POSIX1_VERSION_88 sys/unistd.h:# define _POSIX_VERSION _POSIX1_VERSION_90 sys/unistd.h:# define _POSIX_VERSION _POSIX1_VERSION_93
Now, if they had
#define _POSIX1_VERSION_88 198808L
#define _POSIX1_VERSION_90 199009L
#define _POSIX1_VERSION_93 199309L
#define _POSIX1_VERSION_95 199506L
#define _POSIX1_VERSION_01 200112L
elsewhere in their include files, then
(1) "grep -r POSIX_VERSION *" wouldn't have matched them;
(2) not all of the three output form sys/unistd.h could be in effect at
the same time. There may be #ifdef around it to control which
definition is used, but your "grep" wouldn't have shown them
either.
Maybe HP-UX include files #ifdef the definition of _POSIX_VERSION
depending on what is asked for with feature test macros? We do not
define _POSIX_C_SOURCE to 200112L but we do define _XOPEN_SOURCE to 600.
According to:
http://www.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_02.html
this should be sufficient to ask for POSIX.1-2001 features.
But in any case, 88/90/93 are all too old (predates 2001-12) so if these
three definitions are only possible values in their include files, then
we wouldn't see _POSIX_VERSION set to 200112L. That is unfortunate.
It seems we need to go back to that "NO_SYS_SELECT_H=YesPlease" thing.