Mercurial > hg > toybox
comparison toys.h @ 1299:313980d3d78c draft
Add generic_signal() handler, which sets toys.signal and writes byte to toys.signalfd if set.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 21 May 2014 07:24:16 -0500 |
parents | c47218ccbfdf |
children | 3b85d2ce34aa |
comparison
equal
deleted
inserted
replaced
1298:c25ee9918e65 | 1299:313980d3d78c |
---|---|
21 #include <math.h> | 21 #include <math.h> |
22 #include <pwd.h> | 22 #include <pwd.h> |
23 #include <regex.h> | 23 #include <regex.h> |
24 #include <sched.h> | 24 #include <sched.h> |
25 #include <setjmp.h> | 25 #include <setjmp.h> |
26 #include <signal.h> | |
26 #include <stdarg.h> | 27 #include <stdarg.h> |
27 #include <stddef.h> | 28 #include <stddef.h> |
28 #include <stdint.h> | 29 #include <stdint.h> |
29 #include <stdio.h> | 30 #include <stdio.h> |
30 #include <stdlib.h> | 31 #include <stdlib.h> |
123 int exitval; // Value error_exit feeds to exit() | 124 int exitval; // Value error_exit feeds to exit() |
124 int optc; // Count of optargs | 125 int optc; // Count of optargs |
125 int exithelp; // Should error_exit print a usage message first? | 126 int exithelp; // Should error_exit print a usage message first? |
126 int old_umask; // Old umask preserved by TOYFLAG_UMASK | 127 int old_umask; // Old umask preserved by TOYFLAG_UMASK |
127 int toycount; // Total number of commands in this build | 128 int toycount; // Total number of commands in this build |
129 int signal; // generic_signal() records what signal it saw here | |
130 int signalfd; // and writes signal to this fd, if set | |
128 | 131 |
129 // This is at the end so toy_init() doesn't zero it. | 132 // This is at the end so toy_init() doesn't zero it. |
130 jmp_buf *rebound; // longjmp here instead of exit when do_rebound set | 133 jmp_buf *rebound; // longjmp here instead of exit when do_rebound set |
131 } toys; | 134 } toys; |
132 | 135 |