cmake: Detect attribute format
logging: Add logging when loading system functions

Also fix some whitespace errors
logging: log creating the sockets
tests: use discard_const to get rid of a warning on Solaris
Fix formatting of variables of type pid_t