From owner-freebsd-hackers Mon Jun 5 23:27:48 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from sasi.com (sasi.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 0402F37BA41 for ; Mon, 5 Jun 2000 23:27:41 -0700 (PDT) (envelope-from gbnaidu@sasi.com) Received: from samar (sasi.com [164.164.56.2]) by sasi.com (8.9.3/8.9.3) with SMTP id LAA26639 for ; Tue, 6 Jun 2000 11:55:30 +0530 (IST) Received: from pcd75.sasi.com ([10.0.16.75]) by sasi.com; Tue, 06 Jun 2000 11:55:28 +0000 (IST) Received: from localhost (gbnaidu@localhost) by pcd75.sasi.com (8.9.3/8.9.3) with ESMTP id LAA01211; Tue, 6 Jun 2000 11:55:18 +0530 Date: Tue, 6 Jun 2000 11:55:18 +0530 (IST) From: "G.B.Naidu" To: Alfred Perlstein Cc: hackers@FreeBSD.ORG, Deepika Kakrania , Madhavi Suram Subject: Re: How do I get port inside kernel.... In-Reply-To: <20000605094240.N17973@fw.wintelcom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, Thanks a lot for your reply. It's quite useful. But I have some more questions generated of this study of nfs code and sendfile(2) code. The question is about getting a proc structure. Here it is. As you all know that every system call in side kernel needs a process structure to be passed. So to call socreate, sobind or getsocket we need a proc structure. My doubt is which process structure to pass? In nfs code, at some places it is passing the curproc structure which is nothing but currently running process. At other places example for socreate() and sobind(), it is using proc0 structure which is nothing but of the swap process. So when I am executing the kernel, what is the current process? Is it safe if I use proc0 to pass the proc structure to call socreate() and sobind()? How safe it is to use curproc structure? Somebody mentioned that it will not work in interrupt handlers. So somebody out there throw some light on the currently running process when inside kernel? thanks a lot --gb On Mon, 5 Jun 2000, Alfred Perlstein wrote: > * G.B.Naidu [000605 05:37] wrote: > > > > Hi, > > > > If I want to get a port inside kernel, how do I do that? In user land we > > will call socket(), bind() to get a port. But in kernel, is there any way > > to get a new port? > > > > Any ideas are appreciated. > > Check the nfsd code. src/sys/nfs > > -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message