Pegasus Enhancement Proposal (PEP)

PEP #: 91

Title: Port of Pegasus to Solaris

Version: 1.0

Created: 25 July 2003 

Authors: Keith Petley

Status:  Approved, Aug 03

 

Version History:

Version Date Author Change Description
1.0 25 July 2003 Keith Petley  Initial Submission
       

 


Abstract: Port Pegasus to the Solaris platform


 

Definition of the Problem

Today, Pegasus does not support the Solaris Platform. While at one time it was ported, the changes over the last 1.5 years have bypassed that port.  VERITAS needs a port of Pegasus to Solaris

Proposed Solution

make the changes to complete the port of Pegasus to the Solaris platform.

The code has already been produced and tested on Solaris. 
The code was originally produced on a snapshot taken from  the cvs top of tree (tot) on April 27. The source obtained by merging our changes into this snapshot was built and tested as follows:
    Solaris 5.6, 5.7, 5.8 and 5.9 using the Sun Workshop 6 update 2 Compiler suite.
    Solaris 5.8 using gcc 2.96 and gcc 3.2.3
    Redhat Linux 7.2 using gcc 3.2.3
    AIX 5 using xlr compiler
    HP-UX 11i using (old version of) aCC compiler.
    Windows 2000 SP2 using VS C++ 6

The Solaris builds were to stress the port and the other platforms were simply to confirm we hadn't broken anything.

All builds ran the included test suite to completion. The common and client libraries from the Solaris 5.9 build were successfully linked and used in a VERITAS internal application.

The current code is a remerge with the cvs tot 24 July. This has built (with an additional small patch - see Issues below) on Solaris 5.8 using the Workshop compiler.  It has not yet been built/tested on other platforms.

Rationale

Note that this does not mean that VERITAS is intending to become the platform maintainer for Solaris.  This change simply provides a port to Solaris for the existing code.

Issues

To date the port has primarily been aimed at Client use. Hence the Server side of the port may still require some work.

I have tended to wrap most changes in #ifdef SOLARIS but some things could perhaps be made more generally available.

Many of the changes involved replacing standard library calls with their MT safe equivalent. I know that most HP-UX calls are MT-safe in their standard form, but is this true of the other supported platforms?

The code as shown in the diffs. builds and links but dumps core when the tests are run. This is because the static constructor for LanguageElement::EMPTY makes use of String::EMPTY. Unfortunately the static constructor for LanguageElement::EMPTY is called before that of String::EMPTY on the current Solaris build. (The Linux build of tot that I performed as a comparison calls them in reverse order, and hence has no problem). There seems to be no way to specify the ordering of these constructors and other (unrelated) code changes could cause the order to change. I temporarily fixed this by creating a temporary empty String and using that to initialise LanguageElement::EMPTY. With this minor patch the code completed the test suite.

I haven't changed any of the information at the top of each file - it still bears the original author/company names etc.

VERITAS legal department have asked that I attach the following statement to this submission.

"VERITAS contributes the code accompanying this submission pursuant to the terms of the MIT open source license located at http://www.openpegasus.org/page.tpl?ggid=38
<http://www.openpegasus.org/page.tpl?ggid=38> ."

Schedule

Action

Planned

Actual

Comment

PEP Submitted

7/25/03

 

 

PEP Reviewed

8/1/03

 

 

PEP Approved

8/8/03

 

 

Code Committed

8/29/03

 

 

Discussion

<Additional information from discussions,  reviews, and decisions of the steering committee and architecture team can be recorded here. Information in this section is to help reviewers but MUST also be reflected in the Proposed Solution / Rationale, etc. sections. This section is for information only during the review process.>

Changes

New files:

mak/platform_SOLARIS_SPARC_CC.mak
src/Pegasus/Common/IPCSun.h
src/Pegasus/Common/Platform_SOLARIS_SPARC_CC.h

List of changed files:

src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_emanate.cpp
mak/BuildMakefile
src/Pegasus/Common/HTTPAcceptor.cpp
mak/platform_SOLARIS_SPARC_GNU.mak
src/Pegasus/Common/MessageLoader.h
mak/clean.mak
mak/depend-unix.mak
src/Pegasus/Common/ThreadUnix_inline.h
src/Clients/tomof/clientRepositoryInterface.cpp
src/slp/lslp-perl-linux.h
src/Pegasus/Common/DirUnix.cpp
src/Pegasus/Common/Monitor.h
src/Pegasus/Security/Authentication/LocalAuthFileUnix.cpp
src/Pegasus/Common/Memory.h
src/Pegasus/Common/Signal.cpp
src/Pegasus/Common/tests/Array/Array.cpp
src/Pegasus/Common/tests/ToMof/tomof.cpp
src/Pegasus/Common/Base64.cpp
src/Pegasus/Common/IPCUnix_inline.h
src/Pegasus/Common/tests/Tracer/Tracer.cpp
src/Pegasus/Common/IPCUnix.h
src/slp/slp.cpp
src/Pegasus/Common/tests/Value/Value.cpp
src/Pegasus/Common/CGIQueryString.cpp
src/Pegasus/Repository/Makefile
src/Clients/wbemexec/XMLProcess.cpp
src/Pegasus/Compiler/cimmof_tab.cpp
src/Pegasus/Common/IPC.h
src/Pegasus/Common/AcceptLanguages.cpp
src/Pegasus/Common/ArrayRep.h
src/Pegasus/Common/ContentLanguages.cpp
src/Pegasus/Common/LanguageElementContainer.cpp
mak/config.mak
src/Pegasus/Common/HTTPConnector.cpp
src/Pegasus/Common/DQueue.h
mak/library-unix.mak
src/Pegasus/Client/CIMOperationResponseDecoder.cpp
src/Pegasus/Common/Config.h
src/Pegasus/Config/Makefile
src/Pegasus/Common/SystemUnix.cpp
src/Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h
src/Pegasus/Common/tests/IPC/IPC.cpp
src/Pegasus/Config/ConfigFileDir.h
src/Pegasus/Common/String.cpp
src/Clients/CGIClient/CGIClient.cpp
src/Pegasus/Common/String.h
mak/objects-unix.mak
src/Pegasus/Common/CIMDateTimeUnix.cpp
src/Pegasus/Common/ThreadUnix.cpp
src/Pegasus/Common/XmlWriter.cpp
src/Pegasus/Security/UserManager/UserFileHandler.cpp

Diffs:

These are of context diffs (with 5 lines of context). They have been hand editted to the following format:

=========================
Index: filename

 - cvs log stle description of change
=========================
output from cvs diff -C 5 filename



===================================================================
Index: src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_emanate.cpp

  - snmpDeliverTrap_emanate::_getIPAddress Use gethostbyname_r for PEGASUS_OS_SOLARIS

  - It is noted that although the new _getIPAddress function returns NULL
     if it fails, the calling function ignores this and tries to deref it!

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_emanate.cpp,v
retrieving revision 1.12
diff -C5 -r1.12 snmpDeliverTrap_emanate.cpp
*** src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_emanate.cpp    22 Jul 2003 21:31:45 -0000    1.12
--- src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_emanate.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 476,486 ****
--- 476,495 ----
  char * snmpDeliverTrap_emanate::_getIPAddress(const CString& hostName)
  {
      struct hostent *targetHostInfo;
      struct in_addr in;
 
+ #ifdef PEGASUS_OS_SOLARIS
+ #define HOSTENT_BUFF_SIZE    8192
+     char            buf[HOSTENT_BUFF_SIZE];
+     struct hostent        h_result;
+     int                h_errorp;
+     targetHostInfo=gethostbyname_r(hostName, &h_result, buff,
+                     HOSTENT_BUFF_SIZE, &h_errorp);
+ #else
      targetHostInfo = gethostbyname(hostName);
+ #endif
 
      if (targetHostInfo == NULL)
      {
      return(NULL);
      }

===================================================================
Index: mak/BuildMakefile

  - Added stanza for SOLARIS_SPARC_CC

===================================================================
RCS file: /cvs/MSB/pegasus/mak/BuildMakefile,v
retrieving revision 1.25
diff -C5 -r1.25 BuildMakefile
*** mak/BuildMakefile    14 Jun 2003 19:25:37 -0000    1.25
--- mak/BuildMakefile    25 Jul 2003 13:17:23 -0000
***************
*** 47,56 ****
--- 47,67 ----
    COPYMU = cp -f pegasus/src/utils/mu/$(MUEXE) $(BIN_DIR)/$(MUEXE)
    MKDIR = pegasus/src/utils/mu/mu mkdirhier
    TESTS = prestarttests poststarttests
  endif
 
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+   CIMSERVER_START_SERVICE = cimserver
+   CIMSERVER_STOP_SERVICE = /usr/bin/ps -ef | /usr/bin/grep cimserver | /usr/bin/grep -v grep | /usr/bin/awk '{print "kill -9 "$$2 |"/usr/bin/ksh"}'
+   SLEEP = sleep 5
+   REMOVE_PEGASUS_DIRECTORY = rm -Rf pegasus.old; mv pegasus pegasus.old
+   MUEXE = mu
+   COPYMU = cp -f pegasus/src/utils/mu/$(MUEXE) $(BIN_DIR)/$(MUEXE)
+   MKDIR = pegasus/src/utils/mu/mu mkdirhier
+   TESTS = prestarttests poststarttests
+ endif
+
  ifdef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
    CIMSERVER_START_SERVICE = cimserver
    CIMSERVER_STOP_SERVICE = /bin/ps -ef | /bin/grep cimserver | /bin/grep -v grep | /usr/bin/awk '{print "kill -9 "$$2 |"/bin/bash"}'
    SLEEP = sleep 5
    REMOVE_PEGASUS_DIRECTORY = rm -Rf pegasus.old; mv pegasus pegasus.old

===================================================================
Index: mak/platform_SOLARIS_SPARC_GNU.mak

  - Add DEFINES and SYS_LIBS

===================================================================
RCS file: /cvs/MSB/pegasus/mak/platform_SOLARIS_SPARC_GNU.mak,v
retrieving revision 1.1
diff -C5 -r1.1 platform_SOLARIS_SPARC_GNU.mak
*** mak/platform_SOLARIS_SPARC_GNU.mak    17 Jul 2001 16:23:26 -0000    1.1
--- mak/platform_SOLARIS_SPARC_GNU.mak    25 Jul 2003 13:17:23 -0000
***************
*** 6,24 ****
 
  COMPILER = gnu
 
  SYS_INCLUDES =
 
! DEFINES = -DPEGASUS_PLATFORM_$(PEGASUS_PLATFORM)
 
  ifdef PEGASUS_DEBUG
! FLAGS = -g -W -Wall -Wno-unused -fpic
  else
! FLAGS = -O2 -W -Wall -Wno-unused -fpic
  endif
 
! SYS_LIBS = -ldl
 
  CXX = g++
 
  SH = sh
 
--- 6,29 ----
 
  COMPILER = gnu
 
  SYS_INCLUDES =
 
! DEFINES = -DPEGASUS_PLATFORM_$(PEGASUS_PLATFORM) -D_POSIX_PTHREAD_SEMANTICS -D BSD_COMP -D_REENTRANT
!
! DEFINES += -DDISABLE_KILLING_HUNG_THREADS
!
! DEFINES += -DPEGASUS_OS_SOLARIS
 
  ifdef PEGASUS_DEBUG
! FLAGS = -g -W -Wall -Wno-unused -fPIC
! DEFINES += -DPEGASUS_DEBUG
  else
! FLAGS = -O2 -W -Wall -Wno-unused -fPIC
  endif
 
! SYS_LIBS = -lpthread -ldl -lsocket -lnsl -lxnet -lrt
 
  CXX = g++
 
  SH = sh
 
===================================================================
Index: mak/clean.mak

  - The Solaris compiler keeps template instances (and some other cruft) in
    a cache in each target directory. Remove these during a clean - they are
    supposed to built/managed as needed, but it can't do any harm to nuke
    them if we are cleaning the tree.

===================================================================
RCS file: /cvs/MSB/pegasus/mak/clean.mak,v
retrieving revision 1.1.1.1
diff -C5 -r1.1.1.1 clean.mak
*** mak/clean.mak    14 Jan 2001 19:50:21 -0000    1.1.1.1
--- mak/clean.mak    25 Jul 2003 13:17:23 -0000
***************
*** 1,2 ****
--- 1,5 ----
  clean: $(LOCAL_CLEAN_TARGET) $(ERROR)
      $(RM) $(FILES_TO_CLEAN)
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+     $(RMDIRHIER) $(SUNWS_CACHE)
+ endif

===================================================================
Index: mak/depend-unix.mak

 - Added ifeq stanza for SOLARIS_SPARC_CC depend: using compiler -xM1 option.

===================================================================
RCS file: /cvs/MSB/pegasus/mak/depend-unix.mak,v
retrieving revision 1.10
diff -C5 -r1.10 depend-unix.mak
*** mak/depend-unix.mak    27 Aug 2002 20:07:38 -0000    1.10
--- mak/depend-unix.mak    25 Jul 2003 13:17:23 -0000
***************
*** 1,15 ****
--- 1,21 ----
  DEPEND_MAK = $(OBJ_DIR)/depend.mak
 
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+ depend: $(OBJ_DIR)/target $(ERROR)
+     $(CXX) -xM1 $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $(SOURCES) | sed -e 's=^\(.*:\)='$(OBJ_DIR)'/\1=' | grep -v $(SOLARIS_COMPILER_PATH) > $(DEPEND_MAK)
+    
+ else
  ifdef PEGASUS_HAS_MAKEDEPEND
  DEPEND_INCLUDES = -DPEGASUS_OS_TYPE_UNIX -I/usr/include $(SYS_INCLUDES)
 
  depend: $(OBJ_DIR)/target $(ERROR)
      touch $(DEPEND_MAK)
      makedepend -v $(LOCAL_DEFINES) $(DEFINES) $(DEPEND_DEFINES) $(PRE_DEPEND_INCLUDES) $(DEPEND_INCLUDES) $(INCLUDES) $(SOURCES) -f $(DEPEND_MAK) -p $(OBJ_DIR)/
  else
  depend: $(OBJ_DIR)/target $(ERROR)
      mu depend -O$(OBJ_DIR) $(INCLUDES) $(SOURCES) > $(DEPEND_MAK)
+ endif
  endif
 
  clean-depend:
      $(RM) $(OBJ_DIR)/depend.mak

===================================================================
Index: mak/config.mak

  - SOLARIS_SPARC_CC is a valid platform. Add call to its specific .mak file.

===================================================================
RCS file: /cvs/MSB/pegasus/mak/config.mak,v
retrieving revision 1.32
diff -C5 -r1.32 config.mak
*** mak/config.mak    12 Jun 2003 17:32:10 -0000    1.32
--- mak/config.mak    25 Jul 2003 13:17:23 -0000
***************
*** 43,52 ****
--- 43,53 ----
      AIX_RS_IBMCXX \
      HPUX_PARISC_ACC \
      HPUX_IA64_ACC \
      TRU64_ALPHA_DECCXX \
      SOLARIS_SPARC_GNU \
+     SOLARIS_SPARC_CC \
      ZOS_ZSERIES_IBM \
      NSK_NONSTOP_NMCPLUS 
 
  ifndef PEGASUS_PLATFORM
    ERROR = pegasus_platform_undefined
***************
*** 137,146 ****
--- 138,152 ----
    include $(ROOT)/mak/platform_$(PEGASUS_PLATFORM).mak
    FOUND = true
  endif
 
  ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_GNU)
