diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/pwd.cpp | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 8a1677b4dc..8916ec32b0 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -125,6 +125,7 @@ target_link_libraries(pls LibCrypt) target_link_libraries(pmap LibMain) target_link_libraries(pro LibProtocol) target_link_libraries(ps LibMain) +target_link_libraries(pwd LibMain) target_link_libraries(run-tests LibRegex) target_link_libraries(shot LibGUI) target_link_libraries(sql LibLine LibSQL LibIPC) diff --git a/Userland/Utilities/pwd.cpp b/Userland/Utilities/pwd.cpp index 43fa05c8b1..358b095c45 100644 --- a/Userland/Utilities/pwd.cpp +++ b/Userland/Utilities/pwd.cpp @@ -4,14 +4,14 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> +#include <AK/Format.h> +#include <AK/String.h> +#include <LibCore/System.h> +#include <LibMain/Main.h> -int main(int, char**) +ErrorOr<int> serenity_main(Main::Arguments) { - char* cwd = getcwd(nullptr, 0); - puts(cwd); - free(cwd); + TRY(Core::System::pledge("stdio")); + outln(TRY(Core::System::getcwd())); return 0; } |