RWBUFFER_SIZE_MB=16
PROGRAMS= readbuffer writebuffer with-lock-ex xbatmon-simple \
- summer watershed rcopy-repeatedly xduplic-copier
+ summer watershed rcopy-repeatedly xduplic-copier \
+ cgi-fcgi-perl
SUIDSBINPROGRAMS= really
DAEMONS= trivsoundd
MAN1PAGES= readbuffer.1 writebuffer.1 with-lock-ex.1 \
trivsoundd: trivsoundd.o wrbufcore.o rwbuffer.o
really: really.o myopt.o
acctdump: acctdump.o myopt.o
+cgi-fcgi-perl: cgi-fcgi-perl.o myopt.o
acctdump.o really.o myopt.o rcopy-repeatedly.o: myopt.h
readbuffer.o writebuffer.o rwbuffer.o wrbufcore.o trivsoundd.o: rwbuffer.h
*
* Options:
*
- * -M<ident>
+ * -g<ident>
* Use <ident> rather than hex(sha256(<script>))
* as the basename of the leafname of the fcgi rendezvous
* socket. If <ident> contains only hex digit characters it
* - run cgi-fcgi -connect SOCKET SCRIPT
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "myopt.h"
+
+static const char *ident;
+static int numservers;
+
+static void diee(const char *m) {
+ fprintf(stderr,"cgi-fcgi-: error: %s failed: %s\n", m, strerror(errno));
+ exit(127);
+}
+
+static void fusagemessage(FILE *f) {
+ fprintf(f, "usage: #!/usr/bin/cgi-fcgi-perl [<options>]\n");
+}
+
+void usagemessage(void) { fusagemessage(stderr); }
+
+static void of_help(const struct cmdinfo *ci, const char *val) {
+ fusagemessage(stdout);
+ if (ferror(stdout)) diee("write usage message to stdout");
+ exit(0);
+}
+
+static const struct cmdinfo cmdinfos[]= {
+ { "help", 0, .call= of_help },
+ { 0, 'g', 1, .sassignto= &ident },
+ { 0, 'M', 1, .iassignto= &numservers },
+ { 0 }
+};
+
+int main(int argc, const char *const *argv) {
+ myopt(&argv, cmdinfos);
+ exit(0);
+}