+   include $(ROOT)/mak/platform_$(PEGASUS_PLATFORM).mak
+   FOUND = true
+ endif
+
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
    include $(ROOT)/mak/platform_$(PEGASUS_PLATFORM).mak
    FOUND = true
  endif
 
  ifeq ($(PEGASUS_PLATFORM),ZOS_ZSERIES_IBM)

===================================================================
Index: mak/library-unix.mak

  - Added stanza for Solaris CC compiler.

===================================================================
RCS file: /cvs/MSB/pegasus/mak/library-unix.mak,v
retrieving revision 1.39
diff -C5 -r1.39 library-unix.mak
*** mak/library-unix.mak    14 Jun 2003 19:25:38 -0000    1.39
--- mak/library-unix.mak    25 Jul 2003 13:17:23 -0000
***************
*** 41,50 ****
--- 41,56 ----
    LINK_COMMAND = c++ $(FLAGS)
    LINK_ARGUMENTS = -W "l,XPLINK,dll"
    LINK_OUT = -o
  endif
 
+ ifeq ($(COMPILER),CC)
+   LINK_COMMAND = CC
+   LINK_ARGUMENTS = -G -KPIC -mt -h lib$(LIBRARY).so
+   LINK_OUT = -o
+ endif
+
  FULL_LIB=$(LIB_DIR)/lib$(LIBRARY)$(LIB_SUFFIX)
 
  ## Rule for all UNIX library builds
  $(FULL_LIB): $(LIB_DIR)/target $(OBJ_DIR)/target $(OBJECTS) $(FULL_LIBRARIES) \
      $(ERROR)

===================================================================
Index: mak/objects-unix.mak

  - Added stanza to say SOLARIS_SPARC_CC doesn't use tmp.o files

===================================================================
RCS file: /cvs/MSB/pegasus/mak/objects-unix.mak,v
retrieving revision 1.8
diff -C5 -r1.8 objects-unix.mak
*** mak/objects-unix.mak    1 Sep 2002 18:18:23 -0000    1.8
--- mak/objects-unix.mak    25 Jul 2003 13:17:23 -0000
***************
*** 13,22 ****
--- 13,26 ----
 
  ifeq ($(PEGASUS_PLATFORM),AIX_RS_IBMCXX)
    _NO_TMP_O = yes
  endif
 
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+   _NO_TMP_O = yes
+ endif
+
  _TMP_O = $(PEGASUS_PLATFORM).o
 
  ifeq ($(_NO_TMP_O), yes)
  $(OBJ_DIR)/%.o: %.cpp $(ERROR)
      $(CXX) -c -o $@ $(FLAGS) $(LOCAL_DEFINES) $(DEFINES) $(SYS_INCLUDES) $(INCLUDES) $*.cpp
 
===================================================================
Index: src/Pegasus/Common/HTTPAcceptor.cpp

  - Add SOLARIS_SPARC_CC to list of platforms that have use socklen_t for
    address_size (but not Solaris 5.6)

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/HTTPAcceptor.cpp,v
retrieving revision 1.29
diff -C5 -r1.29 HTTPAcceptor.cpp
*** src/Pegasus/Common/HTTPAcceptor.cpp    14 Jun 2003 19:25:38 -0000    1.29
--- src/Pegasus/Common/HTTPAcceptor.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 91,101 ****
 
      struct sockaddr* address;
 
  #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
     size_t address_size;
! #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)
     socklen_t address_size;
  #else
     int address_size;
  #endif
        Mutex _connection_mut;
--- 91,101 ----
 
      struct sockaddr* address;
 
  #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
     size_t address_size;
! #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) || (defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) && !defined(SUNOS_5_6))
     socklen_t address_size;
  #else
     int address_size;
  #endif
        Mutex _connection_mut;
***************
*** 446,456 ****
     // Accept the connection (populate the address):
 
     struct sockaddr* accept_address;
  #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
     size_t address_size;
! #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)
     socklen_t address_size;
  #else
     int address_size;
  #endif
 
--- 446,456 ----
     // Accept the connection (populate the address):
 
     struct sockaddr* accept_address;
  #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
     size_t address_size;
! #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) || (defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) && !defined(SUNOS_5_6))
     socklen_t address_size;
  #else
     int address_size;
  #endif
 
===================================================================
Index: src/Pegasus/Common/MessageLoader.h

 - The Solaris compiler doesn't like using  formal arguments with the
   same name as member variables. It does the "right thing" but moans
   about it. Changed name of formal arguments to cut down on amount
   of noise during compiles - making it easier to spot real errors.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/MessageLoader.h,v
