]> git.sur5r.net Git - openldap/blob - libraries/msdos/winsock/include/wsa/errno.c
no longer supported.
[openldap] / libraries / msdos / winsock / include / wsa / errno.c
1 #include <winsock.h>
2
3 /* Copies string corresponding to the error code provided    */
4 /* into buf, maximum length len. Returns length actually     */
5 /* copied to buffer, or zero if error code is unknown.       */
6 /* String resources should be present for each error code    */
7 /* using the value of the code as the string ID (except for  */
8 /* error = 0, which is mapped to WSABASEERR to keep it with  */
9 /* the others). The DLL is free to use any string IDs that   */
10 /* are less than WSABASEERR for its own use. The LibMain     */
11 /* procedure of the DLL is presumed to have saved its        */
12 /* HINSTANCE in the global variable hInst.                   */
13
14 int PASCAL FAR WSAsperror (int errorcode, char far * buf, int len)
15 {
16         if (errorcode == 0)
17                 errorcode = WSABASEERR;
18         if (errorcode < WSABASEERR)
19                 return 0;
20         return LoadString(hInst,errorcode,buf,len);
21 }