aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-03-01 23:50:23 -0600
committerRob Landley <rob@landley.net>2016-03-01 23:50:23 -0600
commit323819c689448fffcf4d3ed20f2485b75ac64b64 (patch)
tree0d4e1aa9c466fef1d067d05364c6d4ee46d9d6df
parentdfc44f12d7de952a5aec0c7a4141b609d18cd034 (diff)
downloadtoybox-323819c689448fffcf4d3ed20f2485b75ac64b64.tar.gz
The last-ever release of uClibc hasn't got prlimit, so probe.
-rwxr-xr-xscripts/genconfig.sh7
-rw-r--r--toys/posix/ulimit.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index 5b0715f4..5e7d1df2 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -90,6 +90,13 @@ EOF
int main(int argc, char *argv[]) { return fork(); }
EOF
echo -e '\tdepends on !TOYBOX_MUSL_NOMMU_IS_BROKEN'
+
+ probesymbol TOYBOX_PRLIMIT << EOF
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+ int main(int argc, char *argv[]) { prlimit(0, 0, 0, 0); }
+EOF
}
genconfig()
diff --git a/toys/posix/ulimit.c b/toys/posix/ulimit.c
index b14cd933..b4d8e946 100644
--- a/toys/posix/ulimit.c
+++ b/toys/posix/ulimit.c
@@ -21,6 +21,7 @@ USE_ULIMIT(NEWTOY(ulimit, ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]",
config ULIMIT
bool "ulimit"
default y
+ depends on TOYBOX_PRLIMIT
help
usage: ulimit [-P PID] [-SHRacdefilmnpqrstuv] [LIMIT]