1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <error.h> #include <stdio.h> #include "coroutine.h" #include "net9p.h" int main() { int sock = netio_listen(9000); if (sock < 0) error(1, -sock, "netio_listen"); for (int i = 0; i < 8; i++) if (!coroutine_add(net9p_cr, &sock)) error(1, 0, "coroutine_add(net9p_cr, NULL)"); coroutine_main(); return 1; }