|
libtransistor
A userland library for the Nintendo Switch
|
File operations. More...


Go to the source code of this file.
Data Structures | |
| struct | trn_file_ops_t |
| struct | trn_file_t |
Typedefs | |
| typedef struct trn_file_t | trn_file_t |
Functions | |
| int | fd_create_file (trn_file_ops_t *fops, void *data) |
| Create a file from fops and data. More... | |
| trn_file_t * | fd_file_get (int fd) |
| Get the file structure from a given fd, and increment its rc. More... | |
| void | fd_file_put (trn_file_t *file) |
| Decrease the fd_file refcount, and release it if this is the last one. | |
| int | fd_close (int fd) |
| Close the file descriptor. | |
| int | fd_dup2 (int oldfd, int newfd) |
| Duplicates oldfd, and all its associated locks, into newfd. More... | |
File operations.
File operations
| int fd_create_file | ( | trn_file_ops_t * | fops, |
| void * | data | ||
| ) |
Create a file from fops and data.
Data will be sent to the various functions in fops. Data will usually contain the underlying handle (like the fd for bsd)
| int fd_dup2 | ( | int | oldfd, |
| int | newfd | ||
| ) |
Duplicates oldfd, and all its associated locks, into newfd.
Newfd is closed if necessary.
| trn_file_t* fd_file_get | ( | int | fd | ) |
Get the file structure from a given fd, and increment its rc.
Any call to this function needs an equivalent call to fd_file_put.
1.8.6