harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r810084 [3/3] - in /harmony/enhanced/classlib/trunk: depends/build/ modules/luni/src/main/native/launcher/shared/ modules/luni/src/main/native/launcher/unix/ modules/luni/src/main/native/luni/shared/ modules/portlib/ modules/portlib/src/mai...
Date Tue, 01 Sep 2009 15:06:18 GMT
Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c?rev=810084&r1=810083&r2=810084&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c Tue
Sep  1 15:06:16 2009
@@ -34,6 +34,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef ZOS
+#include <iconv.h>
+#endif
+
 #define CDEV_CURRENT_FUNCTION _prototypes_private
 static const char *nlsh_lookup (struct HyPortLibrary *portLibrary,
                                 U_32 module_name, U_32 message_num);
@@ -1233,6 +1237,11 @@
   char temp[BUF_SIZE];
   IDATA count, nbytes = bufsize;
   char *cursor = buf;
+#ifdef ZOS
+	iconv_t converter;
+	size_t inbytesleft, outbytesleft;
+	char* inbuf, *outbuf;
+#endif
 
   if (nbytes <= 0)
     return 0;
@@ -1240,6 +1249,14 @@
   /* discount 1 for the trailing NUL */
   nbytes -= 1;
 
+#ifdef ZOS
+/* iconv_open is not an a2e function, so we need to pass it EBCDIC strings */
+#pragma convlit(suspend)
+	converter = iconv_open("UTF-8", "IBM-1047");
+#pragma convlit(resume)
+	if ( converter == (iconv_t)-1 ) return NULL;
+#endif
+
   while (nbytes)
     {
       count = BUF_SIZE > nbytes ? nbytes : BUF_SIZE;
@@ -1247,21 +1264,44 @@
 
       if (count < 0)
         {
-
+#ifdef ZOS
+          iconv_close(converter);
+#endif
           /* if we've made it through a successful read, return the buf. */
           if (nbytes + 1 != bufsize)
             return buf;
           return NULL;
         }
 
+#ifdef ZOS
+		inbuf = temp;
+		inbytesleft = count;
+		outbuf = cursor;
+		outbytesleft = nbytes;
+		if ( (size_t)-1 == iconv(converter, &inbuf, &inbytesleft, &outbuf, &outbytesleft)
|| inbytesleft == count ) {
+			/* conversion failed */
+			iconv_close(converter);
+			portLibrary->file_seek(portLibrary, fd, -1 * count, HySeekCur);
+			return NULL;
+		}
+		if ( inbytesleft > 0 ) {
+			portLibrary->file_seek(portLibrary, fd, inbytesleft - count, HySeekCur);
+		}
+		nbytes -= count - inbytesleft;
+		cursor += count - inbytesleft;
+#else 
       memcpy (cursor, temp, count);
       cursor += count;
       nbytes -= count;
-
+#endif /* ZOS */
     }
 
   *cursor = '\0';
 
+#ifdef ZOS
+	if ( converter != (iconv_t)-1 ) iconv_close(converter);
+#endif
+
   return buf;
 }
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c?rev=810084&r1=810083&r2=810084&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c Tue
Sep  1 15:06:16 2009
@@ -24,6 +24,9 @@
 #include "hyport.h"
 #include "portpriv.h"
 #include "hyportpg.h"
+#ifdef ZOS
+#include "atoe.h"
+#endif
 
 /**
  * Initialize the port library.
@@ -45,7 +48,15 @@
   /* return value of 0 is success */
   I_32 rc;
 
