diff --git a/crt/fs_dev.c b/crt/fs_dev.c index 45f7aa3..9f5bdee 100644 --- a/crt/fs_dev.c +++ b/crt/fs_dev.c @@ -938,10 +938,14 @@ fs_chmod(struct _reent *r, return -1; } + rc = FSChangeMode(fsClient, fsCmd, path_fix, (FSMode)mode, -1) free(path_fix); - //TODO: FSChangeMode - r->_errno = ENOSYS; + if (rc >= 0) { + return 0; + } + + r->_errno = fs_translate_error(rc); return -1; } @@ -950,7 +954,8 @@ fs_fchmod(struct _reent *r, int fd, mode_t mode) { - //TODO: FSChangeMode + //TODO: FSChangeMode and FSStatFile? + r->_errno = ENOSYS; return -1; } diff --git a/include/coreinit/filesystem.h b/include/coreinit/filesystem.h index 277ad44..363bf11 100644 --- a/include/coreinit/filesystem.h +++ b/include/coreinit/filesystem.h @@ -370,6 +370,35 @@ FSCloseDirAsync(FSClient *client, FSDirectoryHandle handle, uint32_t flags, FSAsyncData *asyncData); +FSStatus +FSChangeMode(FSClient *client, + FSCmdBlock *block, + char *path, + FSMode mode, + uint32_t flags); + +FSStatus +FSChangeModeAsync(FSClient *client, + FSCmdBlock *block, + char *path, + FSMode mode, + uint32_t flags, + FSAsyncData *asyncData); + +FSStatus +FSGetFreeSpaceSize(FSClient *client, + FSCmdBlock *block, + char *path, + u64 *outSize, + uint32_t flags); + +FSStatus +FSGetFreeSpaceSizeAsync(FSClient *client, + FSCmdBlock *block, + char *path, + u64 *outSize, + uint32_t flags, + FSAsyncData *asyncData); FSStatus FSGetStatFile(FSClient *client, @@ -572,6 +601,19 @@ FSUnmount(FSClient *client, const char *target, uint32_t flags); +FSStatus +FSBindMount(FSClient *client, + FSCmdBlock *cmd, + const char *source, + const char *target, + uint32_t flags); + +FSStatus +FSbindUnmount(FSClient *client, + FSCmdBlock *cmd, + const char *target, + uint32_t flags); + #ifdef __cplusplus } #endif diff --git a/rpl/libcoreinit/exports.h b/rpl/libcoreinit/exports.h index 3f546ac..61417f1 100644 --- a/rpl/libcoreinit/exports.h +++ b/rpl/libcoreinit/exports.h @@ -138,6 +138,10 @@ EXPORT(FSSetStateChangeNotification); EXPORT(FSGetCwd); EXPORT(FSChangeDir); EXPORT(FSChangeDirAsync); +EXPORT(FSChangeMode); +EXPORT(FSChangeModeAsync); +EXPORT(FSGetFreeSpaceSize); +EXPORT(FSGetFreeSpaceSizeAsync); EXPORT(FSGetStat); EXPORT(FSGetStatAsync); EXPORT(FSRemove); @@ -180,6 +184,8 @@ EXPORT(FSGetLastErrorCodeForViewer); EXPORT(FSGetMountSource); EXPORT(FSMount); EXPORT(FSUnmount); +EXPORT(FSBindMount); +EXPORT(FSBindUnmount); // coreinit/foreground.h EXPORT(OSEnableForegroundExit);