From: "Ludovic Courtès" <ludo@gnu.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 34863@debbugs.gnu.org
Subject: [bug#34863] [WIP] syscalls: Add loop device interface.
Date: Sat, 16 Mar 2019 11:18:12 +0100 [thread overview]
Message-ID: <877ecz15sr.fsf@gnu.org> (raw)
In-Reply-To: <20190315171306.777c88bd@scratchpost.org> (Danny Milosavljevic's message of "Fri, 15 Mar 2019 17:13:06 +0100")
Hi!
Danny Milosavljevic <dannym@scratchpost.org> skribis:
>> +(define (set-loop-device-status loop-file status)
>> + (let ((buf (make-bytevector sizeof-loop-info64)))
>> + (apply write-loop-info64! buf status) ; TODO: Be more user-friendly.
>
> I don't know how instantiate a C structure given an assoc list. Help?
You have to extract the fields from STATUS and then pass them in the
right order to ‘write-loop-info64!’:
(let-syntax ((field (syntax-rules ()
((_ field) (assoc-ref status 'field)))))
(write-loop-info64! buf (field lo-device) (field lo-inode)
(field lo-rdevice) …))
However, given the number of fields, you might want to define a Scheme
record type, as is done for ‘%statfs’ and <file-system>.
HTH!
Ludo’.
next prev parent reply other threads:[~2019-03-16 10:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 22:08 [bug#34863] [WIP] syscalls: Add loop device interface Danny Milosavljevic
2019-03-15 16:13 ` Danny Milosavljevic
2019-03-16 10:18 ` Ludovic Courtès [this message]
2019-03-16 10:29 ` Ludovic Courtès
2019-03-16 11:17 ` Danny Milosavljevic
2019-03-18 8:42 ` Ludovic Courtès
2019-04-10 14:56 ` Ludovic Courtès
2019-05-21 14:51 ` Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ecz15sr.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=34863@debbugs.gnu.org \
--cc=dannym@scratchpost.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).