Patchwork [1/2] Remove __NR_openat

login
register
mail settings
Submitter Aurelien Jarno
Date March 22, 2016, 8:30 p.m.
Message ID <1458678640-29310-1-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/11475/
State New
Headers show

Comments

Aurelien Jarno - March 22, 2016, 8:30 p.m.
With the 2.6.32 minimum kernel on x86 and 3.2 on other architectures,
__NR_openat is always defined.

Changelog:
	* sysdeps/unix/sysv/linux/dl-openat64.c (openat64) [__NR_openat]:
	Make code unconditional.
---
 ChangeLog                             | 5 +++++
 sysdeps/unix/sysv/linux/dl-openat64.c | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)
Florian Weimer - March 22, 2016, 9:43 p.m.
* Aurelien Jarno:

> With the 2.6.32 minimum kernel on x86 and 3.2 on other architectures,
> __NR_openat is always defined.

Commit message should say “Assume __NR_openat is always defined” or
something like that.  The subject looks rather misleading.

Looks good otherwise.

Patch

diff --git a/ChangeLog b/ChangeLog
index 36360d9..c403722 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 
+2016-03-22  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/dl-openat64.c (openat64) [__NR_openat]:
+	Make code unconditional.
+
 2016-03-22  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* malloc/Makefile ($(objpfx)tst-malloc-backtrace,
diff --git a/sysdeps/unix/sysv/linux/dl-openat64.c b/sysdeps/unix/sysv/linux/dl-openat64.c
index 1138779..75c2439 100644
--- a/sysdeps/unix/sysv/linux/dl-openat64.c
+++ b/sysdeps/unix/sysv/linux/dl-openat64.c
@@ -27,9 +27,5 @@  openat64 (int dfd, const char *file, int oflag, ...)
 {
   assert (!__OPEN_NEEDS_MODE (oflag));
 
-#ifdef __NR_openat
   return INLINE_SYSCALL (openat, 3, dfd, file, oflag | O_LARGEFILE);
-#else
-  return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-#endif
 }