SunNFS.mesa
Demers, October 7, 1987 12:53:38 pm PDT
DIRECTORY
SunRPC USING [Handle],
SunRPCAuth USING [Conversation]
;
SunNFS: CEDAR DEFINITIONS
~ {
Constants
program: CARD ~ 100003;
programVersion: CARD ~ 2;
Parameters
maxData: CARDINAL ~ 8*1024;
maxPathLen: CARDINAL ~ 1024;
maxNameLen: CARDINAL ~ 255;
cookieSize: CARDINAL ~ 4;
fhSize: CARDINAL ~ 32;
Types
Handle: TYPE ~ SunRPC.Handle;
Conversation: TYPE ~ SunRPCAuth.Conversation;
Stat: TYPE ~ MACHINE DEPENDENT {
ok(0),
perm(1), -- caller is not owner
noent(2), -- no such file or directory
io(5), -- I/O error
nxio(6), -- no such device or address
acces(13), -- access permission denied
exist(17), -- file already exists
nodev(19), -- no such device
notdir(20), -- argument not a directory and should be
isdir(21), -- argument is a directory and shouldn't be
fbig(27), -- file would grow too big
nospc(28), -- no space left on device
rofs(30), -- file system is readonly
nametoolong(63), -- file name too long
notempty(66), -- attempt to remove a nonemtpy directory
dquot(69), -- disk quota exceeded
stale(70), -- fhandle argument no longer valid
wflush(99) -- obsolete
};
FType: TYPE ~ MACHINE DEPENDENT {
non(0), -- not a file
reg(1), -- regular file
dir(2), -- directory
blk(3), -- block special file
chr(4), -- character special file
lnk(5) -- symbolic link
};
FHandle: TYPE ~ REF TEXT; -- opaque file handle [fhSize]
TimeVal: TYPE ~ RECORD [
seconds: CARD,
useconds: CARD
];
Seconds + microseconds since 00:00 1 Jan 1970 GMT
FAttr: TYPE ~ RECORD [
type: FType,
mode: CARD,
nlink: CARD,
uid: CARD,
gid: CARD,
size: CARD,
blocksize: CARD,
rdev: CARD,
blocks: CARD,
fsid: CARD,
fileid: CARD,
atime: TimeVal,
mtime: TimeVal,
ctime: TimeVal
];
SAttr: TYPE ~ RECORD [
mode: CARD,
uid: CARD,
gid: CARD,
size: CARD,
atime: TimeVal,
mtime: TimeVal
];
FileName: TYPE ~ REF TEXT; -- <= maxNameLen
Path: TYPE ~ REF TEXT; -- <= maxPathLen
AttrStat: TYPE ~ RECORD [
status: Stat,
attributes: FAttr -- valid only if status = ok
];
DirOpArgs: TYPE ~ RECORD [
dir: FHandle,
name: FileName
];
DirOpRes: TYPE ~ RECORD [
status: Stat,
file: FHandle, -- valid only if status = ok
attributes: FAttr -- valid only if status = ok
];
Cookie: TYPE ~ REF TEXT; -- opaque directory position [cookieSize]
FSAttr: TYPE ~ RECORD [
tsize: CARD,
bsize: CARD,
blocks: CARD,
bfree: CARD,
bavail: CARD
];
FSAttrStat: TYPE ~ RECORD [
status: Stat,
attributes: FSAttr -- valid only if status = ok
];
Procedure constants and types
null: CARD ~ 0;
NullProc: TYPE ~ PROC [h: Handle, c: Conversation];
getattr: CARD ~ 1;
GetattrProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle]
RETURNS [reply: AttrStat];
setattr: CARD ~ 2;
SetattrProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle, attributes: SAttr]
RETURNS [reply: AttrStat];
lookup: CARD ~ 4;
LookupProc: TYPE ~ PROC [h: Handle, c: Conversation, which: DirOpArgs]
RETURNS [reply: DirOpRes];
readlink: CARD ~ 5;
ReadlinkProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle]
RETURNS [status: Stat, data: Path];
read: CARD ~ 6;
ReadProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle, offset, count, bOffset: CARD, block: REF TEXT]
RETURNS [reply: AttrStat];
write: CARD ~ 8;
WriteProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle, offset, count, bOffset: CARD, block: REF TEXT]
RETURNS [reply: AttrStat];
create: CARD ~ 9;
CreateProc: TYPE ~ PROC [h: Handle, c: Conversation, where: DirOpArgs, attributes: SAttr]
RETURNS [reply: DirOpRes];
remove: CARD ~ 10;
RemoveProc: TYPE ~ PROC [h: Handle, c: Conversation, which: DirOpArgs]
RETURNS [status: Stat];
rename: CARD ~ 11;
RenameProc: TYPE ~ PROC [h: Handle, c: Conversation, from, to: DirOpArgs]
RETURNS [status: Stat];
link: CARD ~ 12;
LinkProc: TYPE ~ PROC [h: Handle, c: Conversation, to: FHandle, as: DirOpArgs]
RETURNS [status: Stat];
symlink: CARD ~ 13;
SymlinkProc: TYPE ~ PROC [h: Handle, c: Conversation, from: DirOpArgs, to: Path, attributes: SAttr]
RETURNS [status: Stat];
mkdir: CARD ~ 14;
MkdirProc: TYPE ~ PROC [h: Handle, c: Conversation, where: DirOpArgs, attributes: SAttr]
RETURNS [reply: DirOpRes];
rmdir: CARD ~ 15;
RmdirProc: TYPE ~ PROC [h: Handle, c: Conversation, which: DirOpArgs]
RETURNS [status: Stat];
readdir: CARD ~ 16;
ReaddirProc: TYPE ~ PROC [h: Handle, c: Conversation, dir: FHandle, cookie: Cookie ← NIL, count: CARD, eachDirEntry: EachDirEntryProc]
RETURNS [status: Stat, eof: BOOL, newCookie: Cookie];
EachDirEntryProc: TYPE ~ PROC [fileid: CARD, filename: -- ephemeral -- FileName]
RETURNS [continue: BOOLTRUE];
statfs: CARD ~ 17;
StatfsProc: TYPE ~ PROC [h: Handle, c: Conversation, file: FHandle]
RETURNS [reply: FSAttrStat];
}...