---
name: "wait_task_stopped"
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/wait_task_stopped"
---

# wait\_task\_stopped(9)

Wait for TASK\_STOPPED or TASK\_TRACED

## NAME

wait\_task\_stopped - Wait for **TASK\_STOPPED** or **TASK\_TRACED**

## SYNOPSIS

**int wait\_task\_stopped(struct wait\_opts \*** *wo***, int** *ptrace***, struct task\_struct \*** *p***);**

## ARGUMENTS

*wo*

wait options

*ptrace*

is the wait for ptrace

*p*

task to wait for

## DESCRIPTION

Handle **sys\_wait4** work for **p** in state **TASK\_STOPPED** or **TASK\_TRACED**.

## CONTEXT

read\_lock(tasklist\_lock), which is released if return value is non-zero. Also, grabs and releases *p*-\>sighand-\>siglock.

## RETURNS

0 if wait condition didn't exist and search for other wait conditions should continue. Non-zero return, -errno on failure and *p*'s pid on success, implies that tasklist\_lock is released and wait condition search should terminate.

## COPYRIGHT
