Patch Name: PHCO_23963

Patch Description: s700_800 11.00 libc cumulative header file patch

Creation Date: 01/04/20

Post Date: 01/05/29

Hardware Platforms - OS Releases:
	s700: 11.00
	s800: 11.00

Products: N/A

Filesets:
	InternetSrvcs.INETSVCS-INETD,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP
	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP

Automatic Reboot?: No

Status: General Release

Critical: No

Category Tags:
	defect_repair general_release

Path Name: /hp-ux_patches/s700_800/11.X/PHCO_23963

Symptoms:
	PHCO_23963:
	while compiling in cplusplus the getres() is Mangled and the
	user experiences a linker error.
	JAGad52748; SR 8606183535

	ctype.h  has  obsolete   compiler  defines  that  should  be
	removed.
	JAGad47817; SR 8606178590

	PHCO_23092:
	gettimeofday is very slow for certain vendors who use it for
	time stamping.Hence a new API hrtime_t  gethrtime(void)  has
	been added to libc.Declaration  for this new API is added to
	the header file /usr/include/time.h
	JAGad44410; SR 8606175166

	PHCO_21017:
	Libc header files that are part of the C++ standard
	language definition are not supporting the namespace
	std:: standard
	JAGaa86632, JAGac88525; SR 1653275354, 8606129620

	PHCO_18229:
	Concurrent invocations of mount(1M) or other commands that
	write to or read from /etc/mnttab may cause a deadlock.
	JAGaa01122, JAGaa01628; SR 1653290346

	PHCO_17078:
	Files /usr/include/threads/rec_mutex.h and
	/usr/include/threads/ktepv.h, included with PHCO_14705
	are now obsolete.
	JAGaa21913

	PHCO_15769:
	The CONCAT macro in <inttypes.h> does not work correctly
	for C++ applications. JAGaa00515

	PHCO_14705:
	Enhancement request for providing a new threads API
	__thread_detach(). The following header files are added:
	/threads/rec_mutex.h, /threads/ktepv.h
	JAGaa01380

	Prototype for the get_expiration_time() API is not visible
	if _INCLUDE_HPUX_SOURCE is defined while building
	applications.  JAGaa01500.

	PHCO_14224:
	C++ applications do not compile when _FILE_OFFSET_BITS is
	set to 64 in 32-bit mode. JAGaa00365, JAGaa01298,
	JAGaa01113, SR 1653208348.

	PHCO_14103:
	To enable large malloc feature for malloc(3C).
	DTS # JAGaa01089, JAGaa01179.

