You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/01/22 23:11:41 UTC

svn commit: r498827 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c

Author: hindessm
Date: Mon Jan 22 14:11:40 2007
New Revision: 498827

URL: http://svn.apache.org/viewvc?view=rev&rev=498827
Log:
FreeBSD sendfile support.  It may be that more OSes support the FreeBSD API
so we might need to change the conditions to use "#if defined(LINUX)".

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?view=diff&rev=498827&r1=498826&r2=498827
==============================================================================
--- 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 Mon Jan 22 14:11:40 2007
@@ -23,7 +23,12 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#if defined(FREEBSD)
+#include <sys/types.h>
+#include <sys/socket.h>
+#else
 #include <sys/sendfile.h>
+#endif
 #include "vmi.h"
 #include "iohelp.h"
 
@@ -234,6 +239,9 @@
   if(hysocketP == NULL)
     return -1;
   socket = hysocketP->sock;
+#if !defined(FREEBSD)
   return sendfile(socket,(int)fd,(off_t *)&offset,(size_t)count);	
+#else
+  return sendfile(fd, socket, offset, (size_t)count, NULL, NULL, 0);
+#endif
 }
-