From owner-freebsd-hackers@freebsd.org Tue Oct 4 00:03:10 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDADAF366B for ; Tue, 4 Oct 2016 00:03:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D516D29 for ; Tue, 4 Oct 2016 00:03:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id p138so180416642wmb.1 for ; Mon, 03 Oct 2016 17:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kgiDkIwi9eJV6upLG/oZbeqUPFmusqmF7ED/9E0ZpaE=; b=x1TDgwXBRvdqnwUivKZSuLnA0yeft8dM45D+r45nwuP0SQ1KAplxGT+yIMgqmv1Eu/ kxsIhvJqG1UfSfah4jO/4SUIbFP1MhHFY+cDflWIdHk61zqA82me0KDcohmQ8P1484DT DVrOtSpKuCEW7UQg+z7NuUu4qvIcXJS8YbEkkshMtJAuhhGZhczBkaujye7F95D+kAwq MyOtUTMVtMthekwsWbpR5LieAYp/NGg57W1Onpa/bUa17YjJRNLzdePVWqiwYMbusk8I mu5R8NQ20zK6lB+5hRJ0ttjfhoShXHc7QTvpl9B49YpPWLAcJyBSJjzGdEDcZWH3U0Px y7nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kgiDkIwi9eJV6upLG/oZbeqUPFmusqmF7ED/9E0ZpaE=; b=ceeqMZqKyxcTi9/sQBt6ldSr/oec7L0kqNWHeslHrnH6Ih7EckiA7yfmUXrB6+1n58 ylTPuLenWfEZ20ikPLk2keSOrqkrR5mRCfvCd6bUt7MbyN02UyCT5YtRcs6vzER3UB1R FCYXhDSJo9TAQBs9Mkqi/xDpQvAXbrn6ZzGYTPhBdictPLbareNUKCM2DDzISg+TTy6R LebfRCeFGVyhQeMQuALXux0f/2rgomWhkNPVczD2Zwc1ioLV547YI8TUtG5nCybPQZF6 jxG4wwhWCFlB50t4KhmHLy7XMK+v3q/3ci8RIKoN6u4jORSijMvN60QHJiVBXeD3Al1W F/Ew== X-Gm-Message-State: AA6/9RnMBad8MsCsrUHLro9kCisUct95Bj4CNFqjahJA9GBTLz+vKPFjvQPAknkZc4mkWEKe/MjGJ3DqFpglDg== X-Received: by 10.194.86.201 with SMTP id r9mr432736wjz.5.1475539387889; Mon, 03 Oct 2016 17:03:07 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.194.15.137 with HTTP; Mon, 3 Oct 2016 17:03:07 -0700 (PDT) In-Reply-To: References: <20161003181803.GS38409@kib.kiev.ua> From: Alan Somers Date: Mon, 3 Oct 2016 18:03:07 -0600 X-Google-Sender-Auth: 5k7Rwa9DMN1Mgl1oGBHRNNnk4rg Message-ID: Subject: Re: Proper way to add vendor-specific syscalls? To: Cedric Blancher Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2016 00:03:10 -0000 In this case, I'm working with vendor-specific syscalls. They'll never be exposed outside of my organization, so I don't have to worry about polluting the FreeBSD namespace. I do, however, have to worry about FreeBSD additions interfering with the vendor-specific syscalls. -Alan On Mon, Oct 3, 2016 at 5:38 PM, Cedric Blancher wrote: > Why do you want to add new syscalls? The UNIX way is to add new > ioctl() and be done. > > Typically new syscalls need committee approval, to prevent that every > crazy idea gets a new syscall and thus litters that namespace. > > Ced > > On 3 October 2016 at 22:00, alan somers wrote: >> On Mon, Oct 3, 2016 at 12:18 PM, Konstantin Belousov >> wrote: >>> On Mon, Oct 03, 2016 at 11:48:39AM -0600, Alan Somers wrote: >>>> What's the proper way to add a vendor-specific syscall? The comments >>>> in kern/syscalls.master suggest that they should be put in the range >>>> from 151-180, but most of that range is actually occupied. >>> I think that the 'vendors' there means vendors of other BSD-derived >>> systems and not e.g. an appliance vendors. >>> >>>> Only five >>>> nosys slots are available. If I add syscalls to the end of the list, >>>> they'll likely collide with future standard syscalls. Should I just >>>> added ~100 nosys syscalls to the end of the list, and put my custom >>>> syscalls afterwards? Is there any penalty to lengthening the list? >>> >>> Each nosys syscall increases the size of the default ABI syscalls table. >>> On amd64 sizeof(struct sysent) == 48, adding 100 nosys entries would >>> waste a page and some more. >>> >>> How many syscalls do you need ? You probably do not allow random modules >>> loaded and implementing syscalls, so could you use e.g. range 210-219 ? >>> >>> If you look further, you will see lot of holes like 258-271, 281-288 >>> etc. Current practice is to allocate new syscalls at the end of the >>> table, which leaves there holes unused with high chance of never being >>> collected. >> >> Ok, it sounds like filling holes is the best method. Thanks for the >> advice, kib. >> >> -Alan >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > > -- > Cedric Blancher > [https://plus.google.com/u/0/+CedricBlancher/] > Institute Pasteur