This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.24-473-g8b9283d
- From: azanella at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 14 Dec 2016 17:31:44 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.24-473-g8b9283d
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 8b9283dabd5ab3524c9a76fabbb379f950a86e6d (commit)
via 7fe1e1d60a0f7b5eaf9f423c1fea7d0660690088 (commit)
from 2bf6e649d6db0c678b49b5d634022f60e6335b42 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8b9283dabd5ab3524c9a76fabbb379f950a86e6d
commit 8b9283dabd5ab3524c9a76fabbb379f950a86e6d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue Dec 13 16:50:06 2016 -0200
Consolidate renameat Linux implementation
This patch consolidates the Linux renameat implementation on
sysdeps/unix/sysv/linux/renameat.c. The renameat syscall was
deprecated at b0da6d44 for newer architectures, so using the
auto-generation list may generate wrappers that returns ENOSYS.
Current code try to use __NR_renameat and if it is not define
it uses __NR_renameat2.
Checked on x86_64 and aarch64.
* sysdeps/unix/sysv/linux/renameat.c: New file.
* sysdeps/unix/sysv/linux/syscalls.list: Remove renameat.
diff --git a/ChangeLog b/ChangeLog
index a9e69a3..f40e09f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2016-12-14 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * sysdeps/unix/sysv/linux/renameat.c: New file.
+ * sysdeps/unix/sysv/linux/syscalls.list: Remove renameat.
+
* sysdeps/unix/sysv/linux/rename.c: New file.
* sysdeps/unix/sysv/linux/generic/rename.c: Remove file.
diff --git a/sysdeps/unix/sysv/linux/renameat.c b/sysdeps/unix/sysv/linux/renameat.c
new file mode 100644
index 0000000..ac52947
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/renameat.c
@@ -0,0 +1,32 @@
+/* Linux implementation for renameat function.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <sysdep.h>
+#include <errno.h>
+
+int
+renameat (int oldfd, const char *old, int newfd, const char *new)
+{
+#ifdef __NR_renameat
+ return INLINE_SYSCALL_CALL (renameat, oldfd, old, newfd, new);
+#else
+ return INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, 0);
+#endif
+}
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 98b3bb9..5d3c417 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -89,7 +89,6 @@ fchownat - fchownat i:isiii fchownat
linkat - linkat i:isisi linkat
mkdirat - mkdirat i:isi mkdirat
readlinkat - readlinkat i:issi readlinkat
-renameat - renameat i:isis renameat
symlinkat - symlinkat i:sis symlinkat
unlinkat - unlinkat i:isi unlinkat
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7fe1e1d60a0f7b5eaf9f423c1fea7d0660690088
commit 7fe1e1d60a0f7b5eaf9f423c1fea7d0660690088
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Nov 11 09:02:46 2016 -0200
Consolidate rename Linux implementation
This patch consolidates the Linux rename implementation on
sysdeps/unix/sysv/linux/rename.c. Current code try to use
__NR_rename if is defined and apply the same strategy for
__NR_renameat and __NR_renameat2.
Check on x86_64 and aarch64.
* sysdeps/unix/sysv/linux/rename.c: New file.
* sysdeps/unix/sysv/linux/generic/rename.c: Remove file.
diff --git a/ChangeLog b/ChangeLog
index 90dad72..a9e69a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-14 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/rename.c: New file.
+ * sysdeps/unix/sysv/linux/generic/rename.c: Remove file.
+
2015-12-14 Wilco Dijkstra <wdijkstr@arm.com>
* benchtests/bench-strtok.c (oldstrtok): Add old implementation.
diff --git a/sysdeps/unix/sysv/linux/generic/rename.c b/sysdeps/unix/sysv/linux/rename.c
similarity index 69%
rename from sysdeps/unix/sysv/linux/generic/rename.c
rename to sysdeps/unix/sysv/linux/rename.c
index 174c147..73f0ae4 100644
--- a/sysdeps/unix/sysv/linux/generic/rename.c
+++ b/sysdeps/unix/sysv/linux/rename.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Linux implementation for rename function.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,13 +17,19 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sysdep.h>
+#include <errno.h>
/* Rename the file OLD to NEW. */
int
rename (const char *old, const char *new)
{
- return INLINE_SYSCALL (renameat, 4, AT_FDCWD, old, AT_FDCWD, new);
+#if defined (__NR_rename)
+ return INLINE_SYSCALL_CALL (rename, old, new);
+#elif defined (__NR_renameat)
+ return INLINE_SYSCALL_CALL (renameat, AT_FDCWD, old, AT_FDCWD, new);
+#else
+ return INLINE_SYSCALL_CALL (renameat2, AT_FDCWD, old, AT_FDCWD, new, 0);
+#endif
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
sysdeps/unix/sysv/linux/{generic => }/rename.c | 14 ++++++++++----
.../sysv/linux/{generic/rename.c => renameat.c} | 15 +++++++++------
sysdeps/unix/sysv/linux/syscalls.list | 1 -
4 files changed, 27 insertions(+), 11 deletions(-)
copy sysdeps/unix/sysv/linux/{generic => }/rename.c (69%)
rename sysdeps/unix/sysv/linux/{generic/rename.c => renameat.c} (69%)
hooks/post-receive
--
GNU C Library master sources