69 static int semifs_close(
void * opaque) {
76 static ssize_t semifs_write(
void * opaque,
const void * ptr,
size_t len) {
81 args[0] = (uint32_t) f->
file;
82 args[1] = (uint32_t) ptr;
83 args[2] = (uint32_t) len;
88 if (res == -1 || res == len)
96 static ssize_t semifs_read(
void * opaque,
void * ptr,
size_t len) {
101 args[0] = (uint32_t) f->
file;
102 args[1] = (uint32_t) ptr;
103 args[2] = (uint32_t) len;
116 static off_t semifs_seek(
void * opaque,
off_t off,
int whence) {
117 uint32_t args[2], len;
130 args[0] = (uint32_t) f->
file;
137 args[0] = (uint32_t) f->
file;
138 args[1] = (uint32_t) off;
146 return res == 0 ? off : -1;
149 static int semifs_open(
void * opaque,
const char *path,
int flags,
int mode) {
170 args[0] = (uint32_t) path;
171 args[1] = (uint32_t) aflags;
172 args[2] = (uint32_t) strlen(path);
177 int fd =
fio_open(semifs_read, semifs_write, semifs_seek, semifs_close, (
void *) fh);
181 semifs_fds[fd].
file = fh;
182 semifs_fds[fd].
cursor = 0;