[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network-interface-names-*

From: Ludovic Courtès
Subject: Re: network-interface-names-*
Date: Thu, 12 Jan 2017 15:27:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

John Darrington <address@hidden> skribis:

> The procedures exported from guix/build/syscalls : 
> 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 "socket".
> In the case of network-interface-names this parameter is #:optional and 
> 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 
> 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’d need to change the order of arguments in all of
these procedures (so that ‘sock’ comes last), and it would also
encourage inefficient code: we’d keep calling socket(2) for every call.

So while I agree that the API is kind of cumbersome (well, the
underlying syscalls are!), I’m inclined to leave it as is.

Now, maybe you can add higher-level procedures along the lines of


reply via email to

[Prev in Thread] Current Thread [Next in Thread]