[klibc] signal handlers segfault on Fedora kernels

Kay Sievers kay.sievers at vrfy.org
Mon Mar 21 10:07:43 PST 2005


Signal handlers in a klibc compiled program are not working with
Fedora-Devel shipped kernels. Therefore a klibc udev does simply
nothing on that boxes.

This simple program segfaults if Ctrl-C is pressed. The same compiled
with glibc works as expected. Any idea what the reason for that may be?

Thanks,
Kay


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

__attribute__((__cdecl__)) static void sig_handler(int signum)
{
        return;
}

int main(int argc, char *argv[], char *envp[])
{
        struct sigaction act;

        memset(&act, 0x00, sizeof(struct sigaction));
        act.sa_handler = (void (*) (int))sig_handler;
        sigemptyset(&act.sa_mask);
        act.sa_flags = SA_RESTART;
        sigaction(SIGINT, &act, NULL);
        sigaction(SIGTERM, &act, NULL);

        sleep(100);
}




More information about the klibc mailing list