Newsgroups: linux.kernel
From: Michael Kerrisk <mtk.manpa...@googlemail.com>
Date: Tue, 08 Apr 2008 23:20:11 +0200
Local: Tues, Apr 8 2008 5:20 pm
Subject: signalfd() not handling sigqueue() sigval data correctly
Hi Davide,
I was doing some playing about with signalfd(), and seem to have encountered a I've not looked into the cause of the problem, but the programs below can be Here's an example run: # Run in the background, waiting for signal 44. Could you take a look at this? Cheers, Michael /* signalfd_sigval.c */ #define _GNU_SOURCE struct signalfd_siginfo { }; static int signalfd(int ufd, sigset_t const *mask) { #define SIZEOF_SIG (_NSIG / 8) #define SIZEOF_SIGSET (SIZEOF_SIG > sizeof(sigset_t) ? \ sizeof(sigset_t): SIZEOF_SIG) return syscall(__NR_signalfd, ufd, mask, SIZEOF_SIGSET); } // #include <sys/signalfd.h> #include <signal.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0) int if (argc != 2) { printf("%s: PID = %ld\n", argv[0], (long) getpid()); sigemptyset(&mask); if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) sfd = signalfd(-1, &mask); for (;;) { printf("Got signal %d\n", fdsi.ssi_signo); } /* sigqueue.c */ #include <signal.h> #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ int if (argc != 4) { printf("%s: PID = %ld\n", argv[0], (long) getpid()); sv.sival_int = atoi(argv[3]); exit(EXIT_SUCCESS); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||