首先#include <errno.h> 然后就能用errno这个全局变量了。
函数strerror获取系统错误信息或打印用户程序错误信息。
如:printf("错误号:%d,错误信息%s\n“,errno,strerror(errno));
OK.