淡定从容,宁静致远
全部博文(329)
分类: LINUX
2013-01-27 11:13:15
#include
#include
#include
#include
#include
/* $ ./sigqueue signo pid val */
int main(int argc, char **argv)
{
int ret;
int signo;
pid_t pid;
int i;
union sigval val;
if (argc != 4) {
fprintf(stderr, "argment...\n");
return 1;
}
signo = atoi(argv[1]);
pid = atoi(argv[2]);
val.sival_int = atoi(argv[3]);
printf("pid = %d\n", getpid());
for (i = 0; i < 1; i++) {
ret = sigqueue(pid, signo, val);
if (ret == -1) {
perror("kill()");
}
}
return 0;
}