2020-01-18 08:38:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
2022-01-31 22:14:49 +00:00
|
|
|
* Copyright (c) 2022, Lucas Chollet <lucas.chollet@free.fr>
|
2020-01-18 08:38:21 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2021-01-17 07:22:20 +00:00
|
|
|
#include <AK/Format.h>
|
2018-11-11 14:36:40 +00:00
|
|
|
#include <assert.h>
|
2020-04-05 16:10:57 +00:00
|
|
|
#include <sys/resource.h>
|
2022-01-31 22:14:49 +00:00
|
|
|
#include <syscall.h>
|
2020-05-04 08:41:31 +00:00
|
|
|
#include <ulimit.h>
|
2018-11-11 14:36:40 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
2020-12-20 23:09:48 +00:00
|
|
|
long ulimit([[maybe_unused]] int cmd, [[maybe_unused]] long newlimit)
|
2018-11-11 14:36:40 +00:00
|
|
|
{
|
2022-01-31 22:14:49 +00:00
|
|
|
dbgln("FIXME: Implement ulimit()");
|
2021-01-17 07:22:20 +00:00
|
|
|
TODO();
|
2019-09-29 19:02:13 +00:00
|
|
|
return -1;
|
2018-11-11 14:36:40 +00:00
|
|
|
}
|
2020-04-05 16:10:57 +00:00
|
|
|
|
2022-01-31 22:14:49 +00:00
|
|
|
// https://pubs.opengroup.org/onlinepubs/009696699/functions/getrusage.html
|
|
|
|
int getrusage(int who, struct rusage* usage)
|
2020-04-05 16:10:57 +00:00
|
|
|
{
|
2022-01-31 22:14:49 +00:00
|
|
|
int rc = syscall(SC_getrusage, who, usage);
|
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
2020-04-05 16:10:57 +00:00
|
|
|
}
|
2021-05-08 03:04:56 +00:00
|
|
|
|
|
|
|
int getrlimit([[maybe_unused]] int resource, rlimit* rl)
|
|
|
|
{
|
|
|
|
rl->rlim_cur = RLIM_INFINITY;
|
|
|
|
rl->rlim_max = RLIM_INFINITY;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int setrlimit([[maybe_unused]] int resource, [[maybe_unused]] rlimit const* rl)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2018-11-11 14:36:40 +00:00
|
|
|
}
|