5 * oserver - a demonstration module for LCA2011
7 * This code shows off the features of CCAN and various C cantrips.
12 * #include <sys/types.h>
13 * #include <sys/socket.h>
14 * #include <ccan/oserver/oserver.h>
22 * sockfd = oserver_setup();
24 * fd = accept(sockfd, NULL, NULL);
26 * err(1, "Accepting connection on TCP socket");
28 * if (!oserver_serve(fd))
29 * err(1, "Serving client");
33 int main(int argc, char *argv[])
35 /* Expect exactly one argument */
39 if (strcmp(argv[1], "depends") == 0) {
40 printf("ccan/read_write_all\n");
42 printf("ccan/foreach\n");