+#if defined(ZOS)
+  /* Initialise the ascii2ebcdic functions if it has not already been done */
+  rc = iconv_init();
+
+  if (rc ==0)
+#endif
+  {
   rc = hyport_create_library (portLibrary, version, size);
+  }
   
   if (rc == 0)
     {

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysysinfo.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysysinfo.c?rev=810084&r1=810083&r2=810084&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysysinfo.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hysysinfo.c
Tue Sep  1 15:06:16 2009
@@ -49,6 +49,18 @@
 #include "portpriv.h"
 #include "hyportpg.h"
 
+#if defined(ZOS)
+#include <sys/ps.h>
+#include <sys/types.h>
+#include "atoe.h"
+
+#if !defined(PATH_MAX) 
+/* This is a somewhat arbitrarily selected fixed buffer size. */
+#define PATH_MAX 1024
+#endif
+
+#endif
+
 #define CDEV_CURRENT_FUNCTION _prototypes_private
 #if !defined(FREEBSD)
 static IDATA readSymbolicLink (struct HyPortLibrary *portLibrary,
@@ -191,7 +203,11 @@
       char *buffer;
       struct utsname sysinfo;
 
+#if !defined(ZOS)
       rc = uname (&sysinfo);
+#else /* !defined(ZOS) */
+      rc = __osname(&sysinfo);
+#endif /* !defined(ZOS) */
 
       if (rc >= 0)
         {
@@ -232,13 +248,18 @@
       int rc;
       struct utsname sysinfo;
 
+#if !defined(ZOS)
       rc = uname (&sysinfo);
+#else /* !defined(ZOS) */
+      rc = __osname(&sysinfo);
+#endif /* !defined(ZOS) */
 
       if (rc >= 0)
         {
           int len;
           char *buffer;
 
+#if !defined(ZOS)
           len = strlen (sysinfo.release) + 1;
           buffer = portLibrary->mem_allocate_memory (portLibrary, len);
           if (NULL == buffer)
@@ -247,6 +268,14 @@
             }
           strncpy (buffer, sysinfo.release, len);
           buffer[len - 1] = '\0';
+#else /* !defined(ZOS) */
+			len = strlen(sysinfo.version) + strlen(sysinfo.release) + 2; /* "." and terminating null
character */
+			buffer = portLibrary->mem_allocate_memory(portLibrary, len);
+			if (NULL == buffer) {
+				return NULL;
+			}
+			sprintf(buffer, "%s.%s", sysinfo.version, sysinfo.release);
+#endif /* !defined(ZOS) */
 
           PPG_si_osVersion = buffer;
         }
@@ -334,6 +363,7 @@
   char *currentPath = NULL;
   char *originalWorkingDirectory = NULL;
 
+#if !defined(ZOS)
   if (!argv0)
     {
       return -1;
@@ -344,6 +374,39 @@
     {
       strcpy (currentPath, argv0);
     }
+#else /* !defined(ZOS) */
+    char *e2aName = NULL;
+	int token = 0;
+	W_PSPROC buf;
+	pid_t mypid = getpid();
+
+	memset(&buf, 0x00, sizeof(buf));
+	buf.ps_pathptr   = portLibrary->mem_allocate_memory(portLibrary, buf.ps_pathlen = PS_PATHBLEN);
+	if (buf.ps_pathptr   == NULL) {
+		retval = -1;
+		goto cleanup;
+	}
+	while ((token = w_getpsent(token, &buf, sizeof(buf))) > 0) {
+		if (buf.ps_pid == mypid) {
+            e2aName = e2a_func(buf.ps_pathptr, strlen(buf.ps_pathptr)+1);
+			break;
+		}
+	}
+
+    /* Return val of w_getpsent == -1 indicates error, == 0 indicates no more processes */
+	if (token <= 0) {
+		retval = -1;
+		goto cleanup;
+	}
+
+	currentPath = (portLibrary->mem_allocate_memory) (portLibrary, strlen(e2aName) + 1);
+	if (currentPath) {
+		strcpy(currentPath, e2aName);
+	}
+    portLibrary->mem_free_memory(portLibrary, buf.ps_pathptr);
+    free(e2aName);
+#endif /* !defined(ZOS) */
+
   if (!currentPath)
     {
       retval = -1;
@@ -678,8 +741,7 @@
 #if defined(LINUX) || defined(FREEBSD)
   /* returns number of online(_SC_NPROCESSORS_ONLN) processors, number configured(_SC_NPROCESSORS_CONF)
may  be more than online */
   return sysconf (_SC_NPROCESSORS_ONLN);
-#else
-#if defined(MACOSX)
+#elif defined(MACOSX)
   /* derived from examples in the sysctl(3) man page from FreeBSD */
   int mib[2], ncpu;
   size_t len;
@@ -693,8 +755,6 @@
 #else
   return 0;
 #endif
-#endif
-
 }
 
 #undef CDEV_CURRENT_FUNCTION
@@ -722,6 +782,9 @@
   sysctl(mib, 2, &mem, &len, NULL, 0);
   return (U_64)mem;
 
+#elif defined(ZOS)
+	/* TODO: implement. Currently this function is unused. */
+	return 0;
 #else
   IDATA pagesize, num_pages;
 
@@ -866,23 +929,39 @@
 hysysinfo_get_username (struct HyPortLibrary * portLibrary, char *buffer,
                         UDATA length)
 {
+  char *remoteCopy = NULL;
+#if defined(ZOS)
+  char *loginID = getlogin();
+  if (NULL != loginID) {
+    struct passwd *userDescription = getpwnam(loginID);
+    if (NULL != userDescription) {
+      remoteCopy = userDescription->pw_name;
+    }
+  }
+	/* there exist situations where one of the above calls will fail.  Fall through to the Unix
solution for those cases */
+#endif
+
+  if (NULL == remoteCopy) {
   uid_t uid = getuid ();
-  int nameLen;
   struct passwd *pwent = getpwuid (uid);
 
-  if (pwent == NULL)
+    if (pwent != NULL)
     {
-      return -1;
+      remoteCopy = pwent->pw_name;
     }
-
-  nameLen = strlen (pwent->pw_name);
+  }
+  if (NULL == remoteCopy) {
+    return -1;
+  } else {
+    size_t nameLen = strlen (remoteCopy);
 
   if ((nameLen + 1) > length)
     {
       return nameLen + 1;
     }
 
-  portLibrary->str_printf (portLibrary, buffer, length, "%s", pwent->pw_name);
+    portLibrary->str_printf (portLibrary, buffer, length, "%s", remoteCopy);
+  }
 
   return 0;
 }

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c?rev=810084&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c
Tue Sep  1 15:06:16 2009
@@ -0,0 +1,167 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#define CDEV_CURRENT_FUNCTION _comment_
+/**
+ * @file
+ * @ingroup Port
+ * @brief Memory map
+ *
+ * This module provides memory mapping facilities that allow a user to map files
+ * into the virtual address space of the process.  There are various options that
+ * can be used when mapping a file into memory, such as copy on write.  Not all 
+ * of these options are available on all platforms, @ref hymmap_capabilities 
+ * provides the list of supported options.  Note also that on some platforms 
+ * memory mapping facilites do not exist at all. On these platforms the API will
+ * still be available, but will simply read the file into allocated memory.
+ */
+
+#undef CDEV_CURRENT_FUNCTION
+
+#include "hyport.h"
+
+#define CDEV_CURRENT_FUNCTION hymmap_map_file
+ /**
+ * Map a file into memory.
+ *
+ * @param[in] portLibrary The port library
+ * @param[in] path - the path of the file to mapped into memory.
+ * @param[out] handle - updates *handle with the memory map handle, this handle is later
passed to unmap.
+ *
+ * @return pointer to newly mapped memory on success, NULL on error.
+ */
+void *VMCALL
+hymmap_map_file (struct HyPortLibrary *portLibrary, const char *path,
+                 void **handle)
+{
+    UDATA numBytesRead;
+	IDATA rc;
+	void *mappedMemory;
+	void *allocPointer;    
+    IDATA file;
+	UDATA size;
+
+    /* default implementation will allocate memory and read the file into it */
+    size = (UDATA) portLibrary->file_length(portLibrary, path);
+	file = portLibrary->file_open(portLibrary, path, (I_32) HyOpenRead, (I_32) 0);
+
+    if ( file == -1 ) {
+		return NULL;
+	}
+
+    /* ensure that allocated memory is 8 byte aligned, just in case it matters */
+	allocPointer = portLibrary->mem_allocate_memory(portLibrary, size + 8);
+	
+	if ( allocPointer == NULL ) {
+		portLibrary->file_close(portLibrary, file);
+		return NULL;
+	}
+
+	if ((UDATA)allocPointer%8) {
+		mappedMemory = (void *) ((UDATA)allocPointer + 8 - ((UDATA)allocPointer%8));
+	} else {
+		mappedMemory = allocPointer;
+	}
+
+	numBytesRead = 0;
+	rc = 0;
+	while ( size - numBytesRead > 0 ) { 
+		rc = portLibrary->file_read(portLibrary, file, (void *)(((UDATA)mappedMemory) + numBytesRead),
size-numBytesRead);
+		if ( rc == -1 ) {
+			/* failed to completely read the file */
+			portLibrary->mem_free_memory(portLibrary, allocPointer);
+			return NULL;
+		}
+		numBytesRead += rc;
+	}
+	
+	return mappedMemory;
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hymmap_unmap_file
+/**
+ * UnMap previously mapped memory.
+ *
+ * @param[in] portLibrary The port library
+ *
+ * @param[in] handle - the handle from the mmap_map_file.
+ */
+void VMCALL
+hymmap_unmap_file(struct HyPortLibrary *portLibrary, void *handle) 
+{
+	portLibrary->mem_free_memory( portLibrary, handle );
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hymmap_shutdown
+/**
+ * PortLibrary shutdown.
+ *
+ * @param[in] portLibrary The port library
+ *
+ * This function is called during shutdown of the portLibrary.  Any resources that were created
by @ref hymmap_startup
+ * should be destroyed here.
+ *
+ */
+void VMCALL
+hymmap_shutdown(struct HyPortLibrary *portLibrary)
+{
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hymmap_startup
+/**
+ * PortLibrary startup.
+ *
+ * This function is called during startup of the portLibrary.  Any resources that are required
for
+ * the memory mapping operations may be created here.  All resources created here should
be destroyed
+ * in @ref hymmap_shutdown.
+ *
+ * @param[in] portLibrary The port library
+ *
+ * @return 0 on success, negative error code on failure.  Error code values returned are
+ * \arg HYPORT_ERROR_STARTUP_MMAP
+ *
+ * @note Most implementations will simply return success.
+ */
+I_32 VMCALL
+hymmap_startup(struct HyPortLibrary *portLibrary)
+{
+	return 0;
+}
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION hymmap_capabilities
+/**
+ * Check the capabilities available for HYMMAP at runtime for the current platform.
+ *
+ *
+ * @param[in] portLibrary The port library
+ *
+ * @return a bit map containing the capabilites supported by the hymmap sub component of
the port library.
+ * Possible bit values:
+ *   HYPORT_MMAP_CAPABILITY_COPYONWRITE - if not present, platform is not capable of "copy
on write" memory mapping.
+ *
+ */
+I_32 VMCALL
+hymmap_capabilities(struct HyPortLibrary *portLibrary)
+{
+	return HYPORT_MMAP_CAPABILITY_COPYONWRITE | HYPORT_MMAP_CAPABILITY_READ;
+}
+#undef CDEV_CURRENT_FUNCTION
+

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hymmap.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c?rev=810084&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c Tue
Sep  1 15:06:16 2009
@@ -0,0 +1,206 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <dll.h>
+#include <stdlib.h> /* for malloc */
+
+#include "hyport.h"
+#include "portnls.h"
+
+#define DMESSAGE(x)				/* printf x; */
+
+
+static void getDLError(struct HyPortLibrary *portLibrary, char *errBuf, UDATA bufLen);
+
+
+/** 
+ * Opens a shared library .
+ *
+ * @param[in] portLibrary The port library.
+ * @param[in] name path Null-terminated string containing the shared library.
+ * @param[out] descriptor Pointer to memory which is filled in with shared-library handle
on success.
+ * @param[out] errBuf Buffer to contain an error message on failure.
+ * @param[in] bufLen Size of errBuf.
+ * @param[in] decorate Boolean value indicates whether name should be decorated if it contains
path information and cannot be found.
+ *
+ * @return 0 on success, any other value on failure.
+ *
+ * @note contents of descriptor are undefined on failure.
+ */
+UDATA VMCALL
+hysl_open_shared_library(struct HyPortLibrary *portLibrary, char *name, UDATA *descriptor,
BOOLEAN decorate)
+{
+	void *handle;
+	char *openName = name;
+	char mangledName[1024];
+	char errBuf[512];
+
+	if (decorate) {
+		char *p = strrchr(name, '/');
+		if ( p ) {
+			/* the names specifies a path */
+			portLibrary->str_printf(portLibrary, mangledName, 1024, "%.*slib%s.so", (UDATA)p+1-(UDATA)name,
name, p+1);
+		} else {
+			portLibrary->str_printf(portLibrary, mangledName, 1024, "lib%s.so", name);
+		}
+		openName = mangledName;
+	} 
+
+	handle = dllload( openName );
+	if( handle == NULL ) {
+		getDLError(portLibrary, errBuf, sizeof(errBuf));
+		if (portLibrary->file_attr(portLibrary, openName) == HyIsFile) {
+			return portLibrary->error_set_last_error_with_message(portLibrary, HYPORT_SL_INVALID,
errBuf);
+		} else {
+			return portLibrary->error_set_last_error_with_message(portLibrary, HYPORT_SL_NOT_FOUND,
errBuf);
+		}
+	}
+
+	*descriptor = (UDATA) handle;
+	return 0;
+}
+
+/**
+ * Close a shared library.
+ *
+ * @param[in] portLibrary The port library.
+ * @param[in] descriptor Shared library handle to close.
+ *
+ * @return 0 on success, any other value on failure.
+ */
+UDATA VMCALL
+hysl_close_shared_library(struct HyPortLibrary *portLibrary, UDATA descriptor)
+{
+	int error;
+	dllhandle *handle; 
+
+	DMESSAGE (("\nClose library %x\n", *descriptor))
+	handle = (dllhandle *)descriptor;
+	error = dllfree (handle);
+
+	return error;	
+}
+
+/**
+ * Search for a function named 'name' taking argCount in the shared library 'descriptor'.
+ *
+ * @param[in] portLibrary The port library.
+ * @param[in] descriptor Shared library to search.
+ * @param[in] name Function to look up.
+ * @param[out] func Pointer to the function.
+ * @param[in] argSignature Argument signature.
+ *
+ * @return 0 on success, any other value on failure.
+ *
+ * argSignature is a C (ie: NUL-terminated) string with the following possible values for
each character:
+ *
+ *		V	- void
+ *		Z	- boolean
+ *		B	- byte
+ *		C	- char (16 bits)
+ *		I	- integer (32 bits)
+ *		J	- long (64 bits)
+ *		F	- float (32 bits) 
+ *		D	- double (64 bits) 
+ *		L	- object / pointer (32 or 64, depending on platform)
+ *      P	- pointer-width platform data. (in this context a
+ *      IDATA)
+ * 
+ * Lower case signature characters imply unsigned value.
+ * Upper case signature characters imply signed values.
+ * If it doesn't make sense to be signed/unsigned (eg: V, L, F, D Z) the character is upper
case.
+ * 
+ * argList[0] is the return type from the function.
+ * The argument list is as it appears in english: list is left (1) to right (argCount)
+ *
+ * @note contents of func are undefined on failure.
+ */
+UDATA VMCALL
+hysl_lookup_name(struct HyPortLibrary *portLibrary, UDATA descriptor, char *name, UDATA *func,
const char *argSignature)
+{
+	void *address;
+	dllhandle *handle;
+
+	handle = (dllhandle *)descriptor;
+	address = (void *)dllqueryfn( handle, name );
+	if( address == NULL ) {
+		return 1;
+	}
+	*func = (UDATA)address;
+	return 0;
+}
+
+/**
+ * PortLibrary shutdown.
+ *
+ * This function is called during shutdown of the portLibrary.  Any resources that were created
by @ref hysl_startup
+ * should be destroyed here.
+ *
+ * @param[in] portLibrary The port library.
+ *
+ * @note Most implementations will be empty.
+ */
+void VMCALL
+hysl_shutdown(struct HyPortLibrary *portLibrary)
+{
+}
+
+/**
+ * PortLibrary startup.
+ *
+ * This function is called during startup of the portLibrary.  Any resources that are required
for
+ * the shared library operations may be created here.  All resources created here should
be destroyed
+ * in @ref hysl_shutdown.
+ *
+ * @param[in] portLibrary The port library.
+ *
+ * @return 0 on success, negative error code on failure.  Error code values returned are
+ * \arg HYPORT_ERROR_STARTUP_SL
+ *
+ * @note Most implementations will simply return success.
+ */
+I_32 VMCALL
+hysl_startup(struct HyPortLibrary *portLibrary)
+{
+	return 0;
+}
+
+static void
+getDLError(struct HyPortLibrary *portLibrary, char *errBuf, UDATA bufLen)
+{
+	char *error;
+
+	if (bufLen == 0) {
+		return;
+	}
+
+	error = strerror(errno);
+	if (error == NULL || error[0] == '\0') {
+		/* just in case another thread consumed our error message */
+		error =  portLibrary->nls_lookup_message(portLibrary, 
+			HYNLS_ERROR|HYNLS_DO_NOT_APPEND_NEWLINE, 
+			HYNLS_PORT_SL_UNKOWN_ERROR, 
+			NULL);
+	}
+
+	strncpy(errBuf, error, bufLen);
+	errBuf[bufLen - 1] = '\0';
+}

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/zos/hysl.c
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message