retrieving revision 1.1
diff -C5 -r1.1 MessageLoader.h
*** src/Pegasus/Common/MessageLoader.h    15 Jul 2003 17:06:23 -0000    1.1
--- src/Pegasus/Common/MessageLoader.h    25 Jul 2003 13:17:23 -0000
***************
*** 152,171 ****
       * @param arg7 Formatter::Arg - optional substitution parameter

       * @param arg8 Formatter::Arg - optional substitution parameter

       * @param arg9 Formatter::Arg - optional substitution parameter

       */

      MessageLoaderParms( String id, String msg,

!                         Formatter::Arg arg0 = Formatter::Arg(),

!                         Formatter::Arg arg1 = Formatter::Arg(),

!                         Formatter::Arg arg2 = Formatter::Arg(),

!                         Formatter::Arg arg3 = Formatter::Arg(),

!                         Formatter::Arg arg4 = Formatter::Arg(),

!                         Formatter::Arg arg5 = Formatter::Arg(),

!                         Formatter::Arg arg6 = Formatter::Arg(),

!                         Formatter::Arg arg7 = Formatter::Arg(),

!                         Formatter::Arg arg8 = Formatter::Arg(),

!                         Formatter::Arg arg9 = Formatter::Arg() ){

                             

          msg_id = id;

          default_msg = msg;

          useProcessLocale = false;

          useThreadLocale = true;

--- 152,171 ----
       * @param arg7 Formatter::Arg - optional substitution parameter

       * @param arg8 Formatter::Arg - optional substitution parameter

       * @param arg9 Formatter::Arg - optional substitution parameter

       */

      MessageLoaderParms( String id, String msg,

!                         Formatter::Arg anArg0 = Formatter::Arg(),

!                         Formatter::Arg anArg1 = Formatter::Arg(),

!                         Formatter::Arg anArg2 = Formatter::Arg(),

!                         Formatter::Arg anArg3 = Formatter::Arg(),

!                         Formatter::Arg anArg4 = Formatter::Arg(),

!                         Formatter::Arg anArg5 = Formatter::Arg(),

!                         Formatter::Arg anArg6 = Formatter::Arg(),

!                         Formatter::Arg anArg7 = Formatter::Arg(),

!                         Formatter::Arg anArg8 = Formatter::Arg(),

!                         Formatter::Arg anArg9 = Formatter::Arg() ){

                             

          msg_id = id;

          default_msg = msg;

          useProcessLocale = false;

          useThreadLocale = true;

***************
*** 175,194 ****
          #endif

         

          acceptlanguages = AcceptLanguages::EMPTY;

          contentlanguages = ContentLanguages::EMPTY;

          msg_src_path = String::EMPTY;

!         this->arg0 = arg0;

!         this->arg1 = arg1;

!         this->arg2 = arg2;

!         this->arg3 = arg3;

!         this->arg4 = arg4;

!         this->arg5 = arg5;

!         this->arg6 = arg6;

!         this->arg7 = arg7;

!         this->arg8 = arg8;

!         this->arg9 = arg9;

      }   

     

      String toString(){

         

          String s;

--- 175,194 ----
          #endif

         

          acceptlanguages = AcceptLanguages::EMPTY;

          contentlanguages = ContentLanguages::EMPTY;

          msg_src_path = String::EMPTY;

!         this->arg0 = anArg0;

!         this->arg1 = anArg1;

!         this->arg2 = anArg2;

!         this->arg3 = anArg3;

!         this->arg4 = anArg4;

!         this->arg5 = anArg5;

!         this->arg6 = anArg6;

!         this->arg7 = anArg7;

!         this->arg8 = anArg8;

!         this->arg9 = anArg9;

      }   

     

      String toString(){

         

          String s;


===================================================================
Index: src/Pegasus/Common/ThreadUnix_inline.h

 - The Solaris compiler moans that pthread_create is expecting a function with
   "C" linkage as the third parameter and we are passing one with "C++" linkage.
   Not only is this true it appears the compiler is correct to complain, even
   though "C" and "C++" linkage are the same on Solaris.

   Added a structure zosParmDef to hold the desired function and its parameter.
   The pass a wrapper function with "C" linkage to pthread_create that simply
   calls the function in zosParmDef with the included parameter.

   Note the structure is malloc'ed in Thread::run, but _must_ be free'd by the
   newly created thread. This is may not be pretty, but it does avoid some nasty
   race conditions.

   zosParmDef shamelessly "borrowed" from the IBM zOS port.

 - On Solaris 5.8 the IPC test (and some others) would deadlock with the
   process consuming large amounts of CPU time. It turns out the "dqe" thread
   in the IPC test has a "hard" loop checking for messages on the queue. If
   the main thread and one of the dqe threads ended up on the same LWP process
   then the dqe would spin and never get pre-empted. This locked out the main
   thread which never got a chance to stop the dqe thread.

   Changed the scheduling policy from SCHED_OTHER to SCHED_RR for Solaris. This
   seems to fix the IPC deadlock by pre-empting dqe after a set time.

 - All the above wrapped in an #ifdef SOLARIS so it doesn't affect other
   platforms.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/ThreadUnix_inline.h,v
retrieving revision 1.11
diff -C5 -r1.11 ThreadUnix_inline.h
*** src/Pegasus/Common/ThreadUnix_inline.h    14 Jun 2003 19:25:38 -0000    1.11
--- src/Pegasus/Common/ThreadUnix_inline.h    25 Jul 2003 13:17:23 -0000
***************
*** 29,48 ****
--- 29,78 ----
 
 
  #ifndef ThreadUnix_inline_h
  #define ThreadUnix_inline_h
 
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_CC
+ // _start wrapper to overcome "C" "C++" binding warnings
+ // (code "borrowed" from ThreadzOS_inline.h)
+ // Actually the Solaris compiler doesn't need this as "C" "C++"
+ // bindings are the same, but it moans like hell about it !!
+ // (Its correct to moan, but its a pain all the same).
+
+
+ typedef struct {                                  
+     void * (PEGASUS_THREAD_CDECL * _start)(void *);
+     void * realParm;                              
+ } zosParmDef;                                     
+
+ extern "C" { void * _linkage(void * zosParm); }
+                                                   
+ inline void Thread::run()
+ {
+     zosParmDef * zosParm = (zosParmDef *)malloc(sizeof(zosParmDef));
+     zosParm->_start = _start;
+     zosParm->realParm = (void *) this;
+     if (_is_detached)
+     {
+         pthread_attr_setdetachstate(&_handle.thatt, PTHREAD_CREATE_DETACHED);
+     }
+     pthread_attr_setschedpolicy(&_handle.thatt, SCHED_RR);
+     pthread_create((pthread_t *)&_handle.thid,
+                     &_handle.thatt, &_linkage, zosParm);
+ }
+ #else // PEGASUS_PLATFORM_SOLARIS_SPARC_CC
  inline void Thread::run()
  {
      if (_is_detached)
          pthread_attr_setdetachstate(&_handle.thatt, PTHREAD_CREATE_DETACHED);
  #ifdef PEGASUS_OS_OS400
      // Initialize the pegasusValue to 1, see IPCOs400.h.
      _handle.thid.pegasusValue = 1; 
  #endif
      pthread_create((pthread_t *)&_handle.thid, &_handle.thatt, _start, this);
  }
+ #endif // PEGASUS_PLATFORM_SOLARIS_SPARC_CC
 
 
  inline void Thread::cancel()
  {
     _cancelled = true;

===================================================================
Index: src/Pegasus/Common/DirUnix.cpp

  - Added PEGASUS_PLATFORM_SOLARIS_SPARC_CC to list of platforms that have
    readdir_r
    WHY isn't this defined in the plaform specific header files?

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/DirUnix.cpp,v
retrieving revision 1.13
diff -C5 -r1.13 DirUnix.cpp
*** src/Pegasus/Common/DirUnix.cpp    12 Nov 2002 00:41:53 -0000    1.13
--- src/Pegasus/Common/DirUnix.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 47,57 ****
 
      return clone.getCString();
  }
 
  // ATTN-RK-20021111: Perhaps this should be enabled for all Unix platforms?
! #if defined(PEGASUS_OS_OS400) || defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_IA64_GNU)
  #define PEGASUS_HAS_READDIR_R
  #endif
 
  struct DirRep
  {
--- 47,57 ----
 
      return clone.getCString();
  }
 
  // ATTN-RK-20021111: Perhaps this should be enabled for all Unix platforms?
! #if defined(PEGASUS_OS_OS400) || defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) || defined (PLATFORM_PEGASUS_SOLARIS_SPARC_CC)
  #define PEGASUS_HAS_READDIR_R
  #endif
 
  struct DirRep
  {

===================================================================
Index: src/Pegasus/Common/Monitor.h

  - Solaris compiler seems to want a _MonitorEntry() constructor, so created
    one for it.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Monitor.h,v
retrieving revision 1.13
diff -C5 -r1.13 Monitor.h
*** src/Pegasus/Common/Monitor.h    7 Apr 2003 20:29:23 -0000    1.13
--- src/Pegasus/Common/Monitor.h    25 Jul 2003 13:17:23 -0000
***************
*** 50,59 ****
--- 50,63 ----
        _MonitorEntry(Sint32 sock, Uint32 q, int Type)
       : socket(sock), queueId(q), _status(EMPTY), _type(Type)
        
        {
        }
+
+       _MonitorEntry() : socket(0), queueId(0), _status(EMPTY), _type(0)
+       {
+       }
       
        Boolean operator ==(const void *key) const
        {
       if(key != 0 &&
          (socket == (reinterpret_cast<_MonitorEntry *>(const_cast<void *>(key)))->socket))

===================================================================
Index: src/Pegasus/Common/Memory.h

  - Include <string> rather than <cstring>

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Memory.h,v
retrieving revision 1.14
diff -C5 -r1.14 Memory.h
*** src/Pegasus/Common/Memory.h    1 Jun 2002 00:56:34 -0000    1.14
--- src/Pegasus/Common/Memory.h    25 Jul 2003 13:17:23 -0000
***************
*** 44,54 ****
  ////////////////////////////////////////////////////////////////////////////////
 
  #ifndef Pegasus_Memory_h
  #define Pegasus_Memory_h
 
! #include <cstring>
  #include <Pegasus/Common/Config.h>
  #include <Pegasus/Common/CIMType.h>
  #include <Pegasus/Common/Char16.h>
 
  PEGASUS_NAMESPACE_BEGIN
--- 44,54 ----
  ////////////////////////////////////////////////////////////////////////////////
 
  #ifndef Pegasus_Memory_h
  #define Pegasus_Memory_h
 
! #include <string>
  #include <Pegasus/Common/Config.h>
  #include <Pegasus/Common/CIMType.h>
  #include <Pegasus/Common/Char16.h>
 
  PEGASUS_NAMESPACE_BEGIN

===================================================================
Index: src/Pegasus/Common/Signal.cpp

  - Solaris compiler was missing the prototype for printf - included stdio.h
    to solve this.

  - Added to Solaris to #ifdef list of OSes using SA_RESETHAND in
    SignalHandler::Activate

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Signal.cpp,v
retrieving revision 1.14
diff -C5 -r1.14 Signal.cpp
*** src/Pegasus/Common/Signal.cpp    21 Mar 2003 23:37:35 -0000    1.14
--- src/Pegasus/Common/Signal.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 27,36 ****
--- 27,39 ----
  //
  //%/////////////////////////////////////////////////////////////////////////////
 
  #include <cstdio>
  #include <cstring>
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_CC
+ #include <stdio.h>
+ #endif
 
  #include <Pegasus/Common/Config.h>
  #include <Pegasus/Common/Signal.h>
 
  PEGASUS_USING_PEGASUS;
***************
*** 87,97 ****
 
      struct sigaction * sig_acts = new struct sigaction;
 
      sig_acts->sa_sigaction = reg_handler[signum].sh;
      sigfillset(&(sig_acts->sa_mask));
! #if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_HPUX_ACC) || defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM)
      sig_acts->sa_flags = SA_SIGINFO | SA_RESETHAND;
  #else
      sig_acts->sa_flags = SA_SIGINFO | SA_ONESHOT;
  #if !defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)
      sig_acts->sa_restorer = NULL;
--- 90,100 ----
 
      struct sigaction * sig_acts = new struct sigaction;
 
      sig_acts->sa_sigaction = reg_handler[signum].sh;
      sigfillset(&(sig_acts->sa_mask));
! #if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_HPUX_ACC) || defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM) || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
      sig_acts->sa_flags = SA_SIGINFO | SA_RESETHAND;
  #else
      sig_acts->sa_flags = SA_SIGINFO | SA_ONESHOT;
  #if !defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)
      sig_acts->sa_restorer = NULL;

===================================================================
Index: src/Pegasus/Common/Base64.cpp

  - Base64::_Ecode, Base64::_IsBase64, Base64::_Decode code for these fuctions
    moved to top of file. Otherwise the compiler complains that it only
    discovers that these are supposed to be in-line after they have been called.

    Is this the reason the AIX port has the "inline" qualifier #def'ed out?

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Base64.cpp,v
retrieving revision 1.15
diff -C5 -r1.15 Base64.cpp
*** src/Pegasus/Common/Base64.cpp    19 Mar 2003 21:46:25 -0000    1.15
--- src/Pegasus/Common/Base64.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 44,53 ****
--- 44,120 ----
 
  #ifdef PEGASUS_PLATFORM_AIX_RS_IBMCXX
  #define inline
  #endif
 
+
+ //**********************************************************
+ /*  Encode thanslates one six-bit pattern into a base-64 character.
+     Unsigned char is used to represent a six-bit stream of date.
+    
+ */
+ inline PEGASUS_COMMON_LINKAGE char Base64::_Encode(Uint8 uc)
+ {
+     if (uc < 26)
+         return 'A'+uc;
+
+     if (uc < 52)
+         return 'a'+(uc-26);
+
+     if (uc < 62)
+         return '0'+(uc-52);
+
+     if (uc == 62)
+         return '+';
+
+     return '/';
+ };
+
+  //Helper function returns true is a character is a valid base-64 character and false otherwise.
+
+ inline Boolean Base64::_IsBase64(char c)
+ {
+
+     if (c >= 'A' && c <= 'Z')
+         return true;
+
+     if (c >= 'a' && c <= 'z')
+         return true;
+
+     if (c >= '0' && c <= '9')
+         return true;
+
+     if (c == '+')
+         return true;
+
+     if (c == '/')
+         return true;
+
+     if (c == '=')
+         return true;
+
+     return false;
+ };

+  // Translate one base-64 character into a six bit pattern
+ inline Uint8 Base64::_Decode(char c)
+ {
+     if (c >= 'A' && c <= 'Z')
+         return c - 'A';
+     if (c >= 'a' && c <= 'z')
+         return c - 'a' + 26;
+
+     if (c >= '0' && c <= '9')
+         return c - '0' + 52;
+
+     if (c == '+')
+         return 62;
+
+     return 63;
+ };
+
+
  //*************************************************************
  /*  Encode static method takes an array of 8-bit values and
      returns a base-64 stream.
      ATTN: KS feb 2002 - This is probably a very slow an inefficient
      implementation and could be improved if it is required for
***************
*** 186,258 ****
      AtoE((char *)retArray.getData(), retArray.size());
  #endif
 
      return retArray;
  };
-
- //**********************************************************
- /*  Encode thanslates one six-bit pattern into a base-64 character.
-     Unsigned char is used to represent a six-bit stream of date.
-    
- */
- inline PEGASUS_COMMON_LINKAGE char Base64::_Encode(Uint8 uc)
- {
-     if (uc < 26)
-         return 'A'+uc;
-
-     if (uc < 52)
-         return 'a'+(uc-26);
-
-     if (uc < 62)
-         return '0'+(uc-52);
-
-     if (uc == 62)
-         return '+';
-
-     return '/';
- };
-
-  //Helper function returns true is a character is a valid base-64 character and false otherwise.
-
- inline Boolean Base64::_IsBase64(char c)
- {
-
-     if (c >= 'A' && c <= 'Z')
-         return true;
-
-     if (c >= 'a' && c <= 'z')
-         return true;
-
-     if (c >= '0' && c <= '9')
-         return true;
-
-     if (c == '+')
-         return true;
-
-     if (c == '/')
-         return true;
-
-     if (c == '=')
-         return true;
-
-     return false;
- };

-  // Translate one base-64 character into a six bit pattern
- inline Uint8 Base64::_Decode(char c)
- {
-     if (c >= 'A' && c <= 'Z')
-         return c - 'A';
-     if (c >= 'a' && c <= 'z')
-         return c - 'a' + 26;
-
-     if (c >= '0' && c <= '9')
-         return c - '0' + 52;
-
-     if (c == '+')
-         return 62;
-
-     return 63;
- };
-
 
  PEGASUS_NAMESPACE_END
--- 253,259 ----

===================================================================
Index: src/Pegasus/Common/IPCUnix_inline.h

  - Added SOLARIS_SPARC_CC to list of platforms that don't have np_cleanup
    routines.

    Again, shouldn't this be defined in the platform config header?

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/IPCUnix_inline.h,v
retrieving revision 1.15
diff -C5 -r1.15 IPCUnix_inline.h
*** src/Pegasus/Common/IPCUnix_inline.h    20 Nov 2002 22:04:11 -0000    1.15
--- src/Pegasus/Common/IPCUnix_inline.h    25 Jul 2003 13:17:23 -0000
***************
*** 52,62 ****
  **
  ** We define the following:
  */
 
 
! #if !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU) && !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) && !defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM)
  # define PEGASUS_HAVE_NP_THREAD_CLEANUP_ROUTINES
  #endif
 
  /*
  **
--- 52,62 ----
  **
  ** We define the following:
  */
 
 
! #if !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) && !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU) && !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX)
  # define PEGASUS_HAVE_NP_THREAD_CLEANUP_ROUTINES
  #endif
 
  /*
  **

===================================================================
Index: src/Pegasus/Common/IPCUnix.h

  - Changed GNU specific #ifdef to be a Solaris specific so it includes the CC
    compiler.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/IPCUnix.h,v
retrieving revision 1.16
diff -C5 -r1.16 IPCUnix.h
*** src/Pegasus/Common/IPCUnix.h    15 Jul 2003 16:53:03 -0000    1.16
--- src/Pegasus/Common/IPCUnix.h    25 Jul 2003 13:17:23 -0000
***************
*** 81,91 ****
      pthread_mutex_t mut;
      pthread_mutexattr_t mutatt;
      pthread_t owner;
  } PEGASUS_MUTEX_HANDLE ;
 
! #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_GNU
  typedef _cleanup_t PEGASUS_CLEANUP_HANDLE;
  #else
  typedef struct _pthread_cleanup_buffer  PEGASUS_CLEANUP_HANDLE;
  #endif
 
--- 81,91 ----
      pthread_mutex_t mut;
      pthread_mutexattr_t mutatt;
      pthread_t owner;
  } PEGASUS_MUTEX_HANDLE ;
 
! #ifdef PEGASUS_OS_SOLARIS
  typedef _cleanup_t PEGASUS_CLEANUP_HANDLE;
  #else
  typedef struct _pthread_cleanup_buffer  PEGASUS_CLEANUP_HANDLE;
  #endif
 
===================================================================
Index: src/Pegasus/Common/CGIQueryString.cpp

  - CGIQueryString::_ParseCGIQueryString use strtok_r on PEGASUS_OS_SOLARIS

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/CGIQueryString.cpp,v
retrieving revision 1.19
diff -C5 -r1.19 CGIQueryString.cpp
*** src/Pegasus/Common/CGIQueryString.cpp    25 Jul 2002 17:41:35 -0000    1.19
--- src/Pegasus/Common/CGIQueryString.cpp    25 Jul 2003 13:17:23 -0000
***************
*** 87,97 ****
--- 87,103 ----
      char* queryString,
      Array<CGIQueryStringEntry>& entries)
  {
      // First split about the '&' characters:
 
+ #ifdef PEGASUS_OS_SOLARIS
+ char *last;
+     for (char* p = strtok_r(queryString, "&", &last); p;
+                     p = strtok_r(NULL, "&", &last))
+ #else
      for (char* p = strtok(queryString, "&"); p; p = strtok(NULL, "&"))
+ #endif
      {
      char* name = p;
 
      // Find equal sign:
      char* equalChar = strchr(p, '=');

===================================================================
Index: src/Pegasus/Common/IPC.h

  - PEGASUS_OS_SOLARIS doesn't want the NEED_CRITICAL_TYPE macro

  - Include IPCSun.h for SOLARIS_SPARC_CC

  - Include IPCUnix_inline.h for SOLARIS_SPARC_CC

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/IPC.h,v
retrieving revision 1.26
diff -C5 -r1.26 IPC.h
*** src/Pegasus/Common/IPC.h    14 Jun 2003 19:25:38 -0000    1.26
--- src/Pegasus/Common/IPC.h    25 Jul 2003 13:17:24 -0000
***************
*** 27,37 ****
--- 27,39 ----
  //         Ramnath Ravindran (Ramnath.Ravindran@compaq.com)
  //         David Eger (dteger@us.ibm.com)
  //
  //%/////////////////////////////////////////////////////////////////////////////
 
+ #ifndef PEGASUS_OS_SOLARIS
  #define PEGASUS_NEED_CRITICAL_TYPE
+ #endif
 
  #ifndef Pegasus_IPC_h
  #define Pegasus_IPC_h
 
  #include <Pegasus/Common/Config.h>
***************
*** 42,51 ****
--- 44,55 ----
  # include "IPCUnix.h"
  #elif defined(PEGASUS_PLATFORM_HPUX_ACC)
  # include "IPCHpux.h"
  #elif defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
  # include "IPCUnix.h"
+ #elif defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
+ # include "IPCSun.h"
  #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX)
  # include "IPCAix.h"
  #elif defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
  # include "IPCzOS.h"
  #elif defined(PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
***************
*** 606,615 ****
--- 610,621 ----
  #elif defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)
  # include "IPCUnix_inline.h"
  #elif defined(PEGASUS_PLATFORM_HPUX_ACC)
  # include "IPCUnix_inline.h"
  #elif defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
+ # include "IPCUnix_inline.h"
+ #elif defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
  # include "IPCUnix_inline.h"
  #elif defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX)
  # include "IPCUnix_inline.h"
  #elif defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
  # include "IPCUnix_inline.h"

===================================================================
Index: src/Pegasus/Common/AcceptLanguages.cpp

 - Solaris Compiler doesn't like formal arguments with same name as
   member variables - it issues warnings about hidden variables.
   Change formal argument of AcceptLanguages::AcceptLanguages from
   to suppress warnings.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/AcceptLanguages.cpp,v
retrieving revision 1.3
diff -C5 -r1.3 AcceptLanguages.cpp
*** src/Pegasus/Common/AcceptLanguages.cpp    16 Jul 2003 18:38:20 -0000    1.3
--- src/Pegasus/Common/AcceptLanguages.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 57,69 ****
          prioritize();

      //}

      PEG_METHOD_EXIT();

  }

 

! AcceptLanguages::AcceptLanguages(Array<AcceptLanguageElement> container) {

!     for(int i = 0; i < container.size(); i++)

!         this->container.append(dynamic_cast<LanguageElement &>(container[i]));

  }

 

  String AcceptLanguages::toString() const{

      String s;

      for(int i = 0; i < container.size(); i++){

--- 57,69 ----
          prioritize();

      //}

      PEG_METHOD_EXIT();

  }

 

! AcceptLanguages::AcceptLanguages(Array<AcceptLanguageElement> aContainer) {

!     for(int i = 0; i < aContainer.size(); i++)

!         this->container.append(dynamic_cast<LanguageElement &>(aContainer[i]));

  }

 

  String AcceptLanguages::toString() const{

      String s;

      for(int i = 0; i < container.size(); i++){


===================================================================
Index: src/Pegasus/Common/ArrayRep.h

  - Array<T>::create changed local variable capacity to Capacity as the
    Solaris compiler keeps warning that the local variable hides a more
    global one. (Not really a problem, just noisy and annoying).

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/ArrayRep.h,v
retrieving revision 1.3
diff -C5 -r1.3 ArrayRep.h
*** src/Pegasus/Common/ArrayRep.h    21 Aug 2002 20:49:41 -0000    1.3
--- src/Pegasus/Common/ArrayRep.h    25 Jul 2003 13:17:24 -0000
***************
*** 96,117 ****
  template<class T>
  ArrayRep<T>* PEGASUS_STATIC_CDECL ArrayRep<T>::create(Uint32 size)
  {
      // Calculate capacity (size rounded to the next power of two).
 
!     Uint32 capacity = 8;
 
!     while (capacity < size)
!         capacity <<= 1;
 
      // Create object:
 
      ArrayRep<T>* rep =
!         (ArrayRep<T>*)operator new(sizeof(ArrayRep<T>) + sizeof(T) * capacity);
 
      rep->size = size;
!     rep->capacity = capacity;
 
      return rep;
  }
 
  template<class T>
--- 96,117 ----
  template<class T>
  ArrayRep<T>* PEGASUS_STATIC_CDECL ArrayRep<T>::create(Uint32 size)
  {
      // Calculate capacity (size rounded to the next power of two).
 
!     Uint32 Capacity = 8;
 
!     while (Capacity < size)
!         Capacity <<= 1;
 
      // Create object:
 
      ArrayRep<T>* rep =
!         (ArrayRep<T>*)operator new(sizeof(ArrayRep<T>) + sizeof(T) * Capacity);
 
      rep->size = size;
!     rep->capacity = Capacity;
 
      return rep;
  }
 
  template<class T>

===================================================================
Index: src/Pegasus/Common/ContentLanguages.cpp

 - Solaris Compiler doesn't like formal arguments with same name as
   member variables - it issues warnings about hidden variables.
   Change formal argument of ContentLanguages::ContentLanguages
   to suppress warnings.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/ContentLanguages.cpp,v
retrieving revision 1.3
diff -C5 -r1.3 ContentLanguages.cpp
*** src/Pegasus/Common/ContentLanguages.cpp    16 Jul 2003 18:38:20 -0000    1.3
--- src/Pegasus/Common/ContentLanguages.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 50,62 ****
          PEG_METHOD_EXIT();

      }

 

      ContentLanguages::ContentLanguages(Array<LanguageElement> container):LanguageElementContainer(container){}

     

!     ContentLanguages::ContentLanguages(Array<ContentLanguageElement> container){

!         for(int i = 0; i < container.size(); i++)

!             this->container.append(dynamic_cast<LanguageElement &>(container[i]));

      }

 

      ContentLanguages::ContentLanguages(const ContentLanguages &rhs): LanguageElementContainer(rhs){}

     

      ContentLanguages::~ContentLanguages(){}

--- 50,62 ----
          PEG_METHOD_EXIT();

      }

 

      ContentLanguages::ContentLanguages(Array<LanguageElement> container):LanguageElementContainer(container){}

     

!     ContentLanguages::ContentLanguages(Array<ContentLanguageElement> aContainer){

!         for(int i = 0; i < aContainer.size(); i++)

!             this->container.append(dynamic_cast<LanguageElement &>(aContainer[i]));

      }

 

      ContentLanguages::ContentLanguages(const ContentLanguages &rhs): LanguageElementContainer(rhs){}

     

      ContentLanguages::~ContentLanguages(){}


===================================================================
Index: src/Pegasus/Common/LanguageElementContainer.cpp

 - Solaris Compiler doesn't like formal arguments with same name as
   member variables - it issues warnings about hidden variables.
   Change formal argument of LanguageElementContainer::LanguageElementContainer
   to suppress warnings.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/LanguageElementContainer.cpp,v
retrieving revision 1.3
diff -C5 -r1.3 LanguageElementContainer.cpp
*** src/Pegasus/Common/LanguageElementContainer.cpp    21 Jul 2003 17:14:47 -0000    1.3
--- src/Pegasus/Common/LanguageElementContainer.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 43,54 ****
           

  const LanguageElementContainer LanguageElementContainer::EMPTY = LanguageElementContainer();

     

  LanguageElementContainer::LanguageElementContainer(){}   

           

! LanguageElementContainer::LanguageElementContainer(Array<LanguageElement> container){

!     this->container = container;   

  }

  

  LanguageElementContainer::LanguageElementContainer(const LanguageElementContainer &rhs){

          container = rhs.getAllLanguageElements();   

  }

--- 43,54 ----
           

  const LanguageElementContainer LanguageElementContainer::EMPTY = LanguageElementContainer();

     

  LanguageElementContainer::LanguageElementContainer(){}   

           

! LanguageElementContainer::LanguageElementContainer(Array<LanguageElement> aContainer){

!     this->container = aContainer;   

  }

  

  LanguageElementContainer::LanguageElementContainer(const LanguageElementContainer &rhs){

          container = rhs.getAllLanguageElements();   

  }


===================================================================
Index: src/Pegasus/Common/HTTPConnector.cpp

 -  _MakeAdress uses gethostbyname_r and gethostbyaddr_r

 - Took out PEGASUS_SNIA_INTEROP_TEST wrapper and made code within it the
   default. The rotuine is either passed a host name (or fqdn) and looks it up
   using gethostbyname, or is passed a dotted quad  which it converts using
   inet_addr. Attempting to use gethostbyaddr is superfluous and fails if no
   reverse DNS is available for the dotted quad.

 - Added return false if inet_addr call fails to convert the dotted quad.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/HTTPConnector.cpp,v
retrieving revision 1.32
diff -C5 -r1.32 HTTPConnector.cpp
*** src/Pegasus/Common/HTTPConnector.cpp    6 Jun 2003 18:19:15 -0000    1.32
--- src/Pegasus/Common/HTTPConnector.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 70,111 ****
  static Boolean _MakeAddress(
     const char* hostname,
     int port,
     sockaddr_in& address)
  {
!     if (!hostname)
        return false;
     
     struct hostent *entry;
     if (isalpha(hostname[0]))
        entry = gethostbyname((char *)hostname);
     else
     {
!       // KS 20020926 Temp change to bypass the gethostbyaddress
!       // and simply use whatever address was supplied.
!       // This needs to be verified. Drops following two
!       // lines and replace with memset through return lines.
! #ifdef PEGASUS_SNIA_INTEROP_TEST
        memset(&address, 0, sizeof(address));
        address.sin_family = AF_INET;
!       address.sin_addr.s_addr = inet_addr((char *)hostname);
        address.sin_port = htons(port);
-       return true;
- #else    
-       unsigned long tmp = inet_addr((char *)hostname);
-       entry = gethostbyaddr((char *)&tmp, sizeof(tmp), AF_INET);
- #endif     
-
     }
-
-    if (!entry)
-        return false;
-
-    memset(&address, 0, sizeof(address));
-    memcpy(&address.sin_addr, entry->h_addr, entry->h_length);
-    address.sin_family = entry->h_addrtype;
-    address.sin_port = htons(port);
 
     return true;
  }
 
  ////////////////////////////////////////////////////////////////////////////////
--- 70,118 ----
  static Boolean _MakeAddress(
     const char* hostname,
     int port,
     sockaddr_in& address)
  {
!    if (!hostname)
        return false;
     
     struct hostent *entry;
     if (isalpha(hostname[0]))
+    {
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_CC
+ #define HOSTENT_BUFF_SIZE    8192
+       char    buf[HOSTENT_BUFF_SIZE];
+       int    h_errorp;
+       struct    hostent hp;
+
+       entry = gethostbyname_r((char *)hostname, &hp, buf,
+                     HOSTENT_BUFF_SIZE, &h_errorp);
+ #else
        entry = gethostbyname((char *)hostname);
+ #endif
+       if(!entry)
+       {
+     return false;
+       }
+
+       memset(&address, 0, sizeof(address));
+       memcpy(&address.sin_addr, entry->h_addr, entry->h_length);
+       address.sin_family = entry->h_addrtype;
+       address.sin_port = htons(port);
+    }    
     else
     {
!       unsigned long tmp_addr = inet_addr((char *)hostname);
!       if(tmp_addr == 0xFFFFFFFF)
!       {
!       return false;
!       }
        memset(&address, 0, sizeof(address));
        address.sin_family = AF_INET;
!       address.sin_addr.s_addr = tmp_addr;
        address.sin_port = htons(port);
     }
 
     return true;
  }
 
  ////////////////////////////////////////////////////////////////////////////////

===================================================================
Index :src/Pegasus/Common/DQueue.h

  - Explicity initialise _headOfFreeList to 0. This forces the compiler/linker
    to actually instantiate one, otherwise everybody seems to leave it to
    someone else.

  - DQueue::prev cast return value appropriately

  - AsyncDQueue::set_capacity I don't understand this. I had to change
    _capapcity to *_capacity to keep the compiler quiet. Reading the code
    I have to agree with the compiler, but why is this OK on other platforms?

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/DQueue.h,v
retrieving revision 1.38
diff -C5 -r1.38 DQueue.h
*** src/Pegasus/Common/DQueue.h    25 Jun 2003 17:44:03 -0000    1.38
--- src/Pegasus/Common/DQueue.h    25 Jul 2003 13:17:24 -0000
***************
*** 156,166 ****
        Uint32 count(void) ;
        Uint32 size(void) ;
       
  };
       
! template<class L> DQueue<L> * DQueue<L>::_headOfFreeList;
  template<class L> const int DQueue<L>::BLOCK_SIZE = 200;
  template<class L> Mutex DQueue<L>::_alloc_mut;
 
  template<class L> void *DQueue<L>::operator new(size_t size)
  {
--- 156,166 ----
        Uint32 count(void) ;
        Uint32 size(void) ;
       
  };
       
! template<class L> DQueue<L> * DQueue<L>::_headOfFreeList = 0;
  template<class L> const int DQueue<L>::BLOCK_SIZE = 200;
  template<class L> Mutex DQueue<L>::_alloc_mut;
 
  template<class L> void *DQueue<L>::operator new(size_t size)
  {
***************
*** 203,213 ****
     p->_dq_next = _headOfFreeList;
     _headOfFreeList = p;
     _alloc_mut.unlock();
  }
 
! template<class L> AsyncDQueue<L> * AsyncDQueue<L>::_headOfFreeList;
  template<class L> const int AsyncDQueue<L>::BLOCK_SIZE = 20;
  template<class L> Mutex AsyncDQueue<L>::_alloc_mut;
 
  template<class L> void * AsyncDQueue<L>::operator new(size_t size)
  {
--- 203,213 ----
     p->_dq_next = _headOfFreeList;
     _headOfFreeList = p;
     _alloc_mut.unlock();
  }
 
! template<class L> AsyncDQueue<L> * AsyncDQueue<L>::_headOfFreeList =0;
  template<class L> const int AsyncDQueue<L>::BLOCK_SIZE = 20;
  template<class L> Mutex AsyncDQueue<L>::_alloc_mut;
 
  template<class L> void * AsyncDQueue<L>::operator new(size_t size)
  {
***************
*** 503,513 ****
       
  template<class L> L *DQueue<L>::prev( const void *ref) throw(IPCException)
  {
     if (_mutex->get_owner() != pegasus_thread_self())
        throw Permission(pegasus_thread_self());
!    return  Base::prev( ref );
  }
 
  template<class L> Boolean DQueue<L>::exists(const void *key) throw(IPCException)
  {
     if(key == 0)
--- 503,513 ----
       
  template<class L> L *DQueue<L>::prev( const void *ref) throw(IPCException)
  {
     if (_mutex->get_owner() != pegasus_thread_self())
        throw Permission(pegasus_thread_self());
!    return  static_cast<L *>(Base::prev( ref ));
  }
 
  template<class L> Boolean DQueue<L>::exists(const void *key) throw(IPCException)
  {
     if(key == 0)
***************
*** 779,789 ****
  }
 
  template<class L> void AsyncDQueue<L>::set_capacity(Uint32 capacity) throw(IPCException)
  {
     lock(pegasus_thread_self());
!    _capacity = capacity;
     unlock();
  }
 
  template<class L> Uint32 AsyncDQueue<L>::get_capacity(void)
  {
--- 779,789 ----
  }
 
  template<class L> void AsyncDQueue<L>::set_capacity(Uint32 capacity) throw(IPCException)
  {
     lock(pegasus_thread_self());
!    *_capacity = capacity;
     unlock();
  }
 
  template<class L> Uint32 AsyncDQueue<L>::get_capacity(void)
  {

===================================================================
Index: src/Pegasus/Common/Config.h

  - Added Platform_SOLARIS_SPARC_CC.h

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Config.h,v
retrieving revision 1.41
diff -C5 -r1.41 Config.h
*** src/Pegasus/Common/Config.h    12 Jun 2003 17:32:10 -0000    1.41
--- src/Pegasus/Common/Config.h    25 Jul 2003 13:17:24 -0000
***************
*** 46,55 ****
--- 46,57 ----
  # include <Pegasus/Common/Platform_HPUX_IA64_ACC.h>
  #elif defined (PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
  # include <Pegasus/Common/Platform_TRU64_ALPHA_DECCXX.h>
  #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
  # include <Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h>
+ #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
+ # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC.h>
  #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
  # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
  #elif defined (PEGASUS_PLATFORM_NSK_NONSTOP_NMCPLUS)
  # include <Pegasus/Common/Platform_NSK_NONSTOP_NMCPLUS.h>
  #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)

===================================================================
Index: src/Pegasus/Common/SystemUnix.cpp

 - System::unloadDynamicLibrary added  #define PEGASUS_OS_SOLRIS to
   use dlclose the same as PEGASUS_OS_LINUX

 - System::looklupPort Use getservbyname_r for PEGASUS_OS_SOLARIS case.
   (Should any other OS use the thread safe version?)

 - System::getEffectiveUser Use getpwuid_r for PEGASUS_OS_SOLARIS case.

 - System::isSystemUser Use getpwnam_r for PEGASUS_OS_SOLARIS case

 - System::getPriviledgedUserName Use getpwuid_r for PEGASUS_OS_SOLARIS case.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/SystemUnix.cpp,v
retrieving revision 1.59
diff -C5 -r1.59 SystemUnix.cpp
*** src/Pegasus/Common/SystemUnix.cpp    14 Jun 2003 19:25:38 -0000    1.59
--- src/Pegasus/Common/SystemUnix.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 213,223 ****
  }
 
  void System::unloadDynamicLibrary(DynamicLibraryHandle libraryHandle)
  {
      // ATTN: Should this method indicate success/failure?
! #ifdef PEGASUS_OS_LINUX
      dlclose(libraryHandle);
  #endif
 
  #ifdef PEGASUS_OS_HPUX
      // Note: shl_unload will unload the library even if it has been loaded
--- 213,223 ----
  }
 
  void System::unloadDynamicLibrary(DynamicLibraryHandle libraryHandle)
  {
      // ATTN: Should this method indicate success/failure?
! #if defined(PEGASUS_OS_LINUX) || defined(PEGASUS_OS_SOLARIS)
      dlclose(libraryHandle);
  #endif
 
  #ifdef PEGASUS_OS_HPUX
      // Note: shl_unload will unload the library even if it has been loaded
***************
*** 345,359 ****
 
      //
      // Get wbem-local port from /etc/services
      //
  #if !defined(PEGASUS_OS_OS400)
      if ( (serv = getservbyname(serviceName, TCP)) != NULL )
! #else
      // Need to cast on OS/400
      if ( (serv = getservbyname((char *)serviceName, TCP)) != NULL )
! #endif
      {
          localPort = htons((uint16_t)serv->s_port);
      }
      else
      {
--- 345,368 ----
 
      //
      // Get wbem-local port from /etc/services
      //
  #if !defined(PEGASUS_OS_OS400)
+ #ifdef PEGASUS_OS_SOLARIS
+ #define SERV_BUFF_SIZE    1024
+     struct servent    serv_result;
+     char        buf[SERV_BUFF_SIZE];
+
+     if ( (serv = getservbyname_r(serviceName, TCP, &serv_result,
+                 buf, SERV_BUFF_SIZE)) != NULL )
+ #else // PEGASUS_OS_SOLARIS
      if ( (serv = getservbyname(serviceName, TCP)) != NULL )
! #endif // PEGASUS_OS_SOLARIS
! #else  // !PEGASUS_OS_OS400
      // Need to cast on OS/400
      if ( (serv = getservbyname((char *)serviceName, TCP)) != NULL )
! #endif  // !PEGASUS_OS_OS400
      {
          localPort = htons((uint16_t)serv->s_port);
      }
      else
      {
***************
*** 379,392 ****
--- 388,410 ----
  String System::getEffectiveUserName()
  {
      String userName = String::EMPTY;
      struct passwd*   pwd = NULL;
 
+ #ifdef PEGASUS_OS_SOLARIS
+ #define PWD_BUFF_SIZE    1024
+     struct passwd    local_pwd;
+     char        buf[PWD_BUFF_SIZE];
+     if(getpwuid_r(geteuid(), &local_pwd, buf, PWD_BUFF_SIZE, &pwd)) {
+     pwd = (struct passwd *)NULL;
+     }
+ #else
      //
      //  get the currently logged in user's UID.
      //
      pwd = getpwuid(geteuid());
+ #endif
      if ( pwd == NULL )
      {
          //ATTN: Log a message
          // "User might have been removed just after login"
      }
***************
*** 411,424 ****
--- 429,450 ----
  #endif
  }
 
  Boolean System::isSystemUser(const char* userName)
  {
+ #ifdef PEGASUS_OS_SOLARIS
+     struct passwd   pwd;
+     struct passwd   *result;
+     char            pwdBuffer[1024];
+
+     if (getpwnam_r(userName, &pwd, pwdBuffer, 1024, &result) != 0)
+ #else
      //
      //  get the password entry for the user
      //
      if  ( getpwnam(userName) == NULL )
+ #endif
      {
      return false;
      }
      return true;
  }
***************
*** 451,466 ****
      static String userName = String::EMPTY;
 
      if (userName == String::EMPTY)
      {
          struct passwd*   pwd = NULL;
!
          //
          //  get the privileged user's UID.
          //
      //  (on OS/400, this is QSECOFR)
          pwd = getpwuid(0);
          if ( pwd != NULL )
          {
              //
              //  get the user name
              //
--- 477,499 ----
      static String userName = String::EMPTY;
 
      if (userName == String::EMPTY)
      {
          struct passwd*   pwd = NULL;
! #ifdef PEGASUS_OS_SOLARIS
!     struct passwd    local_pwd;
!     char        buf[PWD_BUFF_SIZE];
!     if(getpwuid_r(0, &local_pwd, buf, PWD_BUFF_SIZE, &pwd)) {
!         pwd = (struct passwd *)NULL;
!     }
! #else
          //
          //  get the privileged user's UID.
          //
      //  (on OS/400, this is QSECOFR)
          pwd = getpwuid(0);
+ #endif
          if ( pwd != NULL )
          {
              //
              //  get the user name
              //

===================================================================
Index: src/Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h

 - Added #include for <limits.h> and <cstdio>

 - Removed #define PEGASUS_OS_SOlARIS as this is now defined in top level
   Makefile for all SOLARIS builds.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h,v
retrieving revision 1.6
diff -C5 -r1.6 Platform_SOLARIS_SPARC_GNU.h
*** src/Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h    22 Aug 2002 20:08:33 -0000    1.6
--- src/Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h    25 Jul 2003 13:17:24 -0000
***************
*** 29,43 ****
  //%/////////////////////////////////////////////////////////////////////////////
 
  #ifndef Pegasus_Platform_SOLARIS_SPARC_GNU_h
  #define Pegasus_Platform_SOLARIS_SPARC_GNU_h
 
  #include <cstddef>
 
  #define PEGASUS_OS_TYPE_UNIX
-
- #define PEGASUS_OS_SOLARIS
 
  #define PEGASUS_ARCHITECTURE_SPARC
 
  #define PEGASUS_COMPILER_GNU
 
--- 29,43 ----
  //%/////////////////////////////////////////////////////////////////////////////
 
  #ifndef Pegasus_Platform_SOLARIS_SPARC_GNU_h
  #define Pegasus_Platform_SOLARIS_SPARC_GNU_h
 
+ #include <limits.h>
+ #include <cstdio>
  #include <cstddef>
 
  #define PEGASUS_OS_TYPE_UNIX
 
  #define PEGASUS_ARCHITECTURE_SPARC
 
  #define PEGASUS_COMPILER_GNU
 
===================================================================
Index: src/Pegasus/Common/String.cpp

  - Added cheap and nasty print routine - I added this so it was callable
    from  a debugger command line after I got annoyed trying to get the
    "text" out of a String during a debug session.

    Only compiled if PEGASUS_DEBUG defined.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/String.cpp,v
retrieving revision 1.68
diff -C5 -r1.68 String.cpp
*** src/Pegasus/Common/String.cpp    30 Apr 2003 13:50:44 -0000    1.68
--- src/Pegasus/Common/String.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 89,98 ****
--- 89,108 ----
  //
  ///////////////////////////////////////////////////////////////////////////////
 
  const String String::EMPTY = String();
 
+ #ifdef PEGASUS_DEBUG
+
+ // Cheap and nasty print routine - callable from a debugger command line
+
+ void String::print()
+ {
+ cout << *this << endl;
+ }
+ #endif
+
  Uint32 _strnlen(const char* str, Uint32 n)
  {
      if (!str)
      throw NullPointer();
 
===================================================================
Index: src/Pegasus/Common/String.h

  - Added print routine to String class (inside PEGASUS_DEBUG)

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/String.h,v
retrieving revision 1.75
diff -C5 -r1.75 String.h
*** src/Pegasus/Common/String.h    14 Jul 2003 13:55:35 -0000    1.75
--- src/Pegasus/Common/String.h    25 Jul 2003 13:17:24 -0000
***************
*** 357,366 ****
--- 357,369 ----
      @return true if strings are equal independent of case, flase
          otherwise.
      */
      static Boolean equalNoCase(const String& str1, const String& str2);
 
+ #ifdef PEGASUS_DEBUG
+     void print();
+ #endif
  private:
 
      StringRep* _rep;
  };
 
===================================================================
Index: src/Pegasus/Common/CIMDateTimeUnix.cpp

  - Solaris uses localtime_r (MT safe version)

  - Solaris doesn't fill in the timezone structure in the call to gettimeofday
    Add correction for local timezone using Solaris specific methods.

    KRP - Need to verify the DST bit and the +/- sign is correct.

  - All changes inside #ifdef SOLARIS wrappers.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/CIMDateTimeUnix.cpp,v
retrieving revision 1.8
diff -C5 -r1.8 CIMDateTimeUnix.cpp
*** src/Pegasus/Common/CIMDateTimeUnix.cpp    20 Sep 2002 20:31:30 -0000    1.8
--- src/Pegasus/Common/CIMDateTimeUnix.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 67,83 ****
      char           mTmpString[80];
      time_t         mSysTime;
      struct         timeval   tv;
      struct         timezone  tz;
      struct tm*         tmval;
!
      // Get the system date and time
      mSysTime = time(NULL);
 
      // Get the localtime
      tmval = localtime(&mSysTime);
      gettimeofday(&tv,&tz);
 
      // Initialize the year
      year = 1900;
 
      // Format the date
--- 67,93 ----
      char           mTmpString[80];
      time_t         mSysTime;
      struct         timeval   tv;
      struct         timezone  tz;
      struct tm*         tmval;
! #if defined PEGASUS_OS_SOLARIS
!     struct tm        local_tm;
!     time_t        utc_offset;
! #endif
      // Get the system date and time
      mSysTime = time(NULL);
 
      // Get the localtime
+ #if defined PEGASUS_OS_SOLARIS
+     tmval = localtime_r(&mSysTime, &local_tm);
+     gettimeofday(&tv,NULL);
+     utc_offset = (tmval->tm_isdst > 0 && daylight) ? altzone : timezone ;
+     utc_offset /= 60;    // CIM only uses minutes, not seconds.
+ #else
      tmval = localtime(&mSysTime);
      gettimeofday(&tv,&tz);
+ #endif
 
      // Initialize the year
      year = 1900;
 
      // Format the date
***************
*** 87,96 ****
--- 97,115 ----
                      tmval->tm_mday,
                      tmval->tm_hour,
                      tmval->tm_min,
                      tmval->tm_sec,
                      0,
+ #if defined PEGASUS_OS_SOLARIS
+             abs((int)utc_offset));
+
+     // Set UTC sign
+     if(utc_offset > 0)
+     {
+     dateTime.plusOrMinus = '-';
+     }
+ #else
                      abs(tz.tz_minuteswest)); // take care of the sign later on
 
      // Set the UTC Sign
      if (tz.tz_minuteswest > 0)
      {
***************
*** 98,108 ****
      }
      else
      {
          dateTime.plusOrMinus = '+';
      }
!
      currentDateTime.clear();
      strcpy(mTmpString, (char *)&dateTime);
      currentDateTime.set(mTmpString);
 
      return currentDateTime;
--- 117,127 ----
      }
      else
      {
          dateTime.plusOrMinus = '+';
      }
