| 94 | } |
| 95 | |
| 96 | int st_key_create(int *keyp, void (*destructor)(void *)) { |
| 97 | photon::thread_key_t key; |
| 98 | auto ret = photon::thread_key_create(&key, destructor); |
| 99 | if (ret < 0) |
| 100 | LOG_ERRNO_RETURN(0, -1, "failed to thread_key_create()"); |
| 101 | if (key > INT_MAX) { |
| 102 | photon::thread_key_delete(key); |
| 103 | LOG_ERROR_RETURN(EOVERFLOW, -1, "thread key space overflow"); |
| 104 | } |
| 105 | *keyp = key; |
| 106 | return 0; |
| 107 | } |
| 108 | |
| 109 | int st_key_getlimit(void) { |
| 110 | return photon::THREAD_KEYS_MAX; |
nothing calls this directly
no test coverage detected