landlock_restrict_self.2: tfix
[man-pages.git] / man2 / setup.2
blob1abcd6978b194d68015b931847d756238a5f6467
1 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Modified by Michael Haardt <michael@moria.de>
6 .\" Modified Sun Jul 25 10:14:13 1993 by Rik Faith <faith@cs.unc.edu>
7 .\" Modified 15 April 1995 by Michael Chastain <mec@shell.portal.com>
8 .\"   Update calling parameters to Linux 1.2.4 values.
9 .\" Modified 10 June 1995 by Andries Brouwer <aeb@cwi.nl>
10 .\" Modified 3 May 1996 by Martin Schulze <joey@infodrom.north.de>
11 .\" Modified Wed Nov  6 04:05:28 1996 by Eric S. Raymond <esr@thyrsus.com>
12 .\" Modified Sat Jan 29 01:08:23 2000 by aeb
13 .\"
14 .TH SETUP 2 2021-03-22 "Linux" "Linux Programmer's Manual"
15 .SH NAME
16 setup \- setup devices and filesystems, mount root filesystem
17 .SH LIBRARY
18 Standard C library
19 .RI ( libc ", " \-lc )
20 .SH SYNOPSIS
21 .nf
22 .B #include <unistd.h>
23 .PP
24 .B int setup(void);
25 .fi
26 .SH DESCRIPTION
27 .BR setup ()
28 is called once from within
29 .IR linux/init/main.c .
30 It calls initialization functions for devices and filesystems
31 configured into the kernel and then mounts the root filesystem.
32 .PP
33 No user process may call
34 .BR setup ().
35 Any user process, even a process with superuser permission,
36 will receive
37 .BR EPERM .
38 .SH RETURN VALUE
39 .BR setup ()
40 always returns \-1 for a user process.
41 .SH ERRORS
42 .TP
43 .B EPERM
44 Always, for a user process.
45 .SH VERSIONS
46 Since Linux 2.1.121, no such function exists anymore.
47 .SH STANDARDS
48 This function is Linux-specific, and should not be used in programs
49 intended to be portable, or indeed in any programs at all.
50 .SH NOTES
51 The calling sequence varied: at some times
52 .BR setup ()
53 has had a single argument
54 .I "void\ *BIOS"
55 and at other times a single argument
56 .IR "int magic" .