Fix compat personality support for sgetmask syscall

* signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val
with sprint_old_sigmask_val.
* tests/sxetmask.c (main): Check decoding of signal mask containing
RT signals.
This commit is contained in:
Дмитрий Левин 2017-05-23 23:20:18 +00:00
parent ba0bd3f1ec
commit 3b97ee486b
2 changed files with 13 additions and 1 deletions

View File

@ -397,7 +397,7 @@ SYS_FUNC(signal)
SYS_FUNC(sgetmask)
{
if (exiting(tcp) && !syserror(tcp)) {
tcp->auxstr = sprintsigmask_val("mask ", tcp->u_rval);
tcp->auxstr = sprint_old_sigmask_val("mask ", tcp->u_rval);
return RVAL_HEX | RVAL_STR;
}
return 0;

View File

@ -99,6 +99,18 @@ main(void)
if (uget.old_mask != (unsigned long) rc)
error_msg_and_fail("sigprocmask returned %#lx",
uget.old_mask);
if (sizeof(long) > 4) {
sigaddset(&uset.libc_mask, 32 + 27);
if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL))
perror_msg_and_fail("sigprocmask");
rc = k_sgetmask();
printf("sgetmask() = %#lx"
" (mask [USR1 USR2 RT_27])\n", rc);
if (uset.old_mask != (unsigned long) rc)
error_msg_and_fail("sigprocmask set %#lx",
uset.old_mask);
}
}
puts("+++ exited with 0 +++");