! #endif
      currentDateTime.clear();
      strcpy(mTmpString, (char *)&dateTime);
      currentDateTime.set(mTmpString);
 
      return currentDateTime;

===================================================================
Index: src/Pegasus/Common/ThreadUnix.cpp

  - We borrowed the IBM zOS _linkage to overcome the "C" "C++" linkage
    complaints.

  - Solaris complains about empty expression if the trailing ";" is left on
    place.

  - Thread::~Thread. Moved the pthread_attr_destroy outside the if(...) block.
    We always create one so should always destroy it.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/ThreadUnix.cpp,v
retrieving revision 1.8
diff -C5 -r1.8 ThreadUnix.cpp
*** src/Pegasus/Common/ThreadUnix.cpp    7 Apr 2003 20:29:23 -0000    1.8
--- src/Pegasus/Common/ThreadUnix.cpp    25 Jul 2003 13:17:24 -0000
***************
*** 61,71 ****
      sigprocmask(SIG_BLOCK, sig, NULL);
  #endif
      return sig;
  }
 
! #ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
  extern "C" {
      void * _linkage(void * zosParm)
      {
          zosParmDef * zos;
          void * retval;
--- 61,71 ----
      sigprocmask(SIG_BLOCK, sig, NULL);
  #endif
      return sig;
  }
 
! #if defined PEGASUS_PLATFORM_ZOS_ZSERIES_IBM || defined PEGASUS_PLATFORM_SOLARIS_SPARC_CC
  extern "C" {
      void * _linkage(void * zosParm)
      {
          zosParmDef * zos;
          void * retval;
***************
*** 73,83 ****
          zos = (zosParmDef *)zosParm;
          retval = (*(zos->_start))(zos->realParm);
          free(zosParm);
          return retval;
      }
! };
  #endif
 
 
  ////////////////////////////////////////////////////////////////////////////
 
--- 73,83 ----
          zos = (zosParmDef *)zosParm;
          retval = (*(zos->_start))(zos->realParm);
          free(zosParm);
          return retval;
      }
