Displaying 1 result from an estimated 1 matches for "fd_to_send".
2009 Nov 04
0
PATCH: fast copy of files in local server mode
...300
@@ -29,6 +29,7 @@
#include "rsync.h"
#include "ifuncs.h"
+#include <linux/socket.h>
/** If no timeout is specified then use a 60 second select timeout */
#define SELECT_TIMEOUT 60
@@ -1722,6 +1723,82 @@
writefd(f, str, len);
}
+int send_fd(int socket, int fd_to_send)
+{
+ struct msghdr message;
+ struct iovec iov[1];
+ struct cmsghdr *control_message = NULL;
+ char buffer[CMSG_SPACE(sizeof(int))], data[1];
+ int ret;
+
+ memset(&message, 0, sizeof(struct msghdr));
+ memset(buffer, 0, CMSG_SPACE(sizeof(int)));
+
+ data[0] = 'F';
+ iov[0].iov_base =...