all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: John Darrington <john@darrington.wattle.id.au>
Cc: guix-devel@gnu.org
Subject: Re: network-interface-names-*
Date: Thu, 12 Jan 2017 15:27:18 +0100	[thread overview]
Message-ID: <87r3482w1l.fsf@gnu.org> (raw)
In-Reply-To: <20170111075607.GA5083@jocasta.intra> (John Darrington's message of "Wed, 11 Jan 2017 08:56:07 +0100")

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’.

      reply	other threads:[~2017-01-12 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11  7:56 network-interface-names-* John Darrington
2017-01-12 14:27 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3482w1l.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=john@darrington.wattle.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.