! }
  #endif
 
 
  ////////////////////////////////////////////////////////////////////////////
 
***************
*** 109,120 ****
  #ifndef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
              pthread_join(_handle.thid,NULL);
  #else
              pthread_join(*(pthread_t *)&_handle.thid,NULL);
  #endif
-      pthread_attr_destroy(&_handle.thatt);
        }
     }
     catch(...)
     {
     }
    
--- 109,120 ----
  #ifndef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
              pthread_join(_handle.thid,NULL);
  #else
              pthread_join(*(pthread_t *)&_handle.thid,NULL);
  #endif
        }
+       pthread_attr_destroy(&_handle.thatt);
     }
     catch(...)
     {
     }
    
===================================================================
Index: src/Pegasus/Common/XmlWriter.cpp

  - Use strtok_r

  - Added "|| defined PEGASUS_FORCE_POST_METHOD" to allow forcing POST method
    without pulling in all the other hacks that PEGASUS_SNIA_INTEROP_TEST allows

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/XmlWriter.cpp,v
retrieving revision 1.89
diff -C5 -r1.89 XmlWriter.cpp
*** src/Pegasus/Common/XmlWriter.cpp    17 Jul 2003 01:37:36 -0000    1.89
--- src/Pegasus/Common/XmlWriter.cpp    25 Jul 2003 13:17:25 -0000
***************
*** 394,404 ****
--- 394,410 ----
      const CIMNamespaceName& nameSpace)
  {
      out << "<LOCALNAMESPACEPATH>\n";
 
      char* nameSpaceCopy = strdup(nameSpace.getString().getCString());
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_CC
+     char *last;
+     for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;
+                      p = strtok_r(NULL, "/", &last))
+ #else
      for (const char* p = strtok(nameSpaceCopy, "/"); p; p = strtok(NULL, "/"))
