summaryrefslogtreecommitdiff
path: root/src/getcwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/getcwd.c')
-rw-r--r--src/getcwd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/getcwd.c b/src/getcwd.c
new file mode 100644
index 000000000..7c6de9afb
--- /dev/null
+++ b/src/getcwd.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(getcwd)
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[0]);
+ else
+ printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+ }
+ return 0;
+}