Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 61110 Details for
Bug 121658
Complete new AC solution on Linux EM64T
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for building AC without RAC SDK
patch06-AC-ready.txt (text/plain), 221.97 KB, created by
Samson Wai
on 2007-03-16 11:08:51 EDT
(
hide
)
Description:
Patch for building AC without RAC SDK
Filename:
MIME Type:
Creator:
Samson Wai
Created:
2007-03-16 11:08:51 EDT
Size:
221.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp,v >retrieving revision 1.3 >diff -u -r1.3 NoRAtransportSupport.dsp >--- src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp 4 Apr 2006 18:29:41 -0000 1.3 >+++ src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp 16 Mar 2007 14:50:56 -0000 >@@ -43,7 +43,7 @@ > # PROP Ignore_Export_Lib 0 > # PROP Target_Dir "" > # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /YX /FD /c >-# ADD CPP /nologo /MT /W3 /GX /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "$(RAC_SDK_HOME)/include" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../RACommon" /I "../RASharedMemory" /I "../RASocket" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /c > # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > # ADD BASE RSC /l 0x409 /d "NDEBUG" >@@ -53,7 +53,7 @@ > # ADD BSC32 /nologo > LINK32=link.exe > # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib /nologo /dll /machine:I386 /def:".\TransportSupport.def" /out:"../../../bin/transportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"$(RAC_SDK_HOME)/lib" /libpath:"../../../lib" >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib /nologo /dll /machine:I386 /def:".\TransportSupport.def" /out:"../../../bin/transportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" > # SUBTRACT LINK32 /pdb:none > > !ELSEIF "$(CFG)" == "NoRAtransportSupport - Win32 Debug" >@@ -70,7 +70,7 @@ > # PROP Ignore_Export_Lib 0 > # PROP Target_Dir "" > # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /YX /FD /GZ /c >-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "$(RAC_SDK_HOME)/include" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../RACommon" /I "../RASharedMemory" /I "../RASocket" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /GZ /c > # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > # ADD BASE RSC /l 0x409 /d "_DEBUG" >@@ -80,7 +80,7 @@ > # ADD BSC32 /nologo > LINK32=link.exe > # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib /nologo /dll /debug /machine:I386 /def:".\TransportSupport.def" /out:"../../../bin/transportSupport.dll" /implib:"../../../lib/transportSupport.lib" /pdbtype:sept /libpath:"$(RAC_SDK_HOME)/lib" /libpath:"../../../lib" >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib /nologo /dll /debug /machine:I386 /def:".\TransportSupport.def" /out:"../../../bin/transportSupport.dll" /implib:"../../../lib/transportSupport.lib" /pdbtype:sept /libpath:"../../../lib" > # SUBTRACT LINK32 /pdb:none > > !ENDIF >Index: src-native-new/src/transport/transportSupport/TransportSupport.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupport.make,v >retrieving revision 1.8 >diff -u -r1.8 TransportSupport.make >--- src-native-new/src/transport/transportSupport/TransportSupport.make 3 Apr 2006 11:09:08 -0000 1.8 >+++ src-native-new/src/transport/transportSupport/TransportSupport.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${JAVA_HOME}/include ${JAVA_HOME}/include/linux >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include ${JAVA_HOME}/include ${JAVA_HOME}/include/linux > > > #----------------------------------- >@@ -64,7 +64,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../../lib >+LIBDIRS := ../../../lib > > > #----------------------------------- >@@ -93,11 +93,11 @@ > # shared memory system settings for max value (Bug 129276). It compiled fine > # after removing -fPIC option from CFLAGS list. This option is required for EM64T > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) $(USE_FPIC_OPTION) $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) $(USE_FPIC_OPTION) $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/transportSupport/TransportSupportSharedMem.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupportSharedMem.c,v >retrieving revision 1.13 >diff -u -r1.13 TransportSupportSharedMem.c >--- src-native-new/src/transport/transportSupport/TransportSupportSharedMem.c 8 May 2006 18:56:10 -0000 1.13 >+++ src-native-new/src/transport/transportSupport/TransportSupportSharedMem.c 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 Intel Corporation. >+ * Copyright (c) 2005, 2007 Intel Corporation. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -33,7 +33,8 @@ > #include <linux/unistd.h> > #include <linux/types.h> > #include <linux/sysctl.h> >- _syscall1(int, _sysctl, struct __sysctl_args *, args); >+ #include <sys/syscall.h> >+ #include <unistd.h> > #else > #endif > >@@ -105,7 +106,7 @@ > size_t shmmaxlen = sizeof(int); > struct __sysctl_args args = { name, sizeof(name), &shmmax, &shmmaxlen, 0, 0 }; > >- rc = _sysctl(&args); >+ rc = syscall(SYS__sysctl, &args); > if(rc || (shmmax == 0)) { > TPTP_LOG_ERROR_MSG("Cannot get system shared memory setting"); > shmmax = 33554432; // default for Linux systems >Index: src-native-new/src/transport/transportSupport/TransportSupport.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupport.mak64,v >retrieving revision 1.5 >diff -u -r1.5 TransportSupport.mak64 >--- src-native-new/src/transport/transportSupport/TransportSupport.mak64 20 May 2006 18:26:55 -0000 1.5 >+++ src-native-new/src/transport/transportSupport/TransportSupport.mak64 16 Mar 2007 14:50:56 -0000 >@@ -72,10 +72,10 @@ > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I ../RACommon /I ../RASharedMemory /I ../RASocket /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -87,8 +87,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" >+ "..\..\..\hcclco.lib" \ >+ "..\..\..\hcclsm.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -139,10 +139,10 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MD /W3 /O2 /I ../RACommon /I ../RASharedMemory /I ../RASocket /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:IA64 >+LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -154,8 +154,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" >+ "..\..\..\hcclsm.lib" \ >+ "..\..\..\hcclco.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -205,10 +205,9 @@ > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:AMD64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -220,8 +219,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" >+ "..\..\..\hcclco.lib" \ >+ "..\..\..\hcclsm.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -272,10 +271,10 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MD /W3 /O2 /I ../RACommon /I ../RASharedMemory /I ../RASocket /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:AMD64 >+LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -287,8 +286,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" >+ "..\..\..\hcclsm.lib" \ >+ "..\..\..\hcclco.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >Index: src-native-new/src/transport/RACommon/RAComm.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RAComm.h,v >retrieving revision 1.10 >diff -u -r1.10 RAComm.h >--- src-native-new/src/transport/RACommon/RAComm.h 4 May 2006 02:47:35 -0000 1.10 >+++ src-native-new/src/transport/RACommon/RAComm.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,51 +10,11 @@ > * IBM - Initial API and implementation > **********************************************************************/ > >-#ifndef _ACRACOMM_H_ >-#define _ACRACOMM_H_ >+#ifndef _RACOMM_H_ >+#define _RACOMM_H_ > >-#include "tptp/TPTPTypes.h" >-/* Provide unified string access methods across all platforms. */ >-#if defined(__cplusplus) && (defined(_HPUX) || defined(__powerpc64__)) >- #define ENV(e) e >- #define ENVPARM(e) >- #define ENVPARM1(e) >-#else >- #define ENV(e) (*e) >- #define ENVPARM(e) e, >- #define ENVPARM1(e) e >-#endif >- >- >-/** >- * Platform specific includes. >- */ >-#ifdef _WIN32 /* Win32 */ >- #include <winsock2.h> >- #include <windows.h> >- #include <winbase.h> >-#else /* else */ >- #include <pthread.h> >- #include <arpa/inet.h> >- #if defined(__OS400__) || defined(MVS) >- #include <stdlib.h> >- #ifdef MVS >- /* 228721 - for 390, strings.h is needed to define bzero() */ >- #include <strings.h> >- #endif >- /* 190770 - for 390, including string.h causes run-time >- library functions to be inlined to improve performance */ >- #include <string.h> >- #else >- #include <strings.h> >- #endif >-#endif >- >-#ifdef _HPUX >- #include <string.h> >- #include <malloc.h> >- #include <unistd.h> >-#endif >+#include "RATypes.h" >+#include "java.h" > > /* Mutex */ > #ifdef _WIN32 >@@ -63,59 +23,80 @@ > #define ra_critsec_t pthread_mutex_t > #endif > >-/** >- * Macros/typedefs to ease the readability of multiplatform code. >- */ >+/* Macros for shared library */ >+#ifdef _WIN32 >+ #define MODULE_REFERENCE HMODULE >+ #define DLL_REFERENCE HINSTANCE >+ #define RESOLVE_MODULE(name) GetModuleHandle(name) >+ #define LOAD_LIBRARY(name) LoadLibrary(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) GetProcAddress(mod, entry) >+ #ifndef CDECL >+ #define CDECL __cdecl >+ #endif >+#elif MVS >+ #include <dll.h> >+ #define MODULE_REFERENCE dllhandle * >+ #define DLL_REFERENCE dllhandle * >+ #define RESOLVE_MODULE(name) dllload(name) >+ #define LOAD_LIBRARY(name) dllload(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dllqueryfn(mod, entry) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#elif _HPUX >+ #include <dlfcn.h> >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define RESOLVE_MODULE(name) dlopen(name, RTLD_LAZY) >+ #define LOAD_LIBRARY(name) dlopen(name, RTLD_LAZY) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dlsym(mod, entry) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#elif __OS400__ >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define RESOLVE_MODULE(name) loadServicePgm(name) >+ #define LOAD_LIBRARY(name) loadServicePgm(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) findServicePgmEntry(mod, entry) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#else >+ #include <dlfcn.h> >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define RESOLVE_MODULE(name) dlopen(name, RTLD_LAZY) >+ #define LOAD_LIBRARY(name) dlopen(name, RTLD_LAZY) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dlsym(mod, entry) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#endif >+ >+/* Macros to ease the readability of multiplatform code */ > #ifdef _WIN32 /* Win32 */ >- #define BZERO(mem, len) ZeroMemory(mem,len) >- #define SLEEP(millisec) Sleep(millisec) >- #define STRDUP(dest, src) dest=strdup(src) >- #define PATH_SEPARATOR ';' >- #define FILE_SEPARATOR '\\' >- typedef DWORD TID; >-/* typedef DWORD PID;*/ /* moved to TPTPTypes.h */ >- typedef HANDLE RA_HANDLE; >- #define RA_HANDLE_NULL NULL >- #define CLOSE_RA_HANDLE(handle) CloseHandle(handle) >+ #define BZERO(mem, len) ZeroMemory(mem,len) >+ #define SLEEP(millisec) Sleep(millisec) >+ #define STRDUP(dest, src) dest=strdup(src) >+ #define RA_HANDLE_NULL NULL >+ #define CLOSE_RA_HANDLE(handle) CloseHandle(handle) > #else /* else */ >- #define _MAX_PATH 256 /* This is already defined on Windows */ >- #if defined (__OS400__) >- #define BZERO(mem, len) memset(mem, '\0', len) >- #define STRDUP(dest, src) dest=(char*)malloc(strlen(src)+1); BZERO(dest, strlen(src)+1); strcpy(dest, src) /* 236501 */ >- #elif defined (_HPUX) >- #define BZERO(mem, len) memset(mem, '\0', len) >- #define STRDUP(dest, src) dest=strdup(src) >- #else >- #define BZERO(mem, len) bzero(mem,len) >- #define STRDUP(dest, src) dest=strdup(src) >- #endif >- #define SLEEP(millisec) sleep(millisec/1000) >- #define PATH_SEPARATOR ':' >- #define FILE_SEPARATOR '/' >- typedef int SOCKET; >- typedef int HANDLE; >- typedef int RA_HANDLE; >- #define RA_HANDLE_NULL 0 >- #define CLOSE_RA_HANDLE(handle) close(handle) >- #define WINAPI " " >- typedef pthread_t TID; >-/* typedef unsigned long PID; 179338 */ >-/* typedef pid_t PID; */ /* 179338 */ /* moved to TPTPTypes.h */ >- #ifdef FALSE >- #undef FALSE >- #endif >- #ifdef TRUE >- #undef TRUE >- #endif >- /* Unfortunately, the Solaris C++ compiler doesn't like >- the version that all the other compilers like >- */ >- #if defined _SOLARIS && defined __cplusplus >- typedef enum BOOL {FALSE, TRUE}; >- #else >- enum _BOOL {FALSE, TRUE}; >- typedef enum _BOOL BOOL; >- #endif >+ #define _MAX_PATH 256 /* This is already defined on Windows */ >+ #if defined (__OS400__) >+ #define BZERO(mem, len) memset(mem, '\0', len) >+ #define STRDUP(dest, src) dest=(char*)malloc(strlen(src)+1); BZERO(dest, strlen(src)+1); strcpy(dest, src) /* 236501 */ >+ #elif defined (_HPUX) >+ #define BZERO(mem, len) memset(mem, '\0', len) >+ #define STRDUP(dest, src) dest=strdup(src) >+ #else >+ #define BZERO(mem, len) bzero(mem,len) >+ #define STRDUP(dest, src) dest=strdup(src) >+ #endif >+ #define SLEEP(millisec) sleep(millisec/1000) >+ #define RA_HANDLE_NULL 0 >+ #define CLOSE_RA_HANDLE(handle) close(handle) >+ #define WINAPI " " > #endif > > >@@ -128,33 +109,6 @@ > #define RA_PIPE_NAMESPACE_SHORT "/tmp/IBMRAC" > #endif > >-/** >- * Remoteable Agent Data Types >- */ >-#ifdef __powerpc64__ /* long is 8 bytes, int is 4 bytes in size on PPC64 */ >- typedef unsigned int ra_uint_t; >- typedef signed int ra_int_t; >-#else >- typedef unsigned long ra_uint_t; >- typedef signed long ra_int_t; >-#endif >- >-typedef struct { >- ra_uint_t length; >- char *data; >-}ra_string_t; >- >-typedef struct { >- ra_uint_t length; >- void **data; >-}ra_array_t; >- >- >-typedef struct { >- ra_string_t type; >- ra_string_t name; >- ra_string_t value; >-}ra_agentConfigEntry_t; > > /** > * GENERAL PROTOCOL FORMAT: >@@ -170,255 +124,6 @@ > > > >-/* The structure of a COMMAND */ >-typedef struct { >- ra_uint_t tag; /* COMMAND_ID */ >- union { >- struct { >- ra_string_t user; >- ra_string_t passwd; >- }authenticate; /* AUTHENTICATE */ >- >- struct { >- ra_string_t key; >- }authenticate_successful; /* AUTHENTICATION_SUCCESSFUL */ >- >- struct { >- ra_uint_t ticket; >- }authenticate_failed; /* AUTHENTICATION_FAILED */ >- >- >- struct { >- ra_uint_t flag; >- ra_uint_t securePort; >- }serverSecurityRequirements; /* RA_SERVER_SECURITY_REQUIREMENTS */ >- >- struct { >- ra_uint_t context; >- ra_uint_t consoleIP; >- ra_uint_t consolePort; >- ra_string_t executable; >- ra_string_t arguments; >- ra_string_t location; >- ra_array_t environment; >- ra_array_t agents; >- }launch_process; /* LAUNCH_PROCESS*/ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t processUUID; >- ra_string_t executable; >- ra_string_t arguments; >- ra_array_t environment; >- }process_launched; /* PROCESS_LAUNCHED */ >- >- struct { >- ra_uint_t context; >- }query_process_list; /* QUERY_PROCESS_LIST */ >- >- struct { >- ra_uint_t context; >- ra_array_t processes; >- }registered_process_list; /* REGISTERED_PROCESS_LIST */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- }query_agent_list, /* QUERY_AGENT_LIST */ >- kill_process, /* KILL_PROCESS */ >- process_exited; /* PROCESS_EXITED */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t executable; >- ra_array_t agents; >- }registered_agents_list; /* REGISTERED_AGENTS_LIST */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- }register_agent_notification, /* REGISTER_AGENT_NOTIFICATION */ >- query_agent_details; /* QUERY_AGENT_DETAILS */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- }attach, /* ATTACH */ >- detach, /* DETACH */ >- stop_monitor, /* STOP MONITOR */ >- agent_query_state, /* AGENT_QUERY_ATTACHED */ /* Bug 54376 */ >- agent_state; /* AGENT_ATTACHED, AGENT_DETACHED */ /* Bug 54376 */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_uint_t ip; >- ra_uint_t port; >- }start_monitor_remote; /* START_MONITOR_REMOTE */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_string_t file; >- }start_monitor_local; /* START_MONITOR_LOCAL */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_string_t type; >- ra_string_t name; >- ra_string_t value; >- }set_nv_pair; /* SET_NV_PAIR */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_string_t message; >- }custom_command; /* CUSTOM_COMMAND */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_uint_t severity; >- ra_string_t messageId; >- ra_string_t message; >- }error_string; /* ERROR_STRING */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t processUUID; >- ra_string_t agent; >- ra_string_t agentUUID; >- ra_string_t agentType; >- }agent_active, /* AGENT_ACTIVE */ >- agent_inactive, /* AGENT_INACTIVE */ >- agent_details; /* AGENT_DETAILS */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >-/* BEGIN: 235649 */ >-#if defined __linux__ >- ra_uint_t messageProcessId; >-#endif >-/* END: 235649 */ >- ra_string_t processUUID; >- ra_string_t agent; >- ra_string_t agentUUID; >- ra_string_t agentType; >- ra_string_t nodeUUID; >- }agent_scoping_information; /* AGENT_SCOPING_INFORMATION */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t processUUID; >- ra_string_t agent; >- ra_string_t agentUUID; >- ra_string_t agentType; >- ra_string_t nodeUUID; >- ra_array_t configuration; >- }agent_configuration; /* AGENT_CONFIGURATION */ >- >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_string_t node; >- ra_uint_t peerProcessId; >- ra_string_t peerAgent; >- ra_string_t peerNode; >- }agent_request_monitor, /* AGENT_REQUEST_ATTACH */ >- controller_request_monitor, /* CONTROLLER_REQUEST_MONITOR */ >- peer_unreachable; /* PEER_UNREACHABLE */ >- >- /* Bug 77768 begins */ >- struct { >- ra_uint_t context; >- ra_uint_t processId; >- ra_string_t agent; >- ra_string_t node; >- ra_uint_t peerProcessId; >- ra_string_t peerAgent; >- ra_string_t peerNode; >- ra_uint_t port; /* Bug 77768 */ >- ra_uint_t peerPort; /* Bug 77768 */ >- }agent_request_monitor_port, /* AGENT_REQUEST_ATTACH */ >- controller_request_monitor_port; /* CONTROLLER_REQUEST_MONITOR */ >- /* Bug 77768 ends */ >- >- struct { >- ra_uint_t context; >- ra_string_t name; >- ra_string_t type; >- ra_string_t agentUUID; >- } query_property_list; /* GET_PROPERTY_LIST */ >- >- struct { >- ra_uint_t context; >- ra_array_t entries; >- } property_list; /* PROPERTY_LIST */ >- >-/** FILE MANAGEMENT STRUCTURES FOR TRANSFERRING HEADPDUMP FILES >- * Modified by Giridhar.S on 11/4/04*/ >- >- struct { >- ra_uint_t context; >- ra_uint_t operation; >- ra_string_t filename; /* MANAGE_FILE */ >- }manage_file; >- >- struct { >- ra_uint_t context; >- ra_uint_t port; >- ra_string_t jobKey; >- }resource_location; >- >-/** END OF MODIFICATIONS TO RACOMM.H **/ >- >- ra_string_t agentName; >- >- }info; >-} ra_command_t; >- >- >-typedef struct _command_entry_node { >- ra_command_t *command; >- struct _command_entry_node *next; >- struct _command_entry_node *previous; >-}ra_command_list_node_t; >- >-typedef struct { >- ra_command_list_node_t *head; >- ra_command_list_node_t *tail; >- ra_uint_t count; >-}ra_command_list_t; >- >- >-typedef struct { >- ra_uint_t type; >- ra_uint_t ticket; >- ra_uint_t length; >- ra_string_t key; >- ra_command_list_t commands; >-}ra_message_t; >- >- >-/* Define an element to be manipulated atomicly */ >-#ifndef _AIX >-typedef int *atomic_p; >-#endif >- > > /* The various COMMAND_ID's types from the client (server targeted flows) */ > #define RA_AUTHENTICATE 0x00000001 >Index: src-native-new/src/transport/RACommon/RATypes.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RATypes.h,v >retrieving revision 1.1 >diff -u -r1.1 RATypes.h >--- src-native-new/src/transport/RACommon/RATypes.h 2 May 2006 17:41:43 -0000 1.1 >+++ src-native-new/src/transport/RACommon/RATypes.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RACommon/RAError.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RAError.h,v >retrieving revision 1.2 >diff -u -r1.2 RAError.h >--- src-native-new/src/transport/RACommon/RAError.h 24 Jul 2005 08:32:09 -0000 1.2 >+++ src-native-new/src/transport/RACommon/RAError.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RACommon/RACommon.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RACommon.make,v >retrieving revision 1.5 >diff -u -r1.5 RACommon.make >--- src-native-new/src/transport/RACommon/RACommon.make 1 Apr 2006 03:17:38 -0000 1.5 >+++ src-native-new/src/transport/RACommon/RACommon.make 16 Mar 2007 14:50:56 -0000 >@@ -22,7 +22,7 @@ > # > #----------------------------------- > TARGET := libhcclco >-TARGETDIR := $(RAC_SDK_HOME)/lib >+TARGETDIR := ../../../lib > > if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi > if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := . ../../../include ../RASharedMemory >+INCLUDEDIRS := . ../../../include ../RASharedMemory $(JAVA_HOME)/include $(JAVA_HOME)/include/linux > > > #----------------------------------- >@@ -50,7 +50,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := $(RAC_SDK_HOME)/lib ../../../lib >+LIBDIRS := ../../../lib > > > #----------------------------------- >@@ -74,11 +74,11 @@ > > DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/RACommon/RACommon.def >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RACommon.def,v >retrieving revision 1.5 >diff -u -r1.5 RACommon.def >--- src-native-new/src/transport/RACommon/RACommon.def 3 May 2006 21:06:48 -0000 1.5 >+++ src-native-new/src/transport/RACommon/RACommon.def 16 Mar 2007 14:50:56 -0000 >@@ -36,7 +36,18 @@ > ra_readFromNamedPipe @33 > ra_writeToNamedPipe @34 > disableAllSecurityOfKernalObject @35 >+ fndclsid @36 >+ getnewstrutf @37 >+ getmthdid @38 > ra_getEnvironmentVariable @39 > isProcessAlive @40 > native2unicode @41 > unicode2native @42 >+ copyJavaStringToNative @43 >+ ra_createJavaVitualMachine @44 >+ ra_submitJavaJob @45 >+ ra_destroyJavaVirtualMachine @46 >+ ra_isJvmCreated @47 >+ ra_getJvm @48 >+ ra_createJavaVitualMachineWithClasspath @49 >+ ra_submitJavaJobReuseJVMThread @50 >Index: src-native-new/src/transport/RACommon/RAComm.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RAComm.c,v >retrieving revision 1.11 >diff -u -r1.11 RAComm.c >--- src-native-new/src/transport/RACommon/RAComm.c 3 May 2006 13:41:00 -0000 1.11 >+++ src-native-new/src/transport/RACommon/RAComm.c 16 Mar 2007 14:50:55 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -101,7 +101,7 @@ > pthread_mutex_t _cas_mutex=PTHREAD_MUTEX_INITIALIZER; > #endif > >-#ifdef _DEBUG >+#ifdef _DEBUG2 > #include <stdio.h> > #endif > >@@ -117,6 +117,9 @@ > /** > * Function prototypes > */ >+static BOOL validateControlMessage(unsigned char *msg, >+ int length); >+ > > static unsigned char* copyRAUINTToBuffer(unsigned char *buffer, > ra_uint_t uintData) { >@@ -145,7 +148,7 @@ > ra_uint_t nativeLen = 0; > char* utf8Buffer = 0; > char* nativeBuffer = 0; >-#if _DEBUG >+#if _DEBUG2 > char* dbgBuffer = 0; > #endif > >@@ -174,7 +177,7 @@ > copyRAUINTToBuffer(buffer, 0); > } > >-#if _DEBUG >+#if _DEBUG2 > dbgBuffer = (char*)ra_malloc(sizeof(char*) * (utf8Len + 1)); > memcpy(dbgBuffer, utf8Buffer, utf8Len); > dbgBuffer[utf8Len] = '\0'; >@@ -241,7 +244,7 @@ > newString->length = 0; > } > >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: (UTF8->Native) \"%s\" -> \"%s\"\n", utf8Buffer, newString->data); > #endif > >@@ -1834,7 +1837,7 @@ > getout: > } > #else >-/* This code needs to be tested. >+/* This code crashes piAgent! > int *old; > old = (int *)InterlockedCompareExchange( (PLONG)addr, (LONG)oldval_addr, (LONG)&newval ) ; > return ( *old == newval ) ; >@@ -2374,20 +2377,37 @@ > return *bytesWritten; > #else > int result; >- ssize_t byte; >- byte=write(handle, (unsigned char*)buffer+offset, length-offset); >- if(byte==0) { >- result=0; >- *bytesWritten=0; >- } >- else if(byte<0) { >- result=-1; >- *bytesWritten=0; >+ /* Bug 146962 begins */ >+ int start; >+ int bytesWrittenSoFar = 0; >+ int retry = 10; >+ >+ do { >+ int written; >+ start = offset + bytesWrittenSoFar; >+ written = write(handle, (unsigned char*)buffer + start, length - start); >+ if(written > 0) { >+ bytesWrittenSoFar += written; >+ } >+ if(bytesWrittenSoFar < length - offset) { >+ SLEEP(500); >+ } >+ } while((bytesWrittenSoFar < length - offset) && (retry-- > 0)); >+ >+ if(bytesWrittenSoFar == 0) { >+ result = 0; >+ *bytesWritten = 0; >+ } >+ else if(bytesWrittenSoFar < 0) { >+ result = -1; >+ *bytesWritten = 0; > } > else { >- result=1; >- *bytesWritten=byte; >+ result = 1; >+ *bytesWritten = bytesWrittenSoFar; > } >+ /* Bug 146962 ends */ >+ > return result; > #endif > } >@@ -2885,13 +2905,13 @@ > size_t convLen; /* return value from iconv() */ > size_t tempLen; /* Length of the allocated output buffer, will actually be the numnber of bytes left in the buffer */ > size_t inLen_copy; /* a copy of the length of the input buffer */ >-#if _DEBUG >+#if _DEBUG2 > int i; > #endif > > setlocale(LC_CTYPE, ""); > cd = iconv_open(to_cp, from_cp); /* to, from */ >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: CP(%s) -> CP(%s)\n", from_cp, to_cp); > #endif > >@@ -2900,7 +2920,7 @@ > #else > if(cd == (iconv_t)-1) { > #endif >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: Error calling iconv_open()\n"); > #endif > *out = 0; /* Bug 80588 */ >@@ -2911,7 +2931,7 @@ > inBuf_copy = (char*)ra_malloc(sizeof(char) * inLen_copy); /* make a copy of the input buffer */ > memcpy(inBuf_copy, in, size_in); > inBuf_start = inBuf_copy; /* mark the start of the input buffer */ >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: inLen_copy = %d\n", inLen_copy); > printf("DEBUG: inBuf_copy = "); > for(i = 0; i < inLen_copy; i++) { >@@ -2926,7 +2946,7 @@ > tempBuf_start = tempBuf; /* mark the beginning of the output buffer */ > convLen = iconv(cd, &inBuf_copy, &inLen_copy, &tempBuf, &tempLen); /* perform the conversion */ > if(convLen == -1) { >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: Error running iconv(), errno = %d\n", errno); > switch(errno) { > case EILSEQ: >@@ -2943,7 +2963,7 @@ > *out = 0; /* Bug 80588 */ > return 0; /* return 0 if it fails */ > } >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: Bytes left(tempLen) = %d\n", tempLen); > printf("DEBUG: Output buffer(tempBuf_start) = "); > for(i = 0; i < outLen - tempLen; i++) { >@@ -2955,7 +2975,7 @@ > *out = (char*)ra_malloc(sizeof(char) * (outLen - tempLen + 1)); /* create the output buffer with the actual size, adding a null */ > BZERO(*out, outLen - tempLen + 1); > memcpy(*out, tempBuf_start, outLen - tempLen); /* copy the contents from the temp buffer */ >-#if _DEBUG >+#if _DEBUG2 > printf("DEBUG: Copied buffer(out)\n"); > printf("DEBUG: Output buffer size = %d\n", outLen - tempLen); > #endif >Index: src-native-new/src/transport/RACommon/RACommon.dsp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RACommon.dsp,v >retrieving revision 1.6 >diff -u -r1.6 RACommon.dsp >--- src-native-new/src/transport/RACommon/RACommon.dsp 4 May 2006 20:28:56 -0000 1.6 >+++ src-native-new/src/transport/RACommon/RACommon.dsp 16 Mar 2007 14:50:56 -0000 >@@ -114,6 +114,18 @@ > # End Source File > # Begin Source File > >+SOURCE=..\RACommon\java.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RACommon\java.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RACommon\RATypes.h >+# End Source File >+# Begin Source File >+ > SOURCE=..\RACommon\resource.h > # End Source File > # End Group >Index: src-native-new/src/transport/RACommon/resource.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/resource.h,v >retrieving revision 1.4 >diff -u -r1.4 resource.h >--- src-native-new/src/transport/RACommon/resource.h 4 Apr 2006 22:14:59 -0000 1.4 >+++ src-native-new/src/transport/RACommon/resource.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005,2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/CmdExtractor/CmdExtractor.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/CmdExtractor/CmdExtractor.make,v >retrieving revision 1.4 >diff -u -r1.4 CmdExtractor.make >--- src-native-new/src/CmdExtractor/CmdExtractor.make 1 Apr 2006 03:37:22 -0000 1.4 >+++ src-native-new/src/CmdExtractor/CmdExtractor.make 16 Mar 2007 14:50:55 -0000 >@@ -38,7 +38,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -73,11 +73,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/javaBaseAgent/JavaBaseAgent.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/javaBaseAgent/JavaBaseAgent.make,v >retrieving revision 1.7 >diff -u -r1.7 JavaBaseAgent.make >--- src-native-new/src/javaBaseAgent/JavaBaseAgent.make 1 Apr 2006 03:19:03 -0000 1.7 >+++ src-native-new/src/javaBaseAgent/JavaBaseAgent.make 16 Mar 2007 14:50:55 -0000 >@@ -25,7 +25,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux > > > #----------------------------------- >@@ -60,11 +60,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > #----------------------------------- > # general commands and options >Index: src-native-new/src/transport/RASharedMemory/ossdebug.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossdebug.h,v >retrieving revision 1.3 >diff -u -r1.3 ossdebug.h >--- src-native-new/src/transport/RASharedMemory/ossdebug.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossdebug.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossatomictype.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossatomictype.h,v >retrieving revision 1.5 >diff -u -r1.5 ossatomictype.h >--- src-native-new/src/transport/RASharedMemory/ossatomictype.h 28 Apr 2006 23:45:31 -0000 1.5 >+++ src-native-new/src/transport/RASharedMemory/ossatomictype.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossramboflush.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossramboflush.cpp,v >retrieving revision 1.4 >diff -u -r1.4 ossramboflush.cpp >--- src-native-new/src/transport/RASharedMemory/ossramboflush.cpp 8 Aug 2005 19:31:59 -0000 1.4 >+++ src-native-new/src/transport/RASharedMemory/ossramboflush.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -49,7 +49,9 @@ > 216026 Jul/23/2002 dns Added check for writers before detaching from shm buffer > 230611 Nov/19/2002 dns set numUsedSlots correctly when chunk is full > 232468 Nov/19/2002 dns added code to handle case when continueDataSize > dataLengh >- Last Changed = 02/12/12 12:15:11 >+ 94473 Jun/10/2005 dns increased the wait before stopping flushing because >+ nobody else is attached to shm >+ Last Changed = 05/06/10 12:15:11 > > *******************************************************************************/ > >@@ -62,7 +64,7 @@ > #ifdef SQLWINT > #include <limits.h> > #include <io.h> >-#include <winsock.h> >+#include <winsock2.h> /* 134924 */ > #else > #ifdef OSS_DEBUG > #include <errno.h> /* 198075 */ >@@ -76,6 +78,7 @@ > #include <unistd.h> > #endif > >+#include <jni.h> > > /* MACRO's to simplify the JNI code. */ > #if defined __cplusplus >@@ -227,7 +230,7 @@ > } > } > } >- /* Write data to file */ >+ /* Write data to file */ > else { > bytesWritten = write( fileDescriptor, (char *)*pcontinueBuffer, totalRecordSize ) ; > if ( (ssize_t)-1 == bytesWritten ) >@@ -285,7 +288,7 @@ > /* If the whole record doesn't fit in this buffer then allocate a temporary > buffer for the record and copy the part that is included in this buffer > into the temp bufer*/ >- if (offset + OSS_RAMBO_DATA_HEADER_SIZE + recordLength >= dataLength) { >+ if (offset + OSS_RAMBO_DATA_HEADER_SIZE + recordLength > dataLength) { > > continueDataSize = offset + OSS_RAMBO_DATA_HEADER_SIZE + recordLength - dataLength; > bFlushLen = dataLength - offset; >@@ -827,6 +830,7 @@ > Uint32 slotIndex = 0 ; > Uint32 loopIndex = 0 ; > Uint32 timedOut = 0 ; >+ Uint32 attachCheckIndex = 0 ; /* bugzilla 94473 */ > int flushDataLen; > OSSRamboCB * pRamboCB ; > OSSRamboChunkCB * pChunkCB = NULL ; >@@ -944,15 +948,18 @@ > > loopIndex = 0; > timedOut = 0; >+ attachCheckIndex = 0; /* 94473 */ > /* Wait until the chunk is full or we have been asked to stop or we have waited too long */ > for ( ; ; ) > { >+ /* If flushing is to be stopped then set the stopping flag and quit the loop */ > if ( pRamboCB->l2.h2.status & OSS_RAMBO_AUTOF_STOP_NOW ) > { > stopping = true ; > break ; > } > >+ /* If the chunk is full then quit the loop so it can be flushed. */ > if ( ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0 ) > { > #ifdef OSS_DEBUG1 >@@ -962,7 +969,9 @@ > #endif > break ; > } >+ /* Else If we have looped too long */ > else if (loopIndex == 100) { >+ /* If there is any data in the chunk Then quit the loop to flush it */ > if ((ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) - ossAtomicPeek(&pChunkCB->flushedCount) > 0 || > (ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0)) { > timedOut = 1; >@@ -973,12 +982,16 @@ > break ; > } > /* 205955 begin */ >+ /* Else get the attach count to see if anyone else is attached */ > else { > int attcnt = 0; > OSSErr osserr = OSS_OK ; > osserr = ossIPCMemAttachCount( pRambo->ipcMemHandle, &attcnt ) ; >- /* If nobody is attached to the shared memory except for us then stop flushing */ >- if ( osserr == OSS_OK && attcnt == 1 ) >+ attachCheckIndex++; /* bugzilla 94473 */ >+ /* If nobody is attached to the shared memory except for us then stop flushing >+ * bugzilla 94473 - only stop flushing if we have gone through the wait loop four >+ * times to provide more time for the agent to attach to it (4 seconds instead of 1). */ >+ if ( osserr == OSS_OK && attcnt == 1 && attachCheckIndex >= 4) > { > /* set the user count to 1 so the shared memory gets deleted when it is destroyed */ > ossIPCMemSetUserCount( pRambo->ipcMemHandle, attcnt ) ; >@@ -1505,6 +1518,195 @@ > } > > >+/******************************************************************************* >+ >+ Function Name >+ dataToStrProcessor >+ >+ Function >+ Processes data from a RAMBO buffer and writes it out a java OutputStream >+ >+ Inputs >+ pTraceData - addr of trace data to process >+ dataLength - length of data to process >+ continueDataSize - size of data at the start of the buffer to send without processing because it is the remainder of a record >+ jenv - Java environment >+ jobj - Java OutputStream object >+ jmethod - the OutputStream write method ID >+ >+ Normal Return >+ returns size of last part of the data record that did not fit in this buffer >+ >+ Error Return >+ -1 >+**********************************************************************************/ >+ >+int dataToStrProcessor( >+ void *pTraceData, >+ int dataLength, >+ int continueDataSize, /* size of end of msg from previous buffer to send */ >+ JNIEnv *jenv, /* Java environemnt */ >+ jobject jobj, /* OutputStream object */ >+ jmethodID jmethod ) { /* write method ID */ >+ >+ char *pFlushData; >+ Uint32 recordLength; >+ int offset = 0; >+ int endOffset = dataLength - OSS_RAMBO_DATA_HEADER_SIZE; >+ int flushLen; /* length of data to flush to file descriptor */ >+ int bFlushLen; /* length of data to flush from buffer (includes rambo data header length) */ >+ >+#ifdef OSS_DEBUG >+ ra_logServiceMessage(__FILE__, __LINE__,RA_DEBUG,"dataProcessor: pTraceData=%p *pTraceData=%x/%x/%x/%x/%x contSize=%d\n", >+ pTraceData, (*(char *)pTraceData & 0x000000ff),(*((char *)pTraceData+1) & 0x000000ff), >+ (*((char *)pTraceData+2) & 0x000000ff), (*((char *)pTraceData+3) & 0x000000ff), >+ (*((char *)pTraceData+4) & 0x000000ff), continueDataSize); >+#endif >+ >+ /* If there was a record that started in the previous buffer but the buffer was not big >+ enough to contain the whole record, then the rest of the record is at the beginning >+ of this buffer so flush the remainder of the record. >+ */ >+ if (continueDataSize > 0) { >+ int conFlushLen; >+ >+ /* The remainder of the record may be bigger than the size of this buffer */ >+ if (continueDataSize > dataLength) { >+ /* Flush this whole buffer to the file or socket */ >+ conFlushLen = dataLength; >+ } >+ else { >+ /* Write the remaninder of the previous record out to the file or socket */ >+ conFlushLen = continueDataSize; >+ } >+ >+ /* Format the java input arguments */ >+ >+ /* Possible memory leak here if we create a new byte array every time >+ * - need to confirm this >+ */ >+ if(conFlushLen > 0) { >+ jbyteArray jbarr; >+ jthrowable jexc; >+ jbyte *tmpBuffer; >+ >+ jbarr = ENV(jenv)->NewByteArray(ENVPARM(jenv) conFlushLen); >+ if(jbarr == NULL) { >+ return -1; >+ } >+ >+ tmpBuffer = (signed char*)malloc(sizeof(signed char) * conFlushLen); >+ memcpy(tmpBuffer, (signed char*)pTraceData, sizeof(signed char) * conFlushLen); >+ >+ ENV(jenv)->SetByteArrayRegion(ENVPARM(jenv) jbarr, 0, conFlushLen, tmpBuffer); >+ >+ /* Write the data out to the java OutputStream */ >+ ENV(jenv)->CallVoidMethod(ENVPARM(jenv) jobj, jmethod, jbarr, 0, conFlushLen); >+ >+ /* Check for a java exception */ >+ jexc = ENV(jenv)->ExceptionOccurred(ENVPARM1(jenv)); >+ if(jexc) { >+ ENV(jenv)->ExceptionClear(ENVPARM1(jenv)); >+ } >+ >+// ENV(jenv)->ReleaseByteArrayElements(ENVPARM(jenv) jbarr, tmpBuffer, 0); >+ ENV(jenv)->DeleteLocalRef(ENVPARM(jenv) jbarr); >+ free(tmpBuffer); >+ >+ if(jexc) { >+ return -1; >+ } >+ } >+ >+ offset += OSS_RAMBO_ROUND_SLOT_SIZE( conFlushLen ); >+ continueDataSize -= conFlushLen; >+ } >+ >+ /* Process the data until we have reached the end of the buffer */ >+ while (offset < endOffset) { >+ >+#ifdef OSS_DEBUG >+ ra_logServiceMessage(__FILE__, __LINE__,RA_DEBUG,"dataProcessor: *pTraceData at offset %d =%x/%x/%x/%x %x/%x/%x/%x/%x\n", >+ offset, (*((char *)pTraceData+offset) & 0x000000ff),(*((char *)pTraceData+offset+1) & 0x000000ff), >+ (*((char *)pTraceData+offset+2) & 0x000000ff), (*((char *)pTraceData+offset+3) & 0x000000ff), >+ (*((char *)pTraceData+offset+4) & 0x000000ff), (*((char *)pTraceData+offset+5) & 0x000000ff), >+ (*((char *)pTraceData+offset+6) & 0x000000ff), (*((char *)pTraceData+offset+7) & 0x000000ff), >+ (*((char *)pTraceData+offset+8) & 0x000000ff)); >+#endif >+ >+ pFlushData = (char *)pTraceData + offset; >+ flushLen = 0; >+ bFlushLen = 0; >+ /* read the data length from the buffer */ >+ recordLength = *(Uint32 *)pFlushData; >+ >+ /* If the whole record doesn't fit in this buffer then flush what is included >+ in this buffer */ >+ if (offset + OSS_RAMBO_DATA_HEADER_SIZE + recordLength >= dataLength) { >+ continueDataSize = offset + OSS_RAMBO_DATA_HEADER_SIZE + recordLength - dataLength; >+ bFlushLen = dataLength - offset; >+#ifdef OSS_DEBUG >+ ra_logServiceMessage(__FILE__, __LINE__,RA_DEBUG,"dataProcessor: Reached end of buffer recordLength=%d bflushLen=%d pFlushData=%p\n", >+ recordLength, bFlushLen, pFlushData); >+#endif >+ } >+ /* Else the whole record is contained in this buffer so flush it */ >+ else { >+ bFlushLen = OSS_RAMBO_DATA_HEADER_SIZE + recordLength; >+ } >+ >+ flushLen = bFlushLen - OSS_RAMBO_DATA_HEADER_SIZE; >+ pFlushData = (char *)pFlushData + OSS_RAMBO_DATA_HEADER_SIZE; >+ >+#ifdef OSS_DEBUG >+ ra_logServiceMessage(__FILE__, __LINE__,RA_DEBUG,"dataProcessor: recordLength=%d flushLen=%d bFlushLen=%d pFlushData=%p", >+ recordLength, flushLen, bFlushLen, pFlushData); >+#endif >+ >+ /* Format the java input arguments */ >+ >+ /* Possible memory leak here if we create a new byte array every time >+ * - need to confirm this >+ */ >+ if(flushLen > 0) { >+ jbyteArray jbarr; >+ jthrowable jexc; >+ jbyte *tmpBuffer; >+ >+ jbarr = ENV(jenv)->NewByteArray(ENVPARM(jenv) flushLen); >+ if(jbarr == NULL) { >+ return -1; >+ } >+ >+ tmpBuffer = (signed char*)malloc(sizeof(signed char) * flushLen); >+ memcpy(tmpBuffer, (signed char*)pFlushData, sizeof(signed char) * flushLen); >+ >+ ENV(jenv)->SetByteArrayRegion(ENVPARM(jenv) jbarr, 0, flushLen, tmpBuffer); >+ >+ /* Write the data out to the java OutputStream */ >+ ENV(jenv)->CallVoidMethod(ENVPARM(jenv) jobj, jmethod, jbarr, 0, flushLen); >+ >+ /* Check for a java exception */ >+ jexc = ENV(jenv)->ExceptionOccurred(ENVPARM1(jenv)); >+ if(jexc) { >+ ENV(jenv)->ExceptionClear(ENVPARM1(jenv)); >+ } >+ >+// ENV(jenv)->ReleaseByteArrayElements(ENVPARM(jenv) jbarr, tmpBuffer, 0); >+ ENV(jenv)->DeleteLocalRef(ENVPARM(jenv) jbarr); >+ free(tmpBuffer); >+ >+ if(jexc) { >+ return -1; >+ } >+ } >+ >+ /* increase the offset by the number of slots that were flushed */ >+ offset += OSS_RAMBO_ROUND_SLOT_SIZE( bFlushLen ); >+ } >+ return continueDataSize; >+} >+ > > > /******************************************************************************* >@@ -1544,6 +1746,7 @@ > Uint32 chunkIndex = 0 ; > Uint32 slotIndex = 0 ; > Uint32 loopIndex = 0 ; >+ Uint32 attachCheckIndex = 0 ; /* bugzilla 94473 */ > Uint32 timedOut = 0 ; > int flushDataLen; > OSSRamboCB * pRamboCB ; >@@ -1661,9 +1864,11 @@ > > loopIndex = 0; > timedOut = 0; >+ attachCheckIndex = 0; /* 94473 */ > /* Wait until the chunk is full or we have been asked to stop or we have waited too long */ > for ( ; ; ) > { >+ /* If flushing is to be stopped then set the stopping flag and quit the loop */ > if ( pRamboCB->l2.h2.status & OSS_RAMBO_AUTOF_STOP_NOW ) > { > stopping = true ; >@@ -1673,6 +1878,7 @@ > break ; > } > >+ /* If the chunk is full then quit the loop so it can be flushed. */ > if ( ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0 ) > { > #ifdef OSS_DEBUG >@@ -1680,7 +1886,9 @@ > #endif > break ; > } >+ /* Else If we have looped too long */ > else if (loopIndex == 100) { >+ /* If there is any data in the chunk Then quit the loop to flush it */ > if ((ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) - ossAtomicPeek(&pChunkCB->flushedCount) > 0 || > (ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0)) { > timedOut = 1; >@@ -1690,6 +1898,7 @@ > break ; > } > /* 205955 begin */ >+ /* Else get the attach count to see if anyone else is attached */ > else { > int attcnt = 0; > OSSErr osserr = OSS_OK ; >@@ -1697,8 +1906,11 @@ > #ifdef OSS_DEBUG > ra_logServiceMessage(__FILE__, __LINE__,RA_DEBUG,"flushToFD: attach count = %d", attcnt); > #endif >- /* If nobody is attached to the shared memory except for us then stop flushing */ >- if ( osserr == OSS_OK && attcnt == 1 ) >+ attachCheckIndex++; /* bugzilla 94473 */ >+ /* If nobody is attached to the shared memory except for us then stop flushing >+ * bugzilla 94473 - only stop flushing if we have gone through the wait loop four >+ * times to provide more time for the agent to attach to it (4 seconds instead of 1). */ >+ if ( osserr == OSS_OK && attcnt == 1 && attachCheckIndex >= 4) > { > /* set the user count to 1 so the shared memory gets deleted when it is destroyed */ > ossIPCMemSetUserCount( pRambo->ipcMemHandle, attcnt ) ; >@@ -1905,26 +2117,26 @@ > goto errorProcessingFailed ; > } > >- /* Get a pointer to the chunk of memory */ >- pChunk = (void *)( (uintptr_t)pMemBuffer(pRamboCB) >- + ( chunkIndex * OSS_RAMBO_CHUNK_SIZE ) ) ; >- if (ossAtomicPeek(&pChunkCB->flushedCount) > 0) >- pChunk = (void *)((char *)pChunk + ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE); >- OSS_ASSERT( pChunk != NULL ) ; >- OSS_ASSERT( (uintptr_t)pChunk >= (uintptr_t)pMemBuffer(pRamboCB) ) ; >+ /* Get a pointer to the chunk of memory */ >+ pChunk = (void *)( (uintptr_t)pMemBuffer(pRamboCB) >+ + ( chunkIndex * OSS_RAMBO_CHUNK_SIZE ) ) ; >+ if (ossAtomicPeek(&pChunkCB->flushedCount) > 0) >+ pChunk = (void *)((char *)pChunk + ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE); >+ OSS_ASSERT( pChunk != NULL ) ; >+ OSS_ASSERT( (uintptr_t)pChunk >= (uintptr_t)pMemBuffer(pRamboCB) ) ; > >- /* Pass the chunk to the data processor, but only process the filled slots */ >+ /* Pass the chunk to the data processor, but only process the filled slots */ > >- err = dataProcessor( pChunk, numUsedSlots * OSS_RAMBO_SLOT_SIZE, continueDataSize, fileDescriptor, descriptorType ) ; >- if ( 0 > err ) { >+ err = dataProcessor( pChunk, numUsedSlots * OSS_RAMBO_SLOT_SIZE, continueDataSize, fileDescriptor, descriptorType ) ; >+ if ( 0 > err ) { > #ifdef OSS_DEBUG1 >- fprintf(dbgfd,"ossRamboFlushToFD: failed writing the chunk %d of shared memory. error=%d\n", chunkIndex, err ) ; >- fflush(dbgfd); >+ fprintf(dbgfd,"ossRamboFlushToFD: failed writing the chunk %d of shared memory. error=%d\n", chunkIndex, err ) ; >+ fflush(dbgfd); > #endif >- goto errorProcessingFailed ; >- } >- else >- continueDataSize = err; >+ goto errorProcessingFailed ; >+ } >+ else >+ continueDataSize = err; > > #ifdef OSS_DEBUG1 > fprintf(dbgfd,"Flushed unfilled chunk index %lu has fillCount %lu\n", >@@ -1982,98 +2194,624 @@ > /* 198075 end */ > > >- >- > /******************************************************************************* > >- Name >- ossRamboStopFlusherAndDetach >+ Function Name >+ ossRamboFlushToStream > > Function >- Tells flusher routine to stop flushing buffer and detach from buffer. >+ Flushes the RAMBO buffer to a Java Stream on a timed basis. It >+ does not wait for a chunk to be filled before flushing the data in it. > > Inputs > 1. pRambo >- Address of a RAMBO handle. >+ Address of a RAMBO buffer control block. >+ 2. outStrObj >+ java OutputStream object > >- Normal Return >+ Normal Returns > OSS_OK > >- Error Return >+ Error Returns > OSS_ERR_INVALID > OSS_ERR_RAMBO_NOT_INIT >+ OSS_ERR_RAMBO_AUTOFLUSHER_ENABLED >+ OSS_ERR_RAMBO_IO_ERROR > > ******************************************************************************/ >-OSS_EXTERNC OSSErr OSS_API ossRamboStopFlusherAndDetach( OSSRambo * pRambo ) >+OSS_EXTERNC OSSErr OSS_API ossRamboFlushToStream( >+ OSSRambo *pRambo, >+ JNIEnv *jenv, >+ jobject jOutStrObj ) > { > OSSErr osserr = OSS_OK ; >+ ssize_t bytesWritten = 0 ; >+ Uint32 chunkIndex = 0 ; >+ Uint32 slotIndex = 0 ; >+ Uint32 loopIndex = 0 ; >+ Uint32 timedOut = 0 ; >+ Uint32 attachCheckIndex = 0 ; /* bugzilla 94473 */ >+ int flushDataLen; >+ OSSRamboCB * pRamboCB ; >+ OSSRamboChunkCB * pChunkCB = NULL ; >+ void * pChunk = NULL ; >+ bool wrappedChunk = false ; >+ bool flushUnfilledChunks = false ; >+ bool stopping = false; >+ Sint32 err = 0 ; >+ Sint32 continueDataSize = 0; >+ jclass jcls = NULL; >+ jmethodID jmethod = NULL; > >- /* Validate parameters */ >+#ifdef OSS_DEBUG1 >+ FILE *dbgfd; >+#endif >+ >+#ifdef OSS_DEBUG1 >+ dbgfd = fopen("flushdbg.txt", "ac+"); >+ if (dbgfd == NULL) { >+ osserr = errno; >+ goto exit; >+ } >+ if ( 0 > fprintf(dbgfd,"ossRamboFlushToFD: Entered.\n" ) ) { >+ osserr = OSS_ERR_RAMBO_IO_ERROR; >+ goto exit; >+ } >+ fflush(dbgfd); >+#endif >+ >+ /* Validate the parameters */ > OSS_ASSERT( !ossIsBadReadPtr ( pRambo, sizeof( *pRambo ) ) ) ; > OSS_ASSERT( !ossIsBadReadPtr ( pRambo->pRamboCB, sizeof( *pRambo->pRamboCB ) ) ) ; > OSS_ASSERT( !ossIsBadWritePtr( pRambo->pRamboCB, sizeof( *pRambo->pRamboCB ) ) ) ; >- if ( NULL == pRambo ) >+ >+#ifdef OSS_DEBUG1 >+ fprintf(dbgfd,"ossRamboFlushToFD: After asserts.\n" ) ; >+ fflush(dbgfd); >+#endif >+ >+ if ( ( NULL == pRambo ) || ( NULL == pRambo->pRamboCB ) ) > { > goto errorInvalid ; > } > >- OSS_ASSERT( ossRamboIsInitialized( pRambo->pRamboCB ) ) ; >- if ( !ossRamboIsInitialized( pRambo->pRamboCB ) ) >+ pRamboCB = pRambo->pRamboCB ; >+ >+ OSS_ASSERT( ossRamboIsInitialized( pRamboCB ) ) ; >+ >+ if ( !ossRamboIsInitialized( pRamboCB ) ) > { > goto errorNotInitialized ; > } > >- /* Check if the auto flusher is started */ >- if ( !ossRamboIsAutoFlusherStarted( pRambo->pRamboCB ) ) >+ /* If the auto flusher is on, don't allow manual flushing */ >+ if ( ossRamboIsAutoFlusherStarted( pRamboCB ) ) > { >- osserr = OSS_OK ; >+ osserr = OSS_ERR_RAMBO_AUTOFLUSHER_ENABLED ; > goto exit ; > } > >- /* Notify the auto-flusher to stop */ >- pRambo->pRamboCB->l2.h2.status |= OSS_RAMBO_AUTOF_STOP_NOW ; >- >+ /* Get java method ID */ > #ifdef OSS_DEBUG >- printf("After setting the stop flag\n"); >+ printf("ossRamboFlushToStream: Before trying to get java method ID\n"); > #endif >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jOutStrObj); >+ if(jcls != NULL) { >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, "write", "([BII)V"); >+ } > >-/* 216026 begin */ >-/* Wait until there are no more writers to the shared memory */ >- >- while ( ossAtomicPeek(&pRambo->writers) > 0 ) { >+ if (jmethod == NULL) { >+ osserr = OSS_ERR_RAMBO_IO_ERROR ; >+ goto exit ; >+ } > #ifdef OSS_DEBUG >- printf("ossRamboStopFlusher: waiting because there are still %d writers\n", ossAtomicPeek(&pRambo->writers)); >+ printf("ossRamboFlushToStream: After getting java method ID\n"); > #endif >- ossYield() ; >- } >-/* 216026 end */ >- >-/* 186134 - Add a call to detach from the shared memory so it can be destroyed >- by the server */ >- ossIPCMemDetach( pRambo->ipcMemHandle ) ; > >- OSS_ASSERT( OSS_OK == osserr ) ; > >-exit: >- return osserr ; >+ /* If already flushing, wait. */ >+ /* TODO */ >+ /* >+ * There is a timing hole here. The flushing status may have been >+ * cleared and then set by another process before we get to set it. >+ */ >+ while ( ossRamboIsFlushing( pRamboCB ) ) >+ { >+ ossYield() ; >+ } >+// pRamboCB->l2.h2.status |= OSS_RAMBO_FLUSHING ; >+ /* Pretend we are auto flushing instead of manual flushing so we don't hold up writing >+ to the buffer */ >+ pRamboCB->l2.h2.status |= OSS_RAMBO_AUTOF_STARTED ; >+ /* TODO */ > >-errorInvalid : >- osserr = OSS_ERR_INVALID ; >- goto exit ; > >-errorNotInitialized : >- osserr = OSS_ERR_RAMBO_NOT_INIT ; >- goto exit ; >-} >+ /* Examine the first chunk control block to see if we wrapped. */ >+ if ( ossAtomicPeek(&(pFirstChunkCB(pRamboCB)->fillCount)) > OSS_RAMBO_SLOTS_PER_CHUNK ) >+ { >+ pOnDiskCB(pRamboCB)->bufferWrapped = 1 ; /* True */ >+ } > >+ /* Write RAMBO storage header information */ >+ OSS_ASSERT( ossRamboIsValidOnDiskCB( pOnDiskCB(pRamboCB) ) ) ; > >-/******************************************************************************* > >- Name >- ossRamboStopFlusher >+ /* TODO */ >+ /* Start flushing */ >+#ifdef OSS_DEBUG1 >+// printf("ossRamboFlushFD: Started flushing.\n" ) ; >+ fprintf(dbgfd,"ossRamboFlushToFD: Started flushing.\n" ) ; >+ fflush(dbgfd); >+#endif > >- Function >- Tells flusher routine to stop flushing buffer. >+ /* Try to find the least recently filled chunk if the buffer has >+ been wrapped and start flushing at it. */ >+ >+ if ( ossAtomicPeek(&(pFirstChunkCB(pRamboCB)->fillCount)) > OSS_RAMBO_SLOTS_PER_CHUNK ) >+ { >+ slotIndex = ossAtomicPeek(&pRamboCB->l1.h1.nextSlotIndex) % pRamboCB->l2.h2.maxSlots ; >+ chunkIndex = slotIndex / OSS_RAMBO_SLOTS_PER_CHUNK + 1; >+ } >+ else >+ chunkIndex = 0; >+ >+#ifdef OSS_DEBUG >+ printf("ossRamboFlushToStream: About to go into waiting loop\n"); >+#endif >+ >+ for ( ; ; ) >+ { >+ /* Get pointer to the chunk control block */ >+ pChunkCB = pFirstChunkCB(pRamboCB) + chunkIndex ; >+ OSS_ASSERT( ossRamboIsValidChunkCB( pChunkCB, pRamboCB ) ) ; >+ >+ loopIndex = 0; >+ timedOut = 0; >+ attachCheckIndex = 0; /* 94473 */ >+ /* Wait until the chunk is full or we have been asked to stop or we have waited too long */ >+ for ( ; ; ) >+ { >+ /* If flushing is to be stopped then set the stopping flag and quit the loop */ >+ if ( pRamboCB->l2.h2.status & OSS_RAMBO_AUTOF_STOP_NOW ) >+ { >+ stopping = true ; >+ break ; >+ } >+ >+ /* If the chunk is full then quit the loop so it can be flushed. */ >+ if ( ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0 ) >+ { >+#ifdef OSS_DEBUG1 >+// printf("ossRamboFlushFD: Started flushing.\n" ) ; >+ fprintf(dbgfd,"ossRamboFlushToFD: Data found in buffer.\n" ) ; >+ fflush(dbgfd); >+#endif >+ break ; >+ } >+ /* Else If we have looped too long */ >+ else if (loopIndex == 100) { >+ /* If there is any data in the chunk Then quit the loop to flush it */ >+ if ((ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) - ossAtomicPeek(&pChunkCB->flushedCount) > 0 || >+ (ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0)) { >+ timedOut = 1; >+#ifdef OSS_DEBUG1 >+ fprintf(dbgfd,"ossRamboFlushToFD: We've waited too long, flush data found in chunk.\n" ) ; >+ fflush(dbgfd); >+#endif >+ break ; >+ } >+/* 205955 begin */ >+ /* Else get the attach count to see if anyone else is attached */ >+ else { >+ int attcnt = 0; >+ OSSErr osserr = OSS_OK ; >+ osserr = ossIPCMemAttachCount( pRambo->ipcMemHandle, &attcnt ) ; >+ attachCheckIndex++; /* bugzilla 94473 */ >+ /* If nobody is attached to the shared memory except for us then stop flushing >+ * bugzilla 94473 - only stop flushing if we have gone through the wait loop four >+ * times to provide more time for the agent to attach to it (4 seconds instead of 1). */ >+ if ( osserr == OSS_OK && attcnt == 1 && attachCheckIndex >= 4) >+ { >+#ifdef OSS_DEBUG >+ printf("ossRamboFlushToStream: Nobody is attached to write to the buffer yet.\n"); >+#endif >+ /* set the user count to 1 so the shared memory gets deleted when it is destroyed */ >+/* >+ ossIPCMemSetUserCount( pRambo->ipcMemHandle, attcnt ) ; >+ stopping = true ; >+ break ; >+*/ >+ } >+ /* Else continue checking for writes to shared memory */ >+ loopIndex = 0; >+ } >+/* 205955 end */ >+ } >+ >+ ossSleep( 10 ) ; >+ loopIndex++; >+ } >+ >+ /* If we should stop, break out of the flushing loop */ >+ if ( stopping ) >+ { >+#ifdef OSS_DEBUG1 >+// printf("ossRamboFlushFD: Started flushing.\n" ) ; >+ fprintf(dbgfd,"ossRamboFlushToFD: We are stopping flushing so flush unfilled chunks.\n" ) ; >+ fflush(dbgfd); >+#endif >+ flushUnfilledChunks = true ; >+ break ; >+ } >+ >+ /* If the chunk is full, flush it to disk */ >+#ifdef ENW >+ if ( ossAtomicPeek(&pChunkCB->fillCount) > 0 && (ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK) == 0 ) >+#else >+ if ( pChunkCB->fillCount >= OSS_RAMBO_SLOTS_PER_CHUNK ) >+#endif >+ { >+ unsigned int i; >+ if (ossAtomicPeek(&pChunkCB->flushedCount) == 0) { >+ OSS_ASSERT( (Uint32)-1 == ossAtomicPeek(&pChunkCB->slotMap[0]) ) ; >+ } >+ OSS_ASSERT( (Uint32)-1 == ossAtomicPeek(&pChunkCB->slotMap[OSS_RAMBO_SLOT_BITMAP_ARRAY_SIZE-1]) ) ; >+ >+ if ( ossAtomicPeek(&pChunkCB->fillCount) > OSS_RAMBO_SLOTS_PER_CHUNK ) >+ { >+ wrappedChunk = true ; >+ } >+/* >+ if (!flushStarted) >+ flushStarted = true; >+*/ >+ /* Get a pointer to the chunk of memory */ >+ pChunk = (void *)( (uintptr_t)pMemBuffer(pRamboCB) >+ + ( chunkIndex * OSS_RAMBO_CHUNK_SIZE ) ) ; >+ if (ossAtomicPeek(&pChunkCB->flushedCount) > 0) { >+ pChunk = (void *)((char *)pChunk + ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE); >+ flushDataLen = OSS_RAMBO_CHUNK_SIZE - ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE; >+ } >+ else >+ flushDataLen = OSS_RAMBO_CHUNK_SIZE; >+ >+ OSS_ASSERT( pChunk != NULL ) ; >+ OSS_ASSERT( (uintptr_t)pChunk >= (uintptr_t)pMemBuffer(pRamboCB) ) ; >+ >+ /* Pass the chunk to the data processor */ >+ >+ err = dataToStrProcessor( pChunk, flushDataLen, continueDataSize, jenv, jOutStrObj, jmethod ) ; >+ if ( 0 > err ) { >+// perror("ossRamboFlushFD failed writing the storage header info"); >+#ifdef OSS_DEBUG1 >+ fprintf(dbgfd,"ossRamboFlushToFD: failed writing the chunk %d of shared memory. wsa error=%d\n", chunkIndex, WSAGetLastError() ) ; >+ fflush(dbgfd); >+#endif >+ goto errorProcessingFailed ; >+ } >+ else >+ continueDataSize = err; >+ >+ if ( wrappedChunk ) >+ { >+ /* >+ * The flusher has been lapped. The chunk has been filled >+ * more than once. Log this so we know it has happened but >+ * don't exit. >+ */ >+#ifdef OSS_DEBUG1 >+// printf("RC = ERR_CHUNK_OVERWRITTEN: Flushed chunk %lu fillCount %lu\n", >+// chunkIndex, pChunkCB->fillCount ) ; >+ fprintf(dbgfd,"RC = ERR_CHUNK_OVERWRITTEN: Flushed chunk %lu fillCount %lu\n", >+ chunkIndex, ossAtomicPeek(&pChunkCB->fillCount) ) ; >+ fflush(dbgfd); >+#endif >+ wrappedChunk = false ; >+ } >+#ifdef OSS_DEBUG1 >+ else { >+// printf("Flushed chunk %lu fillCount %lu\n", >+// chunkIndex, pChunkCB->fillCount ) ; >+ fprintf(dbgfd,"Flushed chunk %lu fillCount %lu\n", >+ chunkIndex, ossAtomicPeek(&pChunkCB->fillCount) ) ; >+ fflush(dbgfd); >+ } >+#endif >+ >+ //pause() ; >+ /* Reset the chunk control block */ >+/* 186134 begin >+ memset( (void *)&pChunkCB->slotMap[0], 0x00, sizeof( pChunkCB->slotMap ) ) ; >+*/ >+ for(i=0; i < OSS_RAMBO_SLOT_BITMAP_ARRAY_SIZE; i++) { >+ ossAtomicPoke(&(pChunkCB->slotMap[i]), 0); >+ } >+/* 186134 end */ >+ ossAtomicPoke(&pChunkCB->fillCount, 0) ; >+ ossAtomicPoke(&pChunkCB->flushedCount, 0) ; >+ } >+ else if ( timedOut ) { >+ /* Get a pointer to the chunk of memory */ >+ pChunk = (void *)( (uintptr_t)pMemBuffer(pRamboCB) >+ + ( chunkIndex * OSS_RAMBO_CHUNK_SIZE ) ) ; >+ >+ slotIndex = ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK; >+ if (ossAtomicPeek(&pChunkCB->flushedCount) > 0) { >+ pChunk = (void *)((char *)pChunk + ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE); >+ flushDataLen = (slotIndex - ossAtomicPeek(&pChunkCB->flushedCount)) * OSS_RAMBO_SLOT_SIZE; >+ } >+ else >+ flushDataLen = slotIndex * OSS_RAMBO_SLOT_SIZE; >+ >+ OSS_ASSERT( pChunk != NULL ) ; >+ OSS_ASSERT( (uintptr_t)pChunk >= (uintptr_t)pMemBuffer(pRamboCB) ) ; >+ >+ /* Pass the chunk to the data processor */ >+ >+ err = dataToStrProcessor( pChunk, flushDataLen, continueDataSize, jenv, jOutStrObj, jmethod ) ; >+ if ( 0 > err ) { >+// perror("ossRamboFlushFD failed writing the storage header info"); >+#ifdef OSS_DEBUG1 >+ fprintf(dbgfd,"ossRamboFlushToFD: failed writing the chunk %d of shared memory. wsa error=%d\n", chunkIndex, WSAGetLastError() ) ; >+ fflush(dbgfd); >+#endif >+ goto errorProcessingFailed ; >+ } >+ else >+ continueDataSize = err; >+ >+ /* Reset the chunk control block */ >+ ossRamboMarkSlotsEmpty(pChunkCB, ossAtomicPeek(&pChunkCB->flushedCount), slotIndex-ossAtomicPeek(&pChunkCB->flushedCount)); >+ } >+#ifdef OSS_DEBUG1 >+ else if (ossAtomicPeek(&pChunkCB->fillCount) > 0) { >+// printf("Unfilled chunk %lu fillCount %lu\n", >+// chunkIndex, pChunkCB->fillCount ) ; >+ fprintf(dbgfd,"Unfilled chunk %lu fillCount %lu\n", >+ chunkIndex, ossAtomicPeek(&pChunkCB->fillCount) ) ; >+ fflush(dbgfd); >+ } >+#endif >+/* >+ else if (flushStarted) >+ printf("Empty chunk %lu\n", chunkIndex) ; >+*/ >+ /* Move to next chunk if we didn't time out */ >+ if ( !timedOut ) >+ chunkIndex = (chunkIndex + 1) % pRamboCB->l2.h2.maxChunks ; >+ >+ /* Check if we have been asked to stop */ >+ if ( pRamboCB->l2.h2.status & OSS_RAMBO_AUTOF_STOP_NOW ) >+ { >+ flushUnfilledChunks = true ; >+ break ; >+ } >+#ifdef OSS_DEBUG >+ printf("ossRamboFlushToStream: About to do another iteration of the waiting loop\n"); >+#endif >+ } >+ >+ /* Flush unfilled chunks */ >+ if ( flushUnfilledChunks ) >+ { >+ int numUsedSlots; >+ >+ /* Start flushing at the current chunk index so the flushing continues in the correct order */ >+ unsigned int i; >+#ifdef OSS_DEBUG >+ printf("ossRamboFlushToStream: Flushing unfilled chunks\n"); >+#endif >+ for ( i = 0; i < pRamboCB->l2.h2.maxChunks; i++ ) >+ { >+ /* Get pointer to the chunk control block */ >+ pChunkCB = pFirstChunkCB(pRamboCB) + chunkIndex ; >+ OSS_ASSERT( ossRamboIsValidChunkCB( pChunkCB, pRamboCB ) ) ; >+ >+ /* If the chunk contains data, flush it to disk */ >+ if ( ossAtomicPeek(&pChunkCB->fillCount) > 0 ) >+ { >+ unsigned int j; >+ numUsedSlots = ossAtomicPeek(&pChunkCB->fillCount) % OSS_RAMBO_SLOTS_PER_CHUNK; >+ >+ /* Check if chunk is full */ >+ if (numUsedSlots == 0) { >+ numUsedSlots = OSS_RAMBO_SLOTS_PER_CHUNK; >+ } >+ >+ /* subtract the slots that have already been flushed */ >+ numUsedSlots -= ossAtomicPeek(&pChunkCB->flushedCount); >+ >+ /* if there are no used slots in this chunk */ >+ if (numUsedSlots == 0) { >+ /* Move to next chunk */ >+ chunkIndex = (chunkIndex + 1) % pRamboCB->l2.h2.maxChunks ; >+ continue; >+ } >+ else if (numUsedSlots < 0) { >+ /* Note: flushedCount should never be bigger than fillCount but we'll >+ catch this case and stop flushing because we are in an inconsistent >+ state >+ */ >+ goto errorProcessingFailed ; >+ } >+ >+ /* Get a pointer to the chunk of memory */ >+ pChunk = (void *)( (uintptr_t)pMemBuffer(pRamboCB) >+ + ( chunkIndex * OSS_RAMBO_CHUNK_SIZE ) ) ; >+ if (ossAtomicPeek(&pChunkCB->flushedCount) > 0) >+ pChunk = (void *)((char *)pChunk + ossAtomicPeek(&pChunkCB->flushedCount) * OSS_RAMBO_SLOT_SIZE); >+ OSS_ASSERT( pChunk != NULL ) ; >+ OSS_ASSERT( (uintptr_t)pChunk >= (uintptr_t)pMemBuffer(pRamboCB) ) ; >+ >+ /* Pass the chunk to the data processor, but only process the filled slots */ >+ >+ err = dataToStrProcessor( pChunk, numUsedSlots * OSS_RAMBO_SLOT_SIZE, continueDataSize, jenv, jOutStrObj, jmethod ) ; >+ if ( 0 > err ) { >+#ifdef OSS_DEBUG1 >+ fprintf(dbgfd,"ossRamboFlushToFD: failed writing the chunk %d of shared memory. error=%d\n", chunkIndex, err ) ; >+ fflush(dbgfd); >+#endif >+ goto errorProcessingFailed ; >+ } >+ else >+ continueDataSize = err; >+ >+#ifdef OSS_DEBUG1 >+// printf("Flushed unfilled chunk index %lu has fillCount %lu\n", >+// chunkIndex, pChunkCB->fillCount ) ; >+ fprintf(dbgfd,"Flushed unfilled chunk index %lu has fillCount %lu\n", >+ chunkIndex, ossAtomicPeek(&pChunkCB->fillCount) ) ; >+ fflush(dbgfd); >+#endif >+ >+ /* Reset the chunk control block */ >+/* 186134 begin >+ memset( (void *)&pChunkCB->slotMap[0], 0x00, sizeof( pChunkCB->slotMap ) ) ; >+*/ >+ for(j=0; j < OSS_RAMBO_SLOT_BITMAP_ARRAY_SIZE; j++) { >+ ossAtomicPoke(&(pChunkCB->slotMap[j]), 0); >+ } >+/* 186134 end */ >+ ossAtomicPoke(&pChunkCB->fillCount, 0) ; >+ ossAtomicPoke(&pChunkCB->flushedCount, 0) ; >+ } >+#ifdef OSS_DEBUG1 >+ else { >+// printf("empty chunk index %lu\n", chunkIndex ) ; >+ fprintf(dbgfd,"empty chunk index %lu\n", chunkIndex ) ; >+ fflush(dbgfd); >+ } >+#endif >+ /* Move to next chunk */ >+ chunkIndex = (chunkIndex + 1) % pRamboCB->l2.h2.maxChunks ; >+ >+ } >+ /* Clear the auto-flusher status flags */ >+ pRamboCB->l2.h2.status &= ~OSS_RAMBO_AUTOF_STOP_NOW ; >+ pRamboCB->l2.h2.status &= ~OSS_RAMBO_AUTOF_STARTED ; >+ } >+#ifdef OSS_DEBUG >+ printf("ossRamboFlushToStream: Returning with osserr = %d\n", osserr); >+#endif >+ >+// pRamboCB->l2.h2.status &= ~OSS_RAMBO_FLUSHING ; >+ >+ OSS_ASSERT( OSS_OK == osserr ) ; >+ >+exit : >+ #ifdef OSS_DEBUG1 >+ fclose(dbgfd); >+ #endif >+ OSS_ASSERT( !( pRamboCB->l2.h2.status & OSS_RAMBO_FLUSHING ) ) ; >+ return osserr ; >+ >+errorInvalid : >+ osserr = OSS_ERR_INVALID ; >+ goto exit ; >+ >+errorNotInitialized : >+ osserr = OSS_ERR_RAMBO_NOT_INIT ; >+ goto exit ; >+ >+errorProcessingFailed : >+// pRamboCB->l2.h2.status &= ~OSS_RAMBO_FLUSHING ; >+ pRamboCB->l2.h2.status &= ~OSS_RAMBO_AUTOF_STOP_NOW ; >+ pRamboCB->l2.h2.status &= ~OSS_RAMBO_AUTOF_STARTED ; >+ osserr = OSS_ERR_RAMBO_IO_ERROR ; >+ goto exit ; >+} >+ >+ >+/******************************************************************************* >+ >+ Name >+ ossRamboStopFlusherAndDetach >+ >+ Function >+ Tells flusher routine to stop flushing buffer and detach from buffer. >+ >+ Inputs >+ 1. pRambo >+ Address of a RAMBO handle. >+ >+ Normal Return >+ OSS_OK >+ >+ Error Return >+ OSS_ERR_INVALID >+ OSS_ERR_RAMBO_NOT_INIT >+ >+ ******************************************************************************/ >+OSS_EXTERNC OSSErr OSS_API ossRamboStopFlusherAndDetach( OSSRambo * pRambo ) >+{ >+ OSSErr osserr = OSS_OK ; >+ >+ /* Validate parameters */ >+ OSS_ASSERT( !ossIsBadReadPtr ( pRambo, sizeof( *pRambo ) ) ) ; >+ OSS_ASSERT( !ossIsBadReadPtr ( pRambo->pRamboCB, sizeof( *pRambo->pRamboCB ) ) ) ; >+ OSS_ASSERT( !ossIsBadWritePtr( pRambo->pRamboCB, sizeof( *pRambo->pRamboCB ) ) ) ; >+ if ( NULL == pRambo ) >+ { >+ goto errorInvalid ; >+ } >+ >+ OSS_ASSERT( ossRamboIsInitialized( pRambo->pRamboCB ) ) ; >+ if ( !ossRamboIsInitialized( pRambo->pRamboCB ) ) >+ { >+ goto errorNotInitialized ; >+ } >+ >+ /* Check if the auto flusher is started */ >+ if ( !ossRamboIsAutoFlusherStarted( pRambo->pRamboCB ) ) >+ { >+ osserr = OSS_OK ; >+ goto exit ; >+ } >+ >+ /* Notify the auto-flusher to stop */ >+ pRambo->pRamboCB->l2.h2.status |= OSS_RAMBO_AUTOF_STOP_NOW ; >+ >+#ifdef OSS_DEBUG >+ printf("After setting the stop flag\n"); >+#endif >+ >+/* 216026 begin */ >+/* Wait until there are no more writers to the shared memory */ >+ >+ while ( ossAtomicPeek(&pRambo->writers) > 0 ) { >+#ifdef OSS_DEBUG >+ printf("ossRamboStopFlusher: waiting because there are still %d writers\n", ossAtomicPeek(&pRambo->writers)); >+#endif >+ ossYield() ; >+ } >+/* 216026 end */ >+ >+/* 186134 - Add a call to detach from the shared memory so it can be destroyed >+ by the server */ >+ ossIPCMemDetach( pRambo->ipcMemHandle ) ; >+ >+ OSS_ASSERT( OSS_OK == osserr ) ; >+ >+exit: >+ return osserr ; >+ >+errorInvalid : >+ osserr = OSS_ERR_INVALID ; >+ goto exit ; >+ >+errorNotInitialized : >+ osserr = OSS_ERR_RAMBO_NOT_INIT ; >+ goto exit ; >+} >+ >+ >+/******************************************************************************* >+ >+ Name >+ ossRamboStopFlusher >+ >+ Function >+ Tells flusher routine to stop flushing buffer. > > Inputs > 1. pRambo >@@ -2263,4 +3001,15 @@ > return (ra_shm_err_t)shmerr; > } > /* 175248 end */ >+ >+OSSErr ra_stopFlusher(OSSRambo *handle) { >+ OSSErr shmerr; >+ >+ if (handle != NULL) >+ shmerr = ossRamboStopFlusher(handle); >+ else >+ shmerr = OSS_OK; >+ >+ return shmerr; >+} > >\ No newline at end of file >Index: src-native-new/src/transport/RASharedMemory/RASharedMemory.def >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RASharedMemory.def,v >retrieving revision 1.4 >diff -u -r1.4 RASharedMemory.def >--- src-native-new/src/transport/RASharedMemory/RASharedMemory.def 8 Aug 2005 19:32:00 -0000 1.4 >+++ src-native-new/src/transport/RASharedMemory/RASharedMemory.def 16 Mar 2007 14:50:56 -0000 >@@ -36,6 +36,5 @@ > ossYield @33 > ra_getShmAttachCount @45 > ra_setShmAttachCount @46 >- >- >- >+ ra_stopFlusher @47 >+ ossRamboClose @48 >Index: src-native-new/src/transport/RASharedMemory/ossexs.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossexs.h,v >retrieving revision 1.3 >diff -u -r1.3 ossexs.h >--- src-native-new/src/transport/RASharedMemory/ossexs.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossexs.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossmemory.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossmemory.h,v >retrieving revision 1.3 >diff -u -r1.3 ossmemory.h >--- src-native-new/src/transport/RASharedMemory/ossmemory.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossmemory.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/oss.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/oss.h,v >retrieving revision 1.5 >diff -u -r1.5 oss.h >--- src-native-new/src/transport/RASharedMemory/oss.h 28 Apr 2006 23:45:32 -0000 1.5 >+++ src-native-new/src/transport/RASharedMemory/oss.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossdebug.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossdebug.cpp,v >retrieving revision 1.5 >diff -u -r1.5 ossdebug.cpp >--- src-native-new/src/transport/RASharedMemory/ossdebug.cpp 28 Apr 2006 23:45:32 -0000 1.5 >+++ src-native-new/src/transport/RASharedMemory/ossdebug.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -113,7 +113,7 @@ > "ASSERTION FAILED = %s\nFile = %s\nLine = %lu\n", > pszExpression, > pszFilename, >- (unsigned long)lineNumber ) ; >+ lineNumber ) ; > > #if defined SQLWINT > /* >Index: src-native-new/src/transport/RASharedMemory/ossipcmemory.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossipcmemory.h,v >retrieving revision 1.3 >diff -u -r1.3 ossipcmemory.h >--- src-native-new/src/transport/RASharedMemory/ossipcmemory.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossipcmemory.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -109,6 +109,11 @@ > OSS_EXTERNC OSSErr OSS_API ossIPCMemDestroy( OSSMemRes memRes ) ; > > /******************************************************************************* >+ Close IPC memory resource >+ ******************************************************************************/ >+OSS_EXTERNC OSSErr OSS_API ossIPCMemClose( OSSMemRes memRes ) ; >+ >+/******************************************************************************* > Attach to IPC memory resource > ******************************************************************************/ > OSS_EXTERNC OSSErr OSS_API ossIPCMemAttach( >Index: src-native-new/src/transport/RASharedMemory/RASharedMemory.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RASharedMemory.make,v >retrieving revision 1.5 >diff -u -r1.5 RASharedMemory.make >--- src-native-new/src/transport/RASharedMemory/RASharedMemory.make 1 Apr 2006 03:15:56 -0000 1.5 >+++ src-native-new/src/transport/RASharedMemory/RASharedMemory.make 16 Mar 2007 14:50:56 -0000 >@@ -22,7 +22,7 @@ > # > #----------------------------------- > TARGET := libhcclsm >-TARGETDIR := $(RAC_SDK_HOME)/lib >+TARGETDIR := ../../../lib > > if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi > if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := . ../../../include ../RACommon ../RASocket >+INCLUDEDIRS := . ../../../include ../RACommon ../RASocket $(JAVA_HOME)/include $(JAVA_HOME)/include/linux > > > #----------------------------------- >@@ -50,7 +50,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := $(RAC_SDK_HOME)/lib ../../../lib >+LIBDIRS := ../../../lib > > > #----------------------------------- >@@ -74,11 +74,11 @@ > > DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/RASharedMemory/ossipc.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossipc.h,v >retrieving revision 1.3 >diff -u -r1.3 ossipc.h >--- src-native-new/src/transport/RASharedMemory/ossipc.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossipc.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/osstime.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/osstime.h,v >retrieving revision 1.3 >diff -u -r1.3 osstime.h >--- src-native-new/src/transport/RASharedMemory/osstime.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/osstime.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossrambo.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossrambo.h,v >retrieving revision 1.7 >diff -u -r1.7 ossrambo.h >--- src-native-new/src/transport/RASharedMemory/ossrambo.h 3 May 2006 19:00:06 -0000 1.7 >+++ src-native-new/src/transport/RASharedMemory/ossrambo.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -153,10 +153,6 @@ > * RAMBO BUFFER CONTROL BLOCK > */ > #define OSS_RAMBO_BUFFER_NAME_SIZE 23 >-/* Buffer size increases to accommodate UUID length as the name */ >-//We need to use the same length as the RAC for compatibility. >-//#define OSS_RAMBO_BUFFER_NAME_SIZE 256 >- > > typedef struct > { >@@ -263,6 +259,7 @@ > OSS_EXTERNC OSSErr OSS_API ossRamboAttach( char *, OSSRambo *, void **, > void ** ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboDestroy( OSSRambo * ) ; >+OSS_EXTERNC OSSErr OSS_API ossRamboClose( OSSRambo * ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboAutoFlusherStart( OSSRambo *, > const char *, > const char *, >@@ -275,8 +272,10 @@ > Uint32 ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboFlush( OSSRambo *, const char * ) ; > #ifdef ENW >+#include <jni.h> > OSS_EXTERNC OSSErr OSS_API ossRamboFlushToFD( OSSRambo *, int, int ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboFlushToFunc( OSSRambo *, RA_Data_Processing_Routine, void * ) ; >+OSS_EXTERNC OSSErr OSS_API ossRamboFlushToStream( OSSRambo *, JNIEnv *, jobject ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboFlushFullChunksToFunc( OSSRambo *, RA_Data_Processing_Routine, void * ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboStopFlusher( OSSRambo * ) ; > OSS_EXTERNC OSSErr OSS_API ossRamboStopFlusherAndDetach( OSSRambo * ) ; >Index: src-native-new/src/transport/RASharedMemory/ossramboinl.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossramboinl.h,v >retrieving revision 1.3 >diff -u -r1.3 ossramboinl.h >--- src-native-new/src/transport/RASharedMemory/ossramboinl.h 8 Aug 2005 19:31:59 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossramboinl.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossmemory.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossmemory.cpp,v >retrieving revision 1.4 >diff -u -r1.4 ossmemory.cpp >--- src-native-new/src/transport/RASharedMemory/ossmemory.cpp 7 Oct 2005 18:53:05 -0000 1.4 >+++ src-native-new/src/transport/RASharedMemory/ossmemory.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossatomic.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossatomic.h,v >retrieving revision 1.10 >diff -u -r1.10 ossatomic.h >--- src-native-new/src/transport/RASharedMemory/ossatomic.h 5 May 2006 16:47:40 -0000 1.10 >+++ src-native-new/src/transport/RASharedMemory/ossatomic.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -1380,7 +1380,6 @@ > ) > { > OSSRegister32 *old ; >- > /* 186134 - changed this so it would compile on Win NT and because the return > value was being interpretted incorrectly - a PVOID is returned, > not an int >Index: src-native-new/src/transport/RASharedMemory/RAShm.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RAShm.h,v >retrieving revision 1.3 >diff -u -r1.3 RAShm.h >--- src-native-new/src/transport/RASharedMemory/RAShm.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/RAShm.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/osserror.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/osserror.h,v >retrieving revision 1.3 >diff -u -r1.3 osserror.h >--- src-native-new/src/transport/RASharedMemory/osserror.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/osserror.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossipcmemory.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossipcmemory.cpp,v >retrieving revision 1.5 >diff -u -r1.5 ossipcmemory.cpp >--- src-native-new/src/transport/RASharedMemory/ossipcmemory.cpp 5 May 2006 16:47:40 -0000 1.5 >+++ src-native-new/src/transport/RASharedMemory/ossipcmemory.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -66,7 +66,14 @@ > #define OSS_MARKER_MEM ((OSSMarker)(0xDB2ADB2B)) > #define OSS_MEM_HASH_SZ 64 > >+/* bugzilla 99740 begin */ >+#ifdef SQLWINT >+#define OSS_MEM_NAME "Global\\OSSMEM%s" >+#else > #define OSS_MEM_NAME "OSSMEM%s" >+#endif >+/* bugzilla 99740 end */ >+ > #define OSS_RES_SIZE (1024*1024*4) > > >@@ -273,6 +280,9 @@ > } > > sprintf( memName, OSS_MEM_NAME, pResName ) ; >+#ifdef OSS_DEBUG >+ printf("IPCMemAttach: Try to attach to shared memory %s\n",memName); >+#endif > > #ifdef SQLWINT > /* 32-bit Windows implementation */ >@@ -371,17 +381,30 @@ > > shmID = shmget( shmKey, 0, 0 ) ; > #ifdef OSS_DEBUG >- printf("IPCMemAttach: about to delete shared memory because it already exists\n"); >+ printf("IPCMemAttach: about to delete shared memory %s because it already exists\n",memName); > #endif > if (-1 == shmctl( shmID, IPC_RMID, 0 )) { > #ifdef OSS_DEBUG >- printf("IPCMemAttach: shmctl(IPC_RMID) failed - errno=%d %s\n", errno, strerror(errno)); >+ printf("IPCMemAttach: shmctl(IPC_RMID) for mem %s failed - errno=%d %s\n", memName, errno, strerror(errno)); >+#endif >+ struct shmid_ds shmCtl; >+ if (-1 == shmctl(shmID, IPC_STAT, &shmCtl)) { >+ shmID = -1; >+#ifdef OSS_DEBUG >+ printf("IPCMemAttach: shmctl(IPC_STAT) for mem %s failed - errno=%d %s\n", memName, errno, strerror(errno)); > #endif >- shmID = -1; >+ } >+ else if (shmCtl.shm_nattch == 0) { >+#ifdef OSS_DEBUG >+ printf("IPCMemAttach: no attachments for mem %s, opening for read/write\n", memName); >+#endif >+ } >+ else >+ shmID = -1; > } > else { > #ifdef OSS_DEBUG >- printf("IPCMemAttach: about to create shared memory again after deleting it\n"); >+ printf("IPCMemAttach: about to create shared memory %s again after deleting it\n",memName); > #endif > shmID = shmget( shmKey, setSize, shmPerms ) ; > errnoval = errno; >@@ -418,7 +441,7 @@ > if ( -1 == shmID ) > { > #ifdef OSS_DEBUG >- printf("IPCMemAttach: shmget failed with errno=%d %s\n", errno, strerror(errno)); >+ printf("IPCMemAttach: shmget for mem %s failed with errno=%d %s\n", memName, errno, strerror(errno)); > #endif > if (EEXIST == errnoval) > osserr = OSS_ERR_IPC_DUPLICATE; >@@ -437,7 +460,7 @@ > if ( (OSSMemSet *)-1 == pMemSet ) > { > #ifdef OSS_DEBUG >- printf("IPCMemAttach: shmat failed with errno=%d %s\n", errno, strerror(errno)); >+ printf("IPCMemAttach: shmat for mem %s failed with errno=%d %s\n", memName, errno, strerror(errno)); > #endif > osserr = OSS_ERR_IPC_SHMEM_ATTACH_FAILED ; > goto exit ; >@@ -471,7 +494,7 @@ > ossLatchGet( &(pMemSet->usersExs) ) ; /* 186134 */ > pMemSet->users++ ; > #ifdef OSS_DEBUG >- printf("IPCMemAttach: users = %d for shared memory addr %x\n", pMemSet->users, pMemSet); >+ printf("IPCMemAttach: users = %d for shared memory %s addr %x\n", pMemSet->users, memName, pMemSet); > #endif > ossLatchRelease( &(pMemSet->usersExs) ) ; /* 186134 */ > >@@ -953,6 +976,36 @@ > /****************************************************************************** > > Name >+ ossIPCMemClose >+ >+ Function >+ Marks an IPC memory resource to be removed by OS when all users deatched. >+ >+ Inputs >+ 1. memRes - memory resource >+ >+ >+ Normal Returns >+ OSS_OK >+ >+ Error Returns >+ OSS_ERR_FAILED >+ >+******************************************************************************/ >+OSSErr OSS_API ossIPCMemClose(OSSMemRes memRes) { >+ OSSMemHdl *pMemHdl = (OSSMemHdl*) memRes; >+ OSSErr osserr = OSS_OK; >+ >+#if SQLUNIX >+ if (-1 == shmctl(pMemHdl->id, IPC_RMID, 0)) osserr = OSS_ERR_FAILED; >+#endif >+ >+ return osserr; >+} >+ >+/****************************************************************************** >+ >+ Name > ossIPCMemAttach > > Function >Index: src-native-new/src/transport/RASharedMemory/ossipc.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossipc.cpp,v >retrieving revision 1.3 >diff -u -r1.3 ossipc.cpp >--- src-native-new/src/transport/RASharedMemory/ossipc.cpp 8 Aug 2005 19:31:59 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossipc.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/osstime.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/osstime.cpp,v >retrieving revision 1.3 >diff -u -r1.3 osstime.cpp >--- src-native-new/src/transport/RASharedMemory/osstime.cpp 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/osstime.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASharedMemory/ossrambo.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/ossrambo.cpp,v >retrieving revision 1.3 >diff -u -r1.3 ossrambo.cpp >--- src-native-new/src/transport/RASharedMemory/ossrambo.cpp 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/ossrambo.cpp 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -64,7 +64,7 @@ > #ifdef SQLWINT > #include <limits.h> > #include <io.h> >-#include <winsock.h> >+#include <winsock2.h> /* 134924 */ > #else > #ifdef OSS_DEBUG > #include <errno.h> /* 198075 */ >@@ -711,6 +711,10 @@ > goto exit ; > } > >+OSS_EXTERNC OSSErr OSS_API ossRamboClose( OSSRambo * pRambo ) >+{ >+ return ossIPCMemClose( pRambo->ipcMemHandle ) ; >+} > > /******************************************************************************* > >Index: src-native-new/src/transport/RASharedMemory/osslatch.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/osslatch.h,v >retrieving revision 1.7 >diff -u -r1.7 osslatch.h >--- src-native-new/src/transport/RASharedMemory/osslatch.h 19 Aug 2005 19:50:24 -0000 1.7 >+++ src-native-new/src/transport/RASharedMemory/osslatch.h 16 Mar 2007 14:50:56 -0000 >@@ -1,540 +1,547 @@ >-/********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * $Id: osslatch.h,v 1.7 2005/08/19 19:50:24 vnaikawadi Exp $ >- * >- * Contributors: >- * IBM - Initial API and implementation >- **********************************************************************/ >- >-/******************************************************************************* >- >- >- Change Activity: >- defect Date Who Description >- ====== =========== === ============================================== >- 161881 Nov/30/2000 pj Various changes. >- 162293 Jan/29/2001 hdp IA64 Windows port >- 165795 Feb/02/2001 jpk Forward fitted v7.2 EXS implementation >- 166622 Feb/12/2001 jpk Fix SUN build >- 170450 Mar/20/2001 ssu AS400 port changes >- 173377 Apr/24/2001 jpk Removed SQLSIN >- 179937 Jun/16/2001 jpk Added ossExsTestEnter() and changed 32-bit Windows >- to use InterlockedExchanged() >- 191482 Oct/19/2001 jpk Added some comments >- 192160 Oct/23/2001 jpk Added more comments >- 192091 Nov/12/2001 yka Code cleanup Phase V >- 195526 Nov/13/2001 yka Code cleanup Phase VI >- 189356 Nov/15/2001 yka Added OSSEXS_STATIC_INITIALIZER >- 195525 Nov/20/2001 yka Rename OSSExs to OSSLatch >- 186134 Mar/01/2002 dns changes so this file can be compiled as C code >- on some platforms >- >-*******************************************************************************/ >- >-/** >- \file osslatch.h >- \brief OSSe short-duration exclusive spin latch (lock) >- */ >- >-#ifndef OSSLATCH_HEADER_INCLUDED >-#define OSSLATCH_HEADER_INCLUDED >- >-/* System includes */ >-#include <stdio.h> >-#include <stdlib.h> >-#include <memory.h> >- >-/* OSSe includes */ >-#include "oss.h" >-#include "ossdebug.h" >-#ifndef ENW >-#include "ossfeat.h" >-#endif >-#include "osstime.h" >- >-#if defined SQL_OS400 >- #include <mih/locksl.h> >- #include <mih/unlocksl.h> >- #include <mih/matobjlk.h> >- #include <except.h> >-#endif >- >-#if defined SQL_OS400 >- #define OSS_LATCH_LOCK _LENR_LOCK >- #define OSS_LATCH_UNLOCK 0 >-#else >- #if !defined HPUX >- #define OSS_LATCH_LOCK 1 >- #define OSS_LATCH_UNLOCK 0 >- #else >- #define OSS_LATCH_LOCK 0 >- #define OSS_LATCH_UNLOCK 1 >- #define OSS_DEBUG_CHAR 0xCC /* 186134 - used by HP code */ >- #endif >-#endif >- >-/******************************************************************************* >- >- IMPORTANT: Keep the size and layout of the lock type and OSSLatch structure >- the consistent between 32- and 64-bit architectures. >- >- The size/layout does NOT have to be the same cross-platforms. For example, >- AIX and NT don't require a common lock type. BUT, the size/layout must be >- common between 32- and 64-bit AIX. >- >- Why? It is not uncommon for these structures to be used in shared >- memory that is accessed by both 32- and 64-bit processes. >- >-*******************************************************************************/ >- >-/* >- * LOCK TYPE >- */ >-#if defined SQLSUN >-typedef volatile unsigned char OSSLock ; >-#elif defined SQLWINT >-/* Note: LONG is the same on 32- and 64-bit Windows platforms */ >-#include <windows.h> /* 186134 */ >-#include <winbase.h> /* 186134 - required for InterlockedExchange */ >-typedef volatile LONG OSSLock ; >-#elif defined HPUX >-typedef volatile struct { int x[5] ; } OSSLock ; >-#elif defined SQL_OS400 >-typedef volatile unsigned char OSSLock ; >-#elif defined SQLSGI >-/* The lock word size in abilock_t is the same for both 32- and 64-bit */ >-#include <abi_mutex.h> >-typedef volatile abilock_t OSSLock ; >-#else >-typedef volatile int OSSLock ; >-#endif >- >- >-/** \brief Exclusive section handle */ >-typedef struct OSSLatch >-{ >- OSSLock lock ; >-#ifdef ENW >- Uint32 init ; /* Used to help identify uninitialized EXS - changed to Uint32 because this file may be included by C code */ >-#else >- bool init ; /* Used to help identify uninitialized EXS */ >-#endif >-} OSSLatch ; >- >- >-/* >- * Special purpose internal initializer macro for OSSLatch types. >- * OSS and OSSe use only. >- */ >-#if defined HPUX >-#define OSSLATCH_STATIC_INITIALIZER \ >-{ {0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00010001}, 1 } >-#elif defined SQLSGI >-#define OSSLATCH_STATIC_INITIALIZER { {0}, 1 } >-#else >-#define OSSLATCH_STATIC_INITIALIZER { 0, 1 } >-#endif >- >- >-/******************************************************************************* >- >- Lock Macros >- >- oss_lockaddr >- Returns the address of the lock in the OSSLatch structure. This >- macro provides the proper cast and/or alignment adjustment >- for the lock. >- >- oss_trylock >- Tries to acquire a lock. If successful, the return value is non-zero. >- If the lock could not be acquired the return value is zero. >- >- oss_checklock >- Returns non-zero if the lock is free. Otherwise, the return value >- is 0 if the lock is held. >- >- oss_unlock >- Frees a lock. Void return. >- >- oss_initlock >- Initializes the lock. Void return. >- >-*******************************************************************************/ >-#if defined _AIX >-#include <sys/atomic_op.h> >- >-#if defined SQLO_USING_VACPP50 >-/* >- * vacpp5 accidentally removed __iospace_sync() as one of the magic known >- * compiler builtins, so we work around it by explictly including their >- * internal header. >- */ >-#include "builtins.h" >-#endif >- >-/* >- * If we acquire the lock, _check_lock will return FALSE because the >- * compare and swap was successful. >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_trylock(pLatch) (FALSE==_check_lock(((atomic_p)oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK,OSS_LATCH_LOCK)) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) (__iospace_sync(), (void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >- >-/******************************************************************************/ >-#elif defined SQLSUN >-#include <synch.h> >- >-OSS_EXTERNC volatile int ldstub( volatile unsigned char * ) ; >- >-/* >- * ldstub returns the previous value of the lock. If the previous >- * value of the lock is OSS_LATCH_UNLOCK then we have obtained the lock. >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==ldstub(oss_lockaddr(pLatch))) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >- >-/******************************************************************************/ >-#elif defined HPUX >- >-OSS_EXTERNC int LDCWS( volatile void * ) ; >-OSS_EXTERNC int LDWSMA( volatile void * ) ; >-OSS_EXTERNC void STWSMA( volatile void *, int ) ; >- >-/* >- * HPUX lock implementation is the reverse of the other platforms. >- * To obtain a lock, we clear (zero) the lock word. When the lock is >- * free, the lock word value is non-zero. Because of this, the >- * ossLatchInit funtion must be used to initialize an EXS. You cannot >- * just memset the EXS to zero and assume you are safe. >- * >- * If a lock is acquired, LDCWS will return the previous lock word >- * value (OSS_LATCH_UNLOCK). If the lock is free, LDWSMA will return >- * OSS_LATCH_UNLOCK. >- */ >-#define oss_lockaddr(pLatch) ((volatile void *)(((uintptr_t)(&((pLatch)->lock))+15)&~15UL)) >-#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==LDCWS(oss_lockaddr(pLatch))) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==LDWSMA(oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(STWSMA(oss_lockaddr(pLatch),OSS_LATCH_UNLOCK))) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >- >-/******************************************************************************/ >-#elif defined SQLSGI >-#include <abi_mutex.h> >- >-/* >- * If acquire_lock gets the lock, the return value is zero. >- * stat_lock returns UNLOCKED if the lock is free. >- * release_lock returns 0 if the lock was successfully freed. >- * init_lock returns 0 if the lock was successfully initialized. >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_trylock(pLatch) (0==acquire_lock((abilock_t*) oss_lockaddr(pLatch))) >-#define oss_checklock(pLatch) (UNLOCKED==stat_lock((abilock_t*) oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(release_lock((abilock_t*) oss_lockaddr(pLatch)))) >-#define oss_initlock(pLatch) ((void)(init_lock((abilock_t*) oss_lockaddr(pLatch)))) >- >-/******************************************************************************/ >-#elif defined SQLWINT >- >-/* >- * Windows >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==InterlockedExchange((LONG *)oss_lockaddr(pLatch),OSS_LATCH_LOCK)) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(InterlockedExchange((LONG *)(oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK))) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >- >-/******************************************************************************/ >-#elif defined SQLO_INTEL_IA32 || defined SQLLinux >- >-/* >- * 32-bit Intel (Linux, Dynix, Unixware, OS/2, ...) or Linux 390 or Linux IA64. >- * >- * Note: this must be kept in sync with the way this is defined >- * in OSS (spinlock.h). This prototype is different than the >- * spinlock.h proto for OS/2, but we don't really care about that >- * anymore. >- */ >-#ifdef ENW >-/* 186134 - using the xchg linux function instead of the DB2 defined sqloxchg */ >-#if defined(__linux__) && defined(__i386__) >- /* 186134 - system.h file uses new as a function parameter name which causes errors >- * compiling as C++ code - so we will redefine new because it is not used >- * in the oss code */ >- #define new newval >-#else >- #include <asm/types.h> >- /* panic function is used to print error messages in asm/system.h */ >- #define panic(a) printf(a) >-#endif >- >-#if defined(__linux__) && (defined SQLO_INTEL_EM64T || defined SQLO_INTEL_IA64) >- /* 186134 - system.h file uses new as a function parameter name which causes errors >- * compiling as C++ code - so we will redefine new because it is not used >- * in the oss code */ >- #define new newval >-#endif >- >-/* the following pre-processor handles various versions of */ >-/* asm/system.h and asm/bitops.h */ >-#include <asm/bitops.h> >-#ifndef LOCK_PREFIX >- #ifdef CONFIG_SMP >- #define LOCK_PREFIX "lock ; " >- #else >- #define LOCK_PREFIX "" >- #endif >-#endif >- >-#include <asm/system.h> >- >-#define sqloxchg(a,b) xchg(a,b) >-#else >-OSS_EXTERNC int sqloxchg( int *, int ) ; >-#endif >- >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==sqloxchg(((int *)oss_lockaddr(pLatch)),OSS_LATCH_LOCK)) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(sqloxchg(((int *)oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK))) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >- >-/******************************************************************************/ >-#elif defined SQLOS390 >- >-/* >- * OS390 >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >-#define oss_unlock(pLatch) ((void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >-#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >- >-#ifdef __cplusplus >-inline int oss_trylock(OSSLatch * pLatch) >-#else >-#pragma inline(oss_trylock) >-int oss_trylock(OSSLatch * pLatch) >-#endif >-{ >- cs_t oldval = OSS_LATCH_UNLOCK; >- return (0==cs(&oldval,((cs_t*)oss_lockaddr(pLatch)),OSS_LATCH_LOCK)); >-} >- >- >-/******************************************************************************/ >-#elif defined SQL_OS400 /*@d170450ssu*/ >- >-/* >- * AS/400 >- */ >- >-/*The lock is implemented using the locksl and unlocksl mi instructions. >- *locksl will lock the byte and unlocksl will unlock it. Note that this >- *instruction does not actually change the value of the byte. The >- *matobjlk instruction can be used to get the status of the lock on the >- *byte. >- */ >-#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >-#define oss_unlock(pLatch) unlocksl((_SPCPTR)oss_lockaddr(pLatch), OSS_LATCH_LOCK ) >-#define oss_initlock(pLatch) >- >-inline int oss_checklock(OSSLatch * pLatch) { >- /* The receiver template used by 'matobjlk'. */ >- _MOBJL_Template_T allocated_locks; >- >- allocated_locks.Template_Size = sizeof( _MOBJL_Template_T ); >- >- //Look at the bit pattern returned by >- //'matobjlk' in the 'Lock_Alloc' field of the template. The fifth >- //bit (bit 4) of this field represents the Lock-Exclusive-No-Read >- //(LENR) lock. >- matobjlk(&allocated_locks, (_ANYPTR)oss_lockaddr(pLatch)); >- >- if ( allocated_locks.Lock_Alloc & OSS_LATCH_LOCK ) { >- return 0; >- } >- return 1; >-} >- >-inline int oss_trylock(OSSLatch * pLatch) { >- //See if already locked >- if(!oss_checklock(pLatch)) { >- return 0; >- } >- >- //Exclusive lock the byte. Catch MCH5804 = locked time out exception >- #pragma exception_handler(isLocked, 0, 0, \ >- _C2_MH_ESCAPE, _CTLA_HANDLE, "MCH5804") >- locksl((_SPCPTR)oss_lockaddr(pLatch), OSS_LATCH_LOCK ); >- #pragma disable_handler >- >- //Make sure that it really is locked >- return !oss_checklock(pLatch); >- >- isLocked: >- return 0; >-} >- >- >-/******************************************************************************/ >-#else >-#error Unsupported platform >-#endif >- >-/* bugzilla 64229 - adding #include "RASharedMemory.h" to RAServerTypes2.h >- causes this file to be included for all of the RAServer c files. On >- Solaris this causes a link problem because the following functions are >- mutiply defined. So for Solaris we won't define these functions for >- C files >-*/ >-#if (!defined(SQLSUN) && !defined(__powerpc64__)) || defined(__cplusplus) >- >-#ifdef ENW >-#ifndef __cplusplus >-void OSS_API ossLatchInit ( OSSLatch * pLatch ); >-void OSS_API ossLatchGet( OSSLatch * pLatch ); >-int OSS_API ossLatchTestGet( OSSLatch * pLatch ); >-void OSS_API ossLatchRelease ( OSSLatch * pLatch ); >-#endif >-#endif >- >-/** >- \brief Initializes a latch. >- >- \param pLatch [in] >- Address of a latch handle. >- */ >-#ifdef __cplusplus >-inline void OSS_API ossLatchInit ( OSSLatch * pLatch ) >-#else >-#pragma inline(ossLatchInit) >-void OSS_API ossLatchInit ( OSSLatch * pLatch ) >-#endif >-{ >- OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >- >-#if defined HPUX >- /* >- * Fill the OSSLatch structure with a unique eye-catching value then >- * oss_unlock the particular lock word within the structure. This way >- * it will be easier to identify the lock word in a dump of an HPUX >- * OSSLatch structure. >- */ >- memset( (void *)&(pLatch->lock), OSS_DEBUG_CHAR, sizeof( pLatch->lock ) ) ; >-#endif >- oss_initlock( pLatch ) ; >- pLatch->init = 1 ; >- return ; >-} >- >- >-/** >- \brief Gets a latch. >- >- \note The latch handle must be initialized prior to using this function! >- >- \param pLatch [in] >- Address of a latch handle. >- */ >-#ifdef __cplusplus >-inline void OSS_API ossLatchGet( OSSLatch * pLatch ) >-#else >-#pragma inline(ossLatchGet) >-void OSS_API ossLatchGet( OSSLatch * pLatch ) >-#endif >-{ >- volatile int i, j, k ; >- >- OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >- OSS_ASSERT( pLatch->init ) ; >- >- while ( !oss_trylock( pLatch ) ) >- { >- /* Spin */ >- for ( k = 0, i = 1; !oss_checklock( pLatch ); i++ ) >- { >- if ( ( i & 0x1 ) && ( k & 0xFFFF ) ) >- ossYield() ; >- else >- for ( j = 0 ; j < 20 ; j++ ) >- k += i * j + 5 ; >- } >- } >- return ; >-} >- >- >-/** >- \brief Tests and gets a latch if available. >- >- \note The latch handle must be initialized prior to using this function! >- >- \param pLatch [in] >- Address of a latch handle. >- >- \returns If the latch is available, the function returns true and >- gets the latch. Otherwise, the return value is false. >- */ >-/* 186134 - changed return type to int from bool because this could be included from C code */ >-#ifdef __cplusplus >-inline int OSS_API ossLatchTestGet( OSSLatch * pLatch ) >-#else >-#pragma inline(ossLatchTestGet) >-int OSS_API ossLatchTestGet( OSSLatch * pLatch ) >-#endif >-{ >- OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >- OSS_ASSERT( pLatch->init ) ; >- >- if ( oss_trylock( pLatch ) ) >- { >- return 1 ; >- } >- else >- { >- return 0 ; >- } >-} >- >- >-/** >- \brief Release the latch. >- >- \note The latch handle must be initialized prior to using this function! >- >- \param pLatch [in] >- Address of a latch handle. >- */ >-#ifdef __cplusplus >-inline void OSS_API ossLatchRelease ( OSSLatch * pLatch ) >-#else >-#pragma inline(ossLatchRelease) >-void OSS_API ossLatchRelease ( OSSLatch * pLatch ) >-#endif >-{ >- OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >- OSS_ASSERT( pLatch->init ) ; >- >- oss_unlock( pLatch ) ; >- return ; >-} >- >-#endif /* 64229 */ >- >-#endif >+/********************************************************************** >+ * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: osslatch.h,v 1.7 2005/08/19 19:50:24 vnaikawadi Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+/******************************************************************************* >+ >+ >+ Change Activity: >+ defect Date Who Description >+ ====== =========== === ============================================== >+ 161881 Nov/30/2000 pj Various changes. >+ 162293 Jan/29/2001 hdp IA64 Windows port >+ 165795 Feb/02/2001 jpk Forward fitted v7.2 EXS implementation >+ 166622 Feb/12/2001 jpk Fix SUN build >+ 170450 Mar/20/2001 ssu AS400 port changes >+ 173377 Apr/24/2001 jpk Removed SQLSIN >+ 179937 Jun/16/2001 jpk Added ossExsTestEnter() and changed 32-bit Windows >+ to use InterlockedExchanged() >+ 191482 Oct/19/2001 jpk Added some comments >+ 192160 Oct/23/2001 jpk Added more comments >+ 192091 Nov/12/2001 yka Code cleanup Phase V >+ 195526 Nov/13/2001 yka Code cleanup Phase VI >+ 189356 Nov/15/2001 yka Added OSSEXS_STATIC_INITIALIZER >+ 195525 Nov/20/2001 yka Rename OSSExs to OSSLatch >+ 186134 Mar/01/2002 dns changes so this file can be compiled as C code >+ on some platforms >+ >+*******************************************************************************/ >+ >+/** >+ \file osslatch.h >+ \brief OSSe short-duration exclusive spin latch (lock) >+ */ >+ >+#ifndef OSSLATCH_HEADER_INCLUDED >+#define OSSLATCH_HEADER_INCLUDED >+ >+/* System includes */ >+#include <stdio.h> >+#include <stdlib.h> >+#include <memory.h> >+ >+/* OSSe includes */ >+#include "oss.h" >+#include "ossdebug.h" >+#ifndef ENW >+#include "ossfeat.h" >+#endif >+#include "osstime.h" >+ >+#if defined SQL_OS400 >+ #include <mih/locksl.h> >+ #include <mih/unlocksl.h> >+ #include <mih/matobjlk.h> >+ #include <except.h> >+#endif >+ >+#if defined SQL_OS400 >+ #define OSS_LATCH_LOCK _LENR_LOCK >+ #define OSS_LATCH_UNLOCK 0 >+#else >+ #if !defined HPUX >+ #define OSS_LATCH_LOCK 1 >+ #define OSS_LATCH_UNLOCK 0 >+ #else >+ #define OSS_LATCH_LOCK 0 >+ #define OSS_LATCH_UNLOCK 1 >+ #define OSS_DEBUG_CHAR 0xCC /* 186134 - used by HP code */ >+ #endif >+#endif >+ >+/******************************************************************************* >+ >+ IMPORTANT: Keep the size and layout of the lock type and OSSLatch structure >+ the consistent between 32- and 64-bit architectures. >+ >+ The size/layout does NOT have to be the same cross-platforms. For example, >+ AIX and NT don't require a common lock type. BUT, the size/layout must be >+ common between 32- and 64-bit AIX. >+ >+ Why? It is not uncommon for these structures to be used in shared >+ memory that is accessed by both 32- and 64-bit processes. >+ >+*******************************************************************************/ >+ >+/* >+ * LOCK TYPE >+ */ >+#if defined SQLSUN >+typedef volatile unsigned char OSSLock ; >+#elif defined SQLWINT >+/* Note: LONG is the same on 32- and 64-bit Windows platforms */ >+#include <windows.h> /* 186134 */ >+#include <winbase.h> /* 186134 - required for InterlockedExchange */ >+typedef volatile LONG OSSLock ; >+#elif defined HPUX >+typedef volatile struct { int x[5] ; } OSSLock ; >+#elif defined SQL_OS400 >+typedef volatile unsigned char OSSLock ; >+#elif defined SQLSGI >+/* The lock word size in abilock_t is the same for both 32- and 64-bit */ >+#include <abi_mutex.h> >+typedef volatile abilock_t OSSLock ; >+#else >+typedef volatile int OSSLock ; >+#endif >+ >+ >+/** \brief Exclusive section handle */ >+typedef struct OSSLatch >+{ >+ OSSLock lock ; >+#ifdef ENW >+ Uint32 init ; /* Used to help identify uninitialized EXS - changed to Uint32 because this file may be included by C code */ >+#else >+ bool init ; /* Used to help identify uninitialized EXS */ >+#endif >+} OSSLatch ; >+ >+ >+/* >+ * Special purpose internal initializer macro for OSSLatch types. >+ * OSS and OSSe use only. >+ */ >+#if defined HPUX >+#define OSSLATCH_STATIC_INITIALIZER \ >+{ {0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00010001}, 1 } >+#elif defined SQLSGI >+#define OSSLATCH_STATIC_INITIALIZER { {0}, 1 } >+#else >+#define OSSLATCH_STATIC_INITIALIZER { 0, 1 } >+#endif >+ >+ >+/******************************************************************************* >+ >+ Lock Macros >+ >+ oss_lockaddr >+ Returns the address of the lock in the OSSLatch structure. This >+ macro provides the proper cast and/or alignment adjustment >+ for the lock. >+ >+ oss_trylock >+ Tries to acquire a lock. If successful, the return value is non-zero. >+ If the lock could not be acquired the return value is zero. >+ >+ oss_checklock >+ Returns non-zero if the lock is free. Otherwise, the return value >+ is 0 if the lock is held. >+ >+ oss_unlock >+ Frees a lock. Void return. >+ >+ oss_initlock >+ Initializes the lock. Void return. >+ >+*******************************************************************************/ >+#if defined _AIX >+#include <sys/atomic_op.h> >+ >+#if defined SQLO_USING_VACPP50 >+/* >+ * vacpp5 accidentally removed __iospace_sync() as one of the magic known >+ * compiler builtins, so we work around it by explictly including their >+ * internal header. >+ */ >+#include "builtins.h" >+#endif >+ >+/* >+ * If we acquire the lock, _check_lock will return FALSE because the >+ * compare and swap was successful. >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_trylock(pLatch) (FALSE==_check_lock(((atomic_p)oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK,OSS_LATCH_LOCK)) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) (__iospace_sync(), (void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+ >+/******************************************************************************/ >+#elif defined SQLSUN >+#include <synch.h> >+ >+OSS_EXTERNC volatile int ldstub( volatile unsigned char * ) ; >+ >+/* >+ * ldstub returns the previous value of the lock. If the previous >+ * value of the lock is OSS_LATCH_UNLOCK then we have obtained the lock. >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==ldstub(oss_lockaddr(pLatch))) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+ >+/******************************************************************************/ >+#elif defined HPUX >+ >+OSS_EXTERNC int LDCWS( volatile void * ) ; >+OSS_EXTERNC int LDWSMA( volatile void * ) ; >+OSS_EXTERNC void STWSMA( volatile void *, int ) ; >+ >+/* >+ * HPUX lock implementation is the reverse of the other platforms. >+ * To obtain a lock, we clear (zero) the lock word. When the lock is >+ * free, the lock word value is non-zero. Because of this, the >+ * ossLatchInit funtion must be used to initialize an EXS. You cannot >+ * just memset the EXS to zero and assume you are safe. >+ * >+ * If a lock is acquired, LDCWS will return the previous lock word >+ * value (OSS_LATCH_UNLOCK). If the lock is free, LDWSMA will return >+ * OSS_LATCH_UNLOCK. >+ */ >+#define oss_lockaddr(pLatch) ((volatile void *)(((uintptr_t)(&((pLatch)->lock))+15)&~15UL)) >+#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==LDCWS(oss_lockaddr(pLatch))) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==LDWSMA(oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(STWSMA(oss_lockaddr(pLatch),OSS_LATCH_UNLOCK))) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+ >+/******************************************************************************/ >+#elif defined SQLSGI >+#include <abi_mutex.h> >+ >+/* >+ * If acquire_lock gets the lock, the return value is zero. >+ * stat_lock returns UNLOCKED if the lock is free. >+ * release_lock returns 0 if the lock was successfully freed. >+ * init_lock returns 0 if the lock was successfully initialized. >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_trylock(pLatch) (0==acquire_lock((abilock_t*) oss_lockaddr(pLatch))) >+#define oss_checklock(pLatch) (UNLOCKED==stat_lock((abilock_t*) oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(release_lock((abilock_t*) oss_lockaddr(pLatch)))) >+#define oss_initlock(pLatch) ((void)(init_lock((abilock_t*) oss_lockaddr(pLatch)))) >+ >+/******************************************************************************/ >+#elif defined SQLWINT >+ >+/* >+ * Windows >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==InterlockedExchange((LONG *)oss_lockaddr(pLatch),OSS_LATCH_LOCK)) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(InterlockedExchange((LONG *)(oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK))) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+ >+/******************************************************************************/ >+#elif defined SQLO_INTEL_IA32 || defined SQLLinux >+ >+/* >+ * 32-bit Intel (Linux, Dynix, Unixware, OS/2, ...) or Linux 390 or Linux IA64. >+ * >+ * Note: this must be kept in sync with the way this is defined >+ * in OSS (spinlock.h). This prototype is different than the >+ * spinlock.h proto for OS/2, but we don't really care about that >+ * anymore. >+ */ >+#ifdef ENW >+/* 186134 - using the xchg linux function instead of the DB2 defined sqloxchg */ >+#if defined(__linux__) && defined(__i386__) >+ /* 186134 - system.h file uses new as a function parameter name which causes errors >+ * compiling as C++ code - so we will redefine new because it is not used >+ * in the oss code */ >+ #define new newval >+#elif defined(__linux__) && defined(__powerpc64__) /* SW: Need to revisit this - why Linux/ppc64 is so different */ >+ #include "osslatch.linux_ppc64.h" >+ #define panic(a) printf(a) >+#else >+ #include <asm/types.h> >+ /* panic function is used to print error messages in asm/system.h */ >+ #define panic(a) printf(a) >+#endif >+ >+#if defined(__linux__) && (defined SQLO_INTEL_EM64T || defined SQLO_INTEL_IA64) >+ /* 186134 - system.h file uses new as a function parameter name which causes errors >+ * compiling as C++ code - so we will redefine new because it is not used >+ * in the oss code */ >+ #define new newval >+#endif >+ >+/* the following pre-processor handles various versions of */ >+/* asm/system.h and asm/bitops.h */ >+#include <asm/bitops.h> >+#ifndef LOCK_PREFIX >+ #ifdef CONFIG_SMP >+ #define LOCK_PREFIX "lock ; " >+ #else >+ #define LOCK_PREFIX "" >+ #endif >+#endif >+ >+#if defined(__linux__) && defined(__powerpc64__) /* SW: Need to revisit this - why Linux/ppc64 is so different */ >+ /* Do not include system.h since it won't compile */ >+#else >+ #include <asm/system.h> >+#endif >+ >+#define sqloxchg(a,b) xchg(a,b) >+#else >+OSS_EXTERNC int sqloxchg( int *, int ) ; >+#endif >+ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_trylock(pLatch) (OSS_LATCH_UNLOCK==sqloxchg(((int *)oss_lockaddr(pLatch)),OSS_LATCH_LOCK)) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(sqloxchg(((int *)oss_lockaddr(pLatch)),OSS_LATCH_UNLOCK))) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+ >+/******************************************************************************/ >+#elif defined SQLOS390 >+ >+/* >+ * OS390 >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_checklock(pLatch) (OSS_LATCH_UNLOCK==(*oss_lockaddr(pLatch))) >+#define oss_unlock(pLatch) ((void)(*oss_lockaddr(pLatch)=OSS_LATCH_UNLOCK)) >+#define oss_initlock(pLatch) ((void)(oss_unlock((pLatch)))) >+ >+#ifdef __cplusplus >+inline int oss_trylock(OSSLatch * pLatch) >+#else >+#pragma inline(oss_trylock) >+int oss_trylock(OSSLatch * pLatch) >+#endif >+{ >+ cs_t oldval = OSS_LATCH_UNLOCK; >+ return (0==cs(&oldval,((cs_t*)oss_lockaddr(pLatch)),OSS_LATCH_LOCK)); >+} >+ >+ >+/******************************************************************************/ >+#elif defined SQL_OS400 /*@d170450ssu*/ >+ >+/* >+ * AS/400 >+ */ >+ >+/*The lock is implemented using the locksl and unlocksl mi instructions. >+ *locksl will lock the byte and unlocksl will unlock it. Note that this >+ *instruction does not actually change the value of the byte. The >+ *matobjlk instruction can be used to get the status of the lock on the >+ *byte. >+ */ >+#define oss_lockaddr(pLatch) (&((pLatch)->lock)) >+#define oss_unlock(pLatch) unlocksl((_SPCPTR)oss_lockaddr(pLatch), OSS_LATCH_LOCK ) >+#define oss_initlock(pLatch) >+ >+inline int oss_checklock(OSSLatch * pLatch) { >+ /* The receiver template used by 'matobjlk'. */ >+ _MOBJL_Template_T allocated_locks; >+ >+ allocated_locks.Template_Size = sizeof( _MOBJL_Template_T ); >+ >+ //Look at the bit pattern returned by >+ //'matobjlk' in the 'Lock_Alloc' field of the template. The fifth >+ //bit (bit 4) of this field represents the Lock-Exclusive-No-Read >+ //(LENR) lock. >+ matobjlk(&allocated_locks, (_ANYPTR)oss_lockaddr(pLatch)); >+ >+ if ( allocated_locks.Lock_Alloc & OSS_LATCH_LOCK ) { >+ return 0; >+ } >+ return 1; >+} >+ >+inline int oss_trylock(OSSLatch * pLatch) { >+ //See if already locked >+ if(!oss_checklock(pLatch)) { >+ return 0; >+ } >+ >+ //Exclusive lock the byte. Catch MCH5804 = locked time out exception >+ #pragma exception_handler(isLocked, 0, 0, \ >+ _C2_MH_ESCAPE, _CTLA_HANDLE, "MCH5804") >+ locksl((_SPCPTR)oss_lockaddr(pLatch), OSS_LATCH_LOCK ); >+ #pragma disable_handler >+ >+ //Make sure that it really is locked >+ return !oss_checklock(pLatch); >+ >+ isLocked: >+ return 0; >+} >+ >+ >+/******************************************************************************/ >+#else >+#error Unsupported platform >+#endif >+ >+/* bugzilla 64229 - adding #include "RASharedMemory.h" to RAServerTypes2.h >+ causes this file to be included for all of the RAServer c files. On >+ Solaris this causes a link problem because the following functions are >+ mutiply defined. So for Solaris we won't define these functions for >+ C files >+*/ >+#if (!defined(SQLSUN) && !defined(__powerpc64__)) || defined(__cplusplus) >+ >+#ifdef ENW >+#ifndef __cplusplus >+void OSS_API ossLatchInit ( OSSLatch * pLatch ); >+void OSS_API ossLatchGet( OSSLatch * pLatch ); >+int OSS_API ossLatchTestGet( OSSLatch * pLatch ); >+void OSS_API ossLatchRelease ( OSSLatch * pLatch ); >+#endif >+#endif >+ >+/** >+ \brief Initializes a latch. >+ >+ \param pLatch [in] >+ Address of a latch handle. >+ */ >+#ifdef __cplusplus >+inline void OSS_API ossLatchInit ( OSSLatch * pLatch ) >+#else >+#pragma inline(ossLatchInit) >+void OSS_API ossLatchInit ( OSSLatch * pLatch ) >+#endif >+{ >+ OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >+ >+#if defined HPUX >+ /* >+ * Fill the OSSLatch structure with a unique eye-catching value then >+ * oss_unlock the particular lock word within the structure. This way >+ * it will be easier to identify the lock word in a dump of an HPUX >+ * OSSLatch structure. >+ */ >+ memset( (void *)&(pLatch->lock), OSS_DEBUG_CHAR, sizeof( pLatch->lock ) ) ; >+#endif >+ oss_initlock( pLatch ) ; >+ pLatch->init = 1 ; >+ return ; >+} >+ >+ >+/** >+ \brief Gets a latch. >+ >+ \note The latch handle must be initialized prior to using this function! >+ >+ \param pLatch [in] >+ Address of a latch handle. >+ */ >+#ifdef __cplusplus >+inline void OSS_API ossLatchGet( OSSLatch * pLatch ) >+#else >+#pragma inline(ossLatchGet) >+void OSS_API ossLatchGet( OSSLatch * pLatch ) >+#endif >+{ >+ volatile int i, j, k ; >+ >+ OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >+ OSS_ASSERT( pLatch->init ) ; >+ >+ while ( !oss_trylock( pLatch ) ) >+ { >+ /* Spin */ >+ for ( k = 0, i = 1; !oss_checklock( pLatch ); i++ ) >+ { >+ if ( ( i & 0x1 ) && ( k & 0xFFFF ) ) >+ ossYield() ; >+ else >+ for ( j = 0 ; j < 20 ; j++ ) >+ k += i * j + 5 ; >+ } >+ } >+ return ; >+} >+ >+ >+/** >+ \brief Tests and gets a latch if available. >+ >+ \note The latch handle must be initialized prior to using this function! >+ >+ \param pLatch [in] >+ Address of a latch handle. >+ >+ \returns If the latch is available, the function returns true and >+ gets the latch. Otherwise, the return value is false. >+ */ >+/* 186134 - changed return type to int from bool because this could be included from C code */ >+#ifdef __cplusplus >+inline int OSS_API ossLatchTestGet( OSSLatch * pLatch ) >+#else >+#pragma inline(ossLatchTestGet) >+int OSS_API ossLatchTestGet( OSSLatch * pLatch ) >+#endif >+{ >+ OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >+ OSS_ASSERT( pLatch->init ) ; >+ >+ if ( oss_trylock( pLatch ) ) >+ { >+ return 1 ; >+ } >+ else >+ { >+ return 0 ; >+ } >+} >+ >+ >+/** >+ \brief Release the latch. >+ >+ \note The latch handle must be initialized prior to using this function! >+ >+ \param pLatch [in] >+ Address of a latch handle. >+ */ >+#ifdef __cplusplus >+inline void OSS_API ossLatchRelease ( OSSLatch * pLatch ) >+#else >+#pragma inline(ossLatchRelease) >+void OSS_API ossLatchRelease ( OSSLatch * pLatch ) >+#endif >+{ >+ OSS_ASSERT( !ossIsBadWritePtr( pLatch, sizeof( *pLatch ) ) ) ; >+ OSS_ASSERT( pLatch->init ) ; >+ >+ oss_unlock( pLatch ) ; >+ return ; >+} >+ >+#endif /* 64229 */ >+ >+#endif >Index: src-native-new/src/transport/RASharedMemory/RASharedMemory.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RASharedMemory.h,v >retrieving revision 1.3 >diff -u -r1.3 RASharedMemory.h >--- src-native-new/src/transport/RASharedMemory/RASharedMemory.h 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/RASharedMemory.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -81,5 +81,6 @@ > > RASHMEXTERN int ra_getShmAttachCount(ra_shm_handle_t *handle); > RASHMEXTERN ra_shm_err_t ra_setShmAttachCount(ra_shm_handle_t *handle, int count); >+RASHMEXTERN ra_shm_err_t ra_stopFlusher(ra_shm_handle_t *handle); > > #endif >Index: src-native-new/bin/readme.txt >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/bin/readme.txt,v >retrieving revision 1.16 >diff -u -r1.16 readme.txt >--- src-native-new/bin/readme.txt 7 Jul 2006 22:11:24 -0000 1.16 >+++ src-native-new/bin/readme.txt 16 Mar 2007 14:50:55 -0000 >@@ -260,25 +260,19 @@ > (c) [EM64T only:] Change /machine:IA64 to /machine:AMD64 for those same > LINK32_FLAGS specifications. > >-2) Download the current RAC SDK from the download site at >-http://www.eclipse.org/tptp/home/downloads/downloads.php >-(i.e., tptpdc.win_<platform>.sdk-<timestamp>.zip) and unzip that package into a >-directory, then set the environment variable RAC_SDK_HOME to point to that >-directory. >- >-3) Download the current CBE SDK from the from the download site at >+2) Download the current CBE SDK from the from the download site at > http://www.eclipse.org/tptp/home/downloads/downloads.php > (i.e., cbe.win_<platform>.sdk-<timestamp>.zip) and unzip that package into a > directory, then set the environment variable CBE_SDK_HOME to point to that > directory. > >-4) Install Java - J2SE 1.4.0 or above and follow the install intructions on >+3) Install Java - J2SE 1.4.0 or above and follow the install intructions on > http://java.sun.com/j2se/index.jsp website. > > Set the environment variable JAVA_HOME to point to the directory containing the > Java include and lib directories. > >-5) For Windows-IA32, open the agent controller MSVC++ workspace file, >+4) For Windows-IA32, open the agent controller MSVC++ workspace file, > tptp_ac.dsw, located in the build directory. Under Project, Set Active Project > to "BuildMost" and then under Build, select "Build". > >@@ -293,7 +287,7 @@ > => Set Win Svr 2003 {IA64 for IPF | x64 for EM64T} Build Env), change directory > to your installation build directory, and invoke "NMAKE BuildAll.mak64". > >-6) To build the C++ samples on Windows-IA32, open the MSVC++ workspace >+5) To build the C++ samples on Windows-IA32, open the MSVC++ workspace > tptp_samples.dsw. Under Project, Set Active Project to "BuildAllSamples" and > then under Build, select "Build". > >@@ -305,7 +299,7 @@ > NOTE: The Agent Controller must be running prior to executing any of these > samples in order for them to succeed. > >-7) To build the Java Base Agent, open the MSVC++ workspace tptp_javaagent.dsw. >+6) To build the Java Base Agent, open the MSVC++ workspace tptp_javaagent.dsw. > Set the JAVA_HOME environment variable to point to the directory where java is > installed. Under Project, Set Active Project to "javaBaseAgent" and then under > Build, select "Build". >@@ -322,28 +316,22 @@ > Set the environment variable XERCESC_HOME to point to the directory containing > the Xerces include and lib directories. > >-2) Download the current RAC SDK from the download site at >-http://www.eclipse.org/tptp/home/downloads/downloads.php >-(i.e., tptpdc.linux_<platform>.sdk-<timestamp>.zip) and unzip that package into >-a directory, then set the environment variable RAC_SDK_HOME to point to that >-directory. >- >-3) Download the current CBE SDK from the from the download site at >+2) Download the current CBE SDK from the from the download site at > http://www.eclipse.org/tptp/home/downloads/downloads.php > (i.e., cbe.linux_<platform>.sdk-<timestamp>.zip) and unzip that package into a > directory, then set the environment variable CBE_SDK_HOME to point to that > directory. > >-4) Install Java - J2SE 1.4.0 or above and follow the install intructions on >+3) Install Java - J2SE 1.4.0 or above and follow the install intructions on > http://java.sun.com/j2se/index.jsp website. > > Set the environment variable JAVA_HOME to point to the directory containing the > Java include and lib directories. > >-5) Add the AC's lib directory and $XERCESC_HOME/lib to the LD_LIBRARY_PATH >+4) Add the AC's lib directory and $XERCESC_HOME/lib to the LD_LIBRARY_PATH > environment variable. > >-6) Run the following build script files located in the build directory. You may >+5) Run the following build script files located in the build directory. You may > need to run dos2unix if they were checked out in DOS format and add execute > permissions (chmod a+x) on these files before executing them: > build_tptp_ac.script[64] (add the 64 extension for IPF and EM64T) >Index: src-native-new/src/transport/RASocket/RASocket.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.h,v >retrieving revision 1.2 >diff -u -r1.2 RASocket.h >--- src-native-new/src/transport/RASocket/RASocket.h 24 Jul 2005 08:33:48 -0000 1.2 >+++ src-native-new/src/transport/RASocket/RASocket.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASocket/RASocket.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.make,v >retrieving revision 1.4 >diff -u -r1.4 RASocket.make >--- src-native-new/src/transport/RASocket/RASocket.make 1 Apr 2006 03:13:22 -0000 1.4 >+++ src-native-new/src/transport/RASocket/RASocket.make 16 Mar 2007 14:50:56 -0000 >@@ -22,7 +22,7 @@ > # > #----------------------------------- > TARGET := libhccls >-TARGETDIR := $(RAC_SDK_HOME)/lib >+TARGETDIR := ../../../lib > > if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi > if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := . ../../../include ../RACommon >+INCLUDEDIRS := . ../../../include ../RACommon $(JAVA_HOME)/include $(JAVA_HOME)/include/linux > > > #----------------------------------- >@@ -50,7 +50,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := $(RAC_SDK_HOME)/lib ../../../lib >+LIBDIRS := ../../../lib > > > #----------------------------------- >@@ -74,11 +74,11 @@ > > DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/RASocket/resource.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/resource.h,v >retrieving revision 1.4 >diff -u -r1.4 resource.h >--- src-native-new/src/transport/RASocket/resource.h 4 Apr 2006 22:14:58 -0000 1.4 >+++ src-native-new/src/transport/RASocket/resource.h 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005,2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >Index: src-native-new/src/transport/RASocket/RASocket.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.c,v >retrieving revision 1.3 >diff -u -r1.3 RASocket.c >--- src-native-new/src/transport/RASocket/RASocket.c 26 Sep 2005 22:13:37 -0000 1.3 >+++ src-native-new/src/transport/RASocket/RASocket.c 16 Mar 2007 14:50:56 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -14,12 +14,11 @@ > #ifdef _WIN32 /* Win32 */ > #include <winsock2.h> /* 9707 */ > #include <io.h> >+#include <stdio.h> > #else /* else */ > #include <sys/types.h> > #include <sys/socket.h> > #include <netinet/in.h> >-#include <stdlib.h> >-#include <string.h> > #ifndef MVS > #include <netinet/tcp.h> > #endif >@@ -663,7 +662,7 @@ > SOCKET *sockfd) { > > struct sockaddr_in serverAddress; >- /* unsigned short localPortNum=DATA_PORT_NUM_CLIENT;*/ >+ unsigned short localPortNum=DATA_PORT_NUM_CLIENT; > int enable=1; > BOOL nagle=FALSE; > struct linger linger; >Index: src-native-new/test/PerfmonAgent/PerfmonAgent.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/test/PerfmonAgent/PerfmonAgent.make,v >retrieving revision 1.1 >diff -u -r1.1 PerfmonAgent.make >--- src-native-new/test/PerfmonAgent/PerfmonAgent.make 5 Jun 2006 22:52:16 -0000 1.1 >+++ src-native-new/test/PerfmonAgent/PerfmonAgent.make 16 Mar 2007 14:50:56 -0000 >@@ -15,7 +15,7 @@ > > TARGETDIR := ../../bin > LIBDIR := ../../lib >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib >+LIBDIRS := ../../lib > PERFLINLIB := $(LIBDIR)/libperflin.so > SUPPORTLIB := $(LIBDIR)/libresutils.a > RESUTILOBJS := library.o clock.o hashtable.o random.o streq.o thread.o mutex.o >Index: src-native-new/src/agents/tptpProcessController/TPTPProcessController.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/tptpProcessController/TPTPProcessController.make,v >retrieving revision 1.8 >diff -u -r1.8 TPTPProcessController.make >--- src-native-new/src/agents/tptpProcessController/TPTPProcessController.make 1 Apr 2006 03:37:22 -0000 1.8 >+++ src-native-new/src/agents/tptpProcessController/TPTPProcessController.make 16 Mar 2007 14:50:55 -0000 >@@ -20,7 +20,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -54,11 +54,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/TPTPClientCompTL/TPTPClientCompTL.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/TPTPClientCompTL.make,v >retrieving revision 1.5 >diff -u -r1.5 TPTPClientCompTL.make >--- src-native-new/src/transport/TPTPClientCompTL/TPTPClientCompTL.make 7 Feb 2007 19:08:35 -0000 1.5 >+++ src-native-new/src/transport/TPTPClientCompTL/TPTPClientCompTL.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/MyFileTransferClient/MyFileTransferClient.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/MyFileTransferClient/MyFileTransferClient.make,v >retrieving revision 1.2 >diff -u -r1.2 MyFileTransferClient.make >--- src-native-new/samples/MyFileTransferClient/MyFileTransferClient.make 1 Apr 2006 03:37:21 -0000 1.2 >+++ src-native-new/samples/MyFileTransferClient/MyFileTransferClient.make 16 Mar 2007 14:50:55 -0000 >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -55,11 +55,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/agentController/AgentController.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agentController/AgentController.make,v >retrieving revision 1.8 >diff -u -r1.8 AgentController.make >--- src-native-new/src/agentController/AgentController.make 11 May 2006 18:14:26 -0000 1.8 >+++ src-native-new/src/agentController/AgentController.make 16 Mar 2007 14:50:55 -0000 >@@ -21,7 +21,7 @@ > # (separated by blanks) > #----------------------------------- > >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -58,11 +58,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 -D_TPTP_DIAGNOSTIC_ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 -D_TPTP_DIAGNOSTIC_ > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/Compatibility/CompClient.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/Compatibility/CompClient.make,v >retrieving revision 1.2 >diff -u -r1.2 CompClient.make >--- src-native-new/samples/Compatibility/CompClient.make 1 Apr 2006 03:37:23 -0000 1.2 >+++ src-native-new/samples/Compatibility/CompClient.make 16 Mar 2007 14:50:55 -0000 >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -55,11 +55,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/shared/TPTPUtil/TPTPUtils.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/TPTPUtil/TPTPUtils.make,v >retrieving revision 1.9 >diff -u -r1.9 TPTPUtils.make >--- src-native-new/src/shared/TPTPUtil/TPTPUtils.make 1 Apr 2006 03:19:04 -0000 1.9 >+++ src-native-new/src/shared/TPTPUtil/TPTPUtils.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/makefile >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile,v >retrieving revision 1.47 >diff -u -r1.47 makefile >--- src-native-new/makefile 7 Feb 2007 19:08:35 -0000 1.47 >+++ src-native-new/makefile 16 Mar 2007 14:50:55 -0000 >@@ -57,7 +57,6 @@ > cp about.linux.html packaging/about.html > cp -d lib/lib* packaging/lib > cp $(XERCESC_HOME)/lib/libxer* packaging/lib >- cp -d $(RAC_SDK_HOME)/lib/* packaging/lib > cp -r about_files packaging > cp -r config packaging > cp -r agents packaging >Index: src-native-new/makefile.win_ipf >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile.win_ipf,v >retrieving revision 1.14 >diff -u -r1.14 makefile.win_ipf >--- src-native-new/makefile.win_ipf 7 Jul 2006 22:11:25 -0000 1.14 >+++ src-native-new/makefile.win_ipf 16 Mar 2007 14:50:55 -0000 >@@ -22,8 +22,6 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin > if exist $(XERCESC_HOME)\bin\xerces-c_2_6.dll copy /y $(XERCESC_HOME)\bin\xerces-c_2_6.dll packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging >Index: src-native-new/makefile.win_em64t >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile.win_em64t,v >retrieving revision 1.12 >diff -u -r1.12 makefile.win_em64t >--- src-native-new/makefile.win_em64t 7 Jul 2006 22:11:25 -0000 1.12 >+++ src-native-new/makefile.win_em64t 16 Mar 2007 14:50:55 -0000 >@@ -22,8 +22,6 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging > if exist $(TEMP_LICENSE_HOME)\notice.html copy /y $(TEMP_LICENSE_HOME)\notice.html packaging >Index: src-native-new/makedebug.win_ipf >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makedebug.win_ipf,v >retrieving revision 1.2 >diff -u -r1.2 makedebug.win_ipf >--- src-native-new/makedebug.win_ipf 7 Jul 2006 22:11:25 -0000 1.2 >+++ src-native-new/makedebug.win_ipf 16 Mar 2007 14:50:55 -0000 >@@ -22,8 +22,6 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin > if exist $(XERCESC_HOME)\bin\xerces-c_2_6.dll copy /y $(XERCESC_HOME)\bin\xerces-c_2_6.dll packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging >Index: src-native-new/makedebug.win_em64t >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makedebug.win_em64t,v >retrieving revision 1.2 >diff -u -r1.2 makedebug.win_em64t >--- src-native-new/makedebug.win_em64t 7 Jul 2006 22:11:25 -0000 1.2 >+++ src-native-new/makedebug.win_em64t 16 Mar 2007 14:50:55 -0000 >@@ -22,8 +22,6 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin > if exist $(XERCESC_HOME)\bin\xerces-c_2_6.dll copy /y $(XERCESC_HOME)\bin\xerces-c_2_6.dll packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging >Index: src-native-new/src/agents/agentBase/AgentBase.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/agentBase/AgentBase.make,v >retrieving revision 1.10 >diff -u -r1.10 AgentBase.make >--- src-native-new/src/agents/agentBase/AgentBase.make 1 Apr 2006 03:37:23 -0000 1.10 >+++ src-native-new/src/agents/agentBase/AgentBase.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include ../../../include ../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket ../../../include ../../include ${XERCESC_HOME}/include > > #----------------------------------- > # list of additional libraries to be linked with >@@ -70,11 +70,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/agents/FileTransferAgent/FileTransferAgent.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/FileTransferAgent/FileTransferAgent.make,v >retrieving revision 1.4 >diff -u -r1.4 FileTransferAgent.make >--- src-native-new/src/agents/FileTransferAgent/FileTransferAgent.make 1 Apr 2006 03:37:24 -0000 1.4 >+++ src-native-new/src/agents/FileTransferAgent/FileTransferAgent.make 16 Mar 2007 14:50:55 -0000 >@@ -20,7 +20,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -54,11 +54,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/SampleClient/SampleClient.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/SampleClient/SampleClient.make,v >retrieving revision 1.6 >diff -u -r1.6 SampleClient.make >--- src-native-new/samples/SampleClient/SampleClient.make 1 Apr 2006 03:37:23 -0000 1.6 >+++ src-native-new/samples/SampleClient/SampleClient.make 16 Mar 2007 14:50:55 -0000 >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -55,11 +55,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/SimpleAppl/SimpleAppl.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/SimpleAppl/SimpleAppl.make,v >retrieving revision 1.2 >diff -u -r1.2 SimpleAppl.make >--- src-native-new/samples/SimpleAppl/SimpleAppl.make 1 Apr 2006 03:37:21 -0000 1.2 >+++ src-native-new/samples/SimpleAppl/SimpleAppl.make 16 Mar 2007 14:50:55 -0000 >@@ -54,11 +54,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/shared/tptpConfig/tptpConfig.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/tptpConfig/tptpConfig.make,v >retrieving revision 1.3 >diff -u -r1.3 tptpConfig.make >--- src-native-new/src/shared/tptpConfig/tptpConfig.make 1 Apr 2006 03:19:05 -0000 1.3 >+++ src-native-new/src/shared/tptpConfig/tptpConfig.make 16 Mar 2007 14:50:55 -0000 >@@ -38,7 +38,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -73,11 +73,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/build/build_tptp_samples.script >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/build_tptp_samples.script,v >retrieving revision 1.14 >diff -u -r1.14 build_tptp_samples.script >--- src-native-new/build/build_tptp_samples.script 20 Sep 2006 21:28:29 -0000 1.14 >+++ src-native-new/build/build_tptp_samples.script 16 Mar 2007 14:50:55 -0000 >@@ -21,7 +21,6 @@ > then > export XERCESC_HOME=../../../../depends/xerces-c-src_2_6_0 > fi >-if [ x$RAC_SDK_HOME = x ]; then export RAC_SDK_HOME=`pwd`/../../../depends/RAC_SDK_HOME; fi > if [ x$CBE_SDK_HOME = x ]; then export CBE_SDK_HOME=`pwd`/../../../depends/CBE_SDK_HOME; fi > if [ x$OPTIMIZABLE = x ]; then export OPTIMIZABLE=-O3; fi > #if [ x$DEBUGABLE = x ]; then export DEBUGABLE=-g; fi >Index: src-native-new/build/tptp_ac.dsw >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/tptp_ac.dsw,v >retrieving revision 1.28 >diff -u -r1.28 tptp_ac.dsw >--- src-native-new/build/tptp_ac.dsw 4 Apr 2006 18:30:38 -0000 1.28 >+++ src-native-new/build/tptp_ac.dsw 16 Mar 2007 14:50:55 -0000 >@@ -284,6 +284,9 @@ > Begin Project Dependency > Project_Dep_Name TPTPUtil > End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name transportSupport >+ End Project Dependency > }}} > > ############################################################################### >Index: src-native-new/build/build_tptp_ac.script >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/build_tptp_ac.script,v >retrieving revision 1.23 >diff -u -r1.23 build_tptp_ac.script >--- src-native-new/build/build_tptp_ac.script 7 Feb 2007 19:08:36 -0000 1.23 >+++ src-native-new/build/build_tptp_ac.script 16 Mar 2007 14:50:55 -0000 >@@ -22,7 +22,6 @@ > > if [ x$XERCESC_HOME = x ]; then export XERCESC_HOME=`pwd`/../../../depends/xerces-c-src_2_6_0; fi > if [ x$JAVA_HOME = x ]; then export JAVA_HOME=`pwd`/../../../depends/java; fi >-if [ x$RAC_SDK_HOME = x ]; then export RAC_SDK_HOME=`pwd`/../../../depends/RAC_SDK_HOME; fi > if [ x$CBE_SDK_HOME = x ]; then export CBE_SDK_HOME=`pwd`/../../../depends/CBE_SDK_HOME; fi > if [ x$OPTIMIZABLE = x ]; then export OPTIMIZABLE=-O3; fi > #if [ x$DEBUGABLE = x ]; then export DEBUGABLE=-g; fi >@@ -51,6 +50,18 @@ > > echo "----------------------------------------------" > >+make -C ../src/transport/RACommon -f RACommon.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRACommon" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/transport/RASocket -f RASocket.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRASocket" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/transport/RASharedMemory -f RASharedMemory.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRASharedMemory" >+ >+echo "----------------------------------------------" >+ > make -C ../src/transport/transportSupport -f TransportSupport.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\ntransportSupport" > > echo "----------------------------------------------" >Index: src-native-new/build/build_tptp_ac.script64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/build_tptp_ac.script64,v >retrieving revision 1.6 >diff -u -r1.6 build_tptp_ac.script64 >--- src-native-new/build/build_tptp_ac.script64 7 Feb 2007 19:08:36 -0000 1.6 >+++ src-native-new/build/build_tptp_ac.script64 16 Mar 2007 14:50:55 -0000 >@@ -22,8 +22,8 @@ > > if [ x$XERCESC_HOME = x ]; then export XERCESC_HOME=`pwd`/../../../depends/xerces-c-src_2_6_0; fi > if [ x$JAVA_HOME = x ]; then export JAVA_HOME=`pwd`/../../../depends/java; fi >-if [ x$RAC_SDK_HOME = x ]; then export RAC_SDK_HOME=`pwd`/../../../depends/RAC_SDK_HOME; fi > if [ x$CBE_SDK_HOME = x ]; then export CBE_SDK_HOME=`pwd`/../../../depends/CBE_SDK_HOME; fi >+if [ x$KERNEL_SRC = x ]; then export KERNEL_SRC=`pwd`/../../../depends/linux; fi > if [ x$OPTIMIZABLE = x ]; then export OPTIMIZABLE=-O3; fi > #if [ x$DEBUGABLE = x ]; then export DEBUGABLE=-g; fi > >@@ -31,6 +31,9 @@ > NUM_FAILURES=0 > FAILURES="" > >+export C_FLAGS="-m64 -I $KERNEL_SRC/include" >+export L_FLAGS=-L/usr/lib64 >+ > make -C ../src/shared/TPTPLogUtils -f TPTPLogUtils.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nTPTPLogUtils" > > echo "----------------------------------------------" >Index: src-native-new/src/transport/TPTPAgentCompTL/TPTPAgentCompTL.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/TPTPAgentCompTL.make,v >retrieving revision 1.3 >diff -u -r1.3 TPTPAgentCompTL.make >--- src-native-new/src/transport/TPTPAgentCompTL/TPTPAgentCompTL.make 1 Apr 2006 03:08:20 -0000 1.3 >+++ src-native-new/src/transport/TPTPAgentCompTL/TPTPAgentCompTL.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/CompSupport/CompSupport.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/CompSupport/CompSupport.make,v >retrieving revision 1.2 >diff -u -r1.2 CompSupport.make >--- src-native-new/src/transport/CompSupport/CompSupport.make 1 Apr 2006 03:08:22 -0000 1.2 >+++ src-native-new/src/transport/CompSupport/CompSupport.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/BaseTransport/BaseTransport.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/BaseTransport/BaseTransport.make,v >retrieving revision 1.2 >diff -u -r1.2 BaseTransport.make >--- src-native-new/src/transport/BaseTransport/BaseTransport.make 1 Apr 2006 03:08:20 -0000 1.2 >+++ src-native-new/src/transport/BaseTransport/BaseTransport.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := . ${RAC_SDK_HOME}/include ../../../include >+INCLUDEDIRS := . ../RACommon ../RASharedMemory ../RASocket ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/shared/TPTPLogUtils/TPTPLogUtils.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/TPTPLogUtils/TPTPLogUtils.make,v >retrieving revision 1.3 >diff -u -r1.3 TPTPLogUtils.make >--- src-native-new/src/shared/TPTPLogUtils/TPTPLogUtils.make 1 Apr 2006 03:19:05 -0000 1.3 >+++ src-native-new/src/shared/TPTPLogUtils/TPTPLogUtils.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include ${XERCESC_HOME}/include ${CBE_SDK_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include ${XERCESC_HOME}/include ${CBE_SDK_HOME}/include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/sharedMemTL/SharedMemTL.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/sharedMemTL/SharedMemTL.make,v >retrieving revision 1.5 >diff -u -r1.5 SharedMemTL.make >--- src-native-new/src/transport/sharedMemTL/SharedMemTL.make 1 Apr 2006 03:08:20 -0000 1.5 >+++ src-native-new/src/transport/sharedMemTL/SharedMemTL.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/TimeCollector/TimeCollector.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/TimeCollector/TimeCollector.make,v >retrieving revision 1.4 >diff -u -r1.4 TimeCollector.make >--- src-native-new/samples/TimeCollector/TimeCollector.make 1 Apr 2006 03:37:23 -0000 1.4 >+++ src-native-new/samples/TimeCollector/TimeCollector.make 16 Mar 2007 14:50:55 -0000 >@@ -34,7 +34,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib >+LIBDIRS := ../../lib > > > #----------------------------------- >@@ -56,11 +56,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/samples/ConsoleTestClient/ConsoleTestClient.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/ConsoleTestClient/ConsoleTestClient.make,v >retrieving revision 1.2 >diff -u -r1.2 ConsoleTestClient.make >--- src-native-new/samples/ConsoleTestClient/ConsoleTestClient.make 1 Apr 2006 03:37:22 -0000 1.2 >+++ src-native-new/samples/ConsoleTestClient/ConsoleTestClient.make 16 Mar 2007 14:50:55 -0000 >@@ -33,7 +33,7 @@ > # list of additional library directories to search from > # (separated by blanks) > #----------------------------------- >-LIBDIRS := ${RAC_SDK_HOME}/lib ../../lib ${XERCESC_HOME}/lib >+LIBDIRS := ../../lib ${XERCESC_HOME}/lib > > > #----------------------------------- >@@ -55,11 +55,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/client/Client.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/client/Client.make,v >retrieving revision 1.7 >diff -u -r1.7 Client.make >--- src-native-new/src/client/Client.make 1 Apr 2006 03:37:20 -0000 1.7 >+++ src-native-new/src/client/Client.make 16 Mar 2007 14:50:55 -0000 >@@ -48,7 +48,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../include ${XERCESC_HOME}/include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../include ${XERCESC_HOME}/include > > > #----------------------------------- >@@ -83,11 +83,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/ChkPass/ChkPass.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/ChkPass/ChkPass.make,v >retrieving revision 1.1 >diff -u -r1.1 ChkPass.make >--- src-native-new/src/ChkPass/ChkPass.make 7 Feb 2007 19:08:35 -0000 1.1 >+++ src-native-new/src/ChkPass/ChkPass.make 16 Mar 2007 14:50:55 -0000 >@@ -56,11 +56,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 -D_TPTP_DIAGNOSTIC_ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 -D_TPTP_DIAGNOSTIC_ > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/shared/processControlUtil/ProcessControlUtil.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/processControlUtil/ProcessControlUtil.make,v >retrieving revision 1.4 >diff -u -r1.4 ProcessControlUtil.make >--- src-native-new/src/shared/processControlUtil/ProcessControlUtil.make 1 Apr 2006 03:19:06 -0000 1.4 >+++ src-native-new/src/shared/processControlUtil/ProcessControlUtil.make 16 Mar 2007 14:50:55 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../transport/RACommon ../transport/RASharedMemory ../transport/RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/namedPipeTL/NamedPipeTL.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/namedPipeTL/NamedPipeTL.make,v >retrieving revision 1.5 >diff -u -r1.5 NamedPipeTL.make >--- src-native-new/src/transport/namedPipeTL/NamedPipeTL.make 1 Apr 2006 03:08:21 -0000 1.5 >+++ src-native-new/src/transport/namedPipeTL/NamedPipeTL.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/socketTL/SocketTL.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/socketTL/SocketTL.make,v >retrieving revision 1.5 >diff -u -r1.5 SocketTL.make >--- src-native-new/src/transport/socketTL/SocketTL.make 1 Apr 2006 03:08:20 -0000 1.5 >+++ src-native-new/src/transport/socketTL/SocketTL.make 16 Mar 2007 14:50:56 -0000 >@@ -37,7 +37,7 @@ > # list of additional INCLUDE directories to search headers from > # (separated by blanks) > #----------------------------------- >-INCLUDEDIRS := ${RAC_SDK_HOME}/include . ../../../include >+INCLUDEDIRS := ../RACommon ../RASharedMemory ../RASocket . ../../../include > > > #----------------------------------- >@@ -72,11 +72,11 @@ > # > #----------------------------------- > >-CFLAGS := $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 > > CXXFLAGS := $(CFLAGS) > >-LINKOPTS := $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) > > > #----------------------------------- >Index: src-native-new/src/transport/RACommon/java.h >=================================================================== >RCS file: src-native-new/src/transport/RACommon/java.h >diff -N src-native-new/src/transport/RACommon/java.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RACommon/java.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,113 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: java.h,v 1.3 2006/04/06 15:48:11 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _JAVA_H_ >+#define _JAVA_H_ >+ >+#include <jni.h> >+#include "RAComm.h" >+#include "RATypes.h" >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/* JVM creation macros */ >+#if defined(_HPUX) >+ #define ATTACH_THREAD(env) (ra_getJvm())->AttachCurrentThread((void**)&env, NULL) >+ #define DETACH_THREAD() (ra_getJvm())->DetachCurrentThread() >+#else >+ #define ATTACH_THREAD(env) (*ra_getJvm())->AttachCurrentThread(ra_getJvm(), (void**)&env, NULL) >+ #define DETACH_THREAD() (*ra_getJvm())->DetachCurrentThread(ra_getJvm()) >+#endif >+ >+/* JVM interface macros */ >+#if defined(__cplusplus) && (defined(_HPUX) || defined(__powerpc64__)) >+ #define ENV(e) e >+ #define ENVPARM(e) >+ #define ENVPARM1(e) >+#else >+ #define ENV(e) (*e) >+ #define ENVPARM(e) e, >+ #define ENVPARM1(e) e >+#endif >+ >+struct _ra_javaJob; >+ >+/* Typedef for out Java job completion listener */ >+typedef int (ra_javaJobImplementation)(struct _ra_javaJob *job); >+ >+typedef struct _ra_javaJob { >+ TID threadHandle; >+ JNIEnv *env; >+} ra_javaJob; >+ >+ >+/* Typedef for our JVM creation routine */ >+typedef jint (JNICALL *ra_CreateJavaVM)(JavaVM**, void**, void*); >+ >+#ifdef __OS400__ >+/* This structure is to be used with AS/400 for pthread creation, so that a function pointer can be passed as a variable pointer. */ >+typedef struct { >+ ra_javaJobImplementation *fcn_ptr; >+} fcn_ptr_wrp; >+#endif >+ >+extern int ra_createJavaVitualMachine(char *dllPath); >+extern int ra_createJavaVitualMachineWithClasspath(char *dllPath, char *classpath); >+extern int ra_destroyJavaVirtualMachine(); >+extern JavaVM* ra_getJvm(); >+extern BOOL ra_isJvmCreated(); >+extern int ra_submitJavaJob(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid); >+extern int ra_submitJavaJobReuseJVMThread(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid, JNIEnv *jenv); >+extern char* copyJavaStringToNative(JNIEnv *env, jstring str); >+ >+/** fndclsid ************************************************************************************** >+ * This function finds the class ID corresponding to the class name given, taking care of >+ * platform-dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param clsname the name of the class in native encoding >+ * @returns the Java class ID corresponding to the requested class if any. >+ */ >+extern jclass fndclsid(JNIEnv *env, char *clsname); >+ >+ >+/** getnewstrutf ********************************************************************************** >+ * This function creates a new UTF8 string using the string given, taking care of platform- >+ * dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param str the content of the string to be created >+ * @returns the Java string corresponding to the string given. >+ */ >+extern jstring getnewstrutf(JNIEnv *env, char *str); >+ >+ >+/** fndmthdid ************************************************************************************* >+ * This function finds the method ID corresponding to the method given, taking care of platform- >+ * dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param clsid the class ID to which the method belongs >+ * @param mthd the name of the method in native encoding >+ * @param sig the signature of the method in native encoding >+ * @returns the Java method ID corresponding to the requested method if any. >+ */ >+extern jmethodID getmthdid(JNIEnv *env, jclass clsid, char *mthd, char *sig); >+ >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif /* _JAVA_H_ */ >Index: src-native-new/src/transport/RACommon/java.c >=================================================================== >RCS file: src-native-new/src/transport/RACommon/java.c >diff -N src-native-new/src/transport/RACommon/java.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RACommon/java.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,542 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: java.c,v 1.4 2006/04/24 13:29:35 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "java.h" >+#include "RAComm.h" >+ >+#include <stdlib.h> >+ >+/* Bug 62342 begins */ >+#ifdef _WIN32 >+ #define NUM_JVM_OPTIONS 2 >+#elif defined(__OS400__) /* Bug 95493 */ >+ #define NUM_JVM_OPTIONS 2 >+#else >+ #define NUM_JVM_OPTIONS 1 >+#endif >+/* Bug 62342 ends */ >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/** >+ * GLOBALS >+ */ >+ >+/* The global JVM handle*/ >+JavaVM *_java_VM = NULL; >+JNIEnv *_mainThread; >+int _currentJavaJobId = 0; >+BOOL _isJvmCreated = FALSE; >+ >+/** >+ * PROTOTYPES >+ */ >+#ifdef _WIN32 >+DWORD WINAPI win32JavaJobProxy(LPVOID args); >+#endif >+ >+void *JavaJob(void *args); >+ >+JavaVM* ra_getJvm() { >+ return _java_VM; >+} >+ >+BOOL ra_isJvmCreated() { >+ return _isJvmCreated; >+} >+ >+int ra_createJavaVitualMachine(char *dllPath) { >+ return ra_createJavaVitualMachineWithClasspath(dllPath, NULL); >+} >+ >+int ra_createJavaVitualMachineWithClasspath(char *dllPath, char *classpath) { >+ jint result; /* the result of JVM creation */ >+ JavaVMInitArgs vmArgs; /* the JVM arguments */ >+ JavaVMOption options[NUM_JVM_OPTIONS]; /* the options inside the JVM argument structure */ /* Bug 62342 */ >+ char *classpathBuffer; /* the pointer to the class path to be loaded with the JVM */ >+#if defined(__OS400__) /* Bug 95493 */ >+ char *versionBuffer; /* Bug 95493 the pointer to the version to be loaded with the JVM */ >+#endif >+ int size, offset; /* the size and offset of the string buffer to be allocated for the class path */ >+#ifdef _WIN32 >+ char *jvmArgBuffer; /* Bug 62342 */ >+#endif >+ >+#ifndef __OS400__ >+ ra_CreateJavaVM vmCreationFunction; /* the entry point of JNI_CreateJavaVM() call */ >+ DLL_REFERENCE dllRef; /* the pointer to the dynamic library */ >+ >+ /* Load the dynamic library. */ >+ if (!(dllRef = LOAD_LIBRARY(dllPath))) { >+ printf("Couldn't load JVM library %s\n", dllPath); >+ return -1; >+ } >+ else { >+#if _DEBUG >+ printf("Loaded JVM library %s\n", dllPath); >+#endif >+ } >+ >+ /* Resolve the entry point. */ >+ if (!(vmCreationFunction = (ra_CreateJavaVM) RESOLVE_ENTRY_POINT(dllRef, "JNI_CreateJavaVM"))) { >+ printf("Couldn't resolve entrypoint for JNI_CreateJavaVM\n"); >+ return -2; >+ } >+ else { >+#if _DEBUG >+ printf("Resolved entrypoint for JNI_CreateJavaVM\n"); >+#endif >+ } >+#endif >+ >+ /* Construct the class path for this JVM. This path can be of an arbitrary length. */ >+ offset = strlen("-Djava.class.path="); >+ for (size = 1024; ; size <<= 1) { >+ >+ /* Make sure there is enough memory. */ >+ if (!(classpathBuffer = (char *)ra_malloc(size))) { >+ return -1; >+ } >+ BZERO(classpathBuffer, size); >+ >+ result = ra_getEnvironmentVariable("CLASSPATH", classpathBuffer + offset, size - offset); >+ if(classpath == NULL) { >+ if (result + offset <= size) { >+ break; >+ } >+ } >+ else { >+ if (result + offset + (int)strlen(classpath) + 1 <= size) { >+ break; >+ } >+ } >+ >+ ra_free(classpathBuffer); >+ } >+ >+#if _DEBUG >+ printf("System CLASSPATH = %s, rc = %d\n", classpathBuffer + offset, result); >+#endif >+ >+ if(classpath != NULL) { >+ strcat(classpathBuffer + offset, FILE_PATH_SEPARATOR_STR); >+ strcat(classpathBuffer + offset, classpath); >+ result = 1; /* force this to be non-zero if environment has nothing */ >+ } >+ >+#if _DEBUG >+ printf("Agent Controller CLASSPATH = %s\n", classpathBuffer + offset); >+#endif >+ >+ /* Bug 62342 begins */ >+ vmArgs.nOptions = 0; >+ >+#ifdef _WIN32 >+ /* Add the -Xrs option to prevent JVM shutdown upon user logoff */ >+ jvmArgBuffer = (char*)ra_malloc(sizeof(char) * (strlen("-Xrs") + 1)); >+ BZERO(jvmArgBuffer, strlen("-Xrs") + 1); >+ memcpy(jvmArgBuffer, "-Xrs", strlen("-Xrs")); >+ options[vmArgs.nOptions].optionString = jvmArgBuffer; >+ vmArgs.nOptions++; >+#endif >+ >+ /* Set all options for the JVM. */ >+ if (result) { >+#if defined(__OS400__) /* Bug 95493 */ >+ versionBuffer = (char*)ra_malloc(sizeof(char) * 19); >+ BZERO(versionBuffer, 19); >+ memcpy(versionBuffer, "-Djava.version=1.4", 18); >+ options[vmArgs.nOptions].optionString = as400_etoa(versionBuffer); >+ vmArgs.nOptions++; >+#endif >+ >+ memcpy(classpathBuffer, "-Djava.class.path=", offset); >+#if _DEBUG >+ printf("CLASSPATH used for starting Java job is: %s\n", classpathBuffer + offset); >+#endif >+#ifdef __OS400__ >+ /* Set the class path using what is in the CLASSPATH variable. The encoding conversion must be done at run-time. */ >+ options[vmArgs.nOptions].optionString = as400_etoa(classpathBuffer); >+#elif defined MVS >+ __etoa(classpathBuffer); >+ options[vmArgs.nOptions].optionString = classpathBuffer; >+#else >+ options[vmArgs.nOptions].optionString = classpathBuffer; >+#endif >+ >+ vmArgs.nOptions++; >+ } >+ >+ if(vmArgs.nOptions == 0) { >+ vmArgs.options = NULL; >+ } >+ else { >+ vmArgs.options = options; >+ } >+ >+ /* Bug 62342 ends */ >+ >+ vmArgs.version = JNI_VERSION_1_2; >+ vmArgs.ignoreUnrecognized = JNI_FALSE; >+ >+ /* Instantiate the JVM, and clean up. */ >+#ifdef __OS400__ >+ result = JNI_CreateJavaVM(&_java_VM, (void**)&_mainThread, (void*)&vmArgs); >+ ra_free(options[0].optionString); >+#else >+ result = (*vmCreationFunction)(&_java_VM, (void**)&_mainThread, (void*)&vmArgs); >+#endif >+ >+ ra_free(classpathBuffer); >+#ifdef _WIN32 >+ ra_free(jvmArgBuffer); /* Bug 62342 */ >+#elif defined(__OS400__) >+ ra_free(versionBuffer); /* Bug 95493 */ >+#endif >+ >+ if(result == 0) { /* Success */ >+ _isJvmCreated = TRUE; >+ return 0; >+ } >+ else { >+ _isJvmCreated = FALSE; >+ return -1; >+ } >+} >+ >+int ra_submitJavaJob(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid) { >+ return ra_submitJavaJobReuseJVMThread(jobImpl, asynchronous, tid, NULL); >+} >+ >+int ra_submitJavaJobReuseJVMThread(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid, JNIEnv *jenv) { >+ int rc = 0; >+#ifdef __OS400__ >+ fcn_ptr_wrp* ptr; /* the pointer to the wrapper for the function pointer */ >+ >+ /* On AS/400, function and variable pointers are not interchangable. This wrapper is therefore needed >+ to create threads properly. This pointer is dynamically allocated to avoid a race condition. It is >+ to be freed after the function pointer is passed properly. Currently, this is done in JavaJob(). */ >+ ptr = ra_malloc(sizeof(fcn_ptr_wrp)); >+ ptr -> fcn_ptr = jobImpl; >+#endif >+ >+#if _DEBUG >+ printf("Inside ra_submitJavaJobReuseJVMThread()\n"); >+#endif >+ >+ if (asynchronous) { >+#if _DEBUG >+ printf("Asynchronous java job\n"); >+#endif >+ /* Create a thread to run the job on */ >+#ifdef _WIN32 >+ CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32JavaJobProxy, /* Thread entry point */ >+ (LPVOID) jobImpl, /* params */ >+ 0, /* start executing immediately */ >+ tid); /* the thread ID */ >+#elif defined __OS400__ >+ if (pthread_create(tid, NULL, JavaJob, ptr)) { >+#if _DEBUG >+ printf("Failed to create thread for asynchronous java job\n"); >+#endif >+ rc = -1; >+ } >+#else >+ if (pthread_create(tid, NULL, JavaJob, jobImpl)) { >+#if _DEBUG >+ printf("Failed to create thread for asynchronous java job\n"); >+#endif >+ rc = -1; >+ } >+#endif >+ } else { >+ ra_javaJob *job; >+ >+#if _DEBUG >+ printf("Synchronous java job\n"); >+#endif >+ /* Allocate memory for the job. */ >+ job = (ra_javaJob*) ra_malloc(sizeof(ra_javaJob)); >+ BZERO(job, sizeof(ra_javaJob)); >+ >+ if(jenv == NULL) { >+ rc = ATTACH_THREAD(job->env); >+#if _DEBUG >+ printf("Attached to running jvm thread\n"); >+#endif >+ } >+ else { >+ job->env = jenv; >+ rc = 0; >+#if _DEBUG >+ printf("Reuse existing attached jvm thread\n"); >+#endif >+ } >+ >+ if(!rc) { >+#if _DEBUG >+ printf("Running the java job\n"); >+#endif >+ /* Run the job */ >+ rc = jobImpl(job); >+#if _DEBUG >+ printf("Returned from the java job, rc = %d\n", rc); >+#endif >+ >+ /* Detach the thread from the JVM */ >+ if(jenv == NULL) { >+ DETACH_THREAD(); >+#if _DEBUG >+ printf("Detached from the jvm thread\n"); >+#endif >+ } >+ >+ /* cleanup */ >+ ra_free(job); >+ } else { >+ /* couldn't attach thread to jvm */ >+ /* cleanup */ >+#if _DEBUG >+ printf("Cannot attach to the jvm thread\n"); >+#endif >+ ra_free(job); >+ rc = -1; >+ } >+ } >+ return rc; >+} >+ >+ >+int ra_destroyJavaVirtualMachine() { >+ /* TODO: Currently, JVMs on most platforms do not handle the JVM destruction gracefully, e.g., process crash upon the DestroyJavaVM(). >+ * As a result, this call cannot be made until better support is available. >+ */ >+ jint rc = 0; >+ >+#if 0 /* disable the whole block */ >+ if(_isJvmCreated) { >+#if defined(_HPUX) >+ rc = (_java_VM)->DestroyJavaVM(); >+#else >+ rc = (*_java_VM)->DestroyJavaVM(_java_VM); >+#endif >+ _java_VM = NULL; >+ _isJvmCreated = FALSE; >+ } >+#endif >+ >+ return (int)rc; >+} >+ >+ >+void javaJobCleanup(void *arg) { >+ ra_javaJob *job=(ra_javaJob*)arg; >+ /* Notify the listener we have exited */ >+ >+ ra_free(job); >+} >+ >+ >+ >+void *JavaJob(void *args) { >+ ra_javaJobImplementation *jobImpl; /* the entry point to the startup method */ >+ ra_javaJob *job; /* the job object */ >+ >+#ifdef __OS400__ >+ /* The pointer args is allocated in ra_submitJavaJob() as a wrapper to pass the function pointer >+ on AS/400 properly. Freeing it here the correct behaviour. */ >+ jobImpl = ((fcn_ptr_wrp *) args) -> fcn_ptr; >+ ra_free(args); >+#else >+ /* On other platforms, the entry point is stored directly in the paremeter. */ >+ jobImpl = (ra_javaJobImplementation *) args; >+#endif >+ >+ /* Allocate the job. */ >+ job = (ra_javaJob *) ra_malloc(sizeof(ra_javaJob)); >+ BZERO(job, sizeof(ra_javaJob)); >+ >+#ifndef _WIN32 >+ /* Prepare for cleanup. */ >+ pthread_cleanup_push(javaJobCleanup, job); >+#endif >+ >+ /* Start the job. */ >+ if (!ATTACH_THREAD(job -> env)) { >+#if _DEBUG >+ printf("Attached to running jvm thread\n"); >+#endif >+ jobImpl(job); >+ DETACH_THREAD(); >+#if _DEBUG >+ printf("Detached from the jvm thread\n"); >+#endif >+ } else { >+ printf("Couldn't run job because couldn't attach thread to JVM\n"); >+ } >+ >+#ifndef _WIN32 >+ pthread_cleanup_pop(1); >+#else >+ javaJobCleanup(job); >+#endif >+ return (void*) NULL; >+} >+ >+ >+#ifdef _WIN32 >+DWORD WINAPI win32JavaJobProxy(LPVOID args) { >+ DWORD returnVal = 0; >+ JavaJob(args); >+ return returnVal; >+} >+#endif >+ >+/* Creates a native representation of a Java String */ >+char* copyJavaStringToNative(JNIEnv *env, jstring str) { >+ char *utf8Bytes; >+ jsize utf8Length; >+ char *nativeStr = NULL; >+ int nativeLength; >+ >+ utf8Length = (jsize)ENV(env)->GetStringUTFLength(ENVPARM(env) str); >+ utf8Bytes = (char*)ENV(env)->GetStringUTFChars(ENVPARM(env) str, NULL); >+ if(utf8Length > 0) { >+ nativeLength = unicode2native(&nativeStr, utf8Bytes, utf8Length); >+ } >+ else { >+ nativeStr = (char*)ra_malloc(sizeof(char)); /* Bug 103601 */ >+ nativeStr[0] = '\0'; /* Bug 103601 */ >+ } >+ ENV(env)->ReleaseStringUTFChars(ENVPARM(env) str, utf8Bytes); >+ >+ return nativeStr; >+} >+ >+/** fndclsid ************************************************************************************** >+ * This function finds the class ID corresponding to the class name given, taking care of >+ * platform-dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param clsname the name of the class in native encoding >+ * @returns the Java class ID corresponding to the requested class if any. >+ */ >+jclass fndclsid(JNIEnv *env, char *clsname) { >+ jclass clsid; /* the class ID for the class name */ >+ char *asciicls; /* the class name in ASCII format */ >+ >+/* On AS/400 and OS/390, convert the class name at run-time into the ASCII format for the lookup. */ >+#ifdef __OS400__ >+ asciicls = as400_etoa(clsname); >+#elif defined MVS >+ asciicls = (char *) ra_malloc(strlen(clsname) + 1); >+ strcpy(asciicls, clsname); >+ __etoa(asciicls); >+#else >+ asciicls = clsname; >+#endif >+ >+ /* Look up the class ID, after appropriate transformation. */ >+ clsid = ENV(env) -> FindClass(ENVPARM(env) asciicls); >+ >+/* On AS/400 and OS/390, free the ASCII class name before the class ID is returned. */ >+#if defined __OS400__ || defined MVS >+ ra_free(asciicls); >+#endif >+ return clsid; >+} >+ >+ >+/** getnewstrutf ********************************************************************************** >+ * This function creates a new UTF8 string using the string given, taking care of platform- >+ * dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param str the content of the string to be created >+ * @returns the Java string corresponding to the string given. >+ */ >+jstring getnewstrutf(JNIEnv *env, char *str) { >+#if defined __OS400__ || defined MVS >+ char *asciistr; /* the temporary ASCII string */ >+ jstring javastr; /* the new Java string */ >+ >+ if (!str) { >+ return 0; >+ } >+ #ifdef __OS400__ >+ asciistr = as400_etoa(str); >+ #else >+ asciistr = (char *) ra_malloc(strlen(str) + 1); >+ strcpy(asciistr, str); >+ __etoa(asciistr); >+ #endif >+ javastr = ENV(env) -> NewStringUTF(ENVPARM(env) asciistr); >+ ra_free(asciistr); >+ return javastr; >+#else >+ if (!str) { >+ return 0; >+ } >+ return ENV(env) -> NewStringUTF(ENVPARM(env) str); >+#endif >+} >+ >+ >+/** fndmthdid ************************************************************************************* >+ * This function finds the method ID corresponding to the method given, taking care of platform- >+ * dependent encoding on AS/400 and OS/390. >+ * >+ * @param env the environment in which the search is to be performed >+ * @param clsid the class ID to which the method belongs >+ * @param mthd the name of the method in native encoding >+ * @param sig the signature of the method in native encoding >+ * @returns the Java method ID corresponding to the requested method if any. >+ */ >+jmethodID getmthdid(JNIEnv *env, jclass clsid, char *mthd, char *sig) { >+ jmethodID mthdid; /* the resulting method ID */ >+ char *asciimthd; /* the method name in ASCII format */ >+ char *asciisig; /* the method signature in ASCII format */ >+ >+ /* On each platform, obtain the ASCII forms of the method name and signature. */ >+#ifdef __OS400__ >+ asciimthd = as400_etoa(mthd); >+ asciisig = as400_etoa(sig); >+#elif defined MVS >+ asciimthd = (char *) ra_malloc(strlen(mthd) + 1); >+ asciisig = (char *) ra_malloc(strlen(sig) + 1); >+ strcpy(asciimthd, mthd); >+ strcpy(asciisig, sig); >+ __etoa(asciimthd); >+ __etoa(asciisig); >+#else >+ asciimthd = mthd; >+ asciisig = sig; >+#endif >+ >+ /* Look up the method ID. */ >+ mthdid = ENV(env) -> GetMethodID(ENVPARM(env) clsid, asciimthd, asciisig); >+ >+ /* free memory before the methid ID is returned. */ >+#if defined __OS400__ || defined MVS >+ ra_free(asciimthd); >+ ra_free(asciisig); >+#endif >+ return mthdid; >+} >+ >+#ifdef __cplusplus >+} >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 121658
: 61110 |
62142