Queries the user-key for application memory.
The ukey_getkey subroutine can be used to determine the user-key associated with a memory address. The user-key returned by this service normally corresponds to the values set by the ukey_protect subroutine.
When an application memory can not have its user-key altered or is not part of the application address space. A user-key value of the UKEY_SYSTEM is returned for this memory.
Item | Description |
---|---|
addr | Specifies the address of the region to be queried. |
ukey | Value for the user-mode storage-key is returned here. |
When successful, the ukey_getkey subroutine returns a value of 0. Otherwise, it returns a value of -1 and sets the errno global variable to indicate the error.
If the ukey_getkey subroutine is unsuccessful, the errno global variable might be set to one of the following values:
Item | Description |
---|---|
EFAULT | A part of the buffer pointed to by the ukey parameter is out of range or otherwise inaccessible. |
ENOMEM | Address is not valid for the address space of the process. |
ENOSYS | User-keys are not supported. |