cdf3c586ec8d85f9dd14f4efb5ec8d217bfd963f
1 /* io.h - Virtual disk input/output */
3 /* Written 1993 by Werner Almesberger */
5 /* FAT32, VFAT, Atari format support, and various fixes additions May 1998
6 * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
12 //#include <sys/types.h> /* for loff_t */
15 /* In earlier versions, an own llseek() was used, but glibc lseek() is
16 * sufficient (or even better :) for 64 bit offsets in the meantime */
19 void fs_open(char *path
,int rw
);
21 /* Opens the file system PATH. If RW is zero, the file system is opened
22 read-only, otherwise, it is opened read-write. */
24 void fs_read(loff_t pos
,int size
,void *data
);
26 /* Reads SIZE bytes starting at POS into DATA. Performs all applicable
29 int fs_test(loff_t pos
,int size
);
31 /* Returns a non-zero integer if SIZE bytes starting at POS can be read without
32 errors. Otherwise, it returns zero. */
34 void fs_write(loff_t pos
,int size
,void *data
);
36 /* If write_immed is non-zero, SIZE bytes are written from DATA to the disk,
37 starting at POS. If write_immed is zero, the change is added to a list in
40 int fs_close(int write
);
42 /* Closes the file system, performs all pending changes if WRITE is non-zero
43 and removes the list of changes. Returns a non-zero integer if the file
44 system has been changed since the last fs_open, zero otherwise. */
48 /* Determines whether the file system has changed. See fs_close. */
50 extern unsigned device_no
;
52 /* Major number of device (0 if file) and size (in 512 byte sectors) */