DEFINITION MODULE SockErrnums;

        (********************************************************)
        (*                                                      *)
        (*       Error numbers for the sockets interface        *)
        (*                                                      *)
        (*  This is basically a copy of \os2tk45\h\nerrno.h     *)
        (*                                                      *)
        (*  Programmer:         P. Moylan                       *)
        (*  Started:            26 November 2017                *)
        (*  Last edited:        26 November 2017                *)
        (*  Status:             OK                              *)
        (*                                                      *)
        (********************************************************)

CONST
    SOCBASEERR              = 10000;

CONST
    SOCEPERM                = SOCBASEERR+1;             (* Not owner *)
    SOCENOENT               = SOCBASEERR+2;             (* No such file or directory *)
    SOCESRCH                = SOCBASEERR+3;             (* No such process *)
    SOCEINTR                = SOCBASEERR+4;             (* Interrupted system call *)
    SOCEIO                  = SOCBASEERR+5;             (* Input/output error *)
    SOCENXIO                = SOCBASEERR+6;             (* No such device or address *)
    SOCE2BIG                = SOCBASEERR+7;             (* Argument list too long *)
    SOCENOEXEC              = SOCBASEERR+8;             (* Exec format error *)
    SOCEBADF                = SOCBASEERR+9;             (* Bad file number *)
    SOCECHILD               = SOCBASEERR+10;            (* No child processes *)
    SOCEDEADLK              = SOCBASEERR+11;            (* Resource deadlock avoided *)
    SOCENOMEM               = SOCBASEERR+12;            (* Cannot allocate memory *)
    SOCEACCES               = SOCBASEERR+13;            (* Permission denied *)
    SOCEFAULT               = SOCBASEERR+14;            (* Bad address *)
    SOCENOTBLK              = SOCBASEERR+15;            (* Block device required *)
    SOCEBUSY                = SOCBASEERR+16;            (* Device busy *)
    SOCEEXIST               = SOCBASEERR+17;            (* File exists *)
    SOCEXDEV                = SOCBASEERR+18;            (* Cross-device link *)
    SOCENODEV               = SOCBASEERR+19;            (* Operation not supported by device *)
    SOCENOTDIR              = SOCBASEERR+20;            (* Not a directory *)
    SOCEISDIR               = SOCBASEERR+21;            (* Is a directory *)
    SOCEINVAL               = SOCBASEERR+22;            (* Invalid argument *)
    SOCENFILE               = SOCBASEERR+23;            (* Too many open files in system*)
    SOCEMFILE               = SOCBASEERR+24;            (* Too many open files *)
    SOCENOTTY               = SOCBASEERR+25;            (* Inappropriate ioctl for device *)
    SOCETXTBSY              = SOCBASEERR+26;            (* Text file busy *)
    SOCEFBIG                = SOCBASEERR+27;            (* File too large *)
    SOCENOSPC               = SOCBASEERR+28;            (* No space left on device *)
    SOCESPIPE               = SOCBASEERR+29;            (* Illegal seek *)
    SOCEROFS                = SOCBASEERR+30;            (* Read-only file system *)
    SOCEMLINK               = SOCBASEERR+31;            (* Too many links *)
    SOCEPIPE                = SOCBASEERR+32;            (* Broken pipe *)

    (* math software *)

    SOCEDOM                 = SOCBASEERR+33;            (* Numerical argument out of domain *)
    SOCERANGE               = SOCBASEERR+34;            (* Result too large *)

    (* non-blocking and interrupt i/o *)

    SOCEAGAIN               = SOCBASEERR+35;            (* Resource temporarily unavailable *)
    SOCEWOULDBLOCK          = SOCEAGAIN;                (* Operation would block *)
    SOCEINPROGRESS          = SOCBASEERR+36;            (* Operation now in progress *)
    SOCEALREADY             = SOCBASEERR+37;            (* Operation already in progress *)

    (* ipc/network software -- argument errors *)

    SOCENOTSOCK             = SOCBASEERR+38;            (* Socket operation on non-socket *)
    SOCEDESTADDRREQ         = SOCBASEERR+39;            (* Destination address required *)
    SOCEMSGSIZE             = SOCBASEERR+40;            (* Message too long *)
    SOCEPROTOTYPE           = SOCBASEERR+41;            (* Protocol wrong type for socket *)
    SOCENOPROTOOPT          = SOCBASEERR+42;            (* Protocol not available *)
    SOCEPROTONOSUPPORT      = SOCBASEERR+43;            (* Protocol not supported *)
    SOCESOCKTNOSUPPORT      = SOCBASEERR+44;            (* Socket type not supported *)
    SOCEOPNOTSUPP           = SOCBASEERR+45;            (* Operation not supported *)
    SOCEPFNOSUPPORT         = SOCBASEERR+46;            (* Protocol family not supported *)
    SOCEAFNOSUPPORT         = SOCBASEERR+47;            (* Address family not supported by protocol family *)
    SOCEADDRINUSE           = SOCBASEERR+48;            (* Address already in use *)
    SOCEADDRNOTAVAIL        = SOCBASEERR+49;            (* Can't assign requested address *)

    (* ipc/network software -- operational errors *)

    SOCENETDOWN             = SOCBASEERR+50;            (* Network is down *)
    SOCENETUNREACH          = SOCBASEERR+51;            (* Network is unreachable *)
    SOCENETRESET            = SOCBASEERR+52;            (* Network dropped connection on reset *)
    SOCECONNABORTED         = SOCBASEERR+53;            (* Software caused connection abort *)
    SOCECONNRESET           = SOCBASEERR+54;            (* Connection reset by peer *)
    SOCENOBUFS              = SOCBASEERR+55;            (* No buffer space available *)
    SOCEISCONN              = SOCBASEERR+56;            (* Socket is already connected *)
    SOCENOTCONN             = SOCBASEERR+57;            (* Socket is not connected *)
    SOCESHUTDOWN            = SOCBASEERR+58;            (* Can't send after socket shutdown *)
    SOCETOOMANYREFS         = SOCBASEERR+59;            (* Too many references: can't splice *)
    SOCETIMEDOUT            = SOCBASEERR+60;            (* Operation timed out *)
    SOCECONNREFUSED         = SOCBASEERR+61;            (* Connection refused *)

    SOCELOOP                = SOCBASEERR+62;            (* Too many levels of symbolic links *)
    SOCENAMETOOLONG         = SOCBASEERR+63;            (* File name too long *)

    (* should be rearranged *)

    SOCEHOSTDOWN            = SOCBASEERR+64;             (* Host is down *)
    SOCEHOSTUNREACH         = SOCBASEERR+65;             (* No route to host *)
    SOCENOTEMPTY            = SOCBASEERR+66;             (* Directory not empty *)

    (* quotas & mush *)

    SOCEPROCLIM             = SOCBASEERR+67;             (* Too many processes *)
    SOCEUSERS               = SOCBASEERR+68;             (* Too many users *)
    SOCEDQUOT               = SOCBASEERR+69;             (* Disc quota exceeded *)

    (* Network File System *)

    SOCESTALE               = SOCBASEERR+70;             (* Stale NFS file handle *)
    SOCEREMOTE              = SOCBASEERR+71;             (* Too many levels of remote in path *)
    SOCEBADRPC              = SOCBASEERR+72;             (* RPC struct is bad *)
    SOCERPCMISMATCH         = SOCBASEERR+73;             (* RPC version wrong *)
    SOCEPROGUNAVAIL         = SOCBASEERR+74;             (* RPC prog. not avail *)
    SOCEPROGMISMATCH        = SOCBASEERR+75;             (* Program version wrong *)
    SOCEPROCUNAVAIL         = SOCBASEERR+76;             (* Bad procedure for program *)

    SOCENOLCK               = SOCBASEERR+77;             (* No locks available *)
    SOCENOSYS               = SOCBASEERR+78;             (* Function not implemented *)

    SOCEFTYPE               = SOCBASEERR+79;             (* Inappropriate file type or format *)
    SOCEAUTH                = SOCBASEERR+80;             (* Authentication error *)
    SOCENEEDAUTH            = SOCBASEERR+81;             (* Need authenticator *)

    SOCEOS2ERR              = SOCBASEERR+100;            (* OS/2 Error *)
    SOCELAST                = SOCBASEERR+100;            (* Must be equal largest errno *)

END SockErrnums.

