git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] HP-UX does not have select.h

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 20, 2007, 07:52 UTC
Message-ID
<7vlk7preeu.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071220081806.0ccdf636@pc09.procura.nl>
"H.Merijn Brand" <h.m.brand@xs4all.nl> writes:
Show 11 quoted lines
>> > 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:
>> >> > /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.

Previous: H.Merijn BrandNext: Jan Hudec
Message 18 of 20 in “HP-UX does not have select.h”
  1. HP-UX does not have select.hH.Merijn Brand, Dec 17, 2007
  2. Junio C HamanoDec 17, 2007
  3. H.Merijn BrandDec 17, 2007
  4. Junio C HamanoDec 18, 2007
  5. H.Merijn BrandDec 18, 2007
  6. Johannes SixtDec 18, 2007
  7. Johannes SchindelinDec 18, 2007
  8. Johannes SixtDec 18, 2007
  9. Johannes SchindelinDec 18, 2007
  10. Johannes SixtDec 18, 2007
  11. Andreas EricssonDec 18, 2007
  12. Junio C HamanoDec 18, 2007
  13. H.Merijn BrandDec 18, 2007
  14. Junio C HamanoDec 19, 2007
  15. H.Merijn BrandDec 19, 2007
  16. Junio C HamanoDec 19, 2007
  17. H.Merijn BrandDec 20, 2007
  18. Junio C HamanoDec 20, 2007
  19. Jan HudecDec 23, 2007
  20. H.Merijn BrandDec 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.