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

Lennart Poettering lennart at poettering.net
Wed Jul 24 08:22:41 UTC 2019


On Mi, 24.07.19 07:56, Ulrich Windl (Ulrich.Windl at rz.uni-regensburg.de) wrote:

> >> 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?
> >
> > Local AF_UNIX/SOCK_DGRAM sockets may block and are reliable.
>
> Out of curiosity, what would be the condition for the datagram socket to block
> when it's being written to? Is it due to being "reliable" that all received
> packets have to be buffered? ("man 7 unix" does not contain the phrase "block"
> here)

Yes, when an AF_UNIX socket buffer is full any further send()/write()
on it will block until the other side reads some data off them.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list