1996-08-20 23:46:10 +00:00
|
|
|
/* wait.h -- POSIX macros for evaluating exit statuses
|
|
|
|
Copyright (C) 1990 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
1997-05-15 22:46:24 +00:00
|
|
|
GNU General Public License for more details. */
|
1996-08-20 23:46:10 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
|
|
|
#include <sys/types.h> /* For pid_t. */
|
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
#include <sys/resource.h> /* for rusage */
|
|
|
|
#endif
|
|
|
|
#include <sys/wait.h>
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
|
|
|
#ifndef WIFSTOPPED
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
|
|
|
#ifndef WIFSIGNALED
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WIFSIGNALED(w) (((w) & 0xff) != 0x7f && ((w) & 0xff) != 0)
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
|
|
|
#ifndef WIFEXITED
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WIFEXITED(w) (((w) & 0xff) == 0)
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
2004-04-15 01:01:56 +00:00
|
|
|
#ifndef WCOREDUMP /* not POSIX, but common and useful */
|
|
|
|
#define WCOREDUMP(w) (((w) & 0x80) != 0)
|
|
|
|
#endif
|
1996-08-20 23:46:10 +00:00
|
|
|
|
1997-05-15 22:46:24 +00:00
|
|
|
#ifndef WSTOPSIG
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WSTOPSIG(w) (((w) >> 8) & 0xff)
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
|
|
|
#ifndef WTERMSIG
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WTERMSIG(w) ((w) & 0x7f)
|
1997-05-15 22:46:24 +00:00
|
|
|
#endif
|
|
|
|
#ifndef WEXITSTATUS
|
1996-08-20 23:46:10 +00:00
|
|
|
#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
|
|
|
|
#endif
|