From owner-freebsd-net@FreeBSD.ORG Tue Feb 17 17:45:34 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9B7DF77 for ; Tue, 17 Feb 2015 17:45:34 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBB383F for ; Tue, 17 Feb 2015 17:45:34 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HHjYLH098759 for ; Tue, 17 Feb 2015 17:45:34 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t1HHjYbk098758; Tue, 17 Feb 2015 17:45:34 GMT (envelope-from root) Date: Tue, 17 Feb 2015 17:45:34 +0000 To: freebsd-net@freebsd.org From: "rstone (Ryan Stone)" Subject: [Differential] [Request, 471 lines] D1882: Add macros to make code compile in kernel Message-ID: X-Priority: 3 Thread-Topic: D1882: Add macros to make code compile in kernel X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: Thread-Index: YzM1ZTc3MTdjMzBlN2YyNTZkMjI0ODE2M2Ew X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 17:45:34 -0000 rstone created this revision. rstone added a reviewer: jfvogel. rstone added subscribers: pjd, freebsd-net. REVISION SUMMARY Make it possible to compile libnv in the kernel. Mostly this involves wrapping functions that have a different signature in the kernel and in userland (e.g. malloc()) in a macro that will conditionally expand to the right API depending on whether the code is being compiled for the kernel or not. I have also #ifdef'ed out all of file descriptor-handling code, as well as the unsafe varargs functions. REVISION DETAIL https://reviews.freebsd.org/D1882 AFFECTED FILES lib/libnv/dnv.h lib/libnv/dnvlist.c lib/libnv/nv.h lib/libnv/nv_impl.h lib/libnv/nvlist.c lib/libnv/nvlist_impl.h lib/libnv/nvpair.c lib/libnv/nvpair_impl.h To: rstone, jfvogel Cc: freebsd-net, pjd