From owner-freebsd-fs@FreeBSD.ORG Thu Aug 5 07:25:49 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4DD916A4CE; Thu, 5 Aug 2004 07:25:49 +0000 (GMT) Received: from inetmg01.sony.com.sg (inetmg01.sony.com.sg [202.42.154.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53F5643D3F; Thu, 5 Aug 2004 07:25:47 +0000 (GMT) (envelope-from ravi.nanjundappa@ap.sony.com) Received: from avgw02b.sony.com.sg (avgw02b [43.68.8.23]) by inetmg01.sony.com.sg (8.11.7+Sun/8.11.6) with SMTP id i757URI20913; Thu, 5 Aug 2004 15:30:27 +0800 (SGT) Received: from unknown(43.68.8.1) by avgw02b.sony.com.sg via csmap id ac5a2430_e6b1_11d8_8b62_0002b3cb4edc_22924; Thu, 05 Aug 2004 15:32:58 +0800 (SGT) Received: from sapsgssdibh01.ap.sony.com (bh01.ap.sony.com [43.68.15.23]) by seagw01.sony.com.sg (8.11.6+Sun/8.11.6) with ESMTP id i757HnE03697; Thu, 5 Aug 2004 15:17:49 +0800 (SGT) Received: from sapinsardexc01.sard.in.sony.com.sg (SAPINSARDEXC01 [43.88.102.8]) by sapsgssdibh01.ap.sony.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id QHNJBVCT; Thu, 5 Aug 2004 15:25:20 +0800 Received: from [43.88.102.67] (RAVIN [43.88.102.67]) by sapinsardexc01.sard.in.sony.com.sg with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2655.55) id 37T3D9BS; Thu, 5 Aug 2004 13:06:59 +0530 From: ravi To: Dan Nelson In-Reply-To: <20040804050142.GB85344@dan.emsphone.com> References: <20040804050142.GB85344@dan.emsphone.com> Content-Type: text/plain Organization: SONY-SARD Message-Id: <1091691119.4724.19.camel@ravin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Thu, 05 Aug 2004 13:02:00 +0530 Content-Transfer-Encoding: 7bit cc: Brian Fundakowski Feldman cc: Raja Guha cc: freebsd-fs@freebsd.org cc: Robert Watson cc: Aniruddha Bohra cc: Andrey Simonenko Subject: Regarding writing to /proc entries X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2004 07:25:50 -0000 Hi, I've created my own /proc entries using linprocfs.c with read and write permissions like this " pfs_create_file(root,"EXAMPLE",&myfunc,NULL,NULL,PFS_RDWR); " and I've associated my own filler function as follows . static int myfunc(PFS_FILL_ARGS) { printf(" in myfunc() .....\n"); if(uio->uio_rw ==UIO_WRITE) printf(" write request \n"); else printf(" read request \n"); sbuf_printf(sb, " myfunc function called\n"); printf(" exiting from myfunc() .....\n"); return 0; } Please read the above statements . When I run "cat /proc/EXAMPLE" I'll get the follwing o/p on the screen . OUTPUT: in myfunc() ..... read request exiting from myfunc() ..... myfunc function called in myfunc() ..... read request exiting from myfunc() ..... Even though I'm checking the operation that is requested with the conditional statements if (uio->uiorw==UIO_WRITE) and when I run "echo 0 > /proc/EXAMPLE " I'm getting the following error ERROR: /proc/EXAMPLE : Operation not supported The same error is coming even for process related " ctl " files as well when I run "echo attach /proc/12/ctl " Please tell me the reason and solution for this . Regards, N Ravi