1 /*
2 * Copyright (c) 2014-2021 The strace developers.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7
8 #include "defs.h"
9
10 SYS_FUNC(getcwd)
11 {
12 if (exiting(tcp)) {
13 /* buf */
14 if (syserror(tcp))
15 printaddr(tcp->u_arg[0]);
16 else
17 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
18 tprint_arg_next();
19
20 /* size */
21 PRINT_VAL_U(tcp->u_arg[1]);
22 }
23 return 0;
24 }