From owner-p4-projects@FreeBSD.ORG Mon Jul 5 21:46:09 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9B6871065747; Mon, 5 Jul 2010 21:46:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6012C1065745 for ; Mon, 5 Jul 2010 21:46:09 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5D28FC16 for ; Mon, 5 Jul 2010 21:46:09 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o65Lk9Uk080231 for ; Mon, 5 Jul 2010 21:46:09 GMT (envelope-from kibab@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o65Lk9AJ080229 for perforce@freebsd.org; Mon, 5 Jul 2010 21:46:09 GMT (envelope-from kibab@FreeBSD.org) Date: Mon, 5 Jul 2010 21:46:09 GMT Message-Id: <201007052146.o65Lk9AJ080229@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 180508 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 21:46:09 -0000 http://p4web.freebsd.org/@@180508?ac=10 Change 180508 by kibab@kibab_kibab-nb on 2010/07/05 21:45:35 Finish IFC. Affected files ... .. //depot/projects/soc2010/kibab_sysctlreg/src_lib_libc/gen/feature_present.c#2 edit .. //depot/projects/soc2010/kibab_sysctlreg/src_sys/arm/include/bootinfo.h#2 integrate Differences ... ==== //depot/projects/soc2010/kibab_sysctlreg/src_lib_libc/gen/feature_present.c#2 (text+ko) ==== @@ -29,13 +29,34 @@ */ #include -__FBSDID("$FreeBSD: head/lib/libc/gen/feature_present.c 175220 2008-01-10 22:11:21Z jhb $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/feature_present.c,v 1.1 2008/01/10 22:11:21 jhb Exp $"); #include #include #include #include +#include + +/* + * Helper function to test if the named feature is disabled + * by the environment variable FEATURES_DISABLE. + * Returns true if the feature is disabled. + */ +static int +is_feature_disabled(const char *str_to_test) { + char *token, *dis_features; + + dis_features = getenv("FEATURES_DISABLE"); + if(!dis_features) + return (0); + while ((token = strsep(&dis_features, " ")) != NULL) { + if (strcmp(token, str_to_test)==0) + return (1); + } + return (0); +} + /* * Returns true if the named feature is present in the currently * running kernel. A feature's presence is indicated by an integer @@ -48,6 +69,8 @@ size_t len; int i; + if (is_feature_disabled((feature))) + return (0); if (asprintf(&mib, "kern.features.%s", feature) < 0) return (0); len = sizeof(i); @@ -60,3 +83,4 @@ return (0); return (i != 0); } + ==== //depot/projects/soc2010/kibab_sysctlreg/src_sys/arm/include/bootinfo.h#2 (text+ko) ====