libnfs.c: add support for nfs_umask
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>libnfs-4.0.0-vitalif
parent
b53cd4d76c
commit
0c1a5c464c
|
@ -386,7 +386,14 @@ EXTERN int nfs_fstat64_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_c
|
||||||
*/
|
*/
|
||||||
EXTERN int nfs_fstat64(struct nfs_context *nfs, struct nfsfh *nfsfh, struct nfs_stat_64 *st);
|
EXTERN int nfs_fstat64(struct nfs_context *nfs, struct nfsfh *nfsfh, struct nfs_stat_64 *st);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UMASK() never blocks, so no special aync/async versions are available
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Sync umask(<mask>)
|
||||||
|
* Function returns the old mask.
|
||||||
|
*/
|
||||||
|
EXTERN uint16_t nfs_umask(struct nfs_context *nfs, uint16_t mask);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OPEN()
|
* OPEN()
|
||||||
|
|
|
@ -125,6 +125,7 @@ struct nfs_context {
|
||||||
uint64_t writemax;
|
uint64_t writemax;
|
||||||
char *cwd;
|
char *cwd;
|
||||||
struct nfsdir *dircache;
|
struct nfsdir *dircache;
|
||||||
|
uint16_t mask;
|
||||||
};
|
};
|
||||||
|
|
||||||
void nfs_free_nfsdir(struct nfsdir *nfsdir)
|
void nfs_free_nfsdir(struct nfsdir *nfsdir)
|
||||||
|
@ -412,7 +413,7 @@ struct nfs_context *nfs_init_context(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
nfs->cwd = strdup("/");
|
nfs->cwd = strdup("/");
|
||||||
|
nfs->mask = 022;
|
||||||
return nfs;
|
return nfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5095,3 +5096,9 @@ const struct nfs_fh3 *nfs_get_rootfh(struct nfs_context *nfs) {
|
||||||
struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh) {
|
struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh) {
|
||||||
return &nfsfh->fh;
|
return &nfsfh->fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t nfs_umask(struct nfs_context *nfs, uint16_t mask) {
|
||||||
|
uint16_t tmp = nfs->mask;
|
||||||
|
nfs->mask = mask;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue