FreeBSD Bugzilla – Attachment 182523 Details for
Bug 219228
EINTR on thread with full signal mask.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test program: compile with `cc -lthr main.c`; Send '^t^t^t^c' to observe problem.
main.c (text/x-csrc), 1.00 KB, created by
Duane
on 2017-05-12 00:44:16 UTC
(
hide
)
Description:
Test program: compile with `cc -lthr main.c`; Send '^t^t^t^c' to observe problem.
Filename:
MIME Type:
Creator:
Duane
Created:
2017-05-12 00:44:16 UTC
Size:
1.00 KB
patch
obsolete
>#include <poll.h> >#include <pthread.h> >#include <signal.h> >#include <stdio.h> >#include <string.h> >#include <unistd.h> > >pthread_t tid; > >static void * >worker(void *ud) >{ > for (;;) { > write(STDERR_FILENO, ud, 1); > int rc = poll(NULL, 0, 1000); > if (rc < 0) perror(ud); > } > return NULL; >} > >static void >handle(int signo) >{ > write(STDERR_FILENO, "HND\n", strlen("HND\n")); > pause(); >} > >static void >catch_ignore(int signo) >{ >} > >int >main(void) >{ > int rc; > sigset_t ss_block, ss_prev; > > rc = sigfillset(&ss_block); > if (rc < 0) perror(NULL); > > rc = pthread_sigmask(SIG_BLOCK,&ss_block,&ss_prev); > if (rc < 0) perror(NULL); > > rc = pthread_create(&tid, NULL, worker, "*WRK"); > if (rc < 0) perror(NULL); > > if (SIG_ERR == signal(SIGINT, catch_ignore)) { > perror(NULL); > } > > if (SIG_ERR == signal(SIGINFO, handle)) { > perror(NULL); > } > > rc = pthread_sigmask(SIG_SETMASK,&ss_prev,NULL); > if (rc < 0) perror(NULL); > > for (;;) {} > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 219228
: 182523 |
182542