From owner-freebsd-questions Sat Feb 9 20:51:26 2002 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id AD87F37B419 for ; Sat, 9 Feb 2002 20:51:13 -0800 (PST) Received: (qmail 55653 invoked by uid 100); 10 Feb 2002 04:51:09 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15461.64572.790859.177300@guru.mired.org> Date: Sat, 9 Feb 2002 22:51:08 -0600 To: abhijit vaidya Cc: questions@freebsd.org Subject: Re: Kernel File I/O In-Reply-To: <34479115@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.44 (Python 2.2; freebsd-4.5-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG abhijit vaidya types: > I want to access a file "/usr/cache" which is a file created by me in /usr. I want to write some data into it through kernel space. I want to do file I/O from kernel. Please tell me what should i use? i mean how to use open and write system calls in kernel to access files. Please set your mailer to use hard newlines every 70 or so characters. Anyway, the answer is "you can't". There are some kludges floating around to do this kind of thing, but that's just what they are - kludges. Instead, make the data available via a sysctl - which is easy - and then have userland code copy it to /usr/cache. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message