server-api-strerror Posted on 2019-03-20 Edited on 2023-05-21 原型把errno变量转换成对应的字符串并打印出来。 12// errnum:错误码char* strerror(int errnum) 使用参考12345678910111213141516#include <unistd.h>#include <errno.h>#include <stdio.h>#include <string.h>int main(){ int ret; ret = close(10); if(ret == -1){ fprintf(stderr, "close error with msg: %s\n", strerror(errno)); } return 0;}