]> sourceware.org Git - glibc.git/commitdiff
sysvipc: Fix tst-sysvshm-linux on x32
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 15 Oct 2020 18:45:26 +0000 (15:45 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 15 Oct 2020 18:50:25 +0000 (15:50 -0300)
The Linux shminfo fields are '__syscall_ulong_t' (which is 64-bit
for x32).  This patch fixes the test to compare againt the correct
type and to only clamp the value if '__syscall_ulong_t' is the same
size of 'unsigned long int'.

Checked on x86_64-linux-gnu-x32.

sysdeps/unix/sysv/linux/tst-sysvshm-linux.c

index 7128ae2e14db5ad8111849ada5841a1e89f2ceb5..cb32bd522effbc7ae69589d633a4bd20928ef49d 100644 (file)
@@ -54,9 +54,9 @@ do_prepare (int argc, char *argv[])
 
 struct test_shminfo
 {
-  unsigned long int shmall;
-  unsigned long int shmmax;
-  unsigned long int shmmni;
+  __syscall_ulong_t shmall;
+  __syscall_ulong_t shmmax;
+  __syscall_ulong_t shmmni;
 };
 
 /* It tries to obtain some system-wide SysV shared memory information from
@@ -128,7 +128,8 @@ do_test (void)
 #if LONG_MAX == INT_MAX
     /* Kernel explicit clamp the value for shmmax on compat symbol (32-bit
        binaries running on 64-bit kernels).  */
-    if (v > INT_MAX)
+    if (sizeof (__syscall_ulong_t) == sizeof (unsigned long int)
+        && v > INT_MAX)
       v = INT_MAX;
 #endif
     tipcinfo.shmmax = v;
This page took 0.045345 seconds and 5 git commands to generate.