strerror.c
来自「关系型数据库 Postgresql 6.5.2」· C语言 代码 · 共 32 行
C
32 行
/* $Id: strerror.c,v 1.5 1998/09/01 03:24:33 momjian Exp $ *//* * strerror - map error number to descriptive string * * This version is obviously somewhat Unix-specific. * * based on code by Henry Spencer * modified for ANSI by D'Arcy J.M. Cain */#include <string.h>#include <stdio.h>#include <errno.h>extern const char *const sys_errlist[];extern int sys_nerr;const char *strerror(int errnum){ static char buf[24]; if (errnum < 0 || errnum > sys_nerr) { sprintf(buf, "unknown error %d", errnum); return buf; } return sys_errlist[errnum];}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?