Musl porting notes

Background

 * Plenty of macros defined in glibc are actually there for compatibility reasons, but then are depended on by upstreams. Musl drops these, so we have to use the actual POSIX-provided versions instead.

Problem

 * MAXNAMLEN doesn't exist in musl. It's actually an alias in glibc.

Fix

 * Include .
 * If NAME_MAX is defined, use that (ifdef). If not, fall back to MAXNAMLEN.

Problem

 * MSG_TRYHARD only exists in glibc (_GNU_SOURCE set).

Fix

 * Use MSG_DONTROUTE instead.

Porting tasks

 * Tracker bug for missing includes/compile errors
 * Bugs with possible patches to test and commit

Resources

 * #gentoo-hardened on IRC
 * musl's FAQ