-
Notifications
You must be signed in to change notification settings - Fork 3
/
systype_compat.h
27 lines (20 loc) · 814 Bytes
/
systype_compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/*
* Copyright (C) 2023 The Falco Authors.
*
* This file is dual licensed under either the MIT or GPL 2. See MIT.txt
* or GPL2.txt for full copies of the license.
*/
#ifndef __SYSTYPE_COMPACT_H__
#define __SYSTYPE_COMPACT_H__
/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
#define __WEXITSTATUS(status) (((status)&0xff00) >> 8)
/* If WIFSIGNALED(STATUS), the terminating signal. */
#define __WTERMSIG(status) ((status)&0x7f)
/* Nonzero if STATUS indicates termination by a signal. */
#define __WIFSIGNALED(status) \
(((signed char)(((status)&0x7f) + 1) >> 1) > 0)
/* Nonzero if STATUS indicates the child dumped core. */
#define __WCOREDUMP(status) ((status)&__WCOREFLAG)
#define __WCOREFLAG 0x80
#endif /* __SYSTYPE_COMPACT_H__ */