Interface Requirements

This page describes a subset of the Linux kernel interfaces on which Android relies to function properly. The presence and correctness of these interfaces is tested as part of the Vendor Test Suite (VTS). This subset will grow over time to contain a larger portion of Android kernel interfaces.

System calls

All system calls are expected to provide the same signatures and semantics as in the upstream Linux kernel of the same version.

prctl

In addition to the upstream prctl operations for supported kernel versions, Android relies on additional prctl operations, the implementation of which can be found in the android-common kernel.

PR_SET_TIMERSLACK_PID
PR_SET_VMA

Filesystems

The Linux kernel exports interfaces via several filesystems. Android expects these interfaces to communicate the same information, in the same format, and provide the same semantics as in the upstream Linux kernel. For interfaces that do not exist upstream, the appropriate behavior is dictated by the corresponding branch of the Android common kernel.

procfs

Interface Description
/proc/asound/ Read-only file showing the list of currently configured ALSA drivers.
/proc/cmdline Read-only file containing command line arguments passed to the kernel.
/proc/config.gz Read-only file containing kernel build configuration.
/proc/cpuinfo Read-only file containing architecture-specific CPU details.
/proc/diskstats Read-only file showing I/O statistics of block devices.
/proc/filesystems Read-only file listing filesystems currently supported by the kernel.
/proc/kmsg Read-only file showing kernel messages in real time.
/proc/loadavg Read-only file showing CPU and IO load average over time.
/proc/meminfo Read-only file showing memory subsystem details.
/proc/misc Read-only file listing miscellaneous drivers registered on the miscellaneous major device.
/proc/modules Read-only file containing information about loaded kernel modules.
/proc/mounts Symlink to /proc/self/mounts, which is a read-only file listing information about the mounted filesystems.
/proc/net Directory containing a variety of network stack parameters.
/proc/net/xt_qtaguid/ Read-write file providing information about tagged sockets.
/proc/pagetypeinfo Read-only file containing page allocator information.
/proc/stat Read-only file containing various kernel and system statistics.
/proc/swaps Read-only file showing swap space utilization. This file is optional; its contents and permissions will be verified in VTS only if the file is present.
/proc/sys/abi/swp Read-write file which determines the behavior of the obsoleted ARM instruction SWP.
/proc/sys/fs/pipe-max-size Read-write file that reports the maximum size, in bytes, of an individual pipe buffer.
/proc/sys/fs/protected_hardlinks Read-write file that controls the behavior of creation of hard links.
/proc/sys/fs/protected_symlinks Read-write file that controls the behavior of creation of symbolic links.
/proc/sys/fs/suid_dumpable Read-write file that controls the core dump mode for setuid or otherwise protected/tainted binaries.
/proc/sys/kernel/core_pattern Read-write file that specifies the core dump filename pattern.
/proc/sys/kernel/core_pipe_limit Read-write file that defines how many concurrent crashing processes may be piped to user applications in parallel.
/proc/sys/kernel/dmesg_restrict Read-write file that controls whether unprivileged users may access dmesg.
/proc/sys/kernel/domainname Read-write file that contains the YP/NIS domain name of the system.
/proc/sys/kernel/hostname Read-write file that determines the host name of the system.
/proc/sys/kernel/hung_task_timeout_secs Read-write file that controls the timeout used to determine when a task has become non-responsive and should be considered hung. This file is optional; its contents and permissions will be verified in VTS only if the file is present.
/proc/sys/kernel/kptr_restrict Read-write file that determines whether kernel pointers are printed in proc files and other interfaces.
/proc/sys/kernel/modules_disabled Read-write file that controls whether kernel modules may be loaded.
/proc/sys/kernel/panic_on_oops Read-write file that controls the kernel's behavior on oops.
/proc/sys/kernel/perf_event_max_sample_rate Read-write file that controls the maximum sample rate of performance events.
/proc/sys/kernel/perf_event_paranoid Read-write file that controls the usage of the performance events system by unprivileged users.
/proc/sys/kernel/pid_max Read-write file that contains the PID allocation wrap value.
/proc/sys/kernel/random/boot_id Read-only file that contains a new random ID on each boot.
/proc/sys/kernel/randomize_va_space Read-write file that determines the address layout randomization policy for the system.
/proc/sys/kernel/sched_child_runs_first Read-write file that controls whether newly forked tasks are favored in scheduling over their parent tasks.
/proc/sys/kernel/sched_latency_ns Read-write file that contains the maximum latency, in nanoseconds, a task may incur prior to being scheduled.
/proc/sys/kernel/sched_rt_period_us Read-write file that contains the period length used by the system-wide RT execution limit in microseconds.
/proc/sys/kernel/sched_rt_runtime_us Read-write file that contains the amount of time, relative to sched_rt_period_us, that the system may execute RT tasks.
/proc/sys/kernel/sched_tunable_scaling Read-write file that controls whether sched_latency_ns should be automatically adjusted by the scheduler based on the number of CPUs.
/proc/sys/kernel/sched_wakeup_granularity_ns Read-write file that contains how much more virtual runtime task A must have than task B in nanoseconds for task B to preempt it.
/proc/sys/kernel/sysrq Read-write file that controls the functions allowed to be invoked via the sysrq key.
/proc/sys/net/* Directory containing a variety of network stack parameters.
/proc/sysrq-trigger Write-only file that can be used to initiate sysrq functions.
/proc/sys/vm/dirty_background_ratio Read-write file that contains, as a percentage of total available memory (free pages and reclaimable pages), the number of pages at which the background kernel flusher threads will start writing out dirty data.
/proc/sys/vm/dirty_expire_centisecs Read-write file that defines when dirty data is old enough to be eligible for write out by the kernel flusher threads.
/proc/sys/vm/drop_caches Read-write file that can be used to force the kernel to drop clean caches.
/proc/sys/vm/extra_free_kbytes Read-write file that can be used to keep extra free memory between the threshold where background reclaim (kswapd) kicks in, and the threshold where direct reclaim (by allocating processes) kicks in. This file is optional; its contents and permissions will be verified in VTS only if the file is present.
/proc/sys/vm/max_map_count Read-write file that contains the maximum number of memory map areas a process may have.
/proc/sys/vm/mmap_min_addr Read-write file that determines the minimum address than can be mmap'd.
/proc/sys/vm/mmap_rnd_bits Read-write file that specifies the amount of randomness in mmap'd addresses.
/proc/sys/vm/mmap_rnd_compat_bits Read-write file that specifies the amount of randomness in mmap'd addresses.
/proc/sys/vm/overcommit_memory Read-write file that determines the kernel virtual memory accounting mode.
/proc/sys/vm/page-cluster Read-write file that controls the number of pages up to which consecutive pages are read in from swap in a single attempt.
/proc/uid_cputime/remove_uid_range Write-only file that, when written, removes UIDs from being shown in /proc/uid_cputime/show_uid_stat.
/proc/uid_cputime/show_uid_stat Read-only file containing the time a UID's processes spent in user and kernel space.
/proc/uid_io/stats Read-only file containing a list of I/O stats for each UID in the system
/proc/uid_procstat/set Write-only file used to configure a UID as foreground or background.
/proc/uid_time_in_state Read-only file containing the time each UID's processes spend executing at each available frequency. This file is optional; its contents and permissions will be verified in VTS only if the file is present.
/proc/uptime Read-only file that shows how long the system has been running.
/proc/version Read-only file containing a string describing the kernel version.
/proc/vmallocinfo Read-only file containing vmalloc'd ranges.
/proc/vmstat Read-only file containing virtual memory statistics from the kernel.
/proc/zoneinfo Read-only file containing information about memory zones.

dev

Interface Description
/dev/ashmem Anonymous shared memory device file.
/dev/binder Binder device file.
/dev/hwbinder Hardware binder device file.
/dev/tun Universal TUN/TAP device file.
/dev/xt_qtaguid QTAGUID netfilter device file.

sysfs

Interface Description
/sys/class/net/*/mtu Read-write file containing the maximum transmission unit for each interface.
/sys/class/rtc/*/hctosys Read-only file showing whether a particular rtc supplies the system time on boot and resume.
/sys/devices/system/cpu/ Directory containing information about CPU configuration and frequency.
/sys/kernel/ipv4 Directory of read-write files to configure TCP socket buffer sizes.
/sys/kernel/wakeup_reasons Directory of read-only files containing the last suspend time and resume reason.
/sys/power/state Read-write file that controls the system sleep states.
/sys/power/wake_lock Read-write file that contains the active wake locks.
/sys/power/wake_unlock Read-write file that contains non-active wake locks.
/sys/power/wakeup_count Read-write file that can be used to put the system into a sleep state while taking into account the concurrent arrival of wakeup events.

selinuxfs

The framework mounts selinuxfs at /sys/fs/selinux.

Path Description
/sys/fs/selinux/checkreqprot Read/write file containing a binary flag that determines how selinux protections are checked on mmap and mprotect calls.
/sys/fs/selinux/null Read/write null device for use by selinux.
/sys/fs/selinux/policy Read-only file containing the selinux policy in binary form.