mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Why connect() in syslog?
@ 2020-11-06 19:30 Markus Wichmann
  2020-11-06 21:44 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Wichmann @ 2020-11-06 19:30 UTC (permalink / raw)
  To: musl

Hi all,

I was reading musl's syslog source code today for unrelated reasons, and
saw that it is using connect() to set the destination. And it has some
code to deal with connection failures. But why? I see the syslog socket
is a datagram socket, so I thought sendto() with destination address
means the same thing as connect() and send(), with the difference that
it is one less syscall that can fail and no connection errors to handle.
I tried finding information about the semantics of connect() on a UNIX
datagram socket, but failed to find anything useful.

Ciao,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-06 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 19:30 [musl] Why connect() in syslog? Markus Wichmann
2020-11-06 21:44 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).