Start of man-pages-NEXT: Move Changes to Changes.old
[man-pages.git] / man2 / idle.2
blob265d36f315bfcf14d8bb168914cec9bcd71fd71e
1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\" Portions extracted from linux/mm/swap.c:
3 .\"                Copyright (C) 1991, 1992  Linus Torvalds
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .\" Modified 21 Aug 1994 by Michael Chastain <mec@shell.portal.com>:
8 .\"   Added text about calling restriction (new in kernel 1.1.20 I believe).
9 .\"   N.B. calling "idle" from user process used to hang process!
10 .\" Modified Thu Oct 31 14:41:15 1996 by Eric S. Raymond <esr@thyrsus.com>
11 .\" "
12 .TH IDLE 2 2022-09-09 "Linux man-pages (unreleased)"
13 .SH NAME
14 idle \- make process 0 idle
15 .SH SYNOPSIS
16 .nf
17 .B #include <unistd.h>
18 .PP
19 .B int idle(void);
20 .fi
21 .SH DESCRIPTION
22 .BR idle ()
23 is an internal system call used during bootstrap.
24 It marks the process's pages as swappable, lowers its priority,
25 and enters the main scheduling loop.
26 .BR idle ()
27 never returns.
28 .PP
29 Only process 0 may call
30 .BR idle ().
31 Any user process, even a process with superuser permission,
32 will receive
33 .BR EPERM .
34 .SH RETURN VALUE
35 .BR idle ()
36 never returns for process 0, and always returns \-1 for a user process.
37 .SH ERRORS
38 .TP
39 .B EPERM
40 Always, for a user process.
41 .SH VERSIONS
42 Since Linux 2.3.13, this system call does not exist anymore.
43 .SH STANDARDS
44 This function is Linux-specific, and should not be used in programs
45 intended to be portable.