+ #endif
      {
      out << "<NAMESPACE NAME=\"" << p << "\"/>\n";
      }
      delete nameSpaceCopy;
 
***************
*** 1504,1514 ****
      // be changed in the DMTF CIM Operations standard in the future.
      // If we kept M-Post we would have to retry with Post. Does not
      // do that in client today. Permanent change is to retry until spec
      // updated. This change is temp to finish tests or until the retry
      // installed.  Required because of change to wbemservices cimom
! #ifdef PEGASUS_SNIA_INTEROP_TEST
      out << "POST /cimom HTTP/1.1\r\n";
  #else
      if (httpMethod == HTTP_METHOD_M_POST)
      {
          out << "M-POST /cimom HTTP/1.1\r\n";
--- 1510,1520 ----
      // be changed in the DMTF CIM Operations standard in the future.
      // If we kept M-Post we would have to retry with Post. Does not
      // do that in client today. Permanent change is to retry until spec
      // updated. This change is temp to finish tests or until the retry
      // installed.  Required because of change to wbemservices cimom
! #if defined PEGASUS_SNIA_INTEROP_TEST || defined PEGASUS_FORCE_POST_METHOD
      out << "POST /cimom HTTP/1.1\r\n";
  #else
      if (httpMethod == HTTP_METHOD_M_POST)
      {
          out << "M-POST /cimom HTTP/1.1\r\n";

===================================================================
Index: src/Pegasus/Repository/Makefile

 - Added lines to statically link libCstd.a on Solaris. I need to find a
   better way to do this.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Repository/Makefile,v
retrieving revision 1.19
diff -C5 -r1.19 Makefile
*** src/Pegasus/Repository/Makefile    1 May 2002 02:34:23 -0000    1.19
--- src/Pegasus/Repository/Makefile    25 Jul 2003 13:17:25 -0000
***************
*** 8,17 ****
--- 8,21 ----
 
  LOCAL_DEFINES = -DPEGASUS_REPOSITORY_INTERNAL -DPEGASUS_INTERNALONLY
 
  LIBRARIES = pegcommon pegconfig
 
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+ EXTRA_LIBRARIES += $(SOLARIS_COMPILER_PATH)/lib/libCstd.a
+ endif
+
  LIBRARY = pegrepository
 
  SOURCES = \
      InstanceIndexFile.cpp \
      InstanceDataFile.cpp \

===================================================================
Index: src/Clients/tomof/clientRepositoryInterface.cpp

  - Moved clientRepositoryInterface.h to the end of the include list. The
    Solaris compiler saw the Array<CIMClass> return value for enumerateClasses
    and noted it as an implicit declaration. CIMClass.h then presented it
    with an explicit declaration and it moaned about duplicate declarations.
    Making sure CIMClass.h gets in first fixes the problem. Same thing for
    some other Array<Classes>.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Clients/tomof/clientRepositoryInterface.cpp,v
retrieving revision 1.12
diff -C5 -r1.12 clientRepositoryInterface.cpp
*** src/Clients/tomof/clientRepositoryInterface.cpp    6 Jun 2003 11:14:25 -0000    1.12
--- src/Clients/tomof/clientRepositoryInterface.cpp    25 Jul 2003 13:17:25 -0000
***************
*** 26,41 ****
  // Modified By:  Carol Ann Krug Graves, Hewlett-Packard Company
  //               (carolann_graves@hp.com)
  //
  //%/////////////////////////////////////////////////////////////////////////////
 
- #include "clientRepositoryInterface.h"
  #include <Pegasus/Repository/CIMRepository.h>
  #include <Pegasus/Common/CIMClass.h>
  #include <Pegasus/Common/CIMInstance.h>
  #include <Pegasus/Client/CIMClient.h>
  #include <Pegasus/Common/Exception.h>
 
  PEGASUS_USING_STD;
  PEGASUS_NAMESPACE_BEGIN
 
  clientRepositoryInterface::clientRepositoryInterface() :
--- 26,41 ----
  // Modified By:  Carol Ann Krug Graves, Hewlett-Packard Company
  //               (carolann_graves@hp.com)
  //
  //%/////////////////////////////////////////////////////////////////////////////
 
  #include <Pegasus/Repository/CIMRepository.h>
  #include <Pegasus/Common/CIMClass.h>
  #include <Pegasus/Common/CIMInstance.h>
  #include <Pegasus/Client/CIMClient.h>
  #include <Pegasus/Common/Exception.h>
+ #include "clientRepositoryInterface.h"
 
  PEGASUS_USING_STD;
  PEGASUS_NAMESPACE_BEGIN
 
  clientRepositoryInterface::clientRepositoryInterface() :

===================================================================
Index: src/slp/lslp-perl-linux.h

 - #include netdb.h for SOLARIS only

 - add prototype for strtok_r for SOLARIS only

===================================================================
RCS file: /cvs/MSB/pegasus/src/slp/lslp-perl-linux.h,v
retrieving revision 1.12
diff -C5 -r1.12 lslp-perl-linux.h
*** src/slp/lslp-perl-linux.h    24 Aug 2002 16:01:42 -0000    1.12
--- src/slp/lslp-perl-linux.h    25 Jul 2003 13:17:25 -0000
***************
*** 44,60 ****
--- 44,67 ----
  #include <arpa/inet.h>
  #include <sys/ioctl.h>
  #include <sys/socket.h>
  #include <sys/stat.h>
  #include <string.h>
+ #if defined(PEGASUS_OS_SOLARIS)
+ #include <netdb.h>
+ #endif
 
  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
  extern "C" char *strtok_r(char *, const char *, char **);
  # include <arpa/inet.h>
  # include <net/if.h>
  #elif defined (PEGASUS_OS_TRU64) || defined(PEGASUS_OS_AIX)
  # include <arpa/inet.h>
+ # include <net/if.h>
+ #elif defined (PEGASUS_OS_SOLARIS)
+ extern "C" char *strtok_r(char *, const char *, char **);
+ # define INADDR_NONE INADDR_BROADCAST
  # include <net/if.h>
  #elif defined (PEGASUS_OS_OS400)
  # include <unistd.cleinc>
  # include <sys/socket.h> 
  # include <strings.h>

===================================================================
Index: src/slp/slp.cpp

  - Added sys/sockio.h for SOLARIS_SPARC_CC platform (needed for SIOCGIFCONF)

  - I don't understand the gethostbyname_r code. It takes a perfectly good
    MT safe call and replaces it with one that is not MT-safe on some
    platforms - or am I missing something here?

    Added gethostbyname_r macro for SOLARIS that is a drop in replacement for
    the original call but still uses the MT-safe call.

===================================================================
RCS file: /cvs/MSB/pegasus/src/slp/slp.cpp,v
retrieving revision 1.16
diff -C5 -r1.16 slp.cpp
*** src/slp/slp.cpp    27 Aug 2002 18:05:21 -0000    1.16
--- src/slp/slp.cpp    25 Jul 2003 13:17:25 -0000
***************
*** 38,47 ****
--- 38,51 ----
 
  #if defined(PEGASUS_OS_HPUX)
  # include <netdb.h>
  #endif
 
+ #if defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
+ # include <sys/sockio.h>
+ #endif
+
  PEGASUS_USING_STD;
 
  PEGASUS_NAMESPACE_BEGIN
 
  // This is necessary to avoid the "reinterpret cast" warning generated
***************
*** 80,90 ****
    }
    return(0);
  }
 
  #endif
-
  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64) || defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_OS400)
 
  PEGASUS_EXPORT int gethostbyname_r(const char *name,
              struct hostent *resultbuf,
              char *buf,
--- 84,93 ----
***************
*** 107,116 ****
--- 110,125 ----
    }
    return(0);
  }
 
  #endif
