pelya / android-shmem

System V shared memory emulation on Android, using ashmem. That includes shmget, shmat, shmdt and shmctl functions.
BSD 3-Clause "New" or "Revised" License
200 stars 43 forks source link

Usability without XServer in Android #6

Open relipo opened 7 years ago

relipo commented 7 years ago

I understand this was done with applications connected to an XServer in mind, but I actually need this functionality to handle some C code I have (using SYSV shared memory API), which I'm porting right now for the first time to Android, so I wanted to check:

Is the XServer here is a must (to make this all work), or is this something that can be used regardless?

I'm asking because NOT using the XServer, ancil_recv_fd() hangs on the call to recvmsg(), and I'm just wondering if this is a bug in my outdated kernel (3.18), or if I'm missing something here?

Thanks a lot

pelya commented 7 years ago

You should be able to use this library without Xserver. Emulation however is incomplete, you should first use shmget() to allocate it from one process, then shmat() to attach to it from another process, there are also restrictions on flags you can use.

On Wed, Jun 28, 2017 at 5:50 PM, relipo notifications@github.com wrote:

I understand this was done with applications connected to an XServer in mind, but I actually need this functionality to handle some C code I have (using SYSV shared memory API), which I'm porting right now for the first time to Android, so I wanted to check:

Is the XServer here is a must (to make this all work), or is this something that can be used regardless?

I'm asking because NOT using the XServer, ancil_recv_fd() hangs on the call to recvmsg(), and I'm just wondering if this is a bug in my outdated kernel (3.18), or if I'm missing something here?

Thanks a lot

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pelya/android-shmem/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJewHi38pcw_yX5t0fggoH3lICpFBM8ks5sImhCgaJpZM4OIFDk .

relipo commented 7 years ago

Thanks a lot. Works perfectly.