1 /* common stuff for cgi-fcgi-interp and prefork-interp */
16 #include <sys/types.h>
18 #include <sys/utsname.h>
19 #include <sys/socket.h>
30 #include <nettle/sha.h>
33 #include "timespeccmp.h"
37 extern const char *interp, *ident, *script, *socket_path, *lock_path;
39 extern struct sha256_ctx identsc;
41 extern const char our_name[];
43 bool find_run_base_var_run(void);
44 void find_socket_path(void);
46 int acquire_lock(void);
48 extern const struct cmdinfo cmdinfos[];
49 #define PREFORK_CMDINFOS \
50 { "help", 0, .call=of_help }, \
51 { 0, 'g', 1, .sassignto= &ident }, \
52 { 0, 'G', 1, .call= ident_addstring }, \
53 { 0, 'E', 1, .call= off_ident_addenv },
55 void process_opts(const char *const **argv_io);
57 void vmsgcore(int estatus, int errnoval, const char *fmt, va_list al);
59 #define DEF_MSG(func, attrs, estatus, errnoval, after) \
60 static void func(const char *fmt, ...) \
61 __attribute__((unused, format(printf,1,2))) attrs; \
62 static void func(const char *fmt, ...) { \
65 vmsgcore(estatus,errnoval,fmt,al); \
69 DEF_MSG(warninge, /*empty*/, 0, errno, { });
70 DEF_MSG(warning , /*empty*/, 0, -1, { });
72 #define DEF_DIE(func, errnoval) \
73 DEF_MSG(func, __attribute__((noreturn)), 127, errnoval, { abort(); })
80 void fusagemessage(FILE *f);
81 void usagemessage(void);
82 void of_help(const struct cmdinfo *ci, const char *val);
83 void of_iassign(const struct cmdinfo *ci, const char *val);
84 void ident_addstring(const struct cmdinfo *ci, const char *string);
85 void off_ident_addenv(const struct cmdinfo *ci, const char *name);
86 void ident_addinit(void);
87 bool stabs_same_inode(struct stat *a, struct stat *b);