/* perror.c Print unix-style error messages in not in VMS */ /* * Copyright (C) 1988, 1989 by Frederic Hemmer * All rights reserved */ #include #include #define PRIVATE static #define PUBLIC /* UNIX defines unix error number from 0 to 75 */ #define MAXUNIXERR 74 /* as of 31-Aug 1988 */ /* VMS defines unix error number from 0 to 35 */ #define MAXVMSERR 35 /* as of 31-Aug 1988 */ /* Define missing error numbers */ #define EINPROGRESS 36 /* Operation now in progress */ #define EALREADY 37 /* Operation already in progress */ #define ENOTSOCK 38 /* Socket operation on non-socket */ #define EDESTADDRREQ 39 /* Destination address required */ #define EMSGSIZE 40 /* Message too long */ #define EPROTOTYPE 41 /* Protocol wrong type for socket */ #define ENOPROTOOPT 42 /* Protocol not available */ #define EPROTONOSUPPORT 43 /* Protocol not supported */ #define ESOCKTNOSUPPORT 44 /* Socket type not supported */ #define EOPNOTSUPP 45 /* Operation not supported on socket */ #define EPFNOSUPPORT 46 /* Protocol family not supported */ #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ #define EADDRINUSE 48 /* Address already in use */ #define EADDRNOTAVAIL 49 /* Can't assign requested address */ #define ENETDOWN 50 /* Network is down */ #define ENETUNREACH 51 /* Network is unreachable */ #define ENETRESET 52 /* Network dropped connection on reset */ #define ECONNABORTED 53 /* Software caused connection abort */ #define ECONNRESET 54 /* Connection reset by peer */ #define ENOBUFS 55 /* No buffer space available */ #define EISCONN 56 /* Socket is already connected */ #define ENOTCONN 57 /* Socket is not connected */ #define ESHUTDOWN 58 /* Can't send after socket shutdown */ #define ETOOMANYREFS 59 /* Too many references: can't splice */ #define ETIMEDOUT 60 /* Connection timed out */ #define ECONNREFUSED 61 /* Connection refused */ #define ELOOP 62 /* Too many levels of symbolic links */ #define ENAMETOOLONG 63 /* File name too long */ #define EHOSTDOWN 64 /* Host is down */ #define EHOSTUNREACH 65 /* No route to host */ #define ENOTEMPTY 66 /* Directory not empty */ #define EPROCLIM 67 /* Too many processes */ #define EUSERS 68 /* Too many users */ #define EDQUOT 69 /* Disc quota exceeded */ #define ESTALE 70 #define EREMOTE 71 #define ENOMSG 72 /* No message of desired type */ #define EIDRM 73 /* Identifier removed */ #define EALIGN 74 /* alignment error */ /* define error message strings */ PRIVATE _unix$errmsg[MAXUNIXERR+1] = { "Error 0", "Not owner", "No such file or directory", "No such process", "Interrupted system call", "I/O error", "No such device or address", "Arg list too long", "Exec format error", "Bad file number", "No children", "No more processes", "Not enough core", "Permission denied", "Bad address", "Block device required", "Mount device busy", "File exists", "Cross-device link", "No such device", "Not a directory", "Is a directory", "Invalid argument", "File table overflow", "Too many open files", "Not a typewriter", "Text file busy", "File too large", "No space left on device", "Illegal seek", "Restricted operation on file system", "Too many links", "Broken pipe", "Argument too large", "Result too large", "Operation would block", "Operation now in progress", "Operation already in progress", "Socket operation on non-socket", "Destination address required", "Message too long", "Protocol wrong type for socket", "Protocol not available", "Protocol not supported", "Socket type not supported", "Operation not supported", "Protocol family not supported", "Address family not supported by protocol family", "Address already in use", "Can't assign requested address", "Network is down", "Network is unreachable", "Network dropped connection on reset", "Software caused connection abort", "Connection reset by peer", "No buffer space available", "Socket is already connected", "Socket is not connected", "Can't send after socket shutdown", "Too many references: can't splice", "Connection timed out", "Connection refused", "Too many levels of symbolic links", "File name too long", "Host is down", "Host is unreachable", "Directory not empty", "Too many processes", "Too many users", "Disc quota exceeded", "Stale NFS file handle", "Too many levels of remote in path", "No message of desired type", "Identifier removed", "Alignment error" }; PUBLIC _unix$perr(msg) char *msg; { if ((errno > MAXVMSERR) && (errno <= MAXUNIXERR)) { fprintf(stderr,"%s: %s\n",msg, _unix$errmsg[errno]); } else { perror(msg); } }