---
name: "schedule_timeout"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/schedule_timeout"
---

# schedule\_timeout(9)

sleep until timeout

## NAME

schedule\_timeout - sleep until timeout

## SYNOPSIS

**signed long \_\_sched schedule\_timeout(signed long** *timeout***);**

## ARGUMENTS

*timeout*

timeout value in jiffies

## DESCRIPTION

Make the current task sleep until *timeout* jiffies have elapsed. The routine will return immediately unless the current task state has been set (see **set\_current\_state**).

You can set the task state as follows -

**TASK\_UNINTERRUPTIBLE** - at least *timeout* jiffies are guaranteed to pass before the routine returns. The routine will return 0

**TASK\_INTERRUPTIBLE** - 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

The current task state is guaranteed to be TASK\_RUNNING when this routine returns.

Specifying a *timeout* value of **MAX\_SCHEDULE\_TIMEOUT** will schedule the CPU away without a bound on the timeout. In this case the return value will be **MAX\_SCHEDULE\_TIMEOUT**.

In all cases the return value is guaranteed to be non-negative.

## COPYRIGHT
