linux/kernel/configs.c
<<
hidden" nam> navtarget" > "> text" nam> search" id search"> submit">Search hidden" nam> ajax_lookup" id ajax_lookup" > ">u .div id file_contents"l
 L1">2 21./a>.spaa class="comment">/*./spaalu
 L2">2 22./a>.spaa class="comment"> * kernel/configs.c./spaalu
 L3">2 23./a>.spaa class="comment"> * Echo the kernel .config file used to build the kernel./spaalu
 L4">2 24./a>.spaa class="comment"> *./spaalu
 L5">2 25./a>.spaa class="comment"> * Copyright (C) 2002 Khalid Aziz <khalid_aziz@hp.com>./spaalu
 L6">2 26./a>.spaa class="comment"> * Copyright (C) 2002 Randy Dunlap <rdunlap@xenotime.net>./spaalu
 L7">2 27./a>.spaa class="comment"> * Copyright (C) 2002 Al St.1e <ahs3@fc.hp.com>./spaalu
 L8">2 28./a>.spaa class="comment"> * Copyright (C) 2002 Hewlett-Packard Compaay./spaalu
 L9">2 29./a>.spaa class="comment"> *./spaalu
 L10">2 .spaa class="comment"> * This program is free software; you caa redistribute it and/or modify./spaalu
 L11">2 11./a>.spaa class="comment"> * it under the terms of the GNU General Public License as published by./spaalu
 L12">2 12./a>.spaa class="comment"> * the Free Software Foundan va; either vers2.1"2 of the License, or (at./spaalu
 L13">2 13./a>.spaa class="comment"> * your ion va) any later vers2.1../spaalu
 L14">2 14./a>.spaa class="comment"> *./spaalu
 L15">2 15./a>.spaa class="comment"> * This program is distributed in the hope that it will be useful, but./spaalu
 L16">2 16./a>.spaa class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of./spaalu
 L17">2 17./a>.spaa class="comment"> * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or./spaalu
 L18">2 18./a>.spaa class="comment"> * NON INFRINGEMENT.  See the GNU General Public License for more./spaalu
 L19">2 19./a>.spaa class="comment"> * details../spaalu
 L20">2 2opta>.spaa class="comment"> *./spaalu
 L21">2 21./a>.spaa class="comment"> * You should have received a copy of the GNU General Public License./spaalu
 L22">2 22./a>.spaa class="comment"> * along with this program; if not, write to the Free Software./spaalu
 L23">2 23./a>.spaa class="comment"> * Foundan va, Inc., 675 Mass Ave, Cambridge, MA 02139, USA../spaalu
 L24">2 24./a>.spaa class="comment"> */./spaalu
 L25">2 25./a>u
 L26">2 26./a>#include <linux/kernel.h./a>>u
 L27">2 27./a>#include <linux/module.h./a>>u
 L28">2 28./a>#include <linux/proc_fs.h./a>>u
 L29">2 29./a>#include <linux/seq_file.h./a>>u
 L30">2 30./a>#include <linux/init.h./a>>u
 L31">2 31./a>#include <asm/uaccess.h./a>>u
 L32">2 32./a>u
 L33">2 33./a>.spaa class="comment">/**************************************************/./spaalu
 L34">2 34./a>.spaa class="comment">/* the actual current config file                 */./spaalu
 L35">2 35./a>u
 L36">2 36./a>.spaa class="comment">/*./spaalu
 L37">2 37./a>.spaa class="comment"> * Define kernel_config_dana and kernel_config_dana_size, which contains the./spaalu
 L38">2 38./a>.spaa class="comment"> * wrapped and compressed configuran va file.  The file is first compressed./spaalu
 L39">2 39./a>.spaa class="comment"> * with gzip and then bounded by two eight byte magic numbers to allow./spaalu
 L40">2 4opta>.spaa class="comment"> * extracn va from a binary kernel image:./spaalu
 L41">2 41./a>.spaa class="comment"> *./spaalu
 L42">2 42./a>.spaa class="comment"> *   IKCFG_ST./spaalu
 L43">2 43./a>.spaa class="comment"> *   <image>./spaalu
 L44">2 44./a>.spaa class="comment"> *   IKCFG_ED./spaalu
 L45">2 45./a>.spaa class="comment"> */./spaalu
 L46">2 46./a>#define MAGIC_START./a>pv2 2.spaa class="string">"IKCFG_ST"./spaalu
 L47">2 47./a>#define MAGIC_END./a>pv2 2 2.spaa class="string">"IKCFG_ED"./spaalu
 L48">2 48./a>#include ".a href="include/config_dana.h" class="fref">config_dana.h./a>"u
 L49">2 49./a>u
 L50">2 50./a>u
 L51">2 51./a>#define MAGIC_SIZE./a>p(sizeof(MAGIC_START./a>) - 1)u
 L52">2 52./a>#define kernel_config_dana_size./a>p\u
 L53">2 53./a>pv2 2 2p(sizeof(kernel_config_dana./a>) - 1 - MAGIC_SIZE./a>p* 2)u
 L54">2 54./a>u
 L55">2 55./a>#ifdef CONFIG_IKCONFIG_PROC./a>u
 L56">2 56./a>u
 L57">2 57./a>static ssize_t./a>u
 L58">2 58./a>.a href="+code=ikconfig_read_current" class="sref">ikconfig_read_current./a>(struct file./a>p*file./a>, char __user./a>p*buf./a>,u
 L59">2 59./a>pv2 2 2pppppppppppppppsize_t./a>plen./a>, loff_t./a>p* offset./a>)u
 L60">2 60./a>{u
 L61">2 61./a>pv2 2 2preturn simple_read_from_buffer./a>(buf./a>,plen./a>, offset./a>,u
 L62">2 62./a>pv2 2 2ppppppppppppppp 2pppppppppppppppkernel_config_dana./a> + MAGIC_SIZE./a>,u
 L63">2 63./a>pv2 2 2ppppppppppppppp 2pppppppppppppppkernel_config_dana_size./a>);u
 L64">2 64./a>}u
 L65">2 65./a>u
 L66">2 66./a>static const struct file_operan vas./a>pikconfig_file_ops./a>p= {u
 L67">2 67./a>pv2 2 2p.owner./a>p= THIS_MODULE./a>,u
 L68">2 68./a>pv2 2 2p.read./a>p= ikconfig_read_current./a>,u
 L69">2 69./a>pv2 2 2p.llseek./a>p= default_llseek./a>,u
 L70">2 70./a>};u
 L71">2 71./a>u
 L72">2 72./a>static int __init./a>pikconfig_init./a>(void)u
 L73">2 73./a>{u
 L74">2 74./a>pv2 2 2pstruct proc_dir_entry./a>p*entry./a>;u
 L75">2 75./a>u
 L76">2 76./a>pv2 2 2p.spaa class="comment">/* create the current config file */./spaalu
 L77">2 77./a>pv2 2 2pentry./a>p= proc_create./a>("config.gz"./spaal, S_IFREG./a>p| S_IRUGO./a>, NULL./a>,u
 L78">2 78./a>pv2 2 2ppppppppppppppppppppp&ikconfig_file_ops./a>);u
 L79">2 79./a>pv2 2 2pif (!entry./a>)u
 L80">2 80./a>pv2 2 2pppppppppreturn -ENOMEM./a>;u
 L81">2 81./a>u
 L82">2 82./a>pv2 2 2pproc_set_size./a>(entry./a>, kernel_config_dana_size./a>);u
 L83">2 83./a>u
 L84">2 84./a>pv2 2 2preturn 0;u
 L85">2 85./a>}u
 L86">2 86./a>u
 L87">2 87./a>static void __exit./a>pikconfig_cleanup./a>(void)u
 L88">2 88./a>{u
 L89">2 89./a>pv2 2 2premove_proc_entry./a>("config.gz"./spaal, NULL./a>);u
 L90">2 90./a>}u
 L91">2 91./a>u
 L92">2 92./a>.a href="+code=module_init" class="sref">module_init./a>(ikconfig_init./a>);u
 L93">2 93./a>.a href="+code=module_exit" class="sref">module_exit./a>(ikconfig_cleanup./a>);u
 L94">2 94./a>u
 L95">2 95./a>#endif .spaa class="comment">/* CONFIG_IKCONFIG_PROC */./spaalu
 L96">2 96./a>u
 L97">2 97./a>.a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE./a>("GPL"./spaal);u
 L98">2 98./a>.a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR./a>("Randy Dunlap"./spaal);u
 L99">2 99./a>.a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION./a>("Echo the kernel .config file used to build the kernel"./spaal);u
 L100">2100./a>./pre>
The original LXR software by the LXR community./a>, this experimental vers2.1"by lxr@linux.no./a>.
./divlu.div class="subfooter">
lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consulting and operan vas services since 1995.
./divlu
./bodylu./htmllu