AM_CONDITIONAL([EIO_HAVE_INOTIFY], [test "x$have_inotify" = "xyes"])
AM_CONDITIONAL([EIO_HAVE_WINCHANGE], [test "x$have_notify_win32" = "xyes"])
+### Check for extended attribute
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/xattr.h>
+ ]],
+ [[
+size_t tmp = listxattr("/", NULL, 0);
+tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
+setxattr("/", "user.ethumb.md5", NULL, 0, 0);
+ ]])],
+ [
+ AC_DEFINE(HAVE_XATTR, 1, [Define to 1 if you have 'listxattr', 'setxattr' and 'getxattr'])
+ have_xattr="yes"
+ ],
+ [have_xattr="no"])
+
+AC_MSG_CHECKING([for Xattr])
+AC_MSG_RESULT([${have_xattr}])
+
## Report
AC_OUTPUT([
echo
echo "Configuration Options Summary:"
echo
+echo " Xattr................: ${have_xattr}"
echo " Thread Support.......: ${have_threads}"
echo " Inotify..............: ${have_inotify}"
echo " Windows notification.: ${have_notify_win32}"
#include "eio_private.h"
#include "Eio.h"
+#ifdef HAVE_XATTR
+# include <sys/xattr.h>
+#endif
+
/*============================================================================*
* Local *
*============================================================================*/
free(async);
}
+#ifdef HAVE_XATTR
+static void
+_eio_file_copy_xattr(Ecore_Thread *thread, Eio_File_Progress *op, int in, int out)
+{
+ char *tmp;
+ ssize_t length;
+ ssize_t i;
+
+ length = flistxattr(in, NULL, 0);
+
+ if (length > 0) return ;
+
+ tmp = alloca(length);
+ length = flistxattr(in, tmp, length);
+
+ for (i = 0; i < length; i += strlen(tmp) + 1)
+ {
+ ssize_t attr_length;
+ void *value;
+
+ attr_length = fgetxattr(in, tmp, NULL, 0);
+ if (!attr_length) continue ;
+
+ value = malloc(attr_length);
+ if (!value) continue ;
+ attr_length = fgetxattr(in, tmp, value, attr_length);
+
+ if (attr_length > 0)
+ fsetxattr(out, tmp, value, attr_length, 0);
+
+ free(value);
+ }
+}
+#endif
+
static Eina_Bool
_eio_file_write(int fd, void *mem, ssize_t length)
{
goto on_error;
#endif
+#ifdef HAVE_XATTR
+ _eio_file_copy_xattr(thread, copy, in, out);
+#endif
+
close(out);
close(in);