>>> vaibhav dahiya <dahiyavaibha...@gmail.com> schrieb am 19.07.2019 um 00:29 in Nachricht <CAATM+w92Wz2-pkw=xo7ph9u1645yh1vlxoveo2dlzbj2u0w...@mail.gmail.com>: > Since sd_journal_send uses > > fd = journal_fd(); > which has > > fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0); > this socket is opened without a non-blocking call. > > This might cause the unix socket daemon to block this . > > The other approach could be passing a nonblocking flag to > > k = sendmsg(fd, &mh, MSG_NOSIGNAL); > > *MSG_DONTWAIT* flag . > > ARE ANY OF THESE APPROACHES TRIED OR is there a plan to support this > complete non blocking sd_journal_print call ?
If I understand things right, using the non-block flags will prevent these calls from blocking, but they will fail instead, so you'll have to retry to succeed. Is there anything gained then? > > regards > > > On Thu, Jul 18, 2019 at 2:52 AM Mantas Mikulėnas <graw...@gmail.com> wrote: > >> On Thu, Jul 18, 2019 at 12:44 PM Ulrich Windl < >> ulrich.wi...@rz.uni-regensburg.de> wrote: >> >>> >>> Mantas Mikulenas <graw...@gmail.com> schrieb am 18.07.2019 um 10:06 >>> in >>> Nachricht >>> <capwny8xs1jw9iu_a-tagnw-v0nqemacwdrpftpdekw_nfan...@mail.gmail.com>: >>> > On Thu, Jul 18, 2019 at 10:32 AM Ulrich Windl < >>> > ulrich.wi...@rz.uni-regensburg.de> wrote: >>> > >>> >> >>> Vaibhav Dahiya <vdah...@ncsu.edu> schrieb am 18.07.2019 um 02:53 >>> in >>> >> Nachricht >>> >> <5d2fc2f0.1c69fb81.214d0.1...@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 >> _______________________________________________ >> systemd-devel mailing list >> systemd-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/systemd-devel _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel