encyclopegia.org

Wait (system call)

In computer operating systems, a process (or task) may wait for another process to complete its execution.[src] In most systems, a parent process can create an independently executing child process.[src] The parent process may then issue a wait system call, which suspends the execution of the parent process while the child executes.[src] When the child process terminates, it returns an exit status to the operating system, which is then returned to the waiting parent process.[src] The parent process then resumes execution.[src] Modern operating systems also provide system calls that allow a process's thread to create other threads and wait for them to terminate ("join" them) in a similar fashion.[src] An operating system may provide variations of the wait call that allow a process to wait for any of its child processes to exit, or to wait for a single specific child process (identified by its process ID) to exit.[src] Some operating systems issue a signal (SIGCHLD) to the parent process when a child process terminates, notifying the parent process and allowing it to retrieve the child process's exit status.[src] The exit status returned by a child process typically indicates whether the process terminated normally or abnormally.[src] For normal termination, this status also includes the exit code (usually an integer value) that the process returned to the system.…[src]

In computer operating systems, a process (or task) may wait for another process to complete its execution.[src] In most systems, a parent process can create an independently executing child process.[src] The parent process may then issue a wait system call, which suspends the execution of the parent process while the child executes.[src] When the child process terminates, it returns an exit status to the operating system, which is then returned to the waiting parent process.[src] The parent process then resumes execution.[src] Modern operating systems also provide system calls that allow a process's thread to create other threads and wait for them to terminate ("join" them) in a similar fashion.[src] An operating system may provide variations of the wait call that allow a process to wait for any of its child processes to exit, or to wait for a single specific child process (identified by its process ID) to exit.[src] Some operating systems issue a signal (SIGCHLD) to the parent process when a child process terminates, notifying the parent process and allowing it to retrieve the child process's exit status.[src] The exit status returned by a child process typically indicates whether the process terminated normally or abnormally.[src] For normal termination, this status also includes the exit code (usually an integer value) that the process returned to the system.[src] During the first 20 years of UNIX, only the low 8 bits of the exit code were available to the waiting parent.[src] In 1989 with SVR4, a new call waitid was introduced that returns all bits from the exit call in a structure called siginfo_t in the structure member si_status.[src] Waitid has been a mandatory part of the POSIX standard since 2001.[src] ==Zombies and orphans== When a child process terminates, it becomes a zombie process, and continues to exist as an entry in the system process table even though it is no longer an actively executing program.[src] Under normal operation it will typically be immediately waited on by its parent, and then reaped by the system, reclaiming the resource (the process table entry).[src] If a child is not waited on by its parent, it continues to consume this resource indefinitely, and thus is a resource leak.[src] Such situations are typically handled with a special "reaper" process that locates zombies and retrieves their exit status, allowing the operating system to then deallocate their resources.[src] Conversely, a child process whose parent process terminates before it does becomes an orphan process.[src] Such situations are typically handled with a special "root" (or "init") process, which is assigned as the new parent of a process when its parent process exits.[src] This special process detects when an orphan process terminates and then retrieves its exit status, allowing the system to deallocate the terminated child process.[src] If a child process receives a signal, a waiting parent will then continue execution leaving an orphan process behind.[src] Hence it is sometimes needed to check the argument set by wait, waitpid or waitid and, in the case that WIFSIGNALED is true, wait for the child process again to deallocate resources.[src] ==References==[src]

33 sentences · 33 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Wait (system call)." encyclopegia.org, 2024, https://encyclopegia.org/wiki/wait-system-call. Accessed 27 November 2026.

Chicago

"Wait (system call)." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/wait-system-call.

APA

encyclopegia.org. (2024). Wait (system call). Retrieved November 27, 2026, from https://encyclopegia.org/wiki/wait-system-call

Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Applicant Tracking System

article · references available

Solar System

stub · references available

binary numeral system

stub · references available

calendar system

stub · references available

centimeter–gram–second system of units

stub · references available

judicial system of Ukraine

stub · references available

Mac operating system

stub · references available

Public distribution system

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1258619992 · 0.5 · snapshot enwiki-001258619992

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.