shm_open shm_unlink not found

I am new to CMake and trying to build a project for aarch64 armv8 from Termux on my android phone. I am running into this error:
gcc -o ex main.c -lc
main.c:19:10: warning: call to undeclared function ‘shm_open’; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
fd = shm_open(“/my_shm”, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
1 warning generated.
ld.lld: error: undefined symbol: shm_open

referenced by main.c
did you mean: sem_open
defined in: /system/lib64/
clang-15: error: linker command failed with exit code 1 (use -v to see invocation

I found from googling that libc includes these functions and according to the fact that the error messaage suggests me to use >>> did you mean: sem_open I assume that the libc was found in my termux environment, or not? Any help or hints are very appreciated as I wasted a couple of hours already to try to fix that.

I uploaded a small project that reproduces my problem on termux from an android phone: GitHub - alexg93333/cmaketest

shm_open comes from librt and must be linked separately with -lrt.

I get the exact same error with -lrt. I checked my /system/lib64/ path and is there. is missing. What does that mean?

This sounds like a different kind of system/platform. But I’d expect an error about to be missing, not a missing symbol in this case anyways.

In my CMakeLists.txt I executed:

it returns this path:

the content of this file is just:

No idea. Might be a question for Termux folks. Maybe shm_open isn’t implemented in Bionic?

I found a in my linux VM on my PC. Can I just copy it to my phone and use it?

No. I suspect that the Android way is something like Binder or the like, but it’s really a question more for an Android development forum than CMake (as CMake cannot make function appear from nowhere if they’re not implemented on the target).