Tcl Source Code

Attachment Details
Login
Overview

Artifact ID: ba23d513b43d3e9d79694a3b202522831a823b65
Ticket: 219237ffffffffffffffffffffffffffffffffff
Date: 2003-04-23 03:55:17
User: davygrvy
Artifact Attached: 813c6e5b916b15687069d25e07da2ec525349a66
Filename:patch.txt
Description:patch for future reference to show how posix misses the mark.
Content:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
   100
   101
   102
   103
   104
   105
   106
   107
   108
   109
   110
   111
   112
   113
   114
   115
   116
   117
   118
   119
   120
   121
   122
   123
   124
   125
   126
   127
   128
   129
   130
   131
   132
   133
Index: tclWinError.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinError.c,v
retrieving revision 1.5
diff -c -r1.5 tclWinError.c
*** tclWinError.c	27 May 2002 10:14:21 -0000	1.5
--- tclWinError.c	22 Apr 2003 20:51:52 -0000
***************
*** 297,303 ****
   * errno errors.
   */
  
! static int wsaErrorTable[] = {
      EWOULDBLOCK,	/* WSAEWOULDBLOCK */
      EINPROGRESS,	/* WSAEINPROGRESS */
      EALREADY,		/* WSAEALREADY */
--- 297,303 ----
   * errno errors.
   */
  
! static int wsaErrorTable1[] = {
      EWOULDBLOCK,	/* WSAEWOULDBLOCK */
      EINPROGRESS,	/* WSAEINPROGRESS */
      EALREADY,		/* WSAEALREADY */
***************
*** 336,341 ****
--- 336,414 ----
      ESTALE,		/* WSAESTALE */
      EREMOTE,		/* WSAEREMOTE */
  };
+ 
+ /*
+  * These error codes are very windows specific and have no POSIX
+  * translation, yet.
+  *
+  * TODO: Fixme!
+  */
+ 
+ static int wsaErrorTable2[] = {
+     EINVAL,		/* WSASYSNOTREADY	    WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable. */
+     EINVAL,		/* WSAVERNOTSUPPORTED	    The Windows Sockets version requested is not supported. */
+     EINVAL,		/* WSANOTINITIALISED	    Either the application has not called WSAStartup, or WSAStartup failed. */
+     0,
+     0,
+     0,
+     0,
+     0,
+     0,
+     0,
+     EINVAL,		/* WSAEDISCON		    Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence. */
+     EINVAL,		/* WSAENOMORE		    No more results can be returned by WSALookupServiceNext. */
+     EINVAL,		/* WSAECANCELLED	    A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. */
+     EINVAL,		/* WSAEINVALIDPROCTABLE	    The procedure call table is invalid. */
+     EINVAL,		/* WSAEINVALIDPROVIDER	    The requested service provider is invalid. */
+     EINVAL,		/* WSAEPROVIDERFAILEDINIT   The requested service provider could not be loaded or initialized. */
+     EINVAL,		/* WSASYSCALLFAILURE	    A system call that should never fail has failed. */
+     EINVAL,		/* WSASERVICE_NOT_FOUND	    No such service is known. The service cannot be found in the specified name space. */
+     EINVAL,		/* WSATYPE_NOT_FOUND	    The specified class was not found. */
+     EINVAL,		/* WSA_E_NO_MORE	    No more results can be returned by WSALookupServiceNext. */
+     EINVAL,		/* WSA_E_CANCELLED	    A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. */
+     EINVAL,		/* WSAEREFUSED		    A database query failed because it was actively refused. */
+ };
+ 
+ /*
+  * These error codes are very windows specific and have no POSIX
+  * translation, yet.
+  *
+  * TODO: Fixme!
+  */
+ 
+ static int wsaErrorTable3[] = {
+     EINVAL,	/* WSAHOST_NOT_FOUND,	Authoritative Answer: Host not found */
+     EINVAL,	/* WSATRY_AGAIN,	Non-Authoritative: Host not found, or SERVERFAIL */
+     EINVAL,	/* WSANO_RECOVERY,	Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
+     EINVAL,	/* WSANO_DATA,		Valid name, no data record of requested type */
+     EINVAL,	/* WSA_QOS_RECEIVERS,		at least one Reserve has arrived */
+     EINVAL,	/* WSA_QOS_SENDERS,		at least one Path has arrived */
+     EINVAL,	/* WSA_QOS_NO_SENDERS,		there are no senders */
+     EINVAL,	/* WSA_QOS_NO_RECEIVERS,	there are no receivers */
+     EINVAL,	/* WSA_QOS_REQUEST_CONFIRMED,	Reserve has been confirmed */
+     EINVAL,	/* WSA_QOS_ADMISSION_FAILURE,	error due to lack of resources */
+     EINVAL,	/* WSA_QOS_POLICY_FAILURE,	rejected for administrative reasons - bad credentials */
+     EINVAL,	/* WSA_QOS_BAD_STYLE,		unknown or conflicting style */
+     EINVAL,	/* WSA_QOS_BAD_OBJECT,		problem with some part of the filterspec or providerspecific buffer in general */
+     EINVAL,	/* WSA_QOS_TRAFFIC_CTRL_ERROR,	problem with some part of the flowspec */
+     EINVAL,	/* WSA_QOS_GENERIC_ERROR,	general error */
+     EINVAL,	/* WSA_QOS_ESERVICETYPE,	invalid service type in flowspec */
+     EINVAL,	/* WSA_QOS_EFLOWSPEC,		invalid flowspec */
+     EINVAL,	/* WSA_QOS_EPROVSPECBUF,	invalid provider specific buffer */
+     EINVAL,	/* WSA_QOS_EFILTERSTYLE,	invalid filter style */
+     EINVAL,	/* WSA_QOS_EFILTERTYPE,		invalid filter type */
+     EINVAL,	/* WSA_QOS_EFILTERCOUNT,	incorrect number of filters */
+     EINVAL,	/* WSA_QOS_EOBJLENGTH,		invalid object length */
+     EINVAL,	/* WSA_QOS_EFLOWCOUNT,		incorrect number of flows */
+     EINVAL,	/* WSA_QOS_EUNKOWNPSOBJ,	unknown object in provider specific buffer */
+     EINVAL,	/* WSA_QOS_EPOLICYOBJ,		invalid policy object in provider specific buffer */
+     EINVAL,	/* WSA_QOS_EFLOWDESC,		invalid flow descriptor in the list */
+     EINVAL,	/* WSA_QOS_EPSFLOWSPEC,		inconsistent flow spec in provider specific buffer */
+     EINVAL,	/* WSA_QOS_EPSFILTERSPEC,	invalid filter spec in provider specific buffer */
+     EINVAL,	/* WSA_QOS_ESDMODEOBJ,		invalid shape discard mode object in provider specific buffer */
+     EINVAL,	/* WSA_QOS_ESHAPERATEOBJ,	invalid shaping rate object in provider specific buffer */
+     EINVAL,	/* WSA_QOS_RESERVED_PETYPE,	reserved policy element in provider specific buffer */
+ };
  
  /*
   *----------------------------------------------------------------------
***************
*** 382,391 ****
  
  void
  TclWinConvertWSAError(errCode)
!     DWORD errCode;		/* Win32 error code. */
  {
      if ((errCode >= WSAEWOULDBLOCK) && (errCode <= WSAEREMOTE)) {
! 	Tcl_SetErrno(wsaErrorTable[errCode - WSAEWOULDBLOCK]);
      } else {
  	Tcl_SetErrno(EINVAL);
      }
--- 455,468 ----
  
  void
  TclWinConvertWSAError(errCode)
!     DWORD errCode;		/* Winsock error code. */
  {
      if ((errCode >= WSAEWOULDBLOCK) && (errCode <= WSAEREMOTE)) {
! 	Tcl_SetErrno(wsaErrorTable1[errCode - WSAEWOULDBLOCK]);
!     } else if ((errCode >= WSASYSNOTREADY) && (errCode <= WSAEREFUSED)) {
! 	Tcl_SetErrno(wsaErrorTable2[errCode - WSASYSNOTREADY]);
!     } else if ((errCode >= WSAHOST_NOT_FOUND) && (errCode <= WSA_QOS_RESERVED_PETYPE)) {
! 	Tcl_SetErrno(wsaErrorTable3[errCode - WSAHOST_NOT_FOUND]);
      } else {
  	Tcl_SetErrno(EINVAL);
      }