From owner-freebsd-questions Wed Aug 28 13:21: 8 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E513737B400 for ; Wed, 28 Aug 2002 13:21:04 -0700 (PDT) Received: from cis.ohio-state.edu (mail.cis.ohio-state.edu [164.107.115.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24B6F43E3B for ; Wed, 28 Aug 2002 13:21:04 -0700 (PDT) (envelope-from balaji@cis.ohio-state.edu) Received: from gamma.cis.ohio-state.edu (daemon@gamma.cis.ohio-state.edu [164.107.112.13]) by cis.ohio-state.edu (8.9.1/8.9.1) with ESMTP id QAA20902 for ; Wed, 28 Aug 2002 16:21:03 -0400 (EDT) Received: from localhost (balaji@localhost) by gamma.cis.ohio-state.edu (8.11.6/8.11.6) with ESMTP id g7SKL3a27864 for ; Wed, 28 Aug 2002 16:21:03 -0400 (EDT) Date: Wed, 28 Aug 2002 16:21:03 -0400 (EDT) From: Pavan Balaji To: freebsd-questions@freebsd.org Subject: Question about Posting Buffers Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Example implementation: Implementation of PostRecv (in the kernel): PostRecv (void* userbuf) { newNode -> buf = userbuf; } Kernel Process (when the msg arrives): print (incomingdata); --> works fine copyout (incomingdata, newNode -> buf); print (newNode -> buf); --> works fine User Process: void* userbuf; PostRecv (userbuf); sleep (zillion seconds); print (userbuf); --> gives garbage Am I missing something over here? The problem I'm having is that the incomingdata in the kernel is perfect. Also, the copy does not return any error, but after the data has been placed, when I try to print out the userbuf, it does not contain any data -- contains garbage. It's kind of illogical, but I tried using void** instead of void* while posting the buffer, and copying it to *(newNode -> buf), but it gives the same problem -- as expected. -- Pavan ======================================================= Pavan Balaji, | 774, Dreese Labs, 78C, W 9th Ave, | 2015, Neil Avenue, Columbus, OH43201 | Columbus, OH43210 (614) 291 3757 | (614) 292 8501 ======================================================= "Being happy doesn't mean that everything's perfect... It just means that you have decided to see Beyond the Imperfections" -- Rash To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message