As *BSD defaults to use IPv6 only sockets and Linux to IPv4 mapped IPv6
sockets, switches to support explicit binding address families are required.
Now set explicitly if you want IPv6 only, IPv4 only or mapped IPv4.
Caveat:
OpenBSD explicitly states to not support IPv4 mapped IPv6 via setsock-API
It seems this is required to get all the IPv6 definitions, though most
systems aren't very picky. NetBSD seems to be one of those picky
systems, though.
1. If sockets are non-blocking, no need to use poll() on them. Just try
to write regardless and ignore the outcome. This means we don't need the
pollvec stuff anymore.
2. getline(3) is apparently still too new to POSIX that it's hard to use
portably. We don't really need it that badly anyway.
3. Don't use MSG_DONTWAIT. It's non-standard and apparently still hard
to use portably. Set sockets to non-blocking instead.
4. Since we're not polling on client sockets, the queue is a whole lot
simpler.
Requires extensions to be enabled due to incomplete support for
POSIX.1-2008. However one of the now-exposed extensions is tragically
named "struct queue". This struct was been renamed to "struct fifo".
Thanks to @yvoinov for reporting this issue and collaborating on a
solution.
Closes#14, #17.
Assuming an /opt/ install. For those unfamiliar, plop it into /etc/systemd/system (symlinks might not work, old systemd bug), run `systemctl daemon-reload`, and have it start on boot (and immediately) with `systemctl enable --now endlessh.service`
This is necessary for supporting OmniOS (Solaris), which doesn't
actually document how to actually define this flag. This platform also
requires LDLIBS='-lsocket -lnsl' when compiling.