[systemd-devel] Antw: Re: Antw: sd_journal_send non-blocking call
Ulrich Windl
Ulrich.Windl at rz.uni-regensburg.de
Wed Jul 24 05:56:51 UTC 2019
>>> Lennart Poettering <lennart at poettering.net> schrieb am 23.07.2019 um 17:43
in
Nachricht <20190723154358.GA9178 at gardel-login>:
> On Do, 18.07.19 11:06, Mantas Mikulėnas (grawity at gmail.com) wrote:
>
>> 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?
>
> 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)
>
> Lennart
>
> --
> Lennart Poettering, Berlin
More information about the systemd-devel
mailing list