path: root/src/pies.h
authorSergey Poznyakoff <>2014-06-09 18:19:09 (GMT)
committer Sergey Poznyakoff <>2014-06-09 18:26:20 (GMT)
commitcf4ab27d35038a7e4b1d5db119729c142b15abb7 (patch) (side-by-side diff)
tree2f5df3d4fdac6aa0b7af32e87d24585327aabae2 /src/pies.h
parent17c44ea5af850bd03d4eeb245bb8fb35e7d07d90 (diff)
Implement ctrlaltdel and kbrequest processes.
* src/sysdep.c: New file. * src/ (pies_SOURCES): Add sysdep.c * src/pies.c (ACTION_*): Move to pies.h (sig_handler): Call sysvinit_sigtrans, return immediately if it handles the signal. (setsigvhan): New function. (add_extra_sigv): New function. (signal_setup): Rewrite. (main): Handle ACTION_CTRLALTDEL and ACTION_KBREQUEST. * src/pies.h (PIES_COMP_DEFAULT) (PIES_COMP_WAIT,PIES_COMP_MASK): New defines. (pies_action): New enum, add new actions: ACTION_CTRLALTDEL and ACTION_KBREQUEST. (setsigvhan, add_extra_sigv) (sysvinit_sigtrans,sysvinit_runlevel_setup) (sysvinit_sysdep_begin): New protos. (sysvinit_request) <pad>: Rename to data. * src/sysvinit.c (enablecomp): Change meaning of the data pointer. (sysvinit_runlevel_setup): Change signature. Remove static qualifier. All uses changed. (sysvinit_setenv): New static. (sysvinit_fifo_handler): Handle INIT_CMD_SETENV. (sysvinit_sigtrans): New function. (sysvinit_begin): Set up new signals. Call sysvinit_sysdep_begin.
Diffstat (limited to 'src/pies.h') (more/less context) (ignore whitespace changes)
1 files changed, 21 insertions, 2 deletions
diff --git a/src/pies.h b/src/pies.h
index 28a27a7..73f6d18 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -183,6 +183,10 @@ enum pies_comp_mode
pies_comp_respawn = pies_comp_exec,
+#define PIES_COMP_WAIT 0x01
+#define PIES_COMP_MASK(m) (1 << ((m)+1))
#define CF_DISABLED 0x001 /* The componenet is disabled */
#define CF_PRECIOUS 0x002 /* The component is precious (should not
be disabled) */
@@ -259,7 +263,17 @@ union pies_sockaddr_storage
struct sockaddr_in s_in;
struct sockaddr_un s_un;
+enum pies_action {
extern char *log_tag;
extern int log_facility;
extern unsigned long shutdown_timeout;
@@ -323,6 +337,8 @@ int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen);
void log_setup (int want_stderr);
void signal_setup (RETSIGTYPE (*sf)(int));
+void setsigvhan (RETSIGTYPE (*handler) (int signo), int *sigv, int sigc);
+void add_extra_sigv (int *sigv, int sigc);
typedef struct pies_depmap *pies_depmap_t;
typedef struct pies_depmap_pos *pies_depmap_pos_t;
@@ -478,6 +494,9 @@ int is_valid_runlevel (int c);
int console_open (int mode);
int telinit (const char *arg);
int inittab_parse (const char *file);
+int sysvinit_sigtrans (int sig, int *pact);
+void sysvinit_runlevel_setup (int mask, int *wait);
+void sysvinit_sysdep_begin (void);
extern char *sysvinit_environ_hint[];
@@ -502,7 +521,7 @@ struct sysvinit_request {
int cmd; /* What kind of request */
int runlevel; /* Runlevel to change to */
int sleeptime; /* Time between TERM and KILL */
- char pad[368];
+ char data[368];

Return to:

Send suggestions and report system problems to the System administrator.