]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/linux.4
Merge bmake-20211212
[FreeBSD/FreeBSD.git] / share / man / man4 / linux.4
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 May 6, 2021
28 .Dt LINUX 4
29 .Os
30 .Sh NAME
31 .Nm linux
32 .Nd Linux ABI support
33 .Sh SYNOPSIS
34 To load the ABI at boot time, place the following line in
35 .Xr loader.conf 5 :
36 .Bd -literal -offset indent
37 linux_load="YES"
38 .Ed
39 .Sh DESCRIPTION
40 The
41 .Nm
42 module provides limited Linux ABI (application binary interface) compatibility,
43 making it possible to run many unmodified Linux applications and libraries
44 without the need for virtualization or emulation.
45 Some of the facilities provided are:
46 .Bl -bullet
47 .It
48 An image activator
49 for correctly branded
50 .Xr elf 5
51 executable images
52 .It
53 Special signal handling for activated images
54 .It
55 Linux to native system call translation
56 .It
57 Linux-specific system calls
58 .El
59 .Pp
60 Note that dynamically linked Linux executables
61 will require a suitable environment in
62 .Pa /compat/linux .
63 This includes native Linux shared libraries, and Linux-specific virtual
64 filesystems.
65 To set it up, install the
66 .Pa emulators/linux_base-c7
67 port or the linux_base-c7
68 package, and add the following line to the
69 .Xr rc.conf 5
70 file:
71 .Pp
72 .Dl linux_enable="YES"
73 .Pp
74 To avoid mounting Linux-specific filesystems at startup, also add the following
75 line:
76 .Pp
77 .Dl linux_mounts_enable="NO"
78 .Sh SYSCTL VARIABLES
79 The following variables are available as both
80 .Xr sysctl 8
81 variables and
82 .Xr loader 8
83 tunables:
84 .Bl -tag -width indent
85 .It Va compat.linux.debug
86 Enable debugging messages.
87 Set to 0 to silence them.
88 Defaults to 3.
89 A setting of 1 prints debug messages, tells about unimplemented stuff (only
90 once).
91 Set to 2 is like 1, but also prints messages about implemented but not tested
92 stuff (only once).
93 Setting it to 3 or higher is like 2, but no rate limiting of messages.
94 .It Va compat.linux.default_openfiles
95 Default soft openfiles resource limit for Linux applications.
96 Set to -1 to disable the limit.
97 Defaults to 1024.
98 .It Va compat.linux.emul_path
99 Path to the Linux run-time environment.
100 Defaults to
101 .Pa /compat/linux .
102 .It Va compat.linux.osname
103 Linux kernel operating system name.
104 .It Va compat.linux.osrelease
105 Linux kernel operating system release.
106 Changing this to something else is discouraged on non-development systems,
107 because it may change the way Linux programs work.
108 Recent versions of GNU libc are known to use different syscalls depending
109 on the value of this sysctl.
110 .It Va compat.linux.oss_version
111 Linux Open Sound System version.
112 .It Va compat.linux.preserve_vstatus
113 When set to 1, it prevents Linux applications from resetting the
114 .Xr termios 4
115 VSTATUS setting.
116 From a user perspective, this makes
117 .Va SIGINFO
118 work for Linux executables.
119 Defaults to 0.
120 .It Va compat.linux.setid_allowed
121 Disable handling of set-user-ID and set-group-ID mode bits for the new
122 process image file when image is to be executed under Linux ABI.
123 When set, new Linux images always use credentials of the program
124 that issued
125 .Xr execve 2
126 call, regardless of the image file mode.
127 .Pp
128 This might be reasonable or even required, because
129 .Fx
130 does not emulate Linux environment completely, and missed features
131 could become holes.
132 .El
133 .Sh FILES
134 .Bl -tag -width /compat/linux/dev/shm -compact
135 .It Pa /compat/linux
136 minimal Linux run-time environment
137 .It Pa /compat/linux/dev
138 device file system, see
139 .Xr devfs 5
140 .It Pa /compat/linux/dev/fd
141 file descriptor file system mounted with the
142 .Cm linrdlnk
143 option, see
144 .Xr fdescfs 5
145 .It Pa /compat/linux/dev/shm
146 in-memory file system, see
147 .Xr tmpfs 5
148 .It Pa /compat/linux/proc
149 Linux process file system, see
150 .Xr linprocfs 5
151 .It Pa /compat/linux/sys
152 Linux kernel objects file system, see
153 .Xr linsysfs 5
154 .El
155 .Sh SEE ALSO
156 .Xr brandelf 1 ,
157 .Xr pty 4 ,
158 .Xr elf 5 ,
159 .Xr fdescfs 5 ,
160 .Xr linprocfs 5 ,
161 .Xr linsysfs 5 ,
162 .Xr tmpfs 5
163 .Sh HISTORY
164 Linux ABI support first appeared in
165 .Fx 2.1 .
166 .Sh BUGS
167 Support for some of the Linux-specific system calls and system call arguments
168 is missing.