* network-interface-names-*
@ 2017-01-11 7:56 John Darrington
2017-01-12 14:27 ` network-interface-names-* Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: John Darrington @ 2017-01-11 7:56 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
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?
--
Avoid eavesdropping. Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: network-interface-names-*
2017-01-11 7:56 network-interface-names-* John Darrington
@ 2017-01-12 14:27 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-01-12 14:27 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
John Darrington <john@darrington.wattle.id.au> 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
‘configure-network-interface’?
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-12 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11 7:56 network-interface-names-* John Darrington
2017-01-12 14:27 ` network-interface-names-* Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.