|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmoss.drivers.MRamdisk
public class MRamdisk
this implements a "ramdisk" block device
| Field Summary |
|---|
| Fields inherited from interface moss.fs.MFileOps |
|---|
F_GETFL, F_OK, F_SETFL, LSEEK_BEG, LSEEK_CUR, LSEEK_END, O_CLOEXEC, O_NONBLOCK, OPEN_CREAT, OPEN_READ, OPEN_TRUNC, OPEN_WRITE, R_OK, W_OK, X_OK |
| Constructor Summary | |
|---|---|
MRamdisk()
constructor -- initialises the ramdisk |
|
| Method Summary | |
|---|---|
int |
close(MFile handle)
called when closing the ramdisk (it remains intact, however, unless garbage-collected) |
int |
fcntl(MFile handle,
int op,
int arg)
file-handle control |
int |
lseek(MFile handle,
int offset,
int whence)
seeks to a specific block in the ramdisk. |
int |
open(MFile handle,
int flags)
called when opening the ramdisk; stores reference to self in the file-handle |
int |
read(MFile handle,
byte[] buffer,
int count)
called to read a block from the ramdisk (at the current offset) |
int |
write(MFile handle,
byte[] buffer,
int count)
called to write data to the ramdisk (at the current offset) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MRamdisk()
| Method Detail |
|---|
public int open(MFile handle,
int flags)
open in interface MFileOpshandle - file-handleflags - open flags (ignored)
public int close(MFile handle)
close in interface MFileOpshandle - file-handle
public int lseek(MFile handle,
int offset,
int whence)
lseek in interface MFileOpshandle - file-handleoffset - block offsetwhence - where to seek from (LSEEK_{BEG,CUR,END})
public int read(MFile handle,
byte[] buffer,
int count)
read in interface MFileOpshandle - file-handlebuffer - buffer where data will be storedcount - maximum number of bytes to read
public int write(MFile handle,
byte[] buffer,
int count)
write in interface MFileOpshandle - file handlebuffer - data to writecount - number of bytes to write
public int fcntl(MFile handle,
int op,
int arg)
MFileOps
fcntl in interface MFileOpshandle - file-handleop - operation to performarg - argument to operation (if applicable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||