mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
sysdeps: tst-bz21269: handle ENOSYS & skip appropriately
SYS_modify_ldt requires CONFIG_MODIFY_LDT_SYSCALL to be set in the kernel, which some distributions may disable for hardening. Check if that's the case (unset) and mark the test as UNSUPPORTED if so. Reviewed-by: DJ Delorie <dj@redhat.com> Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
e0b712dd91
commit
652b9fdb77
1 changed files with 10 additions and 1 deletions
|
@ -52,7 +52,16 @@ xset_thread_area (struct user_desc *u_info)
|
|||
static void
|
||||
xmodify_ldt (int func, const void *ptr, unsigned long bytecount)
|
||||
{
|
||||
TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, func, ptr, bytecount) == 0);
|
||||
long ret = syscall (SYS_modify_ldt, func, ptr, bytecount);
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
if (errno == ENOSYS)
|
||||
FAIL_UNSUPPORTED ("modify_ldt not supported");
|
||||
FAIL_EXIT1 ("modify_ldt failed (errno=%d)", errno);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Add table
Reference in a new issue