fs: add missing AccessLog functions. (#491)

This commit is contained in:
SciresM 2020-07-02 15:03:36 -07:00 committed by GitHub
parent e36c7a760f
commit b8a095ac2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -366,6 +366,10 @@ Result fsDisableAutoSaveDataCreation(void);
Result fsSetGlobalAccessLogMode(u32 mode);
Result fsGetGlobalAccessLogMode(u32* out_mode);
Result fsOutputAccessLogToSdCard(const char *log, size_t size);
/// Only available on [7.0.0+].
Result fsGetProgramIndexForAccessLog(u32 *out_program_index, u32 *out_program_count);
// Wrapper(s) for fsCreateSaveDataFileSystemBySystemSaveDataId.
Result fsCreate_SystemSaveDataWithOwner(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags);

View File

@ -504,6 +504,30 @@ Result fsGetGlobalAccessLogMode(u32* out_mode) {
return _fsObjectDispatchOut(&g_fsSrv, 1005, *out_mode);
}
Result fsOutputAccessLogToSdCard(const char *log, size_t size) {
return _fsObjectDispatch(&g_fsSrv, 1006,
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In },
.buffers = { { log, size } },
);
}
Result fsGetProgramIndexForAccessLog(u32 *out_program_index, u32 *out_program_count) {
if (hosversionBefore(7,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
struct {
u32 index;
u32 count;
} out;
Result rc = _fsObjectDispatchOut(&g_fsSrv, 1007, out);
if (R_SUCCEEDED(rc)) {
if (out_program_index) *out_program_index = out.index;
if (out_program_count) *out_program_count = out.count;
}
return rc;
}
// Wrapper(s) for fsCreateSaveDataFileSystemBySystemSaveDataId.
Result fsCreate_SystemSaveDataWithOwner(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags) {
FsSaveDataAttribute attr = {