Enables user-keys in a process.
Standard C library (libc.a)
#include <sys/ukeys.h>
int ukey_enable (void)
All threads of a user-key enabled process are initially set-up with an active user-key-set that only allows both read and write access to memory pages that have been assigned to the UKEY_PUBLIC, the default user-key. Individual threads can modify their active user-key-set by calling user-key APIs to construct and activate user-key-sets.
Signal Context for User-Key-Enabled processes:
The default signal context for a user-key-enabled process is modified for any future signals that are received. The ucontext_t structure is extended to include the active user-key-set of the interrupted thread. This is provided to signal handlers.
The following fields are set:
ucontext_t.__extctx.__flags |= __EXTCTX_UKEYS
ucontext_t.__extctx.__ukeys[2] = active user-key-set
The user-key extended context is independent of VMX context and is built for all processes that are user-key-enabled.
Additionally, if a storage key exception is taken, the exception type field is set to indicate this in the extended context:
ucontext_t.uc_mcontext.jmp_context.excp_type = EXCEPT_SKEY.
See the sys/context.h header file for a more detailed layout of the extended context information.
When successful, the ukey_enable subroutine returns the number of available user-keys. Otherwise, it returns a value of -1 and sets the errno global variable to indicate the error.
Item | Description |
---|---|
ENOSYS | User-keys are not supported. |
The ukey_setjmp subroutine.
The ukeyset_init subroutine.
The ukeyset_add_key, ukeyset_remove_key, ukeyset_add_set, ukeyset_remove_set subroutine.
The ukeyset_activate subroutine.
The ukeyset_ismember subroutine.
The pthread_attr_getukeyset_np or pthread_attr_setukeyset_np subroutine.
AIX® Vector Programming inAIX Version 7.1 General Programming Concepts: Writing and Debugging Programs .