mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:47:35 +00:00
bt: Port to LibMain :^)
This commit is contained in:
parent
951d8a06d8
commit
f25466ae08
2 changed files with 8 additions and 13 deletions
|
@ -57,7 +57,7 @@ target_link_libraries(arp LibMain)
|
||||||
target_link_libraries(asctl LibAudio LibMain)
|
target_link_libraries(asctl LibAudio LibMain)
|
||||||
target_link_libraries(base64 LibMain)
|
target_link_libraries(base64 LibMain)
|
||||||
target_link_libraries(basename LibMain)
|
target_link_libraries(basename LibMain)
|
||||||
target_link_libraries(bt LibSymbolication)
|
target_link_libraries(bt LibSymbolication LibMain)
|
||||||
target_link_libraries(blockdev LibMain)
|
target_link_libraries(blockdev LibMain)
|
||||||
target_link_libraries(cat LibMain)
|
target_link_libraries(cat LibMain)
|
||||||
target_link_libraries(checksum LibCrypto)
|
target_link_libraries(checksum LibCrypto)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2021, Kenneth Myhra <kennethmyhra@gmail.com>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -9,26 +10,20 @@
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DirIterator.h>
|
#include <LibCore/DirIterator.h>
|
||||||
#include <LibCore/EventLoop.h>
|
#include <LibCore/EventLoop.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/System.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <LibSymbolication/Symbolication.h>
|
#include <LibSymbolication/Symbolication.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
if (pledge("stdio rpath", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||||
perror("pledge");
|
auto hostname = TRY(Core::System::gethostname());
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
char hostname[256];
|
|
||||||
if (gethostname(hostname, sizeof(hostname)) < 0) {
|
|
||||||
perror("gethostname");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
args_parser.add_positional_argument(pid, "PID", "pid");
|
args_parser.add_positional_argument(pid, "PID", "pid");
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(arguments);
|
||||||
Core::EventLoop loop;
|
Core::EventLoop loop;
|
||||||
|
|
||||||
Core::DirIterator iterator(String::formatted("/proc/{}/stacks", pid), Core::DirIterator::SkipDots);
|
Core::DirIterator iterator(String::formatted("/proc/{}/stacks", pid), Core::DirIterator::SkipDots);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue