1.\" Copyright (c) 2000 Sheldon Hearn 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd June 10, 2020 28.Dt LINUX 4 29.Os 30.Sh NAME 31.Nm linux 32.Nd Linux ABI support 33.Sh SYNOPSIS 34To compile support for this ABI into an i386 kernel 35place the following line in your 36kernel configuration file: 37.Bd -ragged -offset indent 38.Cd "options COMPAT_LINUX" 39.Ed 40.Pp 41for an amd64 kernel use: 42.Bd -ragged -offset indent 43.Cd "options COMPAT_LINUX32" 44.Ed 45.Pp 46Alternatively, to load the ABI as a 47module at boot time, place the following line in 48.Xr loader.conf 5 : 49.Bd -literal -offset indent 50linux_load="YES" 51.Ed 52.Sh DESCRIPTION 53The 54.Nm 55module provides limited Linux ABI (application binary interface) compatibility, 56making it possible to run many unmodified Linux applications and libraries 57without the need for virtualization or emulation. 58Some of the facilities provided are: 59.Bl -bullet 60.It 61An image activator 62for correctly branded 63.Xr elf 5 64executable images 65.It 66Special signal handling for activated images 67.It 68Linux to native system call translation 69.It 70Linux-specific system calls 71.El 72.Pp 73Note that dynamically linked Linux executables 74will require a suitable environment in 75.Pa /compat/linux . 76This includes native Linux shared libraries, and Linux-specific virtual 77filesystems. 78To set it up, install the 79.Pa emulators/linux_base-c7 80port or the linux_base-c7 81package, and add the following line to the 82.Xr rc.conf 5 83file: 84.Pp 85.Dl linux_enable="YES" 86.Pp 87To avoid mounting Linux-specific filesystems at startup, also add the following 88line: 89.Pp 90.Dl linux_mounts_enable="NO" 91.Sh SYSCTL VARIABLES 92The following variables are available as both 93.Xr sysctl 8 94variables and 95.Xr loader 8 96tunables: 97.Bl -tag -width indent 98.It Va compat.linux.default_openfiles 99Default soft openfiles resource limit for Linux applications. 100Set to -1 to disable the limit. 101Defaults to 1024. 102.It Va compat.linux.emul_path 103Path to the Linux run-time environment. 104Defaults to 105.Pa /compat/linux . 106.It Va compat.linux.osname 107Linux kernel operating system name. 108.It Va compat.linux.osrelease 109Linux kernel operating system release. 110Changing this to something else is discouraged on non-development systems, 111because it may change the way Linux programs work. 112Recent versions of GNU libc are known to use different syscalls depending 113on the value of this sysctl. 114.It Va compat.linux.oss_version 115Linux Open Sound System version. 116.It Va compat.linux.preserve_vstatus 117When set to 1, it prevents Linux applications from resetting the 118.Xr termios 4 119VSTATUS setting. 120From a user perspective, this makes 121.Va SIGINFO 122work for Linux executables. 123Defaults to 0. 124.Sh FILES 125.Bl -tag -width /compat/linux/dev/shm -compact 126.It Pa /compat/linux 127minimal Linux run-time environment 128.It Pa /compat/linux/dev/fd 129file-descriptor file system, see 130.Xr fdescfs 5 131.It Pa /compat/linux/dev/shm 132in-memory file system, see 133.Xr tmpfs 5 134.It Pa /compat/linux/proc 135Linux process file system, see 136.Xr linprocfs 5 137.It Pa /compat/linux/sys 138Linux kernel objects file system, see 139.Xr linsysfs 5 140.El 141.Sh SEE ALSO 142.Xr brandelf 1 , 143.Xr pty 4 , 144.Xr elf 5 , 145.Xr fdescfs 5 , 146.Xr linprocfs 5 , 147.Xr linsysfs 5 , 148.Xr tmpfs 5 149.Sh HISTORY 150Linux ABI support first appeared in 151.Fx 2.1 . 152.Sh BUGS 153Support for some of the Linux-specific system calls and system call arguments 154is missing. 155