diff options
| -rw-r--r-- | content/notes/2024-06-17-sending-signals-to-c-programs.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/notes/2024-06-17-sending-signals-to-c-programs.md b/content/notes/2024-06-17-sending-signals-to-c-programs.md index 187beeb..75d5990 100644 --- a/content/notes/2024-06-17-sending-signals-to-c-programs.md +++ b/content/notes/2024-06-17-sending-signals-to-c-programs.md | |||
| @@ -20,7 +20,7 @@ though this is really not advisable. | |||
| 20 | #include <unistd.h> | 20 | #include <unistd.h> |
| 21 | 21 | ||
| 22 | void handle_signal(int signal) { | 22 | void handle_signal(int signal) { |
| 23 | printf("Signal received %d\n", signal); | 23 | printf("Signal received: %d\n", signal); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | int main() { | 26 | int main() { |
| @@ -37,7 +37,7 @@ int main() { | |||
| 37 | 37 | ||
| 38 | Compile with `gcc -o signal signal.c` and run the program with `./signal` and | 38 | Compile with `gcc -o signal signal.c` and run the program with `./signal` and |
| 39 | then from another terminal send the signal to the program with `kill -10 | 39 | then from another terminal send the signal to the program with `kill -10 |
| 40 | $(pidof signal)` which should print out `Signal received 10`. | 40 | $(pidof signal)` which should print out `Signal received: 10`. |
| 41 | 41 | ||
| 42 | | Signal | x86/ARM | Alpha/ | MIPS | PARISC | Notes | | 42 | | Signal | x86/ARM | Alpha/ | MIPS | PARISC | Notes | |
| 43 | |-----------|---------|--------|------|--------|---------------| | 43 | |-----------|---------|--------|------|--------|---------------| |
