Annotation of researchv9/ipc/src/mgrs/dkmgr/dkerr.c, revision 1.1

1.1     ! root        1: #include <errno.h>
        !             2: 
        !             3: /* imported */
        !             4: extern int errno;
        !             5: extern char *errstr;
        !             6: 
        !             7: char *msgs[] = {
        !             8:        "DK controller system error",
        !             9:        "destination busy",
        !            10:        "remote node not answering",
        !            11:        "destination not answering",
        !            12:        "unassigned destination",
        !            13:        "DK system overload",
        !            14:        "server already exists",
        !            15:        "call rejected by destination",
        !            16: };
        !            17: 
        !            18: int errs[] = {
        !            19:        EIO,
        !            20:        EBUSY,
        !            21:        EIO,
        !            22:        EIO,
        !            23:        ENOENT,
        !            24:        EBUSY,
        !            25:        EEXIST,
        !            26:        EACCES,
        !            27: };
        !            28: 
        !            29: /*
        !            30:  *  Convert a Unix error code to a dk error code
        !            31:  */
        !            32: int
        !            33: utodkerr(uerr)
        !            34: {
        !            35: #ifdef LINT
        !            36:        printf("%d\n", uerr);
        !            37: #endif
        !            38:        return 7;
        !            39: }
        !            40: 
        !            41: /*
        !            42:  *  Convert a dk error code to a Unix errstr and errno
        !            43:  */
        !            44: dktouerr(dkerr)
        !            45: {
        !            46:        dkerr &= 0x7f;
        !            47:        if (dkerr<=0 || dkerr>sizeof(errs)/sizeof(int)+1) {
        !            48:                errno = EGREG;
        !            49:                errstr = "unknown error";
        !            50:                return;
        !            51:        }
        !            52:        errno = errs[dkerr];
        !            53:        errstr = msgs[dkerr];
        !            54: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.