From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 15:36:59 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8C171065675 for ; Fri, 25 Apr 2008 15:36:59 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.pkgsrc-box.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6E84E8FC1A for ; Fri, 25 Apr 2008 15:36:59 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (www.pkgsrc-box.org [127.0.0.1]) by www.pkgsrc-box.org (Postfix) with ESMTP id 96A60E506A7 for ; Fri, 25 Apr 2008 15:36:55 +0000 (UTC) Received: by britannica.bec.de (Postfix, from userid 1000) id 5443416FC4; Fri, 25 Apr 2008 17:35:12 +0200 (CEST) Date: Fri, 25 Apr 2008 17:35:12 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20080425153511.GB11467@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: CopyOut Size Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 15:36:59 -0000 On Fri, Apr 25, 2008 at 09:59:55AM -0400, Adam wrote: > Hi, I am writing a custom system call that needs to transfer 16kb of data > from the kernel to userspace. I am transferring the data out of the kernel > by using copyout. This seems to work for a small struct of data < 4k. You are not allowed to use more than a bit of stack space. You are placing a of data on the stack and the kernel stack is typically only a few pages long. Use malloc for this. Joerg