If an error condition occurs, this routine returns an integer
indicating the type of error. Possible return values are as
follows:
Return Description
0 Successful completion.
[EINVAL] The specified key is invalid.
[ENOMEM] Insufficient memory to associate the value with the
key.