- #include <pthread.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <signal.h>
- #include <errno.h>
- /* Simple error handling functions */
- #define handle_error_en(en, msg) \
- do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0)
- int main(int ac, char *av[])
- {
- sigset_t set;
- int i;
- char buff[512];
- sigemptyset(&set);
- sigaddset(&set, SIGRTMIN+2);
- sigaddset(&set, SIGRTMIN+3);
- i = pthread_sigmask(SIG_BLOCK, &set, NULL);
- if (i != 0)
- handle_error_en(i, "pthread_sigmask() failed");
- /*
- * stupid /bin/kill in Linux cannot handle realtime signal
- * *names*, so we pass the signal number instead
- */
- (void)sleep(2);
- i = pthread_sigmask(SIG_UNBLOCK, &set, NULL);
- if (i != 0)
- handle_error_en(i, "pthread_sigmask() failed");
- /*
- * unblocking the SIGRTMIN signals will trigger the default handler for
- * the SIGRT signals, which terminates the process, so we will never reach
- * this point in the program
- */
- return EXIT_SUCCESS;
- }
CodeSys defer SIGRT*&co demo for "Rauch"
Posted by Anonymous on Thu 17th Jan 2019 08:44
raw | new post
view followups (newest first): CodeSys defer SIGRT*&co demo for Fa. "Rauch" by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.