[Glibc-bsd-commits] r5231 - in trunk/freebsd-glue: debian include/sys src/freebsd-glue
rmh at alioth.debian.org
rmh at alioth.debian.org
Tue Dec 10 13:54:41 UTC 2013
Author: rmh
Date: 2013-12-10 13:54:41 +0000 (Tue, 10 Dec 2013)
New Revision: 5231
Added:
trunk/freebsd-glue/src/freebsd-glue/sendfile.c
Modified:
trunk/freebsd-glue/debian/changelog
trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
trunk/freebsd-glue/include/sys/socket.h
trunk/freebsd-glue/src/freebsd-glue/Makefile
Log:
Provide bsd_sendfile() syscall stub, and map sendfile() to it in <sys/socket.h>.
Modified: trunk/freebsd-glue/debian/changelog
===================================================================
--- trunk/freebsd-glue/debian/changelog 2013-12-08 23:11:56 UTC (rev 5230)
+++ trunk/freebsd-glue/debian/changelog 2013-12-10 13:54:41 UTC (rev 5231)
@@ -3,6 +3,8 @@
* Use -O2 for normal build and -Os for udeb build.
* Use MAKEOBJDIRPREFIX instead of MAKEOBJDIR, so that each library has
its own object directory.
+ * Provide bsd_sendfile() syscall stub, and map sendfile() to it in
+ <sys/socket.h>.
-- Robert Millan <rmh at debian.org> Thu, 05 Dec 2013 20:26:27 +0100
Modified: trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
===================================================================
--- trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols 2013-12-08 23:11:56 UTC (rev 5230)
+++ trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols 2013-12-10 13:54:41 UTC (rev 5231)
@@ -1,4 +1,5 @@
libfreebsd-glue.so.0 libfreebsd-glue-0 #MINVER#
+ (arch=kfreebsd-any)bsd_sendfile at Base 0.2.6
cgetcap at Base 0.1.15
cgetclose at Base 0.1.15
cgetent at Base 0.1.15
Modified: trunk/freebsd-glue/include/sys/socket.h
===================================================================
--- trunk/freebsd-glue/include/sys/socket.h 2013-12-08 23:11:56 UTC (rev 5230)
+++ trunk/freebsd-glue/include/sys/socket.h 2013-12-10 13:54:41 UTC (rev 5231)
@@ -9,4 +9,10 @@
int setfib(int fib);
__END_DECLS
+#ifdef __FreeBSD_kernel__
+/* bsd_sendfile prototype already in glibc. */
+#define sendfile(fd, s, offset, nbytes, hdtr, sbytes, flags) \
+ bsd_sendfile((fd), (s), (offset), (nbytes), (hdtr), (sbytes), (flags))
#endif
+
+#endif
Modified: trunk/freebsd-glue/src/freebsd-glue/Makefile
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/Makefile 2013-12-08 23:11:56 UTC (rev 5230)
+++ trunk/freebsd-glue/src/freebsd-glue/Makefile 2013-12-10 13:54:41 UTC (rev 5231)
@@ -28,6 +28,7 @@
mac.c \
mac_set.c \
socket.c \
+ sendfile.c \
${NULL}
.endif
Added: trunk/freebsd-glue/src/freebsd-glue/sendfile.c
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/sendfile.c (rev 0)
+++ trunk/freebsd-glue/src/freebsd-glue/sendfile.c 2013-12-10 13:54:41 UTC (rev 5231)
@@ -0,0 +1,12 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+int
+bsd_sendfile (int fd, int s, off_t offset, size_t nbytes,
+ struct sf_hdtr *hdtr, off_t *sbytes, int flags)
+{
+ return syscall (SYS_sendfile, fd, s, offset, nbytes, hdtr, sbytes, flags);
+}
More information about the Glibc-bsd-commits
mailing list