From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: network-interface-names-* Date: Thu, 12 Jan 2017 15:27:18 +0100 Message-ID: <87r3482w1l.fsf@gnu.org> References: <20170111075607.GA5083@jocasta.intra> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRgLb-0006l4-U2 for guix-devel@gnu.org; Thu, 12 Jan 2017 09:27:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRgLY-0005Vv-OX for guix-devel@gnu.org; Thu, 12 Jan 2017 09:27:23 -0500 In-Reply-To: <20170111075607.GA5083@jocasta.intra> (John Darrington's message of "Wed, 11 Jan 2017 08:56:07 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: John Darrington Cc: guix-devel@gnu.org John Darrington skribis: > The procedures exported from guix/build/syscalls :=20 > > network-interface-names > network-interface-flags > set-network-interface-flags > network-interface-netmask > > .. and possibily a few others all take an argument called "sock" or "sock= et". > > In the case of network-interface-names this parameter is #:optional and=20 > defaults to (socket SOCK_STREAM AF_INET 0) > > In all of the other procedures this argument is not optional, but so far > as I can tell, all callers pass the above expression as its value, and=20 > if I understand the API correctly, it's unlikely that anything else will > ever be required. > > Will you accept a patch making "sock" #:optional for all parameters which > need it? The problem is that we=E2=80=99d need to change the order of arguments in a= ll of these procedures (so that =E2=80=98sock=E2=80=99 comes last), and it would = also encourage inefficient code: we=E2=80=99d keep calling socket(2) for every c= all. So while I agree that the API is kind of cumbersome (well, the underlying syscalls are!), I=E2=80=99m inclined to leave it as is. Now, maybe you can add higher-level procedures along the lines of =E2=80=98configure-network-interface=E2=80=99? Thanks, Ludo=E2=80=99.