about summary refs log tree commit diff stats
path: root/helloworld.c
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-09-06 13:43:35 -0400
committerahriman <ahriman@falte.red>2019-09-06 13:43:35 -0400
commitb9d26dae6af160ead451762de6219485ae9b27b7 (patch)
tree3b2cde58d0beb3a88d0971cae110d910393a3f85 /helloworld.c
parent64252e606cbdcb4d72a802bbf7006bd4cbc7ce52 (diff)
downloadsite-b9d26dae6af160ead451762de6219485ae9b27b7.tar.gz
moved example c/cgi file
Diffstat (limited to 'helloworld.c')
-rw-r--r--helloworld.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/helloworld.c b/helloworld.c
new file mode 100644
index 0000000..fcae386
--- /dev/null
+++ b/helloworld.c
@@ -0,0 +1,16 @@
+#include <err.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+    if (-1 == pledge("stdio", NULL)) 
+        err(EXIT_FAILURE, "pledge");
+    puts("Status: 200 OK\r");
+    puts("Content-Type: text/html\r");
+    puts("\r");
+    puts("Hello, world!\n");
+    return(EXIT_SUCCESS);
+}