/* * Older versions of libc use the Intel-specific access rights. * Hence, override the definitions as they might be incorrect.
*/ #undef PKEY_DISABLE_ACCESS #define PKEY_DISABLE_ACCESS 0x3
int sys_pkey_free(int pkey)
{ return syscall(__NR_pkey_free, pkey);
}
int pkeys_unsupported(void)
{ bool hash_mmu = false; int pkey;
/* Protection keys are currently supported on Hash MMU only */
FAIL_IF(using_hash_mmu(&hash_mmu));
SKIP_IF(!hash_mmu);
/* Check if the system call is supported */
pkey = sys_pkey_alloc(0, PKEY_UNRESTRICTED);
SKIP_IF(pkey < 0);
sys_pkey_free(pkey);
return 0;
}
int siginfo_pkey(siginfo_t *si)
{ /* * In older versions of libc, siginfo_t does not have si_pkey as * a member.
*/ #ifdef si_pkey return si->si_pkey; #else return *((int *)(((char *) si) + SI_PKEY_OFFSET)); #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.