10 addrfd
= flag
.Int("addrfd", -1, "File descriptor on which to print the picked address")
13 // MustWrite communicates listening address addr to the parent process via the
14 // file descriptor number passed to -addrfd, if any. It must be called precisely
16 func MustWrite(addr
string) {
20 log
.Printf("%s is listening on %s", os
.Args
[0], addr
)
21 f
:= os
.NewFile(uintptr(*addrfd
), "")
22 if _
, err
:= f
.Write([]byte(addr
)); err
!= nil {
25 if err
:= f
.Close(); err
!= nil {