]> dgit.raspbian.org Git - libaio.git/commitdiff
[PATCH libaio] harness: Hardcode list of ports that cannot check PROT_WRITE is readable
authorGuillem Jover <guillem@hadrons.org>
Wed, 6 Mar 2024 02:08:15 +0000 (03:08 +0100)
committerGuillem Jover <guillem@debian.org>
Sat, 17 Oct 2026 15:57:49 +0000 (17:57 +0200)
On these ports, the write() check does not work, so we need to hardcode
the list.

Gbp-Pq: Name 0001-harness-Hardcode-list-of-ports-that-cannot-check-PRO.patch

harness/cases/5.t

index b0a7c56ff5cc42951c30bd2bf804878833bcadb9..ae8b57a048bd14e7b6c347fb1ab9e3a72c5d1ee3 100644 (file)
@@ -41,10 +41,17 @@ int test_main(void)
        assert(buf != (char *)-1);
 
        /* Whether PROT_WRITE is readable is arch-dependent.  So compare
-        * against write() result (to make the kernel read from buf). */
+        * against write() result (to make the kernel read from buf), and
+        * use a hard-coded list for the systems where this does not work. */
+#if defined(__hppa__) || \
+    defined(__loongarch__) || \
+    defined(__sparc__)
+       res = SIZE;
+#else
        res = write(rwfd, buf, SIZE);
        if (res < 0)
                res = -errno;
+#endif
        status |= attempt_rw(rwfd, buf, SIZE,  0,  READ, SIZE);
        status |= attempt_rw(rwfd, buf, SIZE,  0, WRITE, res);