From owner-freebsd-hackers Sun Jun 18 21:46:40 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id A74B437BB8F for ; Sun, 18 Jun 2000 21:46:37 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id WAA32367; Sun, 18 Jun 2000 22:45:37 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id WAA53529; Sun, 18 Jun 2000 22:44:13 -0600 (MDT) Message-Id: <200006190444.WAA53529@harmony.village.org> To: Dave Preece Subject: Re: Quickie: C++ statically linked into kernel? Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Mon, 19 Jun 2000 16:26:45 +1200." <67B808B0DD93D211ABEE0000B498356B02BCC0@internet.kbgroup.co.nz> References: <67B808B0DD93D211ABEE0000B498356B02BCC0@internet.kbgroup.co.nz> Date: Sun, 18 Jun 2000 22:44:13 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <67B808B0DD93D211ABEE0000B498356B02BCC0@internet.kbgroup.co.nz> Dave Preece writes: : I'm writing some C++ code that currently uses divert sockets off the : firewall and for performance reasons moving the code kernel mode is looking : like a (long term) good idea. : : The question is: Should I bite the bullet and start writing in pure C now : (and therefore save pain later)? Can I just provide an API using extern "C" : and link it in (with some calling functions in ipfw.c, of course)? Would an : lkm be the best way to go? I've run C++ code in the kernel. You couldn't easily use: templates, exceptions, global ctors, and sometimes you had to be careful with automatic instantiation of things. I implemented only new and delete and was able to get sample code to run in the kernel. I punted at that point due to the pain in actually knowing if these things were being used or not. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message