mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 04:50:29 +00:00
LibC: Add stubs for getrlimit()/setrlimit()
This commit is contained in:
parent
6e80b9fd01
commit
1c3c072a76
Notes:
sideshowbarker
2024-07-18 18:29:57 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/1c3c072a76d Pull-request: https://github.com/SerenityOS/serenity/pull/6959
2 changed files with 31 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
@ -35,4 +36,22 @@ struct rusage {
|
|||
|
||||
int getrusage(int who, struct rusage* usage);
|
||||
|
||||
#define RLIMIT_CORE 1
|
||||
#define RLIMIT_CPU 2
|
||||
#define RLIMIT_DATA 3
|
||||
#define RLIMIT_FSIZE 4
|
||||
#define RLIMIT_NOFILE 5
|
||||
#define RLIMIT_STACK 6
|
||||
#define RLIMIT_AS 7
|
||||
|
||||
#define RLIM_INFINITY SIZE_MAX
|
||||
|
||||
struct rlimit {
|
||||
size_t rlim_cur;
|
||||
size_t rlim_max;
|
||||
};
|
||||
|
||||
int getrlimit(int, struct rlimit*);
|
||||
int setrlimit(int, struct rlimit const*);
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
@ -23,4 +23,16 @@ int getrusage([[maybe_unused]] int who, [[maybe_unused]] struct rusage* usage)
|
|||
dbgln("FIXME: Implement getrusage()");
|
||||
return -1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue