Skip to content

Commit

Permalink
options/posix: define [sg]etrlimit64 as aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 committed Mar 30, 2024
1 parent b73637c commit b2a1b25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions options/posix/generic/sys-resource-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ int getrlimit(int resource, struct rlimit *limit) {
return 0;
}

[[gnu::alias("getrlimit")]] int getrlimit64(int resource, struct rlimit *limit);

int setrlimit(int resource, const struct rlimit *limit) {
MLIBC_CHECK_OR_ENOSYS(mlibc::sys_setrlimit, -1);
if(int e = mlibc::sys_setrlimit(resource, limit); e) {
Expand All @@ -51,6 +53,8 @@ int setrlimit(int resource, const struct rlimit *limit) {
return 0;
}

[[gnu::alias("setrlimit")]] int setrlimit64(int resource, const struct rlimit *limit);

int prlimit(pid_t, int, const struct rlimit *, struct rlimit *) {
__ensure(!"Not implemented");
__builtin_unreachable();
Expand Down
2 changes: 2 additions & 0 deletions options/posix/include/sys/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ int setpriority(int, id_t, int);

int getrusage(int, struct rusage *);
int getrlimit(int, struct rlimit *);
int getrlimit64(int, struct rlimit *);
int setrlimit(int, const struct rlimit *);
int setrlimit64(int, const struct rlimit *);

int prlimit(pid_t pid, int resource, const struct rlimit *new_limits, struct rlimit *old_limits);

Expand Down

0 comments on commit b2a1b25

Please sign in to comment.