MCPcopy Create free account
hub / github.com/devkitPro/libctru / FSFILE_Write

Function FSFILE_Write

libctru/source/services/fs.c:1673–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673Result FSFILE_Write(Handle handle, u32* bytesWritten, u64 offset, const void* buffer, u32 size, u32 flags)
1674{
1675 u32 *cmdbuf = getThreadCommandBuffer();
1676
1677 cmdbuf[0] = IPC_MakeHeader(0x803,4,2); // 0x8030102
1678 cmdbuf[1] = (u32) offset;
1679 cmdbuf[2] = (u32) (offset >> 32);
1680 cmdbuf[3] = size;
1681 cmdbuf[4] = flags;
1682 cmdbuf[5] = IPC_Desc_Buffer(size, IPC_BUFFER_R);
1683 cmdbuf[6] = (u32) buffer;
1684
1685 Result ret = 0;
1686 if(R_FAILED(ret = svcSendSyncRequest(handle))) return ret;
1687
1688 if(bytesWritten) *bytesWritten = cmdbuf[2];
1689
1690 return cmdbuf[1];
1691}
1692
1693Result FSFILE_GetSize(Handle handle, u64* size)
1694{

Callers 1

archive_writeFunction · 0.85

Calls 3

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
IPC_Desc_BufferFunction · 0.85

Tested by

no test coverage detected