home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_src_sys_c_os < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  1.3 KB  |  58 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/sys/c/RCS/os,v $
  4.  * $Date: 1996/09/16 21:23:52 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: os,v $
  10.  * Revision 1.2  1996/09/16 21:23:52  unixlib
  11.  * CL_0002 Nick Burret
  12.  * Minor changes to file handling
  13.  * Change most error numbers, and use in assembler sources (SJC)
  14.  * Various minor bug fixes and compatability changes.
  15.  *
  16.  * Revision 1.1  1996/04/19 21:34:24  simon
  17.  * Initial revision
  18.  *
  19.  ***************************************************************************/
  20.  
  21. static const char rcs_id[] = "$Id: os,v 1.2 1996/09/16 21:23:52 unixlib Rel $";
  22.  
  23. #include <errno.h>
  24. #include <string.h>
  25.  
  26. #include <sys/os.h>
  27.  
  28. static _kernel_oserror the_error;
  29.  
  30. void
  31. __seterr (register _kernel_oserror * e)
  32. {
  33.   if (!e)
  34.     {
  35.       errno = 0;
  36.       return;
  37.     }
  38.  
  39.   errno = EOPSYS;
  40.   /* make sure the error message is stored safely for later diagnostics */
  41.   the_error.errnum = e->errnum;
  42.   strncpy (the_error.errmess, e->errmess, sizeof (the_error.errmess));
  43.   sys_errlist[EOPSYS] = the_error.errmess;
  44. }
  45.  
  46. void
  47. __seterr_ (register char *s)
  48. {
  49.   if (!s)
  50.     {
  51.       errno = 0;
  52.       return;
  53.     }
  54.  
  55.   errno = EOPSYS;
  56.   sys_errlist[EOPSYS] = s;
  57. }
  58.