From mboxrd@z Thu Jan 1 00:00:00 1970 From: RuoMu Hu Subject: Confused about create_proc_entry Date: Sun, 08 Jun 2008 02:28:57 +0800 Message-ID: <484AD369.8030900@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from wa-out-1112.google.com ([209.85.146.183]:18398 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761323AbYFGS3M (ORCPT ); Sat, 7 Jun 2008 14:29:12 -0400 Received: by wa-out-1112.google.com with SMTP id j37so1189732waf.23 for ; Sat, 07 Jun 2008 11:29:12 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi! I'm writing a kernel module to add a file under /proc/sys/kernel, but alway fail to create_proc_entry "sys/kernel/test". I found that in proc_create() in fs/proc/generic.c (2.6.25.4): /* At this point there must not be any '/' characters beyond *fn */ if (strchr(fn, '/')) goto out; So you cannot create_proc_entry with a name containing "/", but acturally create_proc_entry with "sysvipc/test" succeeds, and there are much other codes in the kernel that do this, e.g.: fs/nfsd/nfsctl.c: entry = create_proc_entry("fs/nfs/exports", 0, NULL); fs/proc/proc_tty.c: create_proc_read_entry("tty/ldiscs", 0, NULL, tty_ldiscs_read_proc, NULL); I got pretty confused. Any idea? and is it possible to create a file in /proc/sys/kernel ? How? Thanks! Romu