如何在Android本机代码中使用共享内存? [英] How to use shared memory in android native code?
本文介绍了如何在Android本机代码中使用共享内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将现有的Linux应用程序移植到android.该应用程序正在使用诸如shm_open()
等的共享内存API.
I am porting an existing linux application to android. The application is using shared memory API's like shm_open()
etc.
Checking bionic in android source, I see that these API's are not supported. Hence I get a linking error during build.
external/l2/avbtp.c:138: error: undefined reference to 'shm_open'
external/l2/avbtp.c:151: error: undefined reference to 'shm_unlink'
external/l2/avbtp.c:186: error: undefined reference to 'shm_unlink'
如何正确解决此问题?
推荐答案
Android intentionally doesn't provide SysV IPC. Try to avoid using of shared memory or, if you really want, look for examples of using ashmem
.
这篇关于如何在Android本机代码中使用共享内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文