diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt index aab4d8aa9b8..42d97043559 100644 --- a/Userland/Libraries/LibC/CMakeLists.txt +++ b/Userland/Libraries/LibC/CMakeLists.txt @@ -22,6 +22,7 @@ set(LIBC_SOURCES net.cpp netdb.cpp poll.cpp + priority.cpp pthread_forward.cpp pthread_integration.cpp pthread_tls.cpp diff --git a/Userland/Libraries/LibC/priority.cpp b/Userland/Libraries/LibC/priority.cpp new file mode 100644 index 00000000000..05b97c731a8 --- /dev/null +++ b/Userland/Libraries/LibC/priority.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +extern "C" { + +int getpriority([[maybe_unused]] int which, [[maybe_unused]] id_t who) +{ + dbgln("FIXME: Implement getpriority()"); + return -1; +} + +int setpriority([[maybe_unused]] int which, [[maybe_unused]] id_t who, [[maybe_unused]] int value) +{ + dbgln("FIXME: Implement setpriority()"); + return -1; +} +} diff --git a/Userland/Libraries/LibC/sys/resource.h b/Userland/Libraries/LibC/sys/resource.h index 488b0de6d6c..7d3f265396d 100644 --- a/Userland/Libraries/LibC/sys/resource.h +++ b/Userland/Libraries/LibC/sys/resource.h @@ -58,4 +58,11 @@ struct rlimit { int getrlimit(int, struct rlimit*); int setrlimit(int, struct rlimit const*); +#define PRIO_PROCESS 0 +#define PRIO_PGRP 1 +#define PRIO_USER 2 + +int getpriority(int, id_t); +int setpriority(int, id_t, int); + __END_DECLS