xref: /linux/tools/testing/selftests/coredump/coredump_notify_signal.h (revision 018cf9bf786d501a27963dca6777f169f978e2a5)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef __COREDUMP_NOTIFY_SIGNAL_H
4 #define __COREDUMP_NOTIFY_SIGNAL_H
5 
6 #include <stdbool.h>
7 #include <sys/types.h>
8 
9 /*
10  * Define a bunch of constants we need. We create a situation where the
11  * NT_FILE note blows past 200K. That's way beyond the default 64K
12  * pipe ring and past the ~36K an af_unix skb holds. So we force a write
13  * to come back short.
14  */
15 #define NOTIFY_SIGNAL_MAP_COUNT		4000
16 #define NOTIFY_SIGNAL_ANON_BYTES	(4UL << 20)
17 #define NOTIFY_SIGNAL_STALL_US		200000
18 #define NOTIFY_SIGNAL_MAPFILE		"/tmp/coredump.notify_signal.mapfile"
19 #define NOTIFY_SIGNAL_TRIGGER		"/tmp/coredump.notify_signal.trigger"
20 #define NOTIFY_SIGNAL_CORE_FILE		"/tmp/coredump.notify_signal.core"
21 #define NOTIFY_SIGNAL_CORE_TMPFILE	"/tmp/coredump.notify_signal.core.tmp"
22 #define NOTIFY_SIGNAL_SOCKET		"/tmp/coredump.notify_signal.socket"
23 
24 void crashing_child_notify_signal(void);
25 bool coredump_io_uring_available(void);
26 ssize_t recv_coredump_notify_signal(int fd, int fd_out, bool arm);
27 long long coredump_expected_size(const char *path);
28 
29 #endif /* __COREDUMP_NOTIFY_SIGNAL_H */
30