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

System calls are expected to provide the same signatures and semantics as in the upstream Linux kernel.

ARM64 system calls required by bionic per bionic/libc/SYSCALLS.txt:

accept4, acct, adjtimex, bind, brk, capget, capset, chdir, chroot, clock_adjtime, clock_getres, clock_gettime, clock_nanosleep, clock_settime, close, connect, delete_module, dup3, dup, epoll_create1, epoll_ctl, epoll_pwait, eventfd2, execve, exit, exit_group, faccessat, fadvise64, fallocate, fchdir, fchmodat, fchmod, fchownat, fchown, fcntl, fdatasync, fgetxattr, flistxattr, flock, fremovexattr, fsetxattr, fstat, newfstatat, fstatfs, fsync, ftruncate, getcpu, getcwd, getdents64, getegid, geteuid, getgid, getgroups, getitimer, getpeername, getpgid, getpid, getppid, getpriority, getresgid, getresuid, getrlimit, getrusage, getsid, getsockname, getsockopt, gettimeofday, getuid, getxattr, init_module, inotify_add_watch, inotify_init1, inotify_rm_watch, ioctl, kill, syslog, lgetxattr, linkat, listen, listxattr, llistxattr, lremovexattr, lseek, lsetxattr, madvise, mincore, mkdirat, mknodat, mlockall, mlock, mmap, mount, mprotect, mremap, msync, munlockall, munlock, munmap, nanosleep, openat, personality, pipe2, ppoll, prctl, pread64, preadv, prlimit64, process_vm_readv, process_vm_writev, pselect6, ptrace, pwrite64, pwritev, quotactl, readahead, readlinkat, read, readv, reboot, recvfrom, recvmmsg, recvmsg, removexattr, renameat, rt_sigaction, rt_sigpending, rt_sigprocmask, rt_sigqueueinfo, rt_sigsuspend, rt_sigtimedwait, sched_getaffinity, sched_getparam, sched_get_priority_max, sched_get_priority_min, sched_getscheduler, sched_rr_get_interval, sched_setaffinity, sched_setparam, sched_setscheduler, sched_yield, sendfile, sendmmsg, sendmsg, sendto, setdomainname, setfsgid, setfsuid, setgid, setgroups, sethostname, setitimer, setns, setpgid, setpriority, setregid, setresgid, setresuid, setreuid, setrlimit, setsid, setsockopt, set_tid_address, settimeofday, setuid, setxattr, shutdown, sigaltstack, signalfd4, socketpair, socket, splice, statfs, swapoff, swapon, symlinkat, sync_file_range, sync, sysinfo, tee, tgkill, timer_create, timer_delete, timerfd_create, timerfd_gettime, timerfd_settime, timer_getoverrun, timer_gettime, timer_settime, times, truncate, umask, umount2, uname, unlinkat, unshare, utimensat, vmsplice, wait4, waitid, write, writev

ARM32 system calls required by bionic per bionic/libc/SYSCALLS.txt:

accept4, acct, adjtimex, arm_fadvise64_64, bind, brk, cacheflush, capget, capset, chdir, chroot, clock_adjtime, clock_getres, clock_gettime, clock_nanosleep, clock_settime, close, connect, delete_module, dup3, dup, epoll_create1, epoll_ctl, epoll_pwait, eventfd2, execve, exit, exit_group, faccessat, fallocate, fchdir, fchmodat, fchmod, fchownat, fchown32, fcntl64, fdatasync, fgetxattr, flistxattr, flock, fremovexattr, fsetxattr, fstat64, fstatat64, fstatfs64, fsync, ftruncate64, getcpu, getcwd, getdents64, getegid32, geteuid32, getgid32, getgroups32, getitimer, getpeername, getpgid, getpid, getppid, getpriority, getresgid32, getresuid32, ugetrlimit, getrusage, getsid, getsockname, getsockopt, gettimeofday, getuid32, getxattr, init_module, inotify_add_watch, inotify_init1, inotify_rm_watch, ioctl, kill, syslog, lgetxattr, linkat, listen, listxattr, llistxattr, _llseek, lremovexattr, lseek, lsetxattr, madvise, mincore, mkdirat, mknodat, mlockall, mlock, mmap2, mount, mprotect, mremap, msync, munlockall, munlock, munmap, nanosleep, openat, personality, pipe2, ppoll, prctl, pread64, preadv, prlimit64, process_vm_readv, process_vm_writev, pselect6, ptrace, pwrite64, pwritev, quotactl, readahead, readlinkat, read, readv, reboot, recvfrom, recvmmsg, recvmsg, removexattr, renameat, rt_sigaction, rt_sigpending, rt_sigprocmask, rt_sigqueueinfo, rt_sigsuspend, rt_sigtimedwait, sched_getaffinity, sched_getparam, sched_get_priority_max, sched_get_priority_min, sched_getscheduler, sched_rr_get_interval, sched_setaffinity, sched_setparam, sched_setscheduler, sched_yield, sendfile64, sendfile, sendmmsg, sendmsg, sendto, setdomainname, setfsgid, setfsuid, setgid32, setgroups32, sethostname, setitimer, setns, setpgid, setpriority, setregid32, setresgid32, setresuid32, setreuid32, setrlimit, setsid, setsockopt, set_tid_address, settimeofday, set_tls, setuid32, setxattr, shutdown, sigaction, sigaltstack, signalfd4, socketpair, socket, splice, statfs64, swapoff, swapon, symlinkat, sync_file_range2, sync, sysinfo, tee, tgkill, timer_create, timer_delete, timerfd_create, timerfd_gettime, timerfd_settime, timer_getoverrun, timer_gettime, timer_settime, times, truncate64, truncate, umask, umount2, uname, unlinkat, unshare, utimensat, vmsplice, wait4, waitid, write, writev

The system calls listed below are made by bypassing bionic:

All Architectures gettid, futex, clone, rt_sigreturn, rt_tgsigqueueinfo, restart_syscall, getrandom, perf_event_open, syncfs, tkill, seccomp
arm vfork, sigreturn, pipe, access, stat64, lstat64, open, getdents, eventfd, epoll_wait, readlink, epoll_create, creat, unlink
arm64 pivot_root, ioprio_get, ioprio_set

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

Path Description
/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/kmsg Read-only file showing kernel messages in real time.
/proc/meminfo Read-only file showing memory subsystem details.
/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/xt_qtaguid/ctrl Read-write file providing information about tagged sockets.
/proc/self/maps Read-only file containing the currently mapped memory regions and permissions.
/proc/stat Read-only file containing various kernel and system statistics.
/proc/sys/kernel/kptr_restrict Read-write file that determines whether kernel pointers are printed in proc files and other interfaces.
/proc/sys/kernel/randomize_va_space Read-write file that determines the address layout randomization policy for the system.
/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/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/version Read-only file containing a string describing the kernel version.
/proc/vmallocinfo Read-only file containing vmalloc'd ranges.
/proc/zoneinfo Read-only file containing information about memory zones.

dev

Path 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

Path Description
/sys/devices/system/cpu/online Read-only file showing ranges of CPUs that are currently online.
/sys/kernel/wakeup_reasons/last_resume_reason Read-only file showing a textual description of why the system exited the last instance of suspend.
/sys/devices/system/cpu/kernel_max Read-only file showing the maximum CPU index supported by the kernel.

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.