Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

26.7 Process Completion Status

If the exit status value (see Program Termination) of the child process is zero, then the status value reported by waitpid or wait is also zero. You can test for other kinds of information encoded in the returned status value using the following macros. These macros are defined in the header file sys/wait.h.

— Macro: int WIFEXITED (int status)

This macro returns a nonzero value if the child process terminated normally with exit or _exit.

— Macro: int WEXITSTATUS (int status)

If WIFEXITED is true of status, this macro returns the low-order 8 bits of the exit status value from the child process. See Exit Status.

— Macro: int WIFSIGNALED (int status)

This macro returns a nonzero value if the child process terminated because it received a signal that was not handled. See Signal Handling.

— Macro: int WTERMSIG (int status)

If WIFSIGNALED is true of status, this macro returns the signal number of the signal that terminated the child process.

— Macro: int WCOREDUMP (int status)

This macro returns a nonzero value if the child process terminated and produced a core dump.

— Macro: int WIFSTOPPED (int status)

This macro returns a nonzero value if the child process is stopped.

— Macro: int WSTOPSIG (int status)

If WIFSTOPPED is true of status, this macro returns the signal number of the signal that caused the child process to stop.


 
 
  Published under the terms of the GNU General Public License Design by Interspire