Skip to content

Commit 28012e1

Browse files
committed
osdep: add wait.h compat macros
Man page for WCOREDUMP says: WCOREDUMP(wstatus) returns true if the child produced a core dump. This macro should be employed only if WIFSIGNALED returned true. This macro is not specified in POSIX.1-2001 and is not available on some UNIX implementations (e.g., AIX, SunOS). Therefore, enclose its use inside #ifdef WCOREDUMP ... #endif. Let's do exactly this. Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent e3af292 commit 28012e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/qemu/osdep.h

+10
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ extern int daemon(int, int);
107107
#include "glib-compat.h"
108108
#include "qemu/typedefs.h"
109109

110+
/*
111+
* According to waitpid man page:
112+
* WCOREDUMP
113+
* This macro is not specified in POSIX.1-2001 and is not
114+
* available on some UNIX implementations (e.g., AIX, SunOS).
115+
* Therefore, enclose its use inside #ifdef WCOREDUMP ... #endif.
116+
*/
117+
#ifndef WCOREDUMP
118+
#define WCOREDUMP(status) 0
119+
#endif
110120
/*
111121
* We have a lot of unaudited code that may fail in strange ways, or
112122
* even be a security risk during migration, if you disable assertions

0 commit comments

Comments
 (0)