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 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/config/feature-checks/test-on-exit.c b/tools/perf/config/feature-checks/test-on-exit.c index 473f1dea531..8f64ed3a58d 100644 --- a/tools/perf/config/feature-checks/test-on-exit.c +++ b/tools/perf/config/feature-checks/test-on-exit.c @@ -1,6 +1,15 @@ #include <stdio.h> +static void exit_fn(int status, void *__data) +{ + printf("exit status: %d, data: %d\n", status, *(int *)__data); +} + +static int data = 123; + int main(void) { - return on_exit(NULL, NULL); + on_exit(exit_fn, &data); + + return 321; } |