aboutsummaryrefslogtreecommitdiff
path: root/scripts/genconfig.sh
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-03-19 20:15:08 -0500
committerRob Landley <rob@landley.net>2012-03-19 20:15:08 -0500
commitf9fdd3c2ffe6cb4e1450cfcedad66a1e69f90bb6 (patch)
treed1092268757e76ea3c289e73c7c6883bda89fb03 /scripts/genconfig.sh
parent05744b3176828c25f6e2cc2d663615252b4cd02f (diff)
downloadtoybox-f9fdd3c2ffe6cb4e1450cfcedad66a1e69f90bb6.tar.gz
Have probe for unshare test for actual unshare() function in libc.
Diffstat (limited to 'scripts/genconfig.sh')
-rwxr-xr-xscripts/genconfig.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index f6779548..2334d8a9 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -13,13 +13,17 @@ probeconfig()
# Probe for container support on target
echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" || return 1
- ${CROSS_COMPILE}${CC} -c -xc -o /dev/null - 2>/dev/null << EOF
+ ${CROSS_COMPILE}${CC} -xc -o /dev/null - 2>/dev/null << EOF
#include <linux/sched.h>
int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET;
+
+ int main(int argc, char *argv[]) { return unshare(x); }
EOF
[ $? -eq 0 ] && DEFAULT=y || DEFAULT=n
+ rm a.out 2>/dev/null
echo -e "\tdefault $DEFAULT\n" || return 1
}
+
genconfig()
{
# extract config stanzas from each command source file, in alphabetical order