home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixtools / util / c / chdir < prev    next >
Encoding:
Text File  |  1992-07-21  |  364 b   |  22 lines

  1. /* C.Chdir: Change directory */
  2.  
  3. #include "kernel.h"
  4.  
  5. #include "utils.h"
  6.  
  7. #define SetDir        0
  8. #define OS_FSControl    0x29
  9.  
  10. int chdir (const char *dir)
  11. {
  12.         _kernel_swi_regs regs;
  13.  
  14.         regs.r[0] = SetDir;
  15.         regs.r[1] = (int)dir;
  16.  
  17.         if ( _kernel_swi(OS_FSControl,®s,®s) )
  18.                 return -1;
  19.         else
  20.                 return 0;
  21. }
  22.