diff options
-rw-r--r-- | sd_daemon/notify.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sd_daemon/notify.go b/sd_daemon/notify.go index 8b813cc..f2b9076 100644 --- a/sd_daemon/notify.go +++ b/sd_daemon/notify.go @@ -114,11 +114,15 @@ func Notify(pid int, unsetEnv bool, state string, files []*os.File) error { return err } -// socketUnixgram wraps socket(2), but doesn't bind(2) to anything. -// This is an ugly hack because none of the functions in "net" -// actually allow you to get a AF_UNIX socket not bound to anything (I -// think that sentence is still true if you take out "AF_UNIX", but -// I'm not totally certain of that). +// socketUnixgram wraps socket(2), but doesn't bind(2) or connect(2) +// the socket to anything. This is an ugly hack because none of the +// functions in "net" actually allow you to get a AF_UNIX socket not +// bound/connected to anything. +// +// At some point you begin to question if it is worth it to keep up +// the high-level interface of "net", and messing around with FileConn +// and UnixConn. Maybe we just drop to using unix.Socket and +// unix.SendmsgN directly. func socketUnixgram(name string) (*net.UnixConn, error) { fd, err := unix.Socket(unix.AF_UNIX, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, 0) if err != nil { |