syswait.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1996-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_syswait_h)
00024 #define octave_syswait_h 1
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 /* This mess suggested by the autoconf manual.  */
00031 
00032 #include <sys/types.h>
00033 
00034 #if defined HAVE_SYS_WAIT_H
00035 #include <sys/wait.h>
00036 #endif
00037 
00038 #ifndef WIFEXITED
00039 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
00040 #endif
00041 
00042 #ifndef WEXITSTATUS
00043 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
00044 #endif
00045 
00046 #ifndef WIFSIGNALLED
00047 #define WIFSIGNALLED(stat_val) \
00048   (((stat_val) & 0177) != 0177 && ((stat_val) & 0177) != 0)
00049 #endif
00050 
00051 #if defined (__MINGW32__) || defined (_MSC_VER)
00052 #define HAVE_WAITPID 1
00053 #include <process.h>
00054 #define WAITPID(a, b, c) _cwait (b, a, c)
00055 /* Action argument is ignored for _cwait, so arbitrary definition.  */
00056 #define WNOHANG 0
00057 #else
00058 #define WAITPID(a, b, c) waitpid (a, b, c)
00059 #endif
00060 
00061 #ifdef __cplusplus
00062 }
00063 #endif
00064 
00065 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines