~ubuntu-branches/ubuntu/raring/binkd/raring-proposed

« back to all changes in this revision

Viewing changes to dos/tcperr.c

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2002-03-24 22:52:25 UTC
  • Revision ID: james.westby@ubuntu.com-20020324225225-7ru6itlapn03nl35
Tags: upstream-0.9.5a
ImportĀ upstreamĀ versionĀ 0.9.5a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if defined(IBMTCPIPDOS)
 
2
  #include <sys/errno.h>
 
3
#else  
 
4
  #include <nerrno.h>
 
5
#endif
 
6
 
 
7
static const char *sockerrors[] =
 
8
{
 
9
  "Error 0",
 
10
  "Not owner",                              /* SOCBASEERR+1 */
 
11
  "Error 2",
 
12
  "No such process",                        /* SOCBASEERR+3 */
 
13
  "Interrupted system call",                /* SOCBASEERR+4 */
 
14
  "Error 5",
 
15
  "No such device or address",              /* SOCBASEERR+6 */
 
16
  "Error 7",
 
17
  "Error 8",
 
18
  "Bad file number",                        /* SOCBASEERR+9 */
 
19
  "Error 10",
 
20
  "Error 11",
 
21
  "Error 12",
 
22
  "Permission denied",                      /* SOCBASEERR+13 */
 
23
  "Bad address",                            /* SOCBASEERR+14 */
 
24
  "Error 15",
 
25
  "Error 16",
 
26
  "Error 17",
 
27
  "Error 18",
 
28
  "Error 19",
 
29
  "Error 20",
 
30
  "Error 21",
 
31
  "Invalid argument",                       /* SOCBASEERR+22 */
 
32
  "Error 23",
 
33
  "Too many open files",                    /* SOCBASEERR+24 */
 
34
  "Error 25",
 
35
  "Error 26",
 
36
  "Error 27",
 
37
  "Error 28",
 
38
  "Error 29",
 
39
  "Error 30",
 
40
  "Error 31",
 
41
  "Broken pipe",                            /* SOCBASEERR+32 */
 
42
  "Error 33",
 
43
  "Error 34",
 
44
  "Operation would block",                  /* SOCBASEERR+35 */
 
45
  "Operation now in progress",              /* SOCBASEERR+36 */
 
46
  "Operation already in progress",          /* SOCBASEERR+37 */
 
47
  "Socket operation on non-socket",         /* SOCBASEERR+38 */
 
48
  "Destination address required",           /* SOCBASEERR+39 */
 
49
  "Message too long",                       /* SOCBASEERR+40 */
 
50
  "Protocol wrong type for socket",         /* SOCBASEERR+41 */
 
51
  "Protocol not available",                 /* SOCBASEERR+42 */
 
52
  "Protocol not supported",                 /* SOCBASEERR+43 */
 
53
  "Socket type not supported",              /* SOCBASEERR+44 */
 
54
  "Operation not supported on socket",      /* SOCBASEERR+45 */
 
55
  "Protocol family not supported",          /* SOCBASEERR+46 */
 
56
  "Address family not supported by protocol family",    /* SOCBASEERR+47 */
 
57
  "Address already in use",                 /* SOCBASEERR+48 */
 
58
  "Can't assign requested address",         /* SOCBASEERR+49 */
 
59
  "Network is down",                        /* SOCBASEERR+50 */
 
60
  "Network is unreachable",                 /* SOCBASEERR+51 */
 
61
  "Network dropped connection on reset",    /* SOCBASEERR+52 */
 
62
  "Software caused connection abort",       /* SOCBASEERR+53 */
 
63
  "Connection reset by peer",               /* SOCBASEERR+54 */
 
64
  "No buffer space available",              /* SOCBASEERR+55 */
 
65
  "Socket is already connected",            /* SOCBASEERR+56 */
 
66
  "Socket is not connected",                /* SOCBASEERR+57 */
 
67
  "Can't send after socket shutdown",       /* SOCBASEERR+58 */
 
68
  "Too many references: can't splice",      /* SOCBASEERR+59 */
 
69
  "Connection timed out",                   /* SOCBASEERR+60 */
 
70
  "Connection refused",                     /* SOCBASEERR+61 */
 
71
  "Too many levels of symbolic links",      /* SOCBASEERR+62 */
 
72
  "File name too long",                     /* SOCBASEERR+63 */
 
73
  "Host is down",                           /* SOCBASEERR+64 */
 
74
  "No route to host",                       /* SOCBASEERR+65 */
 
75
  "Directory not empty"                     /* SOCBASEERR+66 */
 
76
};
 
77
 
 
78
int sock_errno( void );
 
79
 
 
80
const char *tcperr ()
 
81
{
 
82
  int err = tcperrno - 0;
 
83
 
 
84
  if (err == 100)
 
85
    return "OS/2 Error";                    /* SOCBASEERR+100 */
 
86
  else if (err > (sizeof (sockerrors) / sizeof (char *)))
 
87
    return "Unknown TCP/IP error";
 
88
  else
 
89
    return sockerrors[err];
 
90
}