diff options
-rw-r--r-- | lib9p/srv_include/lib9p/srv.h | 34 | ||||
-rw-r--r-- | lib9p_util/static.c | 4 |
2 files changed, 20 insertions, 18 deletions
diff --git a/lib9p/srv_include/lib9p/srv.h b/lib9p/srv_include/lib9p/srv.h index cc73634..0ef674a 100644 --- a/lib9p/srv_include/lib9p/srv.h +++ b/lib9p/srv_include/lib9p/srv.h @@ -74,12 +74,9 @@ void lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx); lo_interface lib9p_srv_fio; lo_interface lib9p_srv_dio; -/* FIXME: I don't like that the pointers returned by stat() and - * pread() have to remain live after they return. Perhaps a - * `respond()`-callback? But that just reads as gross in C. Also, - * because stat is used by srv.c internally for things other than - * Tstat, a `respond()`-callback makes less sense for stat() than it - * does for read(). +/* FIXME: I don't like that the pointer returned by pread() has to + * remain live after it returns. Perhaps a `respond()`-callback? But + * that just reads as gross in C. * * FIXME: It would be nice if pread() could return more than 1 iovec. */ @@ -107,6 +104,7 @@ lo_interface lib9p_srv_dio; \ /* non-"opened" generic I/O *****************************************/ \ \ + /** Strings returned from stat() must remain valid until free(). */ \ LO_FUNC(struct lib9p_stat , stat , struct lib9p_srv_ctx *) \ LO_FUNC(void , wstat , struct lib9p_srv_ctx *, \ struct lib9p_stat new) \ @@ -114,12 +112,13 @@ lo_interface lib9p_srv_dio; \ /* non-"opened" directory I/O ***************************************/ \ \ - LO_FUNC(lo_interface lib9p_srv_file, dwalk , struct lib9p_srv_ctx *, \ - struct lib9p_s childname) \ - LO_FUNC(lo_interface lib9p_srv_file, dcreate, struct lib9p_srv_ctx *, \ - struct lib9p_s childname, \ - lib9p_dm_t perm, \ - lib9p_o_t flags) \ + LO_FUNC(lo_interface lib9p_srv_file, dwalk , struct lib9p_srv_ctx *, \ + struct lib9p_s childname) \ + LO_FUNC(lo_interface lib9p_srv_file, dcreate, struct lib9p_srv_ctx *, \ + struct lib9p_s childname, \ + struct lib9p_srv_userid *user, \ + struct lib9p_srv_userid *group, \ + lib9p_dm_t perm) \ \ /* open() for I/O ***************************************************/ \ \ @@ -163,13 +162,14 @@ LO_INTERFACE(lib9p_srv_fio); /* starting at this object -> */ size_t obj_offset) LO_INTERFACE(lib9p_srv_dio); -#define LIB9P_SRV_NOTDIR(TYP, NAM) \ - static lo_interface lib9p_srv_file NAM##_dwalk (TYP *, struct lib9p_srv_ctx *, struct lib9p_s) { assert_notreached("not a directory"); } \ - static lo_interface lib9p_srv_file NAM##_dcreate(TYP *, struct lib9p_srv_ctx *, struct lib9p_s, lib9p_dm_t, lib9p_o_t) { assert_notreached("not a directory"); } \ - static lo_interface lib9p_srv_dio NAM##_dopen (TYP *, struct lib9p_srv_ctx *) { assert_notreached("not a directory"); } +#define LIB9P_SRV_NOTDIR(TYP, NAM) \ + static lo_interface lib9p_srv_file NAM##_dwalk (TYP *, struct lib9p_srv_ctx *, struct lib9p_s) { assert_notreached("not a directory"); } \ + static lo_interface lib9p_srv_file NAM##_dcreate(TYP *, struct lib9p_srv_ctx *, struct lib9p_s, \ + struct lib9p_srv_userid *, struct lib9p_srv_userid *, lib9p_dm_t) { assert_notreached("not a directory"); } \ + static lo_interface lib9p_srv_dio NAM##_dopen (TYP *, struct lib9p_srv_ctx *) { assert_notreached("not a directory"); } #define LIB9P_SRV_NOTFILE(TYP, NAM) \ - static lo_interface lib9p_srv_fio NAM##_fopen (TYP *, struct lib9p_srv_ctx *, bool, bool, bool) { assert_notreached("not a file"); } + static lo_interface lib9p_srv_fio NAM##_fopen (TYP *, struct lib9p_srv_ctx *, bool, bool, bool) { assert_notreached("not a file"); } /* main server entrypoints ****************************************************/ diff --git a/lib9p_util/static.c b/lib9p_util/static.c index 4fba35a..44b8242 100644 --- a/lib9p_util/static.c +++ b/lib9p_util/static.c @@ -90,7 +90,9 @@ static lo_interface lib9p_srv_file util9p_static_dir_dwalk(struct util9p_static_ static lo_interface lib9p_srv_file util9p_static_dir_dcreate(struct util9p_static_dir *self, struct lib9p_srv_ctx *ctx, struct lib9p_s LM_UNUSED(childname), - lib9p_dm_t LM_UNUSED(perm), lib9p_o_t LM_UNUSED(flags)) { + struct lib9p_srv_userid *LM_UNUSED(user), + struct lib9p_srv_userid *LM_UNUSED(group), + lib9p_dm_t LM_UNUSED(perm)) { assert(self); assert(ctx); |