Linux environment variables for Linux

I scrolled the / proc directory on my Android device through the adb shell and looked at the contents of the environment file for one of the processes. The list of environment variables is as follows:

  • PATH
  • LD_LIBRARY_PATH
  • ANDROID_BOOTLOGO
  • ANDROID_ROOT
  • ANDROID_ASSETS
  • ANDROID_DATA
  • ANDROID_STORAGE
  • ASEC_MOUNTPOINT
  • LOOP_MOUNTPOINT
  • BOOTCLASSPATH
  • EXTERNAL_STORAGE
  • EMULATED_STORAGE_SOURCE
  • EMULATED_STORAGE_TARGET
  • ANDROID_PROPERTY_WORKSPACE
  • ANDROID_SOCKET_zygote

This list is different from the environment variables visible on Linux. When I see the environment file of some process on my ubuntu-12.04, I see the list much longer and completely different (only PATH is the same).

I have the following questions:

  • where does android define environment variables?

    Since the environment file in Android is different from the linux file, it had to change somewhere

  • Is there a way to provide default values โ€‹โ€‹for these variables?

    I assume that init can have default values, and forked processes inherit values, and there is a possible modification of values โ€‹โ€‹somewhere after forking (if someone knows the actual location of such code, please share)

  • What is the purpose of each environment variable in the list?

    I understand the PATH and LD_LIBRARY_PATH variables that are derived from linux. What about others? When are they used? What would use the Android app (possibly NDK) for?

Thanks.

+7
android linux environment-variables
source share
1 answer

Android uses Linux, but it is not GNU / Linux, so much more.

-3
source share

All Articles