Fix oldselect decoding on 64-bit architectures
As struct sel_arg_struct is an array of 32-bit values, fetch it using an intermediate array on 64-bit architectures. * desc.c (sys_oldselect): Rename args to long_args. [SIZEOF_LONG == 4] Alias oldselect_args to long_args. [SIZEOF_LONG != 4] Introduce oldselect_args to fetch oldselect args. * linux/sh64/syscallent.h (oldselect): Remove.
This commit is contained in:
parent
52dc1506ab
commit
c44df3e3ca
19
desc.c
19
desc.c
@ -410,13 +410,26 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
||||
|
||||
SYS_FUNC(oldselect)
|
||||
{
|
||||
long args[5];
|
||||
long long_args[5];
|
||||
#undef oldselect_args
|
||||
#if SIZEOF_LONG == 4
|
||||
# define oldselect_args long_args
|
||||
#else
|
||||
unsigned int oldselect_args[5];
|
||||
unsigned int i;
|
||||
#endif
|
||||
|
||||
if (umove(tcp, tcp->u_arg[0], &args) < 0) {
|
||||
if (umove(tcp, tcp->u_arg[0], &oldselect_args) < 0) {
|
||||
printaddr(tcp->u_arg[0]);
|
||||
return 0;
|
||||
}
|
||||
return decode_select(tcp, args, BITNESS_CURRENT);
|
||||
#ifndef oldselect_args
|
||||
for (i = 0; i < 5; i++) {
|
||||
long_args[i] = oldselect_args[i];
|
||||
}
|
||||
#endif
|
||||
return decode_select(tcp, long_args, BITNESS_CURRENT);
|
||||
#undef oldselect_args
|
||||
}
|
||||
|
||||
#ifdef ALPHA
|
||||
|
@ -108,7 +108,7 @@
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
[ 80] = { 2, 0, SEN(getgroups16), "getgroups" },
|
||||
[ 81] = { 2, 0, SEN(setgroups16), "setgroups" },
|
||||
[ 82] = { 1, TD, SEN(oldselect), "oldselect" },
|
||||
[ 82] = { },
|
||||
[ 83] = { 2, TF, SEN(symlink), "symlink" },
|
||||
[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" },
|
||||
[ 85] = { 3, TF, SEN(readlink), "readlink" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user