+ #ifdef PEGASUS_OS_SOLARIS
+ #define gethostbyname_r(name, resultbuf, buf, bufsize, result, errnop) \
+     (*result=gethostbyname_r(name, resultbuf, buf, bufsize, errnop),\
+     *errnop = *errnop)
+
+ #endif
 
  PEGASUS_EXPORT void slp_get_addr_string_from_url(const Sint8 *url, String &addr)
  {
    Sint8 *name = NULL;
    struct sockaddr_in a;
***************
*** 1610,1620 ****
      err = select(_rcv_sock > extra_sock ? _rcv_sock + 1: extra_sock + 1, &fds, NULL, NULL, &tv);
    } while ( (err < 0 )&& (errno == EINTR)) ;
    if( 0 < err ) {
      struct sockaddr_in remote;
 
! #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
      int size = sizeof(remote);
  #else
      socklen_t size = sizeof(remote);
  #endif
 
--- 1619,1629 ----
      err = select(_rcv_sock > extra_sock ? _rcv_sock + 1: extra_sock + 1, &fds, NULL, NULL, &tv);
    } while ( (err < 0 )&& (errno == EINTR)) ;
    if( 0 < err ) {
      struct sockaddr_in remote;
 
! #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64) || ( defined PEGASUS_OS_SOLARIS && defined SUNOS_5_6)
      int size = sizeof(remote);
  #else
      socklen_t size = sizeof(remote);
  #endif
 
===================================================================
Index: src/Pegasus/Security/Authentication/LocalAuthFileUnix.cpp

  - LocalAuthFile::_changeFileOwner Use getpwnam_r for SOLARIS_SPARC_CC
    platform

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Security/Authentication/LocalAuthFileUnix.cpp,v
retrieving revision 1.13
diff -C5 -r1.13 LocalAuthFileUnix.cpp
*** src/Pegasus/Security/Authentication/LocalAuthFileUnix.cpp    29 Aug 2002 00:27:52 -0000    1.13
--- src/Pegasus/Security/Authentication/LocalAuthFileUnix.cpp    25 Jul 2003 13:17:26 -0000
***************
*** 224,235 ****
--- 224,246 ----
  Boolean LocalAuthFile::_changeFileOwner(const String& fileName)
  {
      PEG_METHOD_ENTER(TRC_AUTHENTICATION, "LocalAuthFile::_changeFileOwner()");
 
      struct passwd*        userPasswd;
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC_CC
+     struct passwd   pwd;
+     struct passwd   *result;
+     char            pwdBuffer[1024];
+
+     if (getpwnam_r(_userName.getCString(), &pwd, pwdBuffer, 1024, &userPasswd)
+                                  != 0) {
+     userPasswd = (struct passwd *)NULL;
+     }
+ #else
 
      userPasswd = getpwnam(_userName.getCString());
+ #endif
 
      if ( userPasswd  == NULL)
      {
          PEG_METHOD_EXIT();
          return (false);

===================================================================
Index: src/Pegasus/Common/tests/Array/Array.cpp

  - The Solaris compiler complains about the use of verbose (which is declared
    static at file level) from within a template. The template code appears as
    a separate .o file in the SUNWs_cache, and can't access the static in
    another file. Looked at this way it is correct, but I can't decide if it
    is really correct or simply an artefact of the way Sun have implemented
    the template support.

    Removed the static qualifier from verbose.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/tests/Array/Array.cpp,v
retrieving revision 1.14
diff -C5 -r1.14 Array.cpp
*** src/Pegasus/Common/tests/Array/Array.cpp    21 Aug 2002 22:45:50 -0000    1.14
--- src/Pegasus/Common/tests/Array/Array.cpp    25 Jul 2003 13:17:26 -0000
***************
*** 36,46 ****
  #include "Str.h"
  #include "Int.h"
 
  PEGASUS_USING_PEGASUS;
  PEGASUS_USING_STD;
! static char * verbose;
 
  template<class T>
  void Print(const Array<T>& arr)
  {
      for (size_t i = 0; i < arr.size(); i++)
--- 36,46 ----
  #include "Str.h"
  #include "Int.h"
 
  PEGASUS_USING_PEGASUS;
  PEGASUS_USING_STD;
! char * verbose;
 
  template<class T>
  void Print(const Array<T>& arr)
  {
      for (size_t i = 0; i < arr.size(); i++)

===================================================================
Index: src/Pegasus/Common/tests/ToMof/tomof.cpp

  - The Solaris compiler complains about the use of verbose (which is declared
    static at file level) from within a template. The template code appears as
    a separate .o file in the SUNWs_cache, and can't access the static in
    another file. Looked at this way it is correct, but I can't decide if it
    is really correct or simply an artefact of the way Sun have implemented
    the template support.

    Removed the static qualifier from verbose.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/tests/ToMof/tomof.cpp,v
retrieving revision 1.14
diff -C5 -r1.14 tomof.cpp
*** src/Pegasus/Common/tests/ToMof/tomof.cpp    13 Sep 2002 21:40:42 -0000    1.14
--- src/Pegasus/Common/tests/ToMof/tomof.cpp    25 Jul 2003 13:17:26 -0000
***************
*** 39,49 ****
 
  PEGASUS_USING_PEGASUS;
  PEGASUS_USING_STD;
 
  // #define IO
! static char * verbose;
 
  template<class T>
  void test01(const T& x)
  {
      CIMValue v(x);
--- 39,49 ----
 
  PEGASUS_USING_PEGASUS;
  PEGASUS_USING_STD;
 
  // #define IO
! char * verbose;
 
  template<class T>
  void test01(const T& x)
  {
      CIMValue v(x);

===================================================================
Index: src/Pegasus/Common/tests/Value/Value.cpp

  - The Solaris compiler complains about the use of verbose (which is declared
    static at file level) from within a template. The template code appears as
    a separate .o file in the SUNWs_cache, and can't access the static in
    another file. Looked at this way it is correct, but I can't decide if it
    is really correct or simply an artefact of the way Sun have implemented
    the template support.

    Removed the static qualifier from verbose.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/tests/Value/Value.cpp,v
retrieving revision 1.18
diff -C5 -r1.18 Value.cpp
*** src/Pegasus/Common/tests/Value/Value.cpp    19 Aug 2002 18:04:15 -0000    1.18
--- src/Pegasus/Common/tests/Value/Value.cpp    25 Jul 2003 13:17:26 -0000
***************
*** 56,66 ****
      Added the verbose variable which comes from an environment variable.
      IO occurs onlly when the environment variable is set.
  */
  #define IO 1
 
! static char * verbose;
 
 
  /* This template provides a complete set of tests of simple CIMValues for
      the different possible data types.  It tests creating, assigning,
      the equals, creating XML and MOF, and the functions associated with
--- 56,66 ----
      Added the verbose variable which comes from an environment variable.
      IO occurs onlly when the environment variable is set.
  */
  #define IO 1
 
! char * verbose;
 
 
  /* This template provides a complete set of tests of simple CIMValues for
      the different possible data types.  It tests creating, assigning,
      the equals, creating XML and MOF, and the functions associated with

===================================================================
Index: src/Clients/wbemexec/XMLProcess.cpp

  - XMLProcess::encapsulate use strtok_r for PEGASUS_OS_SOLARIS

===================================================================
RCS file: /cvs/MSB/pegasus/src/Clients/wbemexec/XMLProcess.cpp,v
retrieving revision 1.20
diff -C5 -r1.20 XMLProcess.cpp
*** src/Clients/wbemexec/XMLProcess.cpp    6 Mar 2003 22:46:04 -0000    1.20
--- src/Clients/wbemexec/XMLProcess.cpp    25 Jul 2003 13:17:26 -0000
***************
*** 152,162 ****
--- 152,167 ----
          //  Check for HTTP method
          //
          char tmp [8];
          char* tmpp = & (tmp [0]);
          strncpy (tmpp, entry.text, 8);
+ #ifdef PEGASUS_OS_SOLARIS
+     char *last;
+         char* p = strtok_r (tmpp, HTTP_SP, &last);
+ #else
          char* p = strtok (tmpp, HTTP_SP);
+ #endif
          if (p != NULL)
          {
              if ((strcmp (p, HTTP_METHOD_MPOST) == 0) ||
                  (strcmp (p, HTTP_METHOD_POST) == 0) ||
              //  This is a special request used for testing.

===================================================================
Index: src/Pegasus/Compiler/cimmof_tab.cpp

  - Added SOLARIS_SPARC_CC platform to list of platforms that don't want
    malloc.h

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Compiler/cimmof_tab.cpp,v
retrieving revision 1.23
diff -C5 -r1.23 cimmof_tab.cpp
*** src/Pegasus/Compiler/cimmof_tab.cpp    13 Sep 2002 21:40:42 -0000    1.23
--- src/Pegasus/Compiler/cimmof_tab.cpp    25 Jul 2003 13:17:27 -0000
***************
*** 115,125 ****
    */
 
  #define YYSTACKSIZE 2000
 
  #include <cstdlib>
! #if !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(__OS400__)
  #include <malloc.h>
  #endif
  #include <cstdio>
  #include <cstring>
  #include <Pegasus/Common/String.h>
--- 115,125 ----
    */
 
  #define YYSTACKSIZE 2000
 
  #include <cstdlib>
! #if !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(__OS400__) && !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
  #include <malloc.h>
  #endif
  #include <cstdio>
  #include <cstring>
  #include <Pegasus/Common/String.h>

===================================================================
Index: src/Pegasus/Client/CIMOperationResponseDecoder.cpp

  - Merged CLIENT_TRACE code. This is inside #ifdef PEGASUS_DEBUG wrapper
    and tests for PEGASUS_CLIENT_TRACE in the environment before outputting
    trace data.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Client/CIMOperationResponseDecoder.cpp,v
retrieving revision 1.39
diff -C5 -r1.39 CIMOperationResponseDecoder.cpp
*** src/Pegasus/Client/CIMOperationResponseDecoder.cpp    17 Jul 2003 01:39:24 -0000    1.39
--- src/Pegasus/Client/CIMOperationResponseDecoder.cpp    25 Jul 2003 13:17:27 -0000
***************
*** 234,243 ****
--- 234,250 ----
      String cimOperation;
 
      if (!HTTPMessage::lookupHeader(
      headers, "CIMOperation", cimOperation, true))
      {
+ #ifdef PEGASUS_DEBUG
+             if (getenv("PEGASUS_CLIENT_TRACE"))
+             {
+                 cout << "Missing CIMOperation HTTP header on this response" << endl;
+                 httpMessage->printAll(cout);
+             }
+ #endif
          CIMClientMalformedHTTPException* malformedHTTPException = new
              CIMClientMalformedHTTPException("Missing CIMOperation HTTP header");
          ClientExceptionMessage * response =
              new ClientExceptionMessage(malformedHTTPException);
 
***************
*** 276,285 ****
--- 283,300 ----
      //
      // Zero-terminate the message:
      //
 
      httpMessage->message.append('\0');
+
+ #ifdef PEGASUS_DEBUG
+     // Display of received packet.  Displays the complete received packet
+     // For now, this is conditionally compiled.
+     if (getenv("PEGASUS_CLIENT_TRACE"))
+         XmlWriter::indentedPrint(cout, httpMessage->message.getData());
+ #endif
+
 
      // Calculate the beginning of the content from the message size and
      // the content length.  Subtract 1 to take into account the null
      // character we just added to the end of the message.
 
===================================================================
Index: src/Pegasus/Config/Makefile

 - Added lines to statically link libCstd.a on Solaris. I need to find a
   better way to do this.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Config/Makefile,v
retrieving revision 1.5
diff -C5 -r1.5 Makefile
*** src/Pegasus/Config/Makefile    1 May 2002 02:34:22 -0000    1.5
--- src/Pegasus/Config/Makefile    25 Jul 2003 13:17:27 -0000
***************
*** 9,18 ****
--- 9,22 ----
  LIBRARY = pegconfig
 
  LIBRARIES = \
      pegcommon
 
+ ifeq ($(PEGASUS_PLATFORM),SOLARIS_SPARC_CC)
+ EXTRA_LIBRARIES += $(SOLARIS_COMPILER_PATH)/lib/libCstd.a
+ endif
+
  SOURCES = \
      ConfigExceptions.cpp \
      ConfigFile.cpp \
      ConfigFileHandler.cpp \
      ConfigManager.cpp \

===================================================================
Index: src/Pegasus/Config/ConfigFileDir.h

 - Added default value for CIMSERVER_START_FILE.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Config/ConfigFileDir.h,v
retrieving revision 1.6
diff -C5 -r1.6 ConfigFileDir.h
*** src/Pegasus/Config/ConfigFileDir.h    10 Jun 2003 17:44:01 -0000    1.6
--- src/Pegasus/Config/ConfigFileDir.h    25 Jul 2003 13:17:27 -0000
***************
*** 47,54 ****
--- 47,58 ----
  /**
      Default file name for the planned configuration.
  */
  static char PLANNED_CONFIG_FILE [] = "cimserver_planned.conf";
 
+ /**
+     Default file name for the cimserver startup file containing the PID.
+ */
+ static char CIMSERVER_START_FILE [] = "/tmp/cimserver_start.conf";
  #endif
 
  #endif /* Pegasus_ConfigFileDir_h */

===================================================================
Index: src/Pegasus/Common/tests/IPC/IPC.cpp

 - SCHED_RR doesn't appear to pre-empt the thread properly on the early
   Solaris 5.6. Added a pegasus_sleep(1) in the hard loop to provide a
   pre-emption point. (Solaris 5.6 only).

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Common/tests/IPC/IPC.cpp,v
retrieving revision 1.6
diff -C5 -r1.6 IPC.cpp
*** src/Pegasus/Common/tests/IPC/IPC.cpp    18 Mar 2003 21:03:27 -0000    1.6
--- src/Pegasus/Common/tests/IPC/IPC.cpp    25 Jul 2003 13:17:27 -0000
***************
*** 124,133 ****
--- 124,136 ----
 
      while (type != MY_CANCEL_TYPE)
      {
          message = mq->dequeue();
          while (!message) {
+ #if defined PEGASUS_OS_SOLARIS && defined SUNOS_5_6
+         pegasus_sleep(1);
+ #endif
              message = mq->dequeue();
          }
 
          key = message->getKey();
          type = message->getType();

===================================================================
Index: src/Clients/CGIClient/CGIClient.cpp

  - Solaris CC compiler has a real problem with things declared static and then
    used within a template. It puts the template code instance in to a
    separate .o file and then "can't" access the static, even if they appeared
    in the same original source file. Don't know if this is a bug or simply
    a loosely defined language feature.

    Fixed it by removing the static qualifiers - they didn't do much anyway.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Clients/CGIClient/CGIClient.cpp,v
retrieving revision 1.72
diff -C5 -r1.72 CGIClient.cpp
*** src/Clients/CGIClient/CGIClient.cpp    18 Sep 2002 17:09:24 -0000    1.72
--- src/Clients/CGIClient/CGIClient.cpp    25 Jul 2003 13:17:28 -0000
***************
*** 155,176 ****
  {
      cout << "<hr></hr>";
  }
 
 
! static void PrintHead(const String& title)
  {
      cout << "<head>\n";
      cout << "  <title>" << title << "</title>\n";
      cout << "</head>\n";
  }
 
  /** PrintHeader - Print the HTML banner. THis is a table with
      the text definition for the page and the TOG logo.
      @param - Text for the title
  */
! static void PrintHeader(const String& title)
  {
      String img = "/pegasus/icons/OpenGroupLogo.gif";
 
      cout << "<table width=\"100%\">\n";
      cout << "<tr>\n";
--- 155,176 ----
  {
      cout << "<hr></hr>";
  }
 
 
! void PrintHead(const String& title)
  {
      cout << "<head>\n";
      cout << "  <title>" << title << "</title>\n";
      cout << "</head>\n";
  }
 
  /** PrintHeader - Print the HTML banner. THis is a table with
      the text definition for the page and the TOG logo.
      @param - Text for the title
  */
! void PrintHeader(const String& title)
  {
      String img = "/pegasus/icons/OpenGroupLogo.gif";
 
      cout << "<table width=\"100%\">\n";
      cout << "<tr>\n";
***************
*** 186,196 ****
      and the page banner informatio
      @param string title - The text for the title field
      @param string header - The text for the banner line. This string
      identifies the function of the page.
  */
! static void PrintHTMLHead(const String& title, const String& header)
  {
       cout << "<html>\n";
       PrintHead(title);
       cout << "<body bgcolor=\"#CCCCCC\">\n";
       PrintHeader(header);
--- 186,196 ----
      and the page banner informatio
      @param string title - The text for the title field
      @param string header - The text for the banner line. This string
      identifies the function of the page.
  */
! void PrintHTMLHead(const String& title, const String& header)
  {
       cout << "<html>\n";
       PrintHead(title);
       cout << "<body bgcolor=\"#CCCCCC\">\n";
       PrintHeader(header);
***************
*** 229,239 ****
      ErrorExit("NameSpace parameter is null");
 
      return CIMNamespaceName (nameSpace);
  }
 
! static String EncodeQueryStringValue(const String& x)
  {
      String result;
 
      for (Uint32 j = 0, m = x.size(); j < m; j++)
      {
--- 229,239 ----
      ErrorExit("NameSpace parameter is null");
 
      return CIMNamespaceName (nameSpace);
  }
 
! String EncodeQueryStringValue(const String& x)
  {
      String result;
 
      for (Uint32 j = 0, m = x.size(); j < m; j++)
      {
***************
*** 251,274 ****
  }
  /** PrintAHref - Prints a single href
      @param href - the reference for building the href
      @param content - The content of the reference
  */
! static void PrintAHref(const String& href, const String& content)
  {
      cout << "<a href=\"" << href << "\">\n" << content << "</a>\n";
  }
  /* just prints HTML form spaces. Count is number of spaces
  */
! static void PrintSpaces(Uint32 count)
  {
      for (Uint32 i = 0; i < count; i++)
      {
          cout << "&nbsp;";
      }
  }
! static void PrintTableHeader(const String& tableName)
  {
      cout << "<h2>" << tableName << "</h2>\n";
      cout << "<table border=1 width=\"90%\">\n";
      cout << "<tr>\n";
      cout << "<th>CIMName</th>\n";
--- 251,274 ----
  }
  /** PrintAHref - Prints a single href
      @param href - the reference for building the href
      @param content - The content of the reference
  */
! void PrintAHref(const String& href, const String& content)
  {
      cout << "<a href=\"" << href << "\">\n" << content << "</a>\n";
  }
  /* just prints HTML form spaces. Count is number of spaces
  */
! void PrintSpaces(Uint32 count)
  {
      for (Uint32 i = 0; i < count; i++)
      {
          cout << "&nbsp;";
      }
  }
! void PrintTableHeader(const String& tableName)
  {
      cout << "<h2>" << tableName << "</h2>\n";
      cout << "<table border=1 width=\"90%\">\n";
      cout << "<tr>\n";
      cout << "<th>CIMName</th>\n";
***************
*** 278,288 ****
  }
  /** Header for the Properties HTML table
  Columns in the table are CIMProperty CIMName, type, Vlaue, ClassOrigin,
  Propogated indicator.
  */
! static void PrintPropertiesTableHeader(const String& tableName)
  {
      cout << "<h2>" << tableName << "</h2>\n";
      cout << "<table border=1 width=\"90%\">\n";
      cout << "<tr>\n";
      cout << "<th>CIMName</th>\n";
--- 278,288 ----
  }
  /** Header for the Properties HTML table
  Columns in the table are CIMProperty CIMName, type, Vlaue, ClassOrigin,
  Propogated indicator.
  */
! void PrintPropertiesTableHeader(const String& tableName)
  {
      cout << "<h2>" << tableName << "</h2>\n";
      cout << "<table border=1 width=\"90%\">\n";
      cout << "<tr>\n";
      cout << "<th>CIMName</th>\n";
***************
*** 350,360 ****
  }
  /** PrintEnumInstanceNameHref - Put out a link to the enumerate
  instance Names function for this class.
  @return - void
  */
! static void PrintEnumInstanceNameHref(const CIMNamespaceName & nameSpace,
      const CIMName & className)
  {
      String href = BuildOperationHref("EnumerateInstanceNames",
          EncodeQueryStringValue(nameSpace.getString()));
      AppendHrefField(href,"ClassName",className.getString());
--- 350,360 ----
  }
  /** PrintEnumInstanceNameHref - Put out a link to the enumerate
  instance Names function for this class.
  @return - void
  */
! void PrintEnumInstanceNameHref(const CIMNamespaceName & nameSpace,
      const CIMName & className)
  {
      String href = BuildOperationHref("EnumerateInstanceNames",
          EncodeQueryStringValue(nameSpace.getString()));
      AppendHrefField(href,"ClassName",className.getString());
***************
*** 362,380 ****
      PrintAHref(href, "<BOLD Align=right>Instance Names</BOLD>");
 
  }
 
 
! static void PrintTableTrailer()
  {
      cout << "</table>\n";
  }
 
  /** PrintRow - Prints a single table row with 3 entires
      The entries are name, type, value
  */
! static void PrintRow(
      const CIMName& name,
      const String& type,
      const String& value)
  {
      cout << "<tr>\n";
--- 362,380 ----
      PrintAHref(href, "<BOLD Align=right>Instance Names</BOLD>");
 
  }
 
 
! void PrintTableTrailer()
  {
      cout << "</table>\n";
  }
 
  /** PrintRow - Prints a single table row with 3 entires
      The entries are name, type, value
  */
! void PrintRow(
      const CIMName& name,
      const String& type,
      const String& value)
  {
      cout << "<tr>\n";
***************
*** 387,397 ****
      cout << "<td>null</td>\n";
 
      cout << "<tr>\n";
  }
 
! static void PrintLogo()
  {
      cout << "<table border=2>\n";
      cout << "<tr>\n";
      cout <<
      "<td><img src=\"/pegasus/icons/OpenGroupLogo.gif\"></td>\n";
--- 387,397 ----
      cout << "<td>null</td>\n";
 
      cout << "<tr>\n";
  }
 
! void PrintLogo()
  {
      cout << "<table border=2>\n";
      cout << "<tr>\n";
      cout <<
      "<td><img src=\"/pegasus/icons/OpenGroupLogo.gif\"></td>\n";
***************
*** 719,729 ****
  ***************************************************************************/
 
  /** Function GetClass Peforms the getClass
      request and prints the result as an HTML page
  */
! static void GetClass(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
      DDD(cout << "GetClass" << endl;)
      // Get ClassName:
      const char* tmp;
--- 719,729 ----
  ***************************************************************************/
 
  /** Function GetClass Peforms the getClass
      request and prints the result as an HTML page
  */
! void GetClass(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
      DDD(cout << "GetClass" << endl;)
      // Get ClassName:
      const char* tmp;
***************
*** 782,792 ****
      the Get Class function to get properties for the getClass
      presentation. This function uses the getClass with the
      PropertyName parameter to find each property
      get the property and Print each property.
  */
! static void GetPropertyDeclaration(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
 
--- 782,792 ----
      the Get Class function to get properties for the getClass
      presentation. This function uses the getClass with the
      PropertyName parameter to find each property
      get the property and Print each property.
  */
! void GetPropertyDeclaration(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
 
***************
*** 841,851 ****
      ErrorExit(e.getMessage());
      }
  }
  /** PrintClassNames  - Generates a table with the class names
  */
! static void PrintClassNames(
      const CIMNamespaceName& nameSpace,
      const Array<CIMName>& classNames,
      double elapsedTime)
  {
      PrintHTMLHead("GetClassNames", "EnumerateClassNames Result");
--- 841,851 ----
      ErrorExit(e.getMessage());
      }
  }
  /** PrintClassNames  - Generates a table with the class names
  */
! void PrintClassNames(
      const CIMNamespaceName& nameSpace,
      const Array<CIMName>& classNames,
      double elapsedTime)
  {
      PrintHTMLHead("GetClassNames", "EnumerateClassNames Result");
***************
*** 885,895 ****
      EnumerateClassNames gets the parameters for NameSpace
      and ClassName and calls the  enumerate class name
      CIMOperation.
      The returned array in sent to printclassnames
  */
! static void EnumerateClassNames(const CGIQueryString& qs)
  {
      // Get NameSpace:
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
--- 885,895 ----
      EnumerateClassNames gets the parameters for NameSpace
      and ClassName and calls the  enumerate class name
      CIMOperation.
      The returned array in sent to printclassnames
  */
! void EnumerateClassNames(const CGIQueryString& qs)
  {
      // Get NameSpace:
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
***************
*** 939,949 ****
     DeleteClass Function
  ***************************************************************************/
 
  /** DeleteClass - Deletes the class defined on input
  */
! static void DeleteClass(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
      const char* tmp;
--- 939,949 ----
     DeleteClass Function
  ***************************************************************************/
 
  /** DeleteClass - Deletes the class defined on input
  */
! void DeleteClass(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      // Get ClassName:
      const char* tmp;
***************
*** 1094,1104 ****
  /***************************************************************************
     EnumerateQualifiers Function
  ***************************************************************************/
  /* CIMMethod to execute the EnumerateQualifiers operation
  */
! static void EnumerateQualifiers(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      try
      {
--- 1094,1104 ----
  /***************************************************************************
     EnumerateQualifiers Function
  ***************************************************************************/
  /* CIMMethod to execute the EnumerateQualifiers operation
  */
! void EnumerateQualifiers(const CGIQueryString& qs)
  {
      CIMNamespaceName nameSpace = GetNameSpaceQueryField(qs);
 
      try
      {

===================================================================
Index: src/Pegasus/Security/UserManager/UserFileHandler.cpp

  - Use rand_r. Not sure where we should call srand, so leave it alone, this
    doesn't seem to be critical that we get good (statistically) random
    numbers.

===================================================================
RCS file: /cvs/MSB/pegasus/src/Pegasus/Security/UserManager/UserFileHandler.cpp,v
retrieving revision 1.9
diff -C5 -r1.9 UserFileHandler.cpp
*** src/Pegasus/Security/UserManager/UserFileHandler.cpp    23 Jul 2003 03:36:24 -0000    1.9
--- src/Pegasus/Security/UserManager/UserFileHandler.cpp    25 Jul 2003 13:17:28 -0000
***************
*** 74,84 ****
--- 74,89 ----
      // Generate a random number and get the salt
      //
      System::getCurrentTime( sec, milliSec );
 
      srand( (int) sec );
+ #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC
+     Unit32    seed;
+     randNum = rand_r(*seed);
+ #else
      randNum = rand();
+ #endif
 
      //
      // Make sure the random number generated is between 0-63.
      // refer to _SALT_STRING variable
      //
 

Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; IBM Corp.; The Open Group

Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.