Skip to content

Commit

Permalink
Added System.unmountMountpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Aug 31, 2021
1 parent 1a70f29 commit 0538bc7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/luaSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,5 +1273,20 @@ class System{
* @note This function is available only in unsafe mode.
*/
void unloadUserPlugin(int plug_id);

/**
* Unmount a virtual mountpoint.
* \ingroup System
*
* @par Usage example:
* @code
* System.unmountMountpoint("app0:")
* @endcode
*
* @param mnt - The mountpoint to unmount.
*
* @note This function is available only in unsafe mode.
*/
void unmountMountpoint(string mnt);

}
12 changes: 12 additions & 0 deletions source/luaSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,17 @@ static int lua_unloadkplugin(lua_State *L){
return 0;
}

static int lua_unmountvirtual(lua_State *L){
int argc = lua_gettop(L);
#ifndef SKIP_ERROR_HANDLING
if (argc != 1) return luaL_error(L, "wrong number of arguments");
if (!unsafe_mode) return luaL_error(L, "this function requires unsafe mode");
#endif
char *fname = luaL_checkstring(L, 1);
sceAppMgrUmount(fname);
return 0;
}

//Register our System Functions
static const luaL_Reg System_functions[] = {
{"openFile", lua_openfile},
Expand Down Expand Up @@ -1778,6 +1789,7 @@ static const luaL_Reg System_functions[] = {
{"loadKernelPlugin", lua_loadkplugin},
{"unloadUserPlugin", lua_unloadplugin},
{"unloadKernelPlugin", lua_unloadkplugin},
{"unmountMountpoint", lua_unmountvirtual},
{0, 0}
};

Expand Down

0 comments on commit 0538bc7

Please sign in to comment.