16 #include <sys/types.h>
26 result_t (*seek) (
void *data, off_t offset,
int whence, off_t *out);
27 result_t (*read) (
void *data,
void *buf,
size_t size,
size_t *bytes_read);
28 result_t (*write) (
void *data,
const void *buf,
size_t size,
size_t *bytes_written);
39 _Atomic(
int) refcount;
76 int fd_dup2(
int oldfd,
int newfd);
int fd_create_file(trn_file_ops_t *fops, void *data)
Create a file from fops and data.
void fd_file_put(trn_file_t *file)
Decrease the fd_file refcount, and release it if this is the last one.
int fd_dup2(int oldfd, int newfd)
Duplicates oldfd, and all its associated locks, into newfd.
uint32_t result_t
Function result.
Definition: types.h:51
int fd_close(int fd)
Close the file descriptor.
trn_file_t * fd_file_get(int fd)
Get the file structure from a given fd, and increment its rc.