sm: cleanups for Linux

Use inttypes and PRIx64
Replace printf() with debug macro
Remove useless sun_len
Define _GNU_SOURCE to access ffsl()