On May 5, 2004, at 12:21 AM, Cole wrote:

Hey

Im writing a threaded program to handle connections coming from squid. And
the program is working fine, except that i cant seem to set signal(SIGPIPE,
SIG_IGN)
It doesnt give any errors when performing that command, and then when i
check to see what SIGPIPE is set to, it apparently isnt SIG_IGN.



Are you using pthreads? Signal handling with the threads is tricky. Is SIG_IGN set before child threads are launched?
You should use the pthread interface to handle it.


    int laststate, lasttype;
    sigset_t sigs;

    sigemptyset(&sigs);
    sigaddset(&sigs, SIGPIPE);
    pthread_sigmask(SIG_BLOCK, &sigs, NULL);
    pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &laststate);



So i started to search google and i did find a page where guys had the same
problem, but that was on linux and not FreeBSD.


Im running FreeBSD 4.8-RELEASE
gcc version 2.95.4 20020320 [FreeBSD]

If anyone has any ideas please let me know.
Thanks
/Cole





_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"



_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to