File system stuff.

This commit is contained in:
rsc 2003-12-06 18:08:52 +00:00
parent e97ceade5e
commit d3df308747
29 changed files with 3316 additions and 0 deletions

24
src/libfs/open.c Normal file
View file

@ -0,0 +1,24 @@
#include <u.h>
#include <libc.h>
#include <fcall.h>
#include <fs.h>
#include "fsimpl.h"
Fid*
fsopen(Fsys *fs, char *name, int mode)
{
Fid *fid;
Fcall tx, rx;
if((fid = fswalk(fs->root, name)) == nil)
return nil;
tx.type = Topen;
tx.fid = fid->fid;
tx.mode = mode;
if(fsrpc(fs, &tx, &rx, 0) < 0){
fsclose(fid);
return nil;
}
fid->mode = mode;
return fid;
}