xref: /freebsd/share/man/man4/linux.4 (revision 2cf9eb6c4ead758c0083a30460e3244fab92f268)
1e6769554SRui Paulo.\" Copyright (c) 2000 Sheldon Hearn
2e6769554SRui Paulo.\" All rights reserved.
3e6769554SRui Paulo.\"
4e6769554SRui Paulo.\" Redistribution and use in source and binary forms, with or without
5e6769554SRui Paulo.\" modification, are permitted provided that the following conditions
6e6769554SRui Paulo.\" are met:
7e6769554SRui Paulo.\" 1. Redistributions of source code must retain the above copyright
8e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer.
9e6769554SRui Paulo.\" 2. Redistributions in binary form must reproduce the above copyright
10e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer in the
11e6769554SRui Paulo.\"    documentation and/or other materials provided with the distribution.
12e6769554SRui Paulo.\"
13e6769554SRui Paulo.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14e6769554SRui Paulo.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e6769554SRui Paulo.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e6769554SRui Paulo.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17e6769554SRui Paulo.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e6769554SRui Paulo.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e6769554SRui Paulo.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e6769554SRui Paulo.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e6769554SRui Paulo.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e6769554SRui Paulo.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e6769554SRui Paulo.\" SUCH DAMAGE.
24e6769554SRui Paulo.\"
25e6769554SRui Paulo.\" $FreeBSD$
26e6769554SRui Paulo.\"
27b5f20658SEdward Tomasz Napierala.Dd December 16, 2019
28c383d55bSGavin Atkinson.Dt LINUX 4
29e6769554SRui Paulo.Os
30e6769554SRui Paulo.Sh NAME
31e6769554SRui Paulo.Nm linux
32e6769554SRui Paulo.Nd Linux ABI support
33e6769554SRui Paulo.Sh SYNOPSIS
3439eb4bc6SBernhard SchmidtTo compile support for this ABI into an i386 kernel
35e6769554SRui Pauloplace the following line in your
36e6769554SRui Paulokernel configuration file:
37e6769554SRui Paulo.Bd -ragged -offset indent
38e6769554SRui Paulo.Cd "options COMPAT_LINUX"
39e6769554SRui Paulo.Ed
40e6769554SRui Paulo.Pp
4139eb4bc6SBernhard Schmidtfor an amd64 kernel use:
4239eb4bc6SBernhard Schmidt.Bd -ragged -offset indent
4339eb4bc6SBernhard Schmidt.Cd "options COMPAT_LINUX32"
4439eb4bc6SBernhard Schmidt.Ed
4539eb4bc6SBernhard Schmidt.Pp
46e6769554SRui PauloAlternatively, to load the ABI as a
47e6769554SRui Paulomodule at boot time, place the following line in
48e6769554SRui Paulo.Xr loader.conf 5 :
49e6769554SRui Paulo.Bd -literal -offset indent
50e6769554SRui Paulolinux_load="YES"
51e6769554SRui Paulo.Ed
52e6769554SRui Paulo.Sh DESCRIPTION
53e6769554SRui PauloThe
54e6769554SRui Paulo.Nm
55f54d9519SEdward Tomasz Napieralamodule provides limited Linux ABI (application binary interface) compatibility,
56f54d9519SEdward Tomasz Napieralamaking it possible to run many unmodified Linux applications and libraries
57f54d9519SEdward Tomasz Napieralawithout the need for virtualization or emulation.
58f54d9519SEdward Tomasz NapieralaSome of the facilities provided are:
59e6769554SRui Paulo.Bl -bullet
60e6769554SRui Paulo.It
61e6769554SRui PauloAn image activator
62e6769554SRui Paulofor correctly branded
63e6769554SRui Paulo.Xr elf 5
64e6769554SRui Pauloexecutable images
65e6769554SRui Paulo.It
66e6769554SRui PauloSpecial signal handling for activated images
67e6769554SRui Paulo.It
68e6769554SRui PauloLinux to native system call translation
69f54d9519SEdward Tomasz Napierala.It
70f54d9519SEdward Tomasz NapieralaLinux-specific system calls
71e6769554SRui Paulo.El
72e6769554SRui Paulo.Pp
73f54d9519SEdward Tomasz NapieralaNote that dynamically linked Linux executables
74f54d9519SEdward Tomasz Napieralawill require a suitable environment in
75f54d9519SEdward Tomasz Napierala.Pa /compat/linux .
76f54d9519SEdward Tomasz NapieralaThis includes native Linux shared libraries, and Linux-specific virtual
77f54d9519SEdward Tomasz Napieralafilesystems.
78f54d9519SEdward Tomasz NapieralaTo set it up, install the
79f54d9519SEdward Tomasz Napierala.Pa emulators/linux_base-c7
80f54d9519SEdward Tomasz Napieralaport or the linux_base-c7
81f54d9519SEdward Tomasz Napieralapackage, and add the following line to the
82f54d9519SEdward Tomasz Napierala.Xr rc.conf 5
83f54d9519SEdward Tomasz Napieralafile:
84e6769554SRui Paulo.Pp
85f54d9519SEdward Tomasz Napierala.Dl linux_enable="YES"
86f54d9519SEdward Tomasz Napierala.Pp
87f54d9519SEdward Tomasz NapieralaTo avoid mounting Linux-specific filesystems at startup, also add the following
88f54d9519SEdward Tomasz Napieralaline:
89f54d9519SEdward Tomasz Napierala.Pp
90f54d9519SEdward Tomasz Napierala.Dl linux_mounts_enable="NO"
91f54d9519SEdward Tomasz Napierala.Sh SYSCTL VARIABLES
92f54d9519SEdward Tomasz NapieralaThe following variables are available as both
93e6769554SRui Paulo.Xr sysctl 8
94f54d9519SEdward Tomasz Napieralavariables and
95f54d9519SEdward Tomasz Napierala.Xr loader 8
96f54d9519SEdward Tomasz Napieralatunables:
97f54d9519SEdward Tomasz Napierala.Bl -tag -width indent
98b5f20658SEdward Tomasz Napierala.It Va compat.linux.emul_path
99b5f20658SEdward Tomasz NapieralaPath to the Linux run-time environment.
100b5f20658SEdward Tomasz NapieralaDefaults to
101b5f20658SEdward Tomasz Napierala.Pa /compat/linux .
102f54d9519SEdward Tomasz Napierala.It Va compat.linux.osname
103e6769554SRui PauloLinux kernel operating system name.
104f54d9519SEdward Tomasz Napierala.It Va compat.linux.osrelease
105e6769554SRui PauloLinux kernel operating system release.
106e6769554SRui PauloChanging this to something else is discouraged on non-development systems,
107e6769554SRui Paulobecause it may change the way Linux programs work.
108e6769554SRui PauloRecent versions of GNU libc are known to use different syscalls depending
109e6769554SRui Pauloon the value of this sysctl.
110f54d9519SEdward Tomasz Napierala.It Va compat.linux.oss_version
111e6769554SRui PauloLinux Open Sound System version.
112*2cf9eb6cSEdward Tomasz Napierala.It Va compat.linux.preserve_vstatus
113*2cf9eb6cSEdward Tomasz NapieralaWhen set to 1, it prevents Linux applications from resetting the
114*2cf9eb6cSEdward Tomasz Napierala.Xr termios 4
115*2cf9eb6cSEdward Tomasz NapieralaVSTATUS setting.
116*2cf9eb6cSEdward Tomasz NapieralaFrom a user perspective, this makes
117*2cf9eb6cSEdward Tomasz Napierala.Va SIGINFO
118*2cf9eb6cSEdward Tomasz Napieralawork for Linux executables.
119*2cf9eb6cSEdward Tomasz NapieralaDefaults to 0.
120e6769554SRui Paulo.Sh FILES
121f54d9519SEdward Tomasz Napierala.Bl -tag -width /compat/linux/dev/shm -compact
122e6769554SRui Paulo.It Pa /compat/linux
123e6769554SRui Paulominimal Linux run-time environment
12477d3337cSDmitry Chagin.It Pa /compat/linux/dev/fd
125f54d9519SEdward Tomasz Napieralafile-descriptor file system, see
126f54d9519SEdward Tomasz Napierala.Xr fdescfs 5
127f54d9519SEdward Tomasz Napierala.It Pa /compat/linux/dev/shm
128f54d9519SEdward Tomasz Napieralain-memory file system, see
129f54d9519SEdward Tomasz Napierala.Xr tmpfs 5
130e6769554SRui Paulo.It Pa /compat/linux/proc
131f54d9519SEdward Tomasz NapieralaLinux process file system, see
132f54d9519SEdward Tomasz Napierala.Xr linprocfs 5
133e6769554SRui Paulo.It Pa /compat/linux/sys
134f54d9519SEdward Tomasz NapieralaLinux kernel objects file system, see
135f54d9519SEdward Tomasz Napierala.Xr linsysfs 5
136e6769554SRui Paulo.El
137e6769554SRui Paulo.Sh SEE ALSO
138e6769554SRui Paulo.Xr brandelf 1 ,
139fd2ced61SEdward Tomasz Napierala.Xr pty 4 ,
140e6769554SRui Paulo.Xr elf 5 ,
14177d3337cSDmitry Chagin.Xr fdescfs 5 ,
142e6769554SRui Paulo.Xr linprocfs 5 ,
143f54d9519SEdward Tomasz Napierala.Xr linsysfs 5 ,
144f54d9519SEdward Tomasz Napierala.Xr tmpfs 5
145e6769554SRui Paulo.Sh HISTORY
146e6769554SRui PauloLinux ABI support first appeared in
147e6769554SRui Paulo.Fx 2.1 .
148f54d9519SEdward Tomasz Napierala.Sh BUGS
149f54d9519SEdward Tomasz NapieralaSupport for some of the Linux-specific system calls and system call arguments
150f54d9519SEdward Tomasz Napieralais missing.
151