[systemd-devel] Scheme bindings
Jan Synacek
jsynacek at redhat.com
Fri Nov 20 04:53:02 PST 2015
Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> writes:
> On Fri, Nov 13, 2015 at 09:27:17AM +0100, Jan Synáček wrote:
>> Hello,
>>
>> if anybody lurking here and hacking on systemd also likes scheme, I
>> created bindings for GNU Guile [1]. The API is far from covered, but
>> journal API and sd_listen* stuff is usable. You can now write socket
>> activated services in scheme!
>>
>> [1] https://github.com/jsynacek/guile-systemd
>
> Hi,
>
> when you construct a list like this, do you have normal or reverse order:
> for (i = 0; i < r; i++)
> s_fds = scm_cons(scm_from_int(SD_LISTEN_FDS_START+i), s_fds);
> ?
Good catch, it's reversed. But, does it really matter in practice?
> return sd_booted() ? SCM_BOOL_T : SCM_BOOL_F;
> → sd_booted can return negative for error.
_public_ int sd_booted(void) {
return laccess("/run/systemd/system/", F_OK) >= 0;
}
This returns a "boolean" value. I'm not really sure why it would return
anything else. But, the documentation indeed says that it can return
negative values when it fails.
Cheers,
--
Jan Synacek
Software Engineer, Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151120/5b3047c3/attachment-0001.sig>
More information about the systemd-devel
mailing list