strtok_r() HP-UX,

Lutz Jaenicke Lutz.Jaenicke at aet.TU-Cottbus.DE
Tue Sep 26 19:43:00 EST 2000


On Tue, Sep 26, 2000 at 10:14:56AM +0200, Kevin Steves wrote:
> On Tue, 26 Sep 2000, Damien Miller wrote:
> : > Until I can determine what the issue and background is, you'll need to
> : > define _REENTRANT in the latest snapshot so the strtok_r() function
> : > prototype is pulled in from <string.h>.  This is for HP-UX 11.0; I'm not
> : > sure about 10.20.
> :  
> : Any objections to setting this unconditionally? IIRC there was some other
> : platform (Irix?) where you needed to do the same.
> 
> For HP-UX, this is what I found in pthread(3):
> 
>       Note: When explicitly specifying ANSI compilation (via "-Aa"),
>       defining the POSIX revision level restricts the program to using
>       interfaces within the POSIX namespaces.  If interfaces in the larger
>       X/Open namespace are to be called, either of the compiler options,
>       -D_XOPEN_SOURCE_EXTENDED or -D_HPUX_SOURCE, must be specified in
>       addition to -D_POSIX_C_SOURCE=199506L.  Alternatively, compiling with
>       -Ae (or not specifying "-A") will implicitly specify -D_HPUX_SOURCE.
> 
>       Note: Some documentation will recommend the use of -D_REENTRANT for
>       compilation.  While this also functions properly, it is considered an
>       obsolescent form.
> 
> There's also this in string(3):
> 
>       Users of strtok_r() should also note that the prototype of this
>       function will change in the next release for conformance with the new
>       POSIX Threads standard.
> 
> Though it's been there for years (at least since 10.20).

On 10.20, there is no pthread(3), but the note in string(3) is the same
It is however necessary to define -D_REENTRANT additionally to using
-Ae or D_HPUX_SOURCE. I have checked string.h and sys/stdsyms.h:
on 10.20 -D_REENTRANT is not automatically set!!
Kevin's change to configure solves the problem.

Best regards,
	Lutz
-- 
Lutz Jaenicke                             Lutz.Jaenicke at aet.TU-Cottbus.DE
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153





More information about the openssh-unix-dev mailing list