Date: Wed, 5 May 2004 11:29:03 -0400 From: Mark Wolgemuth <mark@employease.com> To: cole@acenet.co.za Cc: freebsd-hackers@freebsd.org Subject: Re: SIG_IGN Message-ID: <F045D1FD-9EA8-11D8-9367-000D93C0E29E@eease.com> In-Reply-To: <200405042321.AA82575904@acenet.co.za> References: <200405042321.AA82575904@acenet.co.za>
next in thread | previous in thread | raw e-mail | index | archive | help
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
>
>
>
>
>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to
> "freebsd-hackers-unsubscribe@freebsd.org"
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F045D1FD-9EA8-11D8-9367-000D93C0E29E>
