1 /*
2 * This file is part of attach-f-p strace test.
3 *
4 * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
5 * Copyright (c) 2016-2021 The strace developers.
6 * All rights reserved.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11 #include "tests.h"
12 #include <stdio.h>
13 #include <unistd.h>
14
15 int
16 main(void)
17 {
18 skip_if_unavailable("/proc/self/task/");
19
20 static const char dir[] = "attach-f-p.test cmd";
21 pid_t pid = getpid();
22 int rc = chdir(dir);
23
24 printf("%-5d chdir(\"%s\") = %s\n"
25 "%-5d +++ exited with 0 +++\n",
26 pid, dir, sprintrc(rc), pid);
27
28 return 0;
29 }