summaryrefslogtreecommitdiff
path: root/cmd/srv9p
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-13 15:23:42 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-19 20:15:12 -0700
commit0360ef3a038c8c3f6f252fdc8f1b91e4cbdd4e39 (patch)
tree387fde8b794f059484e300bef5fc1051fb30095c /cmd/srv9p
parent363e741feba2268db9c72215460c627bcc4f33ac (diff)
libcr: Start to add coroutine names
Diffstat (limited to 'cmd/srv9p')
-rw-r--r--cmd/srv9p/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c
index c5a3367..076d756 100644
--- a/cmd/srv9p/main.c
+++ b/cmd/srv9p/main.c
@@ -99,17 +99,23 @@ static COROUTINE read_cr(void *_srv) {
cr_end();
}
+const char *hexdig = "0123456789abcdef";
+
int main() {
struct lib9p_srv srv = {
.rootdir = get_root,
};
- for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++)
- if (!coroutine_add(read_cr, &srv))
+ for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++) {
+ char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'};
+ if (!coroutine_add(name, read_cr, &srv))
error(1, 0, "coroutine_add(read_cr, &srv)");
- for (int i = 0; i < 2*CONFIG_SRV9P_NUM_CONNS; i++)
- if (!coroutine_add(lib9p_srv_write_cr, &srv))
+ }
+ for (int i = 0; i < 2*CONFIG_SRV9P_NUM_CONNS; i++) {
+ char name[] = {'w', 'r', 'i', 't', 'e', '-', hexdig[i], '\0'};
+ if (!coroutine_add(name, lib9p_srv_write_cr, &srv))
error(1, 0, "coroutine_add(lib9p_srv_write_cr, &srv)");
+ }
coroutine_main();
return 1;