diff options
-rw-r--r-- | lib9p/CMakeLists.txt | 18 | ||||
-rw-r--r-- | lib9p/core.c | 25 | ||||
-rw-r--r-- | lib9p/core_include/lib9p/core.h | 28 | ||||
-rw-r--r-- | lib9p/srv.c | 21 | ||||
-rw-r--r-- | lib9p/srv_include/lib9p/srv.h | 2 | ||||
-rw-r--r-- | lib9p/tests/test_compile.c | 846 | ||||
-rwxr-xr-x | lib9p/tests/test_compile.c.gen | 2 | ||||
-rw-r--r-- | lib9p/tests/test_compile_config/config.h | 22 |
8 files changed, 938 insertions, 26 deletions
diff --git a/lib9p/CMakeLists.txt b/lib9p/CMakeLists.txt index 543d01a..4e445c4 100644 --- a/lib9p/CMakeLists.txt +++ b/lib9p/CMakeLists.txt @@ -50,6 +50,20 @@ if (ENABLE_TESTS) add_lib9p_executable("testclient-sess") add_lib9p_test("./testclient-sess") - add_lib_test(lib9p_core test_compile) - target_include_directories(test_compile PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_compile_config) + set(cfg_matrix + "CONFIG_9P_SRV_DEBUG;[0;1]" + "CONFIG_9P_ENABLE_9P2000;[1]" # XXX + "CONFIG_9P_ENABLE_9P2000_u;[0;1]" + "CONFIG_9P_ENABLE_9P2000_e;[0;1]" + "CONFIG_9P_ENABLE_9P2000_L;[0;1]" + "CONFIG_9P_ENABLE_9P2000_p9p;[0;1]" + ) + function(add_compile_test n defs) + add_executable("test_compile${n}" "tests/test_compile.c") + target_link_libraries("test_compile${n}" lib9p_srv) + target_include_directories("test_compile${n}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_compile_config) + target_compile_definitions("test_compile${n}" PUBLIC "${defs}") + # Don't bother running it (don't bother calling add_test()) + endfunction() + apply_matrix(add_compile_test "${cfg_matrix}") endif() diff --git a/lib9p/core.c b/lib9p/core.c index a07461d..cb8ddee 100644 --- a/lib9p/core.c +++ b/lib9p/core.c @@ -47,7 +47,7 @@ bool lib9p_str_eq(struct lib9p_s a, struct lib9p_s b) { void lib9p_ctx_clear_error(struct lib9p_ctx *ctx) { assert(ctx); -#if CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L ctx->err_num = 0; #endif ctx->err_msg[0] = '\0'; @@ -58,22 +58,31 @@ bool lib9p_ctx_has_error(struct lib9p_ctx *ctx) { return ctx->err_msg[0]; } -int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *msg) { +#undef lib9p_error +#undef lib9p_errorf + +int lib9p_error(struct lib9p_ctx *ctx, +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + lib9p_errno_t linux_errno, +#endif + char const *msg) { if (lib9p_ctx_has_error(ctx)) return -1; strncpy(ctx->err_msg, msg, sizeof(ctx->err_msg)); ctx->err_msg[sizeof(ctx->err_msg)-1] = '\0'; -#if CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L ctx->err_num = linux_errno; -#else - (void)(linux_errno); #endif return -1; } -int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) { +int lib9p_errorf(struct lib9p_ctx *ctx, +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + lib9p_errno_t linux_errno, +#endif + char const *fmt, ...) { int n; va_list args; @@ -85,10 +94,8 @@ int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *f if ((size_t)(n+1) < sizeof(ctx->err_msg)) memset(&ctx->err_msg[n+1], 0, sizeof(ctx->err_msg)-(n+1)); -#if CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L ctx->err_num = linux_errno; -#else - (void)(linux_errno); #endif return -1; diff --git a/lib9p/core_include/lib9p/core.h b/lib9p/core_include/lib9p/core.h index ff822ed..8f76c3b 100644 --- a/lib9p/core_include/lib9p/core.h +++ b/lib9p/core_include/lib9p/core.h @@ -45,7 +45,7 @@ struct lib9p_ctx { uint32_t max_msg_size; /* state */ -#ifdef CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L lib9p_errno_t err_num; #endif [[gnu::nonstring]] char err_msg[CONFIG_9P_MAX_ERR_SIZE]; @@ -56,9 +56,31 @@ void lib9p_ctx_clear_error(struct lib9p_ctx *ctx); bool lib9p_ctx_has_error(struct lib9p_ctx *ctx); /** Write an static error into ctx, return -1. */ -int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *msg); +int lib9p_error(struct lib9p_ctx *ctx, +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + lib9p_errno_t linux_errno, +#endif + char const *msg); /** Write a printf-style error into ctx, return -1. */ -int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]]; +int lib9p_errorf(struct lib9p_ctx *ctx, +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + lib9p_errno_t linux_errno, +#endif + char const *fmt, ...) +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + [[gnu::format(printf, 3, 4)]] +#else + [[gnu::format(printf, 2, 3)]] +#endif + ; + +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L +/* Detect things that should be just lib9p_error() */ +#define lib9p_errorf(ctx, errnum, fmt, ...) lib9p_errorf(ctx, errnum, fmt, __VA_ARGS__) +#else +#define lib9p_errorf(ctx, errnum, fmt, ...) lib9p_errorf(ctx, fmt, __VA_ARGS__) +#define lib9p_error(ctx, errnum, errmsg) lib9p_error(ctx, errmsg) +#endif /* misc utilities *************************************************************/ diff --git a/lib9p/srv.c b/lib9p/srv.c index 6ab2ab2..8917084 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -174,17 +174,26 @@ static inline bool srv_check_perm(struct srv_req *ctx, struct lib9p_stat *stat, return mode & action; } -struct lib9p_srv_authinfo *srv_authinfo_new(struct lib9p_s uname, lib9p_nuid_t uid) { +struct lib9p_srv_authinfo *srv_authinfo_new(struct lib9p_s uname +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L + , lib9p_nuid_t uid +#endif + ) { struct lib9p_srv_authinfo *ret = malloc(sizeof(struct lib9p_srv_authinfo) + uname.len); if (!ret) return NULL; +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L ret->uid = uid; +#endif ret->uname.len = uname.len; ret->uname.utf8 = (void *)&ret[1]; memcpy(ret->uname.utf8, uname.utf8, uname.len); ret->refcount = 1; return ret; } +#if !(CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L) +#define srv_authinfo_new(name, num) srv_authinfo_new(name) +#endif struct lib9p_srv_authinfo *srv_authinfo_decref(struct lib9p_srv_authinfo *authinfo) { assert(authinfo); @@ -272,8 +281,8 @@ static inline void srv_fid_del(struct srv_req *ctx, lib9p_fid_t fid, bool remove if (remove) { if (pathinfo->parent_dir == fidinfo->path) { - lib9p_errorf(&ctx->basectx, - LIB9P_ERRNO_L_EBUSY, "cannot remove root"); + lib9p_error(&ctx->basectx, + LIB9P_ERRNO_L_EBUSY, "cannot remove root"); goto clunk; } struct srv_pathinfo *parent = map_load(&ctx->parent_sess->paths, pathinfo->parent_dir); @@ -375,7 +384,7 @@ static ssize_t srv_write_Rmsg(struct srv_req *req, struct lib9p_Rmsg_send_buf *r #define srv_nonrespond_errorf errorf static void srv_respond_error(struct srv_req *req) { -#if CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L assert(req->basectx.err_num); #endif assert(req->basectx.err_msg[0]); @@ -647,7 +656,7 @@ void lib9p_srv_worker(struct srv_req *ctx) { case LIB9P_TYP_Tstat: handler = (tmessage_handler)handle_Tstat; break; case LIB9P_TYP_Twstat: handler = (tmessage_handler)handle_Twstat; break; #if CONFIG_9P_ENABLE_9P2000_p9p - case LIB9P_TYP_Topenfd: handler = (tmessage_handler)handle_Topenfd; break + case LIB9P_TYP_Topenfd: handler = (tmessage_handler)handle_Topenfd; break; #endif #if CONFIG_9P_ENABLE_9P2000_e case LIB9P_TYP_Tsession: handler = (tmessage_handler)handle_Tsession; break; @@ -824,7 +833,7 @@ static void handle_Tattach(struct srv_req *ctx, LIB9P_ERRNO_L_EACCES, "FID provided as auth-file is for user=\"%.*s\" and cannot be used for user=\"%.*s\"", afid->authinfo->uname.len, afid->authinfo->uname.utf8, req->uname.len, req->uname.utf8); -#if CONFIG_9P_ENABLE_9P2000_u +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L else if (afid->authinfo->uid != req->n_uid) lib9p_errorf(&ctx->basectx, LIB9P_ERRNO_L_EACCES, "FID provided as auth-file is for user=%"PRIu32" and cannot be used for user=%"PRIu32, diff --git a/lib9p/srv_include/lib9p/srv.h b/lib9p/srv_include/lib9p/srv.h index 9b3256b..e9d2e91 100644 --- a/lib9p/srv_include/lib9p/srv.h +++ b/lib9p/srv_include/lib9p/srv.h @@ -20,7 +20,9 @@ /* context ********************************************************************/ struct lib9p_srv_authinfo { +#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L lib9p_nuid_t uid; +#endif struct lib9p_s uname; BEGIN_PRIVATE(LIB9P_SRV_H); diff --git a/lib9p/tests/test_compile.c b/lib9p/tests/test_compile.c index 4532655..f91793e 100644 --- a/lib9p/tests/test_compile.c +++ b/lib9p/tests/test_compile.c @@ -3,428 +3,1274 @@ #include <lib9p/core.h> int main(void) { [[gnu::unused]] uint64_t x; +#ifdef LIB9P_TAG_NOTAG x = LIB9P_TAG_NOTAG; +#endif +#ifdef LIB9P_FID_NOFID x = LIB9P_FID_NOFID; +#endif +#ifdef LIB9P_DM_DIR x = LIB9P_DM_DIR; +#endif +#ifdef LIB9P_DM_APPEND x = LIB9P_DM_APPEND; +#endif +#ifdef LIB9P_DM_EXCL x = LIB9P_DM_EXCL; +#endif +#ifdef _LIB9P_DM_PLAN9_MOUNT x = _LIB9P_DM_PLAN9_MOUNT; +#endif +#ifdef LIB9P_DM_AUTH x = LIB9P_DM_AUTH; +#endif +#ifdef LIB9P_DM_TMP x = LIB9P_DM_TMP; +#endif +#ifdef _LIB9P_DM_UNUSED_25 x = _LIB9P_DM_UNUSED_25; +#endif +#ifdef _LIB9P_DM_UNUSED_24 x = _LIB9P_DM_UNUSED_24; +#endif +#ifdef LIB9P_DM_DEVICE x = LIB9P_DM_DEVICE; +#endif +#ifdef _LIB9P_DM_UNUSED_22 x = _LIB9P_DM_UNUSED_22; +#endif +#ifdef LIB9P_DM_PIPE x = LIB9P_DM_PIPE; +#endif +#ifdef LIB9P_DM_SOCKET x = LIB9P_DM_SOCKET; +#endif +#ifdef LIB9P_DM_SETUID x = LIB9P_DM_SETUID; +#endif +#ifdef LIB9P_DM_SETGID x = LIB9P_DM_SETGID; +#endif +#ifdef _LIB9P_DM_UNUSED_17 x = _LIB9P_DM_UNUSED_17; +#endif +#ifdef _LIB9P_DM_UNUSED_16 x = _LIB9P_DM_UNUSED_16; +#endif +#ifdef _LIB9P_DM_UNUSED_15 x = _LIB9P_DM_UNUSED_15; +#endif +#ifdef _LIB9P_DM_UNUSED_14 x = _LIB9P_DM_UNUSED_14; +#endif +#ifdef _LIB9P_DM_UNUSED_13 x = _LIB9P_DM_UNUSED_13; +#endif +#ifdef _LIB9P_DM_UNUSED_12 x = _LIB9P_DM_UNUSED_12; +#endif +#ifdef _LIB9P_DM_UNUSED_11 x = _LIB9P_DM_UNUSED_11; +#endif +#ifdef _LIB9P_DM_UNUSED_10 x = _LIB9P_DM_UNUSED_10; +#endif +#ifdef _LIB9P_DM_UNUSED_9 x = _LIB9P_DM_UNUSED_9; +#endif +#ifdef LIB9P_DM_OWNER_R x = LIB9P_DM_OWNER_R; +#endif +#ifdef LIB9P_DM_OWNER_W x = LIB9P_DM_OWNER_W; +#endif +#ifdef LIB9P_DM_OWNER_X x = LIB9P_DM_OWNER_X; +#endif +#ifdef LIB9P_DM_GROUP_R x = LIB9P_DM_GROUP_R; +#endif +#ifdef LIB9P_DM_GROUP_W x = LIB9P_DM_GROUP_W; +#endif +#ifdef LIB9P_DM_GROUP_X x = LIB9P_DM_GROUP_X; +#endif +#ifdef LIB9P_DM_OTHER_R x = LIB9P_DM_OTHER_R; +#endif +#ifdef LIB9P_DM_OTHER_W x = LIB9P_DM_OTHER_W; +#endif +#ifdef LIB9P_DM_OTHER_X x = LIB9P_DM_OTHER_X; +#endif +#ifdef LIB9P_DM_PERM_MASK x = LIB9P_DM_PERM_MASK; +#endif +#ifdef LIB9P_QT_DIR x = LIB9P_QT_DIR; +#endif +#ifdef LIB9P_QT_APPEND x = LIB9P_QT_APPEND; +#endif +#ifdef LIB9P_QT_EXCL x = LIB9P_QT_EXCL; +#endif +#ifdef _LIB9P_QT_PLAN9_MOUNT x = _LIB9P_QT_PLAN9_MOUNT; +#endif +#ifdef LIB9P_QT_AUTH x = LIB9P_QT_AUTH; +#endif +#ifdef LIB9P_QT_TMP x = LIB9P_QT_TMP; +#endif +#ifdef LIB9P_QT_SYMLINK x = LIB9P_QT_SYMLINK; +#endif +#ifdef _LIB9P_QT_UNUSED_0 x = _LIB9P_QT_UNUSED_0; +#endif +#ifdef LIB9P_QT_FILE x = LIB9P_QT_FILE; +#endif +#ifdef _LIB9P_O_UNUSED_7 x = _LIB9P_O_UNUSED_7; +#endif +#ifdef LIB9P_O_RCLOSE x = LIB9P_O_RCLOSE; +#endif +#ifdef _LIB9P_O_RESERVED_CEXEC x = _LIB9P_O_RESERVED_CEXEC; +#endif +#ifdef LIB9P_O_TRUNC x = LIB9P_O_TRUNC; +#endif +#ifdef _LIB9P_O_UNUSED_3 x = _LIB9P_O_UNUSED_3; +#endif +#ifdef _LIB9P_O_UNUSED_2 x = _LIB9P_O_UNUSED_2; +#endif +#ifdef LIB9P_O_FLAG_MASK x = LIB9P_O_FLAG_MASK; +#endif +#ifdef LIB9P_O_MODE_READ x = LIB9P_O_MODE_READ; +#endif +#ifdef LIB9P_O_MODE_WRITE x = LIB9P_O_MODE_WRITE; +#endif +#ifdef LIB9P_O_MODE_RDWR x = LIB9P_O_MODE_RDWR; +#endif +#ifdef LIB9P_O_MODE_EXEC x = LIB9P_O_MODE_EXEC; +#endif +#ifdef LIB9P_O_MODE_MASK x = LIB9P_O_MODE_MASK; +#endif +#ifdef LIB9P_NUID_NONUID x = LIB9P_NUID_NONUID; +#endif +#ifdef LIB9P_ERRNO_NOERROR x = LIB9P_ERRNO_NOERROR; +#endif +#ifdef LIB9P_ERRNO_L_EPERM x = LIB9P_ERRNO_L_EPERM; +#endif +#ifdef LIB9P_ERRNO_L_ENOENT x = LIB9P_ERRNO_L_ENOENT; +#endif +#ifdef LIB9P_ERRNO_L_ESRCH x = LIB9P_ERRNO_L_ESRCH; +#endif +#ifdef LIB9P_ERRNO_L_EINTR x = LIB9P_ERRNO_L_EINTR; +#endif +#ifdef LIB9P_ERRNO_L_EIO x = LIB9P_ERRNO_L_EIO; +#endif +#ifdef LIB9P_ERRNO_L_ENXIO x = LIB9P_ERRNO_L_ENXIO; +#endif +#ifdef LIB9P_ERRNO_L_E2BIG x = LIB9P_ERRNO_L_E2BIG; +#endif +#ifdef LIB9P_ERRNO_L_ENOEXEC x = LIB9P_ERRNO_L_ENOEXEC; +#endif +#ifdef LIB9P_ERRNO_L_EBADF x = LIB9P_ERRNO_L_EBADF; +#endif +#ifdef LIB9P_ERRNO_L_ECHILD x = LIB9P_ERRNO_L_ECHILD; +#endif +#ifdef LIB9P_ERRNO_L_EAGAIN x = LIB9P_ERRNO_L_EAGAIN; +#endif +#ifdef LIB9P_ERRNO_L_ENOMEM x = LIB9P_ERRNO_L_ENOMEM; +#endif +#ifdef LIB9P_ERRNO_L_EACCES x = LIB9P_ERRNO_L_EACCES; +#endif +#ifdef LIB9P_ERRNO_L_EFAULT x = LIB9P_ERRNO_L_EFAULT; +#endif +#ifdef LIB9P_ERRNO_L_ENOTBLK x = LIB9P_ERRNO_L_ENOTBLK; +#endif +#ifdef LIB9P_ERRNO_L_EBUSY x = LIB9P_ERRNO_L_EBUSY; +#endif +#ifdef LIB9P_ERRNO_L_EEXIST x = LIB9P_ERRNO_L_EEXIST; +#endif +#ifdef LIB9P_ERRNO_L_EXDEV x = LIB9P_ERRNO_L_EXDEV; +#endif +#ifdef LIB9P_ERRNO_L_ENODEV x = LIB9P_ERRNO_L_ENODEV; +#endif +#ifdef LIB9P_ERRNO_L_ENOTDIR x = LIB9P_ERRNO_L_ENOTDIR; +#endif +#ifdef LIB9P_ERRNO_L_EISDIR x = LIB9P_ERRNO_L_EISDIR; +#endif +#ifdef LIB9P_ERRNO_L_EINVAL x = LIB9P_ERRNO_L_EINVAL; +#endif +#ifdef LIB9P_ERRNO_L_ENFILE x = LIB9P_ERRNO_L_ENFILE; +#endif +#ifdef LIB9P_ERRNO_L_EMFILE x = LIB9P_ERRNO_L_EMFILE; +#endif +#ifdef LIB9P_ERRNO_L_ENOTTY x = LIB9P_ERRNO_L_ENOTTY; +#endif +#ifdef LIB9P_ERRNO_L_ETXTBSY x = LIB9P_ERRNO_L_ETXTBSY; +#endif +#ifdef LIB9P_ERRNO_L_EFBIG x = LIB9P_ERRNO_L_EFBIG; +#endif +#ifdef LIB9P_ERRNO_L_ENOSPC x = LIB9P_ERRNO_L_ENOSPC; +#endif +#ifdef LIB9P_ERRNO_L_ESPIPE x = LIB9P_ERRNO_L_ESPIPE; +#endif +#ifdef LIB9P_ERRNO_L_EROFS x = LIB9P_ERRNO_L_EROFS; +#endif +#ifdef LIB9P_ERRNO_L_EMLINK x = LIB9P_ERRNO_L_EMLINK; +#endif +#ifdef LIB9P_ERRNO_L_EPIPE x = LIB9P_ERRNO_L_EPIPE; +#endif +#ifdef LIB9P_ERRNO_L_EDOM x = LIB9P_ERRNO_L_EDOM; +#endif +#ifdef LIB9P_ERRNO_L_ERANGE x = LIB9P_ERRNO_L_ERANGE; +#endif +#ifdef LIB9P_ERRNO_L_EDEADLK x = LIB9P_ERRNO_L_EDEADLK; +#endif +#ifdef LIB9P_ERRNO_L_ENAMETOOLONG x = LIB9P_ERRNO_L_ENAMETOOLONG; +#endif +#ifdef LIB9P_ERRNO_L_ENOLCK x = LIB9P_ERRNO_L_ENOLCK; +#endif +#ifdef LIB9P_ERRNO_L_ENOSYS x = LIB9P_ERRNO_L_ENOSYS; +#endif +#ifdef LIB9P_ERRNO_L_ENOTEMPTY x = LIB9P_ERRNO_L_ENOTEMPTY; +#endif +#ifdef LIB9P_ERRNO_L_ELOOP x = LIB9P_ERRNO_L_ELOOP; +#endif +#ifdef LIB9P_ERRNO_L_ENOMSG x = LIB9P_ERRNO_L_ENOMSG; +#endif +#ifdef LIB9P_ERRNO_L_EIDRM x = LIB9P_ERRNO_L_EIDRM; +#endif +#ifdef LIB9P_ERRNO_L_ECHRNG x = LIB9P_ERRNO_L_ECHRNG; +#endif +#ifdef LIB9P_ERRNO_L_EL2NSYNC x = LIB9P_ERRNO_L_EL2NSYNC; +#endif +#ifdef LIB9P_ERRNO_L_EL3HLT x = LIB9P_ERRNO_L_EL3HLT; +#endif +#ifdef LIB9P_ERRNO_L_EL3RST x = LIB9P_ERRNO_L_EL3RST; +#endif +#ifdef LIB9P_ERRNO_L_ELNRNG x = LIB9P_ERRNO_L_ELNRNG; +#endif +#ifdef LIB9P_ERRNO_L_EUNATCH x = LIB9P_ERRNO_L_EUNATCH; +#endif +#ifdef LIB9P_ERRNO_L_ENOCSI x = LIB9P_ERRNO_L_ENOCSI; +#endif +#ifdef LIB9P_ERRNO_L_EL2HLT x = LIB9P_ERRNO_L_EL2HLT; +#endif +#ifdef LIB9P_ERRNO_L_EBADE x = LIB9P_ERRNO_L_EBADE; +#endif +#ifdef LIB9P_ERRNO_L_EBADR x = LIB9P_ERRNO_L_EBADR; +#endif +#ifdef LIB9P_ERRNO_L_EXFULL x = LIB9P_ERRNO_L_EXFULL; +#endif +#ifdef LIB9P_ERRNO_L_ENOANO x = LIB9P_ERRNO_L_ENOANO; +#endif +#ifdef LIB9P_ERRNO_L_EBADRQC x = LIB9P_ERRNO_L_EBADRQC; +#endif +#ifdef LIB9P_ERRNO_L_EBADSLT x = LIB9P_ERRNO_L_EBADSLT; +#endif +#ifdef LIB9P_ERRNO_L_EBFONT x = LIB9P_ERRNO_L_EBFONT; +#endif +#ifdef LIB9P_ERRNO_L_ENOSTR x = LIB9P_ERRNO_L_ENOSTR; +#endif +#ifdef LIB9P_ERRNO_L_ENODATA x = LIB9P_ERRNO_L_ENODATA; +#endif +#ifdef LIB9P_ERRNO_L_ETIME x = LIB9P_ERRNO_L_ETIME; +#endif +#ifdef LIB9P_ERRNO_L_ENOSR x = LIB9P_ERRNO_L_ENOSR; +#endif +#ifdef LIB9P_ERRNO_L_ENONET x = LIB9P_ERRNO_L_ENONET; +#endif +#ifdef LIB9P_ERRNO_L_ENOPKG x = LIB9P_ERRNO_L_ENOPKG; +#endif +#ifdef LIB9P_ERRNO_L_EREMOTE x = LIB9P_ERRNO_L_EREMOTE; +#endif +#ifdef LIB9P_ERRNO_L_ENOLINK x = LIB9P_ERRNO_L_ENOLINK; +#endif +#ifdef LIB9P_ERRNO_L_EADV x = LIB9P_ERRNO_L_EADV; +#endif +#ifdef LIB9P_ERRNO_L_ESRMNT x = LIB9P_ERRNO_L_ESRMNT; +#endif +#ifdef LIB9P_ERRNO_L_ECOMM x = LIB9P_ERRNO_L_ECOMM; +#endif +#ifdef LIB9P_ERRNO_L_EPROTO x = LIB9P_ERRNO_L_EPROTO; +#endif +#ifdef LIB9P_ERRNO_L_EMULTIHOP x = LIB9P_ERRNO_L_EMULTIHOP; +#endif +#ifdef LIB9P_ERRNO_L_EDOTDOT x = LIB9P_ERRNO_L_EDOTDOT; +#endif +#ifdef LIB9P_ERRNO_L_EBADMSG x = LIB9P_ERRNO_L_EBADMSG; +#endif +#ifdef LIB9P_ERRNO_L_EOVERFLOW x = LIB9P_ERRNO_L_EOVERFLOW; +#endif +#ifdef LIB9P_ERRNO_L_ENOTUNIQ x = LIB9P_ERRNO_L_ENOTUNIQ; +#endif +#ifdef LIB9P_ERRNO_L_EBADFD x = LIB9P_ERRNO_L_EBADFD; +#endif +#ifdef LIB9P_ERRNO_L_EREMCHG x = LIB9P_ERRNO_L_EREMCHG; +#endif +#ifdef LIB9P_ERRNO_L_ELIBACC x = LIB9P_ERRNO_L_ELIBACC; +#endif +#ifdef LIB9P_ERRNO_L_ELIBBAD x = LIB9P_ERRNO_L_ELIBBAD; +#endif +#ifdef LIB9P_ERRNO_L_ELIBSCN x = LIB9P_ERRNO_L_ELIBSCN; +#endif +#ifdef LIB9P_ERRNO_L_ELIBMAX x = LIB9P_ERRNO_L_ELIBMAX; +#endif +#ifdef LIB9P_ERRNO_L_ELIBEXEC x = LIB9P_ERRNO_L_ELIBEXEC; +#endif +#ifdef LIB9P_ERRNO_L_EILSEQ x = LIB9P_ERRNO_L_EILSEQ; +#endif +#ifdef LIB9P_ERRNO_L_ERESTART x = LIB9P_ERRNO_L_ERESTART; +#endif +#ifdef LIB9P_ERRNO_L_ESTRPIPE x = LIB9P_ERRNO_L_ESTRPIPE; +#endif +#ifdef LIB9P_ERRNO_L_EUSERS x = LIB9P_ERRNO_L_EUSERS; +#endif +#ifdef LIB9P_ERRNO_L_ENOTSOCK x = LIB9P_ERRNO_L_ENOTSOCK; +#endif +#ifdef LIB9P_ERRNO_L_EDESTADDRREQ x = LIB9P_ERRNO_L_EDESTADDRREQ; +#endif +#ifdef LIB9P_ERRNO_L_EMSGSIZE x = LIB9P_ERRNO_L_EMSGSIZE; +#endif +#ifdef LIB9P_ERRNO_L_EPROTOTYPE x = LIB9P_ERRNO_L_EPROTOTYPE; +#endif +#ifdef LIB9P_ERRNO_L_ENOPROTOOPT x = LIB9P_ERRNO_L_ENOPROTOOPT; +#endif +#ifdef LIB9P_ERRNO_L_EPROTONOSUPPORT x = LIB9P_ERRNO_L_EPROTONOSUPPORT; +#endif +#ifdef LIB9P_ERRNO_L_ESOCKTNOSUPPORT x = LIB9P_ERRNO_L_ESOCKTNOSUPPORT; +#endif +#ifdef LIB9P_ERRNO_L_EOPNOTSUPP x = LIB9P_ERRNO_L_EOPNOTSUPP; +#endif +#ifdef LIB9P_ERRNO_L_EPFNOSUPPORT x = LIB9P_ERRNO_L_EPFNOSUPPORT; +#endif +#ifdef LIB9P_ERRNO_L_EAFNOSUPPORT x = LIB9P_ERRNO_L_EAFNOSUPPORT; +#endif +#ifdef LIB9P_ERRNO_L_EADDRINUSE x = LIB9P_ERRNO_L_EADDRINUSE; +#endif +#ifdef LIB9P_ERRNO_L_EADDRNOTAVAIL x = LIB9P_ERRNO_L_EADDRNOTAVAIL; +#endif +#ifdef LIB9P_ERRNO_L_ENETDOWN x = LIB9P_ERRNO_L_ENETDOWN; +#endif +#ifdef LIB9P_ERRNO_L_ENETUNREACH x = LIB9P_ERRNO_L_ENETUNREACH; +#endif +#ifdef LIB9P_ERRNO_L_ENETRESET x = LIB9P_ERRNO_L_ENETRESET; +#endif +#ifdef LIB9P_ERRNO_L_ECONNABORTED x = LIB9P_ERRNO_L_ECONNABORTED; +#endif +#ifdef LIB9P_ERRNO_L_ECONNRESET x = LIB9P_ERRNO_L_ECONNRESET; +#endif +#ifdef LIB9P_ERRNO_L_ENOBUFS x = LIB9P_ERRNO_L_ENOBUFS; +#endif +#ifdef LIB9P_ERRNO_L_EISCONN x = LIB9P_ERRNO_L_EISCONN; +#endif +#ifdef LIB9P_ERRNO_L_ENOTCONN x = LIB9P_ERRNO_L_ENOTCONN; +#endif +#ifdef LIB9P_ERRNO_L_ESHUTDOWN x = LIB9P_ERRNO_L_ESHUTDOWN; +#endif +#ifdef LIB9P_ERRNO_L_ETOOMANYREFS x = LIB9P_ERRNO_L_ETOOMANYREFS; +#endif +#ifdef LIB9P_ERRNO_L_ETIMEDOUT x = LIB9P_ERRNO_L_ETIMEDOUT; +#endif +#ifdef LIB9P_ERRNO_L_ECONNREFUSED x = LIB9P_ERRNO_L_ECONNREFUSED; +#endif +#ifdef LIB9P_ERRNO_L_EHOSTDOWN x = LIB9P_ERRNO_L_EHOSTDOWN; +#endif +#ifdef LIB9P_ERRNO_L_EHOSTUNREACH x = LIB9P_ERRNO_L_EHOSTUNREACH; +#endif +#ifdef LIB9P_ERRNO_L_EALREADY x = LIB9P_ERRNO_L_EALREADY; +#endif +#ifdef LIB9P_ERRNO_L_EINPROGRESS x = LIB9P_ERRNO_L_EINPROGRESS; +#endif +#ifdef LIB9P_ERRNO_L_ESTALE x = LIB9P_ERRNO_L_ESTALE; +#endif +#ifdef LIB9P_ERRNO_L_EUCLEAN x = LIB9P_ERRNO_L_EUCLEAN; +#endif +#ifdef LIB9P_ERRNO_L_ENOTNAM x = LIB9P_ERRNO_L_ENOTNAM; +#endif +#ifdef LIB9P_ERRNO_L_ENAVAIL x = LIB9P_ERRNO_L_ENAVAIL; +#endif +#ifdef LIB9P_ERRNO_L_EISNAM x = LIB9P_ERRNO_L_EISNAM; +#endif +#ifdef LIB9P_ERRNO_L_EREMOTEIO x = LIB9P_ERRNO_L_EREMOTEIO; +#endif +#ifdef LIB9P_ERRNO_L_EDQUOT x = LIB9P_ERRNO_L_EDQUOT; +#endif +#ifdef LIB9P_ERRNO_L_ENOMEDIUM x = LIB9P_ERRNO_L_ENOMEDIUM; +#endif +#ifdef LIB9P_ERRNO_L_EMEDIUMTYPE x = LIB9P_ERRNO_L_EMEDIUMTYPE; +#endif +#ifdef LIB9P_ERRNO_L_ECANCELED x = LIB9P_ERRNO_L_ECANCELED; +#endif +#ifdef LIB9P_ERRNO_L_ENOKEY x = LIB9P_ERRNO_L_ENOKEY; +#endif +#ifdef LIB9P_ERRNO_L_EKEYEXPIRED x = LIB9P_ERRNO_L_EKEYEXPIRED; +#endif +#ifdef LIB9P_ERRNO_L_EKEYREVOKED x = LIB9P_ERRNO_L_EKEYREVOKED; +#endif +#ifdef LIB9P_ERRNO_L_EKEYREJECTED x = LIB9P_ERRNO_L_EKEYREJECTED; +#endif +#ifdef LIB9P_ERRNO_L_EOWNERDEAD x = LIB9P_ERRNO_L_EOWNERDEAD; +#endif +#ifdef LIB9P_ERRNO_L_ENOTRECOVERABLE x = LIB9P_ERRNO_L_ENOTRECOVERABLE; +#endif +#ifdef LIB9P_ERRNO_L_ERFKILL x = LIB9P_ERRNO_L_ERFKILL; +#endif +#ifdef LIB9P_ERRNO_L_EHWPOISON x = LIB9P_ERRNO_L_EHWPOISON; +#endif +#ifdef LIB9P_SUPER_MAGIC_V9FS_MAGIC x = LIB9P_SUPER_MAGIC_V9FS_MAGIC; +#endif +#ifdef _LIB9P_LO_UNUSED_31 x = _LIB9P_LO_UNUSED_31; +#endif +#ifdef _LIB9P_LO_UNUSED_30 x = _LIB9P_LO_UNUSED_30; +#endif +#ifdef _LIB9P_LO_UNUSED_29 x = _LIB9P_LO_UNUSED_29; +#endif +#ifdef _LIB9P_LO_UNUSED_28 x = _LIB9P_LO_UNUSED_28; +#endif +#ifdef _LIB9P_LO_UNUSED_27 x = _LIB9P_LO_UNUSED_27; +#endif +#ifdef _LIB9P_LO_UNUSED_26 x = _LIB9P_LO_UNUSED_26; +#endif +#ifdef _LIB9P_LO_UNUSED_25 x = _LIB9P_LO_UNUSED_25; +#endif +#ifdef _LIB9P_LO_UNUSED_24 x = _LIB9P_LO_UNUSED_24; +#endif +#ifdef _LIB9P_LO_UNUSED_23 x = _LIB9P_LO_UNUSED_23; +#endif +#ifdef _LIB9P_LO_UNUSED_22 x = _LIB9P_LO_UNUSED_22; +#endif +#ifdef _LIB9P_LO_UNUSED_21 x = _LIB9P_LO_UNUSED_21; +#endif +#ifdef LIB9P_LO_SYNC x = LIB9P_LO_SYNC; +#endif +#ifdef LIB9P_LO_CLOEXEC x = LIB9P_LO_CLOEXEC; +#endif +#ifdef LIB9P_LO_NOATIME x = LIB9P_LO_NOATIME; +#endif +#ifdef LIB9P_LO_NOFOLLOW x = LIB9P_LO_NOFOLLOW; +#endif +#ifdef LIB9P_LO_DIRECTORY x = LIB9P_LO_DIRECTORY; +#endif +#ifdef LIB9P_LO_LARGEFILE x = LIB9P_LO_LARGEFILE; +#endif +#ifdef LIB9P_LO_DIRECT x = LIB9P_LO_DIRECT; +#endif +#ifdef LIB9P_LO_BSD_FASYNC x = LIB9P_LO_BSD_FASYNC; +#endif +#ifdef LIB9P_LO_DSYNC x = LIB9P_LO_DSYNC; +#endif +#ifdef LIB9P_LO_NONBLOCK x = LIB9P_LO_NONBLOCK; +#endif +#ifdef LIB9P_LO_APPEND x = LIB9P_LO_APPEND; +#endif +#ifdef LIB9P_LO_TRUNC x = LIB9P_LO_TRUNC; +#endif +#ifdef LIB9P_LO_NOCTTY x = LIB9P_LO_NOCTTY; +#endif +#ifdef LIB9P_LO_EXCL x = LIB9P_LO_EXCL; +#endif +#ifdef LIB9P_LO_CREATE x = LIB9P_LO_CREATE; +#endif +#ifdef _LIB9P_LO_UNUSED_5 x = _LIB9P_LO_UNUSED_5; +#endif +#ifdef _LIB9P_LO_UNUSED_4 x = _LIB9P_LO_UNUSED_4; +#endif +#ifdef _LIB9P_LO_UNUSED_3 x = _LIB9P_LO_UNUSED_3; +#endif +#ifdef _LIB9P_LO_UNUSED_2 x = _LIB9P_LO_UNUSED_2; +#endif +#ifdef LIB9P_LO_FLAG_MASK x = LIB9P_LO_FLAG_MASK; +#endif +#ifdef LIB9P_LO_MODE_RDONLY x = LIB9P_LO_MODE_RDONLY; +#endif +#ifdef LIB9P_LO_MODE_WRONLY x = LIB9P_LO_MODE_WRONLY; +#endif +#ifdef LIB9P_LO_MODE_RDWR x = LIB9P_LO_MODE_RDWR; +#endif +#ifdef LIB9P_LO_MODE_NOACCESS x = LIB9P_LO_MODE_NOACCESS; +#endif +#ifdef LIB9P_LO_MODE_MASK x = LIB9P_LO_MODE_MASK; +#endif +#ifdef LIB9P_DT_UNKNOWN x = LIB9P_DT_UNKNOWN; +#endif +#ifdef LIB9P_DT_PIPE x = LIB9P_DT_PIPE; +#endif +#ifdef LIB9P_DT_CHAR_DEV x = LIB9P_DT_CHAR_DEV; +#endif +#ifdef LIB9P_DT_DIRECTORY x = LIB9P_DT_DIRECTORY; +#endif +#ifdef LIB9P_DT_BLOCK_DEV x = LIB9P_DT_BLOCK_DEV; +#endif +#ifdef LIB9P_DT_REGULAR x = LIB9P_DT_REGULAR; +#endif +#ifdef LIB9P_DT_SYMLINK x = LIB9P_DT_SYMLINK; +#endif +#ifdef LIB9P_DT_SOCKET x = LIB9P_DT_SOCKET; +#endif +#ifdef _LIB9P_DT_WHITEOUT x = _LIB9P_DT_WHITEOUT; +#endif +#ifdef _LIB9P_MODE_UNUSED_31 x = _LIB9P_MODE_UNUSED_31; +#endif +#ifdef _LIB9P_MODE_UNUSED_30 x = _LIB9P_MODE_UNUSED_30; +#endif +#ifdef _LIB9P_MODE_UNUSED_29 x = _LIB9P_MODE_UNUSED_29; +#endif +#ifdef _LIB9P_MODE_UNUSED_28 x = _LIB9P_MODE_UNUSED_28; +#endif +#ifdef _LIB9P_MODE_UNUSED_27 x = _LIB9P_MODE_UNUSED_27; +#endif +#ifdef _LIB9P_MODE_UNUSED_26 x = _LIB9P_MODE_UNUSED_26; +#endif +#ifdef _LIB9P_MODE_UNUSED_25 x = _LIB9P_MODE_UNUSED_25; +#endif +#ifdef _LIB9P_MODE_UNUSED_24 x = _LIB9P_MODE_UNUSED_24; +#endif +#ifdef _LIB9P_MODE_UNUSED_23 x = _LIB9P_MODE_UNUSED_23; +#endif +#ifdef _LIB9P_MODE_UNUSED_22 x = _LIB9P_MODE_UNUSED_22; +#endif +#ifdef _LIB9P_MODE_UNUSED_21 x = _LIB9P_MODE_UNUSED_21; +#endif +#ifdef _LIB9P_MODE_UNUSED_20 x = _LIB9P_MODE_UNUSED_20; +#endif +#ifdef _LIB9P_MODE_UNUSED_19 x = _LIB9P_MODE_UNUSED_19; +#endif +#ifdef _LIB9P_MODE_UNUSED_18 x = _LIB9P_MODE_UNUSED_18; +#endif +#ifdef _LIB9P_MODE_UNUSED_17 x = _LIB9P_MODE_UNUSED_17; +#endif +#ifdef _LIB9P_MODE_UNUSED_16 x = _LIB9P_MODE_UNUSED_16; +#endif +#ifdef LIB9P_MODE_PERM_SETGROUP x = LIB9P_MODE_PERM_SETGROUP; +#endif +#ifdef LIB9P_MODE_PERM_SETUSER x = LIB9P_MODE_PERM_SETUSER; +#endif +#ifdef LIB9P_MODE_PERM_STICKY x = LIB9P_MODE_PERM_STICKY; +#endif +#ifdef LIB9P_MODE_PERM_OWNER_R x = LIB9P_MODE_PERM_OWNER_R; +#endif +#ifdef LIB9P_MODE_PERM_OWNER_W x = LIB9P_MODE_PERM_OWNER_W; +#endif +#ifdef LIB9P_MODE_PERM_OWNER_X x = LIB9P_MODE_PERM_OWNER_X; +#endif +#ifdef LIB9P_MODE_PERM_GROUP_R x = LIB9P_MODE_PERM_GROUP_R; +#endif +#ifdef LIB9P_MODE_PERM_GROUP_W x = LIB9P_MODE_PERM_GROUP_W; +#endif +#ifdef LIB9P_MODE_PERM_GROUP_X x = LIB9P_MODE_PERM_GROUP_X; +#endif +#ifdef LIB9P_MODE_PERM_OTHER_R x = LIB9P_MODE_PERM_OTHER_R; +#endif +#ifdef LIB9P_MODE_PERM_OTHER_W x = LIB9P_MODE_PERM_OTHER_W; +#endif +#ifdef LIB9P_MODE_PERM_OTHER_X x = LIB9P_MODE_PERM_OTHER_X; +#endif +#ifdef LIB9P_MODE_PERM_MASK x = LIB9P_MODE_PERM_MASK; +#endif +#ifdef LIB9P_MODE_FMT_PIPE x = LIB9P_MODE_FMT_PIPE; +#endif +#ifdef LIB9P_MODE_FMT_CHAR_DEV x = LIB9P_MODE_FMT_CHAR_DEV; +#endif +#ifdef LIB9P_MODE_FMT_DIRECTORY x = LIB9P_MODE_FMT_DIRECTORY; +#endif +#ifdef LIB9P_MODE_FMT_BLOCK_DEV x = LIB9P_MODE_FMT_BLOCK_DEV; +#endif +#ifdef LIB9P_MODE_FMT_REGULAR x = LIB9P_MODE_FMT_REGULAR; +#endif +#ifdef LIB9P_MODE_FMT_SYMLINK x = LIB9P_MODE_FMT_SYMLINK; +#endif +#ifdef LIB9P_MODE_FMT_SOCKET x = LIB9P_MODE_FMT_SOCKET; +#endif +#ifdef LIB9P_MODE_FMT_MASK x = LIB9P_MODE_FMT_MASK; +#endif +#ifdef LIB9P_B4_FALSE x = LIB9P_B4_FALSE; +#endif +#ifdef LIB9P_B4_TRUE x = LIB9P_B4_TRUE; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_63 x = _LIB9P_GETATTR_UNUSED_63; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_62 x = _LIB9P_GETATTR_UNUSED_62; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_61 x = _LIB9P_GETATTR_UNUSED_61; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_60 x = _LIB9P_GETATTR_UNUSED_60; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_59 x = _LIB9P_GETATTR_UNUSED_59; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_58 x = _LIB9P_GETATTR_UNUSED_58; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_57 x = _LIB9P_GETATTR_UNUSED_57; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_56 x = _LIB9P_GETATTR_UNUSED_56; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_55 x = _LIB9P_GETATTR_UNUSED_55; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_54 x = _LIB9P_GETATTR_UNUSED_54; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_53 x = _LIB9P_GETATTR_UNUSED_53; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_52 x = _LIB9P_GETATTR_UNUSED_52; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_51 x = _LIB9P_GETATTR_UNUSED_51; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_50 x = _LIB9P_GETATTR_UNUSED_50; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_49 x = _LIB9P_GETATTR_UNUSED_49; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_48 x = _LIB9P_GETATTR_UNUSED_48; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_47 x = _LIB9P_GETATTR_UNUSED_47; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_46 x = _LIB9P_GETATTR_UNUSED_46; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_45 x = _LIB9P_GETATTR_UNUSED_45; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_44 x = _LIB9P_GETATTR_UNUSED_44; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_43 x = _LIB9P_GETATTR_UNUSED_43; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_42 x = _LIB9P_GETATTR_UNUSED_42; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_41 x = _LIB9P_GETATTR_UNUSED_41; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_40 x = _LIB9P_GETATTR_UNUSED_40; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_39 x = _LIB9P_GETATTR_UNUSED_39; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_38 x = _LIB9P_GETATTR_UNUSED_38; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_37 x = _LIB9P_GETATTR_UNUSED_37; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_36 x = _LIB9P_GETATTR_UNUSED_36; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_35 x = _LIB9P_GETATTR_UNUSED_35; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_34 x = _LIB9P_GETATTR_UNUSED_34; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_33 x = _LIB9P_GETATTR_UNUSED_33; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_32 x = _LIB9P_GETATTR_UNUSED_32; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_31 x = _LIB9P_GETATTR_UNUSED_31; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_30 x = _LIB9P_GETATTR_UNUSED_30; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_29 x = _LIB9P_GETATTR_UNUSED_29; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_28 x = _LIB9P_GETATTR_UNUSED_28; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_27 x = _LIB9P_GETATTR_UNUSED_27; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_26 x = _LIB9P_GETATTR_UNUSED_26; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_25 x = _LIB9P_GETATTR_UNUSED_25; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_24 x = _LIB9P_GETATTR_UNUSED_24; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_23 x = _LIB9P_GETATTR_UNUSED_23; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_22 x = _LIB9P_GETATTR_UNUSED_22; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_21 x = _LIB9P_GETATTR_UNUSED_21; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_20 x = _LIB9P_GETATTR_UNUSED_20; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_19 x = _LIB9P_GETATTR_UNUSED_19; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_18 x = _LIB9P_GETATTR_UNUSED_18; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_17 x = _LIB9P_GETATTR_UNUSED_17; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_16 x = _LIB9P_GETATTR_UNUSED_16; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_15 x = _LIB9P_GETATTR_UNUSED_15; +#endif +#ifdef _LIB9P_GETATTR_UNUSED_14 x = _LIB9P_GETATTR_UNUSED_14; +#endif +#ifdef LIB9P_GETATTR_DATA_VERSION x = LIB9P_GETATTR_DATA_VERSION; +#endif +#ifdef LIB9P_GETATTR_GEN x = LIB9P_GETATTR_GEN; +#endif +#ifdef LIB9P_GETATTR_BTIME x = LIB9P_GETATTR_BTIME; +#endif +#ifdef LIB9P_GETATTR_BLOCKS x = LIB9P_GETATTR_BLOCKS; +#endif +#ifdef LIB9P_GETATTR_SIZE x = LIB9P_GETATTR_SIZE; +#endif +#ifdef LIB9P_GETATTR_INO x = LIB9P_GETATTR_INO; +#endif +#ifdef LIB9P_GETATTR_CTIME x = LIB9P_GETATTR_CTIME; +#endif +#ifdef LIB9P_GETATTR_MTIME x = LIB9P_GETATTR_MTIME; +#endif +#ifdef LIB9P_GETATTR_ATIME x = LIB9P_GETATTR_ATIME; +#endif +#ifdef LIB9P_GETATTR_RDEV x = LIB9P_GETATTR_RDEV; +#endif +#ifdef LIB9P_GETATTR_GID x = LIB9P_GETATTR_GID; +#endif +#ifdef LIB9P_GETATTR_UID x = LIB9P_GETATTR_UID; +#endif +#ifdef LIB9P_GETATTR_NLINK x = LIB9P_GETATTR_NLINK; +#endif +#ifdef LIB9P_GETATTR_MODE x = LIB9P_GETATTR_MODE; +#endif +#ifdef LIB9P_GETATTR_BASIC x = LIB9P_GETATTR_BASIC; +#endif +#ifdef LIB9P_GETATTR_ALL x = LIB9P_GETATTR_ALL; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_31 x = _LIB9P_SETATTR_UNUSED_31; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_30 x = _LIB9P_SETATTR_UNUSED_30; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_29 x = _LIB9P_SETATTR_UNUSED_29; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_28 x = _LIB9P_SETATTR_UNUSED_28; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_27 x = _LIB9P_SETATTR_UNUSED_27; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_26 x = _LIB9P_SETATTR_UNUSED_26; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_25 x = _LIB9P_SETATTR_UNUSED_25; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_24 x = _LIB9P_SETATTR_UNUSED_24; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_23 x = _LIB9P_SETATTR_UNUSED_23; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_22 x = _LIB9P_SETATTR_UNUSED_22; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_21 x = _LIB9P_SETATTR_UNUSED_21; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_20 x = _LIB9P_SETATTR_UNUSED_20; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_19 x = _LIB9P_SETATTR_UNUSED_19; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_18 x = _LIB9P_SETATTR_UNUSED_18; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_17 x = _LIB9P_SETATTR_UNUSED_17; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_16 x = _LIB9P_SETATTR_UNUSED_16; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_15 x = _LIB9P_SETATTR_UNUSED_15; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_14 x = _LIB9P_SETATTR_UNUSED_14; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_13 x = _LIB9P_SETATTR_UNUSED_13; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_12 x = _LIB9P_SETATTR_UNUSED_12; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_11 x = _LIB9P_SETATTR_UNUSED_11; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_10 x = _LIB9P_SETATTR_UNUSED_10; +#endif +#ifdef _LIB9P_SETATTR_UNUSED_9 x = _LIB9P_SETATTR_UNUSED_9; +#endif +#ifdef LIB9P_SETATTR_MTIME_SET x = LIB9P_SETATTR_MTIME_SET; +#endif +#ifdef LIB9P_SETATTR_ATIME_SET x = LIB9P_SETATTR_ATIME_SET; +#endif +#ifdef LIB9P_SETATTR_CTIME x = LIB9P_SETATTR_CTIME; +#endif +#ifdef LIB9P_SETATTR_MTIME x = LIB9P_SETATTR_MTIME; +#endif +#ifdef LIB9P_SETATTR_ATIME x = LIB9P_SETATTR_ATIME; +#endif +#ifdef LIB9P_SETATTR_SIZE x = LIB9P_SETATTR_SIZE; +#endif +#ifdef LIB9P_SETATTR_GID x = LIB9P_SETATTR_GID; +#endif +#ifdef LIB9P_SETATTR_UID x = LIB9P_SETATTR_UID; +#endif +#ifdef LIB9P_SETATTR_MODE x = LIB9P_SETATTR_MODE; +#endif +#ifdef LIB9P_LOCK_TYPE_RDLCK x = LIB9P_LOCK_TYPE_RDLCK; +#endif +#ifdef LIB9P_LOCK_TYPE_WRLCK x = LIB9P_LOCK_TYPE_WRLCK; +#endif +#ifdef LIB9P_LOCK_TYPE_UNLCK x = LIB9P_LOCK_TYPE_UNLCK; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_31 x = _LIB9P_LOCK_FLAGS_UNUSED_31; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_30 x = _LIB9P_LOCK_FLAGS_UNUSED_30; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_29 x = _LIB9P_LOCK_FLAGS_UNUSED_29; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_28 x = _LIB9P_LOCK_FLAGS_UNUSED_28; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_27 x = _LIB9P_LOCK_FLAGS_UNUSED_27; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_26 x = _LIB9P_LOCK_FLAGS_UNUSED_26; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_25 x = _LIB9P_LOCK_FLAGS_UNUSED_25; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_24 x = _LIB9P_LOCK_FLAGS_UNUSED_24; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_23 x = _LIB9P_LOCK_FLAGS_UNUSED_23; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_22 x = _LIB9P_LOCK_FLAGS_UNUSED_22; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_21 x = _LIB9P_LOCK_FLAGS_UNUSED_21; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_20 x = _LIB9P_LOCK_FLAGS_UNUSED_20; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_19 x = _LIB9P_LOCK_FLAGS_UNUSED_19; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_18 x = _LIB9P_LOCK_FLAGS_UNUSED_18; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_17 x = _LIB9P_LOCK_FLAGS_UNUSED_17; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_16 x = _LIB9P_LOCK_FLAGS_UNUSED_16; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_15 x = _LIB9P_LOCK_FLAGS_UNUSED_15; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_14 x = _LIB9P_LOCK_FLAGS_UNUSED_14; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_13 x = _LIB9P_LOCK_FLAGS_UNUSED_13; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_12 x = _LIB9P_LOCK_FLAGS_UNUSED_12; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_11 x = _LIB9P_LOCK_FLAGS_UNUSED_11; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_10 x = _LIB9P_LOCK_FLAGS_UNUSED_10; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_9 x = _LIB9P_LOCK_FLAGS_UNUSED_9; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_8 x = _LIB9P_LOCK_FLAGS_UNUSED_8; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_7 x = _LIB9P_LOCK_FLAGS_UNUSED_7; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_6 x = _LIB9P_LOCK_FLAGS_UNUSED_6; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_5 x = _LIB9P_LOCK_FLAGS_UNUSED_5; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_4 x = _LIB9P_LOCK_FLAGS_UNUSED_4; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_3 x = _LIB9P_LOCK_FLAGS_UNUSED_3; +#endif +#ifdef _LIB9P_LOCK_FLAGS_UNUSED_2 x = _LIB9P_LOCK_FLAGS_UNUSED_2; +#endif +#ifdef LIB9P_LOCK_FLAGS_RECLAIM x = LIB9P_LOCK_FLAGS_RECLAIM; +#endif +#ifdef LIB9P_LOCK_FLAGS_BLOCK x = LIB9P_LOCK_FLAGS_BLOCK; +#endif +#ifdef LIB9P_LOCK_STATUS_SUCCESS x = LIB9P_LOCK_STATUS_SUCCESS; +#endif +#ifdef LIB9P_LOCK_STATUS_BLOCKED x = LIB9P_LOCK_STATUS_BLOCKED; +#endif +#ifdef LIB9P_LOCK_STATUS_ERROR x = LIB9P_LOCK_STATUS_ERROR; +#endif +#ifdef LIB9P_LOCK_STATUS_GRACE x = LIB9P_LOCK_STATUS_GRACE; +#endif +#ifdef LIB9P_TMSG_MAX_IOV x = LIB9P_TMSG_MAX_IOV; +#endif +#ifdef LIB9P_TMSG_MAX_IOV x = LIB9P_TMSG_MAX_IOV; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_TMSG_MAX_COPY x = LIB9P_TMSG_MAX_COPY; +#endif +#ifdef LIB9P_RMSG_MAX_IOV x = LIB9P_RMSG_MAX_IOV; +#endif +#ifdef LIB9P_RMSG_MAX_IOV x = LIB9P_RMSG_MAX_IOV; +#endif +#ifdef LIB9P_RMSG_MAX_IOV x = LIB9P_RMSG_MAX_IOV; +#endif +#ifdef LIB9P_RMSG_MAX_COPY x = LIB9P_RMSG_MAX_COPY; +#endif return 0; } diff --git a/lib9p/tests/test_compile.c.gen b/lib9p/tests/test_compile.c.gen index 1289943..7ffbd77 100755 --- a/lib9p/tests/test_compile.c.gen +++ b/lib9p/tests/test_compile.c.gen @@ -13,7 +13,7 @@ outfile=$2 echo "#include <lib9p/core.h>" echo 'int main(void) {' echo ' [[gnu::unused]] uint64_t x;' - sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/ x = \1;/p' <"$generated_h" + sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/#ifdef \1\n x = \1;\n#endif/p' <"$generated_h" echo ' return 0;' echo '}' } >"$outfile" diff --git a/lib9p/tests/test_compile_config/config.h b/lib9p/tests/test_compile_config/config.h index f899dfa..02cb8e5 100644 --- a/lib9p/tests/test_compile_config/config.h +++ b/lib9p/tests/test_compile_config/config.h @@ -7,13 +7,25 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ +/* 9P *************************************************************************/ + #define CONFIG_9P_MAX_ERR_SIZE 128 #define CONFIG_9P_MAX_9P2000_e_WELEM 16 -#define CONFIG_9P_ENABLE_9P2000 1 /* bool */ -#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */ -#define CONFIG_9P_ENABLE_9P2000_e 1 /* bool */ -#define CONFIG_9P_ENABLE_9P2000_L 1 /* bool */ -#define CONFIG_9P_ENABLE_9P2000_p9p 1 /* bool */ +/* 9P_SRV *********************************************************************/ + +#define CONFIG_9P_SRV_MAX_MSG_SIZE ((4*1024)+24) +#define CONFIG_9P_SRV_MAX_HOSTMSG_SIZE CONFIG_9P_SRV_MAX_MSG_SIZE+16 + +/* COROUTINE ******************************************************************/ + +#define CONFIG_COROUTINE_STACK_SIZE_DEFAULT (32*1024) +#define CONFIG_COROUTINE_NAME_LEN 16 +#define CONFIG_COROUTINE_MEASURE_STACK 1 /* bool */ +#define CONFIG_COROUTINE_PROTECT_STACK 1 /* bool */ +#define CONFIG_COROUTINE_DEBUG 0 /* bool */ +#define CONFIG_COROUTINE_VALGRIND 1 /* bool */ +#define CONFIG_COROUTINE_GDB 1 /* bool */ +#define CONFIG_COROUTINE_NUM 8 #endif /* _CONFIG_H_ */ |