Blob
1 #include <u.h>2 #include <libc.h>3 #include <fcall.h>4 #include <9pclient.h>5 #include "fsimpl.h"7 CFid*8 fscreate(CFsys *fs, char *name, int mode, ulong perm)9 {10 CFid *fid;11 Fcall tx, rx;13 if((fid = _fswalk(fs->root, name)) == nil)14 return nil;15 tx.type = Tcreate;16 tx.fid = fid->fid;17 tx.mode = mode;18 tx.perm = perm;19 if(_fsrpc(fs, &tx, &rx, 0) < 0){20 fsclose(fid);21 return nil;22 }23 fid->mode = mode;24 return fid;25 }