0b26f7
commit 31902ae639d6a50e768a85f1cd2a17e56b8463c2
0b26f7
Author: Florian Weimer <fweimer@redhat.com>
0b26f7
Date:   Fri Aug 6 09:51:38 2021 +0200
0b26f7
0b26f7
    Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
0b26f7
    
0b26f7
    __REDIRECT and __THROW are not compatible with C++ due to the ordering of the
0b26f7
    __asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
0b26f7
    instead.
0b26f7
    
0b26f7
    Fixes commit 8a40aff86ba5f64a3a84883e539cb67b ("io: Add time64 alias
0b26f7
    for fcntl"), commit 82c395d91ea4f69120d453aeec398e30 ("misc: Add
0b26f7
    time64 alias for ioctl"), commit b39ffab860cd743a82c91946619f1b8158
0b26f7
    ("Linux: Add time64 alias for prctl").
0b26f7
    
0b26f7
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
0b26f7
    (cherry picked from commit c87fcacc50505d550f1bb038382bcc7ea73a5926)
0b26f7
0b26f7
diff --git a/io/fcntl.h b/io/fcntl.h
0b26f7
index 8917a73b420b503d..1c96f98f4d75ce65 100644
0b26f7
--- a/io/fcntl.h
0b26f7
+++ b/io/fcntl.h
0b26f7
@@ -187,10 +187,10 @@ extern int fcntl64 (int __fd, int __cmd, ...);
0b26f7
 # endif
0b26f7
 #else /* __USE_TIME_BITS64 */
0b26f7
 # ifdef __REDIRECT
0b26f7
-extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
0b26f7
-		       __fcntl_time64)  __THROW;
0b26f7
-extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
0b26f7
-		       __fcntl_time64)  __THROW;
0b26f7
+extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
0b26f7
+			   __fcntl_time64);
0b26f7
+extern int __REDIRECT_NTH (fcntl64, (int __fd, int __request, ...),
0b26f7
+			   __fcntl_time64);
0b26f7
 # else
0b26f7
 extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
0b26f7
 #  define fcntl64 __fcntl_time64
0b26f7
diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h
0b26f7
index 6884d9925f06125f..9945c1e9181eb313 100644
0b26f7
--- a/misc/sys/ioctl.h
0b26f7
+++ b/misc/sys/ioctl.h
0b26f7
@@ -42,8 +42,8 @@ __BEGIN_DECLS
0b26f7
 extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
0b26f7
 #else
0b26f7
 # ifdef __REDIRECT
0b26f7
-extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...),
0b26f7
-		       __ioctl_time64) __THROW;
0b26f7
+extern int __REDIRECT_NTH (ioctl, (int __fd, unsigned long int __request, ...),
0b26f7
+			   __ioctl_time64);
0b26f7
 # else
0b26f7
 extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
0b26f7
 #  define ioctl __ioctl_time64
0b26f7
diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
0b26f7
index db88938b3a542b0b..f0e0d2f27f9b9ee9 100644
0b26f7
--- a/sysdeps/unix/sysv/linux/sys/prctl.h
0b26f7
+++ b/sysdeps/unix/sysv/linux/sys/prctl.h
0b26f7
@@ -42,7 +42,7 @@ __BEGIN_DECLS
0b26f7
 extern int prctl (int __option, ...) __THROW;
0b26f7
 #else
0b26f7
 # ifdef __REDIRECT
0b26f7
-extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW;
0b26f7
+extern int __REDIRECT_NTH (prctl, (int __option, ...), __prctl_time64);
0b26f7
 # else
0b26f7
 extern int __prctl_time64 (int __option,d ...) __THROW;
0b26f7
 #  define ioctl __prctl_time64