[systemd-devel] Antw: sd_journal_send non-blocking call

Mantas Mikulėnas grawity at gmail.com
Thu Jul 18 09:52:31 UTC 2019


On Thu, Jul 18, 2019 at 12:44 PM Ulrich Windl <
Ulrich.Windl at rz.uni-regensburg.de> wrote:

> >>> Mantas Mikulenas <grawity at gmail.com> schrieb am 18.07.2019 um 10:06 in
> Nachricht
> <CAPWNY8XS1jw9iU_a-tagNw-v0NqeMAcWDRpftPdeKW_NFanqtA at mail.gmail.com>:
> > On Thu, Jul 18, 2019 at 10:32 AM Ulrich Windl <
> > Ulrich.Windl at rz.uni-regensburg.de> wrote:
> >
> >> >>> Vaibhav Dahiya <vdahiya at ncsu.edu> schrieb am 18.07.2019 um 02:53 in
> >> Nachricht
> >> <5d2fc2f0.1c69fb81.214d0.1aca at mx.google.com>:
> >> > Hello,
> >> >
> >> > I am using sd_journal_send api() api call to log messages on syslog
> >> server.
> >> > I see that this uses
> >> > sendmsg(fd, &mh, MSG_NOSIGNAL) call.
> >>
> >> Aren't syslog messages UDP anyway? When would an UDP send block?
> >>
> >
> > No, program APIs use Unix sockets (/dev/log,
> /run/systemd/journal/socket).
> > You only get UDP when your local syslog daemon is configured to forward
> > elsewhere.
> >
> > That said, both are datagram sockets, I'm not sure whether sending to
> Unix
> > dgram sockets can block or not?
>
> ??? Datagram _is_ UDP
>

UDP is datagram, but datagram is not always UDP.

"UDP" specifically means the datagram transport protocol that runs over
IPv4/IPv6, nothing else. Unix sockets (AF_UNIX) have a datagram mode but
they do not use UDP (or IP). Netlink is datagram-based but it isn't
UDP-based. &c.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190718/4a7ad702/attachment-0001.html>


More information about the systemd-devel mailing list