mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:08:11 +00:00
disk_benchmark: Port to LibMain
This commit is contained in:
parent
0a9e84aff0
commit
1db7c423db
2 changed files with 4 additions and 2 deletions
|
@ -90,6 +90,7 @@ target_link_libraries(df LibMain)
|
||||||
target_link_libraries(diff LibDiff LibMain)
|
target_link_libraries(diff LibDiff LibMain)
|
||||||
target_link_libraries(dirname LibMain)
|
target_link_libraries(dirname LibMain)
|
||||||
target_link_libraries(disasm LibX86 LibMain)
|
target_link_libraries(disasm LibX86 LibMain)
|
||||||
|
target_link_libraries(disk_benchmark LibMain)
|
||||||
target_link_libraries(dmesg LibMain)
|
target_link_libraries(dmesg LibMain)
|
||||||
target_link_libraries(du LibMain)
|
target_link_libraries(du LibMain)
|
||||||
target_link_libraries(echo LibMain)
|
target_link_libraries(echo LibMain)
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibCore/ElapsedTimer.h>
|
#include <LibCore/ElapsedTimer.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <stdio.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);
|
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 = ".";
|
String directory = ".";
|
||||||
int time_per_benchmark = 10;
|
int time_per_benchmark = 10;
|
||||||
|
@ -54,7 +55,7 @@ int main(int argc, char** argv)
|
||||||
bool allow_cache = false;
|
bool allow_cache = false;
|
||||||
|
|
||||||
int opt;
|
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) {
|
switch (opt) {
|
||||||
case 'h':
|
case 'h':
|
||||||
exit_with_usage(0);
|
exit_with_usage(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue