1#include <stdio.h>
2
3#ifdef _MSC_VER
4#define _CRT_NONSTDC_NO_WARNINGS
5#include <direct.h>
6#undef getcwd
7#define getcwd(buffer, length) _getcwd(buffer, length)
8#else
9#include <unistd.h>
10#endif
11
12int
13main (int argc, char **argv)
14{
15 char buffer[1024];
16
17 fprintf(stdout, format: "stdout: %s\n", getcwd(buf: buffer, size: 1024));
18 fprintf(stderr, format: "stderr: %s\n", getcwd(buf: buffer, size: 1024));
19
20 return 0;
21}
22

source code of lldb/test/API/commands/process/launch/print_cwd.cpp