1 .\" Copyright (c) 2000 Sheldon Hearn
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
34 To enable the Linux ABI at boot time, place the following line in
36 .Bd -literal -offset indent
42 kernel module provides limited Linux ABI (application binary interface)
43 compatibility, making it possible to run many unmodified Linux applications
44 without the need for virtualization or emulation.
45 Some of the facilities provided are:
48 Linux to native system call translation
50 Linux-specific system calls
52 Special signal handling for Linux processes
54 Path translation mechanism
56 Linux-specific virtual file systems
59 The path translation mechanism makes Linux processes look up file paths
66 For example, when Linux process attempts to open
69 .Pa /compat/linux/etc/passwd ,
70 unless the latter does not exist.
71 This is used to make sure Linux processes load Linux shared libraries
72 instead of their similarly-named FreeBSD counterparts, and also
73 to provide alternative versions of certain other files and virtual
76 To install Linux shared libraries and system files into
79 .Pa emulators/linux_base-c7
84 .Pa sysutils/debootstrap .
86 To avoid mounting Linux-specific filesystems at startup, add the following
91 .Dl linux_mounts_enable="NO"
93 The following variables are available as both
98 .Bl -tag -width indent
99 .It Va compat.linux.debug
100 Enable debugging messages.
101 Set to 0 to silence them.
103 A setting of 1 prints debug messages, tells about unimplemented stuff (only
105 Set to 2 is like 1, but also prints messages about implemented but not tested
107 Setting it to 3 or higher is like 2, but no rate limiting of messages.
108 .It Va compat.linux.default_openfiles
109 Default soft openfiles resource limit for Linux applications.
110 Set to -1 to disable the limit.
112 .It Va compat.linux.emul_path
113 Path to the Linux run-time environment.
116 .It Va compat.linux.osname
117 Linux kernel operating system name.
119 .It Va compat.linux.osrelease
120 Linux kernel operating system release.
121 Changing this to something else is discouraged on non-development systems,
122 because it may change the way Linux programs work.
123 Some versions of GNU libc are known to use different syscalls depending
124 on the value of this sysctl.
125 .It Va compat.linux.oss_version
126 Linux Open Sound System version.
128 .It Va compat.linux.preserve_vstatus
129 When set to 1, it prevents Linux applications from resetting the
132 From a user perspective, this makes
134 work for Linux executables.
136 .It Va compat.linux.setid_allowed
137 Enable handling of set-user-ID and set-group-ID mode bits for the new
138 process image file when image is to be executed under Linux ABI.
139 When set to 0, new Linux images always use credentials of the program
142 call, regardless of the image file mode.
143 This might be reasonable or even required, because
145 does not emulate the Linux environment completely, and missed features
146 may result in security vulnerabilities.
150 .Bl -tag -width /compat/linux/dev/shm -compact
152 Linux run-time environment
153 .It Pa /compat/linux/dev
154 device file system, see
156 .It Pa /compat/linux/dev/fd
157 file descriptor file system mounted with the
161 .It Pa /compat/linux/dev/shm
162 in-memory file system, see
164 .It Pa /compat/linux/proc
165 Linux process file system, see
167 .It Pa /compat/linux/sys
168 Linux kernel objects file system, see
180 Linux ABI support first appeared for i386 in
182 Support for amd64 binaries first appeared in
184 Support for arm64 binaries first appeared in
187 Support for some of the Linux-specific system calls and system call arguments