mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
sysvipc: Fix tst-sysvshm-linux on x32
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.
This commit is contained in:
@ -54,9 +54,9 @@ do_prepare (int argc, char *argv[])
|
|||||||
|
|
||||||
struct test_shminfo
|
struct test_shminfo
|
||||||
{
|
{
|
||||||
unsigned long int shmall;
|
__syscall_ulong_t shmall;
|
||||||
unsigned long int shmmax;
|
__syscall_ulong_t shmmax;
|
||||||
unsigned long int shmmni;
|
__syscall_ulong_t shmmni;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* It tries to obtain some system-wide SysV shared memory information from
|
/* It tries to obtain some system-wide SysV shared memory information from
|
||||||
@ -128,7 +128,8 @@ do_test (void)
|
|||||||
#if LONG_MAX == INT_MAX
|
#if LONG_MAX == INT_MAX
|
||||||
/* Kernel explicit clamp the value for shmmax on compat symbol (32-bit
|
/* Kernel explicit clamp the value for shmmax on compat symbol (32-bit
|
||||||
binaries running on 64-bit kernels). */
|
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;
|
v = INT_MAX;
|
||||||
#endif
|
#endif
|
||||||
tipcinfo.shmmax = v;
|
tipcinfo.shmmax = v;
|
||||||
|
Reference in New Issue
Block a user