This repository has been archived by the owner on May 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
test code
- Loading branch information
1 parent
d99586f
commit c19966b
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
#include "uv.h" | ||
|
||
#include <signal.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
uv_signal_t sigint, sigbreak, sigterm; | ||
|
||
|
||
void signal_cb(uv_signal_t* handle, int signum) { | ||
printf("Signal: %d\n", signum); | ||
} | ||
|
||
|
||
int main(int argc, char* argv[]) { | ||
|
||
uv_signal_init(uv_default_loop(), &sigint); | ||
uv_signal_start(&sigint, signal_cb, SIGINT); | ||
|
||
uv_signal_init(uv_default_loop(), &sigbreak); | ||
uv_signal_start(&sigbreak, signal_cb, SIGBREAK); | ||
|
||
uv_signal_init(uv_default_loop(), &sigterm); | ||
uv_signal_start(&sigterm, signal_cb, SIGHUP); | ||
|
||
uv_run(uv_default_loop()); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters