harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r591998 - in /harmony/enhanced/classlib/trunk/modules: luni/src/main/native/luni/shared/ misc/src/main/native/accessors/shared/ portlib/src/main/native/include/shared/ portlib/src/main/native/include/unix/ portlib/src/main/native/port/unix/
Date Mon, 05 Nov 2007 13:58:49 GMT
Author: odeakin
Date: Mon Nov  5 05:58:47 2007
New Revision: 591998

URL: http://svn.apache.org/viewvc?rev=591998&view=rev
Log:
More z/OS specific changes - mostly alterations to header file includes and fixups for differences
in unix and zOS system headers.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
    harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/MemMacros.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/unix/hysock.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyipcmutex.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysharedhelper.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyshsem.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c Mon
Nov  5 05:58:47 2007
@@ -333,7 +333,9 @@
     {
         unsigned i = 0;
         /* Make a string version of the CP separator */
-        char cpSeparator[] = {(char)hysysinfo_get_classpathSeparator (), '\0'};
+        char cpSeparator[2];
+        cpSeparator[0] = (char)hysysinfo_get_classpathSeparator();
+        cpSeparator[1] = '\0';
 		
         /* Read current value of bootclasspath property */
         rcGetProperty = (*vmInterface)->GetSystemProperty (vmInterface,

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/MemMacros.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/MemMacros.h?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/MemMacros.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/MemMacros.h
Mon Nov  5 05:58:47 2007
@@ -21,6 +21,11 @@
     #include <stddef.h>
 #endif
 
+/* Need to include inttypes.h to get intptr_t and uintptr_t */
+#if defined(ZOS)
+#include <inttypes.h>
+#endif
+
 #include <jni.h>
 
 #define jlong2addr(a, x) ((a *)((uintptr_t)(x)))

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hycomp.h
Mon Nov  5 05:58:47 2007
@@ -197,6 +197,48 @@
 
 #endif /* defined(WIN32) */
 
+#if defined(ZOS)
+
+#define HY_BIG_ENDIAN
+
+#define DATA_TYPES_DEFINED
+typedef unsigned int   BOOLEAN;
+#if defined (HYS390X)
+typedef unsigned long U_64;
+typedef long I_64;
+#else
+typedef signed long long	I_64;
+typedef unsigned long long	U_64;
+#endif
+
+typedef double				SYS_FLOAT;
+
+#define HYCONST64(x) x##LL
+
+#define NO_LVALUE_CASTING
+#define PLATFORM_LINE_DELIMITER	"\012"
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR_STR ":"
+#define LIBPATH_ENV_VAR "LIBPATH"
+
+#define VA_PTR(valist) (&valist[0])
+
+typedef struct {
+#if !defined(HYS390X)
+	char stuff[16];
+#endif
+	char *ada;
+	void (*rawFnAddress)();
+} HyFunctionDescriptor_T;
+
+#define TOC_UNWRAP_ADDRESS(wrappedPointer) (((HyFunctionDescriptor_T *) (wrappedPointer))->rawFnAddress)
+
+#define PLATFORM_DLL_EXTENSION ".so"
+
+#endif /* ZOS */
+
+
 #if !defined(VMCALL)
 #define VMCALL
 #define VMAPICALL

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/unix/hysock.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/unix/hysock.h?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/unix/hysock.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/unix/hysock.h
Mon Nov  5 05:58:47 2007
@@ -28,11 +28,24 @@
 #include <stdio.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+
+#if !defined(ZOS)
 #include <netinet/tcp.h>
+#else /* !defined(ZOS) */
+#include <netinet/tcp_var.h>
+#endif /* !defined(ZOS) */
+
 #include <netdb.h>
 #include <sys/time.h>
 #include <stdlib.h>
+
+#if !defined(ZOS)
 #include <sys/socketvar.h>
+#else /* !defined(ZOS) */
+#include <arpa/inet.h>
+#include <xti.h>
+#endif /* !defined(ZOS) */
+
 #include "hysocket.h"
 #include "hycomp.h"
 #include "hyport.h"

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyipcmutex.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyipcmutex.c?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyipcmutex.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyipcmutex.c
Mon Nov  5 05:58:47 2007
@@ -40,7 +40,7 @@
 #include <errno.h>
 #include "hyport.h"
 
-#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX)
+#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX) || defined(ZOS)
 /* arg for semctl semaphore system calls. */
 union semun
 {

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysharedhelper.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysharedhelper.c?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysharedhelper.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysharedhelper.c
Mon Nov  5 05:58:47 2007
@@ -25,7 +25,9 @@
 #define SUCCESS 0
 #define FAILED -1
 
+#if !defined(ZOS)
 #define __errno2() 0
+#endif
 
 static void changeDirectoryPermission (struct HyPortLibrary *portLibrary,
                                        const char *pathname);

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyshsem.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyshsem.h?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyshsem.h (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyshsem.h Mon
Nov  5 05:58:47 2007
@@ -19,7 +19,7 @@
 #define hyshsem_h
 #include <sys/types.h>
 #include <errno.h>
-#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX)
+#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX) || defined(ZOS)
 /* according to X/OPEN we have to define it ourselves */
 union semun
 {
@@ -54,5 +54,7 @@
 #define HYSHSEM_SEMFLAGS_GROUP (IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
 #define HYSHSEM_SEMMARKER 769
 /* for zOS we have a function to get extended error code - useful for debugging */
+#if !defined(ZOS)
 #define __errno2() 0
+#endif /* ZOS */
 #endif /* hyshsem_h */

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c?rev=591998&r1=591997&r2=591998&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysock.c Mon
Nov  5 05:58:47 2007
@@ -33,13 +33,19 @@
 
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 #include <netinet/in.h>         /* for struct in_addr */
 #include <arpa/inet.h>          /* for inet_addr */
 #include <sys/ioctl.h>
 #include <net/if.h>             /* for struct ifconf */
 
+#if !defined(ZOS)
+#include <sys/poll.h>
+#else
+/* On zOS this header file has a different location */
+#include <poll.h>
+#endif
+
 #if defined(LINUX)
 #define IPV6_FLOWINFO_SEND      33
 #if defined(HARDHAT)
@@ -2196,6 +2202,8 @@
                  U_32 * addr)
 {
   I_32 rc = 0;
+
+#if !defined(ZOS)
   struct in_addr in;
   if (inet_aton(addrStr, &in) == 0)
     {
@@ -2206,6 +2214,23 @@
     {
       *addr = in.s_addr;
     }
+
+#else
+  /* on zOS we do not have inet_aton so revert to the previous inet_addr implementation */
+  U_32 val;
+
+  val = inet_addr (addrStr);
+  if (val == -1)
+    {
+      HYSOCKDEBUGPRINT ("<inet_addr failed>\n");
+      rc = HYPORT_ERROR_SOCKET_ADDRNOTAVAIL;
+    }
+  else
+    {
+      *addr = val;
+  }
+#endif
+
   return rc;
 }
 



Mime
View raw message