[netperf-dev] netperf2 commit notice r144 - in trunk: . src

raj at netperf.org raj at netperf.org
Mon Oct 15 10:42:46 PDT 2007


Author: raj
Date: 2007-10-15 10:42:45 -0700 (Mon, 15 Oct 2007)
New Revision: 144

Modified:
   trunk/AUTHORS
   trunk/Release_Notes
   trunk/src/nettest_bsd.c
Log:
enable OSX sendfile support

Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2007-09-27 18:19:38 UTC (rev 143)
+++ trunk/AUTHORS	2007-10-15 17:42:45 UTC (rev 144)
@@ -209,4 +209,7 @@
 happier for folks redirecting same to a file.
 
 Alexander Duyck
-Fixes to replace struct sockaddr_in with struct sockaddr_storage
\ No newline at end of file
+Fixes to replace struct sockaddr_in with struct sockaddr_storage
+
+Anonymous
+Support for sendfile() on OSX
\ No newline at end of file

Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes	2007-09-27 18:19:38 UTC (rev 143)
+++ trunk/Release_Notes	2007-10-15 17:42:45 UTC (rev 144)
@@ -2,6 +2,9 @@
 
 Things changed in this release:
 
+*) A kind soul who wishes to remain anonymous provided a patch to
+   enable use of sendfile() on OSX.
+
 *) Fix a misplaced \n in a format string of send_tcp_maerts, courtesy
    of Alexander Duyck.
 

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2007-09-27 18:19:38 UTC (rev 143)
+++ trunk/src/nettest_bsd.c	2007-10-15 17:42:45 UTC (rev 144)
@@ -3495,6 +3495,9 @@
 				 to the value in the send_ring! so, we
 				 have to use a scratch variable. */
 #endif /* __linux  || defined(__sun__) */
+#if defined (USE_OSX)
+   off_t    scratch_len;  /* Darwin 9.x need a value-result parameter  */
+#endif
 #if defined (__sun__)
    size_t  scratch_len;	/* the sun sendfilev() needs a place to 
 			   tell us how many bytes were written,
@@ -3855,6 +3858,15 @@
 		      (off_t *)&len,
 		      send_ring->flags) != 0) ||
 	    (len != send_size))
+#elif defined(USE_OSX)
+    scratch_len = send_ring->length;
+    if ((sendfile(send_ring->fildes,
+              send_socket,
+              send_ring->offset,
+              (off_t *)&scratch_len,
+              NULL,
+              send_ring->flags) != 0) ||
+        (scratch_len != send_size))
 #else /* original sendile HP-UX */
 	  if ((len=sendfile(send_socket, 
 			    send_ring->fildes, 



More information about the netperf-dev mailing list