Skip to content

System V and Posix shared memory wrapper for chrooted environments (like PRoot) under Android. Compatible with Android 4 - 10.

License

Notifications You must be signed in to change notification settings

green-green-avk/libwrapdroid

Repository files navigation

libwrapdroid

System V and Posix shared memory wrapper for chrooted environments (i.e.: PRoot) under Android. Supposed to be an extended version of https://github.com/termux/libandroid-shmem

  • Android 10 and higher support (not relied upon ashmem): see https://developer.android.com/about/versions/10/behavior-changes-10#shared-memory
  • Resouces are linked to a server instance and will be freed at the instance exit.
  • Each server instance provides its own namespace.
  • System V shared memory calls: shmget(), shmat(), shmdt(), shmctl():
    • There are some problems around process termination and fork() but it serves Xwayland + XFCE + Firefox without any visible problems even in its current state.
      (Full support will be added in the next version.)
  • Posix shared memory calls: shm_open(), shm_unlink().

Build

Under PRoot:

make PREFIX=/opt/shm install

Parts

  • libwrapdroid-server — is to be started to create a resource namespace.
  • libwrapdroid-shm-posix.so — Posix shared memory API; to be added to LD_PRELOAD.
  • libwrapdroid-shm-sysv.so — System V shared memory API; to be added to LD_PRELOAD.

Environment variables

  • LIBWRAPDROID_SOCKET_NAME — communication socket name in the abstract namespace.
    (must be set per server instance)
  • LIBWRAPDROID_AUTH_KEY — authentication key (at least 16 hex digits length).
    (must be set per server instance)

About

System V and Posix shared memory wrapper for chrooted environments (like PRoot) under Android. Compatible with Android 4 - 10.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published