LINUX(4)
π LINUX(4) β linux ABI support π
Ok bestie, welcome to LINUX(4) from the Kernel Interfaces Manual β this is the page for linux, aka Linux ABI support. Itβs giving βrun Linux apps on FreeBSDβ energy and honestly? Iconic. π¦
πΈ NAME πΈ
linux β Linux ABI support
β¨ SYNOPSIS β¨
To enable the Linux ABI at boot time, place the following line in rc.conf(5):
linux_enable="YES"
π¦ DESCRIPTION π¦
The linux kernel module provides limited Linux ABI (application binary interface) compatibility, making it possible to run many unmodified Linux applications without the need for virtualization or emulation. Some of the facilities provided are:
- Linux to native system call translation
- Linux-specific system calls
- Special signal handling for Linux processes
- Path translation mechanism
- Linux-specific virtual file systems
The path translation mechanism makes Linux processes look up file paths under emul_path (defaulting to /compat/linux) before /. For example, when a Linux process attempts to open /etc/passwd, it will first access /compat/linux/etc/passwd, falling back to /etc/passwd if the compat path does not exist. This is used to make sure Linux processes load Linux shared libraries instead of their similarly-named FreeBSD counterparts, and also to provide alternative versions of certain other files and virtual file systems.
To install Linux shared libraries and system files into /compat/linux, either use the emulators/linux_base-c7 port or package, or debootstrap(8) installed from sysutils/debootstrap.
To avoid mounting Linux-specific filesystems at startup, add the following line to the rc.conf(5) file:
linux_mounts_enable="NO"
π§ SYSCTL VARIABLES π§
The following variables are available as both sysctl(8) variables and loader(8) tunables:
compat.linux.debugβ enables debugging messages. Set to0to silence them. Defaults to3. A setting of1prints debug messages and tells you about unimplemented stuff (only once). Setting it to2is like1, but it also prints messages about implemented-but-not-tested stuff (only once). Setting it to3or higher is like2, but with no rate limiting of messages. π«Άcompat.linux.default_openfilesβ default soft openfiles resource limit for Linux applications. Set to-1to disable the limit. Defaults to1024.compat.linux.emul_pathβ path to the Linux run-time environment. Defaults to/compat/linux.compat.linux.osnameβ Linux kernel operating system name. Defaults to"Linux".compat.linux.osreleaseβ Linux kernel operating system release. Changing this to something else is discouraged on non-development systems, because it may change the way Linux programs work. Some versions of GNU libc are known to use different syscalls depending on the value of this sysctl. π¬compat.linux.oss_versionβ Linux Open Sound System version. Defaults to198144.compat.linux.preserve_vstatusβ when set to1, it prevents Linux applications from resetting thetermios(4)VSTATUSsetting. From a user perspective, this makesSIGINFOwork for Linux executables. Defaults to1.compat.linux.setid_allowedβ enables handling of set-user-ID and set-group-ID mode bits for the new process image file when image is to be executed under Linux ABI. When set to0, new Linux images always use credentials of the program that issued theexecve(2)call, regardless of the image file mode. This might be reasonable or even required, because FreeBSD does not emulate the Linux environment completely, and missed features may result in security vulnerabilities. Defaults to1. πcompat.linux32.emulate_i386β in the x86_64 (amd64) world, enables the real i386 Linuxulator behavior. For example, when set to0, Linuxuname -mwill return"x86_64"even ifunameitself is a i386 Linux executable. When set to1, Linux i386uname -mwill return"i686". Defaults to0.
π FILES π
/compat/linuxβ Linux run-time environment/compat/linux/devβ device file system, seedevfs(4)/compat/linux/dev/fdβ file descriptor file system mounted with thelinrdlnkoption, seefdescfs(4)/compat/linux/dev/mqueueβ symbolic link to amqueuefsmount, seemqueuefs(4)/compat/linux/dev/shmβ in-memory file system, seetmpfs(4)/compat/linux/procβ Linux process file system, seelinprocfs(4)/compat/linux/sysβ Linux kernel objects file system, seelinsysfs(4)
π SEE ALSO π
β HISTORY β
- Linux ABI support first appeared for i386 in FreeBSD 2.1.
- Support for amd64 binaries first appeared in FreeBSD 10.3.
- Support for arm64 binaries first appeared in FreeBSD 12.0.
π BUGS π
Support for some of the Linux-specific system calls and system call arguments is missing. π no cap.
And thatβs the whole LINUX(4) page, bestie!! π«Ά Footer deets: Debian, May 19, 2024 β bye!! πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2000 Sheldon Hearn
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms