summaryrefslogtreecommitdiff
path: root/Ports/oksh/patches/disable_rlimit.patch
blob: bc8aa79ef42507e00dc0ec957d677f1e0d8f6ef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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);
-	}
+	}*/
 }