harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r592904 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
Date Wed, 07 Nov 2007 21:27:45 GMT
Author: hindessm
Date: Wed Nov  7 13:27:45 2007
New Revision: 592904

URL: http://svn.apache.org/viewvc?rev=592904&view=rev
Log:
Use send_file on Aix and z/OS.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c?rev=592904&r1=592903&r2=592904&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
Wed Nov  7 13:27:45 2007
@@ -23,7 +23,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
-#if defined(FREEBSD) || defined(ZOS)
+#if defined(FREEBSD) || defined(AIX) || defined(ZOS)
 #include <sys/types.h>
 #include <sys/socket.h>
 #else
@@ -244,6 +244,19 @@
   if(hysocketP == NULL)
     return -1;
   socket = hysocketP->sock;
+#if defined(AIX) || defined(ZOS)
+  {
+    struct sf_parms parms;
+    parms.file_descriptor = (int)fd;
+    parms.file_offset = (off64_t)offset;
+    parms.file_bytes = count;
+    parms.header_data = 0;
+    parms.header_length = 0;
+    parms.trailer_data = 0;
+    parms.trailer_length = 0;
+    return send_file(&socket, &parms, 0);
+  }
+#else
   /* Value of offset is checked in jint scope (checked in java layer)
    The conversion here is to guarantee no value lost when converting offset to off_t
    */
@@ -252,5 +265,6 @@
   return sendfile(socket,(int)fd,(off_t *)&off,(size_t)count);	
 #else
   return sendfile(fd, socket, off, (size_t)count, NULL, NULL, 0);
+#endif
 #endif
 }



Mime
View raw message