home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / filesy~1 / mfs610s.zoo / minixfs / io.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-25  |  837 b   |  40 lines

  1. /* This file is part of 'minixfs' Copyright 1991,1992,1993 S.N.Henson */
  2.  
  3. #include "minixfs.h"
  4. #include "global.h"
  5. #include "proto.h"
  6.  
  7. /* This is a 'corrected rwabs' , it behaves as though sector-size==1K
  8.  * irrespective of what it really is. Currently it only supports 512 byte 
  9.  * and 1K sectors , also if the extended rwabs is needed use it .
  10.  */
  11.  
  12. void crwabs(rw,buf,num,recno,dev)
  13. int rw;
  14. void *buf;
  15. unsigned num;
  16. long recno;
  17. int dev;
  18. {
  19.     long r;
  20.  
  21.     if(!super_ptr[dev]) {
  22.         ALERT("Minixfs : attempted I/O with illegal Drive %c:",dev+'A');
  23.         ALERT("Minixfs : please submit a bug report!");
  24.         return;
  25.     }
  26.  
  27.     if( (rw & 1) && (recno < 2) )
  28.     {
  29.         ALERT("Minixfs: illegal write");
  30.         return;
  31.     }
  32.  
  33.     r = block_rwabs(rw,buf,num,recno,&disk[dev]);
  34.  
  35.     if (r) ALERT("minixfs: Rwabs returned %ld sector %ld drive %c:"
  36.                 , r,recno,dev+'A');
  37.  
  38.     return;
  39. }
  40.