libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
fspfs.h File Reference

FSP-SRV based filesystem. More...

#include <libtransistor/types.h>
#include <libtransistor/fs/inode.h>
#include <libtransistor/ipc/fs/ifilesystem.h>
Include dependency graph for fspfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

result_t trn_fspfs_create (trn_inode_t *out, ifilesystem_t fs)
 Create an FSPFS filesystem. More...
 

Detailed Description

FSP-SRV based filesystem.

The Nintendo Switch has a service called fsp-srv which is in charge of providing apps with whatever filesystem they might need. For instance, you might ask fsp-srv to give you a filesystem for the SD Card, or for the Game Cartridge, etc...

All those filesystem implement the same IPC interface: IFilesystem. FSPFS is then responsible for wrapping this IPC Interface and providing a libtransistor mountpoint to access it. This is the mechanism used by libtransistor to mount the SDCard filesystem in /sd by default.

Function Documentation

result_t trn_fspfs_create ( trn_inode_t out,
ifilesystem_t  fs 
)

Create an FSPFS filesystem.

This takes an ifilesystem_t (that you'll need to have initialized beforehand), and wraps it in a libtransistor filesystem.

Note that the ownership of the ifilesystem_t is transfered to the fspfs! When the filesystem is released, it will automatically close the ifilesystem_t handle.

Parameters
outOutput for the root inode of the new filesystem. This function will initialize the trn_inode_t struct.
fsThe IFileSystem to bind. Ownership of the IFileSystem is transferred to the fspfs.