1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:34:59 +00:00

disk_benchmark: Port to LibMain

This commit is contained in:
Nicholas Cellino 2022-03-21 21:13:47 -04:00 committed by Andreas Kling
parent 0a9e84aff0
commit 1db7c423db
2 changed files with 4 additions and 2 deletions

View file

@ -90,6 +90,7 @@ target_link_libraries(df LibMain)
target_link_libraries(diff LibDiff LibMain)
target_link_libraries(dirname LibMain)
target_link_libraries(disasm LibX86 LibMain)
target_link_libraries(disk_benchmark LibMain)
target_link_libraries(dmesg LibMain)
target_link_libraries(du LibMain)
target_link_libraries(echo LibMain)

View file

@ -10,6 +10,7 @@
#include <AK/Types.h>
#include <AK/Vector.h>
#include <LibCore/ElapsedTimer.h>
#include <LibMain/Main.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
@ -45,7 +46,7 @@ static void exit_with_usage(int rc)
static Optional<Result> benchmark(const String& filename, int file_size, int block_size, ByteBuffer& buffer, bool allow_cache);
int main(int argc, char** argv)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
String directory = ".";
int time_per_benchmark = 10;
@ -54,7 +55,7 @@ int main(int argc, char** argv)
bool allow_cache = false;
int opt;
while ((opt = getopt(argc, argv, "chd:t:f:b:")) != -1) {
while ((opt = getopt(arguments.argc, arguments.argv, "chd:t:f:b:")) != -1) {
switch (opt) {
case 'h':
exit_with_usage(0);