]> granicus.if.org Git - strace/blob - tests/umovestr3.c
strace: terminate itself if interrupted by a signal
[strace] / tests / umovestr3.c
1 /*
2  * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
3  * Copyright (c) 2016-2018 The strace developers.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8
9 #include "tests.h"
10 #include <limits.h>
11 #include <stdio.h>
12 #include <unistd.h>
13
14 int
15 main(void)
16 {
17         const unsigned int size = PATH_MAX - 1;
18         const char *p = tail_alloc(size);
19         const char *const efault = p + size;
20
21         for (; p <= efault; ++p) {
22                 int rc = chdir(p);
23                 printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name());
24         }
25
26         puts("+++ exited with 0 +++");
27         return 0;
28 }