There's an overflow here. strftime(3) actually adds the terminating NUL
byte.
sysinfo(2) is actually returning -1 on error. Some whitespace mods.
Use a struct to shorten the function and also increase readability.
Convert conditions to use the logical not operator.
Inline the call to gethostid(2). Only this line needs it.
Whitespace mods.
const here is pointless.
Disable buffering for this stream.
Add Fipaddress. It shows the default outgoing IPv4 and IPv6 addresses.
Replace NULL with 0. Less confusion and consistent.
Do three tries or we're not going to enter that loopback fallback.
Pedantic mode. Make it clear what we mean to pass.
This should not be called syslib.
Another NULL replacement. Move this var declaration to the top.
Follow Lua's lead.
Don't need strlcpy anymore.
Use inet_pton,ntop for consistency.