CEEOPKC

C library interface: pthread_key_create()

CEEOPKC creates a new unique key in the enclave of the caller and in the context of the current enclave. The destructor is a pointer to a function to be executed upon thread termination. The CEEOPKC service assigns a key identifier and returns it in the location referred to by key. Key identifiers and their associated destructor functions are common to all threads in the enclave.

Syntax

void CEEOPKC (key, [destructor], [fc])
CEE_THDKEY  *key;
CEE_ENTRY   *destructor;
FEED_BACK   *fc;
CEEOPKC
Call this CWI interface as follows:
L     R15,CEECAALEOV-CEECAA(,R12)     CAA address is in R12
L     R15,0092(,R15)
BALR  R14,R15
key (output)
The unique key identifier generated by Language Environment®. Any thread within the enclave can refer to this key.
destructor (input/optional)
The function pointer which is the user routine to gain control during thread termination. This routine must be an external routine (not a nested procedure). This parameter can be omitted.
fc (output/optional)
The feedback code returned by the service. It indicates the degree of success in creating the new key.

The following message identifiers and associated severities can be returned by the service in the feedback code fc.

Condition Description category Description value
CEE000 Severity 0
Msg_No 0000
Message The service completed successfully.
CEE4S9 Severity 3
Msg_No 5001
Message POSIX is not initialized.
CEE5CM Severity 3
Msg_No 5526
Message There was not enough storage available to create the new key.
CEE5CN Severity 3
Msg_No 5527
Message The key name space is exhausted. The key creation would have resulted in more than the system imposed limit for the maximum number of data keys which can be created per enclave.
CEE5CO Severity 3
Msg_No 5528
Message Thread termination is in progress. This operation is not allowed. Key creation is not permitted during thread termination.
CEE5CT Severity 3
Msg_No 5533
Message The key pointer passed is not valid.
Usage Notes:
  1. It is assumed that destructor is currently available and does not require an explicit LOAD performed.
  2. The key identifier returned can be used by all threads within the enclave that uses the CEEOPSS and CEEOPGS services.