summaryrefslogtreecommitdiff
path: root/lib/renameatu.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-07-05 09:22:09 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-07-05 09:25:34 -0700
commit2522322e5304e7d86c63e607e2bc83c8d8b0a889 (patch)
tree7a22f5c2a21d116f7ae52b43e1a76685944592b6 /lib/renameatu.h
parent60e8b9303d8ce312bb2322d4801ed08678f93d1e (diff)
downloadgnulib-2522322e5304e7d86c63e607e2bc83c8d8b0a889.tar.gz
renameatu: rename from renameat2
It's looking like Glibc will add a renameat2 function that is incompatible with Gnulib renameat2; see: https://sourceware.org/ml/libc-alpha/2018-07/msg00064.html To help avoid future confusion, rename renameat2 to something else. Use the name 'renameatu', as the Gnulib function is close to the Glibc function. Perhaps someday there will also be a renameat2 Gnulib module, which mimicks the future glibc renameat2, but that can wait as nobody seems to need such a module now. * NEWS: Mention this. * lib/renameatu.c: Rename from lib/renameat2.c. * lib/renameatu.h: Rename from lib/renameat2.h. * modules/renameat2: Rename from modules/renameatu. * modules/renameat2-tests: Rename from modules/renameat2-tests. All uses of "renameat2" in identifiers or file name changed to "renameatu", except for two instances in lib/renameatu.c that deal with the Linux kernel's renameat2 syscall.
Diffstat (limited to 'lib/renameatu.h')
-rw-r--r--lib/renameatu.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/renameatu.h b/lib/renameatu.h
new file mode 100644
index 0000000000..7d797757b6
--- /dev/null
+++ b/lib/renameatu.h
@@ -0,0 +1,28 @@
+/* Rename a file relative to open directories.
+ Copyright 2017-2018 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+/* Get RENAME_* macros from <stdio.h> if present, otherwise supply
+ the traditional Linux values. */
+#include <stdio.h>
+#ifndef RENAME_NOREPLACE
+# define RENAME_NOREPLACE (1 << 0)
+# define RENAME_EXCHANGE (1 << 1)
+# define RENAME_WHITEOUT (1 << 2)
+#endif
+
+extern int renameatu (int, char const *, int, char const *, unsigned int);