summaryrefslogtreecommitdiffstats
path: root/hw4/cgiprog/server_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw4/cgiprog/server_info.c')
-rw-r--r--hw4/cgiprog/server_info.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw4/cgiprog/server_info.c b/hw4/cgiprog/server_info.c
new file mode 100644
index 0000000..a49022f
--- /dev/null
+++ b/hw4/cgiprog/server_info.c
@@ -0,0 +1,17 @@
+#define _POSIX_C_SOURCE 200809L
+#define NL "\015\012"
+#include <sys/types.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int main (int argc, char* argv[]) {
+ kill (getppid (), SIGUSR1);
+ fputs (
+ "HTTP/1.1 200 OK" NL
+ "Content-Type: text/html" NL NL
+ "<html><head><title>Info Request</title></head>" NL
+ "<body><p>Look at your console!</p>"
+ "</body></html>" NL, stdout);
+ return 0;
+}