Signed-off-by: mr-yx <496043997@qq.com>
This commit is contained in:
parent
4acf1e9f8d
commit
0164461b33
|
@ -31,7 +31,7 @@
|
||||||
#include "it_test_signal.h"
|
#include "it_test_signal.h"
|
||||||
#include "signal.h"
|
#include "signal.h"
|
||||||
|
|
||||||
static void SigHandler(int sig) // ÐźŴ¦Àí³ÌÐò
|
static void SigHandler(int sig) // źŴ
|
||||||
{
|
{
|
||||||
if (sig == SIGINT) {
|
if (sig == SIGINT) {
|
||||||
printf("SIGINT sig\n");
|
printf("SIGINT sig\n");
|
||||||
|
@ -74,8 +74,8 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("newset 1 = %x\n", newset.__bits[0]);
|
printf("newset 1 = %lx\n", newset.__bits[0]);
|
||||||
printf("old 1 = %x\n", old.__bits[0]);
|
printf("old 1 = %lx\n", old.__bits[0]);
|
||||||
|
|
||||||
retValue = sigemptyset(&newset);
|
retValue = sigemptyset(&newset);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
|
@ -89,8 +89,8 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("newset 2 = %x\n", newset.__bits[0]);
|
printf("newset 2 = %lx\n", newset.__bits[0]);
|
||||||
printf("old 2 = %x\n", old.__bits[0]);
|
printf("old 2 = %lx\n", old.__bits[0]);
|
||||||
|
|
||||||
retValue = sigemptyset(&newset);
|
retValue = sigemptyset(&newset);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
|
@ -105,8 +105,8 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("newset 1 = %x\n", newset.__bits[0]);
|
printf("newset 1 = %lx\n", newset.__bits[0]);
|
||||||
printf("old 1 = %x\n", old.__bits[0]);
|
printf("old 1 = %lx\n", old.__bits[0]);
|
||||||
|
|
||||||
retValue = sigemptyset(&wait);
|
retValue = sigemptyset(&wait);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
|
@ -116,7 +116,7 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("wait = %x\n", wait.__bits[0]);
|
printf("wait = %lx\n", wait.__bits[0]);
|
||||||
|
|
||||||
if (sigsuspend(&wait) != -1) {
|
if (sigsuspend(&wait) != -1) {
|
||||||
printf("sigsuspend error\n");
|
printf("sigsuspend error\n");
|
||||||
|
@ -126,14 +126,14 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("old 2= %x\n", old.__bits[0]);
|
printf("old 2= %lx\n", old.__bits[0]);
|
||||||
|
|
||||||
sigset_t pending;
|
sigset_t pending;
|
||||||
retValue = sigemptyset(&pending);
|
retValue = sigemptyset(&pending);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("pending 1= %x\n", pending.__bits[0]);
|
printf("pending 1= %lx\n", pending.__bits[0]);
|
||||||
retValue = raise(SIGINT);
|
retValue = raise(SIGINT);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
|
@ -142,7 +142,7 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("pending 2= %x\n", pending.__bits[0]);
|
printf("pending 2= %lx\n", pending.__bits[0]);
|
||||||
|
|
||||||
retValue = raise(SIGALRM);
|
retValue = raise(SIGALRM);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
|
@ -152,7 +152,7 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("pending 3= %x\n", pending.__bits[0]);
|
printf("pending 3= %lx\n", pending.__bits[0]);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,8 +192,8 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("new 1 = %x\n", new1.__bits[0]);
|
printf("new 1 = %lx\n", new1.__bits[0]);
|
||||||
printf("old 1 = %x\n", old1.__bits[0]);
|
printf("old 1 = %lx\n", old1.__bits[0]);
|
||||||
|
|
||||||
retValue = kill(getpid(), SIGINT);
|
retValue = kill(getpid(), SIGINT);
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
|
@ -203,7 +203,7 @@ static int TestSigSuspend()
|
||||||
if (retValue != 0) {
|
if (retValue != 0) {
|
||||||
exit(retValue);
|
exit(retValue);
|
||||||
}
|
}
|
||||||
printf("raise 1 = %x\n", new1.__bits[0]);
|
printf("raise 1 = %lx\n", new1.__bits[0]);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue