xmsg.c
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 54 行
C
54 行
#ifndef lintstatic char *sccsid = "@(#)xmsg.c 4.1 (ULTRIX) 7/17/90";#endif lint/* Call fatal with an appropriate error message based on errno. If no good message can be made up, it makes up a simple message. The second argument is a pointer to the calling functions name (a string); it's used in the manufactured message.*/# include "errno.h"# include "sys/types.h"# include "macros.h"xmsg(file,func)char *file, *func;{ register char *str; extern int errno; extern char Error[]; extern void free(); extern char *malloc(); switch (errno) { case ENFILE: str = "no file (ut3)"; break; case ENOENT: sprintf(str = Error,"`%s' nonexistent (ut4)",file); break; case EACCES: str = (char *)malloc(size(file)); copy(file,str); file = str; sprintf(str = Error,"directory `%s' unwritable (ut2)", dname(file)); free(str); break; case ENOSPC: str = "no space! (ut10)"; break; case EFBIG: str = "write error (ut8)"; break; default: sprintf(str = Error,"errno = %d, function = `%s' (ut11)",errno, func); break; } return(fatal(str));}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?