check a system call return code
add an assertion about stupid use of memset, commented out right now
because it fails
switch aroudn the link order so ldflags are last, as they need to be