summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-20 18:58:21 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-22 19:32:44 -0600
commitf181fcb587e88ac602289a2f258b7a39e745a4e4 (patch)
tree9317fa4150dc7ae7b35272188adc716d05ace789
parent83c207920d2073c45ff15d1da92a126d8d892eec (diff)
lib9p: idl: Create an 'errno' type
-rw-r--r--lib9p/9p.c4
-rw-r--r--lib9p/9p.generated.c124
-rw-r--r--lib9p/idl/2005-9P2000.u.9p5
-rw-r--r--lib9p/idl/2010-9P2000.L.9p4
-rw-r--r--lib9p/include/lib9p/9p.generated.h46
-rw-r--r--lib9p/include/lib9p/9p.h6
-rw-r--r--lib9p/tests/test_compile.c1
7 files changed, 109 insertions, 81 deletions
diff --git a/lib9p/9p.c b/lib9p/9p.c
index 1caa01a..74a786c 100644
--- a/lib9p/9p.c
+++ b/lib9p/9p.c
@@ -79,7 +79,7 @@ bool lib9p_ctx_has_error(struct lib9p_ctx *ctx) {
return ctx->err_msg[0];
}
-int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg) {
+int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *msg) {
if (lib9p_ctx_has_error(ctx))
return -1;
strncpy(ctx->err_msg, msg, sizeof(ctx->err_msg));
@@ -94,7 +94,7 @@ int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg) {
return -1;
}
-int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, ...) {
+int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) {
int n;
va_list args;
diff --git a/lib9p/9p.generated.c b/lib9p/9p.generated.c
index 567f450..955429e 100644
--- a/lib9p/9p.generated.c
+++ b/lib9p/9p.generated.c
@@ -479,6 +479,12 @@ LM_ALWAYS_INLINE static bool validate_o(struct _validate_ctx *ctx) {
}
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
+#if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u
+LM_ALWAYS_INLINE static bool validate_errno(struct _validate_ctx *ctx) {
+ return validate_4(ctx);
+}
+
+#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
LM_ALWAYS_INLINE static bool validate_getattr(struct _validate_ctx *ctx) {
if (validate_8(ctx))
@@ -639,22 +645,6 @@ LM_FLATTEN static bool validate_Rwstat(struct _validate_ctx *ctx) {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-LM_FLATTEN static bool validate_Rlerror(struct _validate_ctx *ctx) {
- uint32_t size;
- uint8_t typ;
- uint32_t _size_offset;
- return false
- || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; }))
- || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; }))
- || validate_tag(ctx)
- || validate_4(ctx)
- || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) &&
- lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); })
- || ({ uint8_t exp = 7; (((uint8_t)typ) != exp) &&
- lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); })
- ;
-}
-
LM_FLATTEN static bool validate_Rstatfs(struct _validate_ctx *ctx) {
uint32_t size;
uint8_t typ;
@@ -1108,25 +1098,6 @@ LM_FLATTEN static bool validate_Rversion(struct _validate_ctx *ctx) {
;
}
-LM_FLATTEN static bool validate_Rerror(struct _validate_ctx *ctx) {
- uint32_t size;
- uint8_t typ;
- uint32_t _size_offset;
- return false
- || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; }))
- || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; }))
- || validate_tag(ctx)
- || validate_s(ctx)
-#if CONFIG_9P_ENABLE_9P2000_u
- || ( is_ver(ctx, 9P2000_u) && validate_4(ctx) )
-#endif /* CONFIG_9P_ENABLE_9P2000_u */
- || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) &&
- lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); })
- || ({ uint8_t exp = 107; (((uint8_t)typ) != exp) &&
- lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); })
- ;
-}
-
LM_FLATTEN static bool validate_Twalk(struct _validate_ctx *ctx) {
uint32_t size;
uint8_t typ;
@@ -1553,7 +1524,44 @@ LM_FLATTEN static bool validate_Topenfd(struct _validate_ctx *ctx) {
}
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
+LM_FLATTEN static bool validate_Rerror(struct _validate_ctx *ctx) {
+ uint32_t size;
+ uint8_t typ;
+ uint32_t _size_offset;
+ return false
+ || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; }))
+ || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; }))
+ || validate_tag(ctx)
+ || validate_s(ctx)
+#if CONFIG_9P_ENABLE_9P2000_u
+ || ( is_ver(ctx, 9P2000_u) && validate_errno(ctx) )
+#endif /* CONFIG_9P_ENABLE_9P2000_u */
+ || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) &&
+ lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); })
+ || ({ uint8_t exp = 107; (((uint8_t)typ) != exp) &&
+ lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); })
+ ;
+}
+
+#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
+LM_FLATTEN static bool validate_Rlerror(struct _validate_ctx *ctx) {
+ uint32_t size;
+ uint8_t typ;
+ uint32_t _size_offset;
+ return false
+ || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; }))
+ || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; }))
+ || validate_tag(ctx)
+ || validate_errno(ctx)
+ || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) &&
+ lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); })
+ || ({ uint8_t exp = 7; (((uint8_t)typ) != exp) &&
+ lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); })
+ ;
+}
+
LM_FLATTEN static bool validate_Tgetattr(struct _validate_ctx *ctx) {
uint32_t size;
uint8_t typ;
@@ -2001,6 +2009,12 @@ LM_ALWAYS_INLINE static void unmarshal_o(struct _unmarshal_ctx *ctx, lib9p_o_t *
}
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
+#if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u
+LM_ALWAYS_INLINE static void unmarshal_errno(struct _unmarshal_ctx *ctx, lib9p_errno_t *out) {
+ unmarshal_4(ctx, (uint32_t *)out);
+}
+
+#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
LM_ALWAYS_INLINE static void unmarshal_getattr(struct _unmarshal_ctx *ctx, lib9p_getattr_t *out) {
unmarshal_8(ctx, (uint64_t *)out);
@@ -2082,14 +2096,6 @@ LM_FLATTEN static void unmarshal_Rwstat(struct _unmarshal_ctx *ctx, struct lib9p
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-LM_FLATTEN static void unmarshal_Rlerror(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rlerror *out) {
- memset(out, 0, sizeof(*out));
- ctx->net_offset += 4;
- ctx->net_offset += 1;
- unmarshal_tag(ctx, &out->tag);
- unmarshal_4(ctx, &out->ecode);
-}
-
LM_FLATTEN static void unmarshal_Rstatfs(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rstatfs *out) {
memset(out, 0, sizeof(*out));
ctx->net_offset += 4;
@@ -2324,17 +2330,6 @@ LM_FLATTEN static void unmarshal_Rversion(struct _unmarshal_ctx *ctx, struct lib
unmarshal_s(ctx, &out->version);
}
-LM_FLATTEN static void unmarshal_Rerror(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rerror *out) {
- memset(out, 0, sizeof(*out));
- ctx->net_offset += 4;
- ctx->net_offset += 1;
- unmarshal_tag(ctx, &out->tag);
- unmarshal_s(ctx, &out->ename);
-#if CONFIG_9P_ENABLE_9P2000_u
- if ( is_ver(ctx, 9P2000_u) ) unmarshal_4(ctx, &out->errno);
-#endif /* CONFIG_9P_ENABLE_9P2000_u */
-}
-
LM_FLATTEN static void unmarshal_Twalk(struct _unmarshal_ctx *ctx, struct lib9p_msg_Twalk *out) {
memset(out, 0, sizeof(*out));
ctx->net_offset += 4;
@@ -2596,7 +2591,28 @@ LM_FLATTEN static void unmarshal_Topenfd(struct _unmarshal_ctx *ctx, struct lib9
}
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
+LM_FLATTEN static void unmarshal_Rerror(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rerror *out) {
+ memset(out, 0, sizeof(*out));
+ ctx->net_offset += 4;
+ ctx->net_offset += 1;
+ unmarshal_tag(ctx, &out->tag);
+ unmarshal_s(ctx, &out->ename);
+#if CONFIG_9P_ENABLE_9P2000_u
+ if ( is_ver(ctx, 9P2000_u) ) unmarshal_errno(ctx, &out->errno);
+#endif /* CONFIG_9P_ENABLE_9P2000_u */
+}
+
+#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
+LM_FLATTEN static void unmarshal_Rlerror(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rlerror *out) {
+ memset(out, 0, sizeof(*out));
+ ctx->net_offset += 4;
+ ctx->net_offset += 1;
+ unmarshal_tag(ctx, &out->tag);
+ unmarshal_errno(ctx, &out->ecode);
+}
+
LM_FLATTEN static void unmarshal_Tgetattr(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tgetattr *out) {
memset(out, 0, sizeof(*out));
ctx->net_offset += 4;
diff --git a/lib9p/idl/2005-9P2000.u.9p b/lib9p/idl/2005-9P2000.u.9p
index d96bbce..fefe3e9 100644
--- a/lib9p/idl/2005-9P2000.u.9p
+++ b/lib9p/idl/2005-9P2000.u.9p
@@ -14,6 +14,9 @@ from ./2002-9P2000.9p import *
num nuid = 4
"NONUID = ~0"
+num errno = 4
+ "NOERROR = 0"
+
struct stat += "file_extension[s]"
"file_owner_n_uid[nuid]"
"file_owner_n_gid[nuid]"
@@ -22,7 +25,7 @@ struct stat += "file_extension[s]"
msg Tauth += "n_uid[nuid]"
msg Tattach += "n_uid[nuid]"
-msg Rerror += "errno[4]"
+msg Rerror += "errno[errno]"
bitfield dm += "23=DEVICE"
"21=NAMEDPIPE"
diff --git a/lib9p/idl/2010-9P2000.L.9p b/lib9p/idl/2010-9P2000.L.9p
index e21d411..9c095ad 100644
--- a/lib9p/idl/2010-9P2000.L.9p
+++ b/lib9p/idl/2010-9P2000.L.9p
@@ -10,7 +10,7 @@ version "9P2000.L"
from ./2002-9P2000.9p import tag, fid, s, qt, qid
from ./2002-9P2000.9p import Rerror
from ./2002-9P2000.9p import Tversion, Rversion, Tflush, Rflush, Twalk, Rwalk, Tread, Rread, Twrite, Rwrite, Tclunk, Rclunk, Tremove, Rremove
-from ./2005-9P2000.u.9p import nuid, Tauth, Rauth, Tattach, Rattach
+from ./2005-9P2000.u.9p import nuid, errno, Tauth, Rauth, Tattach, Rattach
bitfield getattr = 8
"0=MODE"
@@ -59,7 +59,7 @@ num lock_status = 1
"GRACE=3"
#msg Tlerror = "size[4,val=end-&size] typ[1,val=6] tag[tag] illegal" # analogous to 106/Terror
-msg Rlerror = "size[4,val=end-&size] typ[1,val=7] tag[tag] ecode[4]" # analogous to 107/Rerror
+msg Rlerror = "size[4,val=end-&size] typ[1,val=7] tag[tag] ecode[errno]" # analogous to 107/Rerror
msg Tstatfs = "size[4,val=end-&size] typ[1,val=8] tag[tag] fid[fid]"
msg Rstatfs = "size[4,val=end-&size] typ[1,val=9] tag[tag] type[4] bsize[4] blocks[8] bfree[8] bavail[8] files[8] ffree[8] fsid[8] namelen[4]"
msg Tlopen = "size[4,val=end-&size] typ[1,val=12] tag[tag] fid[fid] flags[4]" # analogous to 112/Topen
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h
index f107b1f..9003416 100644
--- a/lib9p/include/lib9p/9p.generated.h
+++ b/lib9p/include/lib9p/9p.generated.h
@@ -261,6 +261,12 @@ typedef uint8_t lib9p_o_t;
#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100))
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
+#if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
+typedef uint32_t lib9p_errno_t;
+#define LIB9P_ERRNO_NOERROR ((lib9p_errno_t)UINT32_C(0))
+
+#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
/* size = 8 ; max_iov = 1 ; max_copy = 8 */
typedef uint64_t lib9p_getattr_t;
@@ -463,12 +469,6 @@ struct lib9p_msg_Rwstat {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 11 ; max_iov = 1 ; max_copy = 11 */
-struct lib9p_msg_Rlerror {
- lib9p_tag_t tag;
- uint32_t ecode;
-};
-
/* size = 67 ; max_iov = 1 ; max_copy = 67 */
struct lib9p_msg_Rstatfs {
lib9p_tag_t tag;
@@ -648,19 +648,6 @@ struct lib9p_msg_Rversion {
struct lib9p_s version;
};
-/* LIB9P_VER_9P2000 : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
-/* LIB9P_VER_9P2000_L : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
-/* LIB9P_VER_9P2000_e : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
-/* LIB9P_VER_9P2000_p9p: min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
-/* LIB9P_VER_9P2000_u : min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 3 ; max_copy = 13 */
-struct lib9p_msg_Rerror {
- lib9p_tag_t tag;
- struct lib9p_s ename;
-#if CONFIG_9P_ENABLE_9P2000_u
- uint32_t errno;
-#endif /* CONFIG_9P_ENABLE_9P2000_u */
-};
-
/* min_size = 17 ; exp_size = 481 ; max_size = 1,048,609 ; max_iov = 32 ; max_copy = 49 */
struct lib9p_msg_Twalk {
lib9p_tag_t tag;
@@ -878,7 +865,28 @@ struct lib9p_msg_Topenfd {
};
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
+/* LIB9P_VER_9P2000 : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_L : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_e : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_p9p: min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_u : min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 3 ; max_copy = 13 */
+struct lib9p_msg_Rerror {
+ lib9p_tag_t tag;
+ struct lib9p_s ename;
+#if CONFIG_9P_ENABLE_9P2000_u
+ lib9p_errno_t errno;
+#endif /* CONFIG_9P_ENABLE_9P2000_u */
+};
+
+#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
+struct lib9p_msg_Rlerror {
+ lib9p_tag_t tag;
+ lib9p_errno_t ecode;
+};
+
/* size = 19 ; max_iov = 1 ; max_copy = 19 */
struct lib9p_msg_Tgetattr {
lib9p_tag_t tag;
diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h
index 4ecb172..35b7ef2 100644
--- a/lib9p/include/lib9p/9p.h
+++ b/lib9p/include/lib9p/9p.h
@@ -46,7 +46,7 @@ struct lib9p_ctx {
/* state */
#ifdef CONFIG_9P_ENABLE_9P2000_u
- uint32_t err_num;
+ lib9p_errno_t err_num;
#endif
[[gnu::nonstring]] char err_msg[CONFIG_9P_MAX_ERR_SIZE];
};
@@ -56,9 +56,9 @@ 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, uint32_t linux_errno, char const *msg);
+int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *msg);
/** Write a printf-style error into ctx, return -1. */
-int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]];
+int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]];
/* main T-message functions ***************************************************/
diff --git a/lib9p/tests/test_compile.c b/lib9p/tests/test_compile.c
index 0e33522..d001b2f 100644
--- a/lib9p/tests/test_compile.c
+++ b/lib9p/tests/test_compile.c
@@ -46,6 +46,7 @@ int main(void) {
x = LIB9P_O_EXEC;
x = LIB9P_O_MODE_MASK;
x = LIB9P_O_FLAG_MASK;
+ x = LIB9P_ERRNO_NOERROR;
x = LIB9P_GETATTR_DATA_VERSION;
x = LIB9P_GETATTR_GEN;
x = LIB9P_GETATTR_BTIME;