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

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/chdir,v $
  4.  * $Date: 1996/10/30 21:59:01 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: chdir,v $
  10.  * Revision 1.2  1996/10/30 21:59:01  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.1  1996/04/19 21:35:27  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. static const char rcs_id[] = "$Id: chdir,v 1.2 1996/10/30 21:59:01 unixlib Rel $";
  19.  
  20. #include <errno.h>
  21.  
  22. #include <unistd.h>
  23. #include <sys/os.h>
  24.  
  25. int
  26. chdir (const char *path)
  27. {
  28.   _kernel_oserror *e;
  29.   char *p;
  30.  
  31.   p = __uname ((char *)path, 0);
  32.  
  33.   if (e = os_fsctrl (0, p, 0, 0))
  34.     {
  35.       __seterr (e);
  36.       return (-1);
  37.     }
  38.  
  39.   return (0);
  40. }
  41.