问题解决: error: ‘SCM_CREDENTIALS’ undeclared (first use in this function)

netlink.c: In function ‘main’:
netlink.c:94: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
netlink.c:114: error: ‘SCM_CREDENTIALS’ undeclared (first use in this function)
netlink.c:114: error: (Each undeclared identifier is reported only once
netlink.c:114: error: for each function it appears in.)
netlink.c:120: error: dereferencing pointer to incomplete type
netlink.c:121: error: dereferencing pointer to incomplete type

编译源文件出现类似上述错误时在.c顶部添加以下内容:
#define _GNU_SOURCE

你可能感兴趣的:(日常工作积累)