summaryrefslogtreecommitdiff
path: root/lib9p/tests/test_server/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests/test_server/main.c')
-rw-r--r--lib9p/tests/test_server/main.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib9p/tests/test_server/main.c b/lib9p/tests/test_server/main.c
index 074dbe7..c759029 100644
--- a/lib9p/tests/test_server/main.c
+++ b/lib9p/tests/test_server/main.c
@@ -48,7 +48,10 @@ struct api_file {
uint64_t pathnum;
};
LO_IMPLEMENTATION_H(lib9p_srv_file, struct api_file, api)
+LO_IMPLEMENTATION_H(lib9p_srv_fio, struct api_file, api)
+
LO_IMPLEMENTATION_C(lib9p_srv_file, struct api_file, api, static)
+LO_IMPLEMENTATION_C(lib9p_srv_fio, struct api_file, api, static)
static void api_free(struct api_file *self) {
assert(self);
@@ -61,11 +64,6 @@ static struct lib9p_qid api_qid(struct api_file *self) {
.path = self->pathnum,
};
}
-static uint32_t api_chio(struct api_file *self, struct lib9p_srv_ctx *ctx, bool, bool, bool) {
- assert(self);
- assert(ctx);
- return 0;
-}
static struct lib9p_stat api_stat(struct api_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
@@ -101,6 +99,21 @@ static void api_remove(struct api_file *self, struct lib9p_srv_ctx *ctx) {
LIB9P_SRV_NOTDIR(struct api_file, api)
+static lo_interface lib9p_srv_fio api_fopen(struct api_file *self, struct lib9p_srv_ctx *ctx, bool, bool, bool) {
+ assert(self);
+ assert(ctx);
+ return lo_box_api_as_lib9p_srv_fio(self);
+}
+
+static void api_iofree(struct api_file *self) {
+ assert(self);
+}
+
+static uint32_t api_iounit(struct api_file *self) {
+ assert(self);
+ return 0;
+}
+
static uint32_t api_pwrite(struct api_file *self, struct lib9p_srv_ctx *ctx, void *buf, uint32_t byte_count, uint64_t LM_UNUSED(offset)) {
assert(self);
assert(ctx);
@@ -111,7 +124,9 @@ static uint32_t api_pwrite(struct api_file *self, struct lib9p_srv_ctx *ctx, voi
LO_CALL(lo_box_hostnet_tcplist_as_net_stream_listener(&globals.listeners[i]), close);
return byte_count;
}
-static uint32_t api_pread(struct api_file *, struct lib9p_srv_ctx *, void *, uint32_t, uint64_t) {
+static void api_pread(struct api_file *LM_UNUSED(self), struct lib9p_srv_ctx *LM_UNUSED(ctx),
+ uint32_t LM_UNUSED(byte_count), uint64_t LM_UNUSED(byte_offset),
+ struct iovec *LM_UNUSED(ret)) {
assert_notreached("not readable");
}