Defect Description:
	PHCO_23963:
	The  getres()  function  is mangled up and hence  linking in
	cplusplus  environment fails.  The function name encoding in
	cplusplus  changes  the name of the API in the  application.
	Hence at link time the right symbol is not  recognised and a
	linker error is flagged.

	Resolution:
	The   getres()  has  been   protected   by  the  extern  "C"
	declaration.  This  tells  the c++  compiler  not to  follow
	function name encoding and hence mangling does not occur.  C
	type of compilation is followed in the case of getres().
	JAGad52748; SR 8606183535

	ctype.h  has  obsolete   compiler  defines  that  should  be
	removed.

	Resolution:
	The following obsolete #defines are removed from ctype.h:

	/* The following character class constants are obsolete: */
	     #  define _U    01
	     #  define _L    02
	     #  define _N    04
	     #  define _S    010
	     #  define _P    020
	     #  define _C    040
	     #  define _B    0100
	     #  define _X    0200
	     #  define _A    01
	     #  define _G    02
	     #  define _PR   04

	The above definitions are obsoleted since 10.x.
	Fully Supported symbols insted of the above obsolete symbols
	are given below.
	Obsolete symbol       Supported Symbol
	---------------       ----------------

	  _U                      _ISALPHA
	  _L                      _ISALNUM
	  _N                      _ISBLANK
	  _S                      _ISCNTRL
	  _P                      _ISDIGIT
	  _C                      _ISGRAPH
	  _B                      _ISLOWER
	  _X                      _ISPRINT
	  _A                      _ISALPHA
	  _G                      _ISALNUM
	  _PR                     _ISBLANK

	JAGad47817; SR 8606178590

	PHCO_23092:
	gettimeofday is very slow for certain vendors who use it for
	time stamping because it calls a heavy weight system call to
	get the current time of the day.

	Resolution:
	A new API hrtime_t  gethrtime(void)  has been added to libc.
	Declaration  for  this  API  is  added  in the  header  file
	/usr/include/time.h
	JAGad44410; SR 8606175166

	PHCO_21017:
	Put all STL (Standard C++-library) classes in
	namespace std::, because it is the standard.

	Resolution:
	The libc header files that are part of the C++ standard
	language definition are modified to support the namespace
	std:: standard
	JAGaa86632; SR 1653275354

	#include <cwchar>
	int main () {}
	Try the above test with
	% aCC -AA t.c -E -.i
	on a 11.00 system.  The generated t.i will have a bunch
	of declarations that should not be there.

	In some cases, several headers like stdio.h should be
	included from /usr/include instead of /opt/aCC/include.
	When this happens, these headers should not be included
	from /opt/aCC/include.

	
	The -I order for aCC always searchs /opt/aCC/include
	first.  For HP 11.x version of /usr/include/wchar.h,
	it has

	#  include <ctype.h>      /* _U, _L, etc             */
	#  include <stddef.h>     /* NULL, size_t, etc       */
	#  include <stdio.h>      /* stdio prototypes        */
	#  include <stdlib.h>     /* multibyte prototypes    */
	#  include <time.h>       /* tm struct               */

	without include guard.  That will lead to /opt/aCC/ctype.h
	getting included.

	Resolution:
	The preinclude guard as appeared in HP 10.20 version
	should be there always.

	The 10.20 has the following:
	/* preinclude guards needed for aC++ namespace std */
	#ifndef _CTYPE_INCLUDED
	#  include <ctype.h>      /* _U, _L, etc             */
	#endif
	#ifndef _STDDEF_INCLUDED
	#  include <stddef.h>     /* NULL, size_t, etc       */
	#endif
	#ifndef _STDIO_INCLUDED
	#  include <stdio.h>      /* stdio prototypes        */
	#endif
	#ifndef _STDLIB_INCLUDED
	#  include <stdlib.h>     /* multibyte prototypes    */
	#endif
	#ifndef _TIME_INCLUDED
	#  include <time.h>       /* tm struct               */
	#endif
	JAGac88525; SR 8606129620

	PHCO_18229:
	This deadlock is due to excessive locking of /etc/mnttab
	in the getmntent(3X) family of APIs.  The /etc/mnttab
	access policies have been changed to no longer require
	read locking.  setmntent(3X) still tries to acquire a
	write lock when opening /etc/mnttab for writing/updating.
	In the libc patch, setmntent(3X) no longer uses a read
	lock when opening the mnttab file, and a new API,
	delmntent(3X) has been developed.  This patch is required
	for developers intending on using the new API, delmntent,
	implemented in libc.2 patch PHCO_18227.

	Resolution:
	The problem was caused by excessive locking of /etc/mnttab
	in the getmntent(3X) family of APIs, and by incorrect use
	of the getmntent(3X) APIs by commands such as mount(1M)
	and umount(1M).  In the patch, setmntent(3X) no longer uses
	a read lock when opening the mnttab file, and a new API,
	delmntent(3X), has been developed for use by commands that
	delete entries from the mnttab file.  Use of this patch
	will avoid a possible deadlock situation during concurrent
	invocations of mount(1M) or other commands that write to
	or read from /etc/mnttab.
	JAGaa01122, JAGaa01628; SR 1653290346

	PHCO_17078:
	Files /usr/include/threads/rec_mutex.h and
	/usr/include/threads/ktepv.h, included with PHCO_14705
	are now obsolete.
	JAGaa21913

	PHCO_15769:
	The CONCAT macro in <inttypes.h> returns an incorrect
	value in C++ applications. JAGaa00515.

	PHCO_14705:
	Enhancement request for providing a new threads API
	__thread_detach(). The following header files are added:
	/threads/rec_mutex.h, /threads/ktepv.h
	JAGaa01380

	While supplying the prototype for get_expiration_time,
	<time.h> does not take care of the condition where
	_INCLUDE_HPUX_SOURCE flag is defined during compile
	time. Hence prototype for the get_expiration_time() API
	is not visible if _INCLUDE_HPUX_SOURCE is defined while
	building applications. JAGaa01500

	PHCO_14224:
	C++ applications do not have access to 64-bit data types
	and Large Files interfaces when compiled in 32-bit mode.
	JAGaa00365, JAGaa01298, JAGaa01113, SR 1653208348.

	PHCO_14103:
	To enable large malloc feature for malloc(3C).

