home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / comm / tcp / amitcp / src / netlib / strerror.c < prev    next >
C/C++ Source or Header  |  1994-02-26  |  2KB  |  80 lines

  1. RCS_ID_C="$Id: strerror.c,v 3.5 1994/02/26 17:57:21 jraja Exp $";
  2. /*
  3.  * strerror.c --- network errno support for AmiTCP/IP
  4.  *
  5.  * Author: ppessi <Pekka.Pessi@hut.fi>
  6.  *
  7.  * Copyright © 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  8.  *                  Helsinki University of Technology, Finland.
  9.  *                  All rights reserved.
  10.  *
  11.  * Created      : Sat Mar 20 02:03:45 1993 ppessi
  12.  * Last modified: Sat Feb 26 19:53:12 1994 jraja
  13.  *
  14.  * $Log: strerror.c,v $
  15.  * Revision 3.5  1994/02/26  17:57:21  jraja
  16.  * Fixed includes.
  17.  *
  18.  * Revision 3.4  1994/02/15  20:58:54  jraja
  19.  * A little more efficient version.
  20.  *
  21.  * Revision 3.3  1994/02/03  19:23:54  ppessi
  22.  * Fixed documentation and prototypes
  23.  *
  24.  * Revision 3.2  1994/01/23  22:58:35  jraja
  25.  * Added autodoc.
  26.  *
  27.  */
  28.  
  29. #include <errno.h>
  30. #include <bsdsocket.h>
  31. #include <amitcp/socketbasetags.h>
  32.  
  33. /****** net.lib/strerror *****************************************************
  34.  
  35.     NAME
  36.         strerror -- return the text for given error number
  37.  
  38.     SYNOPSIS
  39.         string = strerror(error);
  40.  
  41.         char * strerror(int);
  42.  
  43.     FUNCTION
  44.         This function returns pointer to the (English) string describing the
  45.         error code given as argument. The error strings are defined for the
  46.         error codes defined in <sys/errno.h>.
  47.  
  48.     NOTES
  49.         The string pointed to by the return value should not be modified by
  50.         the program, but may be overwritten by a subsequent call to this
  51.         function.
  52.  
  53.     BUGS
  54.         The strerror() prototype should be 
  55.     const char *strerror(unsigned int); 
  56.     However, the SAS C includes define it differently.
  57.  
  58.     SEE ALSO
  59.         <netinclude:sys/errno.h>, perror(), PrintNetFault()
  60. *****************************************************************************
  61. */
  62.  
  63. #ifdef notyet
  64. const char *
  65. strerror(unsigned int error)
  66. #else
  67. char *
  68. strerror(int error)
  69. #endif
  70. {
  71.   ULONG taglist[3];
  72.  
  73.   taglist[0] = SBTM_GETVAL(SBTC_ERRNOSTRPTR);
  74.   taglist[1] = error;
  75.   taglist[2] = TAG_END;
  76.  
  77.   SocketBaseTagList((struct TagItem *)taglist);
  78.   return (char *)taglist[1];
  79. }
  80.