mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-30 11:54:57 +00:00
25 lines
418 B
C
25 lines
418 B
C
#include <u.h>
|
|
#include <libc.h>
|
|
#include <fcall.h>
|
|
#include <9pclient.h>
|
|
#include "fsimpl.h"
|
|
|
|
CFid*
|
|
fscreate(CFsys *fs, char *name, int mode, ulong perm)
|
|
{
|
|
CFid *fid;
|
|
Fcall tx, rx;
|
|
|
|
if((fid = _fswalk(fs->root, name)) == nil)
|
|
return nil;
|
|
tx.type = Tcreate;
|
|
tx.fid = fid->fid;
|
|
tx.mode = mode;
|
|
tx.perm = perm;
|
|
if(_fsrpc(fs, &tx, &rx, 0) < 0){
|
|
fsclose(fid);
|
|
return nil;
|
|
}
|
|
fid->mode = mode;
|
|
return fid;
|
|
}
|