SR:
	8606183535 8606178590 8606175166 1653275354 8606129620
	1653290346 1653208348

Patch Files:
	
	InternetSrvcs.INETSVCS-INETD,fr=B.11.00,
		fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/resolv.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/ctype.h
	/usr/include/errno.h
	/usr/include/locale.h
	/usr/include/ftw.h
	/usr/include/inttypes.h
	/usr/include/malloc.h
	/usr/include/mntent.h
	/usr/include/pwd.h
	/usr/include/setjmp.h
	/usr/include/stddef.h
	/usr/include/stdio.h
	/usr/include/stdlib.h
	/usr/include/string.h
	/usr/include/time.h
	/usr/include/utime.h
	/usr/include/wchar.h
	/usr/include/sys/_size_t.h
	/usr/include/sys/_time_t.h
	/usr/include/threads/rec_mutex.h
	/usr/include/threads/ktepv.h

what(1) Output:
	
	InternetSrvcs.INETSVCS-INETD,fr=B.11.00,
		fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/resolv.h:
		resolv.h        8.1 (Berkeley) 6/2/93

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/ctype.h:
		$Revision: ../hdr/ctype.h@@/main/r11ros/cup_ros-cpe/
			cup_libc-ros-cpe/2 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/errno.h:
		$Revision: ../hdr/errno.h@@/main/r11ros/cup_ros-cpe/
			cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/locale.h:
		$Revision: ../hdr/locale.h@@/main/r11ros/cup_ros-cpe
			/cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/ftw.h:
		$Revision: ../hdr/ftw.h@@/main/r11ros/cup_ros-cpe/cu
			p_libc-ros-cpe/4 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/inttypes.h:
		$Revision: ../hdr/inttypes.h@@/main/r11ros/cup_ros-c
			pe/cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/malloc.h:
		$Revision: ../hdr/malloc.h@@/main/r11ros/cup_ros-cpe
			/cup_libc-ros-cpe/3 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/mntent.h:
		$Revision: ../hdr/mntent.h@@/main/i80/cup_tshem_libc
			_990p/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/pwd.h:
		$Revision: ../hdr/pwd.h@@/main/r11ros/cup_ros-cpe/cu
			p_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/setjmp.h:
		setjmp.h $Revision: ../hdr/setjmp.h@@/main/r11ros/cu
			p_ros-cpe/cup_libc-ros-cpe/2 $

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/stddef.h:
		$Revision: ../hdr/stddef.h@@/main/r11ros/cup_ros-cpe
			/cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/stdio.h:
		$Revision: ../hdr/stdio.h@@/main/r11ros/cup_ros-cpe/
			cup_libc-ros-cpe/6 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/stdlib.h:
		$Revision: ../hdr/stdlib.h@@/main/r11ros/cup_ros-cpe
			/cup_libc-ros-cpe/3 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/string.h:
		$Revision: ../hdr/string.h@@/main/r11ros/cup_ros-cpe
			/cup_libc-ros-cpe/2 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/time.h:
		$Revision: ../hdr/time.h@@/main/r11ros/cup_ros-cpe/c
			up_libc-ros-cpe/6 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/utime.h:
		$Revision: ../hdr/utime.h@@/main/r11ros/cup_ros-cpe/
			cup_libc-ros-cpe/1 $  */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/wchar.h:
		wchar.h $Revision: ../hdr/wchar.h@@/main/r11ros/cup_
			ros-cpe/cup_libc-ros-cpe/3 $

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/sys/_size_t.h:
		$Revision: ../hdr/sys/_size_t.h@@/main/r11ros/cup_ro
			s-cpe/cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/sys/_time_t.h:
		$Revision: ../hdr/sys/_time_t.h@@/main/r11ros/cup_ro
			s-cpe/cup_libc-ros-cpe/1 $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/threads/rec_mutex.h:
		$Revision: ../hdr/threads/rec_mutex.h $ */

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	/usr/include/threads/ktepv.h:
		$Revision: ../hdr/threads/ktepv.h $ */

