From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 10 19:14:39 2007 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 9041316A417 for ; Fri, 10 Aug 2007 19:14:39 +0000 (UTC) (envelope-from freebsd.dev@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.235]) by mx1.freebsd.org (Postfix) with ESMTP id 4D47313C45B for ; Fri, 10 Aug 2007 19:14:39 +0000 (UTC) (envelope-from freebsd.dev@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so115207wra for ; Fri, 10 Aug 2007 12:14:38 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SMUytKitQ3R8y0phndQRWL7RInSZ++KI5JzefGkJEOou+yTYLaGD2o1og9WqkChK+d1n4tPR4wNWuieiraFPrrB39QoCB1TF53F/Iqf40yt2Rf9kKVgGAf11kv+xvHQ3t5nOS3nhVPqbynp6FTP4/x7Aq5c4aBdhWqGndkNjnnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bQPjXSfGUpBS+Etb5GPabvKASAIv4904CQNQ0D7Dw9+bqzNAJfFRoDw9dloeAsbXu0RQSO0h4GNMhWUv8oeib3LxmL5DaockCN1lrHI8ADjE75pdgMqxkBvNB5gFMpWhn2KMByXxG+4Zop2i/znW2glxFAoXgiS2oqZIVib6Fcc= Received: by 10.90.102.20 with SMTP id z20mr4981664agb.1186773277723; Fri, 10 Aug 2007 12:14:37 -0700 (PDT) Received: by 10.90.49.2 with HTTP; Fri, 10 Aug 2007 12:14:37 -0700 (PDT) Message-ID: <50cd4e5f0708101214s74155d6bqecc8ed6ae80d7c87@mail.gmail.com> Date: Fri, 10 Aug 2007 14:14:37 -0500 From: "Biks N" To: freebsd-hackers@freebsd.org In-Reply-To: <20070808172535.GA8404@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <50cd4e5f0708080923p1d441e66ha6b42e277b55f8d@mail.gmail.com> <20070808172535.GA8404@nowhere> Subject: Re: Using userland library in Kernel 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, 10 Aug 2007 19:14:39 -0000 Thanks to everyone :) On 8/8/07, Craig Boston wrote: > On Wed, Aug 08, 2007 at 11:23:25AM -0500, Biks N wrote: > > I am new to FreeBSD kernel programming and I am trying to use userland > > library (zlib) in FreeBSD kernel. But I am not sure if zlib library is > > linkable from the kernel. > > Normally, no, you can't just link in a library designed for userland > into the kernel. Some porting is required to deal with the kernel > environment -- things such as not having a full C library available, > different memory management, etc. > > In this case however, there is already a zlib implementation in the > kernel. IIRC, geom_uzip and the crypto framework both use it. > > You may want to check out sys/net/zlib.[ch] and see if it can do what > you're after. You'll need to make sure to include a dependency on the > zlib module and/or add it to your kernel configuration. > > Good luck, > Craig >