From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 2 08:56:16 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CED937B401 for ; Wed, 2 Jul 2003 08:56:16 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 733B943FE0 for ; Wed, 2 Jul 2003 08:56:15 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc0qi.dialup.mindspring.com ([209.86.3.82] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19Xjxs-0003DL-00; Wed, 02 Jul 2003 08:56:13 -0700 Message-ID: <3F03005D.9B82593D@mindspring.com> Date: Wed, 02 Jul 2003 08:55:09 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Sandeep Kumar Davu References: <3F0C1D56@webmail.kent.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a464bd279fc2dd5b110db23ba1d912ad0ba8438e0f32a48e08350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: Writing a new (socket ) system call X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2003 15:56:16 -0000 Sandeep Kumar Davu wrote: > I am scanning throug the freeBSD source code and wanted to know somethin about > the bind system call. I could follow through the code till sobind and after > that pru_bind routine is called in uipc_socket.c. Then suddenly in > tcp_usrreq.c there is tcp_usr_bind. I am wondering how these 2 can be related. > I think i am missing something. i wanted it because I am writing a new system > call that has to navigate to the tcp_usrreq.c. Can anyone help me out with > this. It would be of great help if u can do so. Most likely you can accomplish what you want to accomplish without adding a new system call. If you insist on adding a system call, the code to do so will be rather complex, and involve not only extending a number of data structures, which will require recompiling everything to add another pru_* entry, it will involve adding stub functions in uipc_*, and, possibly, a default implementation for all protocols that have to deal with it. Add to that you will need to allocate a system call slot and (potentially) a struct fileops entry, and you can see that you will not only be touching a lot of the system, you will be making your implementation binarily incompatible with third party code. If you can do it as a socket option (search for "SOPT" in tcp_usrreq.c) then I'd really advise you to do that, instead. -- Terry