MCPcopy Create free account
hub / github.com/Tencent/MMKV / ASharedMemory_getName

Function ASharedMemory_getName

Core/MemoryFile_Android.cpp:208–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208string ASharedMemory_getName(int fd) {
209 // Android Q doesn't have ASharedMemory_getName()
210 // I've make a request to Google, https://issuetracker.google.com/issues/130741665
211 // There's nothing we can do before it's supported officially by Google
212#ifndef MMKV_OHOS
213 if (g_android_api >= __ANDROID_API_O__) {
214 return "";
215 }
216#endif
217
218 char name[ASHMEM_NAME_LEN] = {0};
219 if (ioctl(fd, ASHMEM_GET_NAME, name) != 0) {
220 MMKVError("fail to get ashmem name:%d, %s", fd, strerror(errno));
221 return "";
222 }
223 return {name};
224}
225
226} // namespace mmkv
227

Callers 1

FileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected