Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Question about a process lifecycle Post 303044261 by Chubler_XL on Monday 17th of February 2020 03:09:10 PM
Old 02-17-2020
A process calls the wait() function and kernel level code checks the status of a child process, it will suspend execution of the calling thread until status information for one of the terminated child processes is is available.

A call to the exit() function causes a normal termination of the process that calls exit(). There is no involvement with the parent process, in fact the parent process may have already terminated at this stage.

Note that a running process can also be terminated by sending it a signal (like SIGTERM or SIGKILL).
This User Gave Thanks to Chubler_XL For This Post:
 

8 More Discussions You Might Find Interesting

1. Programming

parent and child process question?

Hi everybody, I'm trying to understand how a parent and child processes interact. This function( below) basically measures the fork time from the perspective of the parent only. what i would like to know is how to measure the time from the perspective of parent and child (ie: inserting... (0 Replies)
Discussion started by: tosa
0 Replies

2. UNIX for Dummies Questions & Answers

Silly question about a process

I know its kinda silly but I've seen the texts consider one side - a thread executes and finishes its task but I was wondering what will happen if the process dies when the thread is still under execution... I somehow think that the thread will continue execution but am backing off from the fact... (10 Replies)
Discussion started by: Legend986
10 Replies

3. Virtualization and Cloud Computing

Adaptive Information Technology for Service Lifecycle Management

HPL-2008-80 Adaptive Information Technology for Service Lifecycle Management - Rolia, Jerry; Belrose, Guillaume; Brand, Klaus; Edwards, Nigel; Gmach, Daniel; Graupner, Sven; Kirschnick, Johannes; Stephenson, Bryan; Vickers, Paul; Wilcock, Lawrence Keyword(s): Software as a Service, Enterprise... (0 Replies)
Discussion started by: Linux Bot
0 Replies

4. UNIX for Dummies Questions & Answers

Zombie process question

Hey guys, So i did some research on the site but previous posts answered most of my questions about zombie processes but I have one question that didnt seem to get addressed "how do you find the parent or parent ID of a zombie process so you can kill it?" I know p -kill doesnt always just... (6 Replies)
Discussion started by: kingpin007
6 Replies

5. AIX

AIOServer process question

Hi I've been trying to learn a bit more about AIOServer processes and how my company administers them, one question i have is, while checking, most of my servers show a memory overhead of about 448 k per aioserver process (nmon -A) however i have found a few with figures of 67 or 56k. Most... (0 Replies)
Discussion started by: philib
0 Replies

6. UNIX for Dummies Questions & Answers

Process Substitution Question?

Hello to all. I'm new to this forum, so please go easy on me. =) I am working on a script to send two e-mail attachments in a single e-mail, and am running into a little bit of an issue when using process substitution. I am using the following: cat <(uuencode $1 <(basename $1)) <(uuencode... (5 Replies)
Discussion started by: rommager
5 Replies

7. Homework & Coursework Questions

C++ Environment needed on Solaris,Program lifecycle

Hello, I would like to build some sample C++ application on Solaris SunOS 5.8 Generic Virtual sun4v sparc. so I would like to know what are the compilation utilities and runtime utilities I need to get in my machine and will any one explain me the detaied life cycle of program like what... (1 Reply)
Discussion started by: Revathi R
1 Replies

8. Solaris

Lifecycle patching

I am trying to understand how people manage lifecycle patching these days. I am not a sysadmin (I am a DB Architect) and what I am being told is that if there is any lag between patching a dev server and a prod server that we will liley get new patches in prod that have not had any soak time in... (9 Replies)
Discussion started by: mse
9 Replies
WAIT(2) 							System Calls Manual							   WAIT(2)

NAME
wait, waitpid - wait for process to terminate SYNOPSIS
#include <sys/types.h> #include <sys/wait.h> pid_t wait(int *status) pid_t waitpid(pid_t pid, int *status, int options) DESCRIPTION
Wait causes its caller to delay until a signal is received or one of its child processes terminates. If any child has died since the last wait, return is immediate, returning the process id and exit status of one of the terminated children. If there are no children, return is immediate with the value -1 returned. On return from a successful wait call, status is nonzero, and the high byte of status contains the low byte of the argument to exit sup- plied by the child process; the low byte of status contains the termination status of the process. A more precise definition of the status word is given in <sys/wait.h>. If wait can called with a null pointer argument to indicate that no status need be returned. Waitpid provides an alternate interface for programs that must not block when collecting the status of child processes, or that wish to wait for one particular child. The pid parameter is the process ID of the child to wait for, -1 for any child. The status parameter is defined as above. The options parameter is used to indicate the call should not block if there are no processes that wish to report status (WNOHANG), and/or that children of the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, or SIGSTOP signal should also have their status reported (WUNTRACED). (Job control is not implemented for Minix, but these symbold and signals are.) When the WNOHANG option is specified and no processes wish to report status, waitpid returns -1 with errno set to EAGAIN. The WNOHANG and WUNTRACED options may be combined by or'ing the two values. NOTES
The call wait(&status) is equivalent to waitpid(-1, &status, 0). See sigaction(2) for a list of termination statuses (signals); 0 status indicates normal termination. A special status (0177) is returned for a stopped process that has not terminated and can be restarted; see ptrace(2). If the 0200 bit of the termination status is set, a core image of the process was produced by the system. If the parent process terminates without waiting on its children, the initialization process (process ID = 1) inherits the children. <sys/wait.h> defines a number of macros that operate on a status word: WIFEXITED(status) True if normal exit. WEXITSTATUS(status) Exit status if the process returned by a normal exit, zero otherwise. WTERMSIG(status) Signal number if the process died by a signal, zero otherwise. WIFSIGNALED(status) True if the process died by a signal. WIFSTOPPED(status) True if the process is stopped. (Never true under Minix.) WSTOPSIG(status) Signal number of the signal that stopped the process. RETURN VALUE
If wait returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and errno is set to indicate the error. Waitpid returns -1 if there are no children not previously waited for, if the process that it wants to wait for doesn't exist, or if WNO- HANG is specified and there are no stopped or exited children. ERRORS
Wait will fail and return immediately if one or more of the following are true: [ECHILD] The calling process has no existing unwaited-for child processes. [EFAULT] The status argument points to an illegal address. [EAGAIN] Waitpid is called with the WNOHANG option and no child has exited yet. SEE ALSO
execve(2), exit(2), sigaction(2). 4th Berkeley Distribution June 30, 1985 WAIT(2)
All times are GMT -4. The time now is 04:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy