Okay, who can tell me why this code doesn't issue a SIGIO on connect?

Taral

--- cut here ---

#define _GNU_SOURCE

#include <fcntl.h>
#include <unistd.h>
#include <sys/socket.h>
#include <signal.h>

void handler(int sig, siginfo_t *si, void *arg)
{
    printf("Got signal %i. arg = %p\n",arg);
}

int main()
{
    int s = socket(AF_INET,SOCK_STREAM,0);

    int fl = fcntl(s,F_GETFL);
    fcntl(s,F_SETFL,fl|O_ASYNC);
    fcntl(s,F_SETSIG,SIGIO); // Just in case

    struct sigaction act;
    act.sa_sigaction = handler;
    act.sa_flags = SA_SIGINFO;
    sigemptyset(&act.sa_mask);

    sigaction(SIGIO,&act,NULL);

    listen(s,0);
    pause();
    return 0;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to