cksum(1) Output:
	
	InternetSrvcs.INETSVCS-INETD,fr=B.11.00,
		fa=HP-UX_B.11.00_32/64,v=HP:
	587610232 7499 /usr/include/resolv.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3581432377 5354 /usr/include/ctype.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	1137803967 1291 /usr/include/errno.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	1993635629 4945 /usr/include/locale.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3073457572 6779 /usr/include/ftw.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	212629695 13265 /usr/include/inttypes.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	300681896 3000 /usr/include/malloc.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	1619052642 6979 /usr/include/mntent.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	1744748058 4864 /usr/include/pwd.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	1002233553 3782 /usr/include/setjmp.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	4017935722 1406 /usr/include/stddef.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3576246502 21213 /usr/include/stdio.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	161083317 13417 /usr/include/stdlib.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	802164631 6310 /usr/include/string.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	484251452 9940 /usr/include/time.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3199309624 1817 /usr/include/utime.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	53137255 9572 /usr/include/wchar.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	2795097045 184 /usr/include/threads/rec_mutex.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3412888502 170 /usr/include/threads/ktepv.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	81113652 942 /usr/include/sys/_size_t.h

	ProgSupport.C-INC,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP:
	3357664492 958 /usr/include/sys/_time_t.h

Patch Conflicts: None

Patch Dependencies: None

Hardware Dependencies: None

Other Dependencies: None

Supersedes:
	PHCO_14103 PHCO_14224 PHCO_14705 PHCO_15769 PHCO_17078 PHCO_18229
	PHCO_21017 PHCO_23092

Equivalent Patches: None

Patch Package Size: 00 KBytes

Installation Instructions:
	Please review all instructions and the Hewlett-Packard
	SupportLine User Guide or your Hewlett-Packard support terms
	and conditions for precautions, scope of license,
	restrictions, and, limitation of liability and warranties,
	before installing this patch.
	------------------------------------------------------------
	1. Back up your system before installing a patch.

	2. Login as root.

	3. Copy the patch to the /tmp directory.

	4. Move to the /tmp directory and unshar the patch:

		cd /tmp
		sh PHCO_23963

	5. Run swinstall to install the patch:

		swinstall -x autoreboot=true -x patch_match_target=true \
			  -s /tmp/PHCO_23963.depot

	By default swinstall will archive the original software in 
	/var/adm/sw/save/PHCO_23963.  If you do not wish to retain a
	copy of the original software, use the patch_save_files option:

		swinstall -x autoreboot=true -x patch_match_target=true \
			  -x patch_save_files=false -s /tmp/PHCO_23963.depot

	WARNING: If patch_save_files is false when a patch is installed,
		 the patch cannot be deinstalled.  Please be careful
		 when using this feature.

	For future reference, the contents of the PHCO_23963.text file is 
	available in the product readme:

		swlist -l product -a readme -d @ /tmp/PHCO_23963.depot

	To put this patch on a magnetic tape and install from the
	tape drive, use the command:

		dd if=/tmp/PHCO_23963.depot of=/dev/rmt/0m bs=2k

Special Installation Instructions:
	None.

