aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Simon <dylan@dylex.net>2010-03-08 22:01:26 -0500
committerMichael Bestas <mikeioannina@gmail.com>2015-08-19 00:12:12 +0300
commit432373ecf8e1f702e4c82afac9a61d2b96445187 (patch)
tree9f6430d4d1145395134a549cfdeb0274333ded48
parent7cb0de6326c915a72253fd103dae93308031ec3f (diff)
downloadandroid_external_rsync-432373ecf8e1f702e4c82afac9a61d2b96445187.tar.gz
android_external_rsync-432373ecf8e1f702e4c82afac9a61d2b96445187.tar.bz2
android_external_rsync-432373ecf8e1f702e4c82afac9a61d2b96445187.zip
Android build, static config, and changes
Works fine on emulator both for local copies and in daemon mode. Very few changes necessary. Change-Id: I6ef54769b00333f84eabd1306381eac80b3d5f09
-rw-r--r--.gitignore3
-rw-r--r--Android.mk76
-rw-r--r--authenticate.c30
-rw-r--r--config.h689
-rw-r--r--flist.c10
-rw-r--r--generator.c10
-rw-r--r--popt/poptint.h2
-rw-r--r--proto.h401
-rw-r--r--rounding.h1
-rw-r--r--rsync.h9
-rw-r--r--syscall.c2
-rw-r--r--xattrs.c2
12 files changed, 1219 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 948d3f7f..67ee9abb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,12 +7,10 @@ Makefile.old
configure.sh
configure.sh.old
config.cache
-config.h
config.h.in
config.h.in.old
config.log
config.status
-/proto.h
/proto.h-tstamp
/rsync.1
/rsyncd.conf.5
@@ -36,7 +34,6 @@ config.status
/t_unsafe
/wildtest
/getfsdev
-/rounding.h
/doc/rsync.pdf
/doc/rsync.ps
/support/savetransfer
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 00000000..7dabc5a8
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,76 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ flist.c \
+ rsync.c \
+ generator.c \
+ receiver.c \
+ cleanup.c \
+ sender.c \
+ exclude.c \
+ util.c \
+ main.c \
+ checksum.c \
+ match.c \
+ syscall.c \
+ log.c \
+ backup.c \
+ options.c \
+ io.c \
+ compat.c \
+ hlink.c \
+ token.c \
+ uidlist.c \
+ socket.c \
+ hashtable.c \
+ fileio.c \
+ batch.c \
+ clientname.c \
+ chmod.c \
+ acls.c \
+ xattrs.c \
+ progress.c \
+ pipe.c \
+ params.c \
+ loadparm.c \
+ clientserver.c \
+ access.c \
+ connection.c \
+ authenticate.c \
+ lib/wildmatch.c \
+ lib/compat.c \
+ lib/snprintf.c \
+ lib/mdfour.c \
+ lib/md5.c \
+ lib/permstring.c \
+ lib/pool_alloc.c \
+ lib/sysacls.c \
+ lib/sysxattrs.c \
+ lib/inet_ntop.c \
+ lib/inet_pton.c \
+ lib/getaddrinfo.c \
+ zlib/deflate.c \
+ zlib/inffast.c \
+ zlib/inflate.c \
+ zlib/inftrees.c \
+ zlib/trees.c \
+ zlib/zutil.c \
+ zlib/adler32.c \
+ zlib/compress.c \
+ zlib/crc32.c \
+ popt/findme.c \
+ popt/popt.c \
+ popt/poptconfig.c \
+ popt/popthelp.c \
+ popt/poptparse.c
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/popt
+
+LOCAL_CFLAGS := -DHAVE_CONFIG_H
+
+LOCAL_MODULE := rsync
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+
+include $(BUILD_EXECUTABLE)
diff --git a/authenticate.c b/authenticate.c
index c92746c6..f363e72e 100644
--- a/authenticate.c
+++ b/authenticate.c
@@ -343,6 +343,36 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
return strdup(line);
}
+#ifdef __BIONIC__
+#include <termios.h>
+static const char *getpass(char *prompt)
+{
+ struct termios old, new;
+ static char res[256];
+ char *p;
+
+ /* Turn echoing off and fail if we can't. */
+ if (tcgetattr (0, &old) != 0)
+ return NULL;
+ new = old;
+ new.c_lflag &= ~ECHO;
+ if (tcsetattr (0, TCSAFLUSH, &new) != 0)
+ return NULL;
+
+ fprintf(stderr, "%s", prompt);
+ fflush(stderr);
+ fgets(res, 256, stdin);
+ if ((p = strchr(res, '\n')))
+ *p = 0;
+
+ /* Restore terminal. */
+ tcsetattr (0, TCSAFLUSH, &old);
+
+ return res;
+}
+
+#endif
+
void auth_client(int fd, const char *user, const char *challenge)
{
const char *pass;
diff --git a/config.h b/config.h
new file mode 100644
index 00000000..74318936
--- /dev/null
+++ b/config.h
@@ -0,0 +1,689 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define to 1 if link() can hard-link special files. */
+/* #undef CAN_HARDLINK_SPECIAL */
+
+/* Define to 1 if link() can hard-link symlinks. */
+/* #undef CAN_HARDLINK_SYMLINK */
+
+/* Define to 1 if chown modifies symlinks. */
+/* #undef CHOWN_MODIFIES_SYMLINK */
+
+/* Undefine if you don't want locale features. By default this is defined. */
+/* #undef CONFIG_LOCALE */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Used to make "checker" understand that FD_ZERO() clears memory. */
+/* #undef FORCE_FD_ZERO_MEMSET */
+
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
+#define GETGROUPS_T gid_t
+
+/* Define to 1 if the `getpgrp' function requires zero arguments. */
+#define GETPGRP_VOID 1
+
+/* Define to 1 if you have the `aclsort' function. */
+/* #undef HAVE_ACLSORT */
+
+/* true if you have acl_get_perm_np */
+/* #undef HAVE_ACL_GET_PERM_NP */
+
+/* Define to 1 if you have the <acl/libacl.h> header file. */
+/* #undef HAVE_ACL_LIBACL_H */
+
+/* true if you have AIX ACLs */
+/* #undef HAVE_AIX_ACLS */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#define HAVE_ALLOCA_H 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#define HAVE_ARPA_NAMESER_H 1
+
+/* Define to 1 if you have the `asprintf' function. */
+#define HAVE_ASPRINTF 1
+
+/* Define to 1 if you have the <attr/xattr.h> header file. */
+/* #undef HAVE_ATTR_XATTR_H */
+
+/* Define to 1 if readdir() is broken */
+/* #undef HAVE_BROKEN_READDIR */
+
+/* Define to 1 if vsprintf has a C99-compatible return value */
+/* #undef HAVE_C99_VSNPRINTF */
+
+/* Define to 1 if you have the `chmod' function. */
+#define HAVE_CHMOD 1
+
+/* Define to 1 if you have the `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define to 1 if you have the <compat.h> header file. */
+/* #undef HAVE_COMPAT_H */
+
+/* Define to 1 if you have the "connect" function */
+#define HAVE_CONNECT 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if errno is declared in errno.h */
+#define HAVE_ERRNO_DECL 1
+
+/* Define to 1 if you have the `extattr_get_link' function. */
+/* #undef HAVE_EXTATTR_GET_LINK */
+
+/* Define to 1 if you have the `fchmod' function. */
+#define HAVE_FCHMOD 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* True if you have FreeBSD xattrs */
+/* #undef HAVE_FREEBSD_XATTRS */
+
+/* Define to 1 if you have the `fstat' function. */
+#define HAVE_FSTAT 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the "getaddrinfo" function and required types. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `getegid' function. */
+#define HAVE_GETEGID 1
+
+/* Define to 1 if you have the `geteuid' function. */
+#define HAVE_GETEUID 1
+
+/* Define to 1 if you have the `getgroups' function. */
+#define HAVE_GETGROUPS 1
+
+/* Define to 1 if you have the `getpgrp' function. */
+#define HAVE_GETPGRP 1
+
+/* Define to 1 if gettimeofday() takes a time-zone arg */
+#define HAVE_GETTIMEOFDAY_TZ 1
+
+/* Define to 1 if you have the `getxattr' function. */
+/* #undef HAVE_GETXATTR */
+
+/* Define to 1 if you have the <grp.h> header file. */
+#define HAVE_GRP_H 1
+
+/* true if you have HPUX ACLs */
+/* #undef HAVE_HPUX_ACLS */
+
+/* Define to 1 if you have the <iconv.h> header file. */
+/* #undef HAVE_ICONV_H */
+
+/* Define to 1 if you have the `iconv_open' function. */
+/* #undef HAVE_ICONV_OPEN */
+
+/* Define to 1 if the system has the type `id_t'. */
+#define HAVE_ID_T 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the `inet_pton' function. */
+#define HAVE_INET_PTON 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* true if you have IRIX ACLs */
+/* #undef HAVE_IRIX_ACLS */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define to 1 if you have the `lchmod' function. */
+/* #undef HAVE_LCHMOD */
+
+/* Define to 1 if you have the `lchown' function. */
+#define HAVE_LCHOWN 1
+
+/* Define to 1 if you have the `acl' library (-lacl). */
+/* #undef HAVE_LIBACL */
+
+/* Define to 1 if you have the <libcharset.h> header file. */
+/* #undef HAVE_LIBCHARSET_H */
+
+/* Define to 1 if you have the `inet' library (-linet). */
+/* #undef HAVE_LIBINET */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `nsl_s' library (-lnsl_s). */
+/* #undef HAVE_LIBNSL_S */
+
+/* Define to 1 if you have the `popt' library (-lpopt). */
+/* #undef HAVE_LIBPOPT */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the `sec' library (-lsec). */
+/* #undef HAVE_LIBSEC */
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `link' function. */
+#define HAVE_LINK 1
+
+/* True if you have Linux xattrs */
+/* #undef HAVE_LINUX_XATTRS */
+
+/* Define to 1 if you have the `locale_charset' function. */
+/* #undef HAVE_LOCALE_CHARSET */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if the type `long double' works and has more range or precision
+ than `double'. */
+/* #undef HAVE_LONG_DOUBLE */
+
+/* Define to 1 if the type `long double' works and has more range or precision
+ than `double'. */
+/* #undef HAVE_LONG_DOUBLE_WIDER */
+
+/* Define to 1 if you have the `lseek64' function. */
+#define HAVE_LSEEK64 1
+
+/* Define to 1 if you have the `lutimes' function. */
+/* #undef HAVE_LUTIMES */
+
+/* Define to 1 if you have the `mallinfo' function. */
+#define HAVE_MALLINFO 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <mcheck.h> header file. */
+/* #undef HAVE_MCHECK_H */
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkfifo' function. */
+/* #undef HAVE_MKFIFO */
+
+/* Define to 1 if you have the `mknod' function. */
+#define HAVE_MKNOD 1
+
+/* Define to 1 if you have the `mkstemp64' function. */
+/* #undef HAVE_MKSTEMP64 */
+
+/* Define to 1 if the system has the type `mode_t'. */
+#define HAVE_MODE_T 1
+
+/* Define to 1 if you have the `mtrace' function. */
+/* #undef HAVE_MTRACE */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+/* #undef HAVE_NL_LANGINFO */
+
+/* Define to 1 if the system has the type `off_t'. */
+#define HAVE_OFF_T 1
+
+/* Define to 1 if you have the `open64' function. */
+/* #undef HAVE_OPEN64 */
+
+/* true if you have Mac OS X ACLs */
+/* #undef HAVE_OSX_ACLS */
+
+/* True if you have Mac OS X xattrs */
+/* #undef HAVE_OSX_XATTRS */
+
+/* Define to 1 if the system has the type `pid_t'. */
+#define HAVE_PID_T 1
+
+/* Define to 1 if you have the <popt.h> header file. */
+/* #undef HAVE_POPT_H */
+
+/* Define to 1 if you have the <popt/popt.h> header file. */
+/* #undef HAVE_POPT_POPT_H */
+
+/* true if you have posix ACLs */
+/* #undef HAVE_POSIX_ACLS */
+
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define to 1 if you have the `readlink' function. */
+#define HAVE_READLINK 1
+
+/* Define to 1 if remote shell is remsh, not rsh */
+/* #undef HAVE_REMSH */
+
+/* Define to 1 if mkstemp() is available and works right */
+#define HAVE_SECURE_MKSTEMP 1
+
+/* Define to 1 if you have the `setattrlist' function. */
+/* #undef HAVE_SETATTRLIST */
+
+/* Define to 1 if you have the `seteuid' function. */
+#define HAVE_SETEUID 1
+
+/* Define to 1 if you have the `setgroups' function. */
+#define HAVE_SETGROUPS 1
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setmode' function. */
+/* #undef HAVE_SETMODE */
+
+/* Define to 1 if you have the `setsid' function. */
+#define HAVE_SETSID 1
+
+/* Define to 1 if you have the `sigaction' function. */
+#define HAVE_SIGACTION 1
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#define HAVE_SIGPROCMASK 1
+
+/* Define to 1 if the system has the type `size_t'. */
+#define HAVE_SIZE_T 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Do we have sockaddr_in6.sin6_scope_id? */
+#define HAVE_SOCKADDR_IN6_SCOPE_ID 1
+
+/* Do we have sockaddr_in.sin_len? */
+/* #undef HAVE_SOCKADDR_IN_LEN */
+
+/* Do we have sockaddr.sa_len? */
+/* #undef HAVE_SOCKADDR_LEN */
+
+/* Do we have sockaddr_un.sun_len? */
+/* #undef HAVE_SOCKADDR_UN_LEN */
+
+/* Define to 1 if you have the "socketpair" function */
+/* #undef HAVE_SOCKETPAIR */
+
+/* true if you have solaris ACLs */
+/* #undef HAVE_SOLARIS_ACLS */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strpbrk' function. */
+#define HAVE_STRPBRK 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#define HAVE_STRUCT_ADDRINFO 1
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+
+/* Define to 1 if the system has the type `struct stat64'. */
+#define HAVE_STRUCT_STAT64 1
+
+/* Define to 1 if `st_rdev' is member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if you have the "struct utimbuf" type */
+#define HAVE_STRUCT_UTIMBUF 1
+
+/* Define to 1 if you have the <sys/acl.h> header file. */
+/* #undef HAVE_SYS_ACL_H */
+
+/* Define to 1 if you have the <sys/attr.h> header file. */
+/* #undef HAVE_SYS_ATTR_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/extattr.h> header file. */
+/* #undef HAVE_SYS_EXTATTR_H */
+
+/* Define to 1 if you have the <sys/fcntl.h> header file. */
+/* #undef HAVE_SYS_FCNTL_H */
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+/* #undef HAVE_SYS_FILIO_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/mode.h> header file. */
+/* #undef HAVE_SYS_MODE_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/unistd.h> header file. */
+/* #undef HAVE_SYS_UNISTD_H */
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+/* #undef HAVE_SYS_XATTR_H */
+
+/* Define to 1 if you have the `tcgetpgrp' function. */
+#define HAVE_TCGETPGRP 1
+
+/* true if you have Tru64 ACLs */
+/* #undef HAVE_TRU64_ACLS */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* true if you have UnixWare ACLs */
+/* #undef HAVE_UNIXWARE_ACLS */
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimes' function. */
+#define HAVE_UTIMES 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
+/* #undef HAVE_UTIME_NULL */
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define HAVE_VASPRINTF 1
+
+/* Define to 1 if you have the `va_copy' function. */
+/* #undef HAVE_VA_COPY */
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `wait4' function. */
+/* #undef HAVE_WAIT4 */
+
+/* Define to 1 if you have the `waitpid' function. */
+#define HAVE_WAITPID 1
+
+/* Define to 1 if you have the `_acl' function. */
+/* #undef HAVE__ACL */
+
+/* Define to 1 if you have the `_facl' function. */
+/* #undef HAVE__FACL */
+
+/* Define to 1 if you have the `__acl' function. */
+/* #undef HAVE___ACL */
+
+/* Define to 1 if you have the `__facl' function. */
+/* #undef HAVE___FACL */
+
+/* Define to 1 if you have the `__va_copy' function. */
+/* #undef HAVE___VA_COPY */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Define if you want the --iconv option. Specifing a value will set the
+ default iconv setting (a NULL means no --iconv processing by default). */
+/* #undef ICONV_OPTION */
+
+/* true if you have IPv6 */
+/* #undef INET6 */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+/* #undef MAJOR_IN_MKDEV */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+/* #undef MAJOR_IN_SYSMACROS */
+
+/* Define to 1 if makedev() takes 3 args */
+/* #undef MAKEDEV_TAKES_3_ARGS */
+
+/* Define to 1 if mknod() can create FIFOs. */
+/* #undef MKNOD_CREATES_FIFOS */
+
+/* Define to 1 if mknod() can create sockets. */
+/* #undef MKNOD_CREATES_SOCKETS */
+
+/* unprivileged group for unprivileged user */
+#define NOBODY_GROUP "nobody"
+
+/* unprivileged user--e.g. nobody */
+#define NOBODY_USER "nobody"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* location of configuration file for rsync server */
+#define RSYNCD_SYSCONF "/etc/rsyncd.conf"
+
+/* location of rsync on remote machine */
+#define RSYNC_PATH "rsync"
+
+/* default -e command */
+#define RSYNC_RSH "ssh"
+
+/* rsync release version */
+#define RSYNC_VERSION "3.0.7"
+
+/* Define to 1 if sockets need to be shutdown */
+/* #undef SHUTDOWN_ALL_SOCKETS */
+
+/* Define to 1 if "signed char" is a valid type */
+#define SIGNED_CHAR_OK 1
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `int16_t', as computed by sizeof. */
+#define SIZEOF_INT16_T 2
+
+/* The size of `int32_t', as computed by sizeof. */
+#define SIZEOF_INT32_T 4
+
+/* The size of `int64_t', as computed by sizeof. */
+#define SIZEOF_INT64_T 8
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `off64_t', as computed by sizeof. */
+#define SIZEOF_OFF64_T 8
+
+/* The size of `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T 4
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 4
+
+/* The size of `uint16_t', as computed by sizeof. */
+#define SIZEOF_UINT16_T 2
+
+/* The size of `uint32_t', as computed by sizeof. */
+#define SIZEOF_UINT32_T 4
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 to add support for ACLs */
+/* #undef SUPPORT_ACLS */
+
+/* Define to 1 to add support for extended attributes */
+/* #undef SUPPORT_XATTRS */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if you want rsync to make use of iconv_open() */
+/* #undef USE_ICONV_OPEN */
+
+/* String to pass to iconv() for the UTF-8 charset. */
+/* #undef UTF8_CHARSET */
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define _GNU_SOURCE so that we get all necessary prototypes */
+#define _GNU_SOURCE 1
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* type to use in place of socklen_t if not defined */
+/* #undef socklen_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
diff --git a/flist.c b/flist.c
index c24672e8..926e96a2 100644
--- a/flist.c
+++ b/flist.c
@@ -90,7 +90,7 @@ extern iconv_t ic_send, ic_recv;
int io_error;
int checksum_len;
-dev_t filesystem_dev; /* used to implement -x */
+DEV_T filesystem_dev; /* used to implement -x */
struct file_list *cur_flist, *first_flist, *dir_flist;
int send_dir_ndx = -1, send_dir_depth = -1;
@@ -119,7 +119,7 @@ int flist_eof = 0; /* all the file-lists are now known */
/* The tmp_* vars are used as a cache area by make_file() to store data
* that the sender doesn't need to remember in its file list. The data
* will survive just long enough to be used by send_file_entry(). */
-static dev_t tmp_rdev;
+static DEV_T tmp_rdev;
#ifdef SUPPORT_HARD_LINKS
static int64 tmp_dev = -1, tmp_ino;
#endif
@@ -402,7 +402,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
- static dev_t rdev;
+ static DEV_T rdev;
static uint32 rdev_major;
static uid_t uid;
static gid_t gid;
@@ -675,7 +675,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
- static dev_t rdev;
+ static DEV_T rdev;
static uint32 rdev_major;
static uid_t uid;
static gid_t gid;
@@ -849,7 +849,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
|| (preserve_specials && IS_SPECIAL(mode) && protocol_version < 31)) {
if (protocol_version < 28) {
if (!(xflags & XMIT_SAME_RDEV_pre28))
- rdev = (dev_t)read_int(f);
+ rdev = (DEV_T)read_int(f);
} else {
uint32 rdev_minor;
if (!(xflags & XMIT_SAME_RDEV_MAJOR))
diff --git a/generator.c b/generator.c
index 91009a53..d7d8497b 100644
--- a/generator.c
+++ b/generator.c
@@ -90,7 +90,7 @@ extern int max_delete;
extern int force_delete;
extern int one_file_system;
extern int skipped_deletes;
-extern dev_t filesystem_dev;
+extern DEV_T filesystem_dev;
extern mode_t orig_umask;
extern uid_t our_uid;
extern char *tmpdir;
@@ -100,7 +100,7 @@ extern filter_rule_list filter_list, daemon_filter_list;
int maybe_ATTRS_REPORT = 0;
-static dev_t dev_zero;
+static DEV_T dev_zero;
static int deldelay_size = 0, deldelay_cnt = 0;
static char *deldelay_buf = NULL;
static int deldelay_fd = -1;
@@ -272,7 +272,7 @@ static void do_delayed_deletions(char *delbuf)
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
* on exit). */
-static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
+static void delete_in_dir(char *fbuf, struct file_struct *file, DEV_T *fs_dev)
{
static int already_warned = 0;
struct file_list *dirlist;
@@ -1563,7 +1563,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
|| (preserve_specials && IS_SPECIAL(file->mode))) {
- dev_t rdev;
+ DEV_T rdev;
int del_for_flag = 0;
if (IS_DEVICE(file->mode)) {
uint32 *devp = F_RDEV_P(file);
@@ -2230,7 +2230,7 @@ void generate_files(int f_out, const char *local_name)
if (delete_during && dry_run < 2 && !list_only
&& !(fp->flags & FLAG_MISSING_DIR)) {
if (fp->flags & FLAG_CONTENT_DIR) {
- dev_t dirdev;
+ DEV_T dirdev;
if (one_file_system) {
uint32 *devp = F_DIR_DEV_P(fp);
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
diff --git a/popt/poptint.h b/popt/poptint.h
index bec7c976..9c11c836 100644
--- a/popt/poptint.h
+++ b/popt/poptint.h
@@ -9,6 +9,8 @@
#ifndef H_POPTINT
#define H_POPTINT
+#include <stdlib.h>
+
/**
* Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
* @param p memory to free
diff --git a/proto.h b/proto.h
new file mode 100644
index 00000000..258a2db9
--- /dev/null
+++ b/proto.h
@@ -0,0 +1,401 @@
+/* This file is automatically generated with "make proto". DO NOT EDIT */
+
+int allow_access(char *addr, char *host, char *allow_list, char *deny_list);
+void free_acl(stat_x *sxp);
+int get_acl(const char *fname, stat_x *sxp);
+void send_acl(stat_x *sxp, int f);
+void receive_acl(struct file_struct *file, int f);
+void cache_tmp_acl(struct file_struct *file, stat_x *sxp);
+void uncache_tmp_acls(void);
+int set_acl(const char *fname, const struct file_struct *file, stat_x *sxp);
+void match_acl_ids(void);
+int default_perms_for_dir(const char *dir);
+void base64_encode(const char *buf, int len, char *out, int pad);
+char *auth_server(int f_in, int f_out, int module, const char *host,
+ const char *addr, const char *leader);
+void auth_client(int fd, const char *user, const char *challenge);
+char *get_backup_name(const char *fname);
+int make_bak_dir(const char *fullpath);
+int make_backup(const char *fname);
+void write_stream_flags(int fd);
+void read_stream_flags(int fd);
+void check_batch_flags(void);
+void write_batch_shell_file(int argc, char *argv[], int file_arg_cnt);
+uint32 get_checksum1(char *buf1, int32 len);
+void get_checksum2(char *buf, int32 len, char *sum);
+void file_checksum(char *fname, char *sum, OFF_T size);
+void sum_init(int seed);
+void sum_update(const char *p, int32 len);
+int sum_end(char *sum);
+struct chmod_mode_struct *parse_chmod(const char *modestr,
+ struct chmod_mode_struct **root_mode_ptr);
+int tweak_mode(int mode, struct chmod_mode_struct *chmod_modes);
+int free_chmod_mode(struct chmod_mode_struct *chmod_modes);
+void close_all(void);
+NORETURN void _exit_cleanup(int code, const char *file, int line);
+void cleanup_disable(void);
+void cleanup_set(const char *fnametmp, const char *fname, struct file_struct *file,
+ int fd_r, int fd_w);
+void cleanup_set_pid(pid_t pid);
+char *client_addr(int fd);
+char *client_name(int fd);
+void client_sockaddr(int fd,
+ struct sockaddr_storage *ss,
+ socklen_t *ss_len);
+int lookup_name(int fd, const struct sockaddr_storage *ss,
+ socklen_t ss_len,
+ char *name_buf, size_t name_buf_size,
+ char *port_buf, size_t port_buf_size);
+int compare_addrinfo_sockaddr(const struct addrinfo *ai,
+ const struct sockaddr_storage *ss);
+int check_name(int fd,
+ const struct sockaddr_storage *ss,
+ char *name_buf, size_t name_buf_size);
+int start_socket_client(char *host, int remote_argc, char *remote_argv[],
+ int argc, char *argv[]);
+int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char *argv[]);
+int start_daemon(int f_in, int f_out);
+int daemon_main(void);
+void set_allow_inc_recurse(void);
+void setup_protocol(int f_out,int f_in);
+int claim_connection(char *fname, int max_connections);
+void set_filter_dir(const char *dir, unsigned int dirlen);
+void *push_local_filters(const char *dir, unsigned int dirlen);
+void pop_local_filters(void *mem);
+void change_local_filter_dir(const char *dname, int dlen, int dir_depth);
+int check_filter(struct filter_list_struct *listp, enum logcode code,
+ const char *name, int name_is_dir);
+void parse_rule(struct filter_list_struct *listp, const char *pattern,
+ uint32 mflags, int xflags);
+void parse_filter_file(struct filter_list_struct *listp, const char *fname,
+ uint32 mflags, int xflags);
+char *get_rule_prefix(int match_flags, const char *pat, int for_xfer,
+ unsigned int *plen_ptr);
+void send_filter_list(int f_out);
+void recv_filter_list(int f_in);
+int sparse_end(int f);
+int flush_write_file(int f);
+int write_file(int f, char *buf, int len);
+struct map_struct *map_file(int fd, OFF_T len, int32 read_size,
+ int32 blk_size);
+char *map_ptr(struct map_struct *map, OFF_T offset, int32 len);
+int unmap_file(struct map_struct *map);
+void init_flist(void);
+void show_flist_stats(void);
+int link_stat(const char *path, STRUCT_STAT *stp, int follow_dirlinks);
+int change_pathname(struct file_struct *file, const char *dir, int dirlen);
+struct file_struct *make_file(const char *fname, struct file_list *flist,
+ STRUCT_STAT *stp, int flags, int filter_level);
+void unmake_file(struct file_struct *file);
+void send_extra_file_list(int f, int at_least);
+struct file_list *send_file_list(int f, int argc, char *argv[]);
+struct file_list *recv_file_list(int f);
+void recv_additional_file_list(int f);
+int flist_find(struct file_list *flist, struct file_struct *f);
+int flist_find_ignore_dirness(struct file_list *flist, struct file_struct *f);
+void clear_file(struct file_struct *file);
+struct file_list *flist_new(int flags, char *msg);
+void flist_free(struct file_list *flist);
+int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2);
+int f_name_has_prefix(const struct file_struct *f1, const struct file_struct *f2);
+char *f_name_buf(void);
+char *f_name(const struct file_struct *f, char *fbuf);
+struct file_list *get_dirlist(char *dirname, int dlen, int ignore_filter_rules);
+int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp);
+void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statret,
+ stat_x *sxp, int32 iflags, uchar fnamecmp_type,
+ const char *xname);
+int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st);
+void check_for_finished_files(int itemizing, enum logcode code, int check_redo);
+void generate_files(int f_out, const char *local_name);
+struct hashtable *hashtable_create(int size, int key64);
+void hashtable_destroy(struct hashtable *tbl);
+void *hashtable_find(struct hashtable *tbl, int64 key, int allocate_if_missing);
+void init_hard_links(void);
+struct ht_int64_node *idev_find(int64 dev, int64 ino);
+void idev_destroy(void);
+void match_hard_links(struct file_list *flist);
+int hard_link_check(struct file_struct *file, int ndx, const char *fname,
+ int statret, stat_x *sxp, int itemizing,
+ enum logcode code);
+int hard_link_one(struct file_struct *file, const char *fname,
+ const char *oldname, int terse);
+void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
+ STRUCT_STAT *stp, int itemizing, enum logcode code,
+ int alt_dest);
+int skip_hard_link(struct file_struct *file, struct file_list **flist_p);
+void io_set_sock_fds(int f_in, int f_out);
+void set_io_timeout(int secs);
+void set_msg_fd_in(int fd);
+void set_msg_fd_out(int fd);
+void increment_active_files(int ndx, int itemizing, enum logcode code);
+int send_msg(enum msgcode code, const char *buf, int len, int convert);
+void send_msg_int(enum msgcode code, int num);
+void wait_for_receiver(void);
+int get_redo_num(void);
+int get_hlink_num(void);
+void io_set_filesfrom_fds(int f_in, int f_out);
+int read_line(int fd, char *buf, size_t bufsiz, int flags);
+void read_args(int f_in, char *mod_name, char *buf, size_t bufsiz, int rl_nulls,
+ char ***argv_p, int *argc_p, char **request_p);
+int io_start_buffering_out(int f_out);
+int io_start_buffering_in(int f_in);
+void io_end_buffering_in(void);
+void io_end_buffering_out(void);
+void maybe_flush_socket(int important);
+void maybe_send_keepalive(void);
+void start_flist_forward(int f_in);
+void stop_flist_forward(void);
+unsigned short read_shortint(int f);
+int32 read_int(int f);
+int32 read_varint(int f);
+int64 read_varlong(int f, uchar min_bytes);
+int64 read_longint(int f);
+void read_buf(int f, char *buf, size_t len);
+void read_sbuf(int f, char *buf, size_t len);
+uchar read_byte(int f);
+int read_vstring(int f, char *buf, int bufsize);
+void read_sum_head(int f, struct sum_struct *sum);
+void write_sum_head(int f, struct sum_struct *sum);
+int io_flush(int flush_it_all);
+void write_shortint(int f, unsigned short x);
+void write_int(int f, int32 x);
+void write_varint(int f, int32 x);
+void write_varlong(int f, int64 x, uchar min_bytes);
+void write_longint(int f, int64 x);
+void write_buf(int f, const char *buf, size_t len);
+void write_sbuf(int f, const char *buf);
+void write_byte(int f, uchar c);
+void write_vstring(int f, const char *str, int len);
+void write_ndx(int f, int32 ndx);
+int32 read_ndx(int f);
+int read_line_old(int f, char *buf, size_t bufsiz);
+void io_printf(int fd, const char *format, ...);
+void io_start_multiplex_out(void);
+void io_start_multiplex_in(void);
+int io_multiplex_write(enum msgcode code, const char *buf, size_t len, int convert);
+void io_end_multiplex_in(void);
+void io_end_multiplex_out(void);
+void start_write_batch(int fd);
+void stop_write_batch(void);
+char *lp_bind_address(void);
+char *lp_motd_file(void);
+char *lp_pid_file(void);
+char *lp_socket_options(void);
+int lp_rsync_port(void);
+char *lp_auth_users(int module_id);
+char *lp_charset(int module_id);
+char *lp_comment(int module_id);
+char *lp_dont_compress(int module_id);
+char *lp_exclude(int module_id);
+char *lp_exclude_from(int module_id);
+char *lp_filter(int module_id);
+char *lp_gid(int module_id);
+char *lp_hosts_allow(int module_id);
+char *lp_hosts_deny(int module_id);
+char *lp_include(int module_id);
+char *lp_include_from(int module_id);
+char *lp_incoming_chmod(int module_id);
+char *lp_lock_file(int module_id);
+char *lp_log_file(int module_id);
+char *lp_log_format(int module_id);
+char *lp_name(int module_id);
+char *lp_outgoing_chmod(int module_id);
+char *lp_path(int module_id);
+char *lp_postxfer_exec(int module_id);
+char *lp_prexfer_exec(int module_id);
+char *lp_refuse_options(int module_id);
+char *lp_secrets_file(int module_id);
+char *lp_temp_dir(int module_id);
+char *lp_uid(int module_id);
+int lp_max_connections(int module_id);
+int lp_max_verbosity(int module_id);
+int lp_syslog_facility(int module_id);
+int lp_timeout(int module_id);
+BOOL lp_fake_super(int module_id);
+BOOL lp_ignore_errors(int module_id);
+BOOL lp_ignore_nonreadable(int module_id);
+BOOL lp_list(int module_id);
+BOOL lp_munge_symlinks(int module_id);
+BOOL lp_numeric_ids(int module_id);
+BOOL lp_read_only(int module_id);
+BOOL lp_strict_modes(int module_id);
+BOOL lp_transfer_logging(int module_id);
+BOOL lp_use_chroot(int module_id);
+BOOL lp_write_only(int module_id);
+BOOL lp_load(char *pszFname, int globals_only);
+int lp_numservices(void);
+int lp_number(char *name);
+void log_init(int restart);
+void logfile_close(void);
+void logfile_reopen(void);
+void rwrite(enum logcode code, const char *buf, int len, int is_utf8);
+void rprintf(enum logcode code, const char *format, ...);
+void rsyserr(enum logcode code, int errcode, const char *format, ...);
+void rflush(enum logcode code);
+int log_format_has(const char *format, char esc);
+void log_item(enum logcode code, struct file_struct *file,
+ struct stats *initial_stats, int iflags, const char *hlink);
+void maybe_log_item(struct file_struct *file, int iflags, int itemizing,
+ const char *buf);
+void log_delete(const char *fname, int mode);
+void log_exit(int code, const char *file, int line);
+pid_t wait_process(pid_t pid, int *status_ptr, int flags);
+int child_main(int argc, char *argv[]);
+void start_server(int f_in, int f_out, int argc, char *argv[]);
+int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]);
+RETSIGTYPE remember_children(UNUSED(int val));
+const char *get_panic_action(void);
+int main(int argc,char *argv[]);
+void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len);
+void match_report(void);
+void usage(enum logcode F);
+void option_error(void);
+int parse_arguments(int *argc_p, const char ***argv_p);
+void server_options(char **args, int *argc_p);
+char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr);
+BOOL pm_process( char *FileName,
+ BOOL (*sfunc)(char *),
+ BOOL (*pfunc)(char *, char *) );
+pid_t piped_child(char **command, int *f_in, int *f_out);
+pid_t local_child(int argc, char **argv, int *f_in, int *f_out,
+ int (*child_main)(int, char*[]));
+void set_current_file_index(struct file_struct *file, int ndx);
+void end_progress(OFF_T size);
+void show_progress(OFF_T ofs, OFF_T size);
+int get_tmpname(char *fnametmp, const char *fname);
+int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file);
+int recv_files(int f_in, char *local_name);
+void setup_iconv(void);
+int iconvbufs(iconv_t ic, xbuf *in, xbuf *out, int flags);
+void send_protected_args(int fd, char *args[]);
+int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr,
+ char *buf, int *len_ptr);
+void free_sums(struct sum_struct *s);
+mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
+ int exists);
+int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+ const char *fnamecmp, int flags);
+RETSIGTYPE sig_int(UNUSED(int val));
+int finish_transfer(const char *fname, const char *fnametmp,
+ const char *fnamecmp, const char *partialptr,
+ struct file_struct *file, int ok_to_set_time,
+ int overwriting_basis);
+struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc);
+const char *who_am_i(void);
+void successful_send(int ndx);
+void send_files(int f_in, int f_out);
+int try_bind_local(int s, int ai_family, int ai_socktype,
+ const char *bind_addr);
+int open_socket_out(char *host, int port, const char *bind_addr,
+ int af_hint);
+int open_socket_out_wrapped(char *host, int port, const char *bind_addr,
+ int af_hint);
+int is_a_socket(int fd);
+void start_accept_loop(int port, int (*fn)(int, int));
+void set_socket_options(int fd, char *options);
+int sock_exec(const char *prog);
+int do_unlink(const char *fname);
+int do_symlink(const char *fname1, const char *fname2);
+int do_link(const char *fname1, const char *fname2);
+int do_lchown(const char *path, uid_t owner, gid_t group);
+int do_mknod(const char *pathname, mode_t mode, DEV_T dev);
+int do_rmdir(const char *pathname);
+int do_open(const char *pathname, int flags, mode_t mode);
+int do_chmod(const char *path, mode_t mode);
+int do_rename(const char *fname1, const char *fname2);
+void trim_trailing_slashes(char *name);
+int do_mkdir(char *fname, mode_t mode);
+int do_mkstemp(char *template, mode_t perms);
+int do_stat(const char *fname, STRUCT_STAT *st);
+int do_lstat(const char *fname, STRUCT_STAT *st);
+int do_fstat(int fd, STRUCT_STAT *st);
+OFF_T do_lseek(int fd, OFF_T offset, int whence);
+void set_compression(const char *fname);
+void send_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
+ int32 n, int32 toklen);
+int32 recv_token(int f, char **data);
+void see_token(char *data, int32 toklen);
+uid_t match_uid(uid_t uid);
+gid_t match_gid(gid_t gid, uint16 *flags_ptr);
+const char *add_uid(uid_t uid);
+const char *add_gid(gid_t gid);
+void send_id_list(int f);
+uid_t recv_user_name(int f, uid_t uid);
+gid_t recv_group_name(int f, gid_t gid, uint16 *flags_ptr);
+void recv_id_list(int f, struct file_list *flist);
+void set_nonblocking(int fd);
+void set_blocking(int fd);
+int fd_pair(int fd[2]);
+void print_child_argv(const char *prefix, char **cmd);
+NORETURN void out_of_memory(const char *str);
+NORETURN void overflow_exit(const char *str);
+int set_modtime(const char *fname, time_t modtime, mode_t mode);
+int mkdir_defmode(char *fname);
+int create_directory_path(char *fname);
+int full_write(int desc, const char *ptr, size_t len);
+int copy_file(const char *source, const char *dest, int ofd,
+ mode_t mode, int create_bak_dir);
+int robust_unlink(const char *fname);
+int robust_rename(const char *from, const char *to, const char *partialptr,
+ int mode);
+pid_t do_fork(void);
+void kill_all(int sig);
+int name_to_uid(const char *name, uid_t *uid_p);
+int name_to_gid(const char *name, gid_t *gid_p);
+int lock_range(int fd, int offset, int len);
+int glob_expand(const char *arg, char ***argv_p, int *argc_p, int *maxargs_p);
+void glob_expand_module(char *base1, char *arg, char ***argv_p, int *argc_p, int *maxargs_p);
+void strlower(char *s);
+size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2);
+size_t stringjoin(char *dest, size_t destsize, ...);
+int count_dir_elements(const char *p);
+unsigned int clean_fname(char *name, int flags);
+char *sanitize_path(char *dest, const char *p, const char *rootdir, int depth,
+ int flags);
+int change_dir(const char *dir, int set_path_only);
+char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr);
+char *full_fname(const char *fn);
+char *partial_dir_fname(const char *fname);
+int handle_partial_dir(const char *fname, int create);
+int unsafe_symlink(const char *dest, const char *src);
+char *human_num(int64 num);
+char *human_dnum(double dnum, int decimal_digits);
+char *timestring(time_t t);
+int msleep(int t);
+int cmp_time(time_t file1, time_t file2);
+int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6);
+void *_new_array(unsigned long num, unsigned int size, int use_calloc);
+void *_realloc_array(void *ptr, unsigned int size, size_t num);
+const char *find_filename_suffix(const char *fn, int fn_len, int *len_ptr);
+uint32 fuzzy_distance(const char *s1, int len1, const char *s2, int len2);
+struct bitbag *bitbag_create(int max_ndx);
+void bitbag_set_bit(struct bitbag *bb, int ndx);
+void bitbag_clear_bit(struct bitbag *bb, int ndx);
+int bitbag_check_bit(struct bitbag *bb, int ndx);
+int bitbag_next_bit(struct bitbag *bb, int after);
+void flist_ndx_push(flist_ndx_list *lp, int ndx);
+int flist_ndx_pop(flist_ndx_list *lp);
+void *expand_item_list(item_list *lp, size_t item_size,
+ const char *desc, int incr);
+void free_xattr(stat_x *sxp);
+int get_xattr(const char *fname, stat_x *sxp);
+int copy_xattrs(const char *source, const char *dest);
+int send_xattr(stat_x *sxp, int f);
+int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all);
+void send_xattr_request(const char *fname, struct file_struct *file, int f_out);
+int recv_xattr_request(struct file_struct *file, int f_in);
+void receive_xattr(struct file_struct *file, int f);
+void cache_tmp_xattr(struct file_struct *file, stat_x *sxp);
+void uncache_tmp_xattrs(void);
+int set_xattr(const char *fname, const struct file_struct *file,
+ const char *fnamecmp, stat_x *sxp);
+char *get_xattr_acl(const char *fname, int is_access_acl, size_t *len_p);
+int set_xattr_acl(const char *fname, int is_access_acl, const char *buf, size_t buf_len);
+int del_def_xattr_acl(const char *fname);
+int get_stat_xattr(const char *fname, int fd, STRUCT_STAT *fst, STRUCT_STAT *xst);
+int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode);
+int x_stat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst);
+int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst);
+int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst);
+int sys_gettimeofday(struct timeval *tv);
diff --git a/rounding.h b/rounding.h
new file mode 100644
index 00000000..eb2937ac
--- /dev/null
+++ b/rounding.h
@@ -0,0 +1 @@
+#define EXTRA_ROUNDING 0
diff --git a/rsync.h b/rsync.h
index 4fef8827..79e3f9fe 100644
--- a/rsync.h
+++ b/rsync.h
@@ -559,11 +559,18 @@ typedef unsigned int size_t;
#endif
#endif
-#if SIZEOF_OFF_T == 8 || !SIZEOF_OFF64_T || !defined HAVE_STRUCT_STAT64
+#ifdef __BIONIC__
+#define DEV_T unsigned long long
+#define OFF_T off_t
+#define STRUCT_STAT struct stat
+#define SIZEOF_CAPITAL_OFF_T SIZEOF_OFF_T
+#elif SIZEOF_OFF_T == 8 || !SIZEOF_OFF64_T || !defined HAVE_STRUCT_STAT64
+#define DEV_T dev_t
#define OFF_T off_t
#define STRUCT_STAT struct stat
#define SIZEOF_CAPITAL_OFF_T SIZEOF_OFF_T
#else
+#define DEV_T dev_t
#define OFF_T off64_t
#define STRUCT_STAT struct stat64
#define USE_STAT64_FUNCS 1
diff --git a/syscall.c b/syscall.c
index 8f1d2fed..3cac5b6b 100644
--- a/syscall.c
+++ b/syscall.c
@@ -126,7 +126,7 @@ int do_lchown(const char *path, uid_t owner, gid_t group)
return lchown(path, owner, group);
}
-int do_mknod(const char *pathname, mode_t mode, dev_t dev)
+int do_mknod(const char *pathname, mode_t mode, DEV_T dev)
{
if (dry_run) return 0;
RETURN_ERROR_IF_RO_OR_LO;
diff --git a/xattrs.c b/xattrs.c
index 57d40e17..5c1c3c64 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -1014,7 +1014,7 @@ int get_stat_xattr(const char *fname, int fd, STRUCT_STAT *fst, STRUCT_STAT *xst
int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
{
STRUCT_STAT fst, xst;
- dev_t rdev;
+ DEV_T rdev;
mode_t mode, fmode;
if (dry_run)