annotate liboctave/wrappers/wait-wrappers.c @ 29359:7854d5752dd2

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Feb 2021 10:10:40 -0500
parents abbab3ed2a5f 0a5b15007766
children 492a37a18b81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
3 // Copyright (C) 2016-2021 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 // These functions may be provided by gnulib. We don't include gnulib
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 // headers directly in Octave's C++ source files to avoid problems that
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 // may be caused by the way that gnulib overrides standard library
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 // functions.
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #if defined (HAVE_CONFIG_H)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 # include "config.h"
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #endif
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 #include <sys/types.h>
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include <sys/wait.h>
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37
28363
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
38 #if defined (__WIN32__) && ! defined (__CYGWIN__)
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
39 # include <windows.h>
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
40 #endif
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
41
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 #include "wait-wrappers.h"
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 #if ! defined (WCONTINUE)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 # define WCONTINUE 0
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 #endif
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 #if ! defined (WNOHANG)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 # define WNOHANG 0
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 #endif
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 #if ! defined (WUNTRACED)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 # define WUNTRACED 0
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 #endif
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
56 #if ! defined (WIFCONTINUED)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
57 # define WIFCONTINUED(x) false
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
58 #endif
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
59
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 pid_t
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 octave_waitpid_wrapper (pid_t pid, int *statusp, int options)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 {
22603
610f88ed2b78 avoid gnulib waitpid replacement for Windows systems (bug #49211)
John W. Eaton <jwe@octave.org>
parents: 22402
diff changeset
63 #if defined (__WIN32__) && ! defined (__CYGWIN__)
28363
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
64 // gnulib's waitpid replacement currently uses _cwait, which
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
65 // apparently only works with console applications.
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
66 // Implement our own wrapper using win32 API functions.
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
67
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
68 octave_unused_parameter (options);
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
69
28363
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
70 pid_t retval = -1;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
71 DWORD status = 0;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
72
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
73 HANDLE hProcess = OpenProcess (PROCESS_QUERY_INFORMATION | SYNCHRONIZE,
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
74 false, pid);
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
75
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
76 if (! hProcess)
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
77 return retval;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
78
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
79 if (WaitForSingleObject (hProcess, INFINITE) != WAIT_OBJECT_0)
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
80 {
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
81 CloseHandle (hProcess);
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
82 return retval;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
83 }
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
84
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
85 if (! GetExitCodeProcess (hProcess, &status))
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
86 {
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
87 CloseHandle (hProcess);
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
88 return retval;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
89 }
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
90
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
91 CloseHandle (hProcess);
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
92
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
93 if (statusp)
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
94 *statusp = status;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
95
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
96 retval = pid;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
97
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
98 return retval;
abbab3ed2a5f Implement wrapper for waitpid using win32 API functions (bug #49211).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27923
diff changeset
99
22603
610f88ed2b78 avoid gnulib waitpid replacement for Windows systems (bug #49211)
John W. Eaton <jwe@octave.org>
parents: 22402
diff changeset
100 #else
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 return waitpid (pid, statusp, options);
22603
610f88ed2b78 avoid gnulib waitpid replacement for Windows systems (bug #49211)
John W. Eaton <jwe@octave.org>
parents: 22402
diff changeset
102 #endif
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 int
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 octave_wcontinue_wrapper (void)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 return WCONTINUE;
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 int
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
112 octave_wnohang_wrapper (void)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
113 {
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
114 return WNOHANG;
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
115 }
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
116
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
117 int
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
118 octave_wuntraced_wrapper (void)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
119 {
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
120 return WUNTRACED;
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
121 }
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
122
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
123 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
124 // Disable the unused parameter warning for the following wrapper functions.
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
125 // The <sys/wait.h> header provided by gnulib may define some of the W*
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
126 // macros to expand to a constant and ignore the parameter.
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
127 #pragma GCC diagnostic push
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
128 #pragma GCC diagnostic ignored "-Wunused-parameter"
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
129 #endif
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
130
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
131 int
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 octave_wcoredump_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 return WCOREDUMP (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
137 int
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
138 octave_wexitstatus_wrapper (int status)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
139 {
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
140 return WEXITSTATUS (status);
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
141 }
21949
baeffde5c87d fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
142
21921
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 bool
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 octave_wifcontinued_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 return WIFCONTINUED (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 bool
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150 octave_wifexited_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 return WIFEXITED (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 bool
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 octave_wifsignaled_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 return WIFSIGNALED (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 bool
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 octave_wifstopped_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 return WIFSTOPPED (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 int
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 octave_wstopsig_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 return WSTOPSIG (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 int
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 octave_wtermsig_wrapper (int status)
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175 {
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 return WTERMSIG (status);
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 }
ecfcc8527661 hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178
24118
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
179 #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
180 // Restore prevailing warning state for remainder of the file.
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
181 #pragma GCC diagnostic pop
f87c9f5c0f43 maint: silence several compiler warnings when building for Windows
Mike Miller <mtmiller@octave.org>
parents: 23220
diff changeset
182 #endif