]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 | |
4 | .\" | |
5 | .\" This is free documentation; you can redistribute it and/or | |
6 | .\" modify it under the terms of the GNU General Public License as | |
7 | .\" published by the Free Software Foundation; either version 2 of | |
8 | .\" the License, or (at your option) any later version. | |
9 | .\" | |
10 | .\" The GNU General Public License's references to "object code" | |
11 | .\" and "executables" are to be interpreted as the output of any | |
12 | .\" document formatting or typesetting system, including | |
13 | .\" intermediate and printed output. | |
14 | .\" | |
15 | .\" This manual is distributed in the hope that it will be useful, | |
16 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | .\" GNU General Public License for more details. | |
19 | .\" | |
20 | .\" You should have received a copy of the GNU General Public | |
21 | .\" License along with this manual; if not, write to the Free | |
22 | .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, | |
23 | .\" USA. | |
24 | .\" | |
25 | .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se> | |
26 | .\" First version written | |
27 | .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de> | |
28 | .\" revision | |
29 | .\" | |
973a928a | 30 | .TH SCHED_YIELD 2 1996-04-10 "Linux" "Linux Programmer's Manual" |
fea681da MK |
31 | .SH NAME |
32 | sched_yield \- yield the processor | |
33 | .SH SYNOPSIS | |
34 | .B #include <sched.h> | |
35 | .sp | |
36 | \fBint sched_yield(void); | |
fea681da | 37 | .SH DESCRIPTION |
c13182ef | 38 | A process can relinquish the processor voluntarily without blocking by calling |
e511ffb6 | 39 | .BR sched_yield (). |
fea681da MK |
40 | The process will then be moved to the end of the queue for its static |
41 | priority and a new process gets to run. | |
42 | ||
43 | Note: If the current process is the only process in the highest | |
44 | priority list at that time, this process will continue to run after a | |
45 | call to | |
e511ffb6 | 46 | .BR sched_yield (). |
fea681da MK |
47 | |
48 | POSIX systems on which | |
e511ffb6 | 49 | .BR sched_yield () |
fea681da MK |
50 | is available define |
51 | .I _POSIX_PRIORITY_SCHEDULING | |
c84371c6 | 52 | in \fI<unistd.h>\fP. |
fea681da MK |
53 | .SH "RETURN VALUE" |
54 | On success, | |
e511ffb6 | 55 | .BR sched_yield () |
fea681da MK |
56 | returns 0. |
57 | On error, \-1 is returned, and | |
58 | .I errno | |
59 | is set appropriately. | |
f5cb430b MK |
60 | .SH ERRORS |
61 | In the Linux implementation, | |
62 | .BR sched_yield () | |
63 | always succeeds. | |
fea681da | 64 | .SH "CONFORMING TO" |
97c1eac8 | 65 | POSIX.1-2001. |
fea681da MK |
66 | .SH "SEE ALSO" |
67 | .BR sched_setscheduler (2) | |
68 | for a description of Linux scheduling. | |
69 | .PP | |
70 | .I Programming for the real world \- POSIX.4 | |
71 | by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 |