I need to migrate data from a Linux box (PATH_MAX 4096) to Solaris with
(PATH_MAX 1024) and it so happens that not only do paths longer than 1K actually
exist, but also is the application in no way bound to 4K paths.
In an effort to find a generic solution to these issues, I have written
liblongpath. See https://code.uplex.de/liblongpath - there is a manpage (online
as RST:
https://code.uplex.de/liblongpath/liblongpath/blobs/master/src/liblongpath.rst )
I am attaching a patch to rsync master which integrates liblongpath using the
redefining headers.
This patch needs
0002-modernize-configure.ac-update-gnulib-macros-and-add.patch.bz2 which is
included in my previous email.
To build rsync with liblongpath, either install liblongpath to a standard
prefix, or use rsync configure with
--with-liblongpath_unsafe-prefix=<prefix>
I have run successful tests on Debian 6, ancient OpenSolaris snv_134 (32 + 64
bit) and SmartOS 20130111T010112Z (32) with rsync and the (currently
undocumented) liblongpath test, so I am pretty confident that the initial
release should be at least of some use.
Also I have successfully migrated some ~1.5 TB of small files with
rsync+liblongpath.
Feedback welcome.
Nils
>From 49d5cf131be213bbbfe52e756e7a2461df784f72 Mon Sep 17 00:00:00 2001
From: Nils Goroll <[email protected]>
Date: Tue, 20 Aug 2013 12:27:53 +0200
Subject: [PATCH] use liblongpath if available
---
configure.ac | 8 ++++++++
flist.c | 3 +++
rsync.h | 8 ++++++++
syscall.c | 4 ++++
xattrs.c | 4 ++++
5 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 633aa5c..562dc87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -487,6 +487,14 @@ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
dnl AC_MSG_NOTICE([Looking in libraries: $LIBS])
+# longpath support - see https://code.uplex.de/liblongpath/liblongpath
+# as long as rsync is single threaded, we can use _unsafe
+# NOTE: CHANGE THIS WHEN GOING MULTI-THREADED!
+AC_LIB_HAVE_LINKFLAGS([longpath_unsafe], [], [#include <longpath/longpath.h>])
+if test x$HAVE_LIBLONGPATH_UNSAFE = xyes; then
+ LIBS="$LIBS $LIBLONGPATH_UNSAFE"
+fi
+
AC_CHECK_FUNCS(inet_ntop, , [AC_LIBOBJ(lib/inet_ntop)])
AC_CHECK_FUNCS(inet_pton, , [AC_LIBOBJ(lib/inet_pton)])
diff --git a/flist.c b/flist.c
index bf8d124..7b7b812 100644
--- a/flist.c
+++ b/flist.c
@@ -25,6 +25,9 @@
#include "rounding.h"
#include "inums.h"
#include "io.h"
+#if defined HAVE_LIBLONGPATH_UNSAFE
+#include <longpath/longpath_redefine_defs.h>
+#endif
extern int am_root;
extern int am_server;
diff --git a/rsync.h b/rsync.h
index 714906a..7c24df1 100644
--- a/rsync.h
+++ b/rsync.h
@@ -280,6 +280,10 @@ enum delret {
#include "config.h"
+#if defined HAVE_LIBLONGPATH_UNSAFE
+#include <longpath/longpath_redefine_pre.h>
+#endif
+
/* The default RSYNC_RSH is always set in config.h. */
#include <stdio.h>
@@ -1289,3 +1293,7 @@ char *getpass(const char *prompt);
#ifdef MAINTAINER_MODE
const char *get_panic_action(void);
#endif
+
+#if defined HAVE_LIBLONGPATH_UNSAFE
+#include <longpath/longpath_redefine_post.h>
+#endif
diff --git a/syscall.c b/syscall.c
index fd23d15..169a631 100644
--- a/syscall.c
+++ b/syscall.c
@@ -33,6 +33,10 @@
#include <sys/syscall.h>
#endif
+#if defined HAVE_LIBLONGPATH_UNSAFE
+#include <longpath/longpath_redefine_post.h>
+#endif
+
extern int dry_run;
extern int am_root;
extern int am_sender;
diff --git a/xattrs.c b/xattrs.c
index df2ea82..8391147 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -26,6 +26,10 @@
#ifdef SUPPORT_XATTRS
+#if defined HAVE_LIBLONGPATH_UNSAFE
+#include <longpath/longpath_redefine_post.h>
+#endif
+
extern int dry_run;
extern int am_root;
extern int am_sender;
--
1.5.6.5
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html