diff options
Diffstat (limited to 'tools/perf/config/feature-checks/test-on-exit.c')
-rw-r--r-- | tools/perf/config/feature-checks/test-on-exit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/config/feature-checks/test-on-exit.c b/tools/perf/config/feature-checks/test-on-exit.c new file mode 100644 index 000000000000..8e88b16e6ded --- /dev/null +++ b/tools/perf/config/feature-checks/test-on-exit.c | |||
@@ -0,0 +1,16 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | static void exit_fn(int status, void *__data) | ||
5 | { | ||
6 | printf("exit status: %d, data: %d\n", status, *(int *)__data); | ||
7 | } | ||
8 | |||
9 | static int data = 123; | ||
10 | |||
11 | int main(void) | ||
12 | { | ||
13 | on_exit(exit_fn, &data); | ||
14 | |||
15 | return 321; | ||
16 | } | ||