summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glnx-fdio.c4
-rw-r--r--libglnx.m49
2 files changed, 11 insertions, 2 deletions
diff --git a/glnx-fdio.c b/glnx-fdio.c
index 19144da..7ee57cd 100644
--- a/glnx-fdio.c
+++ b/glnx-fdio.c
@@ -60,6 +60,7 @@ rename_file_noreplace_at (int olddirfd, const char *oldpath,
gboolean ignore_eexist,
GError **error)
{
+#ifndef ENABLE_WRPSEUDO_COMPAT
if (renameat2 (olddirfd, oldpath, newdirfd, newpath, RENAME_NOREPLACE) < 0)
{
if (errno == EINVAL || errno == ENOSYS)
@@ -80,6 +81,7 @@ rename_file_noreplace_at (int olddirfd, const char *oldpath,
}
else
return TRUE;
+#endif
if (linkat (olddirfd, oldpath, newdirfd, newpath, 0) < 0)
{
@@ -122,7 +124,7 @@ glnx_open_tmpfile_linkable_at (int dfd,
* tempoary path name used is returned in "ret_path". Use
* link_tmpfile() below to rename the result after writing the file
* in full. */
-#if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE)
+#if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE) && !defined(ENABLE_WRPSEUDO_COMPAT)
fd = openat (dfd, subpath, O_TMPFILE|flags, 0600);
if (fd == -1 && !(errno == ENOSYS || errno == EISDIR || errno == EOPNOTSUPP))
{
diff --git a/libglnx.m4 b/libglnx.m4
index 43dff97..9b2e30c 100644
--- a/libglnx.m4
+++ b/libglnx.m4
@@ -20,5 +20,12 @@ AC_ARG_ENABLE(otmpfile,
AS_IF([test $enable_otmpfile = yes], [], [
AC_DEFINE([DISABLE_OTMPFILE], 1, [Define if we should avoid using O_TMPFILE])])
-])
+AC_ARG_ENABLE(wrpseudo-compat,
+ [AS_HELP_STRING([--enable-wrpseudo-compat],
+ [Disable use syscall() and filesystem calls to for compatibility with wrpseudo [default=no]])],,
+ [enable_wrpseudo_compat=no])
+AS_IF([test $enable_wrpseudo_compat = no], [], [
+ AC_DEFINE([ENABLE_WRPSEUDO_COMPAT], 1, [Define if we should be compatible with wrpseudo])])
+dnl end LIBGLNX_CONFIGURE
+])