implicit declaration of function setxattr is invalid in c99 implict adj. 含蓄的;暗示的;盲从的 直译就是,在c99里,含蓄的声明setxattr是不合法的 解决方法是:#include <sys/xattr.h>