'\" t .\" Title: schedule_timeout .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "SCHEDULE_TIMEOUT" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" schedule_timeout \- sleep until timeout .SH "SYNOPSIS" .HP \w'signed\ long\ __sched\ schedule_timeout('u .BI "signed long __sched schedule_timeout(signed\ long\ " "timeout" ");" .SH "ARGUMENTS" .PP \fItimeout\fR .RS 4 timeout value in jiffies .RE .SH "DESCRIPTION" .PP Make the current task sleep until \fItimeout\fR jiffies have elapsed\&. The routine will return immediately unless the current task state has been set (see \fBset_current_state\fR)\&. .PP You can set the task state as follows \- .PP \fBTASK_UNINTERRUPTIBLE\fR \- at least \fItimeout\fR jiffies are guaranteed to pass before the routine returns\&. The routine will return 0 .PP \fBTASK_INTERRUPTIBLE\fR \- the routine may return early if a signal is delivered to the current task\&. In this case the remaining time in jiffies will be returned, or 0 if the timer expired in time .PP The current task state is guaranteed to be TASK_RUNNING when this routine returns\&. .PP Specifying a \fItimeout\fR value of \fBMAX_SCHEDULE_TIMEOUT\fR will schedule the CPU away without a bound on the timeout\&. In this case the return value will be \fBMAX_SCHEDULE_TIMEOUT\fR\&. .PP In all cases the return value is guaranteed to be non\-negative\&. .SH "COPYRIGHT" .br