Added romfsMountFromCurrentProcess().

This commit is contained in:
yellows8 2019-05-17 11:15:43 -04:00
parent f6f6adf1cb
commit 90620daf05
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 16 additions and 0 deletions

View File

@ -84,6 +84,12 @@ static inline Result romfsInitFromStorage(FsStorage storage, u64 offset)
return romfsMountFromStorage(storage, offset, "romfs");
}
/**
* @brief Mounts RomFS using the current process host title RomFS.
* @param name Device mount name.
*/
Result romfsMountFromCurrentProcess(const char *name);
/**
* @brief Mounts RomFS from a file path in a mounted fsdev device.
* @param path File path.

View File

@ -317,6 +317,16 @@ Result romfsMountFromStorage(FsStorage storage, u64 offset, const char *name)
return romfsMountCommon(name, mount);
}
Result romfsMountFromCurrentProcess(const char *name) {
FsStorage storage;
Result rc = fsOpenDataStorageByCurrentProcess(&storage);
if (R_FAILED(rc))
return rc;
return romfsMountFromStorage(storage, 0, name);
}
Result romfsMountFromFsdev(const char *path, u64 offset, const char *name)
{
FsFileSystem *tmpfs = NULL;