serenity/Ports/oksh/patches/0004-Disable-rlimit.patch

81 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Manuel Palenzuela <manuelpalenzuelamerino@gmail.com>
Date: Mon, 5 Apr 2021 22:58:01 +0200
Subject: [PATCH] Disable rlimit
Serenity does not have rlimit support.
---
c_ulimit.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/c_ulimit.c b/c_ulimit.c
index 65e0cca..587f08a 100644
--- a/c_ulimit.c
+++ b/c_ulimit.c
@@ -45,15 +45,15 @@ c_ulimit(char **wp)
{
static const struct limits limits[] = {
/* Do not use options -H, -S or -a or change the order. */
- { "time(cpu-seconds)", RLIMIT_CPU, 1, 't' },
- { "file(blocks)", RLIMIT_FSIZE, 512, 'f' },
- { "coredump(blocks)", RLIMIT_CORE, 512, 'c' },
- { "data(kbytes)", RLIMIT_DATA, 1024, 'd' },
- { "stack(kbytes)", RLIMIT_STACK, 1024, 's' },
- { "lockedmem(kbytes)", RLIMIT_MEMLOCK, 1024, 'l' },
- { "memory(kbytes)", RLIMIT_RSS, 1024, 'm' },
- { "nofiles(descriptors)", RLIMIT_NOFILE, 1, 'n' },
- { "processes", RLIMIT_NPROC, 1, 'p' },
+ { "time(cpu-seconds)", 1, 1, 't' },
+ { "file(blocks)", 512, 512, 'f' },
+ { "coredump(blocks)", 512, 512, 'c' },
+ { "data(kbytes)", 1024, 1024, 'd' },
+ { "stack(kbytes)", 1024, 1024, 's' },
+ { "lockedmem(kbytes)", 1024, 1024, 'l' },
+ { "memory(kbytes)", 1024, 1024, 'm' },
+ { "nofiles(descriptors)", 1, 1, 'n' },
+ { "processes", 1, 1, 'p' },
{ NULL }
};
const char *options = "HSat#f#c#d#s#l#m#n#p#";
@@ -133,7 +133,7 @@ c_ulimit(char **wp)
static int
set_ulimit(const struct limits *l, const char *v, int how)
-{
+{/*
rlim_t val = 0;
struct rlimit limit;
@@ -150,7 +150,7 @@ set_ulimit(const struct limits *l, const char *v, int how)
* If this causes problems, will have to add parameter to
* evaluate() to control if unset params are 0 or an error.
*/
- if (!rval && !digit(v[0])) {
+/* if (!rval && !digit(v[0])) {
bi_errorf("invalid limit: %s", v);
return 1;
}
@@ -169,13 +169,13 @@ set_ulimit(const struct limits *l, const char *v, int how)
bi_errorf("bad -%c limit: %s", l->option,
strerror(errno));
return 1;
- }
+ }*/
return 0;
}
static void
print_ulimit(const struct limits *l, int how)
-{
+{/*
rlim_t val = 0;
struct rlimit limit;
@@ -189,5 +189,5 @@ print_ulimit(const struct limits *l, int how)
else {
val /= l->factor;
shprintf("%" PRIi64 "\n", (int64_t) val);
- }
+ }*/
}