This question is intentionally very generic and I'm not much of a C programmer although I dabble here and there. The following code is intentionally vague and probably won't compile, ...
How can I do this:
*(int *)CMSG_DATA(hdr) = fd2pass;
error: dereferencing type-punned pointer will break strict-aliasing rules
-Wall -Werror -pedantic
I'm having trouble with S_ISXXX(m) macros from sys/stat.h
Specifically almost everything is reported as directory. Only regular files are correctly reported as regular files, links, devices, fifos, all seem to be reported ...